@idmission/websdk-ui 0.2.0-rc.2 → 0.5.0
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 +168 -56
- package/dist/DocumentCaptureView.d.ts +44 -5
- package/dist/DocumentCaptureView.d.ts.map +1 -1
- package/dist/DocumentCaptureView.js +517 -30
- package/dist/FaceLivenessView.d.ts +3 -3
- package/dist/FaceLivenessView.d.ts.map +1 -1
- package/dist/FaceLivenessView.js +82 -40
- package/dist/IdCaptureView.d.ts +33 -20
- package/dist/IdCaptureView.d.ts.map +1 -1
- package/dist/IdCaptureView.js +196 -33
- package/dist/SelfieCaptureView.d.ts +19 -2
- package/dist/SelfieCaptureView.d.ts.map +1 -1
- package/dist/SelfieCaptureView.js +17 -5
- package/dist/SignatureCaptureView.d.ts +23 -2
- package/dist/SignatureCaptureView.d.ts.map +1 -1
- package/dist/SignatureCaptureView.js +138 -22
- package/dist/VideoIdCaptureView.d.ts +15 -3
- package/dist/VideoIdCaptureView.d.ts.map +1 -1
- package/dist/VideoIdCaptureView.js +35 -8
- package/dist/bindings/useDocumentCapture.d.ts.map +1 -1
- package/dist/bindings/useDocumentCapture.js +2 -1
- package/dist/bindings/useIdCapture.d.ts.map +1 -1
- package/dist/bindings/useIdCapture.js +2 -1
- package/dist/bindings/useSelfieCapture.d.ts.map +1 -1
- package/dist/bindings/useSelfieCapture.js +2 -1
- package/dist/bindings/useSignatureCapture.d.ts.map +1 -1
- package/dist/bindings/useSignatureCapture.js +2 -1
- package/dist/bindings/useVideoIdCapture.d.ts.map +1 -1
- package/dist/bindings/useVideoIdCapture.js +2 -1
- package/dist/components/CameraFeed.d.ts +11 -3
- package/dist/components/CameraFeed.d.ts.map +1 -1
- package/dist/components/CameraFeed.js +24 -4
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts +7 -1
- package/dist/components/barcode/BarcodeGuideOverlay.d.ts.map +1 -1
- package/dist/components/barcode/BarcodeGuideOverlay.js +2 -2
- package/dist/components/common/BrowserEdgeTint.d.ts +63 -0
- package/dist/components/common/BrowserEdgeTint.d.ts.map +1 -0
- package/dist/components/common/BrowserEdgeTint.js +111 -0
- package/dist/components/common/LoaderButton.d.ts +9 -0
- package/dist/components/common/LoaderButton.d.ts.map +1 -1
- package/dist/components/common/LoaderButton.js +44 -321
- package/dist/components/common/ScreenReaderStatus.d.ts +8 -0
- package/dist/components/common/ScreenReaderStatus.d.ts.map +1 -0
- package/dist/components/common/ScreenReaderStatus.js +18 -0
- package/dist/components/common/overlay.d.ts +6 -0
- package/dist/components/common/overlay.d.ts.map +1 -1
- package/dist/components/common/overlay.js +7 -1
- package/dist/components/debug/debug.d.ts +10 -4
- package/dist/components/debug/debug.d.ts.map +1 -1
- package/dist/components/debug/debug.js +5 -1
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts +29 -0
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureAutoCaptureDebugLayer.js +273 -0
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts +56 -0
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureAutoCaptureGuidance.js +128 -0
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts +31 -1
- package/dist/components/document/DocumentCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/document/DocumentCaptureGuideOverlay.js +121 -2
- package/dist/components/document/DocumentCaptureReviewScreen.d.ts +44 -0
- package/dist/components/document/DocumentCaptureReviewScreen.d.ts.map +1 -0
- package/dist/components/document/DocumentCaptureReviewScreen.js +40 -0
- package/dist/components/document/types.d.ts +25 -0
- package/dist/components/document/types.d.ts.map +1 -1
- package/dist/components/document/types.js +18 -1
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts +8 -1
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -1
- package/dist/components/error/useCameraAccessDeniedReport.d.ts +12 -0
- package/dist/components/error/useCameraAccessDeniedReport.d.ts.map +1 -0
- package/dist/components/error/useCameraAccessDeniedReport.js +31 -0
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts +4 -1
- package/dist/components/face_liveness/FaceLivenessFailure.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessFailure.js +4 -2
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts +4 -1
- package/dist/components/face_liveness/FaceLivenessSuccess.d.ts.map +1 -1
- package/dist/components/face_liveness/FaceLivenessSuccess.js +6 -2
- package/dist/components/guides/IdCaptureFitGuide.d.ts +2 -0
- package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureFitGuide.js +4 -1
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts +2 -0
- package/dist/components/guides/IdCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuideOverlay.js +3 -1
- package/dist/components/guides/IdCaptureGuides.d.ts +14 -0
- package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuides.js +23 -9
- package/dist/components/guides/IdCaptureGuidesCommon.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuidesCommon.js +12 -7
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts +9 -0
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.d.ts.map +1 -1
- package/dist/components/loading/IdCaptureLoadingOverlayDefault.js +26 -4
- package/dist/components/loading/RingIntroScreen.d.ts.map +1 -1
- package/dist/components/loading/RingIntroScreen.js +4 -34
- package/dist/components/review/ReviewScreen.d.ts +10 -1
- package/dist/components/review/ReviewScreen.d.ts.map +1 -1
- package/dist/components/review/ReviewScreen.js +8 -8
- package/dist/components/review/SignatureCaptureDiagnostics.d.ts +54 -0
- package/dist/components/review/SignatureCaptureDiagnostics.d.ts.map +1 -0
- package/dist/components/review/SignatureCaptureDiagnostics.js +144 -0
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts +9 -2
- package/dist/components/selfie/FaceCaptureGuideOverlay.d.ts.map +1 -1
- package/dist/components/selfie/FaceCaptureGuideOverlay.js +10 -4
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts +8 -1
- package/dist/components/selfie/SelfieCaptureAnimatedMask.d.ts.map +1 -1
- package/dist/components/selfie/SelfieCaptureAnimatedMask.js +55 -21
- package/dist/components/selfie/SelfieCaptureSurface.d.ts +19 -3
- package/dist/components/selfie/SelfieCaptureSurface.d.ts.map +1 -1
- package/dist/components/selfie/SelfieCaptureSurface.js +78 -14
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts +9 -0
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.d.ts.map +1 -1
- package/dist/components/selfie_loading/SelfieCaptureLoadingOverlayDefault.js +26 -4
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts +4 -1
- package/dist/components/videoId/VideoIdCaptureGuides.d.ts.map +1 -1
- package/dist/components/videoId/VideoIdCaptureGuides.js +2 -2
- package/dist/flows/AuthStateContext.d.ts.map +1 -1
- package/dist/flows/AuthStateContext.js +2 -1
- package/dist/flows/CaptureProgress.d.ts +14 -0
- package/dist/flows/CaptureProgress.d.ts.map +1 -0
- package/dist/flows/CaptureProgress.js +51 -0
- package/dist/flows/CompositeWizard.d.ts +5 -0
- package/dist/flows/CompositeWizard.d.ts.map +1 -1
- package/dist/flows/CompositeWizard.js +6 -1
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts +1 -1
- package/dist/flows/CustomerBiometricsEnrollmentFlow.d.ts.map +1 -1
- package/dist/flows/CustomerBiometricsEnrollmentFlow.js +6 -3
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts +1 -1
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.d.ts.map +1 -1
- package/dist/flows/CustomerIdAndBiometricsEnrollmentFlow.js +5 -2
- package/dist/flows/DocumentCaptureFlow.d.ts +2 -2
- package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -1
- package/dist/flows/DocumentCaptureFlow.js +6 -6
- package/dist/flows/FaceValidationFlow.d.ts +2 -2
- package/dist/flows/FaceValidationFlow.d.ts.map +1 -1
- package/dist/flows/FaceValidationFlow.js +2 -2
- package/dist/flows/FlowChassis.d.ts +3 -1
- package/dist/flows/FlowChassis.d.ts.map +1 -1
- package/dist/flows/FlowChassis.js +23 -4
- package/dist/flows/IdAndFaceValidationFlow.d.ts +1 -1
- package/dist/flows/IdAndFaceValidationFlow.d.ts.map +1 -1
- package/dist/flows/IdAndFaceValidationFlow.js +5 -2
- package/dist/flows/IdValidationFlow.d.ts +1 -1
- package/dist/flows/IdValidationFlow.d.ts.map +1 -1
- package/dist/flows/IdValidationFlow.js +18 -4
- package/dist/flows/SignatureKYCFlow.d.ts +18 -3
- package/dist/flows/SignatureKYCFlow.d.ts.map +1 -1
- package/dist/flows/SignatureKYCFlow.js +94 -11
- package/dist/flows/SubmissionProvider.d.ts.map +1 -1
- package/dist/flows/SubmissionProvider.js +10 -5
- package/dist/flows/VideoIdValidationFlow.d.ts +1 -1
- package/dist/flows/VideoIdValidationFlow.d.ts.map +1 -1
- package/dist/flows/VideoIdValidationFlow.js +6 -3
- package/dist/flows/additionalDocuments.d.ts.map +1 -1
- package/dist/flows/additionalDocuments.js +3 -6
- package/dist/flows/approval.d.ts +2 -0
- package/dist/flows/approval.d.ts.map +1 -0
- package/dist/flows/approval.js +1 -0
- package/dist/flows/artifacts.d.ts +1 -1
- package/dist/flows/artifacts.d.ts.map +1 -1
- package/dist/flows/artifacts.js +29 -9
- package/dist/flows/autoCaptureMountGuard.d.ts +22 -0
- package/dist/flows/autoCaptureMountGuard.d.ts.map +1 -0
- package/dist/flows/autoCaptureMountGuard.js +61 -0
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts +1 -1
- package/dist/flows/customerMatch/CustomerMatchFlow.d.ts.map +1 -1
- package/dist/flows/customerMatch/CustomerMatchFlow.js +5 -6
- package/dist/flows/ringScreens.d.ts +1 -3
- package/dist/flows/ringScreens.d.ts.map +1 -1
- package/dist/flows/ringScreens.js +19 -5
- package/dist/flows/types.d.ts +17 -3
- package/dist/flows/types.d.ts.map +1 -1
- package/dist/guidance/selfieStrings.d.ts +9 -1
- package/dist/guidance/selfieStrings.d.ts.map +1 -1
- package/dist/guidance/selfieStrings.js +67 -24
- package/dist/guidance/strings.d.ts +34 -1
- package/dist/guidance/strings.d.ts.map +1 -1
- package/dist/guidance/strings.js +39 -0
- package/dist/i18n/index.d.ts +28 -1177
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +58 -22
- package/dist/i18n/locales/threeOh.d.ts +4 -0
- package/dist/i18n/locales/threeOh.d.ts.map +1 -0
- package/dist/i18n/locales/threeOh.js +159 -0
- package/dist/index.d.ts +12 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/testing/autoCaptureFrames.d.ts +23 -0
- package/dist/testing/autoCaptureFrames.d.ts.map +1 -0
- package/dist/testing/autoCaptureFrames.js +193 -0
- package/dist/testing/buildSelfieState.d.ts.map +1 -1
- package/dist/testing/buildSelfieState.js +5 -0
- package/dist/testing/classNamesLeaves.js +1 -1
- package/dist/testing/fakeDocumentController.d.ts +7 -1
- package/dist/testing/fakeDocumentController.d.ts.map +1 -1
- package/dist/testing/fakeDocumentController.js +10 -2
- package/dist/testing/fakeSelfieController.d.ts.map +1 -1
- package/dist/testing/fakeSelfieController.js +7 -0
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +1 -0
- package/dist/theme/index.d.ts +10 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/useDocumentUpload.d.ts +63 -0
- package/dist/useDocumentUpload.d.ts.map +1 -0
- package/dist/useDocumentUpload.js +45 -0
- package/dist/useIdmissionClient.d.ts +29 -0
- package/dist/useIdmissionClient.d.ts.map +1 -0
- package/dist/useIdmissionClient.js +44 -0
- package/dist/utils/canvas.d.ts.map +1 -1
- package/dist/utils/canvas.js +41 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -4,19 +4,24 @@ React presentation layer for the modular IDmission Web SDK 2 implementation.
|
|
|
4
4
|
It sits on top of `@idmission/websdk-core`, the framework-agnostic engine, and
|
|
5
5
|
owns rendered UI, theming, i18n, React bindings, and complete validation flows.
|
|
6
6
|
|
|
7
|
+
Flows accept an optional `captureProgress` task handle from core. See [capture progress](../../docs/capture-progress.md) for lifecycle ownership, signed context, and local verification. The views report final committed prompt codes after display overrides.
|
|
8
|
+
|
|
7
9
|
## Install
|
|
8
10
|
|
|
9
11
|
```
|
|
10
12
|
pnpm add @idmission/websdk-core @idmission/websdk-ui
|
|
11
13
|
```
|
|
12
14
|
|
|
15
|
+
Migrating an existing `idmission-web-sdk` integration? Follow the
|
|
16
|
+
[compatibility-facade migration guide](https://github.com/idmission/websdk/blob/develop/packages/websdk-ui/MIGRATION_FROM_COMPAT.md).
|
|
17
|
+
|
|
13
18
|
### Peer dependencies
|
|
14
19
|
|
|
15
|
-
| Package
|
|
16
|
-
|
|
|
17
|
-
| `react`
|
|
18
|
-
| `react-dom`
|
|
19
|
-
| `styled-components` | `^6`
|
|
20
|
+
| Package | Version |
|
|
21
|
+
| ------------------- | -------------- |
|
|
22
|
+
| `react` | `^18 \|\| ^19` |
|
|
23
|
+
| `react-dom` | `^18 \|\| ^19` |
|
|
24
|
+
| `styled-components` | `^6` |
|
|
20
25
|
|
|
21
26
|
## Quickstart
|
|
22
27
|
|
|
@@ -40,6 +45,56 @@ liveness check.
|
|
|
40
45
|
No `useMemo`/`useCallback` is required, and none of this depends on the
|
|
41
46
|
React Compiler.
|
|
42
47
|
|
|
48
|
+
Create the stateful network client with `useIdmissionClient`. The hook may run
|
|
49
|
+
before an asynchronously loaded session is available; the current committed
|
|
50
|
+
session and callback implementations are read when the client needs them.
|
|
51
|
+
Inline options are safe and do not require consumer memoization:
|
|
52
|
+
|
|
53
|
+
```tsx
|
|
54
|
+
import { IdValidationFlow, useIdmissionClient } from "@idmission/websdk-ui";
|
|
55
|
+
|
|
56
|
+
function IdCaptureScreen({
|
|
57
|
+
sessionId,
|
|
58
|
+
onError,
|
|
59
|
+
}: {
|
|
60
|
+
sessionId?: string;
|
|
61
|
+
onError: (error: Error) => void;
|
|
62
|
+
}) {
|
|
63
|
+
const client = useIdmissionClient({
|
|
64
|
+
sessionId,
|
|
65
|
+
onRequestFailure: (error) => onError(error),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
if (!sessionId) return null;
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<IdValidationFlow
|
|
72
|
+
client={client}
|
|
73
|
+
submission={{ jobID: "job-1" }}
|
|
74
|
+
geolocationEnabled={false}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
One hook mount owns one client and its validated session state. `sessionId`
|
|
81
|
+
is live for session resolution and can be a string, `null`/`undefined` while
|
|
82
|
+
loading, or an async resolver. It is read when validation or retry needs a
|
|
83
|
+
session; changing it does not silently replace an already validated session.
|
|
84
|
+
A later session also does not automatically retry a validation that has
|
|
85
|
+
already failed; call `client.retrySession()` (the standard flow error screen
|
|
86
|
+
does this) when retrying. `authUrl`, `submissionUrl`, `documentServiceUrl`,
|
|
87
|
+
and `timeoutMs` are mount-only.
|
|
88
|
+
|
|
89
|
+
Callback presence is mount-only too, while callbacks supplied at mount call
|
|
90
|
+
their latest committed defined implementation. This distinction matters for
|
|
91
|
+
`onSubmit`: supplying it selects customer handoff instead of SDK posting, so
|
|
92
|
+
adding or removing it during a capture cannot silently switch submission
|
|
93
|
+
modes. If a later render omits a mounted callback, the most recent defined
|
|
94
|
+
implementation remains active; a callback absent at mount is ignored if it
|
|
95
|
+
appears later. Remount the component that owns the hook with a React `key` to
|
|
96
|
+
intentionally replace the client or change any mount-only option.
|
|
97
|
+
|
|
43
98
|
For enrolled-biometrics journeys, use `CustomerIdentificationFlow` (1:N face
|
|
44
99
|
match), `CustomerVerificationFlow` (1:1 against one `submission.enrollmentId`),
|
|
45
100
|
`CustomerBiometricsEnrollmentFlow`, or
|
|
@@ -54,40 +109,44 @@ The lower-level views remain available for custom assemblies:
|
|
|
54
109
|
`IdCaptureView` is the whole ID-capture screen: it drives the camera, guide
|
|
55
110
|
box, guidance messages, loading overlay, and review/error screens off a
|
|
56
111
|
single headless `IdCaptureController` from `@idmission/websdk-core`. The host
|
|
57
|
-
app owns creating the controller
|
|
58
|
-
it
|
|
59
|
-
no theme, so it composes into whatever theme
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
112
|
+
app owns creating the controller; `useIdmissionClient` owns the stateful
|
|
113
|
+
client/session behind it. The host also wraps the tree in `ThemeProvider` —
|
|
114
|
+
`IdCaptureView` itself renders no theme, so it composes into whatever theme
|
|
115
|
+
context the host already has. The package initializes its bundled translations
|
|
116
|
+
automatically in an SDK-owned i18n instance; `IdCaptureView`'s `lang` prop
|
|
117
|
+
selects the language from the first client or server render without requiring
|
|
118
|
+
application bootstrap code.
|
|
64
119
|
|
|
65
120
|
```tsx
|
|
66
|
-
import { useMemo } from
|
|
67
|
-
import {
|
|
68
|
-
import { createIdCaptureController } from
|
|
69
|
-
import {
|
|
70
|
-
|
|
71
|
-
|
|
121
|
+
import { useMemo } from "react";
|
|
122
|
+
import { SubmissionAction } from "@idmission/websdk-core/client";
|
|
123
|
+
import { createIdCaptureController } from "@idmission/websdk-core/idCapture";
|
|
124
|
+
import {
|
|
125
|
+
IdCaptureView,
|
|
126
|
+
ThemeProvider,
|
|
127
|
+
useIdmissionClient,
|
|
128
|
+
} from "@idmission/websdk-ui";
|
|
72
129
|
|
|
73
130
|
function IdCaptureScreen({ sessionId }: { sessionId: string }) {
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
131
|
+
const client = useIdmissionClient({ sessionId });
|
|
132
|
+
const controller = useMemo(
|
|
133
|
+
() =>
|
|
134
|
+
createIdCaptureController({
|
|
135
|
+
client,
|
|
136
|
+
submission: { action: SubmissionAction.VERIFY },
|
|
137
|
+
}),
|
|
138
|
+
[client],
|
|
139
|
+
);
|
|
81
140
|
|
|
82
141
|
return (
|
|
83
142
|
<ThemeProvider theme="default">
|
|
84
143
|
<IdCaptureView
|
|
85
144
|
controller={controller}
|
|
86
|
-
onExit={() => console.log(
|
|
145
|
+
onExit={() => console.log("user exited capture")}
|
|
87
146
|
onSubmitted={(response) => console.log(response.status.statusCode)}
|
|
88
147
|
/>
|
|
89
148
|
</ThemeProvider>
|
|
90
|
-
)
|
|
149
|
+
);
|
|
91
150
|
}
|
|
92
151
|
```
|
|
93
152
|
|
|
@@ -108,27 +167,32 @@ passing the `IdmissionClient`'s own `checkLiveness` into the controller's
|
|
|
108
167
|
step:
|
|
109
168
|
|
|
110
169
|
```tsx
|
|
111
|
-
import { useMemo } from
|
|
112
|
-
import {
|
|
113
|
-
import {
|
|
114
|
-
|
|
170
|
+
import { useMemo } from "react";
|
|
171
|
+
import { createSelfieCaptureController } from "@idmission/websdk-core/selfieCapture";
|
|
172
|
+
import {
|
|
173
|
+
FaceLivenessView,
|
|
174
|
+
ThemeProvider,
|
|
175
|
+
useIdmissionClient,
|
|
176
|
+
} from "@idmission/websdk-ui";
|
|
115
177
|
|
|
116
178
|
function FaceLivenessScreen({ sessionId }: { sessionId: string }) {
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
179
|
+
const client = useIdmissionClient({ sessionId });
|
|
180
|
+
const controller = useMemo(
|
|
181
|
+
() =>
|
|
182
|
+
createSelfieCaptureController({
|
|
183
|
+
liveness: { checkLiveness: (img) => client.checkLiveness(img) },
|
|
184
|
+
}),
|
|
185
|
+
[client],
|
|
186
|
+
);
|
|
123
187
|
|
|
124
188
|
return (
|
|
125
189
|
<ThemeProvider theme="default">
|
|
126
190
|
<FaceLivenessView
|
|
127
191
|
controller={controller}
|
|
128
|
-
onDone={(imageUrl) => console.log(
|
|
192
|
+
onDone={(imageUrl) => console.log("liveness-checked selfie", imageUrl)}
|
|
129
193
|
/>
|
|
130
194
|
</ThemeProvider>
|
|
131
|
-
)
|
|
195
|
+
);
|
|
132
196
|
}
|
|
133
197
|
```
|
|
134
198
|
|
|
@@ -145,18 +209,42 @@ explanatory page with an "Enable camera & start" button) before the camera
|
|
|
145
209
|
permission prompt fires, instead of requesting the camera immediately on
|
|
146
210
|
`attach()` — the same pairing `IdCaptureView`'s ring overlay uses.
|
|
147
211
|
|
|
212
|
+
`SignatureKYCFlow` defaults its shared front camera to a 1280×720 maximum
|
|
213
|
+
(720×1280 on portrait streams). Set `allowHigherCameraResolutions={true}` to
|
|
214
|
+
use normal camera resolution selection instead. Explicit limits in
|
|
215
|
+
`faceCapture.camera` or `signatureCapture.camera` still apply to the acquisition
|
|
216
|
+
that opens the shared stream. This prop is read once at mount; remount to change
|
|
217
|
+
it. Higher resolutions can reduce signing responsiveness on slower devices.
|
|
218
|
+
|
|
148
219
|
## Exports
|
|
149
220
|
|
|
150
|
-
| Import
|
|
151
|
-
|
|
|
152
|
-
| `@idmission/websdk-ui`
|
|
153
|
-
| `@idmission/websdk-ui/testing` | Scriptable fake ID/selfie controllers and `createFakeIdmissionClient` for tests and Storybook stories
|
|
221
|
+
| Import | Contents |
|
|
222
|
+
| ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
223
|
+
| `@idmission/websdk-ui` | `useIdmissionClient`, validation flows and chassis, capture views, React bindings, theme, i18n, overlays, and the curated components used to assemble them |
|
|
224
|
+
| `@idmission/websdk-ui/testing` | Scriptable fake ID/selfie controllers and `createFakeIdmissionClient` for tests and Storybook stories |
|
|
154
225
|
|
|
155
226
|
`@idmission/websdk-ui`'s root export is a curated, named surface — never a
|
|
156
227
|
blanket `export *` — mirroring `@idmission/websdk-core/idCapture`'s barrel
|
|
157
228
|
policy. Internal helpers (e.g. the `useSyncExternalStore` listener-exception
|
|
158
229
|
guard) are deliberately not exported.
|
|
159
230
|
|
|
231
|
+
### Styling individual guidance messages
|
|
232
|
+
|
|
233
|
+
Every guidance message renders with a `data-guidance-code` attribute naming
|
|
234
|
+
which message it is, so a host can style one specific message from its own
|
|
235
|
+
stylesheet without the SDK shipping a severity opinion. "Guidance message"
|
|
236
|
+
means anything driven by one of the five guidance code enums, across every
|
|
237
|
+
layout that renders one — screen-level copy such as the upload-fallback step
|
|
238
|
+
instructions is not part of that vocabulary. The vocabulary is
|
|
239
|
+
append-only and enforced by `websdk-core`'s `guidanceCodeContract.test.ts` —
|
|
240
|
+
customer selectors are not type-checked against us, so renaming a code fails
|
|
241
|
+
silently in their production rather than in our build.
|
|
242
|
+
|
|
243
|
+
The customer-facing reference (every code for every flow, plus the CSS
|
|
244
|
+
specificity pattern that makes host rules win over the pill's
|
|
245
|
+
styled-components class) lives at
|
|
246
|
+
[apps/docs/content/other/styling-guidance-messages.mdx](../../apps/docs/content/other/styling-guidance-messages.mdx).
|
|
247
|
+
|
|
160
248
|
### Component surface (à la carte custom UI)
|
|
161
249
|
|
|
162
250
|
Everything `IdCaptureView` composes is independently exported, so a host that
|
|
@@ -165,25 +253,49 @@ in between, a completely custom review step — can skip `IdCaptureView` and
|
|
|
165
253
|
build its own tree from the same pieces, driven by the same
|
|
166
254
|
`useIdCapture(controller)` state:
|
|
167
255
|
|
|
168
|
-
| Area
|
|
169
|
-
|
|
|
170
|
-
| Flows
|
|
171
|
-
| Flow steps
|
|
172
|
-
| Match outcomes
|
|
173
|
-
| Camera
|
|
174
|
-
| Guides
|
|
175
|
-
| Guidance
|
|
176
|
-
| Barcode
|
|
177
|
-
| Loading
|
|
178
|
-
| Review / error
|
|
179
|
-
| Other
|
|
180
|
-
| Shared overlay primitives | `GrayOverlayContainer`, `OverlayInner`, `ButtonsColumn`, `WideButton`, `WideBorderButton` — the styled building blocks `ReviewScreen`/`ErrorScreen` compose
|
|
256
|
+
| Area | Components |
|
|
257
|
+
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
258
|
+
| Flows | `IdValidationFlow`, `FaceValidationFlow`, `IdAndFaceValidationFlow`, `SignatureKYCFlow`, `VideoIdValidationFlow`, `CustomerIdentificationFlow`, `CustomerVerificationFlow`, `CustomerBiometricsEnrollmentFlow`, `CustomerIdAndBiometricsEnrollmentFlow`, `FlowChassis`, `CompositeWizard` |
|
|
259
|
+
| Flow steps | `buildAdditionalDocumentsStep`, `buildSignatureStep`, `buildVideoIdSteps` — assemble a custom `CompositeWizard` step list |
|
|
260
|
+
| Match outcomes | `CustomerMatchSuccess`, `CustomerMatchFailure` |
|
|
261
|
+
| Camera | `CameraVideoTag`, `ScalingCameraFeed`, `CameraFeedWrapper`, `GuideLayoutProvider`/`useGuideLayout`, `GuideOrientationContextProvider`/`useGuideOrientationContext` |
|
|
262
|
+
| Guides | `IdCaptureGuides` (fit/overlay router), `IdCaptureFitGuide`, `IdCaptureGuideOverlay`, `FlipIdPrompt`, `defaultIdCaptureGuideImages` |
|
|
263
|
+
| Guidance | `GuidanceMessage`, `GuidanceMessageContainer` (portal), `guidanceMessageKey`/`instructionKey` |
|
|
264
|
+
| Barcode | `BarcodeGuideOverlay`, `BarcodeSuccessOverlay` |
|
|
265
|
+
| Loading | `IdCaptureLoadingOverlay`, `IdCaptureLoadingGraphic` |
|
|
266
|
+
| Review / error | `ReviewScreen`, `ErrorScreen`, `CameraAccessDeniedOverlay`, `OverrideWrongDocumentTypeDialog` |
|
|
267
|
+
| Other | `ExitCaptureButton`, `Card`/`FlexCard`, `ButtonsRow`, `LoaderButton`, `CapturedDocumentImg`, `LoadingListItemIndicator` |
|
|
268
|
+
| Shared overlay primitives | `GrayOverlayContainer`, `OverlayInner`, `ButtonsColumn`, `WideButton`, `WideBorderButton` — the styled building blocks `ReviewScreen`/`ErrorScreen` compose |
|
|
181
269
|
|
|
182
270
|
Every component takes plain props derived from `IdCaptureControllerState` (no
|
|
183
271
|
store/context reads beyond the layout contexts above) — pass
|
|
184
272
|
`controller.getState()` fields (or a `useIdCapture(controller)` /
|
|
185
273
|
`useIdCaptureSelector(controller, selector)` selection) straight through.
|
|
186
274
|
|
|
275
|
+
## Barcode controls
|
|
276
|
+
|
|
277
|
+
ID capture defaults to capturing barcode crops and showing them on its success
|
|
278
|
+
screen. To disable barcode crop analysis, model loading, decoding, recapture,
|
|
279
|
+
and the crop's upload, set `capture.enableBarcodeCapture: false` on
|
|
280
|
+
`IdValidationFlow` (or `idCapture.enableBarcodeCapture` on combined ID flows).
|
|
281
|
+
The ID front and back images are still captured. Precaptured barcode images
|
|
282
|
+
are ignored when barcode capture is disabled.
|
|
283
|
+
|
|
284
|
+
To keep barcode capture and submission but hide the crop on the ID capture
|
|
285
|
+
success screen, set `view.showBarcodeImage: false` (or `idView.showBarcodeImage`
|
|
286
|
+
on combined ID flows). The display option also hides barcode comparison images
|
|
287
|
+
in debug mode. It does not hide barcode data from the terminal submission
|
|
288
|
+
success diagnostics.
|
|
289
|
+
|
|
290
|
+
The `idmission-web-sdk` façade exposes both options as top-level props:
|
|
291
|
+
|
|
292
|
+
```tsx
|
|
293
|
+
<IdValidation sessionId={sessionId} enableBarcodeCapture={false} />
|
|
294
|
+
|
|
295
|
+
// Display only: the crop is still captured and submitted.
|
|
296
|
+
<IdValidation sessionId={sessionId} showBarcodeImage={false} />
|
|
297
|
+
```
|
|
298
|
+
|
|
187
299
|
## Test harness
|
|
188
300
|
|
|
189
301
|
Tests run under `node:test`, not a browser test runner. Because the
|
|
@@ -3,6 +3,7 @@ import type { DocumentCaptureController } from '@idmission/websdk-core/documentC
|
|
|
3
3
|
import { type CameraFeedMode } from './components/CameraFeed';
|
|
4
4
|
import { type DocumentCaptureGuideOverlayClassNames } from './components/document/DocumentCaptureGuideOverlay';
|
|
5
5
|
import type { DocumentCapturePrompt } from './components/document/types';
|
|
6
|
+
import type { CameraAccessDeniedReason } from './components/error/CameraAccessDeniedOverlay';
|
|
6
7
|
import { type CustomerSuppliedVerbiage, type LangOption } from './i18n';
|
|
7
8
|
export type DocumentCaptureViewClassNames = {
|
|
8
9
|
cameraFeedWrapper?: string;
|
|
@@ -21,6 +22,11 @@ export type DocumentCaptureViewClassNames = {
|
|
|
21
22
|
uploadBtn?: string;
|
|
22
23
|
uploadProgressBtn?: string;
|
|
23
24
|
captureBtn?: string;
|
|
25
|
+
autoCaptureGuidance?: string;
|
|
26
|
+
manualCaptureHint?: string;
|
|
27
|
+
reviewContainer?: string;
|
|
28
|
+
reviewCard?: string;
|
|
29
|
+
reviewHeading?: string;
|
|
24
30
|
};
|
|
25
31
|
export type DocumentCaptureViewVerbiage = {
|
|
26
32
|
headingText?: CustomerSuppliedVerbiage;
|
|
@@ -35,6 +41,15 @@ export type DocumentCaptureViewVerbiage = {
|
|
|
35
41
|
uploadingBtnText?: CustomerSuppliedVerbiage;
|
|
36
42
|
retryUploadBtnText?: CustomerSuppliedVerbiage;
|
|
37
43
|
successBtnText?: CustomerSuppliedVerbiage;
|
|
44
|
+
autoCaptureNoDocumentText?: CustomerSuppliedVerbiage;
|
|
45
|
+
autoCaptureTooCloseText?: CustomerSuppliedVerbiage;
|
|
46
|
+
autoCaptureTooFarText?: CustomerSuppliedVerbiage;
|
|
47
|
+
autoCaptureNotStableText?: CustomerSuppliedVerbiage;
|
|
48
|
+
autoCaptureOutOfFocusText?: CustomerSuppliedVerbiage;
|
|
49
|
+
autoCaptureHoldStillText?: CustomerSuppliedVerbiage;
|
|
50
|
+
manualCaptureHintText?: CustomerSuppliedVerbiage;
|
|
51
|
+
reviewHeadingText?: CustomerSuppliedVerbiage;
|
|
52
|
+
reviewImageAltText?: CustomerSuppliedVerbiage;
|
|
38
53
|
};
|
|
39
54
|
export type DocumentCaptureViewProps = {
|
|
40
55
|
controller: DocumentCaptureController;
|
|
@@ -50,12 +65,13 @@ export type DocumentCaptureViewProps = {
|
|
|
50
65
|
/** Fired once, when every document has uploaded successfully. */
|
|
51
66
|
onCompleted?: () => void;
|
|
52
67
|
/**
|
|
53
|
-
* Fires once when the
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
68
|
+
* Fires once when the camera cannot be used — sdk2's
|
|
69
|
+
* `onCameraAccessDenied`. `reason` tells a refused permission from a camera
|
|
70
|
+
* that could not be started. A pure notification: the view renders its
|
|
71
|
+
* camera error UI either way. Fires again only if the camera later works
|
|
72
|
+
* and then fails again, or fails for the other reason.
|
|
57
73
|
*/
|
|
58
|
-
onCameraAccessDenied?: () => void;
|
|
74
|
+
onCameraAccessDenied?: (reason: CameraAccessDeniedReason) => void;
|
|
59
75
|
/** sdk2's `onCameraTamperingDetected`, which its DocumentCapture wired
|
|
60
76
|
* through `CameraStoreProvider` (DocumentCapture.tsx:193). Fires once per
|
|
61
77
|
* detection. */
|
|
@@ -75,6 +91,20 @@ export type DocumentCaptureViewProps = {
|
|
|
75
91
|
aspectRatio?: number;
|
|
76
92
|
/** Fallback instructions when the current document has none. */
|
|
77
93
|
instructions?: ReactNode;
|
|
94
|
+
/**
|
|
95
|
+
* Renders the auto-capture tuning overlay: per-label detection boxes plus a
|
|
96
|
+
* stats pane carrying every gate's value, threshold and verdict, and the
|
|
97
|
+
* ~300-frame diagnostics ring buffer behind a COPY button (#341).
|
|
98
|
+
*
|
|
99
|
+
* Deliberately the SAME prop 2.x already exposes rather than a new one — the
|
|
100
|
+
* sheets and the applicants are in Mexico, so the instrument has to be
|
|
101
|
+
* reachable from a published build by the people holding the paper.
|
|
102
|
+
*
|
|
103
|
+
* Renders nothing until a document opts into `autoCapture`: with no engine
|
|
104
|
+
* there are no diagnostics, and an empty pane would read as a broken model
|
|
105
|
+
* rather than a flow that never asked for one.
|
|
106
|
+
*/
|
|
107
|
+
debugMode?: boolean;
|
|
78
108
|
classNames?: DocumentCaptureViewClassNames;
|
|
79
109
|
verbiage?: DocumentCaptureViewVerbiage;
|
|
80
110
|
};
|
|
@@ -93,6 +123,15 @@ export declare const DOCUMENT_CAPTURE_FALLBACK_VERBIAGE: {
|
|
|
93
123
|
uploadingBtnText: string;
|
|
94
124
|
retryUploadBtnText: string;
|
|
95
125
|
successBtnText: string;
|
|
126
|
+
autoCaptureNoDocumentText: string;
|
|
127
|
+
autoCaptureTooCloseText: string;
|
|
128
|
+
autoCaptureTooFarText: string;
|
|
129
|
+
autoCaptureNotStableText: string;
|
|
130
|
+
autoCaptureOutOfFocusText: string;
|
|
131
|
+
autoCaptureHoldStillText: string;
|
|
132
|
+
manualCaptureHintText: string;
|
|
133
|
+
reviewHeadingText: string;
|
|
134
|
+
reviewImageAltText: string;
|
|
96
135
|
};
|
|
97
136
|
/**
|
|
98
137
|
* Owns its own `GuideLayoutProvider`, matching IdCaptureView (:364). The guide
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentCaptureView.d.ts","sourceRoot":"","sources":["../src/DocumentCaptureView.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAEvF,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"DocumentCaptureView.d.ts","sourceRoot":"","sources":["../src/DocumentCaptureView.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAEvF,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,yBAAyB,CAAA;AAchC,OAAO,EAEL,KAAK,qCAAqC,EAC3C,MAAM,mDAAmD,CAAA;AAC1D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