@idmission/websdk-ui 0.1.0-rc.1 → 0.2.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/dist/DocumentCaptureView.d.ts +2 -2
- package/dist/DocumentCaptureView.d.ts.map +1 -1
- package/dist/IdCaptureView.d.ts +38 -1
- package/dist/IdCaptureView.d.ts.map +1 -1
- package/dist/IdCaptureView.js +12 -4
- package/dist/SignatureCaptureView.d.ts +9 -5
- package/dist/SignatureCaptureView.d.ts.map +1 -1
- package/dist/SignatureCaptureView.js +70 -39
- package/dist/components/GuidanceMessage.d.ts +25 -1
- package/dist/components/GuidanceMessage.d.ts.map +1 -1
- package/dist/components/GuidanceMessage.js +37 -0
- package/dist/components/additional_documents/types.d.ts +2 -10
- package/dist/components/additional_documents/types.d.ts.map +1 -1
- package/dist/components/document/types.d.ts +6 -15
- package/dist/components/document/types.d.ts.map +1 -1
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts +12 -1
- package/dist/components/error/CameraAccessDeniedOverlay.d.ts.map +1 -1
- package/dist/components/error/CameraAccessDeniedOverlay.js +15 -2
- package/dist/components/error/ErrorScreen.d.ts.map +1 -1
- package/dist/components/error/ErrorScreen.js +72 -57
- package/dist/components/guides/IdCaptureFitGuide.d.ts +13 -1
- package/dist/components/guides/IdCaptureFitGuide.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureFitGuide.js +27 -11
- package/dist/components/guides/IdCaptureGuides.d.ts +8 -1
- package/dist/components/guides/IdCaptureGuides.d.ts.map +1 -1
- package/dist/components/guides/IdCaptureGuides.js +2 -2
- package/dist/flows/DocumentCaptureFlow.d.ts +5 -5
- package/dist/flows/DocumentCaptureFlow.d.ts.map +1 -1
- package/dist/flows/DocumentCaptureFlow.js +29 -26
- package/dist/flows/SignatureKYCFlow.d.ts +19 -1
- package/dist/flows/SignatureKYCFlow.d.ts.map +1 -1
- package/dist/flows/SignatureKYCFlow.js +30 -0
- package/dist/flows/SubmissionProvider.d.ts +3 -9
- package/dist/flows/SubmissionProvider.d.ts.map +1 -1
- package/dist/flows/documentCapture.d.ts.map +1 -1
- package/dist/flows/documentCapture.js +1 -1
- package/dist/flows/types.d.ts +3 -3
- package/dist/flows/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/layout/GuideLayoutContext.d.ts +11 -0
- package/dist/layout/GuideLayoutContext.d.ts.map +1 -1
- package/dist/layout/GuideLayoutContext.js +24 -3
- package/dist/testing/buildDocumentState.d.ts +2 -2
- package/dist/testing/buildDocumentState.d.ts.map +1 -1
- package/dist/testing/fakeController.d.ts +1 -0
- package/dist/testing/fakeController.d.ts.map +1 -1
- package/dist/testing/fakeController.js +18 -1
- package/dist/testing/stubSignatureCanvas.d.ts.map +1 -1
- package/dist/testing/stubSignatureCanvas.js +3 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -8
- package/dist/utils/signaturePadStrokeGuard.d.ts +0 -16
- package/dist/utils/signaturePadStrokeGuard.d.ts.map +0 -1
- package/dist/utils/signaturePadStrokeGuard.js +0 -70
|
@@ -2,7 +2,7 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import type { DocumentCaptureController } from '@idmission/websdk-core/documentCapture';
|
|
3
3
|
import { type CameraFeedMode } from './components/CameraFeed';
|
|
4
4
|
import { type DocumentCaptureGuideOverlayClassNames } from './components/document/DocumentCaptureGuideOverlay';
|
|
5
|
-
import type {
|
|
5
|
+
import type { DocumentCapturePrompt } from './components/document/types';
|
|
6
6
|
import { type CustomerSuppliedVerbiage, type LangOption } from './i18n';
|
|
7
7
|
export type DocumentCaptureViewClassNames = {
|
|
8
8
|
cameraFeedWrapper?: string;
|
|
@@ -68,7 +68,7 @@ export type DocumentCaptureViewProps = {
|
|
|
68
68
|
* items. Supplies per-document `instructions` and `cameraFeedMode`, which are
|
|
69
69
|
* React/presentation concerns and therefore never reach core.
|
|
70
70
|
*/
|
|
71
|
-
documents?: readonly
|
|
71
|
+
documents?: readonly DocumentCapturePrompt[];
|
|
72
72
|
/** Fallback feed mode when the current document does not specify one. */
|
|
73
73
|
cameraFeedMode?: CameraFeedMode;
|
|
74
74
|
/** Fallback guide-box aspect ratio when the current document has none. */
|
|
@@ -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;AAGhC,OAAO,EAEL,KAAK,qCAAqC,EAC3C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,KAAK,EAAE,
|
|
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;AAGhC,OAAO,EAEL,KAAK,qCAAqC,EAC3C,MAAM,mDAAmD,CAAA;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAA;AAExE,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,UAAU,EAGhB,MAAM,QAAQ,CAAA;AAGf,MAAM,MAAM,6BAA6B,GAAG;IAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,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IACjC;;oBAEgB;IAChB,yBAAyB,CAAC,EAAE,MAAM,IAAI,CAAA;IACtC;gEAC4D;IAC5D,2BAA2B,CAAC,EAAE,MAAM,IAAI,CAAA;IACxC;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAA;IAC5C,yEAAyE;IACzE,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gEAAgE;IAChE,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,UAAU,CAAC,EAAE,6BAA6B,CAAA;IAC1C,QAAQ,CAAC,EAAE,2BAA2B,CAAA;CACvC,CAAA;AAED;oEACoE;AACpE,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;CAac,CAAA;AAE7D;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAMlE"}
|
package/dist/IdCaptureView.d.ts
CHANGED
|
@@ -104,6 +104,43 @@ export type IdCaptureViewProps = {
|
|
|
104
104
|
rotateLoadingOverlayImageWhenPortrait?: boolean;
|
|
105
105
|
/** Fit guides only: draw the guide box on the mask's own rect so the two always agree, and show the mask over a fullscreen feed. Defaults to false. */
|
|
106
106
|
guideBoxFollowsMask?: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Fit guides only. Corner radius of the guide box and of the hole cut in the
|
|
109
|
+
* dimming mask, in CSS pixels. Defaults to 33.
|
|
110
|
+
*
|
|
111
|
+
* A prop rather than a class name because neither shape is CSS: the mask hole
|
|
112
|
+
* is a canvas `roundRect` and the box is an SVG `rx`, so a stylesheet has
|
|
113
|
+
* nothing to apply `border-radius` to.
|
|
114
|
+
*/
|
|
115
|
+
guideBoxBorderRadius?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Fit guides only. Upper bounds on the guide box, in CSS pixels. Unset (the
|
|
118
|
+
* default), it grows to fill the viewport less the theme's guide-box padding,
|
|
119
|
+
* which on a desktop monitor is a card outline spanning most of the screen.
|
|
120
|
+
*
|
|
121
|
+
* Under `cameraFeedMode: 'snapToGuides'` the feed is clipped to this box, so
|
|
122
|
+
* capping it caps the feed too.
|
|
123
|
+
*/
|
|
124
|
+
guideBoxMaxWidth?: number;
|
|
125
|
+
guideBoxMaxHeight?: number;
|
|
126
|
+
/**
|
|
127
|
+
* Where the guidance pill sits. `'viewport'` (the default) pins it 12.5% up
|
|
128
|
+
* from the bottom of the screen, as every release so far has. `'guideBox'`
|
|
129
|
+
* anchors it `guidanceMessageGap` pixels below the guide box instead, so it
|
|
130
|
+
* tracks the box across viewport sizes and orientation changes rather than
|
|
131
|
+
* needing per-breakpoint CSS.
|
|
132
|
+
*
|
|
133
|
+
* `'guideBox'` needs a rect that IS the guide box, which means `guideType:
|
|
134
|
+
* 'fit'` together with `guideBoxFollowsMask`. Without the latter the box is
|
|
135
|
+
* the guide overlay's flex-derived one while the published rect is the mask
|
|
136
|
+
* hole, and the two differ by hundreds of pixels on a desktop viewport. Any
|
|
137
|
+
* other combination falls back to `'viewport'` rather than anchoring to a
|
|
138
|
+
* rectangle that was never drawn.
|
|
139
|
+
*/
|
|
140
|
+
guidanceMessagePlacement?: 'viewport' | 'guideBox';
|
|
141
|
+
/** Gap between the guide box and the guidance pill, in CSS pixels. Defaults
|
|
142
|
+
* to 8. Only applies when `guidanceMessagePlacement` is `'guideBox'`. */
|
|
143
|
+
guidanceMessageGap?: number;
|
|
107
144
|
/** Default false. True renders phase 'requestingFlip' as a ReviewScreen
|
|
108
145
|
* interstitial (sdk2's `separateIdCardCaptureSequence`) whose submit
|
|
109
146
|
* calls `actions.confirmFlip()` instead of showing the flip-prompt guide
|
|
@@ -267,5 +304,5 @@ export type IdCaptureViewProps = {
|
|
|
267
304
|
colors?: IdCaptureViewColors;
|
|
268
305
|
assets?: IdCaptureViewAssets;
|
|
269
306
|
};
|
|
270
|
-
export declare function IdCaptureView({ controller, guideType, loadingOverlayMode, cameraFeedMode, guideBoxDisabled, forceFallbackMode, silentFallback, allowUploadingDocumentsFromStorage, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, guideBoxFollowsMask, flipReview, sessionReady: sessionReadyProp, skipSuccessScreen, lang, autoContinueAfterLoading, showIntroScreen, debugMode, onExit, onUserCancel, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, customOverlayContent, instructions, onCameraTamperingDetected, onCameraAccessDenied, onModelError, onExitAfterTamperSealPopped, onDocumentStored, onRetry, onSubmitted, onCollected, verbiage, classNames, colors, assets, }: IdCaptureViewProps): ReactElement;
|
|
307
|
+
export declare function IdCaptureView({ controller, guideType, loadingOverlayMode, cameraFeedMode, guideBoxDisabled, forceFallbackMode, silentFallback, allowUploadingDocumentsFromStorage, portraitGuidesOnMobile, rotateLoadingOverlayImageWhenPortrait, guideBoxFollowsMask, guideBoxBorderRadius, guideBoxMaxWidth, guideBoxMaxHeight, guidanceMessagePlacement, guidanceMessageGap, flipReview, sessionReady: sessionReadyProp, skipSuccessScreen, lang, autoContinueAfterLoading, showIntroScreen, debugMode, onExit, onUserCancel, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, customOverlayContent, instructions, onCameraTamperingDetected, onCameraAccessDenied, onModelError, onExitAfterTamperSealPopped, onDocumentStored, onRetry, onSubmitted, onCollected, verbiage, classNames, colors, assets, }: IdCaptureViewProps): ReactElement;
|
|
271
308
|
//# sourceMappingURL=IdCaptureView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IdCaptureView.d.ts","sourceRoot":"","sources":["../src/IdCaptureView.tsx"],"names":[],"mappings":"AAmCA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAGd,OAAO,KAAK,EACV,oBAAoB,EAEpB,mBAAmB,EAEpB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAA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D;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAA;IACtD,QAAQ,CAAC,EAAE,qBAAqB,CAAA;IAChC,UAAU,CAAC,EAAE,uBAAuB,CAAA;IACpC,MAAM,CAAC,EAAE,mBAAmB,CAAA;IAC5B,MAAM,CAAC,EAAE,mBAAmB,CAAA;CAC7B,CAAA;AAED,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,SAAiB,EACjB,kBAA8B,EAC9B,cAA+B,EAC/B,gBAAwB,EACxB,iBAAyB,EACzB,cAAsB,EACtB,kCAA0C,EAC1C,sBAA6B,EAC7B,qCAA4C,EAC5C,mBAA2B,EAC3B,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAqC,EACrC,kBAAsB,EACtB,UAAkB,EAClB,YAAY,EAAE,gBAAgB,EAC9B,iBAAyB,EACzB,IAAa,EACb,wBAAgC,EAChC,eAAuB,EACvB,SAAiB,EACjB,MAAM,EACN,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,oBAAoB,EACpB,YAAY,EACZ,yBAAyB,EACzB,oBAAoB,EACpB,YAAY,EACZ,2BAA2B,EAC3B,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,WAAW,EACX,QAAa,EACb,UAAe,EACf,MAAW,EACX,MAAW,GACZ,EAAE,kBAAkB,GAAG,YAAY,CA0gBnC"}
|
package/dist/IdCaptureView.js
CHANGED
|
@@ -44,7 +44,7 @@ import GuideOrientationContextProvider from './layout/GuideOrientationContext';
|
|
|
44
44
|
import { ScalingCameraFeed } from './components/CameraFeed';
|
|
45
45
|
import { DebugBoundingBoxOverlay, DebugStatsPane, IdCaptureDetectedObjectDebugBox, useDebugScalingDetails, } from './components/debug/debug';
|
|
46
46
|
import { IdCaptureGuides, } from './components/guides/IdCaptureGuides';
|
|
47
|
-
import { GuidanceMessage,
|
|
47
|
+
import { PlacedGuidanceMessageContainer, GuidanceMessage, } from './components/GuidanceMessage';
|
|
48
48
|
import { guidanceMessageKey } from './guidance/strings';
|
|
49
49
|
import { ExitCaptureButton } from './components/ExitCaptureButton';
|
|
50
50
|
import { OverrideWrongDocumentTypeDialog, } from './components/OverrideWrongDocumentTypeDialog';
|
|
@@ -86,7 +86,7 @@ const REVIEW_PHASES = new Set([
|
|
|
86
86
|
'uploading',
|
|
87
87
|
'complete',
|
|
88
88
|
]);
|
|
89
|
-
export function IdCaptureView({ controller, guideType = 'fit', loadingOverlayMode = 'default', cameraFeedMode = 'snapToGuides', guideBoxDisabled = false, forceFallbackMode = false, silentFallback = false, allowUploadingDocumentsFromStorage = false, portraitGuidesOnMobile = true, rotateLoadingOverlayImageWhenPortrait = true, guideBoxFollowsMask = false, flipReview = false, sessionReady: sessionReadyProp, skipSuccessScreen = false, lang = 'auto', autoContinueAfterLoading = false, showIntroScreen = false, debugMode = false, onExit, onUserCancel, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, customOverlayContent, instructions, onCameraTamperingDetected, onCameraAccessDenied, onModelError, onExitAfterTamperSealPopped, onDocumentStored, onRetry, onSubmitted, onCollected, verbiage = {}, classNames = {}, colors = {}, assets = {}, }) {
|
|
89
|
+
export function IdCaptureView({ controller, guideType = 'fit', loadingOverlayMode = 'default', cameraFeedMode = 'snapToGuides', guideBoxDisabled = false, forceFallbackMode = false, silentFallback = false, allowUploadingDocumentsFromStorage = false, portraitGuidesOnMobile = true, rotateLoadingOverlayImageWhenPortrait = true, guideBoxFollowsMask = false, guideBoxBorderRadius, guideBoxMaxWidth, guideBoxMaxHeight, guidanceMessagePlacement = 'viewport', guidanceMessageGap = 8, flipReview = false, sessionReady: sessionReadyProp, skipSuccessScreen = false, lang = 'auto', autoContinueAfterLoading = false, showIntroScreen = false, debugMode = false, onExit, onUserCancel, onLoadingStarted, onLoadingProgress, onLoadingCompleted, onLoadingFailed, onLoadingOverlayDismissed, customOverlayContent, instructions, onCameraTamperingDetected, onCameraAccessDenied, onModelError, onExitAfterTamperSealPopped, onDocumentStored, onRetry, onSubmitted, onCollected, verbiage = {}, classNames = {}, colors = {}, assets = {}, }) {
|
|
90
90
|
// Omitted means "follow the session": mounted inside a flow this view now
|
|
91
91
|
// renders during session validation, so its own loading overlay is the one
|
|
92
92
|
// loading surface (2.x behaviour — see useSessionReady). An explicit prop
|
|
@@ -346,9 +346,17 @@ export function IdCaptureView({ controller, guideType = 'fit', loadingOverlayMod
|
|
|
346
346
|
// Notify BEFORE resetting, matching sdk2's onRetryClick
|
|
347
347
|
// (IdCaptureWizard.tsx:1124-1127): the host sees the retry against the state
|
|
348
348
|
// that prompted it, not against the freshly-cleared one.
|
|
349
|
+
//
|
|
350
|
+
// `.catch(() => {})` for the same reason the attach effect above does it:
|
|
351
|
+
// `retry()` runs `doAttach()`, whose catch writes the failure to the store
|
|
352
|
+
// AND rethrows (controller.ts, "one truth in both places"). The store write
|
|
353
|
+
// is what puts the user back on the error screen, so the rejection itself
|
|
354
|
+
// carries nothing new -- left unhandled it only escapes to the host page's
|
|
355
|
+
// `unhandledrejection`, once per Retry tap. A user who denies the camera
|
|
356
|
+
// and taps Retry is the common way to hit that.
|
|
349
357
|
const handleRetry = useCallback(() => {
|
|
350
358
|
onRetry?.();
|
|
351
|
-
void controller.actions.retry();
|
|
359
|
+
void controller.actions.retry().catch(() => { });
|
|
352
360
|
}, [controller, onRetry]);
|
|
353
361
|
const handleOverride = useCallback(() => {
|
|
354
362
|
controller.actions.overrideWrongDocumentType();
|
|
@@ -365,7 +373,7 @@ export function IdCaptureView({ controller, guideType = 'fit', loadingOverlayMod
|
|
|
365
373
|
return (_jsx(FontCarrier, { children: _jsx(GuideOrientationContextProvider, { children: _jsxs(GuideLayoutProvider, { children: [_jsx(ScalingCameraFeed, { videoRef: setVideoRef, phase: state.phase, isRearFacing: state.camera.isRearFacing, cameraFeedMode: cameraFeedMode, className: classNames.cameraFeed }), inFallbackMode && (_jsx(IdCaptureFallback, { captureRequirement: state.captureRequirement, idCardBackCaptureRequired: state.idCardBackCaptureRequired, silentFallback: silentFallback, onCapture: handleManualImages('Manual'), onFinished: () => setFallbackFinished(true), classNames: classNames.fallback, colors: colors.fallback, verbiage: verbiage.fallback })), showUploadChoice && (_jsx(IdCaptureOrUploadScreen, { captureRequirement: state.captureRequirement, idCardBackCaptureRequired: state.idCardBackCaptureRequired, onCaptureWithCamera: () => {
|
|
366
374
|
setUploadChoiceMade(true);
|
|
367
375
|
void controller.actions.requestCamera().catch(() => { });
|
|
368
|
-
}, onUpload: handleManualImages('Upload'), onFinished: () => setUploadChoiceMade(true), classNames: classNames.uploadOrCaptureScreen, colors: colors.uploadOrCaptureScreen, verbiage: verbiage.uploadOrCaptureScreen })), showGuides && (_jsx(IdCaptureGuides, { state: state, isRearFacing: state.camera.isRearFacing, guideType: guideType, guideBoxDisabled: guideBoxDisabled, portraitGuidesOnMobile: portraitGuidesOnMobile, guideBoxFollowsMask: guideBoxFollowsMask, cameraFeedMode: cameraFeedMode, images: assets.guideImages, classNames: classNames.guides, verbiage: verbiage.guides, status: !overlayDismissed ? 'disabled' : undefined })), showGuidancePill && (_jsx(
|
|
376
|
+
}, onUpload: handleManualImages('Upload'), onFinished: () => setUploadChoiceMade(true), classNames: classNames.uploadOrCaptureScreen, colors: colors.uploadOrCaptureScreen, verbiage: verbiage.uploadOrCaptureScreen })), showGuides && (_jsx(IdCaptureGuides, { state: state, isRearFacing: state.camera.isRearFacing, guideType: guideType, guideBoxDisabled: guideBoxDisabled, portraitGuidesOnMobile: portraitGuidesOnMobile, guideBoxFollowsMask: guideBoxFollowsMask, guideBoxBorderRadius: guideBoxBorderRadius, guideBoxMaxWidth: guideBoxMaxWidth, guideBoxMaxHeight: guideBoxMaxHeight, cameraFeedMode: cameraFeedMode, images: assets.guideImages, classNames: classNames.guides, verbiage: verbiage.guides, status: !overlayDismissed ? 'disabled' : undefined })), showGuidancePill && (_jsx(PlacedGuidanceMessageContainer, { placement: guidanceMessagePlacement, gap: guidanceMessageGap, className: classNames.guidanceMessageContainer, children: _jsx(GuidanceMessage, { "$variant": state.guidance.satisfied ? 'positive' : 'default', className: classNames.guidanceMessage, children: t(guidanceKey) }) })), state.phase !== 'complete' && _jsx("div", { id: "idmission-above-guides-content" }), debugMode && overlayDismissed && showGuides && (_jsx(IdCaptureDebugLayer, { state: state })), onExit != null && (_jsx(ExitCaptureButton, { onClick: onExit, className: classNames.exitBtn })), showLoadingOverlay && (_jsx(IdCaptureLoadingOverlay, { state: state, mode: loadingOverlayMode, sessionReady: sessionReady, autoContinueAfterLoading: autoContinueAfterLoading, showIntroScreen: showIntroScreen, assets: assets.loadingOverlay, classNames: classNames.loadingOverlay, colors: colors.loadingOverlay, verbiage: verbiage.loadingOverlay, rotateImage: rotateOverlayImage, onUserCancel: onUserCancel, onLoadingStarted: onLoadingStarted, onLoadingProgress: onLoadingProgress, onLoadingCompleted: onLoadingCompleted, onLoadingFailed: onLoadingFailed, onDismissed: handleLoadingOverlayDismissed, customOverlayContent: customOverlayContent, instructions: instructions, onRequestCamera: () => controller.actions.requestCamera() })), _jsx(OverrideWrongDocumentTypeDialog, { visible: state.allowOverrideWrongDocumentTypeGuidance, onOverride: handleOverride, classNames: classNames.overrideWrongDocumentType, verbiage: verbiage.overrideWrongDocumentType }), showReview && (_jsx(ReviewScreen, { capturedDocuments: state.capturedDocuments, submission: isFlipInterstitial ? 'idle' : state.submission, sessionReady: sessionReady, diagnostics: debugMode && !isFlipInterstitial
|
|
369
377
|
? {
|
|
370
378
|
initialBarcodeScore: state.recaptureBarcodeScore !== null
|
|
371
379
|
? state.initialBarcodeScore
|
|
@@ -124,11 +124,15 @@ export type SignatureCaptureViewProps = {
|
|
|
124
124
|
*/
|
|
125
125
|
onRestartRequested?: () => void;
|
|
126
126
|
/**
|
|
127
|
-
* Replaces the
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
127
|
+
* Replaces the interrupted-recording screen, for hosts with their own
|
|
128
|
+
* approved design. Rendered INSTEAD of the SDK's panel — including its
|
|
129
|
+
* container — because the approved ones are typically modals that portal to
|
|
130
|
+
* `document.body`, and an opaque full-bleed container behind them leaves the
|
|
131
|
+
* dialog floating over a blank screen instead of over the capture UI.
|
|
132
|
+
*
|
|
133
|
+
* The SDK still decides WHEN it appears and supplies the restart. Text-only
|
|
134
|
+
* changes do not need this: every string on the default screen already
|
|
135
|
+
* accepts a component through `verbiage`.
|
|
132
136
|
*/
|
|
133
137
|
recordingInterruptedComponent?: ComponentType<RecordingInterruptedScreenProps>;
|
|
134
138
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureCaptureView.d.ts","sourceRoot":"","sources":["../src/SignatureCaptureView.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,0BAA0B,
|
|
1
|
+
{"version":3,"file":"SignatureCaptureView.d.ts","sourceRoot":"","sources":["../src/SignatureCaptureView.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,KAAK,0BAA0B,EAEhC,MAAM,yCAAyC,CAAC;AAMjD,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,UAAU,EAChB,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,4BAA4B,GAAG;IACzC,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC,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EAAE,0BAA0B,GAC1D,EAAE,yBAAyB,2CA6iB3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState, } from "react";
|
|
3
|
-
import
|
|
3
|
+
import SignaturePad from "signature_pad";
|
|
4
4
|
import { styled } from "styled-components";
|
|
5
5
|
import { SignatureCaptureGuidanceCode, } from "@idmission/websdk-core/signatureCapture";
|
|
6
6
|
import { useSignatureCapture } from "./bindings/useSignatureCapture";
|
|
@@ -12,7 +12,6 @@ import { FaceCaptureGuideOverlay, } from "./components/selfie/FaceCaptureGuideOv
|
|
|
12
12
|
import { SelfieCaptureAnimatedMaskWithStatus } from "./components/selfie/SelfieCaptureAnimatedMask";
|
|
13
13
|
import { useLanguage, useTranslations, } from "./i18n";
|
|
14
14
|
import useResizeObserver from "./layout/useResizeObserver";
|
|
15
|
-
import { guardSignaturePadStrokes } from "./utils/signaturePadStrokeGuard";
|
|
16
15
|
import { useShowSuccessScreen, } from "./flows/useShowSuccessScreen";
|
|
17
16
|
import { MicrophoneAccessDeniedOverlay, } from "./flows/overlays";
|
|
18
17
|
const FALLBACKS = {
|
|
@@ -35,10 +34,21 @@ const FALLBACKS = {
|
|
|
35
34
|
signaturePadEmptyText: "",
|
|
36
35
|
headTrackingUnsatisfiedText: "",
|
|
37
36
|
};
|
|
38
|
-
const SignatureCanvas = SignatureCanvasImport.default ?? SignatureCanvasImport;
|
|
39
37
|
function updateVideoRef(ref, node) {
|
|
40
38
|
ref.current = node;
|
|
41
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Absorbs the rejection from a controller action.
|
|
42
|
+
*
|
|
43
|
+
* Every action dispatches its typed error into the store BEFORE rethrowing,
|
|
44
|
+
* and this view renders that error — so the rejection is a second copy of a
|
|
45
|
+
* failure already handled. `void` alone does not absorb it: the promise stays
|
|
46
|
+
* rejected with no handler, reaches `window.onunhandledrejection`, and reports
|
|
47
|
+
* as an uncaught crash. Sentry has been collecting these (AMEX-DOC-COLLECT-WE).
|
|
48
|
+
*/
|
|
49
|
+
function handledByState(action) {
|
|
50
|
+
void action.catch(() => { });
|
|
51
|
+
}
|
|
42
52
|
export function SignatureCaptureView({ controller, sessionReady = true, lang = "auto", autoStart = true, skipSuccessScreen = false, onExit, onCompleted, verbiage, classNames = {}, assets = {}, videoRef: providedVideoRef, onVideoElementChange, forceCameraFeed = false, headTrackingSatisfied = true, showFaceGuideThenSignaturePad = false, legacyVideoLayout = false, faceGuideStatus = "ready", onRestartRequested, recordingInterruptedComponent: RecordingInterruptedScreen, }) {
|
|
43
53
|
useLanguage(lang);
|
|
44
54
|
const text = useTranslations(verbiage, FALLBACKS);
|
|
@@ -64,10 +74,12 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
64
74
|
setVideoNode(node);
|
|
65
75
|
onVideoElementChange?.(node);
|
|
66
76
|
}, [onVideoElementChange, videoRef]);
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
77
|
+
const canvasRef = useRef(null);
|
|
78
|
+
const padRef = useRef(null);
|
|
79
|
+
const [canvasNode, setCanvasNode] = useState(null);
|
|
80
|
+
const setCanvasRef = useCallback((node) => {
|
|
81
|
+
canvasRef.current = node;
|
|
82
|
+
setCanvasNode(node);
|
|
71
83
|
}, []);
|
|
72
84
|
const { ref: signaturePanelRef, width: signaturePanelWidth, height: signaturePanelHeight, } = useResizeObserver();
|
|
73
85
|
const [canvasDimensions, setCanvasDimensions] = useState(null);
|
|
@@ -102,13 +114,39 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
102
114
|
height: signaturePanelHeight,
|
|
103
115
|
});
|
|
104
116
|
}, [signaturePanelHeight, signaturePanelWidth]);
|
|
117
|
+
// signature_pad is an EventTarget rather than an options-callback API, and it
|
|
118
|
+
// binds its pointer handlers in the constructor, so the pad's lifetime is tied
|
|
119
|
+
// to the canvas node it was built against.
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (!canvasNode)
|
|
122
|
+
return;
|
|
123
|
+
const pad = new SignaturePad(canvasNode);
|
|
124
|
+
padRef.current = pad;
|
|
125
|
+
// `toData()` returns one PointGroup per stroke, carrying the pen options
|
|
126
|
+
// alongside the points core scores.
|
|
127
|
+
const syncStrokes = () => {
|
|
128
|
+
controller.actions.setStrokes(pad.toData().map((group) => group.points));
|
|
129
|
+
};
|
|
130
|
+
// signature_pad dispatches beginStroke BEFORE pushing the new point group,
|
|
131
|
+
// where the v2 `onBegin` fired after. Syncing inline would report an empty
|
|
132
|
+
// pad for the whole first stroke, leaving the empty-pad overlay up and
|
|
133
|
+
// Accept disabled, so defer a microtask -- `_strokeBegin` is synchronous, so
|
|
134
|
+
// by then the point is in.
|
|
135
|
+
const syncOnBegin = () => queueMicrotask(syncStrokes);
|
|
136
|
+
pad.addEventListener("beginStroke", syncOnBegin);
|
|
137
|
+
pad.addEventListener("endStroke", syncStrokes);
|
|
138
|
+
return () => {
|
|
139
|
+
pad.removeEventListener("beginStroke", syncOnBegin);
|
|
140
|
+
pad.removeEventListener("endStroke", syncStrokes);
|
|
141
|
+
pad.off();
|
|
142
|
+
padRef.current = null;
|
|
143
|
+
};
|
|
144
|
+
}, [canvasNode, controller]);
|
|
105
145
|
useEffect(() => {
|
|
106
|
-
const canvas =
|
|
146
|
+
const canvas = canvasRef.current;
|
|
107
147
|
if (!videoNode || !canvas)
|
|
108
148
|
return;
|
|
109
|
-
|
|
110
|
-
// The controller publishes its typed error for the view below.
|
|
111
|
-
});
|
|
149
|
+
handledByState(controller.attach(videoNode, canvas));
|
|
112
150
|
return () => controller.detach();
|
|
113
151
|
}, [controller, videoNode]);
|
|
114
152
|
useEffect(() => {
|
|
@@ -118,9 +156,7 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
118
156
|
!(state.phase === "loading" && state.pipeline.ready))) {
|
|
119
157
|
return;
|
|
120
158
|
}
|
|
121
|
-
|
|
122
|
-
// The controller publishes its typed error for the view below.
|
|
123
|
-
});
|
|
159
|
+
handledByState(controller.actions.start());
|
|
124
160
|
}, [autoStart, controller, sessionReady, state.phase, state.pipeline.ready]);
|
|
125
161
|
useEffect(() => {
|
|
126
162
|
if (state.phase !== "completed" || !state.artifact)
|
|
@@ -153,7 +189,7 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
153
189
|
// The pad still shows ink that the recording never captured, so the
|
|
154
190
|
// restart has to wipe it — regardless of `restartVideoOnClear`, which
|
|
155
191
|
// governs the USER-initiated clear, not a forced one.
|
|
156
|
-
|
|
192
|
+
padRef.current?.clear();
|
|
157
193
|
setRestarting(true);
|
|
158
194
|
// A flow that owns a face stage takes the user back through it: the
|
|
159
195
|
// interruption is an unsupervised gap, so the selfie that vouches for who
|
|
@@ -161,7 +197,7 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
161
197
|
if (onRestartRequested)
|
|
162
198
|
onRestartRequested();
|
|
163
199
|
else
|
|
164
|
-
|
|
200
|
+
handledByState(controller.actions.retry());
|
|
165
201
|
}, [controller, onRestartRequested]);
|
|
166
202
|
const guidance = state.guidance.code === SignatureCaptureGuidanceCode.KEEP_SIGNING
|
|
167
203
|
? text.keepSigningText
|
|
@@ -184,10 +220,6 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
184
220
|
controller.actions.done();
|
|
185
221
|
}, [controller]);
|
|
186
222
|
const showSuccessScreen = useShowSuccessScreen(skipSuccessScreen, state.phase === "reviewing", handleDone);
|
|
187
|
-
function syncStrokes() {
|
|
188
|
-
const strokes = signatureRef.current?.toData() ?? [];
|
|
189
|
-
controller.actions.setStrokes(strokes);
|
|
190
|
-
}
|
|
191
223
|
function pointerSignal(type, event) {
|
|
192
224
|
const rect = event.currentTarget.getBoundingClientRect();
|
|
193
225
|
controller.actions.recordPointerSignal({
|
|
@@ -199,19 +231,13 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
199
231
|
at: event.timeStamp,
|
|
200
232
|
});
|
|
201
233
|
}
|
|
202
|
-
const signaturePanel = (_jsxs(SignaturePanel, { ref: signaturePanelRef, className: classNames.signaturePanel, "$empty": displayEmptyState, "$headTrackingSatisfied": headTrackingSatisfied, "$legacyVideoLayout": legacyVideoLayout, onPointerDown: (event) => pointerSignal("down", event), onPointerMove: (event) => pointerSignal("move", event), onPointerUp: (event) => pointerSignal("up", event), onPointerCancel: (event) => pointerSignal("cancel", event), children: [_jsx(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
"aria-hidden": !showLegacySignaturePad
|
|
234
|
+
const signaturePanel = (_jsxs(SignaturePanel, { ref: signaturePanelRef, className: classNames.signaturePanel, "$empty": displayEmptyState, "$headTrackingSatisfied": headTrackingSatisfied, "$legacyVideoLayout": legacyVideoLayout, onPointerDown: (event) => pointerSignal("down", event), onPointerMove: (event) => pointerSignal("move", event), onPointerUp: (event) => pointerSignal("up", event), onPointerCancel: (event) => pointerSignal("cancel", event), children: [_jsx("canvas", { ref: setCanvasRef, width: canvasDimensions?.width, height: canvasDimensions?.height, className: classNames.canvas, "aria-label": "Signature pad", "aria-hidden": !showLegacySignaturePad
|
|
235
|
+
? true
|
|
236
|
+
: !legacyVideoLayout &&
|
|
237
|
+
showFaceGuideThenSignaturePad &&
|
|
238
|
+
!headTrackingSatisfied
|
|
208
239
|
? true
|
|
209
|
-
: !legacyVideoLayout &&
|
|
210
|
-
showFaceGuideThenSignaturePad &&
|
|
211
|
-
!headTrackingSatisfied
|
|
212
|
-
? true
|
|
213
|
-
: undefined,
|
|
214
|
-
}, onBegin: syncStrokes, onEnd: syncStrokes }), !headTrackingSatisfied && text.headTrackingUnsatisfiedText ? (_jsx(SignaturePanelContent, { className: classNames.headTrackingUnsatisfiedContentContainer, "$legacyVideoLayout": legacyVideoLayout, children: _jsx(SignaturePanelContentInner, { className: classNames.headTrackingUnsatisfiedContentInner, children: text.headTrackingUnsatisfiedText }) })) : displayEmptyState ? (_jsx(SignaturePanelContent, { className: classNames.emptyContentContainer, "$legacyVideoLayout": legacyVideoLayout, onClick: () => setEmptyContentDismissed(true), children: _jsx(SignaturePanelContentInner, { className: classNames.emptyContentInner, children: text.signaturePadEmptyText }) })) : null, legacyVideoLayout &&
|
|
240
|
+
: undefined }), !headTrackingSatisfied && text.headTrackingUnsatisfiedText ? (_jsx(SignaturePanelContent, { className: classNames.headTrackingUnsatisfiedContentContainer, "$legacyVideoLayout": legacyVideoLayout, children: _jsx(SignaturePanelContentInner, { className: classNames.headTrackingUnsatisfiedContentInner, children: text.headTrackingUnsatisfiedText }) })) : displayEmptyState ? (_jsx(SignaturePanelContent, { className: classNames.emptyContentContainer, "$legacyVideoLayout": legacyVideoLayout, onClick: () => setEmptyContentDismissed(true), children: _jsx(SignaturePanelContentInner, { className: classNames.emptyContentInner, children: text.signaturePadEmptyText }) })) : null, legacyVideoLayout &&
|
|
215
241
|
!signatureDisabled &&
|
|
216
242
|
((!text.signaturePadEmptyText && headTrackingSatisfied) ||
|
|
217
243
|
emptyContentDismissed) ? (_jsx(SignHereText, { children: text.signHereText })) : null] }));
|
|
@@ -219,12 +245,12 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
219
245
|
!headTrackingSatisfied ||
|
|
220
246
|
state.pointCount === 0 ||
|
|
221
247
|
state.phase !== "capturing", onClick: () => {
|
|
222
|
-
|
|
223
|
-
|
|
248
|
+
padRef.current?.clear();
|
|
249
|
+
handledByState(controller.actions.clear());
|
|
224
250
|
}, children: text.clearBtnText }), _jsx(AcceptButton, { variant: "positive", finished: state.phase !== "processing", className: classNames.acceptBtn, "$legacyVideoLayout": legacyVideoLayout, disabled: signatureDisabled ||
|
|
225
251
|
!headTrackingSatisfied ||
|
|
226
252
|
!state.guidance.satisfied ||
|
|
227
|
-
state.phase !== "capturing", onClick: () =>
|
|
253
|
+
state.phase !== "capturing", onClick: () => handledByState(controller.actions.accept()), children: text.acceptBtnText })] }));
|
|
228
254
|
return (_jsxs(Root, { className: classNames.container, children: [onExit && state.phase !== "reviewing" && state.phase !== "completed" ? (_jsx(ExitCaptureButton, { onClick: onExit, className: classNames.exitBtn })) : null, _jsx(CameraLayer, { "$visible": forceCameraFeed || state.captureMode === "video", children: _jsx(CameraVideoTag, { ref: setVideoRef, isRearFacing: state.camera.isRearFacing, className: classNames.cameraFeed }) }), _jsxs(CaptureContent, { "$visible": (legacyVideoLayout && !sessionReady) ||
|
|
229
255
|
state.phase === "capturing" ||
|
|
230
256
|
state.phase === "processing", "$legacyVideoLayout": legacyVideoLayout, children: [!legacyVideoLayout &&
|
|
@@ -236,12 +262,17 @@ export function SignatureCaptureView({ controller, sessionReady = true, lang = "
|
|
|
236
262
|
? ` ${classNames.signatureCanvasContainerDisabled}`
|
|
237
263
|
: ""}`, "$disabled": signatureDisabled, "$headTrackingSatisfied": headTrackingSatisfied, children: [signaturePanel, signatureButtons] }) })] })) : (_jsxs(_Fragment, { children: [signaturePanel, signatureButtons] }))] })] }), (state.phase === "reviewing" || state.phase === "completed") &&
|
|
238
264
|
showSuccessScreen ? (_jsxs(Review, { className: classNames.review, children: [assets.successIcon ? _jsx("img", { src: assets.successIcon, alt: "" }) : null, _jsx("h1", { className: classNames.successHeading, children: text.successHeadingText }), previewUrl ? (_jsx("video", { src: previewUrl, className: classNames.reviewMedia, controls: true, playsInline: true })) : null, !previewUrl && state.artifact ? (_jsx("img", { src: state.artifact.imageDataUrl, alt: capturedSignatureAltText, className: classNames.reviewMedia })) : null, state.phase === "reviewing" ? (_jsxs(ButtonsRow, { className: classNames.buttonsRow, children: [_jsx(LoaderButton, { variant: "warning", finished: true, className: classNames.retryBtn, onClick: () => {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}, children: text.retryBtnText }), _jsx(LoaderButton, { variant: "positive", finished: true, className: classNames.doneBtn, onClick: handleDone, children: text.doneBtnText })] })) : null] })) : null, micDenied ? (_jsx(MicrophoneAccessDeniedOverlay, { onRetry: () =>
|
|
265
|
+
padRef.current?.clear();
|
|
266
|
+
handledByState(controller.actions.retry());
|
|
267
|
+
}, children: text.retryBtnText }), _jsx(LoaderButton, { variant: "positive", finished: true, className: classNames.doneBtn, onClick: handleDone, children: text.doneBtnText })] })) : null] })) : null, micDenied ? (_jsx(MicrophoneAccessDeniedOverlay, { onRetry: () => handledByState(controller.actions.retry()), classNames: classNames.microphoneAccessDenied, verbiage: verbiage?.microphoneAccessDenied })) : null, state.phase === "error" &&
|
|
268
|
+
!micDenied &&
|
|
269
|
+
recordingInterrupted &&
|
|
270
|
+
!restarting &&
|
|
271
|
+
RecordingInterruptedScreen ? (_jsx(RecordingInterruptedScreen, { onStartOver: handleStartOver, willCaptureSelfie: Boolean(onRestartRequested) })) : null, state.phase === "error" &&
|
|
242
272
|
!micDenied &&
|
|
243
273
|
recordingInterrupted &&
|
|
244
|
-
!restarting
|
|
274
|
+
!restarting &&
|
|
275
|
+
!RecordingInterruptedScreen ? (_jsx(ErrorPanel, { role: "alert", className: classNames.error, children: _jsxs(_Fragment, { children: [_jsx(InterruptedIcon, { "aria-hidden": "true", className: classNames.recordingInterruptedIcon, children: _jsxs("svg", { width: "34", height: "34", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M15 10.5V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-3.5l6 4.5V6z" }), _jsx("line", { x1: "2", y1: "22", x2: "22", y2: "2" })] }) }), _jsx(InterruptedHeading, { className: classNames.recordingInterruptedHeading, children: text.recordingInterruptedHeadingText }), _jsx(InterruptedBody, { className: classNames.recordingInterruptedText, children: text.recordingInterruptedText }), _jsx(InterruptedButton, { finished: true, className: classNames.startOverBtn, onClick: handleStartOver, children: text.startOverBtnText }), onRestartRequested ? (_jsx(InterruptedHint, { className: classNames.recordingInterruptedHint, children: text.recordingInterruptedHintText })) : null] }) })) : null, state.phase === "error" && !micDenied && !recordingInterrupted ? (_jsxs(ErrorPanel, { role: "alert", className: classNames.error, children: [_jsx("h1", { children: text.errorHeadingText }), _jsx("p", { children: state.error?.message }), state.error?.recoverable ? (_jsx(LoaderButton, { finished: true, onClick: () => handledByState(controller.actions.retry()), children: text.retryBtnText })) : null] })) : null] }));
|
|
245
276
|
}
|
|
246
277
|
const Root = styled.div `
|
|
247
278
|
position: relative;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
export type GuidanceMessageVariant = 'default' | 'positive' | 'negative';
|
|
3
3
|
export declare const GuidanceMessageContainerDiv: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$top" | "$bottom"> & {
|
|
4
4
|
$top?: string;
|
|
@@ -11,6 +11,7 @@ export declare const GuidanceMessageContainer: (props: {
|
|
|
11
11
|
$top?: string;
|
|
12
12
|
$bottom?: string;
|
|
13
13
|
className?: string;
|
|
14
|
+
style?: CSSProperties;
|
|
14
15
|
children?: ReactNode;
|
|
15
16
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export declare const GuidanceMessage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$textColor" | "$variant" | "$background"> & {
|
|
@@ -22,4 +23,27 @@ export declare const GuidanceMessage: import("styled-components/dist/types").ISt
|
|
|
22
23
|
$textColor?: string;
|
|
23
24
|
$variant?: GuidanceMessageVariant;
|
|
24
25
|
}, never>>> & string;
|
|
26
|
+
export type GuidanceMessagePlacement = 'viewport' | 'guideBox';
|
|
27
|
+
/**
|
|
28
|
+
* `GuidanceMessageContainer` placed relative to the guide box rather than to
|
|
29
|
+
* the viewport.
|
|
30
|
+
*
|
|
31
|
+
* The guide rect and this container resolve their coordinates against the same
|
|
32
|
+
* positioned ancestor — the rect is published relative to the guide canvas
|
|
33
|
+
* wrapper, which is pinned to that ancestor's top-left — so the rect's own
|
|
34
|
+
* numbers can be used as a `top` directly, with no conversion. A ResizeObserver
|
|
35
|
+
* republishes the rect on every size change, which is what makes the offset
|
|
36
|
+
* hold across resize and orientation changes without per-breakpoint CSS.
|
|
37
|
+
*
|
|
38
|
+
* Falls back to the viewport placement whenever the rect is unavailable: the
|
|
39
|
+
* guide type may not publish one, and even the fit guide's arrives a frame
|
|
40
|
+
* after mount. Anchoring to a missing rect would put the pill at the top of the
|
|
41
|
+
* screen for that frame, so the old placement is the safer floor.
|
|
42
|
+
*/
|
|
43
|
+
export declare const PlacedGuidanceMessageContainer: ({ placement, gap, className, children, }: {
|
|
44
|
+
placement: GuidanceMessagePlacement;
|
|
45
|
+
gap: number;
|
|
46
|
+
className?: string;
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
25
49
|
//# sourceMappingURL=GuidanceMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GuidanceMessage.d.ts","sourceRoot":"","sources":["../../src/components/GuidanceMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"GuidanceMessage.d.ts","sourceRoot":"","sources":["../../src/components/GuidanceMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKhD,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;AAExE,eAAO,MAAM,2BAA2B;WAC/B,MAAM;cACH,MAAM;;WADT,MAAM;cACH,MAAM;oBAUjB,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAI,OAAO;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,4CAOA,CAAA;AAED,eAAO,MAAM,eAAe;kBACZ,MAAM;iBACP,MAAM;eACR,sBAAsB;;kBAFnB,MAAM;iBACP,MAAM;eACR,sBAAsB;oBAqBlC,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,UAAU,GAAG,UAAU,CAAA;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,8BAA8B,GAAI,0CAK5C;IACD,SAAS,EAAE,wBAAwB,CAAA;IACnC,GAAG,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,4CA+BA,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from 'styled-components';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
+
import { useGuideLayout } from '../layout/GuideLayoutContext';
|
|
4
5
|
export const GuidanceMessageContainerDiv = styled.div `
|
|
5
6
|
position: absolute;
|
|
6
7
|
top: calc(${({ $top }) => $top ?? '10%'});
|
|
@@ -37,3 +38,39 @@ export const GuidanceMessage = styled.div `
|
|
|
37
38
|
0 1px 3px 0 rgb(0 0 0 / 0.1),
|
|
38
39
|
0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
39
40
|
`;
|
|
41
|
+
/**
|
|
42
|
+
* `GuidanceMessageContainer` placed relative to the guide box rather than to
|
|
43
|
+
* the viewport.
|
|
44
|
+
*
|
|
45
|
+
* The guide rect and this container resolve their coordinates against the same
|
|
46
|
+
* positioned ancestor — the rect is published relative to the guide canvas
|
|
47
|
+
* wrapper, which is pinned to that ancestor's top-left — so the rect's own
|
|
48
|
+
* numbers can be used as a `top` directly, with no conversion. A ResizeObserver
|
|
49
|
+
* republishes the rect on every size change, which is what makes the offset
|
|
50
|
+
* hold across resize and orientation changes without per-breakpoint CSS.
|
|
51
|
+
*
|
|
52
|
+
* Falls back to the viewport placement whenever the rect is unavailable: the
|
|
53
|
+
* guide type may not publish one, and even the fit guide's arrives a frame
|
|
54
|
+
* after mount. Anchoring to a missing rect would put the pill at the top of the
|
|
55
|
+
* screen for that frame, so the old placement is the safer floor.
|
|
56
|
+
*/
|
|
57
|
+
export const PlacedGuidanceMessageContainer = ({ placement, gap, className, children, }) => {
|
|
58
|
+
const { guideRect } = useGuideLayout();
|
|
59
|
+
// `isGuideBox` is the load-bearing check, not a nicety: a rect is always
|
|
60
|
+
// published for the camera feed to clip to, but it is only the guide box in
|
|
61
|
+
// mask-following mode. Anchoring to it otherwise puts the message below a
|
|
62
|
+
// rectangle that was never drawn.
|
|
63
|
+
const belowGuideBox = placement === 'guideBox' &&
|
|
64
|
+
guideRect !== null &&
|
|
65
|
+
guideRect.isGuideBox === true &&
|
|
66
|
+
guideRect.height > 0;
|
|
67
|
+
return (_jsx(GuidanceMessageContainer, { "$top": "", "$bottom": "12.5%", className: className,
|
|
68
|
+
// Inline, not a styled-components interpolation: this value changes with
|
|
69
|
+
// every observed size, and interpolating it would mint a fresh class per
|
|
70
|
+
// pixel and grow the stylesheet for the length of a drag-resize. Inline
|
|
71
|
+
// also outranks the `$bottom` rule above, so `bottom: auto` is what
|
|
72
|
+
// releases the viewport anchor.
|
|
73
|
+
style: belowGuideBox
|
|
74
|
+
? { top: guideRect.y + guideRect.height + gap, bottom: 'auto' }
|
|
75
|
+
: undefined, children: children }));
|
|
76
|
+
};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import type { ComponentType } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
name: string;
|
|
2
|
+
import type { AdditionalDocumentRequest } from '@idmission/websdk-core/client';
|
|
3
|
+
export type AdditionalDocument = AdditionalDocumentRequest & {
|
|
5
4
|
/** Rendered under the heading. A component form is invoked with no props. */
|
|
6
5
|
description?: string | ComponentType;
|
|
7
|
-
/**
|
|
8
|
-
* Evaluated before the document is shown. Resolving `true` skips it
|
|
9
|
-
* entirely; the document contributes nothing to the submission.
|
|
10
|
-
*/
|
|
11
|
-
skip?: () => Promise<boolean>;
|
|
12
|
-
/** Marks the document as a proof-of-address on the wire. */
|
|
13
|
-
processAsPOA?: boolean;
|
|
14
6
|
};
|
|
15
7
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/additional_documents/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/additional_documents/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AAO9E,MAAM,MAAM,kBAAkB,GAAG,yBAAyB,GAAG;IAC3D,6EAA6E;IAC7E,WAAW,CAAC,EAAE,MAAM,GAAG,aAAa,CAAA;CACrC,CAAA"}
|
|
@@ -1,25 +1,16 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { CapturedDocument, DocumentCaptureInput } from '@idmission/websdk-core/documentCapture';
|
|
3
3
|
import type { CameraFeedMode } from '../CameraFeed';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* It lives here rather than in core because `instructions` is a `ReactNode` and
|
|
9
|
-
* the callbacks take React-facing objects; `@idmission/websdk-core` is
|
|
10
|
-
* React-free, enforced by its own `reactFree.test.ts`. Core therefore takes only
|
|
11
|
-
* the stripped `DocumentCaptureItem` half, and this type re-composes the rest.
|
|
12
|
-
*
|
|
13
|
-
* The progress fields (`documentId`, `contentUrl`, `uploadState`) are populated
|
|
14
|
-
* on the objects handed to the callbacks, matching what sdk2's consumers saw.
|
|
5
|
+
* React presentation and per-document notifications for a core document
|
|
6
|
+
* capture input. Live progress belongs to core's `CapturedDocument` result,
|
|
7
|
+
* never to this prompt.
|
|
15
8
|
*/
|
|
16
|
-
export type
|
|
9
|
+
export type DocumentCapturePrompt = DocumentCaptureInput & {
|
|
17
10
|
cameraFeedMode?: CameraFeedMode;
|
|
18
11
|
instructions?: ReactNode;
|
|
19
12
|
onCaptured?: (document: CapturedDocument) => void;
|
|
20
13
|
onUploaded?: (document: CapturedDocument) => void;
|
|
21
|
-
documentId?: string;
|
|
22
|
-
contentUrl?: string;
|
|
23
|
-
uploadState?: DocumentUploadState;
|
|
24
14
|
};
|
|
15
|
+
export type { CapturedDocument } from '@idmission/websdk-core/documentCapture';
|
|
25
16
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/document/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/document/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,GAAG;IACzD,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAA;IACjD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAA;CAClD,CAAA;AAGD,YAAY,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAA"}
|
|
@@ -26,6 +26,17 @@ export type CameraAccessDeniedOverlayProps = {
|
|
|
26
26
|
classNames?: CameraAccessDeniedOverlayClassNames;
|
|
27
27
|
colors?: CameraAccessDeniedOverlayColors;
|
|
28
28
|
verbiage?: CameraAccessDeniedOverlayVerbiage;
|
|
29
|
+
/**
|
|
30
|
+
* Which half of sdk2's ONE camera-failure screen this is. `ErrorScreen`
|
|
31
|
+
* renders this component for `CAMERA_UNAVAILABLE` as well as for
|
|
32
|
+
* `CAMERA_PERMISSION_DENIED` — same screen, same classNames, and only the
|
|
33
|
+
* stock copy differs ("in use by another application" is not a permission
|
|
34
|
+
* problem). Selecting the defaults HERE rather than resolving them in
|
|
35
|
+
* `ErrorScreen` keeps a single translation pass: a second pass over an
|
|
36
|
+
* already-resolved value would silently drop component-typed verbiage,
|
|
37
|
+
* since `evaluateVerbiage` reads a ReactElement as a locale map.
|
|
38
|
+
*/
|
|
39
|
+
variant?: 'permissionDenied' | 'unavailable';
|
|
29
40
|
};
|
|
30
|
-
export declare const CameraAccessDeniedOverlay: ({ onRetry, assets, classNames, colors, verbiage: rawVerbiage, }: CameraAccessDeniedOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare const CameraAccessDeniedOverlay: ({ onRetry, assets, classNames, colors, verbiage: rawVerbiage, variant, }: CameraAccessDeniedOverlayProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
42
|
//# sourceMappingURL=CameraAccessDeniedOverlay.d.ts.map
|