@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,454 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
// Task 12: the phase-switched assembly. Everything Tasks 2-11 built (the
|
|
3
|
+
// headless controller + bindings, layout contexts, camera feed, guidance
|
|
4
|
+
// pills, guide router, loading overlay family, review/error screens) is
|
|
5
|
+
// composed here into one component — the UI-package analog of sdk2's
|
|
6
|
+
// IdCaptureWizard.tsx (assembly order below mirrors :1452-1596, see
|
|
7
|
+
// task-12-report.md for the line-by-line comparison).
|
|
8
|
+
//
|
|
9
|
+
// Divergence from a literal wizard port (documented, not accidental):
|
|
10
|
+
// - sdk2's wizard has no unified "phase" — it branches on captureState +
|
|
11
|
+
// submissionStatus + a scatter of boolean flags across ~150 lines.
|
|
12
|
+
// Core's `CapturePhase` (idCapture/phase.ts) already collapses that into
|
|
13
|
+
// one union; this view switches on it directly instead of re-deriving
|
|
14
|
+
// the same branches sdk2's wizard hand-rolled.
|
|
15
|
+
// - The single guidance pill (sdk2 PR #254: one held code drives the
|
|
16
|
+
// pill's text AND background, IdCapture.tsx:279-330) only renders during
|
|
17
|
+
// phase 'capturing'. sdk2 gates it on `overlayDismissed && captureState
|
|
18
|
+
// === 'capturing'` (the pill lives inside sdk2's `<IdCapture>`, wizard
|
|
19
|
+
// :1456-1468) OR 'requestingBetterBarcode' — but the barcode branch's
|
|
20
|
+
// "recapture message" is a DIFFERENT standalone live element in sdk2
|
|
21
|
+
// (wizard :1470-1490), and this package's IdCaptureGuides router already
|
|
22
|
+
// folds that exact message into BarcodeGuideOverlay's own
|
|
23
|
+
// `instructionText` for 'requestingBetterBarcode' (see
|
|
24
|
+
// IdCaptureGuides.tsx's divergence-6 comment) — showing the held pill
|
|
25
|
+
// too during that phase would be a second, redundant "recapture
|
|
26
|
+
// message". 'requestingFlip' shows neither (no live detection guidance
|
|
27
|
+
// while flip art is up, matching sdk2: IdCapture never mounts during
|
|
28
|
+
// requestingFlip either).
|
|
29
|
+
// - sdk2's `customOverlayContent` and loading lifecycle callbacks are
|
|
30
|
+
// explicit view seams because hosts use them to coordinate loading chrome
|
|
31
|
+
// outside the SDK. `separateIdCardCaptureSequence` is represented by the
|
|
32
|
+
// `flipReview` prop instead of a controller-level auto-timer setting
|
|
33
|
+
// (core's own `flipConfirmation: 'manual'` config knob is the
|
|
34
|
+
// controller-side equivalent — see controller.ts). ExitCaptureButton only
|
|
35
|
+
// renders when the host passes `onExit`; an inert X button would be worse
|
|
36
|
+
// than none.
|
|
37
|
+
import { useCallback, useEffect, useRef, useState, } from 'react';
|
|
38
|
+
import { styled } from 'styled-components';
|
|
39
|
+
import { useTranslation } from 'react-i18next';
|
|
40
|
+
import { useIdCapture } from './bindings/useIdCapture';
|
|
41
|
+
import { useLanguage } from './i18n';
|
|
42
|
+
import { GuideLayoutProvider, useGuideLayout } from './layout/GuideLayoutContext';
|
|
43
|
+
import GuideOrientationContextProvider from './layout/GuideOrientationContext';
|
|
44
|
+
import { ScalingCameraFeed } from './components/CameraFeed';
|
|
45
|
+
import { DebugBoundingBoxOverlay, DebugStatsPane, IdCaptureDetectedObjectDebugBox, useDebugScalingDetails, } from './components/debug/debug';
|
|
46
|
+
import { IdCaptureGuides, } from './components/guides/IdCaptureGuides';
|
|
47
|
+
import { GuidanceMessage, GuidanceMessageContainer } from './components/GuidanceMessage';
|
|
48
|
+
import { guidanceMessageKey } from './guidance/strings';
|
|
49
|
+
import { ExitCaptureButton } from './components/ExitCaptureButton';
|
|
50
|
+
import { OverrideWrongDocumentTypeDialog, } from './components/OverrideWrongDocumentTypeDialog';
|
|
51
|
+
import { IdCaptureLoadingOverlay, } from './components/loading/IdCaptureLoadingOverlay';
|
|
52
|
+
import { ReviewScreen, } from './components/review/ReviewScreen';
|
|
53
|
+
import { ErrorScreen, } from './components/error/ErrorScreen';
|
|
54
|
+
import { IdCaptureFallback, } from './components/fallback/IdCaptureFallback';
|
|
55
|
+
import { IdCaptureOrUploadScreen, } from './components/fallback/IdCaptureOrUploadScreen';
|
|
56
|
+
import { useShowSuccessScreen, } from './flows/useShowSuccessScreen';
|
|
57
|
+
import { useSessionReady } from './flows/AuthStateContext';
|
|
58
|
+
// Unlike SelfieCaptureView/FaceLivenessView, this view has no root
|
|
59
|
+
// container of its own -- ScalingCameraFeed/IdCaptureGuides/etc. render as
|
|
60
|
+
// siblings relying on whatever positioned ancestor the host page provides.
|
|
61
|
+
// sdk2 applied theme.fontFamily at the flow-level SdkPage wrapper
|
|
62
|
+
// (SdkPage.tsx:59, `font-family: ${props.theme.fontFamily}` when set) --
|
|
63
|
+
// SdkPage itself is flow-level and was never ported to this package. This
|
|
64
|
+
// minimal wrapper carries the same conditional font-family without adding a
|
|
65
|
+
// layout box of its own: `display: contents` makes it invisible to layout/
|
|
66
|
+
// positioning (absolutely positioned descendants still resolve their
|
|
67
|
+
// containing block against whatever ancestor the host provides, exactly as
|
|
68
|
+
// before this wrapper existed) while font-family -- an inherited CSS
|
|
69
|
+
// property -- still cascades to every descendant.
|
|
70
|
+
const FontCarrier = styled.div `
|
|
71
|
+
display: contents;
|
|
72
|
+
${(props) => (props.theme?.fontFamily ? `font-family: ${props.theme.fontFamily};` : '')}
|
|
73
|
+
`;
|
|
74
|
+
// Phases where IdCaptureGuides (the visual guide box / barcode overlay
|
|
75
|
+
// router) renders. 'requestingFlip' is excluded when `flipReview` swaps it
|
|
76
|
+
// for the ReviewScreen interstitial instead (see render below).
|
|
77
|
+
const GUIDE_PHASES = new Set([
|
|
78
|
+
'capturing',
|
|
79
|
+
'requestingBetterBarcode',
|
|
80
|
+
'requestingFlip',
|
|
81
|
+
]);
|
|
82
|
+
// Phases where ReviewScreen renders (the flip interstitial, when enabled,
|
|
83
|
+
// joins this set below via `isFlipInterstitial`).
|
|
84
|
+
const REVIEW_PHASES = new Set([
|
|
85
|
+
'reviewing',
|
|
86
|
+
'uploading',
|
|
87
|
+
'complete',
|
|
88
|
+
]);
|
|
89
|
+
export function IdCaptureView({ controller, guideType = 'fit', loadingOverlayMode = 'default', cameraFeedMode = 'snapToGuides', guideBoxDisabled = false, forceFallbackMode = false, silentFallback = false, allowUploadingDocumentsFromStorage = false, portraitGuidesOnMobile = true, rotateLoadingOverlayImageWhenPortrait = true, guideBoxFollowsMask = false, flipReview = false, sessionReady: sessionReadyProp, skipSuccessScreen = false, lang = 'auto', autoContinueAfterLoading = false, showIntroScreen = false, debugMode = false, onExit, onUserCancel, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, customOverlayContent, instructions, onCameraTamperingDetected, onCameraAccessDenied, onModelError, onExitAfterTamperSealPopped, onDocumentStored, onRetry, onSubmitted, onCollected, verbiage = {}, classNames = {}, colors = {}, assets = {}, }) {
|
|
90
|
+
// Omitted means "follow the session": mounted inside a flow this view now
|
|
91
|
+
// renders during session validation, so its own loading overlay is the one
|
|
92
|
+
// loading surface (2.x behaviour — see useSessionReady). An explicit prop
|
|
93
|
+
// still wins, which is what Storybook and the headless demo pass.
|
|
94
|
+
const sessionFromContext = useSessionReady();
|
|
95
|
+
const sessionReady = sessionReadyProp ?? sessionFromContext;
|
|
96
|
+
useLanguage(lang);
|
|
97
|
+
const { t } = useTranslation();
|
|
98
|
+
const state = useIdCapture(controller);
|
|
99
|
+
// Ref-callback + an effect keyed only on [controller]: the ref callback
|
|
100
|
+
// (fired during React's commit phase, before effects) populates
|
|
101
|
+
// `videoElRef` synchronously; by the time this effect body runs the video
|
|
102
|
+
// element already exists for every phase this view mounts it in (see
|
|
103
|
+
// ScalingCameraFeed below — CameraFeed.test.tsx confirms it renders in
|
|
104
|
+
// every phase except reviewing/uploading/complete, and controller state
|
|
105
|
+
// starts 'initializing'). `.catch(() => {})` the attach promise: the
|
|
106
|
+
// dual-truth contract (controller.ts:1454-1466, mirrored by the fake)
|
|
107
|
+
// already lands the SAME error on `state.error`/`state.phase === 'error'`,
|
|
108
|
+
// so there is nothing further for the view to do with the rejection
|
|
109
|
+
// itself — letting it go unhandled would fail StrictMode/production alike
|
|
110
|
+
// with an unhandledrejection. Capture start is deferred so this view's
|
|
111
|
+
// loading/consent overlay remains a hard boundary around frame processing.
|
|
112
|
+
const videoElRef = useRef(null);
|
|
113
|
+
const setVideoRef = useCallback((node) => {
|
|
114
|
+
videoElRef.current = node;
|
|
115
|
+
}, []);
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
const el = videoElRef.current;
|
|
118
|
+
if (!el)
|
|
119
|
+
return;
|
|
120
|
+
controller.attach(el, { deferCaptureStart: true }).catch(() => { });
|
|
121
|
+
return () => {
|
|
122
|
+
controller.detach();
|
|
123
|
+
};
|
|
124
|
+
}, [controller]);
|
|
125
|
+
// sdk2 wizard pattern (:1446-1450, :1527-1552): the loading overlay is
|
|
126
|
+
// view-local state, not derived from controller phase — it stays up until
|
|
127
|
+
// BOTH models+camera are ready (IdCaptureLoadingOverlay's own `ready`
|
|
128
|
+
// gate, which controls whether its Continue button even renders) AND the
|
|
129
|
+
// user clicks that Continue button (`onDismissed`). A fresh controller
|
|
130
|
+
// means a fresh session, so this resets alongside the attach effect above.
|
|
131
|
+
const [overlayDismissed, setOverlayDismissed] = useState(false);
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
setOverlayDismissed(false);
|
|
134
|
+
}, [controller]);
|
|
135
|
+
const handleLoadingOverlayDismissed = useCallback(() => {
|
|
136
|
+
setOverlayDismissed(true);
|
|
137
|
+
controller.actions.start();
|
|
138
|
+
onLoadingOverlayDismissed?.();
|
|
139
|
+
}, [controller, onLoadingOverlayDismissed]);
|
|
140
|
+
// Per-document progress, ported from sdk2's onDocumentStored effect
|
|
141
|
+
// (IdCaptureWizard.tsx:342-372). Diffs capturedDocuments against what has
|
|
142
|
+
// already been announced, comparing by IDENTITY rather than presence: a
|
|
143
|
+
// recapture replaces the same key with a different object and must report
|
|
144
|
+
// again.
|
|
145
|
+
//
|
|
146
|
+
// Documents the controller seeded from `precapturedDocuments` are skipped.
|
|
147
|
+
// Seeding replays them through the ordinary `documentCaptured` action, so
|
|
148
|
+
// state alone cannot tell them apart — core records which types were seeded
|
|
149
|
+
// for exactly this reason. Each seeded type is skipped ONCE: a later
|
|
150
|
+
// recapture of that same document is a real capture and is reported.
|
|
151
|
+
const reportedDocumentsRef = useRef({});
|
|
152
|
+
const pendingPrecapturedRef = useRef(new Set());
|
|
153
|
+
const seenPrecapturedRef = useRef(new Set());
|
|
154
|
+
const tamperReportedRef = useRef(false);
|
|
155
|
+
const cameraDeniedReportedRef = useRef(false);
|
|
156
|
+
const reportedModelErrorRef = useRef(null);
|
|
157
|
+
// A new controller is a new session, so every notification latch below has
|
|
158
|
+
// to start over — the same reasoning as the attach and overlay-dismissal
|
|
159
|
+
// effects above. Declared BEFORE the two reporting effects so React runs it
|
|
160
|
+
// first in the same commit, clearing the latches before the new
|
|
161
|
+
// controller's state is processed.
|
|
162
|
+
//
|
|
163
|
+
// Without this, a swapped-in controller's PRECAPTURED documents would be
|
|
164
|
+
// announced as fresh captures (their types are already in `seen`, so they
|
|
165
|
+
// never reach the pending-exclusion set), and a new controller that is also
|
|
166
|
+
// tampered would report nothing at all (the latch is still spent from the
|
|
167
|
+
// old one).
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
reportedDocumentsRef.current = {};
|
|
170
|
+
pendingPrecapturedRef.current = new Set();
|
|
171
|
+
seenPrecapturedRef.current = new Set();
|
|
172
|
+
tamperReportedRef.current = false;
|
|
173
|
+
cameraDeniedReportedRef.current = false;
|
|
174
|
+
reportedModelErrorRef.current = null;
|
|
175
|
+
}, [controller]);
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
// `precapturedDocumentTypes` lands in the SAME state update as the seeded
|
|
178
|
+
// documents (both come from configureWizard, which runs at attach — long
|
|
179
|
+
// after this effect first runs with an empty state). Folding it in here,
|
|
180
|
+
// rather than seeding once on mount, is what makes the skip actually
|
|
181
|
+
// apply. `seen` keeps a consumed exclusion from being re-armed.
|
|
182
|
+
for (const documentType of state.precapturedDocumentTypes) {
|
|
183
|
+
if (seenPrecapturedRef.current.has(documentType))
|
|
184
|
+
continue;
|
|
185
|
+
seenPrecapturedRef.current.add(documentType);
|
|
186
|
+
pendingPrecapturedRef.current.add(documentType);
|
|
187
|
+
}
|
|
188
|
+
for (const key of Object.keys(state.capturedDocuments)) {
|
|
189
|
+
const documentType = key;
|
|
190
|
+
const document = state.capturedDocuments[documentType];
|
|
191
|
+
if (!document)
|
|
192
|
+
continue;
|
|
193
|
+
if (reportedDocumentsRef.current[documentType] === document)
|
|
194
|
+
continue;
|
|
195
|
+
reportedDocumentsRef.current[documentType] = document;
|
|
196
|
+
if (pendingPrecapturedRef.current.delete(documentType))
|
|
197
|
+
continue;
|
|
198
|
+
onDocumentStored?.(documentType);
|
|
199
|
+
}
|
|
200
|
+
// `controller` is a dependency so a swap re-runs this against the new
|
|
201
|
+
// controller's documents even if the state objects happened to be equal.
|
|
202
|
+
}, [
|
|
203
|
+
controller,
|
|
204
|
+
state.capturedDocuments,
|
|
205
|
+
state.precapturedDocumentTypes,
|
|
206
|
+
onDocumentStored,
|
|
207
|
+
]);
|
|
208
|
+
// sdk2's `onCameraTamperingDetected` is a one-shot notification, not a
|
|
209
|
+
// per-render signal. Latched on a ref rather than fired from the render
|
|
210
|
+
// path so StrictMode's double-invoke and any unrelated re-render (guidance
|
|
211
|
+
// ticking, a resize) cannot double-report a single detection. The latch
|
|
212
|
+
// clears when the error goes away, so a retry that re-detects tampering
|
|
213
|
+
// reports again — the host is counting detections, not screens.
|
|
214
|
+
const tampered = state.error?.code === 'CAMERA_TAMPERING_SUSPECTED';
|
|
215
|
+
useEffect(() => {
|
|
216
|
+
if (!tampered) {
|
|
217
|
+
tamperReportedRef.current = false;
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (tamperReportedRef.current)
|
|
221
|
+
return;
|
|
222
|
+
tamperReportedRef.current = true;
|
|
223
|
+
onCameraTamperingDetected?.();
|
|
224
|
+
// `controller` is a dependency because `tampered` alone does not change
|
|
225
|
+
// when one tampered controller replaces another — without it, the new
|
|
226
|
+
// controller's detection would go unreported.
|
|
227
|
+
}, [controller, tampered, onCameraTamperingDetected]);
|
|
228
|
+
// Same one-shot latch shape as the tamper notification above, for the two
|
|
229
|
+
// sdk2 side-channel callbacks the ID stage had been dropping. Both read the
|
|
230
|
+
// controller's typed error, which is where core lands a denied camera and a
|
|
231
|
+
// failed model load alike (dual-truth contract: the same failure is already
|
|
232
|
+
// on screen, so these are notifications, not the error UI).
|
|
233
|
+
const cameraDenied = state.error?.code === 'CAMERA_PERMISSION_DENIED';
|
|
234
|
+
useEffect(() => {
|
|
235
|
+
if (!cameraDenied) {
|
|
236
|
+
cameraDeniedReportedRef.current = false;
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (cameraDeniedReportedRef.current)
|
|
240
|
+
return;
|
|
241
|
+
cameraDeniedReportedRef.current = true;
|
|
242
|
+
onCameraAccessDenied?.();
|
|
243
|
+
}, [controller, cameraDenied, onCameraAccessDenied]);
|
|
244
|
+
// Keyed on the ERROR OBJECT's identity, not on its cause: a MODEL_LOAD_FAILED
|
|
245
|
+
// with no cause attached is still a model failure the host asked to hear
|
|
246
|
+
// about, and keying on the cause skipped those entirely. A second, different
|
|
247
|
+
// failure after a retry is a new object and reports again, while any
|
|
248
|
+
// re-render carrying the same one does not.
|
|
249
|
+
//
|
|
250
|
+
// The cause is typed `unknown` on `CaptureError`, so it is normalised to an
|
|
251
|
+
// Error at the callback boundary only — normalising earlier would mint a new
|
|
252
|
+
// object per render and defeat the latch.
|
|
253
|
+
const modelError = state.error?.code === 'MODEL_LOAD_FAILED' ? state.error : null;
|
|
254
|
+
useEffect(() => {
|
|
255
|
+
if (!modelError) {
|
|
256
|
+
reportedModelErrorRef.current = null;
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (reportedModelErrorRef.current === modelError)
|
|
260
|
+
return;
|
|
261
|
+
reportedModelErrorRef.current = modelError;
|
|
262
|
+
const cause = modelError.cause;
|
|
263
|
+
onModelError?.(cause instanceof Error
|
|
264
|
+
? cause
|
|
265
|
+
: new Error(cause == null
|
|
266
|
+
? `Model ${modelError.model} failed to load`
|
|
267
|
+
: String(cause)));
|
|
268
|
+
}, [controller, modelError, onModelError]);
|
|
269
|
+
// sdk2 IdCaptureWizard.tsx:1645-1648 verbatim, including the AND with
|
|
270
|
+
// `portraitGuidesOnMobile`: the overlay image only ever rotates to match
|
|
271
|
+
// guides that are themselves standing the card up. Read at render time (no
|
|
272
|
+
// resize listener) exactly as sdk2 read it — an orientation change
|
|
273
|
+
// re-renders this view through the guide layout's own resize observer.
|
|
274
|
+
const rotateOverlayImage = rotateLoadingOverlayImageWhenPortrait &&
|
|
275
|
+
portraitGuidesOnMobile &&
|
|
276
|
+
typeof window !== 'undefined' &&
|
|
277
|
+
window.innerWidth < window.innerHeight;
|
|
278
|
+
const isFlipInterstitial = state.phase === 'requestingFlip' && flipReview;
|
|
279
|
+
// sdk2 IdCaptureWizard.tsx:535 — the fallback owns the screen when the
|
|
280
|
+
// integrator asked for it OR the models failed. `fallbackFinished` is what
|
|
281
|
+
// lets the user out of it: once they are done supplying images the
|
|
282
|
+
// controller is holding them, so the normal render resumes and lands on the
|
|
283
|
+
// review screen (sdk2 submitted straight from the fallback; the review step
|
|
284
|
+
// is 3.0's own, and `skipSuccessScreen` still applies to it).
|
|
285
|
+
const [fallbackFinished, setFallbackFinished] = useState(false);
|
|
286
|
+
useEffect(() => {
|
|
287
|
+
setFallbackFinished(false);
|
|
288
|
+
}, [controller]);
|
|
289
|
+
const inFallbackMode = !fallbackFinished &&
|
|
290
|
+
(forceFallbackMode || state.error?.code === 'MODEL_LOAD_FAILED');
|
|
291
|
+
// The upload choice comes BEFORE capture, so it is gated on the phase where
|
|
292
|
+
// nothing has been captured yet — sdk2 gates on
|
|
293
|
+
// `['initializing', 'uploading'].includes(captureState)`.
|
|
294
|
+
const [uploadChoiceMade, setUploadChoiceMade] = useState(false);
|
|
295
|
+
const showUploadChoice = allowUploadingDocumentsFromStorage &&
|
|
296
|
+
!uploadChoiceMade &&
|
|
297
|
+
!inFallbackMode &&
|
|
298
|
+
state.phase === 'initializing';
|
|
299
|
+
// While either screen owns the surface, the ordinary capture chrome is
|
|
300
|
+
// suppressed — guides, loading overlay, review and error screens would all
|
|
301
|
+
// be stacked underneath it otherwise, and the error screen in particular
|
|
302
|
+
// would show through as soon as a model failure put us in fallback mode.
|
|
303
|
+
const screenTakeover = inFallbackMode || showUploadChoice;
|
|
304
|
+
const showGuides = !screenTakeover && GUIDE_PHASES.has(state.phase) && !isFlipInterstitial;
|
|
305
|
+
// sdk2 IdCapture.tsx:311-330: the pill is hidden when the resolved text is
|
|
306
|
+
// '' (guidanceMessageKey maps the held NONE code to ''). Text and variant
|
|
307
|
+
// both read the same held event, so the pill's background always describes
|
|
308
|
+
// the message it is showing.
|
|
309
|
+
const guidanceKey = guidanceMessageKey(state.guidance);
|
|
310
|
+
const showGuidancePill = overlayDismissed && state.phase === 'capturing' && guidanceKey !== '';
|
|
311
|
+
// The overlay stacks on top of the capture/guide screen exactly like
|
|
312
|
+
// sdk2's wizard (never simultaneously with review/error) — plus phase
|
|
313
|
+
// 'initializing' forces it regardless (nothing to dismiss into yet).
|
|
314
|
+
const showLoadingOverlay = !screenTakeover &&
|
|
315
|
+
(state.phase === 'initializing' || (!overlayDismissed && showGuides));
|
|
316
|
+
const handleSubmit = useCallback(() => {
|
|
317
|
+
// Collect-don't-submit seam (onCollected doc above): when a host is
|
|
318
|
+
// composing this view with another stage into one combined submission,
|
|
319
|
+
// it takes over entirely — collectArtifacts() is a pure, synchronous
|
|
320
|
+
// read that cannot reject, so there is no error path to wire here (unlike
|
|
321
|
+
// the submit path below).
|
|
322
|
+
if (onCollected) {
|
|
323
|
+
onCollected(controller.collectArtifacts());
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
controller.actions.submit().then(
|
|
327
|
+
// `onSubmitted` reports a RESPONSE; the hand-off path resolves null.
|
|
328
|
+
(response) => {
|
|
329
|
+
if (response)
|
|
330
|
+
onSubmitted?.(response);
|
|
331
|
+
}, () => {
|
|
332
|
+
// Dual-truth contract: the same error already landed on state.error
|
|
333
|
+
// (phase 'error') — nothing further to do here.
|
|
334
|
+
});
|
|
335
|
+
}, [controller, onSubmitted, onCollected]);
|
|
336
|
+
const showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, state.phase === 'reviewing', handleSubmit);
|
|
337
|
+
const showReview = !screenTakeover &&
|
|
338
|
+
(isFlipInterstitial ||
|
|
339
|
+
(REVIEW_PHASES.has(state.phase) && showSuccessScreen));
|
|
340
|
+
const handleConfirmFlip = useCallback(() => {
|
|
341
|
+
controller.actions.confirmFlip();
|
|
342
|
+
}, [controller]);
|
|
343
|
+
// Shared by ReviewScreen's Retry and ErrorScreen's Retry, so `onRetry`
|
|
344
|
+
// reports both deliberate redos and recoverable-error restarts.
|
|
345
|
+
//
|
|
346
|
+
// Notify BEFORE resetting, matching sdk2's onRetryClick
|
|
347
|
+
// (IdCaptureWizard.tsx:1124-1127): the host sees the retry against the state
|
|
348
|
+
// that prompted it, not against the freshly-cleared one.
|
|
349
|
+
const handleRetry = useCallback(() => {
|
|
350
|
+
onRetry?.();
|
|
351
|
+
void controller.actions.retry();
|
|
352
|
+
}, [controller, onRetry]);
|
|
353
|
+
const handleOverride = useCallback(() => {
|
|
354
|
+
controller.actions.overrideWrongDocumentType();
|
|
355
|
+
}, [controller]);
|
|
356
|
+
const reviewFlipVerbiage = {
|
|
357
|
+
submitText: 'Continue',
|
|
358
|
+
...verbiage.reviewFlip,
|
|
359
|
+
};
|
|
360
|
+
const handleManualImages = useCallback((captureMode) => (imageDataUrl) => {
|
|
361
|
+
void controller.actions
|
|
362
|
+
.captureManually(imageDataUrl, { captureMode })
|
|
363
|
+
.catch(() => { });
|
|
364
|
+
}, [controller]);
|
|
365
|
+
return (_jsx(FontCarrier, { children: _jsx(GuideOrientationContextProvider, { children: _jsxs(GuideLayoutProvider, { children: [_jsx(ScalingCameraFeed, { videoRef: setVideoRef, phase: state.phase, isRearFacing: state.camera.isRearFacing, cameraFeedMode: cameraFeedMode, className: classNames.cameraFeed }), inFallbackMode && (_jsx(IdCaptureFallback, { captureRequirement: state.captureRequirement, idCardBackCaptureRequired: state.idCardBackCaptureRequired, silentFallback: silentFallback, onCapture: handleManualImages('Manual'), onFinished: () => setFallbackFinished(true), classNames: classNames.fallback, colors: colors.fallback, verbiage: verbiage.fallback })), showUploadChoice && (_jsx(IdCaptureOrUploadScreen, { captureRequirement: state.captureRequirement, idCardBackCaptureRequired: state.idCardBackCaptureRequired, onCaptureWithCamera: () => {
|
|
366
|
+
setUploadChoiceMade(true);
|
|
367
|
+
void controller.actions.requestCamera().catch(() => { });
|
|
368
|
+
}, onUpload: handleManualImages('Upload'), onFinished: () => setUploadChoiceMade(true), classNames: classNames.uploadOrCaptureScreen, colors: colors.uploadOrCaptureScreen, verbiage: verbiage.uploadOrCaptureScreen })), showGuides && (_jsx(IdCaptureGuides, { state: state, isRearFacing: state.camera.isRearFacing, guideType: guideType, guideBoxDisabled: guideBoxDisabled, portraitGuidesOnMobile: portraitGuidesOnMobile, guideBoxFollowsMask: guideBoxFollowsMask, cameraFeedMode: cameraFeedMode, images: assets.guideImages, classNames: classNames.guides, verbiage: verbiage.guides, status: !overlayDismissed ? 'disabled' : undefined })), showGuidancePill && (_jsx(GuidanceMessageContainer, { "$top": "", "$bottom": "12.5%", className: classNames.guidanceMessageContainer, children: _jsx(GuidanceMessage, { "$variant": state.guidance.satisfied ? 'positive' : 'default', className: classNames.guidanceMessage, children: t(guidanceKey) }) })), state.phase !== 'complete' && _jsx("div", { id: "idmission-above-guides-content" }), debugMode && overlayDismissed && showGuides && (_jsx(IdCaptureDebugLayer, { state: state })), onExit != null && (_jsx(ExitCaptureButton, { onClick: onExit, className: classNames.exitBtn })), showLoadingOverlay && (_jsx(IdCaptureLoadingOverlay, { state: state, mode: loadingOverlayMode, sessionReady: sessionReady, autoContinueAfterLoading: autoContinueAfterLoading, showIntroScreen: showIntroScreen, assets: assets.loadingOverlay, classNames: classNames.loadingOverlay, colors: colors.loadingOverlay, verbiage: verbiage.loadingOverlay, rotateImage: rotateOverlayImage, onUserCancel: onUserCancel, onLoadingStarted: onLoadingStarted, onLoadingProgress: onLoadingProgress, onLoadingCompleted: onLoadingCompleted, onLoadingFailed: onLoadingFailed, onDismissed: handleLoadingOverlayDismissed, customOverlayContent: customOverlayContent, instructions: instructions, onRequestCamera: () => controller.actions.requestCamera() })), _jsx(OverrideWrongDocumentTypeDialog, { visible: state.allowOverrideWrongDocumentTypeGuidance, onOverride: handleOverride, classNames: classNames.overrideWrongDocumentType, verbiage: verbiage.overrideWrongDocumentType }), showReview && (_jsx(ReviewScreen, { capturedDocuments: state.capturedDocuments, submission: isFlipInterstitial ? 'idle' : state.submission, sessionReady: sessionReady, diagnostics: debugMode && !isFlipInterstitial
|
|
369
|
+
? {
|
|
370
|
+
initialBarcodeScore: state.recaptureBarcodeScore !== null
|
|
371
|
+
? state.initialBarcodeScore
|
|
372
|
+
: undefined,
|
|
373
|
+
recaptureBarcodeScore: state.recaptureBarcodeScore,
|
|
374
|
+
initialCaptureBarcodeImage: state.initialCaptureBarcodeImage,
|
|
375
|
+
recaptureBarcodeImage: state.recaptureBarcodeImage,
|
|
376
|
+
nativeBarcodeDecodeResult: state.nativeBarcodeDecodeResult,
|
|
377
|
+
nativeBarcodeDecodeAttempted: state.nativeBarcodeDecodeAttempted,
|
|
378
|
+
nativeBarcodeDecodeDetails: state.nativeBarcodeDecodeDetails,
|
|
379
|
+
pdf417DetectionCount: state.pdf417DetectionCount,
|
|
380
|
+
pdf417LowScoreCount: state.pdf417LowScoreCount,
|
|
381
|
+
zxingParseAttemptCount: state.zxingParseAttemptCount,
|
|
382
|
+
}
|
|
383
|
+
: undefined, onSubmit: isFlipInterstitial ? handleConfirmFlip : handleSubmit, onRetry: handleRetry, verbiage: isFlipInterstitial ? reviewFlipVerbiage : verbiage.review, classNames: classNames.review })), !screenTakeover && state.phase === 'error' && state.error !== null && (_jsx(ErrorScreen, { error: state.error, onRetry: handleRetry, onExit: state.error.code === 'CAMERA_TAMPERING_SUSPECTED'
|
|
384
|
+
? onExitAfterTamperSealPopped
|
|
385
|
+
: undefined, verbiage: verbiage.error, classNames: classNames.error,
|
|
386
|
+
// 2.x styled/translated the camera-denied screen through the
|
|
387
|
+
// loading overlay's `cameraAccessDenied` bag; denial rendering
|
|
388
|
+
// moved to ErrorScreen, so route that bag to its new home.
|
|
389
|
+
cameraAccessDenied: {
|
|
390
|
+
assets: assets.loadingOverlay?.cameraAccessDenied,
|
|
391
|
+
classNames: classNames.loadingOverlay?.cameraAccessDenied,
|
|
392
|
+
colors: colors.loadingOverlay?.cameraAccessDenied,
|
|
393
|
+
verbiage: verbiage.loadingOverlay?.cameraAccessDenied,
|
|
394
|
+
} }))] }) }) }));
|
|
395
|
+
}
|
|
396
|
+
// Debug overlay + stats pane, sourced from sdk2 IdCapture.tsx:333-353
|
|
397
|
+
// (per-detected-object boxes, anchored to the guide rect via
|
|
398
|
+
// DebugBoundingBoxOverlay) and :386-467 (the DebugStatsPane score readout).
|
|
399
|
+
// Split into its own component (rather than inlined above) so it can call
|
|
400
|
+
// useGuideLayout() as a DESCENDANT of GuideLayoutProvider -- IdCaptureView
|
|
401
|
+
// itself renders that provider and can't consume its own context.
|
|
402
|
+
//
|
|
403
|
+
// Field-for-field adaptation from sdk2's stats pane: every line below reads
|
|
404
|
+
// straight off IdCaptureControllerState, so any sdk2 line with no public
|
|
405
|
+
// state equivalent is dropped rather than faked --
|
|
406
|
+
// - "Camera: <label> (WxH)" -> camera label isn't on controller state;
|
|
407
|
+
// kept the ready/not-ready check plus state.videoWidth/videoHeight (the
|
|
408
|
+
// camera's actual decoded resolution, which IS on state).
|
|
409
|
+
// - the frame-rate line's "(Xms doc detect, Yms focus)" suffix -> per-model
|
|
410
|
+
// timings live only inside the core pipeline's internal FrameLoop, never
|
|
411
|
+
// surfaced publicly; dropped.
|
|
412
|
+
// - "Best Barcode Score" -> getBestBarcode() is a controller-internal
|
|
413
|
+
// pipeline accessor with no public read; dropped.
|
|
414
|
+
// Every other line (detection scores/thresholds, occlusion, barcode/booklet
|
|
415
|
+
// state, good-frame count) has a direct, same-named field on
|
|
416
|
+
// IdCaptureControllerState and is ported verbatim, sdk2 quirks (e.g. the
|
|
417
|
+
// exact ✅/❌ ternaries) included.
|
|
418
|
+
function IdCaptureDebugLayer({ state, }) {
|
|
419
|
+
const { guideRect } = useGuideLayout();
|
|
420
|
+
const isRearFacing = state.camera.isRearFacing;
|
|
421
|
+
const scaling = useDebugScalingDetails({
|
|
422
|
+
enabled: true,
|
|
423
|
+
pageWidth: guideRect?.width || 1,
|
|
424
|
+
pageHeight: guideRect?.height || 1,
|
|
425
|
+
videoWidth: state.videoWidth,
|
|
426
|
+
videoHeight: state.videoHeight,
|
|
427
|
+
});
|
|
428
|
+
return (_jsxs(_Fragment, { children: [_jsx(DebugBoundingBoxOverlay, { "$flipX": !isRearFacing, scaling: scaling, guideRect: guideRect, children: state.detectedObjects.map((obj, i) => {
|
|
429
|
+
// During barcode recapture, render PDF417 barcodes with green color
|
|
430
|
+
// (sdk2 IdCapture.tsx:342-345).
|
|
431
|
+
const isBarcodeRecapture = state.captureState === 'requestingBetterBarcode';
|
|
432
|
+
const isBarcode = obj.label === 'PDF417';
|
|
433
|
+
const color = isBarcodeRecapture && isBarcode ? 'green' : undefined;
|
|
434
|
+
return (_jsx(IdCaptureDetectedObjectDebugBox, { obj: obj, scaling: scaling, flipX: !isRearFacing, color: color }, i));
|
|
435
|
+
}) }), _jsxs(DebugStatsPane, { children: [state.camera.ready ? (_jsxs(_Fragment, { children: ["\u2705 Camera ready (", state.videoWidth, "x", state.videoHeight, ")"] })) : ('❌ Camera not ready'), _jsx("br", {}), state.frameCaptureRate > 0.75 ? '✅' : '👎', " Frame Rate:", ' ', Math.round((state.frameCaptureRate + Number.EPSILON) * 1000) / 1000, " fps", _jsx("br", {}), state.models.ready ? (_jsxs(_Fragment, { children: [state.detectionThresholdMet ? '✅' : '❌', " Detected Document Type:", ' ', state.detectedDocumentType, _jsx("br", {}), state.idCardFrontDetectionThresholdMet ? '✅' : '❌', " ID Card Front Score: ", state.idCardFrontDetectionScore.toFixed(3), _jsx("br", {}), state.idCardBackDetectionThresholdMet ? '✅' : '❌', " ID Card Back Score: ", state.idCardBackDetectionScore.toFixed(3), _jsx("br", {}), state.passportDetectionThresholdMet ? '✅' : '❌', " Passport Score:", ' ', state.passportDetectionScore.toFixed(3), _jsx("br", {}), state.singlePageDetectionThresholdMet ? '✅' : '❌', " Single Page Score: ", state.singlePageDetectionScore.toFixed(3), _jsx("br", {}), state.focusThresholdMet ? '✅' : '❌', " Focus Score:", ' ', state.focusScore.toFixed(3), _jsx("br", {}), state.enableFingerOcclusionGuidance && (_jsxs(_Fragment, { children: [state.fingersOccludingDocument ? '❌' : '✅', " Max Finger Score:", ' ', Math.max(0, ...state.detectedObjects
|
|
436
|
+
.filter((o) => o.label === 'Finger')
|
|
437
|
+
.map((o) => o.score)).toFixed(3), _jsx("br", {})] })), state.enableGlareOcclusionGuidance && (_jsxs(_Fragment, { children: [state.glareOccludingDocument ? '❌' : '✅', " Max Glare Score:", ' ', Math.max(0, ...state.detectedObjects
|
|
438
|
+
.filter((o) => o.label === 'Glare')
|
|
439
|
+
.map((o) => o.score)).toFixed(3), _jsx("br", {})] })), state.enableHologramOcclusionGuidance && (_jsxs(_Fragment, { children: [state.hologramOccludingDocument ? '❌' : '✅', " Max Hologram Score:", ' ', Math.max(0, ...state.detectedObjects
|
|
440
|
+
.filter((o) => o.label === 'Hologram')
|
|
441
|
+
.map((o) => o.score)).toFixed(3), _jsx("br", {})] })), state.pdf417PredictionThresholdMet ? '✅' : '❌', " Current Barcode Score: ", state.pdf417PredictionScore.toFixed(3), _jsx("br", {}), state.aggressiveModeDecodeComplete ? '✅' : '⏳', " Aggressive Decode:", ' ', state.aggressiveModeDecodeComplete && state.aggressiveModeDecodeResult
|
|
442
|
+
? `SUCCESS via ${state.aggressiveModeDecodeResult.method}`
|
|
443
|
+
: 'Pending', _jsx("br", {}), state.documentInBounds ? '✅' : '❌', " Document In Bounds", _jsx("br", {}), state.documentIsStable ? '✅' : '❌', " Document Is Stable", _jsx("br", {}), state.requireFullPassportBooklet && (_jsxs(_Fragment, { children: [state.bookletVerdict?.isFullBooklet &&
|
|
444
|
+
state.bookletVerdict.framing === 'ok'
|
|
445
|
+
? '✅'
|
|
446
|
+
: '❌', ' ', "Booklet:", ' ', state.bookletVerdict
|
|
447
|
+
? `${state.bookletVerdict.orientation}/${state.bookletVerdict.framing}` +
|
|
448
|
+
(state.bookletVerdict.metrics
|
|
449
|
+
? ` leaf ${state.bookletVerdict.metrics.leafRatio.toFixed(2)}` +
|
|
450
|
+
` aspect ${state.bookletVerdict.metrics.aspectRatio.toFixed(2)}` +
|
|
451
|
+
` cont ${state.bookletVerdict.metrics.mrzInPage.toFixed(2)}/${state.bookletVerdict.metrics.pageInDocument.toFixed(2)}`
|
|
452
|
+
: ' (boxes missing)')
|
|
453
|
+
: 'N/A', _jsx("br", {})] })), state.goodFramesThresholdMet ? '✅' : '❌', " Good Frame Count:", ' ', state.goodFramesCount, "/", state.goodFramesThreshold] })) : (_jsx(_Fragment, { children: "\u274C Models not ready" }))] })] }));
|
|
454
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { ReactElement, type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import { SelfieGuidanceCode, type SelfieCaptureController } from '@idmission/websdk-core/selfieCapture';
|
|
3
|
+
import { type CustomerSuppliedVerbiage, type LangOption } from './i18n';
|
|
4
|
+
import { type SelfieCaptureSurfaceColors } from './components/selfie/SelfieCaptureSurface';
|
|
5
|
+
import { type FaceCaptureGuideOverlayClassNames } from './components/selfie/FaceCaptureGuideOverlay';
|
|
6
|
+
import { type SelfieCaptureLoadingOverlayAssets, type SelfieCaptureLoadingOverlayClassNames, type SelfieCaptureLoadingOverlayMode, type SelfieCaptureLoadingOverlayVerbiage } from './components/selfie_loading/SelfieCaptureLoadingOverlay';
|
|
7
|
+
import { type ErrorScreenClassNames, type ErrorScreenVerbiage } from './components/error/ErrorScreen';
|
|
8
|
+
export type SelfieGuidanceVerbiage = {
|
|
9
|
+
guidanceHoldStillText?: CustomerSuppliedVerbiage;
|
|
10
|
+
guidanceLookStraightText?: CustomerSuppliedVerbiage;
|
|
11
|
+
guidanceMoveBackText?: CustomerSuppliedVerbiage;
|
|
12
|
+
guidanceMoveForwardText?: CustomerSuppliedVerbiage;
|
|
13
|
+
guidanceMoveToCenterText?: CustomerSuppliedVerbiage;
|
|
14
|
+
guidanceNoFaceDetectedText?: CustomerSuppliedVerbiage;
|
|
15
|
+
guidanceVisibilityTooLowText?: CustomerSuppliedVerbiage;
|
|
16
|
+
guidanceNotStableText?: CustomerSuppliedVerbiage;
|
|
17
|
+
guidanceManualCaptureText?: CustomerSuppliedVerbiage;
|
|
18
|
+
manualCaptureBtnText?: CustomerSuppliedVerbiage;
|
|
19
|
+
};
|
|
20
|
+
export declare const GUIDANCE_VERBIAGE_FIELD: Record<Exclude<SelfieGuidanceCode, 'NONE'>, keyof SelfieGuidanceVerbiage>;
|
|
21
|
+
export type SelfieCaptureViewVerbiage = {
|
|
22
|
+
guidance?: SelfieGuidanceVerbiage;
|
|
23
|
+
loadingOverlay?: SelfieCaptureLoadingOverlayVerbiage;
|
|
24
|
+
error?: ErrorScreenVerbiage;
|
|
25
|
+
};
|
|
26
|
+
export type SelfieCaptureViewClassNames = {
|
|
27
|
+
container?: string;
|
|
28
|
+
cameraFeed?: string;
|
|
29
|
+
guides?: FaceCaptureGuideOverlayClassNames;
|
|
30
|
+
guidanceMessageContainer?: string;
|
|
31
|
+
guidanceMessage?: string;
|
|
32
|
+
loadingOverlay?: SelfieCaptureLoadingOverlayClassNames;
|
|
33
|
+
error?: ErrorScreenClassNames;
|
|
34
|
+
exitBtn?: string;
|
|
35
|
+
manualCaptureBtnContainer?: string;
|
|
36
|
+
manualCaptureBtn?: string;
|
|
37
|
+
};
|
|
38
|
+
export type SelfieCaptureViewColors = SelfieCaptureSurfaceColors;
|
|
39
|
+
export type SelfieCaptureViewAssets = {
|
|
40
|
+
loadingOverlay?: SelfieCaptureLoadingOverlayAssets;
|
|
41
|
+
};
|
|
42
|
+
export type SelfieCaptureViewProps = {
|
|
43
|
+
controller: SelfieCaptureController;
|
|
44
|
+
/** Which loading overlay variant renders. Defaults to 'default'. */
|
|
45
|
+
loadingOverlayMode?: SelfieCaptureLoadingOverlayMode;
|
|
46
|
+
/** Default true. Gates the loading overlay's session-checking line — same
|
|
47
|
+
* seam IdCaptureView exposes for its own loading overlay. */
|
|
48
|
+
sessionReady?: boolean;
|
|
49
|
+
lang?: LangOption;
|
|
50
|
+
/** When true, the loading overlay auto-dismisses ~400ms after
|
|
51
|
+
* models/camera are ready instead of waiting for the continue button.
|
|
52
|
+
* Default false. */
|
|
53
|
+
autoContinueAfterLoading?: boolean;
|
|
54
|
+
/** Ring mode only (`loadingOverlayMode: 'ring'`): shows a priming intro
|
|
55
|
+
* page first and defers the camera permission request to its "Enable
|
|
56
|
+
* camera & start" button instead of the ring rendering immediately.
|
|
57
|
+
* Default false. Meaningful only when `controller` was created with
|
|
58
|
+
* `deferCameraAcquisition: true` — otherwise `attach()` acquires the
|
|
59
|
+
* camera eagerly and `state.camera.accessRequested` latches before the
|
|
60
|
+
* intro ever gets a chance to render, so the overlay goes straight to the
|
|
61
|
+
* ring regardless of this flag (same caveat as IdCaptureView's own
|
|
62
|
+
* `showIntroScreen`). */
|
|
63
|
+
showIntroScreen?: boolean;
|
|
64
|
+
/** Ring mode only: opens the overlay with an animated ID→selfie handoff
|
|
65
|
+
* instead of the plain ring — the flow-level "you just finished ID
|
|
66
|
+
* capture, now do a selfie" transition. Default false. */
|
|
67
|
+
transitionFromIdCapture?: boolean;
|
|
68
|
+
/** Renders sdk2's face-detection debug overlay + DebugStatsPane readout
|
|
69
|
+
* (SelfieCaptureSurface's own `debugMode` doc has the full rundown).
|
|
70
|
+
* Default false; dev/QA tooling only, never enabled by a customer-facing
|
|
71
|
+
* story. */
|
|
72
|
+
debugMode?: boolean;
|
|
73
|
+
/** Shows face landmarks without enabling the full diagnostics pane. */
|
|
74
|
+
showFaceLandmarks?: boolean;
|
|
75
|
+
/** sdk2's third debug gate: sample points need this AND `debugMode`. */
|
|
76
|
+
debugShowSamplePoints?: boolean;
|
|
77
|
+
onLoadingStarted?: () => void;
|
|
78
|
+
onLoadingProgress?: (progress: number) => void;
|
|
79
|
+
onLoadingCompleted?: () => void;
|
|
80
|
+
onLoadingFailed?: (error?: Error) => void;
|
|
81
|
+
onLoadingOverlayDismissed?: () => void;
|
|
82
|
+
onCameraAccessDenied?: () => void;
|
|
83
|
+
/** sdk2's `onModelError` / `onSelfieCaptureModelError`: fires once with the
|
|
84
|
+
* Error when a selfie model fails to load or times out. */
|
|
85
|
+
onModelError?: (error: Error) => void;
|
|
86
|
+
/** sdk2's `onCameraTamperingDetected`: fires once per detection. */
|
|
87
|
+
onCameraTamperingDetected?: () => void;
|
|
88
|
+
/** sdk2's `onExitAfterTamperSealPopped`: renders an exit button on the
|
|
89
|
+
* tampering screen, which is otherwise a dead end. Bind-gated. */
|
|
90
|
+
onExitAfterTamperSealPopped?: () => void;
|
|
91
|
+
onUserCancel?: () => void;
|
|
92
|
+
customOverlayContent?: ReactNode;
|
|
93
|
+
allowManualSelfieCaptureOnLoadingError?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* sdk2's stock-camera fallback on a model failure: with in-camera manual
|
|
96
|
+
* capture NOT enabled, the user still finishes through the device picker
|
|
97
|
+
* rather than dead-ending at "Retry". Defaults to true, matching 2.x.
|
|
98
|
+
*/
|
|
99
|
+
fallbackCapture?: boolean;
|
|
100
|
+
/** Reads as a normal capture step rather than an apology. sdk2's prop. */
|
|
101
|
+
silentFallback?: boolean;
|
|
102
|
+
/** Reuses a video element owned by a parent multi-stage flow. */
|
|
103
|
+
videoRef?: RefObject<HTMLVideoElement | null>;
|
|
104
|
+
/** False when a parent multi-stage flow renders the shared camera feed. */
|
|
105
|
+
renderCameraFeed?: boolean;
|
|
106
|
+
/** False when a parent multi-stage flow renders the shared face guide. */
|
|
107
|
+
renderFaceGuide?: boolean;
|
|
108
|
+
onExit?: () => void;
|
|
109
|
+
/** Fires once per new `state.capturedSelfie` (compared by `capturedAt`),
|
|
110
|
+
* passing its `dataUrl`. The selfie controller has no submit() action —
|
|
111
|
+
* this is the plain flow's sole "a selfie landed" signal. */
|
|
112
|
+
onCaptured?: (dataUrl: string) => void;
|
|
113
|
+
verbiage?: SelfieCaptureViewVerbiage;
|
|
114
|
+
classNames?: SelfieCaptureViewClassNames;
|
|
115
|
+
colors?: SelfieCaptureViewColors;
|
|
116
|
+
assets?: SelfieCaptureViewAssets;
|
|
117
|
+
};
|
|
118
|
+
export declare function SelfieCaptureView({ controller, loadingOverlayMode, sessionReady: sessionReadyProp, lang, autoContinueAfterLoading, showIntroScreen, transitionFromIdCapture, debugMode, showFaceLandmarks, debugShowSamplePoints, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, onCameraAccessDenied, onModelError, onCameraTamperingDetected, onExitAfterTamperSealPopped, onUserCancel, customOverlayContent, allowManualSelfieCaptureOnLoadingError, fallbackCapture, silentFallback, videoRef, renderCameraFeed, renderFaceGuide, onExit, onCaptured, verbiage, classNames, colors, assets, }: SelfieCaptureViewProps): ReactElement;
|
|
119
|
+
//# sourceMappingURL=SelfieCaptureView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelfieCaptureView.d.ts","sourceRoot":"","sources":["../src/SelfieCaptureView.tsx"],"names":[],"mappings":"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"}
|