@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,137 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Divergence 4 rewiring vs sdk2's IdCaptureGuideOverlay.tsx:
|
|
3
|
+
// - `dispatch({type: 'guideImageLoaded', payload: {width, height}})` (which
|
|
4
|
+
// fed IdCaptureFitGuide's store-read aspect-ratio fallback) is gone —
|
|
5
|
+
// FitGuide now reads `useGuideOrientationContext().imageAspectRatio`
|
|
6
|
+
// directly (see IdCaptureFitGuide.tsx's header comment). The
|
|
7
|
+
// `<img onLoad>` handler still exists, but now corrects
|
|
8
|
+
// `imageAspectRatio` (already seeded from the static guide-image config
|
|
9
|
+
// metadata by the effect below) against the actual loaded image's
|
|
10
|
+
// measured `naturalWidth`/`naturalHeight` via the same context setter —
|
|
11
|
+
// the "local state" divergence-4 calls for, landing in
|
|
12
|
+
// GuideOrientationContext instead of a new dispatch/global store.
|
|
13
|
+
import { useEffect } from 'react';
|
|
14
|
+
import { styled, useTheme } from 'styled-components';
|
|
15
|
+
import { isMobile } from '../../utils/isMobile';
|
|
16
|
+
import { IdCardGuideImage, IdCardGuideImageContainer, } from './IdCaptureGuidesCommon';
|
|
17
|
+
import { FlipIdPrompt } from './FlipIdPrompt';
|
|
18
|
+
import { useGuideOrientationContext } from '../../layout/GuideOrientationContext';
|
|
19
|
+
import { defaultIdCaptureGuideImages, getOrientation, useImagesWithBackToFront, } from '../guide_images';
|
|
20
|
+
import useResizeObserver from '../../layout/useResizeObserver';
|
|
21
|
+
export const IdCaptureGuideOverlay = ({ classNames = {}, images: userSuppliedImages = defaultIdCaptureGuideImages, padding: userSuppliedPadding, imagePadding: userSuppliedImagePadding, imageVisible = true, borderWidth, borderColor, idCardBorderWidth = '2.5%', idCardBorderColor = 'white', maskColor, isMirrored = false, isBackToFront = false, portraitGuidesOnMobile = true, instruction = '', requestedAction = 'SHOW_ID_FRONT', progress = 0, status = 'ready', guideBoxDisabled = false, onClick, }) => {
|
|
22
|
+
const { wrapperRef, wrapperWidth, imageAspectRatio, wrapperAspectRatio, setImageAspectRatio, } = useGuideOrientationContext();
|
|
23
|
+
const { ref: innerRef, width: innerWidth, height: innerHeight, } = useResizeObserver();
|
|
24
|
+
const theme = useTheme();
|
|
25
|
+
if (borderWidth === undefined)
|
|
26
|
+
borderWidth = theme.idCapture?.guideBox?.borderWidth ?? 4;
|
|
27
|
+
const padding = userSuppliedPadding ??
|
|
28
|
+
(isMobile()
|
|
29
|
+
? (theme.idCapture?.guideBox?.mobilePadding ?? 0)
|
|
30
|
+
: (theme.idCapture?.guideBox?.desktopPadding ?? 50));
|
|
31
|
+
const paddingAndBorderPx = padding * 2 + (borderWidth ?? 0) * 2;
|
|
32
|
+
const images = useImagesWithBackToFront(userSuppliedImages, isBackToFront);
|
|
33
|
+
const orientation = getOrientation(portraitGuidesOnMobile);
|
|
34
|
+
const currentImage = images[orientation][requestedAction === 'FLIP_ID' ? 'SHOW_ID_FRONT' : requestedAction];
|
|
35
|
+
const imagePadding = userSuppliedImagePadding ??
|
|
36
|
+
(isMobile()
|
|
37
|
+
? (theme.idCapture?.guideBox?.mobileImagePadding ?? 0)
|
|
38
|
+
: (theme.idCapture?.guideBox?.imagePadding ?? 50));
|
|
39
|
+
const centerRegionMinWidth = imageAspectRatio >= wrapperAspectRatio
|
|
40
|
+
? wrapperWidth - paddingAndBorderPx
|
|
41
|
+
: undefined;
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setImageAspectRatio(currentImage.width / currentImage.height);
|
|
44
|
+
}, [currentImage.height, currentImage.width, setImageAspectRatio]);
|
|
45
|
+
function onImageLoaded(event) {
|
|
46
|
+
const img = event.currentTarget;
|
|
47
|
+
if (img.naturalWidth && img.naturalHeight) {
|
|
48
|
+
setImageAspectRatio(img.naturalWidth / img.naturalHeight);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return (_jsx(StyledPageContainer, { ref: wrapperRef, onClick: onClick, className: classNames.container, children: _jsxs(GuidesContainer, { className: classNames.inner, children: [_jsx(GuideRegion, { "$maskColor": maskColor, "$minHeight": padding, className: regionClsx(classNames, 'Top'), children: !!instruction && (_jsx(GuideText, { className: classNames.guideText, children: instruction })) }), _jsxs(GuideCenterRow, { className: classNames.centerRow, children: [_jsx(Spacer, { "$maskColor": maskColor, "$minWidth": padding, className: regionClsx(classNames, 'Left') }), _jsx(GuideCenterRegion, { "$minWidth": centerRegionMinWidth, "$isMirrored": isMirrored, className: classNames.centerRegion, children: _jsx(GuideCenterBorder, { "$borderWidth": borderWidth ?? 0, "$borderColor": borderColor, "$padding": imagePadding, className: classNames.centerRegionBorder, children: _jsxs(GuideCenterInner, { "$isLandscape": orientation === 'landscape', ref: innerRef, className: classNames.centerRegionInner, style: { aspectRatio: imageAspectRatio }, id: "sam", children: [_jsx(IdCardGuideImageContainer, { "$isMobile": isMobile(), "$isLandscape": orientation === 'landscape', status: status, progress: progress, guideBoxDisabled: guideBoxDisabled, borderWidth: idCardBorderWidth, borderColor: idCardBorderColor, "$isVisible": requestedAction !== 'FLIP_ID', aspectRatio: imageAspectRatio, children: _jsx(IdCardGuideImage, { alt: "", src: currentImage.url, onLoad: onImageLoaded, className: classNames.image, "$isInvisible": !imageVisible, "$isMirrored": isMirrored, width: innerWidth || currentImage.width, height: innerHeight || currentImage.height }) }), requestedAction === 'FLIP_ID' && (_jsx(FlipIdPrompt, { images: images, borderWidth: idCardBorderWidth, borderColor: idCardBorderColor, portraitGuidesOnMobile: portraitGuidesOnMobile, isMirrored: isMirrored, classNames: classNames.flipIdPrompt, width: innerWidth, height: innerHeight }))] }) }) }), _jsx(Spacer, { "$maskColor": maskColor, "$minWidth": padding, className: regionClsx(classNames, 'Right') })] }), _jsx(GuideRegion, { "$maskColor": maskColor, "$minHeight": padding, className: regionClsx(classNames, 'Bottom'), children: !!instruction && (_jsx(GuideText, { style: { opacity: 0 }, children: instruction })) })] }) }));
|
|
52
|
+
};
|
|
53
|
+
const regionClsx = (classNames, which) => [classNames.dimmingRegion, classNames[`dimmingRegion${which}`]]
|
|
54
|
+
.filter((v) => v)
|
|
55
|
+
.join(' ');
|
|
56
|
+
const StyledPageContainer = styled.div `
|
|
57
|
+
position: relative;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
z-index: 1000;
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
`;
|
|
63
|
+
export const GuidesContainer = styled.div `
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-flow: column nowrap;
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 100%;
|
|
68
|
+
`;
|
|
69
|
+
export const GuideCenterRow = styled.div `
|
|
70
|
+
position: relative;
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-flow: row nowrap;
|
|
73
|
+
align-items: center;
|
|
74
|
+
justify-items: center;
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
max-height: 100%;
|
|
78
|
+
min-height: 0;
|
|
79
|
+
flex: 1;
|
|
80
|
+
`;
|
|
81
|
+
export const GuideRegion = styled.div `
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
justify-content: end;
|
|
85
|
+
width: 100%;
|
|
86
|
+
position: relative;
|
|
87
|
+
z-index: 1000;
|
|
88
|
+
background: ${(props) => props.$maskColor ??
|
|
89
|
+
props.theme?.idCapture?.guideOverlay?.backgroundColor ??
|
|
90
|
+
'rgba(0, 0, 0, 0.5)'};
|
|
91
|
+
color: ${(props) => props.theme?.idCapture?.guideOverlay?.textColor ?? 'white'};
|
|
92
|
+
text-align: center;
|
|
93
|
+
${(props) => (props.$minWidth ? `min-width: ${props.$minWidth}px;` : ``)}
|
|
94
|
+
${(props) => (props.$minHeight ? `min-height: ${props.$minHeight}px;` : ``)}
|
|
95
|
+
`;
|
|
96
|
+
export const Spacer = styled(GuideRegion) `
|
|
97
|
+
display: block;
|
|
98
|
+
width: auto;
|
|
99
|
+
`;
|
|
100
|
+
export const GuideCenterRegion = styled.div `
|
|
101
|
+
${(props) => (props.$minWidth ? `min-width: ${props.$minWidth}px;` : ``)}
|
|
102
|
+
${(props) => (props.$isMirrored ? 'transform: scaleX(-1);' : '')}
|
|
103
|
+
transform-style: preserve-3d;
|
|
104
|
+
box-sizing: border-box;
|
|
105
|
+
display: flex;
|
|
106
|
+
flex: 1;
|
|
107
|
+
max-height: 100%;
|
|
108
|
+
height: 100%;
|
|
109
|
+
`;
|
|
110
|
+
export const GuideCenterBorder = styled.div `
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
border: ${(props) => `${props.$borderWidth ?? 4}px solid ${props.$borderColor ?? 'white'}`};
|
|
113
|
+
display: flex;
|
|
114
|
+
flex: 1;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
max-height: 100%;
|
|
117
|
+
min-height: 0;
|
|
118
|
+
max-width: 100%;
|
|
119
|
+
position: relative;
|
|
120
|
+
${(props) => (props.$padding ? `padding: ${props.$padding}px;` : '')}
|
|
121
|
+
`;
|
|
122
|
+
export const GuideText = styled.span `
|
|
123
|
+
align-content: center;
|
|
124
|
+
margin-top: 12px;
|
|
125
|
+
margin-bottom: 12px;
|
|
126
|
+
`;
|
|
127
|
+
export const GuideCenterInner = styled.div `
|
|
128
|
+
position: relative;
|
|
129
|
+
top: 0;
|
|
130
|
+
margin: auto;
|
|
131
|
+
${(props) => (props.$isLandscape ? 'height: 100%;' : 'width: 90%;')}
|
|
132
|
+
max-height: 100%;
|
|
133
|
+
max-width: 100%;
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
justify-content: center;
|
|
137
|
+
`;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type IdCaptureControllerState } from '@idmission/websdk-core/idCapture';
|
|
2
|
+
import { type CustomerSuppliedVerbiage } from '../../i18n';
|
|
3
|
+
import { IdCaptureFitGuideClassNames } from './IdCaptureFitGuide';
|
|
4
|
+
import { type IdCaptureGuideOverlayClassNames } from './IdCaptureGuideOverlay';
|
|
5
|
+
import type { IdCardGuideStatus } from './IdCaptureGuidesCommon';
|
|
6
|
+
import { IdCaptureGuideImages } from '../guide_images';
|
|
7
|
+
import { type BarcodeGuideOverlayClassNames } from '../barcode/BarcodeGuideOverlay';
|
|
8
|
+
/**
|
|
9
|
+
* This router hands the SAME bag to whichever guide renders (`IdCaptureFitGuide`
|
|
10
|
+
* or `IdCaptureGuideOverlay`, plus the barcode overlays), so the type has to
|
|
11
|
+
* admit every key any of them reads. Typing it as the fit guide's bag alone
|
|
12
|
+
* made the overlay-only keys — `dimmingRegion*`, `centerRegion*`, and the whole
|
|
13
|
+
* `flipIdPrompt` sub-bag, all of which ARE rendered and wired — unreachable
|
|
14
|
+
* from `IdCaptureViewClassNames.guides`, so 2.x integrators on `guideType:
|
|
15
|
+
* 'overlay'` silently lost them.
|
|
16
|
+
*/
|
|
17
|
+
export type IdCaptureGuidesClassNames = IdCaptureFitGuideClassNames & IdCaptureGuideOverlayClassNames & BarcodeGuideOverlayClassNames;
|
|
18
|
+
export type IdCaptureGuideType = 'fit' | 'overlay';
|
|
19
|
+
export type IdCaptureGuidesVerbiage = {
|
|
20
|
+
barcodeHeaderText?: CustomerSuppliedVerbiage;
|
|
21
|
+
};
|
|
22
|
+
export type IdCaptureGuidesProps = {
|
|
23
|
+
state: IdCaptureControllerState;
|
|
24
|
+
isRearFacing: boolean;
|
|
25
|
+
guideType?: IdCaptureGuideType;
|
|
26
|
+
/** When true, hides the outer guide-box SVG stack while preserving guide
|
|
27
|
+
* geometry and detection. Defaults to false. sdk2 PR #269. */
|
|
28
|
+
guideBoxDisabled?: boolean;
|
|
29
|
+
/** Fit guides only: draw the guide box on the mask's own rect. See IdCaptureFitGuideProps. */
|
|
30
|
+
guideBoxFollowsMask?: boolean;
|
|
31
|
+
cameraFeedMode?: 'snapToGuides' | 'fullscreen';
|
|
32
|
+
images?: IdCaptureGuideImages;
|
|
33
|
+
classNames?: IdCaptureGuidesClassNames;
|
|
34
|
+
verbiage?: IdCaptureGuidesVerbiage;
|
|
35
|
+
/** Overrides this router's own capturing/ready `status` derivation
|
|
36
|
+
* outright. IdCaptureView (Task 12) passes 'disabled' here while its
|
|
37
|
+
* view-local `overlayDismissed` flag is still false, reproducing sdk2's
|
|
38
|
+
* `!overlayDismissed -> 'disabled'` wizard arm (see header comment).
|
|
39
|
+
* Leave unset for the router's normal capturing/ready derivation. */
|
|
40
|
+
status?: IdCardGuideStatus;
|
|
41
|
+
/** sdk2's wizard prop of the same name (default true): on a portrait
|
|
42
|
+
* viewport the guide art and card outline stand the ID card up. False
|
|
43
|
+
* keeps the landscape guides in every orientation. */
|
|
44
|
+
portraitGuidesOnMobile?: boolean;
|
|
45
|
+
};
|
|
46
|
+
export declare function IdCaptureGuides({ state, isRearFacing, guideType, guideBoxDisabled, guideBoxFollowsMask, cameraFeedMode, images, classNames, verbiage: rawVerbiage, status: statusOverride, portraitGuidesOnMobile, }: IdCaptureGuidesProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
//# sourceMappingURL=IdCaptureGuides.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdCaptureGuides.d.ts","sourceRoot":"","sources":["../../../src/components/guides/IdCaptureGuides.tsx"],"names":[],"mappings":"AA0EA,OAAO,EAAmB,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAEjG,OAAO,EAAmB,KAAK,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC3E,OAAO,EAEL,2BAA2B,EAC5B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,EAA+B,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACnF,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,gCAAgC,CAAA;AAGvC;;;;;;;;GAQG;AACH,MAAM,MAAM,yBAAyB,GAAG,2BAA2B,GACjE,+BAA+B,GAC/B,6BAA6B,CAAA;AAE/B,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,SAAS,CAAA;AAElD,MAAM,MAAM,uBAAuB,GAAG;IACpC,iBAAiB,CAAC,EAAE,wBAAwB,CAAA;CAC7C,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,wBAAwB,CAAA;IAC/B,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,CAAC,EAAE,kBAAkB,CAAA;IAC9B;kEAC8D;IAC9D,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,8FAA8F;IAC9F,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,cAAc,CAAC,EAAE,cAAc,GAAG,YAAY,CAAA;IAC9C,MAAM,CAAC,EAAE,oBAAoB,CAAA;IAC7B,UAAU,CAAC,EAAE,yBAAyB,CAAA;IACtC,QAAQ,CAAC,EAAE,uBAAuB,CAAA;IAClC;;;;yEAIqE;IACrE,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B;;0DAEsD;IACtD,sBAAsB,CAAC,EAAE,OAAO,CAAA;CACjC,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,YAAY,EACZ,SAAiB,EACjB,gBAAwB,EACxB,mBAA2B,EAC3B,cAA+B,EAC/B,MAAoC,EACpC,UAAe,EACf,QAAQ,EAAE,WAAgB,EAC1B,MAAM,EAAE,cAAc,EACtB,sBAA6B,GAC9B,EAAE,oBAAoB,2CA8GtB"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Router port of sdk2's IdCaptureGuides.tsx (:88-157), rewired per divergence
|
|
3
|
+
// 1 (store reads -> controller state prop) and divergence 6 (barcode-
|
|
4
|
+
// recapture instruction override). The wizard-level props sdk2 threaded in
|
|
5
|
+
// individually (status, progress, requestedAction, isBackToFront, colors)
|
|
6
|
+
// are gone from this component's signature — the router now takes the whole
|
|
7
|
+
// `state` and derives each of them itself:
|
|
8
|
+
// - `requestedAction` <- `state.requestedAction` (core's deriveRequestedAction
|
|
9
|
+
// already mirrors the wizard's 4-way guide-art selector, IdCaptureWizard.tsx:1435-1444).
|
|
10
|
+
// - `isBackToFront` <- `state.allowIdCardBackToFrontCapture && 'idCardBack' in
|
|
11
|
+
// state.capturedDocuments` (wizard :1495-1498, verbatim — both fields are
|
|
12
|
+
// already on IdCaptureFlowState).
|
|
13
|
+
// - `status`/`progress` <- sdk2's wizard derivation, faithfully:
|
|
14
|
+
// `guidesStatus = isCapturing && state.goodFramesCount > 0 ? 'capturing'
|
|
15
|
+
// : 'ready'` where `isCapturing = captureState === 'capturing' ||
|
|
16
|
+
// captureState === 'requestingBetterBarcode'` (IdCaptureWizard.tsx
|
|
17
|
+
// :315-317 + :1446-1450), and `progress = isCapturing ? captureProgress
|
|
18
|
+
// : 0` (:1489; core already publishes captureProgress's exact formula,
|
|
19
|
+
// wizard :1404-1407, as `state.progress`). NOT the `state.capturing`
|
|
20
|
+
// flow flag — that flips true only for the one tick between the
|
|
21
|
+
// reducer's 'capturing' and 'captured'/'captureFailed' actions around a
|
|
22
|
+
// single best-frame grab, and in sdk2 feeds only the instruction ternary
|
|
23
|
+
// (which core's deriveInstruction already owns here); keying `status` on
|
|
24
|
+
// it would leave the progress ring invisible while good frames
|
|
25
|
+
// accumulate. The `requestingBetterBarcode` half of sdk2's `isCapturing`
|
|
26
|
+
// OR is unreachable in this derivation: the barcode branch below
|
|
27
|
+
// early-returns into BarcodeGuideOverlay before `status`/`progress` are
|
|
28
|
+
// ever read (exactly as sdk2's own :78-88 early-return made those props
|
|
29
|
+
// dead in that state), so `state.phase === 'capturing'` alone covers
|
|
30
|
+
// every reachable case. sdk2's remaining `!overlayDismissed ->
|
|
31
|
+
// 'disabled'` arm is a *view*-local flag this component doesn't receive;
|
|
32
|
+
// that concern belongs to whichever component owns the loading overlay
|
|
33
|
+
// (IdCaptureView, Task 12), not this guide router.
|
|
34
|
+
// - `colors` prop is gone. sdk2's own `colors.guideBox{Un,}satisfiedColor`
|
|
35
|
+
// always fell back to `theme.idCapture.guideBox.{un,}satisfiedColor`
|
|
36
|
+
// (IdCapture.tsx:236-239) when not overridden by the caller — this
|
|
37
|
+
// router reads the theme fallback directly, since there is no
|
|
38
|
+
// upstream wizard prop left to carry a caller override through.
|
|
39
|
+
// - `portraitGuidesOnMobile` was initially dropped here, on the grounds
|
|
40
|
+
// that the leaf components' own `true` default (matching sdk2's wizard
|
|
41
|
+
// default) applies un-overridden. That held for every caller who wanted
|
|
42
|
+
// the default and for nobody who passed `false`, so the prop is back —
|
|
43
|
+
// forwarded, not re-derived, to both leaves below.
|
|
44
|
+
//
|
|
45
|
+
// Task 12 addition (carry-forward 3): sdk2's wizard derives `guidesStatus`
|
|
46
|
+
// as `!overlayDismissed ? 'disabled' : isCapturing && goodFramesCount > 0 ?
|
|
47
|
+
// 'capturing' : 'ready'` (IdCaptureWizard.tsx :1446-1450) — the `disabled`
|
|
48
|
+
// arm wins outright, regardless of phase/goodFramesCount, whenever the
|
|
49
|
+
// loading overlay hasn't been dismissed yet. `overlayDismissed` is
|
|
50
|
+
// view-local state this router has no visibility into (see the divergence
|
|
51
|
+
// note above), so IdCaptureView (Task 12) passes it down through the new
|
|
52
|
+
// optional `status` prop below, which — when provided — replaces this
|
|
53
|
+
// router's own `status` derivation outright (the smallest change that
|
|
54
|
+
// preserves wizard fidelity without threading a view-local boolean through
|
|
55
|
+
// this component's signature).
|
|
56
|
+
//
|
|
57
|
+
// Divergence 6 (barcode-recapture instruction override) target: in sdk2 the
|
|
58
|
+
// swapped `idCardBack.instructionText` (wizard :1088-1098) is actually dead
|
|
59
|
+
// for this component specifically — IdCaptureGuides.tsx's own
|
|
60
|
+
// isRequestingBetterBarcode branch (source :78-88) returns before ever
|
|
61
|
+
// reading its `instruction`-ish verbiage, and the wizard renders the
|
|
62
|
+
// barcode-recapture message via a separate standalone <GuidanceMessage> pill
|
|
63
|
+
// above <IdCaptureGuides> (IdCaptureWizard.tsx :1470-1482), not through this
|
|
64
|
+
// component at all. Since this port's router now owns the *entire* barcode
|
|
65
|
+
// branch (rendering BarcodeGuideOverlay directly, wizard's job in sdk2), the
|
|
66
|
+
// natural, single place for the code-driven recapture message to land is
|
|
67
|
+
// BarcodeGuideOverlay's own `instructionText` — so `instruction` below
|
|
68
|
+
// doubles as that value instead of the overlay's generic default
|
|
69
|
+
// ('Bring camera closer...'). `barcodeInstructionText` verbiage override is
|
|
70
|
+
// therefore dropped from IdCaptureGuidesVerbiage (would otherwise be dead:
|
|
71
|
+
// always superseded by the guidance-code string); `barcodeHeaderText`
|
|
72
|
+
// remains, since the header ("SCAN THE BARCODE") has no guidance-code
|
|
73
|
+
// equivalent and stays customizable exactly as in sdk2.
|
|
74
|
+
import { useTheme } from 'styled-components';
|
|
75
|
+
import { useTranslation } from 'react-i18next';
|
|
76
|
+
import { isSatisfiedCode } from '@idmission/websdk-core/idCapture';
|
|
77
|
+
import { guidanceMessageKey, instructionKey } from '../../guidance/strings';
|
|
78
|
+
import { useTranslations } from '../../i18n';
|
|
79
|
+
import { IdCaptureFitGuide, } from './IdCaptureFitGuide';
|
|
80
|
+
import { IdCaptureGuideOverlay, } from './IdCaptureGuideOverlay';
|
|
81
|
+
import { defaultIdCaptureGuideImages } from '../guide_images';
|
|
82
|
+
import { BarcodeGuideOverlay, } from '../barcode/BarcodeGuideOverlay';
|
|
83
|
+
import { BarcodeSuccessOverlay } from '../barcode/BarcodeSuccessOverlay';
|
|
84
|
+
export function IdCaptureGuides({ state, isRearFacing, guideType = 'fit', guideBoxDisabled = false, guideBoxFollowsMask = false, cameraFeedMode = 'snapToGuides', images = defaultIdCaptureGuideImages, classNames = {}, verbiage: rawVerbiage = {}, status: statusOverride, portraitGuidesOnMobile = true, }) {
|
|
85
|
+
const { t } = useTranslation();
|
|
86
|
+
const theme = useTheme();
|
|
87
|
+
const barcodeVerbiage = useTranslations(rawVerbiage, {
|
|
88
|
+
barcodeHeaderText: 'SCAN THE BARCODE',
|
|
89
|
+
});
|
|
90
|
+
const isRequestingBetterBarcode = state.phase === 'requestingBetterBarcode';
|
|
91
|
+
// sdk2 declares this branch (IdCaptureGuides.tsx :78-81) but never actually
|
|
92
|
+
// sets it true anywhere (IdCaptureWizard.tsx never passes
|
|
93
|
+
// isBarcodeSuccess) — preserved here, unreachable, for fidelity.
|
|
94
|
+
const isBarcodeSuccess = false;
|
|
95
|
+
const instruction = isRequestingBetterBarcode
|
|
96
|
+
? t(guidanceMessageKey(state.rawGuidance))
|
|
97
|
+
: t(instructionKey(state.instruction));
|
|
98
|
+
const satisfiedColor = theme.idCapture?.guideBox?.satisfiedColor ?? 'green';
|
|
99
|
+
const unsatisfiedColor = theme.idCapture?.guideBox?.unsatisfiedColor ?? 'white';
|
|
100
|
+
// The border reads the HELD guidance code (sdk2 IdCaptureGuides.tsx
|
|
101
|
+
// :113-116, :143-147), never the live per-frame verdict — that drift is
|
|
102
|
+
// exactly what let the border go green while the held pill still read
|
|
103
|
+
// "Document not detected" (sdk2 PR #254).
|
|
104
|
+
const borderColor = isSatisfiedCode(state.guidance.code)
|
|
105
|
+
? satisfiedColor
|
|
106
|
+
: unsatisfiedColor;
|
|
107
|
+
// Phase-level "capture is running" signal (wizard :315-317 gated by
|
|
108
|
+
// :1446-1450), NOT the one-tick state.capturing best-frame-grab flag — see
|
|
109
|
+
// the header comment. requestingBetterBarcode (the other half of sdk2's
|
|
110
|
+
// isCapturing OR) early-returns below before status/progress are consumed.
|
|
111
|
+
const status = statusOverride ??
|
|
112
|
+
(state.phase === 'capturing' && state.goodFramesCount > 0
|
|
113
|
+
? 'capturing'
|
|
114
|
+
: 'ready');
|
|
115
|
+
const progress = state.phase === 'capturing' ? state.progress : 0;
|
|
116
|
+
const requestedAction = state.requestedAction;
|
|
117
|
+
const isBackToFront = state.allowIdCardBackToFrontCapture && 'idCardBack' in state.capturedDocuments;
|
|
118
|
+
// Render barcode guide overlays when in barcode recapture state
|
|
119
|
+
if (isRequestingBetterBarcode) {
|
|
120
|
+
if (isBarcodeSuccess) {
|
|
121
|
+
return _jsx(BarcodeSuccessOverlay, {});
|
|
122
|
+
}
|
|
123
|
+
return (_jsx(BarcodeGuideOverlay, { headerText: barcodeVerbiage.barcodeHeaderText, instructionText: instruction, classNames: classNames }));
|
|
124
|
+
}
|
|
125
|
+
// Client barcode scanning happens silently in the background
|
|
126
|
+
// during normal ID back capture - no special UI needed here
|
|
127
|
+
return (_jsxs(_Fragment, { children: [guideType === 'overlay' && (_jsx(IdCaptureGuideOverlay, { images: images, classNames: classNames, portraitGuidesOnMobile: portraitGuidesOnMobile, status: status, progress: progress, guideBoxDisabled: guideBoxDisabled, instruction: instruction, isMirrored: !isRearFacing, borderColor: borderColor, imageVisible: requestedAction === 'FLIP_ID' ||
|
|
128
|
+
!state.idCardFrontDetectionThresholdMet ||
|
|
129
|
+
!state.documentInBounds ||
|
|
130
|
+
state.documentTooClose })), guideType === 'fit' && (_jsx(IdCaptureFitGuide, { images: images, classNames: classNames, portraitGuidesOnMobile: portraitGuidesOnMobile, requestedAction: requestedAction, status: status, progress: progress, guideBoxDisabled: guideBoxDisabled, guideBoxFollowsMask: guideBoxFollowsMask, cameraFeedMode: cameraFeedMode, instruction: instruction, isMirrored: !isRearFacing, isBackToFront: isBackToFront, borderColor: borderColor, imageVisible: requestedAction === 'FLIP_ID' ||
|
|
131
|
+
!state.detectionThresholdMet ||
|
|
132
|
+
!state.documentInBounds ||
|
|
133
|
+
state.documentTooClose ||
|
|
134
|
+
state.backDetectedFirst ||
|
|
135
|
+
state.flipRequired }))] }));
|
|
136
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { CSSProperties, HTMLAttributes, SVGProps } from 'react';
|
|
2
|
+
export declare const IdCardGuideImageContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
status?: IdCardGuideStatus;
|
|
4
|
+
borderWidth?: number | string;
|
|
5
|
+
borderRadius?: number;
|
|
6
|
+
borderColor?: string;
|
|
7
|
+
aspectRatio?: number;
|
|
8
|
+
progress?: number;
|
|
9
|
+
guideBoxDisabled?: boolean;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
}, "aspectRatio" | "$isVisible" | "$isMobile" | "$isLandscape"> & {
|
|
12
|
+
$isVisible?: boolean;
|
|
13
|
+
aspectRatio?: number | string;
|
|
14
|
+
$isMobile?: boolean;
|
|
15
|
+
$isLandscape?: boolean;
|
|
16
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<HTMLAttributes<HTMLDivElement> & {
|
|
17
|
+
status?: IdCardGuideStatus;
|
|
18
|
+
borderWidth?: number | string;
|
|
19
|
+
borderRadius?: number;
|
|
20
|
+
borderColor?: string;
|
|
21
|
+
aspectRatio?: number;
|
|
22
|
+
progress?: number;
|
|
23
|
+
guideBoxDisabled?: boolean;
|
|
24
|
+
style?: CSSProperties;
|
|
25
|
+
}, "aspectRatio" | "$isVisible" | "$isMobile" | "$isLandscape"> & {
|
|
26
|
+
$isVisible?: boolean;
|
|
27
|
+
aspectRatio?: number | string;
|
|
28
|
+
$isMobile?: boolean;
|
|
29
|
+
$isLandscape?: boolean;
|
|
30
|
+
}, never>>> & string & Omit<typeof IdCardBorder, keyof import("react").Component<any, {}, any>>;
|
|
31
|
+
export declare const IdCardGuideImage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "$isMirrored" | "$isInvisible"> & {
|
|
32
|
+
$isMirrored?: boolean;
|
|
33
|
+
$isInvisible?: boolean;
|
|
34
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "$isMirrored" | "$isInvisible"> & {
|
|
35
|
+
$isMirrored?: boolean;
|
|
36
|
+
$isInvisible?: boolean;
|
|
37
|
+
}, never>>> & string;
|
|
38
|
+
export type IdCardGuideStatus = 'disabled' | 'ready' | 'capturing';
|
|
39
|
+
declare function IdCardBorder({ children, status, borderWidth, borderRadius, borderColor, aspectRatio, progress, guideBoxDisabled, ...props }: HTMLAttributes<HTMLDivElement> & {
|
|
40
|
+
status?: IdCardGuideStatus;
|
|
41
|
+
borderWidth?: number | string;
|
|
42
|
+
borderRadius?: number;
|
|
43
|
+
borderColor?: string;
|
|
44
|
+
aspectRatio?: number;
|
|
45
|
+
progress?: number;
|
|
46
|
+
guideBoxDisabled?: boolean;
|
|
47
|
+
style?: CSSProperties;
|
|
48
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
type IdCardBorderSvgProps = SVGProps<SVGSVGElement> & {
|
|
50
|
+
borderRadius: number;
|
|
51
|
+
borderColor: string;
|
|
52
|
+
borderWidth: number | string;
|
|
53
|
+
borderOpacity?: number;
|
|
54
|
+
isProgressBar?: boolean;
|
|
55
|
+
progress?: number;
|
|
56
|
+
/**
|
|
57
|
+
* By default `borderRadius` is treated as a radius against a 500px-tall box
|
|
58
|
+
* and scaled to the rendered height, so the corner keeps its proportions as
|
|
59
|
+
* the box grows. Pass false to use `borderRadius` as a literal pixel value —
|
|
60
|
+
* needed when this border has to line up with a radius drawn elsewhere in
|
|
61
|
+
* absolute pixels (the fit guide's canvas hole).
|
|
62
|
+
*/
|
|
63
|
+
scaleBorderRadius?: boolean;
|
|
64
|
+
};
|
|
65
|
+
export declare function IdCardBorderSvg({ borderRadius, borderColor, borderWidth, borderOpacity, progress, isProgressBar, scaleBorderRadius, ...props }: IdCardBorderSvgProps): import("react/jsx-runtime").JSX.Element;
|
|
66
|
+
export declare const FlipImageContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<HTMLAttributes<HTMLDivElement> & {
|
|
67
|
+
status?: IdCardGuideStatus;
|
|
68
|
+
borderWidth?: number | string;
|
|
69
|
+
borderRadius?: number;
|
|
70
|
+
borderColor?: string;
|
|
71
|
+
aspectRatio?: number;
|
|
72
|
+
progress?: number;
|
|
73
|
+
guideBoxDisabled?: boolean;
|
|
74
|
+
style?: CSSProperties;
|
|
75
|
+
}, "aspectRatio" | "$isVisible" | "$isMobile" | "$isLandscape"> & {
|
|
76
|
+
$isVisible?: boolean;
|
|
77
|
+
aspectRatio?: number | string;
|
|
78
|
+
$isMobile?: boolean;
|
|
79
|
+
$isLandscape?: boolean;
|
|
80
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<HTMLAttributes<HTMLDivElement> & {
|
|
81
|
+
status?: IdCardGuideStatus;
|
|
82
|
+
borderWidth?: number | string;
|
|
83
|
+
borderRadius?: number;
|
|
84
|
+
borderColor?: string;
|
|
85
|
+
aspectRatio?: number;
|
|
86
|
+
progress?: number;
|
|
87
|
+
guideBoxDisabled?: boolean;
|
|
88
|
+
style?: CSSProperties;
|
|
89
|
+
}, "aspectRatio" | "$isVisible" | "$isMobile" | "$isLandscape"> & {
|
|
90
|
+
$isVisible?: boolean;
|
|
91
|
+
aspectRatio?: number | string;
|
|
92
|
+
$isMobile?: boolean;
|
|
93
|
+
$isLandscape?: boolean;
|
|
94
|
+
}, never>> & {
|
|
95
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
96
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
97
|
+
}, "$transforms" | "$transitionTime"> & {
|
|
98
|
+
$transforms: string;
|
|
99
|
+
$transitionTime: number;
|
|
100
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<HTMLAttributes<HTMLDivElement> & {
|
|
101
|
+
status?: IdCardGuideStatus;
|
|
102
|
+
borderWidth?: number | string;
|
|
103
|
+
borderRadius?: number;
|
|
104
|
+
borderColor?: string;
|
|
105
|
+
aspectRatio?: number;
|
|
106
|
+
progress?: number;
|
|
107
|
+
guideBoxDisabled?: boolean;
|
|
108
|
+
style?: CSSProperties;
|
|
109
|
+
}, "aspectRatio" | "$isVisible" | "$isMobile" | "$isLandscape"> & {
|
|
110
|
+
$isVisible?: boolean;
|
|
111
|
+
aspectRatio?: number | string;
|
|
112
|
+
$isMobile?: boolean;
|
|
113
|
+
$isLandscape?: boolean;
|
|
114
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<HTMLAttributes<HTMLDivElement> & {
|
|
115
|
+
status?: IdCardGuideStatus;
|
|
116
|
+
borderWidth?: number | string;
|
|
117
|
+
borderRadius?: number;
|
|
118
|
+
borderColor?: string;
|
|
119
|
+
aspectRatio?: number;
|
|
120
|
+
progress?: number;
|
|
121
|
+
guideBoxDisabled?: boolean;
|
|
122
|
+
style?: CSSProperties;
|
|
123
|
+
}, "aspectRatio" | "$isVisible" | "$isMobile" | "$isLandscape"> & {
|
|
124
|
+
$isVisible?: boolean;
|
|
125
|
+
aspectRatio?: number | string;
|
|
126
|
+
$isMobile?: boolean;
|
|
127
|
+
$isLandscape?: boolean;
|
|
128
|
+
}, never>> & {
|
|
129
|
+
as?: import("styled-components").WebTarget | undefined;
|
|
130
|
+
forwardedAs?: import("styled-components").WebTarget | undefined;
|
|
131
|
+
}, "$transforms" | "$transitionTime"> & {
|
|
132
|
+
$transforms: string;
|
|
133
|
+
$transitionTime: number;
|
|
134
|
+
}, never>>> & string;
|
|
135
|
+
export {};
|
|
136
|
+
//# sourceMappingURL=IdCaptureGuidesCommon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdCaptureGuidesCommon.d.ts","sourceRoot":"","sources":["../../../src/components/guides/IdCaptureGuidesCommon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAA;AAMpF,eAAO,MAAM,yBAAyB;aA4C3B,iBAAiB;kBACZ,MAAM,GAAG,MAAM;mBACd,MAAM;kBACP,MAAM;kBACN,MAAM;eACT,MAAM;uBACE,OAAO;YAClB,aAAa;;iBAlDR,OAAO;kBACN,MAAM,GAAG,MAAM;gBACjB,OAAO;mBACJ,OAAO;;aAwCb,iBAAiB;kBACZ,MAAM,GAAG,MAAM;mBACd,MAAM;kBACP,MAAM;kBACN,MAAM;eACT,MAAM;uBACE,OAAO;YAClB,aAAa;;iBAlDR,OAAO;kBACN,MAAM,GAAG,MAAM;gBACjB,OAAO;mBACJ,OAAO;+FAevB,CAAA;AAED,eAAO,MAAM,gBAAgB;kBACb,OAAO;mBACN,OAAO;;kBADR,OAAO;mBACN,OAAO;oBAMvB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,CAAA;AAElE,iBAAS,YAAY,CAAC,EACpB,QAAQ,EACR,MAAgB,EAChB,WAAgB,EAChB,YAAiB,EACjB,WAAqB,EACrB,WAAe,EACf,QAAY,EACZ,gBAAwB,EACxB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,cAAc,CAAC,GAAG;IAClC,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,KAAK,CAAC,EAAE,aAAa,CAAA;CACtB,2CA0EA;AAED,KAAK,oBAAoB,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG;IACpD,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAiB,EACjB,QAAY,EACZ,aAAqB,EACrB,iBAAwB,EACxB,GAAG,KAAK,EACT,EAAE,oBAAoB,2CAsEtB;AAuDD,eAAO,MAAM,kBAAkB;aA3OpB,iBAAiB;kBACZ,MAAM,GAAG,MAAM;mBACd,MAAM;kBACP,MAAM;kBACN,MAAM;eACT,MAAM;uBACE,OAAO;YAClB,aAAa;;iBAlDR,OAAO;kBACN,MAAM,GAAG,MAAM;gBACjB,OAAO;mBACJ,OAAO;;aAwCb,iBAAiB;kBACZ,MAAM,GAAG,MAAM;mBACd,MAAM;kBACP,MAAM;kBACN,MAAM;eACT,MAAM;uBACE,OAAO;YAClB,aAAa;;iBAlDR,OAAO;kBACN,MAAM,GAAG,MAAM;gBACjB,OAAO;mBACJ,OAAO;;;;;iBAoRT,MAAM;qBACF,MAAM;;aA7Od,iBAAiB;kBACZ,MAAM,GAAG,MAAM;mBACd,MAAM;kBACP,MAAM;kBACN,MAAM;eACT,MAAM;uBACE,OAAO;YAClB,aAAa;;iBAlDR,OAAO;kBACN,MAAM,GAAG,MAAM;gBACjB,OAAO;mBACJ,OAAO;;aAwCb,iBAAiB;kBACZ,MAAM,GAAG,MAAM;mBACd,MAAM;kBACP,MAAM;kBACN,MAAM;eACT,MAAM;uBACE,OAAO;YAClB,aAAa;;iBAlDR,OAAO;kBACN,MAAM,GAAG,MAAM;gBACjB,OAAO;mBACJ,OAAO;;;;;iBAoRT,MAAM;qBACF,MAAM;oBAUxB,CAAA"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { styled, useTheme } from 'styled-components';
|
|
4
|
+
import { debug } from '../../utils/logger';
|
|
5
|
+
import { wavesAnimation } from '../common/animation';
|
|
6
|
+
import useResizeObserver from '../../layout/useResizeObserver';
|
|
7
|
+
export const IdCardGuideImageContainer = styled(IdCardBorder) `
|
|
8
|
+
position: relative;
|
|
9
|
+
${(props) => (props.$isVisible ? '' : 'opacity: 0;')}
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
max-width: 100%;
|
|
12
|
+
max-height: 100%;
|
|
13
|
+
${(props) => props.$isMobile
|
|
14
|
+
? props.$isLandscape
|
|
15
|
+
? 'height: 100%;'
|
|
16
|
+
: 'width: 80%;'
|
|
17
|
+
: props.$isLandscape
|
|
18
|
+
? 'height: 70%;'
|
|
19
|
+
: 'width: 82%;'};
|
|
20
|
+
`;
|
|
21
|
+
export const IdCardGuideImage = styled.img `
|
|
22
|
+
max-height: 100%;
|
|
23
|
+
transform-style: preserve-3d;
|
|
24
|
+
${(props) => (props.$isMirrored ? 'transform: scaleX(-1);' : '')}
|
|
25
|
+
${(props) => (props.$isInvisible ? 'opacity: 0;' : '')}
|
|
26
|
+
`;
|
|
27
|
+
function IdCardBorder({ children, status = 'ready', borderWidth = 20, borderRadius = 25, borderColor = 'white', aspectRatio = 1, progress = 0, guideBoxDisabled = false, ...props }) {
|
|
28
|
+
const { ref, width = 0, height = 0 } = useResizeObserver();
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
const wavesDisabled = theme.idCapture?.guideBox?.wavesDisabled ?? false;
|
|
31
|
+
const wavesColor = theme.idCapture?.guideBox?.wavesColor ?? '#287ec6';
|
|
32
|
+
const progressBarColor = theme.idCapture?.guideBox?.progressBarColor ?? borderColor;
|
|
33
|
+
const progressBarIndicatorColor = theme.idCapture?.guideBox?.progressBarIndicatorColor ?? '#287ec6';
|
|
34
|
+
const progressBarWidth = theme.idCapture?.guideBox?.progressBarWidth ?? borderWidth;
|
|
35
|
+
return (_jsx(IdCardBorderContainer, { ...props, style: { ...props.style, aspectRatio }, children: _jsxs(IdCardBorderInner, { ref: ref, style: { aspectRatio }, children: [children, !guideBoxDisabled && status === 'ready' && !wavesDisabled && (_jsxs(_Fragment, { children: [_jsx(IdCardBorderSvg, { width: width, height: height, borderRadius: borderRadius, borderOpacity: 0.25, borderColor: wavesColor, borderWidth: borderWidth, className: "idmSdkWaves" }), _jsx(IdCardBorderSvg, { width: width, height: height, borderRadius: borderRadius, borderOpacity: 0.25, borderColor: wavesColor, borderWidth: borderWidth, className: "idmSdkWaves" }), _jsx(IdCardBorderSvg, { width: width, height: height, borderRadius: borderRadius, borderOpacity: 0.25, borderColor: wavesColor, borderWidth: borderWidth, className: "idmSdkWaves" })] })), !guideBoxDisabled && (_jsx(IdCardBorderSvg, { width: width, height: height, borderRadius: borderRadius, borderColor: progressBarColor, borderWidth: progressBarWidth, className: "idmSdkWavesOrigin" })), !guideBoxDisabled && status === 'capturing' && (_jsx(IdCardBorderSvg, { width: width, height: height, borderRadius: borderRadius, borderColor: progressBarIndicatorColor, borderWidth: progressBarWidth, isProgressBar: true, progress: progress }))] }) }));
|
|
36
|
+
}
|
|
37
|
+
export function IdCardBorderSvg({ borderRadius, borderColor, borderWidth, borderOpacity = 1, progress = 0, isProgressBar = false, scaleBorderRadius = true, ...props }) {
|
|
38
|
+
const [totalLength, setTotalLength] = useState(0);
|
|
39
|
+
const [transitionEnabled, setTransitionEnabled] = useState(false);
|
|
40
|
+
// Enable the CSS transition one frame after totalLength is measured,
|
|
41
|
+
// so the initial dashoffset value is painted without animation first.
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (totalLength > 0 && !transitionEnabled) {
|
|
44
|
+
requestAnimationFrame(() => setTransitionEnabled(true));
|
|
45
|
+
}
|
|
46
|
+
}, [totalLength, transitionEnabled]);
|
|
47
|
+
const scaledBorderRadius = scaleBorderRadius
|
|
48
|
+
? borderRadius * (typeof props.height === 'number' ? props.height / 500 : 1)
|
|
49
|
+
: borderRadius;
|
|
50
|
+
const rectRef = (r) => {
|
|
51
|
+
try {
|
|
52
|
+
if (isProgressBar && r)
|
|
53
|
+
setTotalLength(r.getTotalLength());
|
|
54
|
+
}
|
|
55
|
+
catch (e) {
|
|
56
|
+
debug('failed to measure SVG length', e);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
return (_jsxs(SvgOverlay, { height: "100%", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("defs", { children: _jsx("clipPath", { id: "round-corner", children: _jsx("rect", { x: "0", y: "0", width: props.width || '100%', height: props.height || '100%', rx: scaledBorderRadius, ry: scaledBorderRadius }) }) }), _jsx(IdCardBorderRect, { ref: rectRef, x: "0", y: "0", width: props.width || '100%', height: props.height || '100%', rx: scaledBorderRadius, ry: scaledBorderRadius, clipPath: "url(#round-corner)", stroke: borderColor, strokeWidth: borderWidth, strokeOpacity: borderOpacity, strokeDashoffset: isProgressBar
|
|
60
|
+
? totalLength > 0
|
|
61
|
+
? totalLength * (1 - progress)
|
|
62
|
+
: 999999
|
|
63
|
+
: undefined, strokeDasharray: isProgressBar ? (totalLength > 0 ? totalLength : 999999) : undefined, className: isProgressBar && transitionEnabled ? 'idmSdkProgressBorder' : '' })] }));
|
|
64
|
+
}
|
|
65
|
+
const IdCardBorderContainer = styled.div `
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
display: flex;
|
|
69
|
+
position: relative;
|
|
70
|
+
margin: auto;
|
|
71
|
+
|
|
72
|
+
& .idmSdkWaves {
|
|
73
|
+
position: absolute;
|
|
74
|
+
animation: ${wavesAnimation} 2s ease-out infinite;
|
|
75
|
+
transform-style: preserve-3d;
|
|
76
|
+
|
|
77
|
+
&:nth-child(3) {
|
|
78
|
+
animation-delay: 0.66s;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:nth-child(4) {
|
|
82
|
+
animation-delay: 1.33s;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
const IdCardBorderInner = styled.div `
|
|
87
|
+
max-height: 100%;
|
|
88
|
+
max-width: 100%;
|
|
89
|
+
flex: 1;
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
position: relative;
|
|
94
|
+
`;
|
|
95
|
+
const SvgOverlay = styled.svg `
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 0;
|
|
98
|
+
left: 0;
|
|
99
|
+
width: 100%;
|
|
100
|
+
height: 100%;
|
|
101
|
+
pointer-events: none;
|
|
102
|
+
`;
|
|
103
|
+
const IdCardBorderRect = styled.rect `
|
|
104
|
+
&.idmSdkProgressBorder {
|
|
105
|
+
transition: stroke-dashoffset 0.3s ease-out;
|
|
106
|
+
}
|
|
107
|
+
`;
|
|
108
|
+
// Ported dep (sdk2's video_id/IdVideoCaptureFlipIdPrompt.tsx:136-148 —
|
|
109
|
+
// FlipImageContainer). That file isn't otherwise in this task's scope (it's
|
|
110
|
+
// the video-capture flip prompt, a different top-level component pulling in
|
|
111
|
+
// the store-based useCameraStore), so only the pure styled-component it
|
|
112
|
+
// exports is relocated here, next to the IdCardGuideImageContainer it
|
|
113
|
+
// extends. Byte-identical CSS; used by FlipIdPrompt.tsx (this task's port).
|
|
114
|
+
export const FlipImageContainer = styled(IdCardGuideImageContainer) `
|
|
115
|
+
backface-visibility: hidden;
|
|
116
|
+
transition: transform ${(props) => props.$transitionTime}s;
|
|
117
|
+
transform: ${(props) => props.$transforms};
|
|
118
|
+
transform-style: preserve-3d;
|
|
119
|
+
position: absolute;
|
|
120
|
+
display: block;
|
|
121
|
+
top: 0;
|
|
122
|
+
height: 100%; // todo: branch between desktop and mobile
|
|
123
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type IdCaptureLoadingGraphicProps = {
|
|
2
|
+
width?: number;
|
|
3
|
+
height?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function IdCaptureLoadingGraphic(props: IdCaptureLoadingGraphicProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function IdCaptureLoadingGraphicDesktop({ className, }: IdCaptureLoadingGraphicProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function IdCaptureLoadingGraphicMobile({ width, height, className, }: IdCaptureLoadingGraphicProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=IdCaptureLoadingGraphic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdCaptureLoadingGraphic.d.ts","sourceRoot":"","sources":["../../../src/components/loading/IdCaptureLoadingGraphic.tsx"],"names":[],"mappings":"AASA,MAAM,MAAM,4BAA4B,GAAG;IACzC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,2CAO1E;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,SAAS,GACV,EAAE,4BAA4B,2CA8P9B;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,KAAW,EACX,MAAY,EACZ,SAAS,GACV,EAAE,4BAA4B,2CA0O9B"}
|