idmission-web-sdk 1.0.151 → 1.0.153
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/components/customer_flows/DocumentCapture.d.ts +4 -1
- package/dist/components/document_capture/DocumentCaptureScreen.d.ts +16 -2
- package/dist/components/document_capture/DocumentCaptureWizard.d.ts +4 -2
- package/dist/lib/locales/es/translation.d.ts +6 -0
- package/dist/lib/locales/index.d.ts +6 -0
- package/dist/sdk2.cjs.development.js +68 -41
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +68 -41
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +68 -41
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,10 @@ import { FC, PropsWithChildren, ReactNode } from 'react';
|
|
|
2
2
|
import { ThemeInput } from '../../themes';
|
|
3
3
|
import { LangOption } from '../../lib/locales';
|
|
4
4
|
import { SubmissionRequest } from '../../contexts/SubmissionContext';
|
|
5
|
-
import { DocumentCaptureWizardClassNames } from '../document_capture/DocumentCaptureWizard';
|
|
5
|
+
import { DocumentCaptureWizardClassNames, DocumentCaptureWizardVerbiage } from '../document_capture/DocumentCaptureWizard';
|
|
6
6
|
import { CameraFeedMode } from '../../lib/camera/CameraFeedWrapper';
|
|
7
7
|
export type DocumentCaptureClassNames = DocumentCaptureWizardClassNames;
|
|
8
|
+
export type DocumentCaptureVerbiage = DocumentCaptureWizardVerbiage;
|
|
8
9
|
export interface DocumentCaptureProps extends PropsWithChildren {
|
|
9
10
|
/** Language code to use. Supported values: 'auto' (detect based on user's OS), 'en' (English), 'es' (Spanish). Defaults to auto. */
|
|
10
11
|
lang?: LangOption;
|
|
@@ -31,6 +32,8 @@ export interface DocumentCaptureProps extends PropsWithChildren {
|
|
|
31
32
|
theme?: ThemeInput;
|
|
32
33
|
/** Object containing any classNames for inner components. **/
|
|
33
34
|
classNames?: DocumentCaptureClassNames;
|
|
35
|
+
/** Object containing any verbiage overrides. */
|
|
36
|
+
verbiage?: DocumentCaptureVerbiage;
|
|
34
37
|
/** Boolean flag to indicate whether users should be prompted to share their location. Default is `true`. */
|
|
35
38
|
geolocationEnabled?: boolean;
|
|
36
39
|
/** Boolean flag to indicate whether users should be blocked from proceeding if they block location access. Default is `false`. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
2
|
import { CameraFeedMode } from '../../lib/camera/CameraFeedWrapper';
|
|
3
|
+
import { CustomerSuppliedVerbiage } from '../../lib/locales';
|
|
3
4
|
export type DocumentCaptureScreenClassNames = {
|
|
4
5
|
container?: string;
|
|
5
6
|
cameraFeedWrapper?: string;
|
|
@@ -17,12 +18,25 @@ export type DocumentCaptureScreenClassNames = {
|
|
|
17
18
|
uploadProgressBtn?: string;
|
|
18
19
|
captureBtn?: string;
|
|
19
20
|
};
|
|
21
|
+
export type DocumentCaptureScreenVerbiage = {
|
|
22
|
+
headingText?: CustomerSuppliedVerbiage;
|
|
23
|
+
loadingBtnText?: CustomerSuppliedVerbiage;
|
|
24
|
+
retryCameraAccessBtnText?: CustomerSuppliedVerbiage;
|
|
25
|
+
captureBtnText?: CustomerSuppliedVerbiage;
|
|
26
|
+
capturingBtnText?: CustomerSuppliedVerbiage;
|
|
27
|
+
retryCaptureBtnText?: CustomerSuppliedVerbiage;
|
|
28
|
+
uploadBtnText?: CustomerSuppliedVerbiage;
|
|
29
|
+
uploadingBtnText?: CustomerSuppliedVerbiage;
|
|
30
|
+
retryUploadBtnText?: CustomerSuppliedVerbiage;
|
|
31
|
+
successBtnText?: CustomerSuppliedVerbiage;
|
|
32
|
+
};
|
|
20
33
|
export type DocumentCaptureScreenProps = {
|
|
21
34
|
aspectRatio?: number;
|
|
22
35
|
cameraFeedMode?: CameraFeedMode;
|
|
23
|
-
classNames?: DocumentCaptureScreenClassNames;
|
|
24
36
|
instructions?: ReactNode;
|
|
25
37
|
onCaptureClicked?: () => void;
|
|
26
38
|
onSuccess?: (blob: Blob) => void;
|
|
39
|
+
classNames?: DocumentCaptureScreenClassNames;
|
|
40
|
+
verbiage?: DocumentCaptureScreenVerbiage;
|
|
27
41
|
};
|
|
28
|
-
export declare const DocumentCaptureScreen: ({ aspectRatio, cameraFeedMode,
|
|
42
|
+
export declare const DocumentCaptureScreen: ({ aspectRatio, cameraFeedMode, instructions, onCaptureClicked, onSuccess, classNames, verbiage: rawVerbiage, }: DocumentCaptureScreenProps) => React.JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { ReactNode } from 'react';
|
|
2
|
-
import { DocumentCaptureScreenClassNames } from './DocumentCaptureScreen';
|
|
2
|
+
import { DocumentCaptureScreenClassNames, DocumentCaptureScreenVerbiage } from './DocumentCaptureScreen';
|
|
3
3
|
import { CameraFeedMode } from '../../lib/camera/CameraFeedWrapper';
|
|
4
4
|
export type DocumentCaptureWizardClassNames = DocumentCaptureScreenClassNames;
|
|
5
|
+
export type DocumentCaptureWizardVerbiage = DocumentCaptureScreenVerbiage;
|
|
5
6
|
export type DocumentCaptureWizardProps = {
|
|
6
7
|
onSuccess?: () => void;
|
|
7
8
|
onExitCapture?: () => void;
|
|
@@ -10,5 +11,6 @@ export type DocumentCaptureWizardProps = {
|
|
|
10
11
|
cameraFeedMode?: CameraFeedMode;
|
|
11
12
|
instructions?: ReactNode;
|
|
12
13
|
classNames?: DocumentCaptureWizardClassNames;
|
|
14
|
+
verbiage?: DocumentCaptureWizardVerbiage;
|
|
13
15
|
};
|
|
14
|
-
export declare const DocumentCaptureWizard: ({ onSuccess, aspectRatio, cameraFeedMode, instructions, classNames, }: DocumentCaptureWizardProps) => React.JSX.Element;
|
|
16
|
+
export declare const DocumentCaptureWizard: ({ onSuccess, aspectRatio, cameraFeedMode, instructions, classNames, verbiage, }: DocumentCaptureWizardProps) => React.JSX.Element;
|
|
@@ -56,5 +56,11 @@ declare const _default: {
|
|
|
56
56
|
'Network unreachable': string;
|
|
57
57
|
"We're having trouble reaching our services, please check your connection and try again.": string;
|
|
58
58
|
"We're sorry, an unexpected error has occurred.": string;
|
|
59
|
+
'Document Capture': string;
|
|
60
|
+
Capture: string;
|
|
61
|
+
'Retry capture': string;
|
|
62
|
+
Upload: string;
|
|
63
|
+
'Uploading...': string;
|
|
64
|
+
'Upload succeeded!': string;
|
|
59
65
|
};
|
|
60
66
|
export default _default;
|
|
@@ -64,6 +64,12 @@ export declare const resources: {
|
|
|
64
64
|
'Network unreachable': string;
|
|
65
65
|
"We're having trouble reaching our services, please check your connection and try again.": string;
|
|
66
66
|
"We're sorry, an unexpected error has occurred.": string;
|
|
67
|
+
'Document Capture': string;
|
|
68
|
+
Capture: string;
|
|
69
|
+
'Retry capture': string;
|
|
70
|
+
Upload: string;
|
|
71
|
+
'Uploading...': string;
|
|
72
|
+
'Upload succeeded!': string;
|
|
67
73
|
};
|
|
68
74
|
};
|
|
69
75
|
};
|
|
@@ -47,7 +47,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
47
47
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
48
48
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
49
49
|
|
|
50
|
-
var webSdkVersion = '1.0.
|
|
50
|
+
var webSdkVersion = '1.0.153';
|
|
51
51
|
|
|
52
52
|
function getPlatform() {
|
|
53
53
|
if (typeof window === 'undefined') return;
|
|
@@ -9610,7 +9610,13 @@ var esTranslation = {
|
|
|
9610
9610
|
'Video signature has been successfully captured!': 'La video firma ha sido exitosa.',
|
|
9611
9611
|
'Network unreachable': 'No hay conexión a internet.',
|
|
9612
9612
|
"We're having trouble reaching our services, please check your connection and try again.": "Estamos teniendo problemas para alcanzar nuestros servicios, por favor verificar la conexi\xF3n a internet e intentar de nuevo.",
|
|
9613
|
-
"We're sorry, an unexpected error has occurred.": "Lo sentimos, se ha producido un error inesperado."
|
|
9613
|
+
"We're sorry, an unexpected error has occurred.": "Lo sentimos, se ha producido un error inesperado.",
|
|
9614
|
+
'Document Capture': 'Captura de documento',
|
|
9615
|
+
Capture: 'Capturar',
|
|
9616
|
+
'Retry capture': 'Reintentar la captura',
|
|
9617
|
+
Upload: 'Adjuntar',
|
|
9618
|
+
'Uploading...': 'Procesando...',
|
|
9619
|
+
'Upload succeeded!': 'Proceso completo!'
|
|
9614
9620
|
};
|
|
9615
9621
|
|
|
9616
9622
|
var resources = {
|
|
@@ -14330,7 +14336,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
14330
14336
|
}, /*#__PURE__*/React__default['default'].createElement(HighPerformanceSelfieGuidanceModelsProvider, null, function () {
|
|
14331
14337
|
switch (captureState) {
|
|
14332
14338
|
case 'CAPTURING_ID':
|
|
14333
|
-
return /*#__PURE__*/React__default['default'].createElement(GuideOrientationProvider, null, /*#__PURE__*/React__default['default'].createElement(IdCaptureWizard, tslib.__assign({
|
|
14339
|
+
return /*#__PURE__*/React__default['default'].createElement(IdCaptureStateProvider, null, /*#__PURE__*/React__default['default'].createElement(GuideOrientationProvider, null, /*#__PURE__*/React__default['default'].createElement(IdCaptureWizard, tslib.__assign({
|
|
14334
14340
|
key: "id-capture-".concat(attempt)
|
|
14335
14341
|
}, idCaptureProps, {
|
|
14336
14342
|
assets: assets.idCapture,
|
|
@@ -14343,7 +14349,7 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
14343
14349
|
skipSuccessScreen: true,
|
|
14344
14350
|
releaseCameraAccessOnExit: false,
|
|
14345
14351
|
debugMode: debugMode
|
|
14346
|
-
})));
|
|
14352
|
+
}))));
|
|
14347
14353
|
case 'CHECKING_LIVENESS':
|
|
14348
14354
|
return /*#__PURE__*/React__default['default'].createElement(FaceLivenessWizard, tslib.__assign({
|
|
14349
14355
|
key: "face-liveness-".concat(attempt)
|
|
@@ -17001,32 +17007,46 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
17001
17007
|
var aspectRatio = _a.aspectRatio,
|
|
17002
17008
|
_f = _a.cameraFeedMode,
|
|
17003
17009
|
cameraFeedMode = _f === void 0 ? 'snapToGuides' : _f,
|
|
17004
|
-
_g = _a.classNames,
|
|
17005
|
-
classNames = _g === void 0 ? {} : _g,
|
|
17006
17010
|
instructions = _a.instructions,
|
|
17007
17011
|
onCaptureClicked = _a.onCaptureClicked,
|
|
17008
|
-
onSuccess = _a.onSuccess
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
|
|
17021
|
-
|
|
17022
|
-
|
|
17023
|
-
|
|
17024
|
-
|
|
17025
|
-
|
|
17026
|
-
|
|
17027
|
-
|
|
17012
|
+
onSuccess = _a.onSuccess,
|
|
17013
|
+
_g = _a.classNames,
|
|
17014
|
+
classNames = _g === void 0 ? {} : _g,
|
|
17015
|
+
_h = _a.verbiage,
|
|
17016
|
+
rawVerbiage = _h === void 0 ? {} : _h;
|
|
17017
|
+
var _j = React.useContext(SubmissionContext),
|
|
17018
|
+
submit = _j.submit,
|
|
17019
|
+
uploadDocument = _j.uploadDocument;
|
|
17020
|
+
var _k = useDocumentCaptureState(),
|
|
17021
|
+
_l = _k[0],
|
|
17022
|
+
rectX = _l.rectX,
|
|
17023
|
+
rectY = _l.rectY,
|
|
17024
|
+
rectWidth = _l.rectWidth,
|
|
17025
|
+
rectHeight = _l.rectHeight,
|
|
17026
|
+
rectOffsetTop = _l.rectOffsetTop,
|
|
17027
|
+
capturing = _l.capturing,
|
|
17028
|
+
imageUrl = _l.imageUrl,
|
|
17029
|
+
imageBlob = _l.imageBlob,
|
|
17030
|
+
uploadState = _l.uploadState,
|
|
17031
|
+
dispatch = _k[1];
|
|
17032
|
+
var _m = React.useContext(CameraStateContext),
|
|
17033
|
+
cameraReady = _m.cameraReady,
|
|
17034
|
+
cameraAccessDenied = _m.cameraAccessDenied,
|
|
17035
|
+
retryCameraAccess = _m.retryCameraAccess;
|
|
17028
17036
|
var theme = styled.useTheme();
|
|
17029
17037
|
var maskColor = (_d = (_c = (_b = theme.documentCapture) === null || _b === void 0 ? void 0 : _b.guideBox) === null || _c === void 0 ? void 0 : _c.maskColor) !== null && _d !== void 0 ? _d : cameraFeedMode === 'snapToGuides' ? '#708090' : "rgba(0, 0, 0, 0.5)";
|
|
17038
|
+
var verbiage = useTranslations(rawVerbiage, {
|
|
17039
|
+
headingText: 'Document Capture',
|
|
17040
|
+
loadingBtnText: 'Camera initializing...',
|
|
17041
|
+
retryCameraAccessBtnText: 'Retry',
|
|
17042
|
+
captureBtnText: 'Capture',
|
|
17043
|
+
capturingBtnText: 'Capturing...',
|
|
17044
|
+
retryCaptureBtnText: 'Retry capture',
|
|
17045
|
+
uploadBtnText: 'Upload',
|
|
17046
|
+
uploadingBtnText: 'Uploading...',
|
|
17047
|
+
retryUploadBtnText: 'Retry',
|
|
17048
|
+
successBtnText: 'Upload succeeded!'
|
|
17049
|
+
});
|
|
17030
17050
|
function onCaptureClick() {
|
|
17031
17051
|
dispatch({
|
|
17032
17052
|
type: 'captureRequested'
|
|
@@ -17087,7 +17107,7 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
17087
17107
|
className: classNames.headingRow
|
|
17088
17108
|
}, /*#__PURE__*/React__default['default'].createElement(Heading, {
|
|
17089
17109
|
className: classNames.heading
|
|
17090
|
-
},
|
|
17110
|
+
}, verbiage.headingText)), /*#__PURE__*/React__default['default'].createElement(DocumentCaptureGuideOverlay, {
|
|
17091
17111
|
aspectRatio: aspectRatio,
|
|
17092
17112
|
classNames: classNames,
|
|
17093
17113
|
maskColor: maskColor
|
|
@@ -17103,7 +17123,7 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
17103
17123
|
variant: "negative",
|
|
17104
17124
|
finished: true,
|
|
17105
17125
|
onClick: retryCameraAccess
|
|
17106
|
-
},
|
|
17126
|
+
}, verbiage.retryCameraAccessBtnText)) : imageUrl ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, uploadState === 'not_started' ? ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(LoaderButton, {
|
|
17107
17127
|
className: classNames.retryCaptureBtn,
|
|
17108
17128
|
finished: true,
|
|
17109
17129
|
variant: "warning",
|
|
@@ -17112,23 +17132,24 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
|
|
|
17112
17132
|
type: 'retryCapture'
|
|
17113
17133
|
});
|
|
17114
17134
|
}
|
|
17115
|
-
},
|
|
17135
|
+
}, verbiage.retryCaptureBtnText), /*#__PURE__*/React__default['default'].createElement(LoaderButton, {
|
|
17116
17136
|
className: classNames.uploadBtn,
|
|
17117
17137
|
finished: true,
|
|
17118
17138
|
variant: "positive",
|
|
17119
17139
|
onClick: onSubmitClick
|
|
17120
|
-
},
|
|
17140
|
+
}, verbiage.uploadBtnText))) : ( /*#__PURE__*/React__default['default'].createElement(LoaderButton, {
|
|
17121
17141
|
className: classNames.uploadProgressBtn,
|
|
17122
17142
|
finished: uploadState !== 'in_progress',
|
|
17123
17143
|
variant: uploadState === 'failed' ? 'negative' : 'positive',
|
|
17124
|
-
onClick: onSubmitClick
|
|
17125
|
-
|
|
17144
|
+
onClick: onSubmitClick,
|
|
17145
|
+
disabled: ['in_progress', 'succeeded'].includes(uploadState)
|
|
17146
|
+
}, uploadState === 'succeeded' ? verbiage.successBtnText : uploadState === 'failed' ? verbiage.retryUploadBtnText : verbiage.uploadingBtnText)))) : ( /*#__PURE__*/React__default['default'].createElement(LoaderButton, {
|
|
17126
17147
|
className: classNames.captureBtn,
|
|
17127
17148
|
finished: cameraReady,
|
|
17128
17149
|
variant: "primary",
|
|
17129
17150
|
onClick: onCaptureClick,
|
|
17130
17151
|
disabled: !cameraReady || capturing
|
|
17131
|
-
}, !cameraReady ?
|
|
17152
|
+
}, !cameraReady ? verbiage.loadingBtnText : capturing ? verbiage.capturingBtnText : verbiage.captureBtnText))))));
|
|
17132
17153
|
};
|
|
17133
17154
|
var CaptureContainer = styled__default['default'].div(templateObject_1 || (templateObject_1 = tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: var(--app-height);\n"], ["\n display: flex;\n flex-direction: column;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: var(--app-height);\n"])));
|
|
17134
17155
|
var HeadingRow = styled__default['default'].div(templateObject_2 || (templateObject_2 = tslib.__makeTemplateObject(["\n background: ", ";\n text-align: center;\n color: white;\n"], ["\n background: ", ";\n text-align: center;\n color: white;\n"])), function (props) {
|
|
@@ -17152,13 +17173,16 @@ var DocumentCaptureWizard = function DocumentCaptureWizard(_a) {
|
|
|
17152
17173
|
cameraFeedMode = _a.cameraFeedMode,
|
|
17153
17174
|
instructions = _a.instructions,
|
|
17154
17175
|
_b = _a.classNames,
|
|
17155
|
-
classNames = _b === void 0 ? {} : _b
|
|
17176
|
+
classNames = _b === void 0 ? {} : _b,
|
|
17177
|
+
_c = _a.verbiage,
|
|
17178
|
+
verbiage = _c === void 0 ? {} : _c;
|
|
17156
17179
|
return /*#__PURE__*/React__default['default'].createElement(DocumentCaptureStateProvider, null, /*#__PURE__*/React__default['default'].createElement(DocumentCaptureScreen, {
|
|
17157
17180
|
aspectRatio: aspectRatio,
|
|
17158
17181
|
cameraFeedMode: cameraFeedMode,
|
|
17159
|
-
classNames: classNames,
|
|
17160
17182
|
instructions: instructions,
|
|
17161
|
-
onSuccess: onSuccess
|
|
17183
|
+
onSuccess: onSuccess,
|
|
17184
|
+
classNames: classNames,
|
|
17185
|
+
verbiage: verbiage
|
|
17162
17186
|
}));
|
|
17163
17187
|
};
|
|
17164
17188
|
|
|
@@ -17183,10 +17207,12 @@ var DocumentCapture = function DocumentCapture(_a) {
|
|
|
17183
17207
|
theme = _c === void 0 ? 'default' : _c,
|
|
17184
17208
|
_d = _a.classNames,
|
|
17185
17209
|
classNames = _d === void 0 ? {} : _d,
|
|
17186
|
-
_e = _a.
|
|
17187
|
-
|
|
17188
|
-
_f = _a.
|
|
17189
|
-
|
|
17210
|
+
_e = _a.verbiage,
|
|
17211
|
+
verbiage = _e === void 0 ? {} : _e,
|
|
17212
|
+
_f = _a.geolocationEnabled,
|
|
17213
|
+
geolocationEnabled = _f === void 0 ? true : _f,
|
|
17214
|
+
_g = _a.geolocationRequired,
|
|
17215
|
+
geolocationRequired = _g === void 0 ? false : _g;
|
|
17190
17216
|
useLanguage(lang);
|
|
17191
17217
|
return /*#__PURE__*/React__default['default'].createElement(ThemeProvider, {
|
|
17192
17218
|
theme: theme
|
|
@@ -17207,8 +17233,9 @@ var DocumentCapture = function DocumentCapture(_a) {
|
|
|
17207
17233
|
onUserCancel: onUserCancel,
|
|
17208
17234
|
aspectRatio: aspectRatio,
|
|
17209
17235
|
cameraFeedMode: cameraFeedMode,
|
|
17236
|
+
instructions: instructions,
|
|
17210
17237
|
classNames: classNames,
|
|
17211
|
-
|
|
17238
|
+
verbiage: verbiage
|
|
17212
17239
|
}))));
|
|
17213
17240
|
};
|
|
17214
17241
|
|