@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,67 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Rewired from sdk2's selfie_capture/SelfieCaptureLoadingOverlayLegacy.tsx.
|
|
3
|
+
// Same rewiring as the Default variant (see its header for the full
|
|
4
|
+
// field-by-field mapping and the drop inventory shared with the dispatcher's
|
|
5
|
+
// header comment):
|
|
6
|
+
// - `useSelfieGuidanceModelsContext()` -> `state.models.{ready,
|
|
7
|
+
// downloadProgress}` (this variant never read modelLoadState/
|
|
8
|
+
// modelWarmingStartedAt/error at all -- its continue-button copy only
|
|
9
|
+
// ever branched on `modelsReady` and `modelDownloadProgress`, so nothing
|
|
10
|
+
// is lost, and (matching sdk2 and the ID port) it does not call
|
|
11
|
+
// `useLoadProgressHooks` / fire `onLoadingFailed`).
|
|
12
|
+
// - `useCameraStore().cameraReady` -> `state.camera.ready`.
|
|
13
|
+
// - `useAuthContext()` session gating -> `sessionReady` prop (default
|
|
14
|
+
// `true`).
|
|
15
|
+
// - `onDismissed`/local `dismissed` self-hide dropped -> `onContinue`.
|
|
16
|
+
// - `cameraAccessDenied`/`microphoneAccessDenied` branches dropped.
|
|
17
|
+
import { OverlayContainer, OverlayImageContainer, OverlayInner, } from '../common/overlay';
|
|
18
|
+
import { DEFAULT_CDN_URL } from '../../utils/cdn';
|
|
19
|
+
import { LoaderButton } from '../common/LoaderButton';
|
|
20
|
+
import { downloadingLabel } from '../common/downloadingLabel';
|
|
21
|
+
import { useAutoContinueWhenReady } from '../loading/useAutoContinueWhenReady';
|
|
22
|
+
import { useTranslations } from '../../i18n';
|
|
23
|
+
import { GuidanceMessage } from '../GuidanceMessage';
|
|
24
|
+
import { styled } from 'styled-components';
|
|
25
|
+
import { ButtonsRow } from '../common/ButtonsRow';
|
|
26
|
+
import { ExitCaptureButton } from '../ExitCaptureButton';
|
|
27
|
+
export const SelfieCaptureLoadingOverlayLegacy = ({ state, sessionReady = true, onContinue, onUserCancel, autoContinueAfterLoading = false, assets = {}, classNames = {}, colors = {}, verbiage: rawVerbiage = {}, }) => {
|
|
28
|
+
const { ready: modelsReady, downloadProgress: modelDownloadProgress } = state.models;
|
|
29
|
+
const cameraReady = state.camera.ready;
|
|
30
|
+
const instructionImageUrl = assets.instructionImageUrl ?? `${DEFAULT_CDN_URL}/Selfie-Image-1.png`;
|
|
31
|
+
const verbiage = useTranslations(rawVerbiage, {
|
|
32
|
+
headingText: 'Use your device camera to capture your face',
|
|
33
|
+
removeEyeCoveringsText: 'Remove Sunglasses & Hat',
|
|
34
|
+
avoidExcessiveBacklightingText: 'Avoid Excessive Backlighting',
|
|
35
|
+
continueText: 'Continue',
|
|
36
|
+
cameraInitializingText: 'Camera initializing...',
|
|
37
|
+
downloadingText: 'Downloading...',
|
|
38
|
+
modelsWarmingUpText: 'Models warming up...',
|
|
39
|
+
});
|
|
40
|
+
const allModelsReady = modelsReady;
|
|
41
|
+
const ready = sessionReady && allModelsReady && cameraReady;
|
|
42
|
+
const handleContinue = () => {
|
|
43
|
+
onContinue?.();
|
|
44
|
+
};
|
|
45
|
+
useAutoContinueWhenReady({
|
|
46
|
+
enabled: autoContinueAfterLoading,
|
|
47
|
+
ready,
|
|
48
|
+
onContinue: handleContinue,
|
|
49
|
+
});
|
|
50
|
+
return (_jsx(OverlayContainer, { className: classNames.container, children: _jsxs(OverlayInner, { className: classNames.inner, children: [_jsx("h3", { className: classNames.heading, children: verbiage.headingText }), onUserCancel && (_jsx(ExitCaptureButton, { onClick: onUserCancel, className: classNames.cancelBtn })), _jsxs(StyledGuidanceMessage, { children: [verbiage.removeEyeCoveringsText, _jsx("br", {}), verbiage.avoidExcessiveBacklightingText] }), _jsx(OverlayImageContainer, { className: classNames.imageContainer, children: _jsx("img", { className: classNames.image, alt: verbiage.headingText, src: instructionImageUrl }) }), _jsx(StyledButtonsRow, { className: classNames.buttonsRow, children: !autoContinueAfterLoading && (_jsx(LoaderButton, { variant: "positive", disabled: !ready, finished: ready, className: classNames.continueBtn, colors: colors.continueBtn, onClick: handleContinue, children: ready
|
|
51
|
+
? verbiage.continueText
|
|
52
|
+
: allModelsReady
|
|
53
|
+
? verbiage.cameraInitializingText
|
|
54
|
+
: modelDownloadProgress >= 100
|
|
55
|
+
? `${verbiage.modelsWarmingUpText}`
|
|
56
|
+
: downloadingLabel(verbiage.downloadingText, modelDownloadProgress) })) })] }) }));
|
|
57
|
+
};
|
|
58
|
+
const StyledGuidanceMessage = styled(GuidanceMessage) `
|
|
59
|
+
padding: 12px 24px;
|
|
60
|
+
font-weight: normal;
|
|
61
|
+
line-height: 1.5;
|
|
62
|
+
margin-bottom: -30px;
|
|
63
|
+
`;
|
|
64
|
+
const StyledButtonsRow = styled(ButtonsRow) `
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
padding-top: 25px;
|
|
67
|
+
`;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SelfieCaptureLoadingOverlayProps } from './SelfieCaptureLoadingOverlay';
|
|
2
|
+
export declare const SelfieCaptureLoadingOverlayRing: ({ state, sessionReady, now, onContinue, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onUserCancel, customOverlayContent, showIntroScreen, transitionFromIdCapture, onRequestCamera, autoContinueAfterLoading, assets, classNames, colors, verbiage: rawVerbiage, }: SelfieCaptureLoadingOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=SelfieCaptureLoadingOverlayRing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelfieCaptureLoadingOverlayRing.d.ts","sourceRoot":"","sources":["../../../src/components/selfie_loading/SelfieCaptureLoadingOverlayRing.tsx"],"names":[],"mappings":"AAsEA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAA;AAoBrF,eAAO,MAAM,+BAA+B,GAAI,iSAmB7C,gCAAgC,4CAgQlC,CAAA"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Ported from sdk2 develop's selfie_capture/SelfieCaptureLoadingOverlayRing.tsx
|
|
3
|
+
// (PR #272 selfie ring port), following the SAME adaptation seams as
|
|
4
|
+
// SelfieCaptureLoadingOverlayDefault.tsx (see that file's header, and
|
|
5
|
+
// SelfieCaptureLoadingOverlay.tsx's, for the shared rewiring/drop inventory
|
|
6
|
+
// -- state prop, sessionReady prop, onContinue replacing onDismissed/local
|
|
7
|
+
// dismissed, cameraAccessDenied/microphoneAccessDenied branches dropped).
|
|
8
|
+
// This file's own deltas:
|
|
9
|
+
// - `useCameraStore()` reads -> `state.camera.{ready,accessRequested}`.
|
|
10
|
+
// `accessRequested` is core's settled-latch equivalent to sdk2's
|
|
11
|
+
// `cameraAccessRequested` (controller.ts's camera-state carry-forward on
|
|
12
|
+
// detach): it survives an overlay remount after a grant, which is
|
|
13
|
+
// exactly why sdk2 keys the intro-vs-ring stage off it rather than
|
|
14
|
+
// local state.
|
|
15
|
+
// - `requestCameraAccess()` (the camera store action) -> `onRequestCamera`
|
|
16
|
+
// prop, wired by the composing view to `controller.actions.requestCamera()`.
|
|
17
|
+
// `requesting` stays component-LOCAL state (kept, per sdk2's own
|
|
18
|
+
// comment): it must NOT flip the settled latch while the native
|
|
19
|
+
// permission prompt is still open.
|
|
20
|
+
// - Mic path dropped wholesale (divergence #7, same as Default/Legacy):
|
|
21
|
+
// `requireMicrophoneAccess`/`requestMicrophoneAccess`, the
|
|
22
|
+
// `MicrophoneAccessDeniedOverlay` branch, and the `useCameraStoreApi()`
|
|
23
|
+
// race guard that existed only to check `cameraAccessDenied` before
|
|
24
|
+
// firing the mic request -- with no mic request, there is nothing left
|
|
25
|
+
// to guard.
|
|
26
|
+
// - `cameraAccessDenied` early-return branch (`CameraAccessDeniedOverlay`)
|
|
27
|
+
// dropped, same as Default/Legacy: a denial is a flow-level concern
|
|
28
|
+
// (composing view's `phase === 'error'` -> ErrorScreen, which already
|
|
29
|
+
// special-cases CAMERA_PERMISSION_DENIED onto this same overlay --
|
|
30
|
+
// see SelfieCaptureLoadingOverlay.tsx's header). What sdk2's Ring
|
|
31
|
+
// source does NOT share with Default/Legacy is the *recovery* path out
|
|
32
|
+
// of a failed `onRequestCamera` call while still on the intro/
|
|
33
|
+
// requesting stage -- that is local `startFailed` state (sdk2 lines
|
|
34
|
+
// 164-173, kept verbatim below), which forces the stage back to
|
|
35
|
+
// 'intro'/'requesting' so the overlay never stalls on a ring that can
|
|
36
|
+
// never become ready. The denial also lands in `state.error`
|
|
37
|
+
// (dual-truth, same pattern as every other requestCamera() caller in
|
|
38
|
+
// this port) and the composing view may swap to ErrorScreen -- this
|
|
39
|
+
// overlay doesn't need to know that happened.
|
|
40
|
+
// - `overrideModelsReady`/`allowManualSelfieCaptureOnLoadingError` dropped
|
|
41
|
+
// (out of scope, same as Default/Legacy): `allModelsReady` is just
|
|
42
|
+
// `state.models.ready`.
|
|
43
|
+
// - `useAuthContext()` session gating -> `sessionReady` prop (default
|
|
44
|
+
// `true`).
|
|
45
|
+
// - `modelWarmingStartedAt` context read -> the shared UI-local warming
|
|
46
|
+
// clock (`useModelWarmingElapsedMs`, injectable via `now`) that
|
|
47
|
+
// Default and the ID ring port both already use; sdk2 :124-126's blend
|
|
48
|
+
// formula (`ready ? 100 : min(100, downloadProgress * 0.5 +
|
|
49
|
+
// warmingProgress * 49.0)`) is reproduced byte-for-byte -- same formula
|
|
50
|
+
// the ID ring port copied, reused here rather than duplicated a third
|
|
51
|
+
// time.
|
|
52
|
+
// - `onDismissed`/local `dismissed` self-hide dropped -> `onContinue`
|
|
53
|
+
// (see SelfieCaptureLoadingOverlay.tsx's shared props header): the
|
|
54
|
+
// composing view hides the overlay by branching on `state.phase`, not
|
|
55
|
+
// this component. `effectiveAutoContinue`'s `|| showIntroScreen` term
|
|
56
|
+
// and the `!requesting` exclusion in `useAutoContinueWhenReady`'s
|
|
57
|
+
// `enabled` gate are kept verbatim (sdk2 :199-208); the mic-denial and
|
|
58
|
+
// camera-denial exclusions are dropped along with the concepts they
|
|
59
|
+
// guarded (denial keeps `cameraReady`/`ready` false regardless, so
|
|
60
|
+
// they were redundant once those branches left).
|
|
61
|
+
// - `RingProgress`/`selectRingStatusKey`/`useAutoContinueWhenReady` are
|
|
62
|
+
// imported from `../loading/` -- shared with the ID ring port, not
|
|
63
|
+
// duplicated. `RingIntroScreen`/`RingStageTransition`/`ringIntro` (this
|
|
64
|
+
// task's new shared files) live there too, for the same reason.
|
|
65
|
+
import { useEffect, useState } from 'react';
|
|
66
|
+
import { styled, css, keyframes, useTheme } from 'styled-components';
|
|
67
|
+
import { LoadingOverlayInner, OverlayContainer } from '../common/overlay';
|
|
68
|
+
import { LoaderButton } from '../common/LoaderButton';
|
|
69
|
+
import { downloadingLabel } from '../common/downloadingLabel';
|
|
70
|
+
import { useTranslations } from '../../i18n';
|
|
71
|
+
import { ExitCaptureButton } from '../ExitCaptureButton';
|
|
72
|
+
import { useLoadProgressHooks, useModelWarmingElapsedMs, } from '../../utils/loadProgressHooks';
|
|
73
|
+
import { useAutoContinueWhenReady } from '../loading/useAutoContinueWhenReady';
|
|
74
|
+
import { RingProgress } from '../loading/RingProgress';
|
|
75
|
+
import { CustomerLoadingSpinner } from '../loading/customerSpinner';
|
|
76
|
+
import { selectRingStatusKey } from '../loading/ringStatus';
|
|
77
|
+
import { RingIntroScreen } from '../loading/RingIntroScreen';
|
|
78
|
+
import { selectRingOverlayStage } from '../loading/ringIntro';
|
|
79
|
+
import { RingStageTransition, STAGE_TRANSITION_HOLD_MS, } from '../loading/RingStageTransition';
|
|
80
|
+
// Module-level so the default `now` prop has a stable identity across
|
|
81
|
+
// renders (it sits in useModelWarmingElapsedMs's effect dependency array).
|
|
82
|
+
const defaultNow = () => performance.now();
|
|
83
|
+
export const SelfieCaptureLoadingOverlayRing = ({ state, sessionReady = true, now = defaultNow, onContinue, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onUserCancel, customOverlayContent, showIntroScreen = false, transitionFromIdCapture = false, onRequestCamera, autoContinueAfterLoading = false, assets = {}, classNames = {}, colors = {}, verbiage: rawVerbiage = {}, }) => {
|
|
84
|
+
const { ready: modelsReady, loadState: modelLoadState, downloadProgress: modelDownloadProgress, error: modelError, } = state.models;
|
|
85
|
+
const cameraReady = state.camera.ready;
|
|
86
|
+
const cameraAccessRequested = state.camera.accessRequested;
|
|
87
|
+
const theme = useTheme();
|
|
88
|
+
const verbiage = useTranslations(rawVerbiage, {
|
|
89
|
+
downloadingText: 'Downloading...',
|
|
90
|
+
modelsWarmingUpText: 'Loading guided capture experience...',
|
|
91
|
+
sessionCheckingText: 'Authenticating...',
|
|
92
|
+
continueText: "Let's Go!",
|
|
93
|
+
pleaseWaitText: 'Please wait...',
|
|
94
|
+
ringCameraWarmingText: 'Getting your camera ready…',
|
|
95
|
+
ringReadyText: 'Ready!',
|
|
96
|
+
ringOnlyHappensOnceText: 'One moment — this only happens once.',
|
|
97
|
+
introTitleText: "Let's verify your identity",
|
|
98
|
+
introSubtitleText: 'Just one quick step — about 10 seconds.',
|
|
99
|
+
introStep1Text: 'Take a quick selfie',
|
|
100
|
+
introStep2Text: '',
|
|
101
|
+
introReassuranceChipText: '',
|
|
102
|
+
introEnableCameraText: 'Enable camera & start',
|
|
103
|
+
introRequestingCameraText: 'Requesting camera…',
|
|
104
|
+
introPrivacyText: '🔒 Your data is encrypted and used only for verification',
|
|
105
|
+
transitionIdCapturedText: 'ID captured',
|
|
106
|
+
transitionTitleText: 'Now, a quick selfie',
|
|
107
|
+
transitionSubtitleText: 'Look at your front camera',
|
|
108
|
+
});
|
|
109
|
+
// sdk2 :124-126 verbatim, elapsed time sourced from the shared UI-local
|
|
110
|
+
// warming clock instead of a context-provided timestamp (see header
|
|
111
|
+
// comment; same seam Default and the ID ring port use).
|
|
112
|
+
const timeSinceWarmingStarted = useModelWarmingElapsedMs(modelLoadState, now);
|
|
113
|
+
const warmingProgress = timeSinceWarmingStarted / 5000.0;
|
|
114
|
+
const allModelsReady = modelsReady;
|
|
115
|
+
const ready = sessionReady && allModelsReady && cameraReady;
|
|
116
|
+
const modelLoadProgress = ready
|
|
117
|
+
? 100
|
|
118
|
+
: Math.min(100, modelDownloadProgress * 0.5 + warmingProgress * 49.0);
|
|
119
|
+
useLoadProgressHooks({
|
|
120
|
+
ready,
|
|
121
|
+
modelLoadState,
|
|
122
|
+
modelLoadProgress,
|
|
123
|
+
modelError,
|
|
124
|
+
onLoadingStarted,
|
|
125
|
+
onLoadingProgress,
|
|
126
|
+
onLoadingCompleted,
|
|
127
|
+
onLoadingFailed,
|
|
128
|
+
});
|
|
129
|
+
const [requesting, setRequesting] = useState(false);
|
|
130
|
+
const [transitionHoldElapsed, setTransitionHoldElapsed] = useState(!transitionFromIdCapture);
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (transitionHoldElapsed)
|
|
133
|
+
return undefined;
|
|
134
|
+
const t = setTimeout(() => setTransitionHoldElapsed(true), STAGE_TRANSITION_HOLD_MS);
|
|
135
|
+
return () => clearTimeout(t);
|
|
136
|
+
}, [transitionHoldElapsed]);
|
|
137
|
+
const handleContinue = () => {
|
|
138
|
+
onContinue?.();
|
|
139
|
+
};
|
|
140
|
+
// A thrown camera request (no camera, camera held by another app -- core
|
|
141
|
+
// rethrows every non-permission failure) returns the user to the intro to
|
|
142
|
+
// retry; without this the settled latch would advance the stage to a ring
|
|
143
|
+
// that can never become ready.
|
|
144
|
+
const [startFailed, setStartFailed] = useState(false);
|
|
145
|
+
const stage = startFailed
|
|
146
|
+
? requesting
|
|
147
|
+
? 'requesting'
|
|
148
|
+
: 'intro'
|
|
149
|
+
: selectRingOverlayStage({
|
|
150
|
+
showIntroScreen,
|
|
151
|
+
cameraAccessRequested,
|
|
152
|
+
requesting,
|
|
153
|
+
});
|
|
154
|
+
const effectiveAutoContinue = autoContinueAfterLoading || showIntroScreen;
|
|
155
|
+
const handleStartFromIntro = async () => {
|
|
156
|
+
// The Ladda spinner strips the button's disabled attribute, so keyboard
|
|
157
|
+
// activation can re-fire while the request is pending -- guard re-entry.
|
|
158
|
+
if (requesting)
|
|
159
|
+
return;
|
|
160
|
+
setRequesting(true);
|
|
161
|
+
try {
|
|
162
|
+
await onRequestCamera?.();
|
|
163
|
+
setStartFailed(false);
|
|
164
|
+
}
|
|
165
|
+
catch {
|
|
166
|
+
setStartFailed(true);
|
|
167
|
+
}
|
|
168
|
+
finally {
|
|
169
|
+
setRequesting(false);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
useAutoContinueWhenReady({
|
|
173
|
+
enabled: effectiveAutoContinue &&
|
|
174
|
+
transitionHoldElapsed &&
|
|
175
|
+
// Never dismiss into capture while the intro tap's permission prompt
|
|
176
|
+
// is still settling.
|
|
177
|
+
!requesting,
|
|
178
|
+
ready,
|
|
179
|
+
onContinue: handleContinue,
|
|
180
|
+
});
|
|
181
|
+
const statusKey = selectRingStatusKey({
|
|
182
|
+
ready,
|
|
183
|
+
sessionReady,
|
|
184
|
+
modelLoadState,
|
|
185
|
+
cameraReady,
|
|
186
|
+
});
|
|
187
|
+
const statusText = {
|
|
188
|
+
ready: verbiage.ringReadyText,
|
|
189
|
+
authenticating: verbiage.sessionCheckingText,
|
|
190
|
+
downloading: downloadingLabel(verbiage.downloadingText, modelDownloadProgress),
|
|
191
|
+
warming: verbiage.modelsWarmingUpText,
|
|
192
|
+
camera: verbiage.ringCameraWarmingText,
|
|
193
|
+
}[statusKey];
|
|
194
|
+
const ringBaseColor = theme.selfieCapture?.loadingOverlay?.progressBarBackgroundColor ??
|
|
195
|
+
'var(--idm-color-primary-500)';
|
|
196
|
+
const trackColor = `color-mix(in srgb, ${ringBaseColor} 18%, white)`;
|
|
197
|
+
const fillColor = theme.selfieCapture?.loadingOverlay?.progressBarIndicatorColor ??
|
|
198
|
+
'var(--idm-color-primary-500)';
|
|
199
|
+
// A plain node, not a component defined in render: a fresh component type
|
|
200
|
+
// every render would remount the ring and restart its transition.
|
|
201
|
+
const builtInRing = (_jsx(RingProgress, { progress: modelLoadProgress, trackColor: trackColor, fillColor: fillColor, className: classNames.ring, trackClassName: classNames.ringTrack, fillClassName: classNames.ringFill }));
|
|
202
|
+
// The customer's `loadingSpinner` stands in for the ring, and is handed the
|
|
203
|
+
// same download percentage that drives it — otherwise adopting their
|
|
204
|
+
// component would have downgraded a real progress indicator to a spinner.
|
|
205
|
+
const ringProgressNode = (_jsx(CustomerLoadingSpinner, { stage: "model-loading", progress: modelLoadProgress, fallback: builtInRing }));
|
|
206
|
+
const statusLineNode = (_jsx(StatusLine, { "aria-live": "polite", className: classNames.statusLine, children: statusText }));
|
|
207
|
+
return (_jsx(OverlayContainer, { className: classNames.container, children: _jsxs(RingOverlayInner, { className: classNames.inner, "$softEntry": transitionFromIdCapture, children: [onUserCancel && (_jsx(ExitCaptureButton, { onClick: onUserCancel, className: classNames.cancelBtn })), stage === 'ring' ? (_jsxs(RingLayout, { children: [transitionFromIdCapture && !customOverlayContent ? (_jsx(RingStageTransition, { completedText: verbiage.transitionIdCapturedText, titleText: verbiage.transitionTitleText, subtitleText: verbiage.transitionSubtitleText, nextStageEmoji: assets.transitionEmoji ?? '🤳', badgeColor: fillColor, showLoadingRow: !ready, loadingRow: _jsxs(_Fragment, { children: [ringProgressNode, statusLineNode] }), classNames: classNames })) : (_jsxs(_Fragment, { children: [ringProgressNode, customOverlayContent || (_jsxs(_Fragment, { children: [statusLineNode, _jsx(SubText, { className: classNames.subText, children: verbiage.ringOnlyHappensOnceText })] }))] })), !effectiveAutoContinue &&
|
|
208
|
+
(ready ||
|
|
209
|
+
theme.selfieCapture?.loadingOverlay
|
|
210
|
+
?.displayDisabledContinueBtn) && (_jsx(ContinueButton, { autoFocus: true, finished: ready, disabled: !ready, className: classNames.continueBtn, variant: "positive", colors: colors.continueBtn, onClick: handleContinue, children: ready ? verbiage.continueText : verbiage.pleaseWaitText }))] })) : (_jsx(RingIntroScreen, { title: verbiage.introTitleText, subtitle: verbiage.introSubtitleText, step1Text: verbiage.introStep1Text, step2Text: verbiage.introStep2Text, step1Emoji: assets.introStep1Emoji ?? '🤳', step2Emoji: assets.introStep2Emoji ?? '🤳', reassuranceChipText: verbiage.introReassuranceChipText, startButtonText: verbiage.introEnableCameraText, requestingButtonText: verbiage.introRequestingCameraText, requesting: stage === 'requesting', privacyText: verbiage.introPrivacyText, badgeColor: fillColor, chipTint: trackColor, onStart: handleStartFromIntro, classNames: classNames, buttonColors: colors.continueBtn }))] }) }));
|
|
211
|
+
};
|
|
212
|
+
const overlayFadeIn = keyframes `
|
|
213
|
+
from { opacity: 0; }
|
|
214
|
+
to { opacity: 1; }
|
|
215
|
+
`;
|
|
216
|
+
const RingOverlayInner = styled(LoadingOverlayInner) `
|
|
217
|
+
background: ${(props) => {
|
|
218
|
+
const tintBase = props.theme?.selfieCapture?.loadingOverlay?.backgroundColor ??
|
|
219
|
+
'var(--idm-color-primary-500)';
|
|
220
|
+
return `linear-gradient(180deg, #ffffff, color-mix(in srgb, ${tintBase} 45%, #ffffff))`;
|
|
221
|
+
}};
|
|
222
|
+
color: ${(props) => props.theme?.selfieCapture?.loadingOverlay?.textColor ?? '#12211d'};
|
|
223
|
+
${(props) => props.$softEntry
|
|
224
|
+
? css `
|
|
225
|
+
animation: ${overlayFadeIn} 250ms ease-out both;
|
|
226
|
+
`
|
|
227
|
+
: ''}
|
|
228
|
+
`;
|
|
229
|
+
const RingLayout = styled.div `
|
|
230
|
+
position: absolute;
|
|
231
|
+
inset: 0;
|
|
232
|
+
display: flex;
|
|
233
|
+
flex-direction: column;
|
|
234
|
+
align-items: center;
|
|
235
|
+
justify-content: center;
|
|
236
|
+
gap: 14px;
|
|
237
|
+
padding: 40px;
|
|
238
|
+
text-align: center;
|
|
239
|
+
`;
|
|
240
|
+
const StatusLine = styled.div `
|
|
241
|
+
font-size: 15px;
|
|
242
|
+
font-weight: 600;
|
|
243
|
+
min-height: 22px;
|
|
244
|
+
`;
|
|
245
|
+
const SubText = styled.div `
|
|
246
|
+
font-size: 13px;
|
|
247
|
+
opacity: 0.65;
|
|
248
|
+
`;
|
|
249
|
+
const ContinueButton = styled(LoaderButton) `
|
|
250
|
+
margin-top: 10px;
|
|
251
|
+
white-space: nowrap;
|
|
252
|
+
${(props) => props.theme?.selfieCapture?.loadingOverlay?.continueBtnBorder
|
|
253
|
+
? `border: ${props.theme?.selfieCapture?.loadingOverlay?.continueBtnBorder};`
|
|
254
|
+
: ''}
|
|
255
|
+
|
|
256
|
+
&.disabled {
|
|
257
|
+
background: ${(props) => props.theme?.selfieCapture?.loadingOverlay
|
|
258
|
+
?.continueBtnDisabledBackgroundColor ??
|
|
259
|
+
'var(--idm-color-positive-600)'};
|
|
260
|
+
color: ${(props) => props.theme?.selfieCapture?.loadingOverlay
|
|
261
|
+
?.continueBtnDisabledTextColor ?? 'white'};
|
|
262
|
+
border: ${(props) => props.theme?.selfieCapture?.loadingOverlay?.continueBtnDisabledBorder ??
|
|
263
|
+
'none'};
|
|
264
|
+
}
|
|
265
|
+
`;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type IdCardGuideStatus } from '../guides/IdCaptureGuidesCommon';
|
|
3
|
+
import { type IdCaptureGuideImages } from '../guide_images';
|
|
4
|
+
import type { FlipIdPromptClassNames } from '../guides/FlipIdPrompt';
|
|
5
|
+
import type { FaceGuideStatus } from '../selfie/FaceCaptureGuideOverlay';
|
|
6
|
+
export type VideoIdCaptureGuideAction = 'SHOW_ID_FRONT' | 'FLIP_ID' | 'SHOW_ID_BACK' | 'SHOW_PASSPORT';
|
|
7
|
+
export type VideoIdCaptureGuidesClassNames = {
|
|
8
|
+
container?: string;
|
|
9
|
+
faceGuideContainer?: string;
|
|
10
|
+
faceGuide?: string;
|
|
11
|
+
idCardGuideContainer?: string;
|
|
12
|
+
idCardGuideInner?: string;
|
|
13
|
+
idCardGuideImageContainer?: string;
|
|
14
|
+
idCardGuideImage?: string;
|
|
15
|
+
instructionsContainer?: string;
|
|
16
|
+
instructions?: string;
|
|
17
|
+
/** The flip animation shown while the user turns the card over. */
|
|
18
|
+
flipIdPrompt?: FlipIdPromptClassNames;
|
|
19
|
+
};
|
|
20
|
+
export type VideoIdCaptureGuidesProps = {
|
|
21
|
+
requestedAction?: VideoIdCaptureGuideAction;
|
|
22
|
+
idDocumentType?: 'idCard' | 'passport';
|
|
23
|
+
instruction?: ReactNode;
|
|
24
|
+
satisfied?: boolean;
|
|
25
|
+
faceGuideStatus?: FaceGuideStatus;
|
|
26
|
+
faceGuideBorderWidth?: number;
|
|
27
|
+
faceGuideBorderColor?: string;
|
|
28
|
+
idCardGuideStatus?: IdCardGuideStatus;
|
|
29
|
+
idCardGuideBorderWidth?: number;
|
|
30
|
+
idCardGuideBorderColor?: string;
|
|
31
|
+
idCardCaptureProgress?: number;
|
|
32
|
+
images?: IdCaptureGuideImages;
|
|
33
|
+
isMirrored?: boolean;
|
|
34
|
+
classNames?: VideoIdCaptureGuidesClassNames;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The combined face-over-document guide used by SDK2's Video ID recording
|
|
38
|
+
* stage. Unlike the standalone ID overlay, both subjects remain framed in a
|
|
39
|
+
* single camera composition while the document advances through its stages.
|
|
40
|
+
*/
|
|
41
|
+
export declare function VideoIdCaptureGuides({ requestedAction, idDocumentType, instruction, satisfied, faceGuideStatus, faceGuideBorderWidth, faceGuideBorderColor, idCardGuideStatus, idCardGuideBorderWidth, idCardGuideBorderColor, idCardCaptureProgress, images: suppliedImages, isMirrored, classNames, }: VideoIdCaptureGuidesProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=VideoIdCaptureGuides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoIdCaptureGuides.d.ts","sourceRoot":"","sources":["../../../src/components/videoId/VideoIdCaptureGuides.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AAId,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAGL,KAAK,oBAAoB,EAG1B,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAIxE,MAAM,MAAM,yBAAyB,GACjC,eAAe,GACf,SAAS,GACT,cAAc,GACd,eAAe,CAAA;AAEnB,MAAM,MAAM,8BAA8B,GAAG;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,yBAAyB,CAAC,EAAE,MAAM,CAAA;IAClC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,mEAAmE;IACnE,YAAY,CAAC,EAAE,sBAAsB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,eAAe,CAAC,EAAE,yBAAyB,CAAA;IAC3C,cAAc,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IACtC,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,eAAe,CAAC,EAAE,eAAe,CAAA;IACjC,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,8BAA8B,CAAA;CAC5C,CAAA;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,eAAiC,EACjC,cAAyB,EACzB,WAAW,EACX,SAAiB,EACjB,eAA2B,EAC3B,oBAAoB,EACpB,oBAAoB,EACpB,iBAA2B,EAC3B,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,EAAE,cAA4C,EACpD,UAAkB,EAClB,UAAe,GAChB,EAAE,yBAAyB,2CAyI3B"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useState, } from 'react';
|
|
3
|
+
import { styled, useTheme } from 'styled-components';
|
|
4
|
+
import { isMobile } from '../../utils/isMobile';
|
|
5
|
+
import { GuidanceMessage } from '../GuidanceMessage';
|
|
6
|
+
import { IdCardGuideImage, IdCardGuideImageContainer, } from '../guides/IdCaptureGuidesCommon';
|
|
7
|
+
import { defaultIdCaptureGuideImages, getOrientation, useGuideImages, useGuideImagesByUrl, } from '../guide_images';
|
|
8
|
+
import { SelfieCaptureAnimatedMaskWithStatus } from '../selfie/SelfieCaptureAnimatedMask';
|
|
9
|
+
import useResizeObserver from '../../layout/useResizeObserver';
|
|
10
|
+
/**
|
|
11
|
+
* The combined face-over-document guide used by SDK2's Video ID recording
|
|
12
|
+
* stage. Unlike the standalone ID overlay, both subjects remain framed in a
|
|
13
|
+
* single camera composition while the document advances through its stages.
|
|
14
|
+
*/
|
|
15
|
+
export function VideoIdCaptureGuides({ requestedAction = 'SHOW_ID_FRONT', idDocumentType = 'idCard', instruction, satisfied = false, faceGuideStatus = 'success', faceGuideBorderWidth, faceGuideBorderColor, idCardGuideStatus = 'ready', idCardGuideBorderWidth, idCardGuideBorderColor, idCardCaptureProgress, images: suppliedImages = defaultIdCaptureGuideImages, isMirrored = false, classNames = {}, }) {
|
|
16
|
+
const theme = useTheme();
|
|
17
|
+
const resolvedFaceBorderWidth = faceGuideBorderWidth ?? theme.idVideoCapture?.faceGuides?.borderWidth ?? 5;
|
|
18
|
+
const resolvedFaceBorderColor = faceGuideBorderColor ??
|
|
19
|
+
(satisfied
|
|
20
|
+
? theme.idVideoCapture?.faceGuides?.satisfiedColor
|
|
21
|
+
: theme.idVideoCapture?.faceGuides?.unsatisfiedColor) ??
|
|
22
|
+
'#D6DCE7';
|
|
23
|
+
const resolvedIdBorderWidth = idCardGuideBorderWidth ??
|
|
24
|
+
theme.idVideoCapture?.idCardGuides?.borderWidth ??
|
|
25
|
+
20;
|
|
26
|
+
const resolvedIdBorderColor = idCardGuideBorderColor ??
|
|
27
|
+
(satisfied
|
|
28
|
+
? theme.idVideoCapture?.idCardGuides?.satisfiedColor
|
|
29
|
+
: theme.idVideoCapture?.idCardGuides?.unsatisfiedColor) ??
|
|
30
|
+
'#D6DCE7';
|
|
31
|
+
const { ref: idCardGuideRef, width: idCardGuideWidth = 0, height: idCardGuideHeight = 0, } = useResizeObserver();
|
|
32
|
+
const images = useGuideImages(suppliedImages);
|
|
33
|
+
const imagesByUrl = useGuideImagesByUrl(images);
|
|
34
|
+
const currentImage = idDocumentType === 'passport'
|
|
35
|
+
? images.landscape.SHOW_PASSPORT
|
|
36
|
+
: requestedAction === 'SHOW_ID_BACK'
|
|
37
|
+
? images.landscape.SHOW_ID_BACK
|
|
38
|
+
: images.landscape.SHOW_ID_FRONT;
|
|
39
|
+
const [aspectRatio, setAspectRatio] = useState(currentImage.width / currentImage.height);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
setAspectRatio(currentImage.width / currentImage.height);
|
|
42
|
+
}, [currentImage.height, currentImage.width]);
|
|
43
|
+
const onImageLoaded = useCallback((event) => {
|
|
44
|
+
const image = event.currentTarget;
|
|
45
|
+
const configured = imagesByUrl[image.src];
|
|
46
|
+
const naturalWidth = configured?.width ?? image.naturalWidth;
|
|
47
|
+
const naturalHeight = configured?.height ?? image.naturalHeight;
|
|
48
|
+
if (naturalWidth > 0 && naturalHeight > 0) {
|
|
49
|
+
setAspectRatio(naturalWidth / naturalHeight);
|
|
50
|
+
}
|
|
51
|
+
}, [imagesByUrl]);
|
|
52
|
+
const imageStyle = useMemo(() => ({
|
|
53
|
+
maxWidth: idCardGuideWidth > idCardGuideHeight ? idCardGuideWidth : undefined,
|
|
54
|
+
maxHeight: idCardGuideHeight > idCardGuideWidth ? idCardGuideHeight : undefined,
|
|
55
|
+
height: '100%',
|
|
56
|
+
aspectRatio,
|
|
57
|
+
}), [aspectRatio, idCardGuideHeight, idCardGuideWidth]);
|
|
58
|
+
return (_jsx(Container, { className: classNames.container, children: _jsxs(Inner, { children: [_jsx(FaceGuideContainer, { className: classNames.faceGuideContainer, children: _jsx(SelfieCaptureAnimatedMaskWithStatus, { className: classNames.faceGuide, status: faceGuideStatus, borderWidth: resolvedFaceBorderWidth, borderColor: resolvedFaceBorderColor, verticalAlign: "bottom" }) }), _jsx(IdCardGuideContainer, { ref: idCardGuideRef, className: classNames.idCardGuideContainer, children: _jsxs(IdCardGuideInner, { className: classNames.idCardGuideInner, style: { aspectRatio }, children: [_jsx(StyledIdCardGuideImageContainer, { className: classNames.idCardGuideImageContainer, status: idCardGuideStatus, borderWidth: resolvedIdBorderWidth, borderColor: resolvedIdBorderColor, aspectRatio: aspectRatio, "$isVisible": requestedAction !== 'FLIP_ID', progress: idCardCaptureProgress, children: _jsx(IdCardGuideImage, { alt: "", className: classNames.idCardGuideImage, "$isMirrored": isMirrored, style: imageStyle, src: currentImage.url, onLoad: onImageLoaded }) }), requestedAction === 'FLIP_ID' ? (_jsx(VideoIdCaptureFlipPrompt, { images: images, isMirrored: isMirrored, borderWidth: resolvedIdBorderWidth, borderColor: resolvedIdBorderColor, imageStyle: imageStyle, aspectRatio: aspectRatio, classNames: classNames.flipIdPrompt })) : null] }) }), _jsx(InstructionsContainer, { className: classNames.instructionsContainer, children: _jsx(Instructions, { className: classNames.instructions, "$textColor": theme.idVideoCapture?.idCardGuides?.instructionsTextColor, "$background": theme.idVideoCapture?.idCardGuides?.instructionsBackgroundColor, children: instruction }) })] }) }));
|
|
59
|
+
}
|
|
60
|
+
function VideoIdCaptureFlipPrompt({ images, isMirrored, borderWidth, borderColor, imageStyle, aspectRatio, classNames = {}, }) {
|
|
61
|
+
const orientation = getOrientation(true);
|
|
62
|
+
const [transitionTime, setTransitionTime] = useState(1);
|
|
63
|
+
const [rotationAngle, setRotationAngle] = useState(0);
|
|
64
|
+
const frontTransforms = [`rotateY(${rotationAngle}deg)`];
|
|
65
|
+
const backTransforms = [`rotateY(${180 - rotationAngle}deg)`];
|
|
66
|
+
if (isMirrored) {
|
|
67
|
+
frontTransforms.push('scaleX(-1)');
|
|
68
|
+
backTransforms.push('scaleX(-1)');
|
|
69
|
+
}
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
let timeout;
|
|
72
|
+
const flip = () => {
|
|
73
|
+
setTransitionTime(1);
|
|
74
|
+
setRotationAngle(180);
|
|
75
|
+
timeout = setTimeout(() => {
|
|
76
|
+
setTransitionTime(0);
|
|
77
|
+
setRotationAngle(0);
|
|
78
|
+
}, 1500);
|
|
79
|
+
};
|
|
80
|
+
const interval = setInterval(flip, 2500);
|
|
81
|
+
timeout = setTimeout(flip, 250);
|
|
82
|
+
return () => {
|
|
83
|
+
clearInterval(interval);
|
|
84
|
+
clearTimeout(timeout);
|
|
85
|
+
};
|
|
86
|
+
}, []);
|
|
87
|
+
return (_jsxs(FlipWrapper, { style: { aspectRatio }, children: [_jsx(FlipImageContainer, { status: "disabled", borderWidth: borderWidth, borderColor: borderColor, "$transforms": frontTransforms.join(' '), "$transitionTime": transitionTime, "$isMobile": isMobile(), "$isLandscape": orientation === 'landscape', "$isVisible": true, aspectRatio: aspectRatio, className: classNames.frontImageContainer, children: _jsx(IdCardGuideImage, { src: images.landscape.SHOW_ID_FRONT.url, alt: "", style: imageStyle, className: classNames.frontImage }) }), _jsx(FlipImageContainer, { status: "disabled", borderWidth: borderWidth, borderColor: borderColor, "$transforms": backTransforms.join(' '), "$transitionTime": transitionTime, "$isMobile": isMobile(), "$isLandscape": orientation === 'landscape', "$isVisible": true, aspectRatio: aspectRatio, className: classNames.backImageContainer, children: _jsx(IdCardGuideImage, { src: images.landscape.SHOW_ID_BACK.url, alt: "", style: imageStyle, className: classNames.backImage }) })] }));
|
|
88
|
+
}
|
|
89
|
+
const Container = styled.div `
|
|
90
|
+
position: absolute;
|
|
91
|
+
inset: 0;
|
|
92
|
+
z-index: 1000;
|
|
93
|
+
display: flex;
|
|
94
|
+
max-height: 100%;
|
|
95
|
+
width: 100%;
|
|
96
|
+
height: 100%;
|
|
97
|
+
padding: 40px;
|
|
98
|
+
box-sizing: border-box;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
font-family: ${(props) => props.theme?.fontFamily};
|
|
101
|
+
`;
|
|
102
|
+
const Inner = styled.div `
|
|
103
|
+
position: relative;
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
width: 100%;
|
|
109
|
+
height: 100%;
|
|
110
|
+
max-height: 1280px;
|
|
111
|
+
margin: auto;
|
|
112
|
+
`;
|
|
113
|
+
const FaceGuideContainer = styled.div `
|
|
114
|
+
position: relative;
|
|
115
|
+
height: 65%;
|
|
116
|
+
`;
|
|
117
|
+
const IdCardGuideContainer = styled.div `
|
|
118
|
+
position: relative;
|
|
119
|
+
display: flex;
|
|
120
|
+
flex-flow: column nowrap;
|
|
121
|
+
width: 100%;
|
|
122
|
+
max-width: 100%;
|
|
123
|
+
height: 35%;
|
|
124
|
+
margin: 0 auto;
|
|
125
|
+
`;
|
|
126
|
+
const IdCardGuideInner = styled.div `
|
|
127
|
+
position: relative;
|
|
128
|
+
width: 100%;
|
|
129
|
+
height: 100%;
|
|
130
|
+
`;
|
|
131
|
+
const StyledIdCardGuideImageContainer = styled(IdCardGuideImageContainer) `
|
|
132
|
+
width: auto;
|
|
133
|
+
height: 100%;
|
|
134
|
+
`;
|
|
135
|
+
const InstructionsContainer = styled.div `
|
|
136
|
+
position: absolute;
|
|
137
|
+
right: 0;
|
|
138
|
+
bottom: 16px;
|
|
139
|
+
left: 0;
|
|
140
|
+
display: flex;
|
|
141
|
+
flex-direction: column;
|
|
142
|
+
justify-content: end;
|
|
143
|
+
width: 100%;
|
|
144
|
+
box-sizing: border-box;
|
|
145
|
+
color: white;
|
|
146
|
+
text-align: center;
|
|
147
|
+
`;
|
|
148
|
+
const Instructions = styled(GuidanceMessage) `
|
|
149
|
+
align-content: center;
|
|
150
|
+
padding: 8px 12px;
|
|
151
|
+
font-size: 18px;
|
|
152
|
+
font-weight: 700;
|
|
153
|
+
`;
|
|
154
|
+
const FlipWrapper = styled.div `
|
|
155
|
+
position: absolute;
|
|
156
|
+
top: 50%;
|
|
157
|
+
left: 50%;
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: center;
|
|
160
|
+
justify-content: center;
|
|
161
|
+
height: 100%;
|
|
162
|
+
transform: translate(-50%, -50%);
|
|
163
|
+
`;
|
|
164
|
+
const FlipImageContainer = styled(IdCardGuideImageContainer) `
|
|
165
|
+
position: absolute;
|
|
166
|
+
top: 0;
|
|
167
|
+
display: block;
|
|
168
|
+
height: 100%;
|
|
169
|
+
backface-visibility: hidden;
|
|
170
|
+
transition: transform ${(props) => props.$transitionTime}s;
|
|
171
|
+
transform: ${(props) => props.$transforms};
|
|
172
|
+
transform-style: preserve-3d;
|
|
173
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { ClientState, IdmissionClient, SessionCheckState } from '@idmission/websdk-core/client';
|
|
3
|
+
export type AuthStateContextValue = {
|
|
4
|
+
client: IdmissionClient;
|
|
5
|
+
state: ClientState;
|
|
6
|
+
sessionReady: boolean;
|
|
7
|
+
retry: () => Promise<SessionCheckState>;
|
|
8
|
+
};
|
|
9
|
+
export type AuthProviderProps = {
|
|
10
|
+
client: IdmissionClient;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
autoValidate?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function AuthProvider({ client, children, autoValidate, }: AuthProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function useAuthState(): AuthStateContextValue;
|
|
16
|
+
/**
|
|
17
|
+
* Session readiness for components that may render OUTSIDE a flow.
|
|
18
|
+
*
|
|
19
|
+
* The capture views are mounted both by the flows (always inside
|
|
20
|
+
* `AuthProvider`) and directly — by Storybook, the headless demo, and hosts
|
|
21
|
+
* driving a single stage. `useAuthState` throws without a provider, which is
|
|
22
|
+
* right for the flows and wrong for those, so this reports `true` when there
|
|
23
|
+
* is no session to wait for.
|
|
24
|
+
*
|
|
25
|
+
* This is what lets a view render its own loading overlay while the session is
|
|
26
|
+
* still validating, which is how 2.x behaved: all three of its loading overlay
|
|
27
|
+
* variants read `useAuthContext()` themselves
|
|
28
|
+
* (sdk2 IdCaptureLoadingOverlay{Ring,Default,Legacy}.tsx), so the capture
|
|
29
|
+
* wizard was mounted throughout the session check and its overlay was the ONE
|
|
30
|
+
* loading surface.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useSessionReady(): boolean;
|
|
33
|
+
//# sourceMappingURL=AuthStateContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthStateContext.d.ts","sourceRoot":"","sources":["../../src/flows/AuthStateContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,iBAAiB,EAClB,MAAM,+BAA+B,CAAA;AAEtC,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,WAAW,CAAA;IAClB,YAAY,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;CACxC,CAAA;AAID,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,QAAQ,EACR,YAAmB,GACpB,EAAE,iBAAiB,2CA6BnB;AAED,wBAAgB,YAAY,IAAI,qBAAqB,CAMpD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAGzC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useMemo, useRef, useSyncExternalStore, } from 'react';
|
|
3
|
+
const AuthStateContext = createContext(null);
|
|
4
|
+
export function AuthProvider({ client, children, autoValidate = true, }) {
|
|
5
|
+
const validatedClientRef = useRef(null);
|
|
6
|
+
const state = useSyncExternalStore(client.subscribe, client.getState, client.getState);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (!autoValidate || validatedClientRef.current === client)
|
|
9
|
+
return;
|
|
10
|
+
validatedClientRef.current = client;
|
|
11
|
+
void client.validateSession();
|
|
12
|
+
}, [autoValidate, client]);
|
|
13
|
+
const value = useMemo(() => ({
|
|
14
|
+
client,
|
|
15
|
+
state,
|
|
16
|
+
sessionReady: state.session.sessionCheckState === 'PASSED',
|
|
17
|
+
retry: client.retrySession,
|
|
18
|
+
}), [client, state]);
|
|
19
|
+
return (_jsx(AuthStateContext.Provider, { value: value, children: children }));
|
|
20
|
+
}
|
|
21
|
+
export function useAuthState() {
|
|
22
|
+
const context = useContext(AuthStateContext);
|
|
23
|
+
if (!context) {
|
|
24
|
+
throw new Error('useAuthState must be used inside AuthProvider');
|
|
25
|
+
}
|
|
26
|
+
return context;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Session readiness for components that may render OUTSIDE a flow.
|
|
30
|
+
*
|
|
31
|
+
* The capture views are mounted both by the flows (always inside
|
|
32
|
+
* `AuthProvider`) and directly — by Storybook, the headless demo, and hosts
|
|
33
|
+
* driving a single stage. `useAuthState` throws without a provider, which is
|
|
34
|
+
* right for the flows and wrong for those, so this reports `true` when there
|
|
35
|
+
* is no session to wait for.
|
|
36
|
+
*
|
|
37
|
+
* This is what lets a view render its own loading overlay while the session is
|
|
38
|
+
* still validating, which is how 2.x behaved: all three of its loading overlay
|
|
39
|
+
* variants read `useAuthContext()` themselves
|
|
40
|
+
* (sdk2 IdCaptureLoadingOverlay{Ring,Default,Legacy}.tsx), so the capture
|
|
41
|
+
* wizard was mounted throughout the session check and its overlay was the ONE
|
|
42
|
+
* loading surface.
|
|
43
|
+
*/
|
|
44
|
+
export function useSessionReady() {
|
|
45
|
+
const context = useContext(AuthStateContext);
|
|
46
|
+
return context ? context.sessionReady : true;
|
|
47
|
+
}
|