@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,91 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import type { DetectedObject, Face, FaceKeypoint } from '@idmission/websdk-core/models';
|
|
3
|
+
export declare function DebugStatsPane({ children }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const DebugStatsPaneDiv: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>>> & string;
|
|
7
|
+
export declare const ObjectDetectionDebugOverlayDiv: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$flipX"> & {
|
|
8
|
+
$flipX?: boolean;
|
|
9
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$flipX"> & {
|
|
10
|
+
$flipX?: boolean;
|
|
11
|
+
}, never>>> & string;
|
|
12
|
+
export declare const ObjectDetectionDebugBox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$flipX"> & {
|
|
13
|
+
$color?: string;
|
|
14
|
+
$flipX?: boolean;
|
|
15
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$flipX"> & {
|
|
16
|
+
$color?: string;
|
|
17
|
+
$flipX?: boolean;
|
|
18
|
+
}, never>>> & string;
|
|
19
|
+
export declare const ObjectDetectionDebugLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$color"> & {
|
|
20
|
+
$color?: string;
|
|
21
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "$color"> & {
|
|
22
|
+
$color?: string;
|
|
23
|
+
}, never>>> & string;
|
|
24
|
+
export declare const FaceDetectionKeypointMarker: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$flipX"> & {
|
|
25
|
+
$color?: string;
|
|
26
|
+
$flipX?: boolean;
|
|
27
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color" | "$flipX"> & {
|
|
28
|
+
$color?: string;
|
|
29
|
+
$flipX?: boolean;
|
|
30
|
+
}, never>>> & string;
|
|
31
|
+
export type DebugScalingDetails = {
|
|
32
|
+
horizontal: boolean;
|
|
33
|
+
pageWidth: number;
|
|
34
|
+
pageHeight: number;
|
|
35
|
+
videoWidth: number;
|
|
36
|
+
videoHeight: number;
|
|
37
|
+
scaledWidth: number;
|
|
38
|
+
scaledHeight: number;
|
|
39
|
+
xOffset: number;
|
|
40
|
+
yOffset: number;
|
|
41
|
+
};
|
|
42
|
+
export declare function useDebugScalingDetails({ enabled, pageWidth, pageHeight, videoWidth, videoHeight, }: {
|
|
43
|
+
enabled?: boolean;
|
|
44
|
+
pageWidth: number;
|
|
45
|
+
pageHeight: number;
|
|
46
|
+
videoWidth: number;
|
|
47
|
+
videoHeight: number;
|
|
48
|
+
}): DebugScalingDetails;
|
|
49
|
+
export type DebugGuideRect = {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
width: number;
|
|
53
|
+
height: number;
|
|
54
|
+
};
|
|
55
|
+
export declare const DebugBoundingBoxOverlay: ({ scaling, $flipX, guideRect, children, }: {
|
|
56
|
+
scaling?: DebugScalingDetails;
|
|
57
|
+
$flipX?: boolean;
|
|
58
|
+
guideRect?: DebugGuideRect | null;
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
61
|
+
export type DetectedObjectDebugBoxProps = {
|
|
62
|
+
obj: DetectedObject;
|
|
63
|
+
scaling: DebugScalingDetails;
|
|
64
|
+
flipX?: boolean;
|
|
65
|
+
color?: string;
|
|
66
|
+
};
|
|
67
|
+
export declare function IdCaptureDetectedObjectDebugBox({ obj, flipX, color, scaling, }: DetectedObjectDebugBoxProps): ReactElement;
|
|
68
|
+
export type SelfieCaptureFaceDebugBoxProps = {
|
|
69
|
+
face: Face;
|
|
70
|
+
scaling: DebugScalingDetails;
|
|
71
|
+
flipX?: boolean;
|
|
72
|
+
color?: string;
|
|
73
|
+
showBoundingBox?: boolean;
|
|
74
|
+
showLandmarks?: boolean;
|
|
75
|
+
};
|
|
76
|
+
export declare function SelfieCaptureFaceDebugBox({ face, flipX, color, scaling, showBoundingBox, showLandmarks, }: SelfieCaptureFaceDebugBoxProps): ReactElement;
|
|
77
|
+
export type SelfieCaptureFaceMeshProps = {
|
|
78
|
+
face: Face;
|
|
79
|
+
scaling: DebugScalingDetails;
|
|
80
|
+
flipX?: boolean;
|
|
81
|
+
};
|
|
82
|
+
export declare function SelfieCaptureFaceMesh({ face, scaling, flipX, }: SelfieCaptureFaceMeshProps): ReactElement;
|
|
83
|
+
type SelfieCaptureFaceKeypointProps = {
|
|
84
|
+
point: FaceKeypoint | null;
|
|
85
|
+
scaling: DebugScalingDetails;
|
|
86
|
+
flipX?: boolean;
|
|
87
|
+
color?: string;
|
|
88
|
+
};
|
|
89
|
+
export declare function SelfieCaptureFaceKeypoint({ point, flipX, color, scaling: { horizontal, pageWidth, pageHeight, videoWidth, videoHeight, scaledWidth, scaledHeight, xOffset, yOffset, }, }: SelfieCaptureFaceKeypointProps): ReactElement;
|
|
90
|
+
export {};
|
|
91
|
+
//# sourceMappingURL=debug.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../src/components/debug/debug.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,YAAY,EAAE,SAAS,EAA8B,MAAM,OAAO,CAAA;AAE3E,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAEvF,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAOnE;AAED,eAAO,MAAM,iBAAiB,2VAY7B,CAAA;AAED,eAAO,MAAM,8BAA8B;aAAyB,OAAO;;aAAP,OAAO;oBAa1E,CAAA;AAED,eAAO,MAAM,uBAAuB;aACzB,MAAM;aACN,OAAO;;aADP,MAAM;aACN,OAAO;oBAQjB,CAAA;AAcD,eAAO,MAAM,yBAAyB;aAA0B,MAAM;;aAAN,MAAM;oBAUrE,CAAA;AAED,eAAO,MAAM,2BAA2B;aAC7B,MAAM;aACN,OAAO;;aADP,MAAM;aACN,OAAO;oBAWjB,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC,UAAU,EAAE,OAAO,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,sBAAsB,CAAC,EACrC,OAAc,EACd,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,GACZ,EAAE;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;CACpB,GAAG,mBAAmB,CA+BtB;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAI,2CAKrC;IACD,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;IACjC,QAAQ,EAAE,SAAS,CAAA;CACpB,4CAeA,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,GAAG,EAAE,cAAc,CAAA;IACnB,OAAO,EAAE,mBAAmB,CAAA;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,+BAA+B,CAAC,EAC9C,GAAG,EACH,KAAK,EACL,KAAe,EACf,OAAO,GACR,EAAE,2BAA2B,GAAG,YAAY,CA2C5C;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,mBAAmB,CAAA;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,CAAA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,IAAI,EACJ,KAAK,EACL,KAAe,EACf,OAAO,EACP,eAAsB,EACtB,aAAoB,GACrB,EAAE,8BAA8B,GAAG,YAAY,CAwD/C;AAoBD,MAAM,MAAM,0BAA0B,GAAG;IACvC,IAAI,EAAE,IAAI,CAAA;IACV,OAAO,EAAE,mBAAmB,CAAA;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,OAAO,EACP,KAAK,GACN,EAAE,0BAA0B,GAAG,YAAY,CA+D3C;AAED,KAAK,8BAA8B,GAAG;IACpC,KAAK,EAAE,YAAY,GAAG,IAAI,CAAA;IAC1B,OAAO,EAAE,mBAAmB,CAAA;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,yBAAyB,CAAC,EACxC,KAAK,EACL,KAAK,EACL,KAAa,EACb,OAAO,EAAE,EACP,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,OAAO,EACP,OAAO,GACR,GACF,EAAE,8BAA8B,GAAG,YAAY,CAsB/C"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Ported from sdk2/src/components/common/debug.tsx (451 lines) — near
|
|
3
|
+
// verbatim: every exported piece (DebugStatsPane, the ObjectDetectionDebug*
|
|
4
|
+
// styled primitives, FaceDetectionKeypointMarker, useDebugScalingDetails,
|
|
5
|
+
// DebugBoundingBoxOverlay, IdCaptureDetectedObjectDebugBox,
|
|
6
|
+
// SelfieCaptureFaceDebugBox, SelfieCaptureFaceMesh, SelfieCaptureFaceKeypoint)
|
|
7
|
+
// carries the same name, geometry math, and styling. Sanctioned adaptations
|
|
8
|
+
// (this package has no sdk2 contexts to read from):
|
|
9
|
+
//
|
|
10
|
+
// - useDebugScalingDetails no longer reads sdk2's global `useCameraStore`
|
|
11
|
+
// for videoWidth/videoHeight — callers pass them in directly. IdCaptureView
|
|
12
|
+
// already has them on `IdCaptureControllerState.videoWidth/videoHeight`;
|
|
13
|
+
// SelfieCaptureSurface has neither a core field nor a shared camera store
|
|
14
|
+
// for this, so it reads them off the attached `<video>` element locally
|
|
15
|
+
// (see that file's own comment).
|
|
16
|
+
// - DebugBoundingBoxOverlay no longer reads sdk2's `useIdCaptureStore` for
|
|
17
|
+
// guideRectX/Y/Width/Height — callers pass a `guideRect` prop instead.
|
|
18
|
+
// IdCaptureView sources it from GuideLayoutContext's `guideRect`, this
|
|
19
|
+
// package's own replacement for that store field (see
|
|
20
|
+
// layout/GuideLayoutContext.tsx's header comment).
|
|
21
|
+
// - getMeshColorByIndex() (SelfieCaptureFaceMesh's per-mesh-index color
|
|
22
|
+
// lookup) is a local, always-monochrome stub instead of importing sdk2's
|
|
23
|
+
// lib/models/FaceLandmarker.ts cache. That cache is populated as a side
|
|
24
|
+
// effect of the MediaPipe FaceLandmarker PROVIDER loading (core-internal,
|
|
25
|
+
// not exposed on any public controller state) — sdk2 itself falls back to
|
|
26
|
+
// this exact same monochrome stub for LiteRT-only sessions
|
|
27
|
+
// (FaceLandmarker.ts:99-108's own doc comment), so this port always
|
|
28
|
+
// renders in that fallback rather than depending on an unexported core
|
|
29
|
+
// cache.
|
|
30
|
+
import { styled } from 'styled-components';
|
|
31
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
32
|
+
import { createPortal } from 'react-dom';
|
|
33
|
+
export function DebugStatsPane({ children }) {
|
|
34
|
+
const element = _jsx(DebugStatsPaneDiv, { children: children });
|
|
35
|
+
const portalLocation = document.getElementById('idmission-above-guides-content');
|
|
36
|
+
if (!portalLocation)
|
|
37
|
+
return element;
|
|
38
|
+
return createPortal(element, portalLocation);
|
|
39
|
+
}
|
|
40
|
+
export const DebugStatsPaneDiv = styled.span `
|
|
41
|
+
font-size: 16px;
|
|
42
|
+
font-family: monospace;
|
|
43
|
+
position: absolute;
|
|
44
|
+
left: 20px;
|
|
45
|
+
bottom: 20px;
|
|
46
|
+
margin-right: 20px;
|
|
47
|
+
padding: 8px;
|
|
48
|
+
color: limegreen;
|
|
49
|
+
background: rgba(0, 0, 0, 0.5);
|
|
50
|
+
z-index: 10002;
|
|
51
|
+
pointer-events: none;
|
|
52
|
+
`;
|
|
53
|
+
export const ObjectDetectionDebugOverlayDiv = styled.div `
|
|
54
|
+
position: absolute;
|
|
55
|
+
z-index: 1001;
|
|
56
|
+
top: 0;
|
|
57
|
+
left: 0;
|
|
58
|
+
width: 100%;
|
|
59
|
+
height: 100%;
|
|
60
|
+
max-width: 100%;
|
|
61
|
+
max-height: 100%;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
${({ $flipX }) => ($flipX ? 'transform: scaleX(-1);' : '')}
|
|
65
|
+
transform-style: preserve-3d;
|
|
66
|
+
`;
|
|
67
|
+
export const ObjectDetectionDebugBox = styled.div `
|
|
68
|
+
font: 10px monospace;
|
|
69
|
+
position: absolute;
|
|
70
|
+
border: 3px solid ${({ $color }) => $color ?? 'green'};
|
|
71
|
+
color: ${({ $color }) => $color ?? 'green'};
|
|
72
|
+
${({ $flipX }) => ($flipX ? 'transform: scaleX(-1);' : '')}
|
|
73
|
+
transform-style: preserve-3d;
|
|
74
|
+
`;
|
|
75
|
+
const darkColors = new Set([
|
|
76
|
+
'blue',
|
|
77
|
+
'darkblue',
|
|
78
|
+
'navy',
|
|
79
|
+
'darkgreen',
|
|
80
|
+
'purple',
|
|
81
|
+
'maroon',
|
|
82
|
+
'black',
|
|
83
|
+
'darkred',
|
|
84
|
+
'indigo',
|
|
85
|
+
]);
|
|
86
|
+
export const ObjectDetectionDebugLabel = styled.span `
|
|
87
|
+
position: absolute;
|
|
88
|
+
top: -1px;
|
|
89
|
+
left: -1px;
|
|
90
|
+
background: ${({ $color }) => $color ?? 'green'};
|
|
91
|
+
color: ${({ $color }) => (darkColors.has($color ?? '') ? 'white' : 'black')};
|
|
92
|
+
font: bold 9px monospace;
|
|
93
|
+
padding: 1px 3px;
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
transform: translateY(-100%);
|
|
96
|
+
`;
|
|
97
|
+
export const FaceDetectionKeypointMarker = styled.div `
|
|
98
|
+
position: absolute;
|
|
99
|
+
width: 4px;
|
|
100
|
+
height: 4px;
|
|
101
|
+
border: 2px solid ${({ $color }) => $color ?? 'red'};
|
|
102
|
+
font: 10px monospace;
|
|
103
|
+
color: ${({ $color }) => $color ?? 'red'};
|
|
104
|
+
border-radius: 50%;
|
|
105
|
+
${({ $flipX }) => ($flipX ? 'transform: scaleX(-1);' : '')}
|
|
106
|
+
transform-style: preserve-3d;
|
|
107
|
+
`;
|
|
108
|
+
export function useDebugScalingDetails({ enabled = true, pageWidth, pageHeight, videoWidth, videoHeight, }) {
|
|
109
|
+
return useMemo(() => {
|
|
110
|
+
let horizontal = false, scaledWidth = 0, scaledHeight = 0, xOffset = 0, yOffset = 0;
|
|
111
|
+
if (enabled) {
|
|
112
|
+
horizontal = pageWidth / pageHeight < videoWidth / videoHeight;
|
|
113
|
+
if (horizontal) {
|
|
114
|
+
scaledWidth = videoWidth * (pageHeight / videoHeight);
|
|
115
|
+
xOffset = (scaledWidth - pageWidth) / 2;
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
scaledHeight = videoHeight * (pageWidth / videoWidth);
|
|
119
|
+
yOffset = (scaledHeight - pageHeight) / 2;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
horizontal,
|
|
124
|
+
pageWidth,
|
|
125
|
+
pageHeight,
|
|
126
|
+
videoWidth,
|
|
127
|
+
videoHeight,
|
|
128
|
+
scaledWidth,
|
|
129
|
+
scaledHeight,
|
|
130
|
+
xOffset,
|
|
131
|
+
yOffset,
|
|
132
|
+
};
|
|
133
|
+
}, [enabled, pageHeight, pageWidth, videoHeight, videoWidth]);
|
|
134
|
+
}
|
|
135
|
+
export const DebugBoundingBoxOverlay = ({ scaling, $flipX, guideRect, children, }) => {
|
|
136
|
+
return (_jsx(ObjectDetectionDebugOverlayDiv, { id: "debug-overlay-div", "$flipX": $flipX, style: {
|
|
137
|
+
top: guideRect?.y ?? 0,
|
|
138
|
+
left: guideRect?.x ?? 0,
|
|
139
|
+
width: guideRect?.width || scaling?.pageWidth,
|
|
140
|
+
height: guideRect?.height || scaling?.pageHeight,
|
|
141
|
+
}, children: children }));
|
|
142
|
+
};
|
|
143
|
+
export function IdCaptureDetectedObjectDebugBox({ obj, flipX, color = 'green', scaling, }) {
|
|
144
|
+
const { horizontal, pageWidth, pageHeight, videoWidth, videoHeight, scaledWidth, scaledHeight, xOffset, yOffset, } = scaling;
|
|
145
|
+
if (!videoWidth || !videoHeight || !pageWidth || !pageHeight)
|
|
146
|
+
return _jsx(_Fragment, {});
|
|
147
|
+
let top;
|
|
148
|
+
let left;
|
|
149
|
+
let width;
|
|
150
|
+
let height;
|
|
151
|
+
if (horizontal) {
|
|
152
|
+
top = (obj.box.yMin / videoHeight) * pageHeight;
|
|
153
|
+
left = (obj.box.xMin / videoWidth) * scaledWidth - xOffset;
|
|
154
|
+
width = (obj.box.width / videoWidth) * scaledWidth;
|
|
155
|
+
height = (obj.box.height / videoHeight) * pageHeight;
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
top = (obj.box.yMin / videoHeight) * scaledHeight - yOffset;
|
|
159
|
+
left = (obj.box.xMin / videoWidth) * pageWidth;
|
|
160
|
+
width = (obj.box.width / videoWidth) * pageWidth;
|
|
161
|
+
height = (obj.box.height / videoHeight) * scaledHeight;
|
|
162
|
+
}
|
|
163
|
+
return (_jsx(ObjectDetectionDebugBox, { "$flipX": flipX, "$color": color, style: { top, left, width, height }, children: _jsxs(ObjectDetectionDebugLabel, { "$color": color, children: [obj.label, " ", obj.score.toFixed(2)] }) }));
|
|
164
|
+
}
|
|
165
|
+
export function SelfieCaptureFaceDebugBox({ face, flipX, color = 'green', scaling, showBoundingBox = true, showLandmarks = true, }) {
|
|
166
|
+
const { horizontal, pageWidth, pageHeight, videoWidth, videoHeight, scaledWidth, scaledHeight, xOffset, yOffset, } = scaling;
|
|
167
|
+
if (!videoWidth || !videoHeight || !pageWidth || !pageHeight)
|
|
168
|
+
return _jsx(_Fragment, {});
|
|
169
|
+
let top;
|
|
170
|
+
let left;
|
|
171
|
+
let width;
|
|
172
|
+
let height;
|
|
173
|
+
if (horizontal) {
|
|
174
|
+
top = (face.box.yMin / videoHeight) * pageHeight;
|
|
175
|
+
left = (face.box.xMin / videoWidth) * scaledWidth - xOffset;
|
|
176
|
+
width = (face.box.width / videoWidth) * scaledWidth;
|
|
177
|
+
height = (face.box.height / videoHeight) * pageHeight;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
top = (face.box.yMin / videoHeight) * scaledHeight - yOffset;
|
|
181
|
+
left = (face.box.xMin / videoWidth) * pageWidth;
|
|
182
|
+
width = (face.box.width / videoWidth) * pageWidth;
|
|
183
|
+
height = (face.box.height / videoHeight) * scaledHeight;
|
|
184
|
+
}
|
|
185
|
+
return (_jsxs(_Fragment, { children: [showBoundingBox && (_jsx(ObjectDetectionDebugBox, { "$flipX": flipX, "$color": color, style: { top, left, width, height } })), showLandmarks && face.meshLandmarks ? (_jsx(SelfieCaptureFaceMesh, { face: face, scaling: scaling, flipX: flipX })) : showLandmarks ? (face.keypoints.map((point, ii) => (_jsx(SelfieCaptureFaceKeypoint, { point: point, scaling: scaling, flipX: flipX }, ii)))) : null] }));
|
|
186
|
+
}
|
|
187
|
+
const FaceMeshCanvas = styled.canvas `
|
|
188
|
+
position: absolute;
|
|
189
|
+
pointer-events: none;
|
|
190
|
+
${({ $flipX }) => ($flipX ? 'transform: scaleX(-1);' : '')}
|
|
191
|
+
transform-style: preserve-3d;
|
|
192
|
+
`;
|
|
193
|
+
// 478 = 468 mesh + 10 iris (when iris refinement is enabled). Sizing for the
|
|
194
|
+
// larger case is harmless when iris landmarks aren't returned. Mirrors sdk2
|
|
195
|
+
// FaceLandmarker.ts's MESH_INDEX_COUNT/base color — see this file's header
|
|
196
|
+
// comment for why this port always uses the monochrome fallback.
|
|
197
|
+
const MESH_INDEX_COUNT = 478;
|
|
198
|
+
const MESH_BASE_COLOR = '#6EE7B7';
|
|
199
|
+
function getMeshColorByIndex() {
|
|
200
|
+
return new Array(MESH_INDEX_COUNT).fill(MESH_BASE_COLOR);
|
|
201
|
+
}
|
|
202
|
+
export function SelfieCaptureFaceMesh({ face, scaling, flipX, }) {
|
|
203
|
+
const canvasRef = useRef(null);
|
|
204
|
+
const meshLandmarks = face.meshLandmarks;
|
|
205
|
+
const { horizontal, pageWidth, pageHeight, videoWidth, videoHeight, scaledWidth, scaledHeight, xOffset, yOffset, } = scaling;
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
const canvas = canvasRef.current;
|
|
208
|
+
if (!canvas || !meshLandmarks || !videoWidth || !videoHeight)
|
|
209
|
+
return;
|
|
210
|
+
if (canvas.width !== videoWidth)
|
|
211
|
+
canvas.width = videoWidth;
|
|
212
|
+
if (canvas.height !== videoHeight)
|
|
213
|
+
canvas.height = videoHeight;
|
|
214
|
+
const ctx = canvas.getContext('2d');
|
|
215
|
+
if (!ctx)
|
|
216
|
+
return;
|
|
217
|
+
ctx.clearRect(0, 0, videoWidth, videoHeight);
|
|
218
|
+
const dim = Math.min(videoWidth, videoHeight);
|
|
219
|
+
const dotRadius = Math.max(1.5, dim * 0.002);
|
|
220
|
+
// Group dot indices by color so we can issue one fill per color, which
|
|
221
|
+
// keeps canvas state churn near-zero even at 478 dots × 30fps.
|
|
222
|
+
const colorByIndex = getMeshColorByIndex();
|
|
223
|
+
const groups = new Map();
|
|
224
|
+
for (let i = 0; i < meshLandmarks.length; i++) {
|
|
225
|
+
const c = colorByIndex[i] ?? colorByIndex[colorByIndex.length - 1];
|
|
226
|
+
let bucket = groups.get(c);
|
|
227
|
+
if (!bucket) {
|
|
228
|
+
bucket = [];
|
|
229
|
+
groups.set(c, bucket);
|
|
230
|
+
}
|
|
231
|
+
bucket.push(i);
|
|
232
|
+
}
|
|
233
|
+
groups.forEach((indices, color) => {
|
|
234
|
+
ctx.fillStyle = color;
|
|
235
|
+
ctx.beginPath();
|
|
236
|
+
for (const i of indices) {
|
|
237
|
+
const p = meshLandmarks[i];
|
|
238
|
+
ctx.moveTo(p.x + dotRadius, p.y);
|
|
239
|
+
ctx.arc(p.x, p.y, dotRadius, 0, 2 * Math.PI);
|
|
240
|
+
}
|
|
241
|
+
ctx.fill();
|
|
242
|
+
});
|
|
243
|
+
}, [meshLandmarks, videoWidth, videoHeight]);
|
|
244
|
+
if (!meshLandmarks || !videoWidth || !videoHeight)
|
|
245
|
+
return _jsx(_Fragment, {});
|
|
246
|
+
// Position the canvas so its drawing surface (videoWidth × videoHeight) aligns
|
|
247
|
+
// 1:1 with the displayed video, including letterbox offsets. The parent
|
|
248
|
+
// overlay clips overflow, so the off-page edges of the canvas are hidden the
|
|
249
|
+
// same way the video itself is cropped.
|
|
250
|
+
const style = horizontal
|
|
251
|
+
? { left: -xOffset, top: 0, width: scaledWidth, height: pageHeight }
|
|
252
|
+
: { left: 0, top: -yOffset, width: pageWidth, height: scaledHeight };
|
|
253
|
+
return _jsx(FaceMeshCanvas, { ref: canvasRef, "$flipX": flipX, style: style });
|
|
254
|
+
}
|
|
255
|
+
export function SelfieCaptureFaceKeypoint({ point, flipX, color = 'red', scaling: { horizontal, pageWidth, pageHeight, videoWidth, videoHeight, scaledWidth, scaledHeight, xOffset, yOffset, }, }) {
|
|
256
|
+
if (!point)
|
|
257
|
+
return _jsx(_Fragment, {});
|
|
258
|
+
let left, top;
|
|
259
|
+
if (horizontal) {
|
|
260
|
+
left = (point.x / videoWidth) * scaledWidth - xOffset;
|
|
261
|
+
top = (point.y / videoHeight) * pageHeight;
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
left = (point.x / videoWidth) * pageWidth;
|
|
265
|
+
top = (point.y / videoHeight) * scaledHeight - yOffset;
|
|
266
|
+
}
|
|
267
|
+
top -= 2;
|
|
268
|
+
left -= 2;
|
|
269
|
+
return (_jsx(FaceDetectionKeypointMarker, { "$flipX": flipX, "$color": color, style: { top, left } }));
|
|
270
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type DocumentCaptureGuideOverlayClassNames = {
|
|
2
|
+
container?: string;
|
|
3
|
+
};
|
|
4
|
+
export type DocumentCaptureGuideOverlayProps = {
|
|
5
|
+
/** Width / height of the guide box. Omitted fills the padded area. */
|
|
6
|
+
aspectRatio?: number;
|
|
7
|
+
borderRadius?: number;
|
|
8
|
+
borderColor?: string;
|
|
9
|
+
borderWidth?: number;
|
|
10
|
+
maskColor: string;
|
|
11
|
+
padding?: number;
|
|
12
|
+
classNames?: DocumentCaptureGuideOverlayClassNames;
|
|
13
|
+
};
|
|
14
|
+
export declare function DocumentCaptureGuideOverlay({ aspectRatio, borderRadius, borderColor, borderWidth, maskColor, padding, classNames, }: DocumentCaptureGuideOverlayProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=DocumentCaptureGuideOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocumentCaptureGuideOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/document/DocumentCaptureGuideOverlay.tsx"],"names":[],"mappings":"AAsCA,MAAM,MAAM,qCAAqC,GAAG;IAClD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,gCAAgC,GAAG;IAC7C,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,UAAU,CAAC,EAAE,qCAAqC,CAAA;CACnD,CAAA;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,WAAW,EACX,YAAiB,EACjB,WAAW,EACX,WAAW,EACX,SAAS,EACT,OAAO,EACP,UAAe,GAChB,EAAE,gCAAgC,2CA+HlC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Rewired from sdk2's document_capture/DocumentCaptureGuideOverlay.tsx. The
|
|
3
|
+
// mask drawing is byte-faithful; the plumbing changes:
|
|
4
|
+
// - The computed rect is published to GuideLayoutContext via `setGuideRect`
|
|
5
|
+
// instead of being dispatched into the capture reducer
|
|
6
|
+
// (`dispatch({ type: 'redrawCompleted', payload: { rectX, ... } })`).
|
|
7
|
+
// `ScalingCameraFeed` already reads the rect from that context, so the
|
|
8
|
+
// source's `redrawRequested` / `redrawInProgress` round-trip — which
|
|
9
|
+
// existed only to force a canvas resize before remeasuring — has no port.
|
|
10
|
+
// - `rectOffsetTop` is gone as separate state, but the offset it carried is
|
|
11
|
+
// not: `ScalingCameraFeed` does no such compensation, so the offset is
|
|
12
|
+
// folded into the rect published below.
|
|
13
|
+
// - Geometry lives in the pure `computeGuideRect` (guideRect.ts) so it can be
|
|
14
|
+
// tested without a canvas.
|
|
15
|
+
import { useEffect, useRef } from 'react';
|
|
16
|
+
import { styled, useTheme } from 'styled-components';
|
|
17
|
+
import { useGuideLayout } from '../../layout/GuideLayoutContext';
|
|
18
|
+
import useResizeObserver from '../../layout/useResizeObserver';
|
|
19
|
+
import { isMobile } from '../../utils/isMobile';
|
|
20
|
+
import { setCanvasDimensions } from '../../utils/canvas';
|
|
21
|
+
import { computeGuideRect } from './guideRect';
|
|
22
|
+
/**
|
|
23
|
+
* How far the camera feed overhangs the guide box on each side, in CSS pixels.
|
|
24
|
+
*
|
|
25
|
+
* The feed's position is published from a measurement taken inside an effect
|
|
26
|
+
* keyed on the observed box's SIZE. The wrapper can still shift vertically
|
|
27
|
+
* without resizing — a heading reflow or a late font load moves it a fraction
|
|
28
|
+
* of a pixel — and the observed size itself arrives through
|
|
29
|
+
* useResizeObserver's Math.round. Either can leave the feed short of the hole
|
|
30
|
+
* the mask punches, showing a hairline of background along an edge.
|
|
31
|
+
*
|
|
32
|
+
* Two pixels covers the drift observed in practice (~1px). Overhang is free:
|
|
33
|
+
* the feed sits behind the mask, so extra pixels are covered, whereas a
|
|
34
|
+
* shortfall is visible. This is a tolerance, not exact alignment — the feed is
|
|
35
|
+
* deliberately a little larger than the hole rather than pixel-matched to it.
|
|
36
|
+
*/
|
|
37
|
+
const FEED_BLEED_PX = 2;
|
|
38
|
+
export function DocumentCaptureGuideOverlay({ aspectRatio, borderRadius = 25, borderColor, borderWidth, maskColor, padding, classNames = {}, }) {
|
|
39
|
+
const { ref: wrapperRef, width: wrapperWidth = 0, height: wrapperHeight = 0, } = useResizeObserver();
|
|
40
|
+
const canvasRef = useRef(null);
|
|
41
|
+
const { setGuideRect } = useGuideLayout();
|
|
42
|
+
const theme = useTheme();
|
|
43
|
+
const resolvedBorderWidth = borderWidth ?? theme.documentCapture?.guideBox?.borderWidth ?? 4;
|
|
44
|
+
const resolvedPadding = padding ??
|
|
45
|
+
(isMobile()
|
|
46
|
+
? (theme.documentCapture?.guideBox?.mobilePadding ?? 0)
|
|
47
|
+
: (theme.documentCapture?.guideBox?.desktopPadding ?? 0));
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (!wrapperWidth || !wrapperHeight)
|
|
50
|
+
return;
|
|
51
|
+
const rect = computeGuideRect({
|
|
52
|
+
wrapperWidth,
|
|
53
|
+
wrapperHeight,
|
|
54
|
+
aspectRatio,
|
|
55
|
+
padding: resolvedPadding,
|
|
56
|
+
borderWidth: resolvedBorderWidth,
|
|
57
|
+
});
|
|
58
|
+
const canvas = canvasRef.current;
|
|
59
|
+
// Offset of the observed box within the box the feed is positioned against.
|
|
60
|
+
//
|
|
61
|
+
// Measured from the WRAPPER, not the canvas: `rect` is derived from the
|
|
62
|
+
// wrapper's observed size, and the canvas's own box differs from it by up
|
|
63
|
+
// to a pixel, so mixing the two leaves the feed flush with one edge of the
|
|
64
|
+
// hole instead of overhanging it.
|
|
65
|
+
//
|
|
66
|
+
// `offsetLeft`/`offsetTop` would be simpler but are integers while layout
|
|
67
|
+
// is fractional — a box at y=56.47 reports 56, shifting the feed half a
|
|
68
|
+
// pixel up and reopening the hairline the bleed exists to close. Measuring
|
|
69
|
+
// against `offsetParent` (what an absolutely positioned child resolves
|
|
70
|
+
// against) keeps the fraction. jsdom reports zeroes, which is harmless:
|
|
71
|
+
// the offset is genuinely 0 there.
|
|
72
|
+
const wrapperEl = canvas?.parentElement;
|
|
73
|
+
const offsetParentBox = wrapperEl?.offsetParent?.getBoundingClientRect();
|
|
74
|
+
const wrapperBox = wrapperEl?.getBoundingClientRect();
|
|
75
|
+
const offsetX = offsetParentBox && wrapperBox
|
|
76
|
+
? wrapperBox.x - offsetParentBox.x
|
|
77
|
+
: (wrapperEl?.offsetLeft ?? 0);
|
|
78
|
+
const offsetY = offsetParentBox && wrapperBox
|
|
79
|
+
? wrapperBox.y - offsetParentBox.y
|
|
80
|
+
: (wrapperEl?.offsetTop ?? 0);
|
|
81
|
+
// `rect` is relative to this canvas, but the camera feed is absolutely
|
|
82
|
+
// positioned against the nearest positioned ancestor — the same box
|
|
83
|
+
// `offsetLeft`/`offsetTop` are measured from. Without this the feed sits
|
|
84
|
+
// too high by the heading row's height, leaving a band of background
|
|
85
|
+
// showing at the bottom of the guide box. sdk2 did the same thing by
|
|
86
|
+
// carrying a separate `rectOffsetTop` through its reducer and adding it at
|
|
87
|
+
// the consumer (DocumentCaptureScreen.tsx:132); folding it in here keeps
|
|
88
|
+
// the published rect in one coordinate space.
|
|
89
|
+
//
|
|
90
|
+
// The feed is then grown by FEED_BLEED_PX on every side to absorb the
|
|
91
|
+
// remaining rounding: useResizeObserver reports the observed box through
|
|
92
|
+
// Math.round, so the rect can still land a fraction of a pixel short of the
|
|
93
|
+
// hole the mask punches, showing a hairline of background at whichever edge
|
|
94
|
+
// lost the rounding. Overhanging is free — the feed sits behind the mask,
|
|
95
|
+
// so the extra pixel is covered, whereas a shortfall is visible.
|
|
96
|
+
//
|
|
97
|
+
// Published before any drawing so the feed still sizes itself where no 2D
|
|
98
|
+
// context is available.
|
|
99
|
+
setGuideRect({
|
|
100
|
+
x: rect.x + offsetX - FEED_BLEED_PX,
|
|
101
|
+
y: rect.y + offsetY - FEED_BLEED_PX,
|
|
102
|
+
width: rect.width + FEED_BLEED_PX * 2,
|
|
103
|
+
height: rect.height + FEED_BLEED_PX * 2,
|
|
104
|
+
});
|
|
105
|
+
if (!canvas)
|
|
106
|
+
return;
|
|
107
|
+
setCanvasDimensions(canvas, wrapperWidth, wrapperHeight);
|
|
108
|
+
const ctx = canvas.getContext('2d');
|
|
109
|
+
if (!ctx)
|
|
110
|
+
return;
|
|
111
|
+
ctx.fillStyle = maskColor;
|
|
112
|
+
ctx.clearRect(0, 0, wrapperWidth, wrapperHeight);
|
|
113
|
+
ctx.fillRect(0, 0, wrapperWidth, wrapperHeight);
|
|
114
|
+
ctx.beginPath();
|
|
115
|
+
ctx.roundRect(rect.x, rect.y, rect.width, rect.height, borderRadius);
|
|
116
|
+
ctx.lineWidth = resolvedBorderWidth;
|
|
117
|
+
ctx.strokeStyle = borderColor ?? 'white';
|
|
118
|
+
ctx.stroke();
|
|
119
|
+
// Punch the guide box out of the mask. The fill colour is irrelevant under
|
|
120
|
+
// 'destination-out'; only its alpha matters.
|
|
121
|
+
ctx.fillStyle = 'rgba(0,0,0,1)';
|
|
122
|
+
ctx.globalCompositeOperation = 'destination-out';
|
|
123
|
+
ctx.fill();
|
|
124
|
+
ctx.globalCompositeOperation = 'source-over';
|
|
125
|
+
}, [
|
|
126
|
+
aspectRatio,
|
|
127
|
+
borderColor,
|
|
128
|
+
borderRadius,
|
|
129
|
+
maskColor,
|
|
130
|
+
resolvedBorderWidth,
|
|
131
|
+
resolvedPadding,
|
|
132
|
+
setGuideRect,
|
|
133
|
+
wrapperHeight,
|
|
134
|
+
wrapperWidth,
|
|
135
|
+
]);
|
|
136
|
+
// Releasing the shared rect on unmount stops a stale guide box from sizing
|
|
137
|
+
// the feed for whatever renders next.
|
|
138
|
+
useEffect(() => () => setGuideRect(null), [setGuideRect]);
|
|
139
|
+
return (_jsx(CanvasWrapper, { ref: wrapperRef, className: classNames.container, "$maskColor": maskColor, children: _jsx(Canvas, { ref: canvasRef }) }));
|
|
140
|
+
}
|
|
141
|
+
const CanvasWrapper = styled.div `
|
|
142
|
+
flex-grow: 1;
|
|
143
|
+
background-clip: padding-box;
|
|
144
|
+
box-shadow: inset 0 0 0 2px ${(props) => props.$maskColor};
|
|
145
|
+
`;
|
|
146
|
+
const Canvas = styled.canvas `
|
|
147
|
+
display: block;
|
|
148
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GuideRect } from '../../layout/GuideLayoutContext';
|
|
2
|
+
export type ComputeGuideRectInput = {
|
|
3
|
+
wrapperWidth: number;
|
|
4
|
+
wrapperHeight: number;
|
|
5
|
+
/** Width / height. Omitted means "fill the padded box". */
|
|
6
|
+
aspectRatio?: number;
|
|
7
|
+
padding: number;
|
|
8
|
+
borderWidth: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function computeGuideRect({ wrapperWidth, wrapperHeight, aspectRatio, padding, borderWidth, }: ComputeGuideRectInput): GuideRect;
|
|
11
|
+
//# sourceMappingURL=guideRect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guideRect.d.ts","sourceRoot":"","sources":["../../../src/components/document/guideRect.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAEhE,MAAM,MAAM,qBAAqB,GAAG;IAClC,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,WAAW,GACZ,EAAE,qBAAqB,GAAG,SAAS,CA2BnC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function computeGuideRect({ wrapperWidth, wrapperHeight, aspectRatio, padding, borderWidth, }) {
|
|
2
|
+
const inset = padding + borderWidth;
|
|
3
|
+
const boundingWidth = Math.max(0, wrapperWidth - inset * 2);
|
|
4
|
+
const boundingHeight = Math.max(0, wrapperHeight - inset * 2);
|
|
5
|
+
let x = inset;
|
|
6
|
+
let y = inset;
|
|
7
|
+
let width = boundingWidth;
|
|
8
|
+
let height = boundingHeight;
|
|
9
|
+
if (aspectRatio !== undefined) {
|
|
10
|
+
const scaledWidth = boundingHeight * aspectRatio;
|
|
11
|
+
const scaledHeight = boundingWidth / aspectRatio;
|
|
12
|
+
// Constrain on whichever axis keeps the box inside the bounding area, then
|
|
13
|
+
// centre on that axis — the source compares against `boundingWidth` rather
|
|
14
|
+
// than testing the ratio directly, and that comparison is preserved.
|
|
15
|
+
if (scaledWidth < boundingWidth) {
|
|
16
|
+
width = scaledWidth;
|
|
17
|
+
x += (boundingWidth - width) / 2;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
height = scaledHeight;
|
|
21
|
+
y += (boundingHeight - height) / 2;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return { x, y, width, height };
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DocumentCaptureItem, DocumentUploadState } from '@idmission/websdk-core/documentCapture';
|
|
3
|
+
import type { CameraFeedMode } from '../CameraFeed';
|
|
4
|
+
/**
|
|
5
|
+
* The public, parity-preserving document config — sdk2's `CapturedDocument`
|
|
6
|
+
* (document_capture/DocumentCaptureStateProvider.tsx:27-39).
|
|
7
|
+
*
|
|
8
|
+
* It lives here rather than in core because `instructions` is a `ReactNode` and
|
|
9
|
+
* the callbacks take React-facing objects; `@idmission/websdk-core` is
|
|
10
|
+
* React-free, enforced by its own `reactFree.test.ts`. Core therefore takes only
|
|
11
|
+
* the stripped `DocumentCaptureItem` half, and this type re-composes the rest.
|
|
12
|
+
*
|
|
13
|
+
* The progress fields (`documentId`, `contentUrl`, `uploadState`) are populated
|
|
14
|
+
* on the objects handed to the callbacks, matching what sdk2's consumers saw.
|
|
15
|
+
*/
|
|
16
|
+
export type CapturedDocument = DocumentCaptureItem & {
|
|
17
|
+
cameraFeedMode?: CameraFeedMode;
|
|
18
|
+
instructions?: ReactNode;
|
|
19
|
+
onCaptured?: (document: CapturedDocument) => void;
|
|
20
|
+
onUploaded?: (document: CapturedDocument) => void;
|
|
21
|
+
documentId?: string;
|
|
22
|
+
contentUrl?: string;
|
|
23
|
+
uploadState?: DocumentUploadState;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/document/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,gBAAgB,GAAG,mBAAmB,GAAG;IACnD,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACjD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACjD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,mBAAmB,CAAA;CAClC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type LoaderButtonColors } from '../common/LoaderButton';
|
|
2
|
+
import { type CustomerSuppliedVerbiage } from '../../i18n';
|
|
3
|
+
export type CameraAccessDeniedOverlayAssets = {
|
|
4
|
+
imageUrl?: string;
|
|
5
|
+
};
|
|
6
|
+
export type CameraAccessDeniedOverlayClassNames = {
|
|
7
|
+
container?: string;
|
|
8
|
+
inner?: string;
|
|
9
|
+
imageContainer?: string;
|
|
10
|
+
image?: string;
|
|
11
|
+
heading?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
retryBtn?: string;
|
|
14
|
+
};
|
|
15
|
+
export type CameraAccessDeniedOverlayColors = {
|
|
16
|
+
retryBtn?: LoaderButtonColors;
|
|
17
|
+
};
|
|
18
|
+
export type CameraAccessDeniedOverlayVerbiage = {
|
|
19
|
+
headingText?: CustomerSuppliedVerbiage;
|
|
20
|
+
descriptionText?: CustomerSuppliedVerbiage;
|
|
21
|
+
retryBtnText?: CustomerSuppliedVerbiage;
|
|
22
|
+
};
|
|
23
|
+
export type CameraAccessDeniedOverlayProps = {
|
|
24
|
+
onRetry: () => void;
|
|
25
|
+
assets?: CameraAccessDeniedOverlayAssets;
|
|
26
|
+
classNames?: CameraAccessDeniedOverlayClassNames;
|
|
27
|
+
colors?: CameraAccessDeniedOverlayColors;
|
|
28
|
+
verbiage?: CameraAccessDeniedOverlayVerbiage;
|
|
29
|
+
};
|
|
30
|
+
export declare const CameraAccessDeniedOverlay: ({ onRetry, assets, classNames, colors, verbiage: rawVerbiage, }: CameraAccessDeniedOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=CameraAccessDeniedOverlay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CameraAccessDeniedOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/error/CameraAccessDeniedOverlay.tsx"],"names":[],"mappings":"AAkBA,OAAO,EAAgB,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC9E,OAAO,EAAE,KAAK,wBAAwB,EAAmB,MAAM,YAAY,CAAA;AAE3E,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,mCAAmC,GAAG;IAChD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,CAAC,EAAE,kBAAkB,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG;IAC9C,WAAW,CAAC,EAAE,wBAAwB,CAAA;IACtC,eAAe,CAAC,EAAE,wBAAwB,CAAA;IAC1C,YAAY,CAAC,EAAE,wBAAwB,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,CAAC,EAAE,+BAA+B,CAAA;IACxC,UAAU,CAAC,EAAE,mCAAmC,CAAA;IAChD,MAAM,CAAC,EAAE,+BAA+B,CAAA;IACxC,QAAQ,CAAC,EAAE,iCAAiC,CAAA;CAC7C,CAAA;AAED,eAAO,MAAM,yBAAyB,GAAI,iEAMvC,8BAA8B,4CAsChC,CAAA"}
|