@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
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# @idmission/websdk-ui
|
|
2
|
+
|
|
3
|
+
React presentation layer for the modular IDmission Web SDK 2 implementation.
|
|
4
|
+
It sits on top of `@idmission/websdk-core`, the framework-agnostic engine, and
|
|
5
|
+
owns rendered UI, theming, i18n, React bindings, and complete validation flows.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
pnpm add @idmission/websdk-core @idmission/websdk-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Peer dependencies
|
|
14
|
+
|
|
15
|
+
| Package | Version |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `react` | `^18 \|\| ^19` |
|
|
18
|
+
| `react-dom` | `^18 \|\| ^19` |
|
|
19
|
+
| `styled-components` | `^6` |
|
|
20
|
+
|
|
21
|
+
## Quickstart
|
|
22
|
+
|
|
23
|
+
For complete journeys, use `IdValidationFlow`, `FaceValidationFlow`, or
|
|
24
|
+
`IdAndFaceValidationFlow`. They validate the client session before mounting
|
|
25
|
+
camera capture, create stable capture controllers, and own final submission.
|
|
26
|
+
The combined flow snapshots ID artifacts before switching cameras, completes
|
|
27
|
+
the live check, and sends exactly one ID-and-face validation request. The
|
|
28
|
+
face-only flow intentionally stops after its live check and returns captured
|
|
29
|
+
artifacts through `onCaptured`.
|
|
30
|
+
|
|
31
|
+
For enrolled-biometrics journeys, use `CustomerIdentificationFlow` (1:N face
|
|
32
|
+
match), `CustomerVerificationFlow` (1:1 against one `submission.enrollmentId`),
|
|
33
|
+
`CustomerBiometricsEnrollmentFlow`, or
|
|
34
|
+
`CustomerIdAndBiometricsEnrollmentFlow`. The two match flows are a loop rather
|
|
35
|
+
than a wizard: they capture a selfie, optionally gate it on a live check, submit
|
|
36
|
+
it, and recapture when the customer is not confirmed live. Set
|
|
37
|
+
`useFrontendLivenessToken` to require a confirmed live face — three failed
|
|
38
|
+
checks end on the failure screen and the matching endpoint is never called.
|
|
39
|
+
|
|
40
|
+
The lower-level views remain available for custom assemblies:
|
|
41
|
+
|
|
42
|
+
`IdCaptureView` is the whole ID-capture screen: it drives the camera, guide
|
|
43
|
+
box, guidance messages, loading overlay, and review/error screens off a
|
|
44
|
+
single headless `IdCaptureController` from `@idmission/websdk-core`. The host
|
|
45
|
+
app owns creating the controller (and the `IdmissionClient`/session behind
|
|
46
|
+
it) and wrapping the tree in `ThemeProvider` — `IdCaptureView` itself renders
|
|
47
|
+
no theme, so it composes into whatever theme context the host already has.
|
|
48
|
+
i18n init is likewise host-owned: unlike sdk2 (which calls it automatically
|
|
49
|
+
at module scope), this package never calls `initializeI18n()` for you — call
|
|
50
|
+
it once, at module scope, before rendering. `IdCaptureView`'s `lang` prop
|
|
51
|
+
only switches the language afterward; it does not initialize react-i18next.
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { useMemo } from 'react'
|
|
55
|
+
import { createIdmissionClient, SubmissionAction } from '@idmission/websdk-core/client'
|
|
56
|
+
import { createIdCaptureController } from '@idmission/websdk-core/idCapture'
|
|
57
|
+
import { IdCaptureView, ThemeProvider, initializeI18n } from '@idmission/websdk-ui'
|
|
58
|
+
|
|
59
|
+
initializeI18n()
|
|
60
|
+
|
|
61
|
+
function IdCaptureScreen({ sessionId }: { sessionId: string }) {
|
|
62
|
+
const controller = useMemo(() => {
|
|
63
|
+
const client = createIdmissionClient({ sessionId })
|
|
64
|
+
return createIdCaptureController({
|
|
65
|
+
client,
|
|
66
|
+
submission: { action: SubmissionAction.VERIFY },
|
|
67
|
+
})
|
|
68
|
+
}, [sessionId])
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<ThemeProvider theme="default">
|
|
72
|
+
<IdCaptureView
|
|
73
|
+
controller={controller}
|
|
74
|
+
onExit={() => console.log('user exited capture')}
|
|
75
|
+
onSubmitted={(response) => console.log(response.status.statusCode)}
|
|
76
|
+
/>
|
|
77
|
+
</ThemeProvider>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`IdCaptureView` owns `controller.attach()`/`detach()` for its own lifetime
|
|
83
|
+
(mounting a `<video>` and attaching to it on mount, detaching on unmount —
|
|
84
|
+
safe under React StrictMode's double-invoked effects) and switches its
|
|
85
|
+
rendered screen off `controller.getState().phase`:
|
|
86
|
+
`initializing` → loading overlay, `capturing`/`requestingFlip`/
|
|
87
|
+
`requestingBetterBarcode` → camera feed + guide box + guidance, `reviewing`/
|
|
88
|
+
`uploading`/`complete` → the review screen, `error` → the error screen.
|
|
89
|
+
|
|
90
|
+
`FaceLivenessView` is the selfie/liveness analog: it drives the front camera,
|
|
91
|
+
face guide mask, guidance/challenge messages, loading overlay, and
|
|
92
|
+
success/failure screens off a headless `SelfieCaptureController` from
|
|
93
|
+
`@idmission/websdk-core/selfieCapture`. Wiring a liveness check requires
|
|
94
|
+
passing the `IdmissionClient`'s own `checkLiveness` into the controller's
|
|
95
|
+
`liveness` config — the controller calls it directly, no separate submit
|
|
96
|
+
step:
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
import { useMemo } from 'react'
|
|
100
|
+
import { createIdmissionClient } from '@idmission/websdk-core/client'
|
|
101
|
+
import { createSelfieCaptureController } from '@idmission/websdk-core/selfieCapture'
|
|
102
|
+
import { FaceLivenessView, ThemeProvider } from '@idmission/websdk-ui'
|
|
103
|
+
|
|
104
|
+
function FaceLivenessScreen({ sessionId }: { sessionId: string }) {
|
|
105
|
+
const controller = useMemo(() => {
|
|
106
|
+
const client = createIdmissionClient({ sessionId })
|
|
107
|
+
return createSelfieCaptureController({
|
|
108
|
+
liveness: { checkLiveness: (img) => client.checkLiveness(img) },
|
|
109
|
+
})
|
|
110
|
+
}, [sessionId])
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<ThemeProvider theme="default">
|
|
114
|
+
<FaceLivenessView
|
|
115
|
+
controller={controller}
|
|
116
|
+
onDone={(imageUrl) => console.log('liveness-checked selfie', imageUrl)}
|
|
117
|
+
/>
|
|
118
|
+
</ThemeProvider>
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`FaceLivenessView` shares its capture surface (camera feed, mask, guidance
|
|
124
|
+
pill, loading overlay) with the plain `SelfieCaptureView`, and adds the
|
|
125
|
+
challenge-response ladder plus full-screen success/failure screens driven by
|
|
126
|
+
the controller's liveness state — its terminal signal is `onDone`, firing
|
|
127
|
+
once with the final liveness-checked image (`skipSuccessScreen` skips the
|
|
128
|
+
success screen and fires `onDone` immediately on completion instead).
|
|
129
|
+
|
|
130
|
+
`loadingOverlayMode="ring"` pairs with `showIntroScreen` and the
|
|
131
|
+
controller's `deferCameraAcquisition: true` for a priming intro screen (an
|
|
132
|
+
explanatory page with an "Enable camera & start" button) before the camera
|
|
133
|
+
permission prompt fires, instead of requesting the camera immediately on
|
|
134
|
+
`attach()` — the same pairing `IdCaptureView`'s ring overlay uses.
|
|
135
|
+
|
|
136
|
+
## Exports
|
|
137
|
+
|
|
138
|
+
| Import | Contents |
|
|
139
|
+
| --- | --- |
|
|
140
|
+
| `@idmission/websdk-ui` | Validation flows and chassis, capture views, React bindings, theme, i18n, overlays, and the curated components used to assemble them |
|
|
141
|
+
| `@idmission/websdk-ui/testing` | Scriptable fake ID/selfie controllers and `createFakeIdmissionClient` for tests and Storybook stories |
|
|
142
|
+
|
|
143
|
+
`@idmission/websdk-ui`'s root export is a curated, named surface — never a
|
|
144
|
+
blanket `export *` — mirroring `@idmission/websdk-core/idCapture`'s barrel
|
|
145
|
+
policy. Internal helpers (e.g. the `useSyncExternalStore` listener-exception
|
|
146
|
+
guard) are deliberately not exported.
|
|
147
|
+
|
|
148
|
+
### Component surface (à la carte custom UI)
|
|
149
|
+
|
|
150
|
+
Everything `IdCaptureView` composes is independently exported, so a host that
|
|
151
|
+
needs a different screen layout — a different assembly order, extra screens
|
|
152
|
+
in between, a completely custom review step — can skip `IdCaptureView` and
|
|
153
|
+
build its own tree from the same pieces, driven by the same
|
|
154
|
+
`useIdCapture(controller)` state:
|
|
155
|
+
|
|
156
|
+
| Area | Components |
|
|
157
|
+
| --- | --- |
|
|
158
|
+
| Flows | `IdValidationFlow`, `FaceValidationFlow`, `IdAndFaceValidationFlow`, `SignatureKYCFlow`, `VideoIdValidationFlow`, `CustomerIdentificationFlow`, `CustomerVerificationFlow`, `CustomerBiometricsEnrollmentFlow`, `CustomerIdAndBiometricsEnrollmentFlow`, `FlowChassis`, `CompositeWizard` |
|
|
159
|
+
| Flow steps | `buildAdditionalDocumentsStep`, `buildSignatureStep`, `buildVideoIdSteps` — assemble a custom `CompositeWizard` step list |
|
|
160
|
+
| Match outcomes | `CustomerMatchSuccess`, `CustomerMatchFailure` |
|
|
161
|
+
| Camera | `CameraVideoTag`, `ScalingCameraFeed`, `CameraFeedWrapper`, `GuideLayoutProvider`/`useGuideLayout`, `GuideOrientationContextProvider`/`useGuideOrientationContext` |
|
|
162
|
+
| Guides | `IdCaptureGuides` (fit/overlay router), `IdCaptureFitGuide`, `IdCaptureGuideOverlay`, `FlipIdPrompt`, `defaultIdCaptureGuideImages` |
|
|
163
|
+
| Guidance | `GuidanceMessage`, `GuidanceMessageContainer` (portal), `guidanceMessageKey`/`instructionKey` |
|
|
164
|
+
| Barcode | `BarcodeGuideOverlay`, `BarcodeSuccessOverlay` |
|
|
165
|
+
| Loading | `IdCaptureLoadingOverlay`, `IdCaptureLoadingGraphic` |
|
|
166
|
+
| Review / error | `ReviewScreen`, `ErrorScreen`, `CameraAccessDeniedOverlay`, `OverrideWrongDocumentTypeDialog` |
|
|
167
|
+
| Other | `ExitCaptureButton`, `Card`/`FlexCard`, `ButtonsRow`, `LoaderButton`, `CapturedDocumentImg`, `LoadingListItemIndicator` |
|
|
168
|
+
| Shared overlay primitives | `GrayOverlayContainer`, `OverlayInner`, `ButtonsColumn`, `WideButton`, `WideBorderButton` — the styled building blocks `ReviewScreen`/`ErrorScreen` compose |
|
|
169
|
+
|
|
170
|
+
Every component takes plain props derived from `IdCaptureControllerState` (no
|
|
171
|
+
store/context reads beyond the layout contexts above) — pass
|
|
172
|
+
`controller.getState()` fields (or a `useIdCapture(controller)` /
|
|
173
|
+
`useIdCaptureSelector(controller, selector)` selection) straight through.
|
|
174
|
+
|
|
175
|
+
## Test harness
|
|
176
|
+
|
|
177
|
+
Tests run under `node:test`, not a browser test runner. Because the
|
|
178
|
+
monorepo's default `--experimental-strip-types` loader cannot parse JSX,
|
|
179
|
+
this package's `test` script instead loads files through `tsx` and boots
|
|
180
|
+
a jsdom document via `global-jsdom` before any test file runs:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
node --import tsx --import ./test/setup.ts --test 'src/**/*.test.ts' 'src/**/*.test.tsx'
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Component tests use `@testing-library/react`. Every test file that
|
|
187
|
+
renders a component must call `afterEach(cleanup)` (see
|
|
188
|
+
`src/harness.test.tsx`) to unmount between tests — jsdom's document is
|
|
189
|
+
shared process-wide across the whole test run.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { DocumentCaptureController } from '@idmission/websdk-core/documentCapture';
|
|
3
|
+
import { type CameraFeedMode } from './components/CameraFeed';
|
|
4
|
+
import { type DocumentCaptureGuideOverlayClassNames } from './components/document/DocumentCaptureGuideOverlay';
|
|
5
|
+
import type { CapturedDocument } from './components/document/types';
|
|
6
|
+
import { type CustomerSuppliedVerbiage, type LangOption } from './i18n';
|
|
7
|
+
export type DocumentCaptureViewClassNames = {
|
|
8
|
+
cameraFeedWrapper?: string;
|
|
9
|
+
cameraFeed?: string;
|
|
10
|
+
previewImage?: string;
|
|
11
|
+
captureContainer?: string;
|
|
12
|
+
headingRow?: string;
|
|
13
|
+
heading?: string;
|
|
14
|
+
guideOverlay?: DocumentCaptureGuideOverlayClassNames;
|
|
15
|
+
footerRow?: string;
|
|
16
|
+
instructions?: string;
|
|
17
|
+
tamperMessage?: string;
|
|
18
|
+
buttonsRow?: string;
|
|
19
|
+
retryCameraAccessBtn?: string;
|
|
20
|
+
retryCaptureBtn?: string;
|
|
21
|
+
uploadBtn?: string;
|
|
22
|
+
uploadProgressBtn?: string;
|
|
23
|
+
captureBtn?: string;
|
|
24
|
+
};
|
|
25
|
+
export type DocumentCaptureViewVerbiage = {
|
|
26
|
+
headingText?: CustomerSuppliedVerbiage;
|
|
27
|
+
loadingBtnText?: CustomerSuppliedVerbiage;
|
|
28
|
+
retryCameraAccessBtnText?: CustomerSuppliedVerbiage;
|
|
29
|
+
exitBtnText?: CustomerSuppliedVerbiage;
|
|
30
|
+
tamperingText?: CustomerSuppliedVerbiage;
|
|
31
|
+
captureBtnText?: CustomerSuppliedVerbiage;
|
|
32
|
+
capturingBtnText?: CustomerSuppliedVerbiage;
|
|
33
|
+
retryCaptureBtnText?: CustomerSuppliedVerbiage;
|
|
34
|
+
uploadBtnText?: CustomerSuppliedVerbiage;
|
|
35
|
+
uploadingBtnText?: CustomerSuppliedVerbiage;
|
|
36
|
+
retryUploadBtnText?: CustomerSuppliedVerbiage;
|
|
37
|
+
successBtnText?: CustomerSuppliedVerbiage;
|
|
38
|
+
};
|
|
39
|
+
export type DocumentCaptureViewProps = {
|
|
40
|
+
controller: DocumentCaptureController;
|
|
41
|
+
/** Language code used by the document-capture translations. */
|
|
42
|
+
lang?: LangOption;
|
|
43
|
+
/**
|
|
44
|
+
* Gates camera acquisition on a validated session, matching sdk2, which did
|
|
45
|
+
* not initialize documents until `sessionCheckState === 'PASSED'`
|
|
46
|
+
* (DocumentCaptureStateProvider.tsx:235-238). Uploads need a valid session,
|
|
47
|
+
* so there is no point lighting the camera before one exists.
|
|
48
|
+
*/
|
|
49
|
+
sessionReady?: boolean;
|
|
50
|
+
/** Fired once, when every document has uploaded successfully. */
|
|
51
|
+
onCompleted?: () => void;
|
|
52
|
+
/**
|
|
53
|
+
* Fires once when the controller reports `CAMERA_PERMISSION_DENIED` —
|
|
54
|
+
* sdk2's `onCameraAccessDenied`. A pure notification: the view renders its
|
|
55
|
+
* denial UI either way. Fires again only if access is later granted and
|
|
56
|
+
* then denied again.
|
|
57
|
+
*/
|
|
58
|
+
onCameraAccessDenied?: () => void;
|
|
59
|
+
/** sdk2's `onCameraTamperingDetected`, which its DocumentCapture wired
|
|
60
|
+
* through `CameraStoreProvider` (DocumentCapture.tsx:193). Fires once per
|
|
61
|
+
* detection. */
|
|
62
|
+
onCameraTamperingDetected?: () => void;
|
|
63
|
+
/** sdk2's `onExitAfterTamperSealPopped`: an exit from the tampering dead
|
|
64
|
+
* end. Bind-gated — no button unless the host wants one. */
|
|
65
|
+
onExitAfterTamperSealPopped?: () => void;
|
|
66
|
+
/**
|
|
67
|
+
* The UI half of the document config, indexed alongside the controller's
|
|
68
|
+
* items. Supplies per-document `instructions` and `cameraFeedMode`, which are
|
|
69
|
+
* React/presentation concerns and therefore never reach core.
|
|
70
|
+
*/
|
|
71
|
+
documents?: readonly CapturedDocument[];
|
|
72
|
+
/** Fallback feed mode when the current document does not specify one. */
|
|
73
|
+
cameraFeedMode?: CameraFeedMode;
|
|
74
|
+
/** Fallback guide-box aspect ratio when the current document has none. */
|
|
75
|
+
aspectRatio?: number;
|
|
76
|
+
/** Fallback instructions when the current document has none. */
|
|
77
|
+
instructions?: ReactNode;
|
|
78
|
+
classNames?: DocumentCaptureViewClassNames;
|
|
79
|
+
verbiage?: DocumentCaptureViewVerbiage;
|
|
80
|
+
};
|
|
81
|
+
/** The verbiage fallbacks, exported so the i18n parity test reads the real
|
|
82
|
+
* literals rather than a second copy that could drift from them. */
|
|
83
|
+
export declare const DOCUMENT_CAPTURE_FALLBACK_VERBIAGE: {
|
|
84
|
+
headingText: string;
|
|
85
|
+
loadingBtnText: string;
|
|
86
|
+
retryCameraAccessBtnText: string;
|
|
87
|
+
exitBtnText: string;
|
|
88
|
+
tamperingText: string;
|
|
89
|
+
captureBtnText: string;
|
|
90
|
+
capturingBtnText: string;
|
|
91
|
+
retryCaptureBtnText: string;
|
|
92
|
+
uploadBtnText: string;
|
|
93
|
+
uploadingBtnText: string;
|
|
94
|
+
retryUploadBtnText: string;
|
|
95
|
+
successBtnText: string;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Owns its own `GuideLayoutProvider`, matching IdCaptureView (:364). The guide
|
|
99
|
+
* overlay publishes the guide rect into that context and the camera feed reads
|
|
100
|
+
* it back to size itself; without a provider both sides silently fall through
|
|
101
|
+
* to the default context, whose `setGuideRect` is a no-op, and the feed
|
|
102
|
+
* collapses to 0x0 while the mask still renders — a white box where the camera
|
|
103
|
+
* should be.
|
|
104
|
+
*
|
|
105
|
+
* The provider has to sit above the component that consumes it, hence the
|
|
106
|
+
* split: a provider cannot be read by the component that renders it. Nesting
|
|
107
|
+
* inside a host-supplied provider is harmless — the inner one wins and both
|
|
108
|
+
* the overlay and the feed sit under it.
|
|
109
|
+
*/
|
|
110
|
+
export declare function DocumentCaptureView(props: DocumentCaptureViewProps): import("react/jsx-runtime").JSX.Element;
|
|
111
|
+
//# sourceMappingURL=DocumentCaptureView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentCaptureView.d.ts","sourceRoot":"","sources":["../src/DocumentCaptureView.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Rewired from sdk2's document_capture/DocumentCaptureScreen.tsx. The layout,
|
|
3
|
+
// the button branching, and every verbiage default are byte-faithful; the
|
|
4
|
+
// plumbing changes:
|
|
5
|
+
// - Screen state comes from the headless controller via `useDocumentCapture`
|
|
6
|
+
// rather than from `useDocumentCaptureState()`'s reducer context.
|
|
7
|
+
// - The guide rect is read from GuideLayoutContext, which the overlay
|
|
8
|
+
// publishes into, instead of from `rectX`/`rectY`/`rectOffsetTop` on the
|
|
9
|
+
// capture state. See DocumentCaptureGuideOverlay's header.
|
|
10
|
+
// - `requestCameraAccess()` is the controller's `actions.requestCamera()`;
|
|
11
|
+
// the auto-request effect keeps sdk2's condition (:83-96) verbatim.
|
|
12
|
+
import { useEffect, useRef } from 'react';
|
|
13
|
+
import { styled, useTheme } from 'styled-components';
|
|
14
|
+
import { useDocumentCapture } from './bindings/useDocumentCapture';
|
|
15
|
+
import { CameraFeedWrapper, CameraVideoTag, } from './components/CameraFeed';
|
|
16
|
+
import { ButtonsRow } from './components/common/ButtonsRow';
|
|
17
|
+
import { LoaderButton } from './components/common/LoaderButton';
|
|
18
|
+
import { DocumentCaptureGuideOverlay, } from './components/document/DocumentCaptureGuideOverlay';
|
|
19
|
+
import { GuideLayoutProvider, useGuideLayout } from './layout/GuideLayoutContext';
|
|
20
|
+
import { useLanguage, useTranslations, } from './i18n';
|
|
21
|
+
import { useSessionReady } from './flows/AuthStateContext';
|
|
22
|
+
/** The verbiage fallbacks, exported so the i18n parity test reads the real
|
|
23
|
+
* literals rather than a second copy that could drift from them. */
|
|
24
|
+
export const DOCUMENT_CAPTURE_FALLBACK_VERBIAGE = {
|
|
25
|
+
headingText: 'Document Capture',
|
|
26
|
+
loadingBtnText: 'Camera initializing...',
|
|
27
|
+
retryCameraAccessBtnText: 'Retry',
|
|
28
|
+
exitBtnText: 'Exit',
|
|
29
|
+
tamperingText: 'Camera tampering detected',
|
|
30
|
+
captureBtnText: 'Capture',
|
|
31
|
+
capturingBtnText: 'Capturing...',
|
|
32
|
+
retryCaptureBtnText: 'Retry capture',
|
|
33
|
+
uploadBtnText: 'Upload',
|
|
34
|
+
uploadingBtnText: 'Uploading...',
|
|
35
|
+
retryUploadBtnText: 'Retry',
|
|
36
|
+
successBtnText: 'Upload succeeded!',
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Owns its own `GuideLayoutProvider`, matching IdCaptureView (:364). The guide
|
|
40
|
+
* overlay publishes the guide rect into that context and the camera feed reads
|
|
41
|
+
* it back to size itself; without a provider both sides silently fall through
|
|
42
|
+
* to the default context, whose `setGuideRect` is a no-op, and the feed
|
|
43
|
+
* collapses to 0x0 while the mask still renders — a white box where the camera
|
|
44
|
+
* should be.
|
|
45
|
+
*
|
|
46
|
+
* The provider has to sit above the component that consumes it, hence the
|
|
47
|
+
* split: a provider cannot be read by the component that renders it. Nesting
|
|
48
|
+
* inside a host-supplied provider is harmless — the inner one wins and both
|
|
49
|
+
* the overlay and the feed sit under it.
|
|
50
|
+
*/
|
|
51
|
+
export function DocumentCaptureView(props) {
|
|
52
|
+
return (_jsx(GuideLayoutProvider, { children: _jsx(DocumentCaptureSurface, { ...props }) }));
|
|
53
|
+
}
|
|
54
|
+
function DocumentCaptureSurface({ controller, lang = 'auto', sessionReady: sessionReadyProp, onCompleted, onCameraAccessDenied, onCameraTamperingDetected, onExitAfterTamperSealPopped, documents, cameraFeedMode, aspectRatio, instructions, classNames = {}, verbiage: rawVerbiage = {}, }) {
|
|
55
|
+
// Omitted means "follow the session": mounted inside a flow this view now
|
|
56
|
+
// renders during session validation, so its own loading overlay is the one
|
|
57
|
+
// loading surface (2.x behaviour — see useSessionReady). An explicit prop
|
|
58
|
+
// still wins, which is what Storybook and the headless demo pass.
|
|
59
|
+
const sessionFromContext = useSessionReady();
|
|
60
|
+
const sessionReady = sessionReadyProp ?? sessionFromContext;
|
|
61
|
+
useLanguage(lang);
|
|
62
|
+
const state = useDocumentCapture(controller);
|
|
63
|
+
const videoRef = useRef(null);
|
|
64
|
+
const { guideRect } = useGuideLayout();
|
|
65
|
+
const theme = useTheme();
|
|
66
|
+
const entry = state.documents[state.currentIndex];
|
|
67
|
+
const uiDocument = documents?.[state.currentIndex];
|
|
68
|
+
const cameraCaptureRequired = !uiDocument?.content;
|
|
69
|
+
const contentUrl = entry?.contentUrl ?? null;
|
|
70
|
+
const uploadState = entry?.uploadState ?? 'not_started';
|
|
71
|
+
const autoUploadStarted = useRef(new Set());
|
|
72
|
+
const autoUploadIndex = sessionReady &&
|
|
73
|
+
uiDocument?.content &&
|
|
74
|
+
entry?.content &&
|
|
75
|
+
uploadState === 'not_started'
|
|
76
|
+
? state.currentIndex
|
|
77
|
+
: null;
|
|
78
|
+
// sdk2 defaults this twice with different precedence
|
|
79
|
+
// (DocumentCaptureStateProvider.tsx:242-257): caller-supplied documents get
|
|
80
|
+
// the literal 'snapToGuides' and IGNORE the top-level prop, while the
|
|
81
|
+
// synthesized single-document fallback honours it. It reads like a bug and is
|
|
82
|
+
// preserved deliberately — existing integrations depend on it, and this repo
|
|
83
|
+
// has been bitten four times by "tidying" a cascade default.
|
|
84
|
+
const resolvedFeedMode = documents?.length
|
|
85
|
+
? (uiDocument?.cameraFeedMode ?? 'snapToGuides')
|
|
86
|
+
: (cameraFeedMode ?? 'snapToGuides');
|
|
87
|
+
const resolvedAspectRatio = entry?.item.aspectRatio ?? aspectRatio;
|
|
88
|
+
const resolvedInstructions = uiDocument?.instructions ?? instructions;
|
|
89
|
+
const verbiage = useTranslations(rawVerbiage, {
|
|
90
|
+
...DOCUMENT_CAPTURE_FALLBACK_VERBIAGE,
|
|
91
|
+
headingText: entry?.item.title ?? DOCUMENT_CAPTURE_FALLBACK_VERBIAGE.headingText,
|
|
92
|
+
});
|
|
93
|
+
const maskColor = theme.documentCapture?.guideBox?.maskColor ??
|
|
94
|
+
(resolvedFeedMode === 'snapToGuides' ? '#708090' : 'rgba(0, 0, 0, 0.5)');
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
const video = videoRef.current;
|
|
97
|
+
if (!video || !sessionReady || !cameraCaptureRequired)
|
|
98
|
+
return;
|
|
99
|
+
void controller.attach(video).catch(() => {
|
|
100
|
+
// The controller publishes its typed error onto state for the view.
|
|
101
|
+
});
|
|
102
|
+
return () => controller.detach();
|
|
103
|
+
}, [cameraCaptureRequired, controller, sessionReady]);
|
|
104
|
+
// sdk2 uploads caller-supplied content during document initialization. This
|
|
105
|
+
// runs in the view because the view is mounted behind FlowChassis's auth
|
|
106
|
+
// gate; starting it from the outer flow would race session validation.
|
|
107
|
+
useEffect(() => {
|
|
108
|
+
if (autoUploadIndex === null ||
|
|
109
|
+
autoUploadStarted.current.has(autoUploadIndex)) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
autoUploadStarted.current.add(autoUploadIndex);
|
|
113
|
+
void controller.actions.upload();
|
|
114
|
+
}, [autoUploadIndex, controller]);
|
|
115
|
+
// sdk2's requestCameraAccessIfNeeded (:83-96): force the browser prompt when
|
|
116
|
+
// we are not mid-upload, the caller supplied no blob, and we have no camera.
|
|
117
|
+
const cameraAccessNeeded = sessionReady &&
|
|
118
|
+
uploadState === 'not_started' &&
|
|
119
|
+
!entry?.content &&
|
|
120
|
+
!state.camera.accessRequested &&
|
|
121
|
+
!state.camera.ready;
|
|
122
|
+
useEffect(() => {
|
|
123
|
+
if (!cameraAccessNeeded)
|
|
124
|
+
return;
|
|
125
|
+
void controller.actions.requestCamera();
|
|
126
|
+
}, [cameraAccessNeeded, controller]);
|
|
127
|
+
// Completion is derived rather than event-driven so it survives a remount:
|
|
128
|
+
// the ref only stops it firing twice within one mount.
|
|
129
|
+
const everyUploaded = state.documents.length > 0 &&
|
|
130
|
+
state.documents.every((doc) => doc.uploadState === 'succeeded');
|
|
131
|
+
const completedRef = useRef(false);
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (!everyUploaded || completedRef.current)
|
|
134
|
+
return;
|
|
135
|
+
completedRef.current = true;
|
|
136
|
+
onCompleted?.();
|
|
137
|
+
}, [everyUploaded, onCompleted]);
|
|
138
|
+
const cameraAccessDenied = state.error?.code === 'CAMERA_PERMISSION_DENIED';
|
|
139
|
+
const cameraTampered = state.error?.code === 'CAMERA_TAMPERING_SUSPECTED';
|
|
140
|
+
// Latched like the completion effect above: a notification per denial or
|
|
141
|
+
// detection, not per render.
|
|
142
|
+
const deniedReportedRef = useRef(false);
|
|
143
|
+
useEffect(() => {
|
|
144
|
+
if (!cameraAccessDenied) {
|
|
145
|
+
deniedReportedRef.current = false;
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (deniedReportedRef.current)
|
|
149
|
+
return;
|
|
150
|
+
deniedReportedRef.current = true;
|
|
151
|
+
onCameraAccessDenied?.();
|
|
152
|
+
}, [cameraAccessDenied, onCameraAccessDenied]);
|
|
153
|
+
const tamperReportedRef = useRef(false);
|
|
154
|
+
useEffect(() => {
|
|
155
|
+
if (!cameraTampered) {
|
|
156
|
+
tamperReportedRef.current = false;
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (tamperReportedRef.current)
|
|
160
|
+
return;
|
|
161
|
+
tamperReportedRef.current = true;
|
|
162
|
+
onCameraTamperingDetected?.();
|
|
163
|
+
}, [cameraTampered, onCameraTamperingDetected]);
|
|
164
|
+
return (_jsxs(_Fragment, { children: [_jsxs(CameraFeedWrapper, { className: classNames.cameraFeedWrapper, "$mode": resolvedFeedMode, "$x": guideRect?.x ?? 0, "$y": guideRect?.y ?? 0, "$w": guideRect?.width ?? 0, "$h": guideRect?.height ?? 0, children: [_jsx(CameraVideoTag, { ref: videoRef, className: classNames.cameraFeed, isRearFacing: state.camera.isRearFacing }), contentUrl && (_jsx(PreviewImage, { alt: "", src: contentUrl, className: classNames.previewImage }))] }), _jsxs(CaptureContainer, { className: classNames.captureContainer, children: [_jsx(HeadingRow, { "$maskColor": maskColor, className: classNames.headingRow, children: _jsx(Heading, { className: classNames.heading, children: verbiage.headingText }) }), _jsx(DocumentCaptureGuideOverlay, { aspectRatio: resolvedAspectRatio, maskColor: maskColor, classNames: classNames.guideOverlay }), _jsxs(FooterRow, { "$maskColor": maskColor, className: classNames.footerRow, children: [resolvedInstructions && (_jsx(Instructions, { className: classNames.instructions, children: resolvedInstructions })), cameraTampered && (_jsx(Instructions, { className: classNames.tamperMessage, children: verbiage.tamperingText })), _jsx(StyledButtonsRow, { className: classNames.buttonsRow, children: cameraTampered ? (onExitAfterTamperSealPopped ? (_jsx(LoaderButton, { className: classNames.retryCameraAccessBtn, variant: "negative", finished: true, onClick: onExitAfterTamperSealPopped, children: verbiage.exitBtnText })) : null) : cameraAccessDenied ? (_jsx(LoaderButton, { className: classNames.retryCameraAccessBtn, variant: "negative", finished: true, onClick: () => void controller.actions.requestCamera(), children: verbiage.retryCameraAccessBtnText })) : contentUrl ? (uploadState === 'not_started' ? (_jsxs(_Fragment, { children: [_jsx(LoaderButton, { className: classNames.retryCaptureBtn, finished: true, variant: "warning", onClick: () => controller.actions.retry(), children: verbiage.retryCaptureBtnText }), _jsx(LoaderButton, { className: classNames.uploadBtn, finished: true, variant: "positive", onClick: () => void controller.actions.upload(), children: verbiage.uploadBtnText })] })) : (_jsx(LoaderButton, { className: classNames.uploadProgressBtn, finished: uploadState !== 'in_progress', variant: uploadState === 'failed' ? 'negative' : 'positive', onClick: () => void controller.actions.upload(), disabled: uploadState === 'in_progress' ||
|
|
165
|
+
uploadState === 'succeeded', children: uploadState === 'succeeded'
|
|
166
|
+
? verbiage.successBtnText
|
|
167
|
+
: uploadState === 'failed'
|
|
168
|
+
? verbiage.retryUploadBtnText
|
|
169
|
+
: verbiage.uploadingBtnText }))) : (_jsx(LoaderButton, { className: classNames.captureBtn, finished: state.camera.ready, variant: "primary",
|
|
170
|
+
// Guarded rather than relying on `disabled` alone: with
|
|
171
|
+
// `finished` false, LoaderButton hands the element to ladda,
|
|
172
|
+
// which manipulates its disabled state imperatively
|
|
173
|
+
// (LoaderButton.tsx:63-79). The button can therefore be
|
|
174
|
+
// clickable mid-animation, which CI caught.
|
|
175
|
+
onClick: () => {
|
|
176
|
+
if (!state.camera.ready || state.capturing)
|
|
177
|
+
return;
|
|
178
|
+
void controller.actions.capture();
|
|
179
|
+
}, disabled: !state.camera.ready || state.capturing, children: !state.camera.ready
|
|
180
|
+
? verbiage.loadingBtnText
|
|
181
|
+
: state.capturing
|
|
182
|
+
? verbiage.capturingBtnText
|
|
183
|
+
: verbiage.captureBtnText })) })] })] })] }));
|
|
184
|
+
}
|
|
185
|
+
const CaptureContainer = styled.div `
|
|
186
|
+
display: flex;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
position: absolute;
|
|
189
|
+
top: 0;
|
|
190
|
+
left: 0;
|
|
191
|
+
width: 100%;
|
|
192
|
+
height: 100%;
|
|
193
|
+
`;
|
|
194
|
+
const HeadingRow = styled.div `
|
|
195
|
+
background: ${(props) => props.$maskColor};
|
|
196
|
+
text-align: center;
|
|
197
|
+
color: white;
|
|
198
|
+
`;
|
|
199
|
+
const Heading = styled.h1 `
|
|
200
|
+
font-size: 22px;
|
|
201
|
+
`;
|
|
202
|
+
const FooterRow = styled.div `
|
|
203
|
+
background: ${(props) => props.$maskColor};
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
justify-content: center;
|
|
207
|
+
padding: 0 20px 20px;
|
|
208
|
+
height: auto;
|
|
209
|
+
color: white;
|
|
210
|
+
`;
|
|
211
|
+
const Instructions = styled.div `
|
|
212
|
+
max-height: ${(props) => props.theme.documentCapture?.instructions?.maxHeight ?? '8rem'};
|
|
213
|
+
overflow-y: auto;
|
|
214
|
+
`;
|
|
215
|
+
const StyledButtonsRow = styled(ButtonsRow) `
|
|
216
|
+
padding-top: 20px;
|
|
217
|
+
`;
|
|
218
|
+
// Layered over the still-mounted camera feed rather than replacing it.
|
|
219
|
+
const PreviewImage = styled.img `
|
|
220
|
+
position: absolute;
|
|
221
|
+
inset: 0;
|
|
222
|
+
width: 100%;
|
|
223
|
+
height: 100%;
|
|
224
|
+
object-fit: cover;
|
|
225
|
+
`;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ReactElement, type RefObject } from 'react';
|
|
2
|
+
import { type CustomerSuppliedVerbiage } from './i18n';
|
|
3
|
+
import { type SelfieCaptureViewAssets, type SelfieCaptureViewColors, type SelfieCaptureViewClassNames, type SelfieCaptureViewProps, type SelfieCaptureViewVerbiage } from './SelfieCaptureView';
|
|
4
|
+
import { type FaceLivenessSuccessClassNames, type FaceLivenessSuccessColors, type FaceLivenessSuccessVerbiage } from './components/face_liveness/FaceLivenessSuccess';
|
|
5
|
+
import { type FaceLivenessFailureAssets, type FaceLivenessFailureClassNames, type FaceLivenessFailureColors, type FaceLivenessFailureVerbiage } from './components/face_liveness/FaceLivenessFailure';
|
|
6
|
+
export type FaceLivenessGuidanceVerbiage = {
|
|
7
|
+
guidanceLivenessCheckFailedText?: CustomerSuppliedVerbiage;
|
|
8
|
+
guidanceLivenessCheckErrorText?: CustomerSuppliedVerbiage;
|
|
9
|
+
guidanceRemoveEyeCoveringsText?: CustomerSuppliedVerbiage;
|
|
10
|
+
guidanceRemoveHeadCoveringsText?: CustomerSuppliedVerbiage;
|
|
11
|
+
guidanceRemoveMaskText?: CustomerSuppliedVerbiage;
|
|
12
|
+
guidanceValidatingText?: CustomerSuppliedVerbiage;
|
|
13
|
+
challengeTurnLeftText?: CustomerSuppliedVerbiage;
|
|
14
|
+
challengeTurnRightText?: CustomerSuppliedVerbiage;
|
|
15
|
+
challengeBlinkText?: CustomerSuppliedVerbiage;
|
|
16
|
+
challengeBlinkTwiceText?: CustomerSuppliedVerbiage;
|
|
17
|
+
challengeReturnToCenterText?: CustomerSuppliedVerbiage;
|
|
18
|
+
challengeTimeoutText?: CustomerSuppliedVerbiage;
|
|
19
|
+
};
|
|
20
|
+
export type FaceLivenessViewVerbiage = SelfieCaptureViewVerbiage & {
|
|
21
|
+
liveness?: FaceLivenessGuidanceVerbiage;
|
|
22
|
+
success?: FaceLivenessSuccessVerbiage;
|
|
23
|
+
failure?: FaceLivenessFailureVerbiage;
|
|
24
|
+
};
|
|
25
|
+
export type FaceLivenessViewClassNames = SelfieCaptureViewClassNames & {
|
|
26
|
+
success?: FaceLivenessSuccessClassNames;
|
|
27
|
+
failure?: FaceLivenessFailureClassNames;
|
|
28
|
+
};
|
|
29
|
+
export type FaceLivenessViewAssets = SelfieCaptureViewAssets & {
|
|
30
|
+
failure?: FaceLivenessFailureAssets;
|
|
31
|
+
};
|
|
32
|
+
/** sdk2's `FaceLivenessColors`: the surface's bag plus the two terminal screens. */
|
|
33
|
+
export type FaceLivenessViewColors = SelfieCaptureViewColors & {
|
|
34
|
+
success?: FaceLivenessSuccessColors;
|
|
35
|
+
failure?: FaceLivenessFailureColors;
|
|
36
|
+
};
|
|
37
|
+
export type FaceLivenessViewProps = Omit<SelfieCaptureViewProps, 'onCaptured'> & {
|
|
38
|
+
/** Fires with the final (liveness-checked) image URL when the user clicks
|
|
39
|
+
* Done on the success screen -- or immediately on entering 'completed',
|
|
40
|
+
* exactly once, when `skipSuccessScreen` is true. */
|
|
41
|
+
onDone?: (imageUrl: string) => void;
|
|
42
|
+
/** When true, FaceLivenessSuccess never renders -- `onDone` fires as soon
|
|
43
|
+
* as `state.phase` becomes 'completed' instead. Default false. */
|
|
44
|
+
skipSuccessScreen?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* How many times the lockout screen offers a fresh start, each granting a
|
|
47
|
+
* whole new set of liveness attempts (sdk2 FaceLivenessWizard's `maxRetries`,
|
|
48
|
+
* default 2). Any value <= 0 offers no retries -- `-1` hides the Retry button
|
|
49
|
+
* outright, and `0` leaves `retryCount < maxRetries` false from the start, so
|
|
50
|
+
* it is hidden too. This is the OUTER budget;
|
|
51
|
+
* the inner per-run one is core's ALLOWED_LIVENESS_FAILURES.
|
|
52
|
+
*/
|
|
53
|
+
maxRetries?: number;
|
|
54
|
+
/** Continues with the captured selfie after terminal liveness denial/timeout. */
|
|
55
|
+
allowLivenessFailure?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Exit from the lockout/failure screen, distinct from the in-capture `onExit`
|
|
58
|
+
* — sdk2 splits these too (`onExitCapture` vs `onExitAfterFailure`,
|
|
59
|
+
* FaceLivenessWizard.tsx:118-119, wired to :483 and :529 respectively).
|
|
60
|
+
* Defaults to `onExit`, so a host that binds only `onExit` keeps today's
|
|
61
|
+
* behaviour exactly.
|
|
62
|
+
*
|
|
63
|
+
* Unlike sdk2's, this takes no arguments: the liveness response/request pair
|
|
64
|
+
* sdk2 passes is not exposed by the current client/controller and remains a
|
|
65
|
+
* separate recorded divergence.
|
|
66
|
+
*/
|
|
67
|
+
onExitAfterFailure?: () => void;
|
|
68
|
+
/**
|
|
69
|
+
* Fires when a whole capture run restarts — from the lockout screen's Retry
|
|
70
|
+
* or the success screen's redo, both of which spend an outer retry. Ports
|
|
71
|
+
* sdk2's `onRetry` (PR #279), which fed `capture.retried`.
|
|
72
|
+
*
|
|
73
|
+
* `attempt` is the number of the run being STARTED, 1-based, so the first
|
|
74
|
+
* retry reports 2. Matches sdk2's `retryCount + 2`
|
|
75
|
+
* (FaceLivenessWizard.tsx:403).
|
|
76
|
+
*/
|
|
77
|
+
onRetry?: (attempt: number) => void;
|
|
78
|
+
colors?: FaceLivenessViewColors;
|
|
79
|
+
/** Reuses a video element owned by a parent multi-stage flow. */
|
|
80
|
+
videoRef?: RefObject<HTMLVideoElement | null>;
|
|
81
|
+
/** False when a parent multi-stage flow renders the shared camera feed. */
|
|
82
|
+
renderCameraFeed?: boolean;
|
|
83
|
+
verbiage?: FaceLivenessViewVerbiage;
|
|
84
|
+
classNames?: FaceLivenessViewClassNames;
|
|
85
|
+
assets?: FaceLivenessViewAssets;
|
|
86
|
+
};
|
|
87
|
+
export declare function FaceLivenessView({ controller, loadingOverlayMode, sessionReady: sessionReadyProp, lang, autoContinueAfterLoading, showIntroScreen, transitionFromIdCapture, debugMode, showFaceLandmarks, debugShowSamplePoints, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, onCameraAccessDenied, onModelError, onCameraTamperingDetected, onExitAfterTamperSealPopped, onUserCancel, customOverlayContent, allowManualSelfieCaptureOnLoadingError, onExit, onExitAfterFailure, onRetry, onDone, skipSuccessScreen, maxRetries, allowLivenessFailure, videoRef, renderCameraFeed, renderFaceGuide, verbiage, classNames, colors, assets, }: FaceLivenessViewProps): ReactElement;
|
|
88
|
+
//# sourceMappingURL=FaceLivenessView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FaceLivenessView.d.ts","sourceRoot":"","sources":["../src/FaceLivenessView.tsx"],"names":[],"mappings":"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"}
|