@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 @@
|
|
|
1
|
+
{"version":3,"file":"GuideOrientationContext.d.ts","sourceRoot":"","sources":["../../src/layout/GuideOrientationContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,SAAS,EACT,WAAW,EAIZ,MAAM,OAAO,CAAA;AAGd,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,UAAU,GAAG,WAAW,CAAA;IACrC,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,MAAM,CAAA;IACrB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,gBAAgB,EAAE,MAAM,CAAA;IACxB,mBAAmB,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,UAAU,EAAE,WAAW,CAAC,cAAc,CAAC,CAAA;CACxC,CAAA;AAED,eAAO,MAAM,uBAAuB,gDAQlC,CAAA;AAEF,MAAM,CAAC,OAAO,UAAU,+BAA+B,CAAC,EACtD,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;CACpB,GAAG,YAAY,CAsCf;AAED,wBAAgB,0BAA0B,IAAI,qBAAqB,CAOlE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useMemo, useState, } from 'react';
|
|
3
|
+
import useResizeObserver from './useResizeObserver';
|
|
4
|
+
export const GuideOrientationContext = createContext({
|
|
5
|
+
orientation: 'landscape',
|
|
6
|
+
wrapperWidth: 1,
|
|
7
|
+
wrapperHeight: 1,
|
|
8
|
+
wrapperAspectRatio: 0,
|
|
9
|
+
imageAspectRatio: 0,
|
|
10
|
+
wrapperRef: null,
|
|
11
|
+
setImageAspectRatio: () => null,
|
|
12
|
+
});
|
|
13
|
+
export default function GuideOrientationContextProvider({ children, }) {
|
|
14
|
+
const [imageAspectRatio, setImageAspectRatio] = useState(1);
|
|
15
|
+
const { ref: wrapperRef, width: wrapperWidth = 1, height: wrapperHeight = 1, } = useResizeObserver();
|
|
16
|
+
const wrapperAspectRatio = useMemo(() => wrapperWidth / wrapperHeight, [wrapperHeight, wrapperWidth]);
|
|
17
|
+
const orientation = 'landscape'; //width > height ? 'landscape' : 'portrait'
|
|
18
|
+
const value = useMemo(() => ({
|
|
19
|
+
orientation,
|
|
20
|
+
wrapperWidth,
|
|
21
|
+
wrapperHeight,
|
|
22
|
+
wrapperAspectRatio,
|
|
23
|
+
imageAspectRatio,
|
|
24
|
+
setImageAspectRatio,
|
|
25
|
+
wrapperRef,
|
|
26
|
+
}), [
|
|
27
|
+
imageAspectRatio,
|
|
28
|
+
wrapperAspectRatio,
|
|
29
|
+
wrapperHeight,
|
|
30
|
+
wrapperRef,
|
|
31
|
+
wrapperWidth,
|
|
32
|
+
]);
|
|
33
|
+
return (_jsx(GuideOrientationContext.Provider, { value: value, children: children }));
|
|
34
|
+
}
|
|
35
|
+
export function useGuideOrientationContext() {
|
|
36
|
+
const ctx = useContext(GuideOrientationContext);
|
|
37
|
+
if (!ctx)
|
|
38
|
+
throw new Error('useGuideOrientationContext cannot be used without GuideOrientationContextProvider');
|
|
39
|
+
return ctx;
|
|
40
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RefCallback } from 'react';
|
|
2
|
+
export type ObservedSize = {
|
|
3
|
+
width?: number;
|
|
4
|
+
height?: number;
|
|
5
|
+
};
|
|
6
|
+
type HookResponse<T extends Element> = {
|
|
7
|
+
ref: RefCallback<T>;
|
|
8
|
+
} & ObservedSize;
|
|
9
|
+
export default function useResizeObserver<T extends Element>(): HookResponse<T>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=useResizeObserver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useResizeObserver.d.ts","sourceRoot":"","sources":["../../src/layout/useResizeObserver.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,EAMZ,MAAM,OAAO,CAAA;AAEd,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,KAAK,YAAY,CAAC,CAAC,SAAS,OAAO,IAAI;IACrC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;CACpB,GAAG,YAAY,CAAA;AAEhB,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,CAAC,SAAS,OAAO,KACd,YAAY,CAAC,CAAC,CAAC,CAkEnB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// This is a simplified version of https://github.com/ZeeCoder/use-resize-observer.
|
|
2
|
+
// We have removed all options and made it compliant with React Compiler/React 19.
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState, } from 'react';
|
|
4
|
+
export default function useResizeObserver() {
|
|
5
|
+
// Using a single instance throughout the hook's lifetime
|
|
6
|
+
const resizeObserverRef = useRef(undefined);
|
|
7
|
+
const [size, setSize] = useState({});
|
|
8
|
+
// In certain edge cases the RO might want to report a size change just after
|
|
9
|
+
// the component unmounted.
|
|
10
|
+
const didUnmount = useRef(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
didUnmount.current = false;
|
|
13
|
+
return () => {
|
|
14
|
+
didUnmount.current = true;
|
|
15
|
+
};
|
|
16
|
+
}, []);
|
|
17
|
+
// Using a ref to track the previous width / height to avoid unnecessary renders.
|
|
18
|
+
const previous = useRef({});
|
|
19
|
+
// This block is kinda like a useEffect, only it's called whenever a new
|
|
20
|
+
// element could be resolved based on the ref option. It also has a cleanup
|
|
21
|
+
// function.
|
|
22
|
+
const refCallback = useResolvedElement(useCallback((element) => {
|
|
23
|
+
// We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.
|
|
24
|
+
// This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.
|
|
25
|
+
resizeObserverRef.current ||= new ResizeObserver((entries) => {
|
|
26
|
+
const entry = entries[0];
|
|
27
|
+
const reportedWidth = extractSize(entry, 'inlineSize');
|
|
28
|
+
const reportedHeight = extractSize(entry, 'blockSize');
|
|
29
|
+
const newWidth = reportedWidth ? Math.round(reportedWidth) : undefined;
|
|
30
|
+
const newHeight = reportedHeight
|
|
31
|
+
? Math.round(reportedHeight)
|
|
32
|
+
: undefined;
|
|
33
|
+
if (previous.current.width !== newWidth ||
|
|
34
|
+
previous.current.height !== newHeight) {
|
|
35
|
+
const newSize = { width: newWidth, height: newHeight };
|
|
36
|
+
previous.current.width = newWidth;
|
|
37
|
+
previous.current.height = newHeight;
|
|
38
|
+
if (!didUnmount.current) {
|
|
39
|
+
setSize(newSize);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
resizeObserverRef.current.observe(element);
|
|
44
|
+
return () => {
|
|
45
|
+
resizeObserverRef.current?.unobserve?.(element);
|
|
46
|
+
};
|
|
47
|
+
}, []));
|
|
48
|
+
return useMemo(() => ({
|
|
49
|
+
ref: refCallback,
|
|
50
|
+
width: size.width,
|
|
51
|
+
height: size.height,
|
|
52
|
+
}), [refCallback, size.width, size.height]);
|
|
53
|
+
}
|
|
54
|
+
// This could've been more streamlined with internal state instead of abusing
|
|
55
|
+
// refs to such extent, but then composing hooks and components could not opt out of unnecessary renders.
|
|
56
|
+
function useResolvedElement(subscriber) {
|
|
57
|
+
const lastReportRef = useRef(null);
|
|
58
|
+
const cbElementRef = useRef(null);
|
|
59
|
+
// Calling re-evaluation after each render without using a dep array,
|
|
60
|
+
// as the ref object's current value could've changed since the last render.
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
evaluateSubscription();
|
|
63
|
+
});
|
|
64
|
+
const evaluateSubscription = useCallback(() => {
|
|
65
|
+
const cbElement = cbElementRef.current;
|
|
66
|
+
// Ugly ternary. But smaller than an if-else block.
|
|
67
|
+
const element = cbElement ? cbElement : null;
|
|
68
|
+
if (lastReportRef.current &&
|
|
69
|
+
lastReportRef.current.element === element &&
|
|
70
|
+
lastReportRef.current.subscriber === subscriber) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
if (lastReportRef.current && lastReportRef.current.cleanup) {
|
|
74
|
+
lastReportRef.current.cleanup();
|
|
75
|
+
}
|
|
76
|
+
lastReportRef.current = {
|
|
77
|
+
element,
|
|
78
|
+
subscriber,
|
|
79
|
+
// Only calling the subscriber, if there's an actual element to report.
|
|
80
|
+
// Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.
|
|
81
|
+
cleanup: element ? subscriber(element) : undefined,
|
|
82
|
+
};
|
|
83
|
+
}, [subscriber]);
|
|
84
|
+
// making sure we call the cleanup function on unmount
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
return () => {
|
|
87
|
+
if (lastReportRef.current && lastReportRef.current.cleanup) {
|
|
88
|
+
lastReportRef.current.cleanup();
|
|
89
|
+
lastReportRef.current = null;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}, []);
|
|
93
|
+
return useCallback((element) => {
|
|
94
|
+
cbElementRef.current = element;
|
|
95
|
+
evaluateSubscription();
|
|
96
|
+
}, [evaluateSubscription]);
|
|
97
|
+
}
|
|
98
|
+
function extractSize(entry, sizeType) {
|
|
99
|
+
if (!entry.contentBoxSize) {
|
|
100
|
+
// The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.
|
|
101
|
+
// See the 6th step in the description for the RO algorithm:
|
|
102
|
+
// https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h
|
|
103
|
+
// > Set this.contentRect to logical this.contentBoxSize given target and observedBox of "content-box".
|
|
104
|
+
// In real browser implementations of course these objects differ, but the width/height values should be equivalent.
|
|
105
|
+
return entry.contentRect[sizeType === 'inlineSize' ? 'width' : 'height'];
|
|
106
|
+
}
|
|
107
|
+
// A couple bytes smaller than calling Array.isArray() and just as effective here.
|
|
108
|
+
return entry.contentBoxSize[0]
|
|
109
|
+
? entry.contentBoxSize[0][sizeType]
|
|
110
|
+
: // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current
|
|
111
|
+
// behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.
|
|
112
|
+
// @ts-expect-error TS2339: Property '0' does not exist on type 'ResizeObserverSize'.
|
|
113
|
+
entry.contentBoxSize[sizeType];
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alignGlobals.d.ts","sourceRoot":"","sources":["../../src/testing/alignGlobals.ts"],"names":[],"mappings":"AAqBA,wBAAgB,uBAAuB,IAAI,IAAI,CAG9C"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// global-jsdom only copies a jsdom global onto `globalThis` when that name
|
|
2
|
+
// isn't already defined there (see its KEYS filter). Node has shipped its
|
|
3
|
+
// own `File`/`Blob` globals since v20, so they win the dedup and stick
|
|
4
|
+
// around instead of jsdom's versions. jsdom's `FileReader` (which Node has
|
|
5
|
+
// no built-in for, so it *does* get copied) internally brand-checks its
|
|
6
|
+
// argument against jsdom's own `Blob` implementation and rejects a
|
|
7
|
+
// Node-native `File`/`Blob` with "parameter 1 is not of type 'Blob'".
|
|
8
|
+
//
|
|
9
|
+
// Any suite that exercises a real `FileReader.readAsDataURL(new File(...))`
|
|
10
|
+
// read — because the component under test has no `readFile` injection seam
|
|
11
|
+
// reachable from that call site — needs `globalThis.File`/`Blob` realigned
|
|
12
|
+
// to jsdom's versions before constructing a `File`. Call
|
|
13
|
+
// `alignFileAndBlobGlobals()` once at module scope in that test file.
|
|
14
|
+
//
|
|
15
|
+
// This is deliberately NOT done in the shared `test/setup.ts`: that file is
|
|
16
|
+
// loaded via `--import ./test/setup.ts` for every matched test file, so
|
|
17
|
+
// anything placed there would affect suites that don't need it. Scoping the
|
|
18
|
+
// realignment to only the test files that need it is safe because Node's
|
|
19
|
+
// test runner isolates each matched file in its own subprocess — the
|
|
20
|
+
// module-scope assignment below has no effect on any other test file in the
|
|
21
|
+
// suite.
|
|
22
|
+
export function alignFileAndBlobGlobals() {
|
|
23
|
+
globalThis.File = window.File;
|
|
24
|
+
globalThis.Blob = window.Blob;
|
|
25
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type DocumentCaptureControllerState, type DocumentCaptureEntry, type DocumentCaptureItem } from '@idmission/websdk-core/documentCapture';
|
|
2
|
+
export declare function buildDocumentEntries(items: readonly DocumentCaptureItem[], createObjectUrl?: (blob: Blob) => string): DocumentCaptureEntry[];
|
|
3
|
+
export declare function buildDocumentControllerState(overrides?: Partial<DocumentCaptureControllerState>): DocumentCaptureControllerState;
|
|
4
|
+
//# sourceMappingURL=buildDocumentState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildDocumentState.d.ts","sourceRoot":"","sources":["../../src/testing/buildDocumentState.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,8BAA8B,EACnC,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,wCAAwC,CAAA;AAU/C,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,eAAe,GAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAwB,GACxD,oBAAoB,EAAE,CAExB;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,GAAE,OAAO,CAAC,8BAA8B,CAAM,GACtD,8BAA8B,CAOhC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { buildEntries, createInitialDocumentCaptureState, } from '@idmission/websdk-core/documentCapture';
|
|
2
|
+
/**
|
|
3
|
+
* jsdom exposes `URL.createObjectURL` inconsistently across versions, and a
|
|
4
|
+
* test asserting on a preview URL wants a stable value anyway, so entries built
|
|
5
|
+
* for tests get a deterministic fake URL unless the caller supplies its own.
|
|
6
|
+
* Stories running in a real browser can pass `URL.createObjectURL`.
|
|
7
|
+
*/
|
|
8
|
+
const stableObjectUrl = (blob) => `blob:test/${blob.size}`;
|
|
9
|
+
export function buildDocumentEntries(items, createObjectUrl = stableObjectUrl) {
|
|
10
|
+
return buildEntries(items, createObjectUrl);
|
|
11
|
+
}
|
|
12
|
+
export function buildDocumentControllerState(overrides = {}) {
|
|
13
|
+
const base = createInitialDocumentCaptureState(overrides.documents ?? []);
|
|
14
|
+
return {
|
|
15
|
+
...base,
|
|
16
|
+
...overrides,
|
|
17
|
+
camera: { ...base.camera, ...overrides.camera },
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ChallengeRunnerSnapshot, type FaceDetectionPrediction, type LivenessMachineState, type SelfieCameraState, type SelfieCaptureControllerState, type SelfieModelsState } from '@idmission/websdk-core/selfieCapture';
|
|
2
|
+
export declare function buildSelfieControllerState(overrides?: Partial<SelfieCaptureControllerState>): SelfieCaptureControllerState;
|
|
3
|
+
export declare const READY_SELFIE_MODELS: SelfieModelsState;
|
|
4
|
+
export declare const READY_SELFIE_CAMERA: SelfieCameraState;
|
|
5
|
+
export declare function faceReadyPrediction(overrides?: Partial<FaceDetectionPrediction>): FaceDetectionPrediction;
|
|
6
|
+
export declare function livenessState(overrides?: Partial<LivenessMachineState>): LivenessMachineState;
|
|
7
|
+
export declare function challengeSnapshot(overrides?: Partial<ChallengeRunnerSnapshot>): ChallengeRunnerSnapshot;
|
|
8
|
+
//# sourceMappingURL=buildSelfieState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSelfieState.d.ts","sourceRoot":"","sources":["../../src/testing/buildSelfieState.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACvB,MAAM,sCAAsC,CAAA;AAE7C,wBAAgB,0BAA0B,CACxC,SAAS,GAAE,OAAO,CAAC,4BAA4B,CAAM,GACpD,4BAA4B,CAgB9B;AAMD,eAAO,MAAM,mBAAmB,EAAE,iBAMjC,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,iBAIjC,CAAA;AAMD,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC/C,uBAAuB,CAezB;AAID,wBAAgB,aAAa,CAC3B,SAAS,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAC5C,oBAAoB,CAKtB;AAID,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC/C,uBAAuB,CAYzB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// State factory for the scriptable fake SelfieCaptureController (Task 1).
|
|
2
|
+
// Defaults mirror what the real controller (controller.ts's
|
|
3
|
+
// createSelfieCaptureController + its toPublicState() derivation) publishes
|
|
4
|
+
// before attach() ever resolves: createInitialSelfieCaptureState()'s flow
|
|
5
|
+
// state spread + the controller-only additions (camera/capturedAttempt/
|
|
6
|
+
// capturedImageUrl/liveness/challenge) it seeds its internal store with,
|
|
7
|
+
// plus the derived-field default toPublicState() would compute for that
|
|
8
|
+
// pristine internal state (held guidance NONE, unsatisfied).
|
|
9
|
+
import { createInitialLivenessMachineState, createInitialSelfieCaptureState, SelfieGuidanceCode, } from '@idmission/websdk-core/selfieCapture';
|
|
10
|
+
export function buildSelfieControllerState(overrides = {}) {
|
|
11
|
+
const flow = createInitialSelfieCaptureState();
|
|
12
|
+
return {
|
|
13
|
+
...flow,
|
|
14
|
+
phase: 'initializing',
|
|
15
|
+
guidance: { code: SelfieGuidanceCode.NONE, satisfied: false },
|
|
16
|
+
prediction: null,
|
|
17
|
+
error: null,
|
|
18
|
+
camera: { ready: false, isRearFacing: false, accessRequested: false },
|
|
19
|
+
capturedAttempt: null,
|
|
20
|
+
capturedImageUrl: null,
|
|
21
|
+
liveness: null,
|
|
22
|
+
challenge: null,
|
|
23
|
+
livenessTimedOut: false,
|
|
24
|
+
...overrides,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
// Tiny fixture helpers shared across view tests (Task 1's brief) — kept in
|
|
28
|
+
// the testing barrel alongside the state builder so consuming tests never
|
|
29
|
+
// hand-roll these shapes themselves.
|
|
30
|
+
export const READY_SELFIE_MODELS = {
|
|
31
|
+
ready: true,
|
|
32
|
+
loadState: 'ready',
|
|
33
|
+
downloadProgress: 1,
|
|
34
|
+
warmingStartedAt: null,
|
|
35
|
+
error: null,
|
|
36
|
+
};
|
|
37
|
+
export const READY_SELFIE_CAMERA = {
|
|
38
|
+
ready: true,
|
|
39
|
+
isRearFacing: false,
|
|
40
|
+
accessRequested: true,
|
|
41
|
+
};
|
|
42
|
+
// Minimal FaceDetectionPrediction with faceReady: true — shape copied from
|
|
43
|
+
// core's own guidance.test.ts `prediction()` fixture (the closest analog in
|
|
44
|
+
// core; controller.test.ts drives the real pipeline instead of a literal
|
|
45
|
+
// fixture), not invented fresh here.
|
|
46
|
+
export function faceReadyPrediction(overrides = {}) {
|
|
47
|
+
return {
|
|
48
|
+
face: null,
|
|
49
|
+
faceNotDetected: false,
|
|
50
|
+
faceNotCentered: false,
|
|
51
|
+
faceLookingAway: false,
|
|
52
|
+
faceTooClose: false,
|
|
53
|
+
faceTooFar: false,
|
|
54
|
+
faceReady: true,
|
|
55
|
+
faceReadyAt: null,
|
|
56
|
+
faceIsStable: true,
|
|
57
|
+
noseIsStable: true,
|
|
58
|
+
faceVisibilityTooLow: false,
|
|
59
|
+
...overrides,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// sdk2-faithful defaults: requestState 'CAPTURING' (the machine's own
|
|
63
|
+
// createInitialLivenessMachineState()), counters at 0, flags false.
|
|
64
|
+
export function livenessState(overrides = {}) {
|
|
65
|
+
return {
|
|
66
|
+
...createInitialLivenessMachineState(),
|
|
67
|
+
...overrides,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
// sdk2-faithful defaults for a challenge NOT in progress: no active prompt,
|
|
71
|
+
// counters at 0, flags false, no finalized result.
|
|
72
|
+
export function challengeSnapshot(overrides = {}) {
|
|
73
|
+
return {
|
|
74
|
+
promptKind: null,
|
|
75
|
+
promptCount: 0,
|
|
76
|
+
stepIndex: 0,
|
|
77
|
+
stepCount: 0,
|
|
78
|
+
awaitingReturn: false,
|
|
79
|
+
settling: false,
|
|
80
|
+
finalized: false,
|
|
81
|
+
result: null,
|
|
82
|
+
...overrides,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type SignatureCaptureControllerState } from '@idmission/websdk-core/signatureCapture';
|
|
2
|
+
export declare function buildSignatureControllerState(overrides?: Partial<SignatureCaptureControllerState>): SignatureCaptureControllerState;
|
|
3
|
+
//# sourceMappingURL=buildSignatureState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildSignatureState.d.ts","sourceRoot":"","sources":["../../src/testing/buildSignatureState.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,+BAA+B,EACrC,MAAM,yCAAyC,CAAA;AAEhD,wBAAgB,6BAA6B,CAC3C,SAAS,GAAE,OAAO,CAAC,+BAA+B,CAAM,GACvD,+BAA+B,CAYjC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createInitialSignatureCaptureState, } from '@idmission/websdk-core/signatureCapture';
|
|
2
|
+
export function buildSignatureControllerState(overrides = {}) {
|
|
3
|
+
const base = createInitialSignatureCaptureState(overrides.captureMode ?? 'video');
|
|
4
|
+
return {
|
|
5
|
+
...base,
|
|
6
|
+
...overrides,
|
|
7
|
+
camera: { ...base.camera, ...overrides.camera },
|
|
8
|
+
pipeline: { ...base.pipeline, ...overrides.pipeline },
|
|
9
|
+
guidance: { ...base.guidance, ...overrides.guidance },
|
|
10
|
+
recording: { ...base.recording, ...overrides.recording },
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildState.d.ts","sourceRoot":"","sources":["../../src/testing/buildState.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,wBAAwB,EAK9B,MAAM,kCAAkC,CAAA;AAEzC,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAChD,wBAAwB,CAyB1B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// State factory for the scriptable fake IdCaptureController (Task 5).
|
|
2
|
+
// Defaults mirror what the real controller (controller.ts:288-296 + its
|
|
3
|
+
// toPublicState() derivation) publishes before attach() ever resolves:
|
|
4
|
+
// initialFlowState spread + the InternalState defaults it seeds its store
|
|
5
|
+
// with, plus the derived-field defaults toPublicState() would compute for
|
|
6
|
+
// that pristine internal state (held + raw guidance both GuidanceCode.NONE,
|
|
7
|
+
// InstructionCode.SCAN_FRONT, RequestedAction.SHOW_ID_FRONT, progress 0).
|
|
8
|
+
import { GuidanceCode, InstructionCode, RequestedAction, initialFlowState, } from '@idmission/websdk-core/idCapture';
|
|
9
|
+
export function buildControllerState(overrides = {}) {
|
|
10
|
+
return {
|
|
11
|
+
...initialFlowState,
|
|
12
|
+
phase: 'initializing',
|
|
13
|
+
guidance: {
|
|
14
|
+
code: GuidanceCode.NONE,
|
|
15
|
+
satisfied: false,
|
|
16
|
+
detectedDocumentType: 'none',
|
|
17
|
+
},
|
|
18
|
+
rawGuidance: {
|
|
19
|
+
code: GuidanceCode.NONE,
|
|
20
|
+
satisfied: false,
|
|
21
|
+
detectedDocumentType: 'none',
|
|
22
|
+
},
|
|
23
|
+
instruction: InstructionCode.SCAN_FRONT,
|
|
24
|
+
requestedAction: RequestedAction.SHOW_ID_FRONT,
|
|
25
|
+
progress: 0,
|
|
26
|
+
error: null,
|
|
27
|
+
submission: 'idle',
|
|
28
|
+
models: { ready: false, loadState: 'not-started', downloadProgress: 0 },
|
|
29
|
+
camera: { ready: false, isRearFacing: false, accessRequested: false },
|
|
30
|
+
recaptureGrowthSatisfied: false,
|
|
31
|
+
barcodeDecodeSummary: null,
|
|
32
|
+
...overrides,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type VideoIdCaptureControllerState } from '@idmission/websdk-core/videoIdCapture';
|
|
2
|
+
export declare function buildVideoIdControllerState(overrides?: Partial<VideoIdCaptureControllerState>): VideoIdCaptureControllerState;
|
|
3
|
+
//# sourceMappingURL=buildVideoIdState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildVideoIdState.d.ts","sourceRoot":"","sources":["../../src/testing/buildVideoIdState.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,6BAA6B,EACnC,MAAM,uCAAuC,CAAA;AAE9C,wBAAgB,2BAA2B,CACzC,SAAS,GAAE,OAAO,CAAC,6BAA6B,CAAM,GACrD,6BAA6B,CAW/B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createInitialVideoIdCaptureState, } from '@idmission/websdk-core/videoIdCapture';
|
|
2
|
+
export function buildVideoIdControllerState(overrides = {}) {
|
|
3
|
+
const base = createInitialVideoIdCaptureState(overrides.documentType ?? 'idCard');
|
|
4
|
+
return {
|
|
5
|
+
...base,
|
|
6
|
+
...overrides,
|
|
7
|
+
camera: { ...base.camera, ...overrides.camera },
|
|
8
|
+
models: { ...base.models, ...overrides.models },
|
|
9
|
+
recording: { ...base.recording, ...overrides.recording },
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type ClassNamesBag = {
|
|
2
|
+
[key: string]: string | ClassNamesBag;
|
|
3
|
+
};
|
|
4
|
+
export declare function knownBag(typeName: string): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Expands `typeName` into a nested bag of unique sentinel class names, plus the
|
|
7
|
+
* flat path -> sentinel map. `prefix` keeps sentinels unique per call site so
|
|
8
|
+
* two views under test cannot satisfy each other's assertions.
|
|
9
|
+
*/
|
|
10
|
+
export declare function sentinelBag(typeName: string, prefix: string, path?: string, seen?: ReadonlySet<string>): {
|
|
11
|
+
bag: ClassNamesBag;
|
|
12
|
+
sentinels: Map<string, string>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=classNamesLeaves.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classNamesLeaves.d.ts","sourceRoot":"","sources":["../../src/testing/classNamesLeaves.ts"],"names":[],"mappings":"AAsCA,MAAM,MAAM,aAAa,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,CAAA;CAAE,CAAA;AA8ErE,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,SAAK,EACT,IAAI,GAAE,WAAW,CAAC,MAAM,CAAa,GACpC;IAAE,GAAG,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAOxD"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// Test-only: expands a `*ClassNames` type into every leaf it declares, so the
|
|
2
|
+
// parity suite can prove each leaf actually reaches the DOM.
|
|
3
|
+
//
|
|
4
|
+
// Why derive from the SOURCE rather than hand-write the leaf list: a
|
|
5
|
+
// hand-written list only covers the leaves someone remembered, and the
|
|
6
|
+
// customer-reported 2.4.73 regressions were exactly the leaves nobody
|
|
7
|
+
// remembered (a bag routed into a prop no component read — no type error, no
|
|
8
|
+
// failing test). Deriving means a newly declared leaf is covered the moment it
|
|
9
|
+
// is declared, and a leaf that stops rendering fails the suite.
|
|
10
|
+
//
|
|
11
|
+
// This uses the TypeScript compiler API rather than a regex, for the same
|
|
12
|
+
// reason `websdk-compat/scripts/classNameSnapshot.mjs` does: a bag is not
|
|
13
|
+
// always a type literal. `IdCaptureGuidesClassNames` is an INTERSECTION of
|
|
14
|
+
// three bags, and a literal-only read contributes ZERO leaves for it — the
|
|
15
|
+
// same "declared but invisible" failure this harness exists to catch. A
|
|
16
|
+
// looser regex over-corrects and leaks keys between bags, which is worse: it
|
|
17
|
+
// invents leaves that were never declared.
|
|
18
|
+
import { readFileSync, readdirSync, statSync } from 'node:fs';
|
|
19
|
+
import { createRequire } from 'node:module';
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
import { fileURLToPath } from 'node:url';
|
|
22
|
+
const require = createRequire(import.meta.url);
|
|
23
|
+
const ts = require('typescript');
|
|
24
|
+
// fileURLToPath, not `.pathname`: the latter leaves %20 (and any non-ASCII
|
|
25
|
+
// path segment) percent-encoded, which no fs call will find.
|
|
26
|
+
const SRC_ROOT = fileURLToPath(new URL('..', import.meta.url));
|
|
27
|
+
function sourceFiles(dir) {
|
|
28
|
+
return readdirSync(dir).flatMap((entry) => {
|
|
29
|
+
const path = join(dir, entry);
|
|
30
|
+
if (statSync(path).isDirectory())
|
|
31
|
+
return sourceFiles(path);
|
|
32
|
+
return /\.tsx?$/.test(path) && !/\.test\.tsx?$/.test(path) ? [path] : [];
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/** Every `export type *ClassNames = ...` in the package, by name. */
|
|
36
|
+
const aliases = (() => {
|
|
37
|
+
const found = new Map();
|
|
38
|
+
for (const path of sourceFiles(SRC_ROOT)) {
|
|
39
|
+
const sourceFile = ts.createSourceFile(path, readFileSync(path, 'utf8'), ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX);
|
|
40
|
+
for (const statement of sourceFile.statements) {
|
|
41
|
+
if (ts.isTypeAliasDeclaration(statement) &&
|
|
42
|
+
statement.name.text.endsWith('ClassNames')) {
|
|
43
|
+
found.set(statement.name.text, { typeNode: statement.type, sourceFile });
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return found;
|
|
48
|
+
})();
|
|
49
|
+
/** The property members a type node contributes, following intersections. */
|
|
50
|
+
function membersOf(typeNode, sourceFile, seen) {
|
|
51
|
+
if (ts.isTypeLiteralNode(typeNode)) {
|
|
52
|
+
return typeNode.members.map((member) => ({ member, sourceFile }));
|
|
53
|
+
}
|
|
54
|
+
if (ts.isIntersectionTypeNode(typeNode)) {
|
|
55
|
+
return typeNode.types.flatMap((part) => membersOf(part, sourceFile, seen));
|
|
56
|
+
}
|
|
57
|
+
if (ts.isTypeReferenceNode(typeNode)) {
|
|
58
|
+
const name = typeNode.typeName.getText(sourceFile);
|
|
59
|
+
const alias = aliases.get(name);
|
|
60
|
+
if (!alias || seen.has(name))
|
|
61
|
+
return [];
|
|
62
|
+
return membersOf(alias.typeNode, alias.sourceFile, new Set([...seen, name]));
|
|
63
|
+
}
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A type node reduced to `'string'` or an alias NAME, unwrapping unions.
|
|
68
|
+
* A raw `getText()` comparison drops `foo?: string | undefined` silently —
|
|
69
|
+
* the failure mode this harness exists to catch, inside the harness.
|
|
70
|
+
*/
|
|
71
|
+
function isNullish(typeNode) {
|
|
72
|
+
// `null` in a type position is a LiteralType wrapping a NullKeyword,
|
|
73
|
+
// NOT a bare NullKeyword — comparing `part.kind` against NullKeyword
|
|
74
|
+
// never matches, so `string | null` would look like a two-member union
|
|
75
|
+
// and drop the leaf silently. `undefined` IS a bare keyword type.
|
|
76
|
+
return (typeNode.kind === ts.SyntaxKind.UndefinedKeyword ||
|
|
77
|
+
(ts.isLiteralTypeNode(typeNode) &&
|
|
78
|
+
typeNode.literal.kind === ts.SyntaxKind.NullKeyword));
|
|
79
|
+
}
|
|
80
|
+
function declaredTypeName(typeNode, sourceFile) {
|
|
81
|
+
if (ts.isUnionTypeNode(typeNode)) {
|
|
82
|
+
const meaningful = typeNode.types.filter((part) => !isNullish(part));
|
|
83
|
+
return meaningful.length === 1
|
|
84
|
+
? declaredTypeName(meaningful[0], sourceFile)
|
|
85
|
+
: '';
|
|
86
|
+
}
|
|
87
|
+
return typeNode.getText(sourceFile).trim();
|
|
88
|
+
}
|
|
89
|
+
export function knownBag(typeName) {
|
|
90
|
+
return aliases.has(typeName);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Expands `typeName` into a nested bag of unique sentinel class names, plus the
|
|
94
|
+
* flat path -> sentinel map. `prefix` keeps sentinels unique per call site so
|
|
95
|
+
* two views under test cannot satisfy each other's assertions.
|
|
96
|
+
*/
|
|
97
|
+
export function sentinelBag(typeName, prefix, path = '', seen = new Set()) {
|
|
98
|
+
const alias = aliases.get(typeName);
|
|
99
|
+
if (!alias)
|
|
100
|
+
throw new Error(`no ClassNames type named ${typeName}`);
|
|
101
|
+
return expand(alias.typeNode, alias.sourceFile, prefix, path, new Set([
|
|
102
|
+
...seen,
|
|
103
|
+
typeName,
|
|
104
|
+
]));
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The leaf walk itself, over a type NODE rather than an alias name, so an
|
|
108
|
+
* INLINE sub-bag expands too. `IdCaptureOrUploadScreenClassNames` declares
|
|
109
|
+
* `passportUploadScreen?: { ... }` inline; resolving only named aliases left
|
|
110
|
+
* every leaf under it outside the gate — invisible, which is the failure this
|
|
111
|
+
* harness exists to catch.
|
|
112
|
+
*/
|
|
113
|
+
function expand(typeNode, aliasSource, prefix, path, nextSeen) {
|
|
114
|
+
const bag = {};
|
|
115
|
+
const sentinels = new Map();
|
|
116
|
+
for (const { member, sourceFile } of membersOf(typeNode, aliasSource, nextSeen)) {
|
|
117
|
+
if (!ts.isPropertySignature(member) || !member.name || !member.type)
|
|
118
|
+
continue;
|
|
119
|
+
if (!ts.isIdentifier(member.name) && !ts.isStringLiteral(member.name)) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const key = member.name.text;
|
|
123
|
+
const keyPath = path ? `${path}.${key}` : key;
|
|
124
|
+
const declared = declaredTypeName(member.type, sourceFile);
|
|
125
|
+
if (declared === 'string') {
|
|
126
|
+
const sentinel = `${prefix}-${keyPath.replace(/\./g, '-')}`;
|
|
127
|
+
bag[key] = sentinel;
|
|
128
|
+
sentinels.set(keyPath, sentinel);
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const nested = ts.isTypeLiteralNode(member.type)
|
|
132
|
+
? expand(member.type, sourceFile, prefix, keyPath, nextSeen)
|
|
133
|
+
: aliases.has(declared) && !nextSeen.has(declared)
|
|
134
|
+
? sentinelBag(declared, prefix, keyPath, nextSeen)
|
|
135
|
+
: null;
|
|
136
|
+
if (!nested)
|
|
137
|
+
continue;
|
|
138
|
+
bag[key] = nested.bag;
|
|
139
|
+
for (const [nestedPath, sentinel] of nested.sentinels) {
|
|
140
|
+
sentinels.set(nestedPath, sentinel);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return { bag, sentinels };
|
|
144
|
+
}
|