idmission-web-sdk 1.0.153 → 1.0.155
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/common/GuidanceMessage.d.ts +10 -3
- package/dist/components/video_id/IdVideoCaptureWizard.d.ts +1 -1
- package/dist/sdk2.cjs.development.js +42 -29
- 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 +42 -29
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +45 -33
- 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
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
export type GuidanceMessageVariant = 'default' | 'positive' | 'negative';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const GuidanceMessageContainerDiv: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
4
4
|
$top?: string | undefined;
|
|
5
|
+
$bottom?: string | undefined;
|
|
5
6
|
}>>;
|
|
6
|
-
export declare const
|
|
7
|
+
export declare const GuidanceMessageContainer: (props: {
|
|
8
|
+
$top?: string;
|
|
9
|
+
$bottom?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}) => React.ReactPortal;
|
|
13
|
+
export declare const GuidanceMessage: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
7
14
|
$background?: string | undefined;
|
|
8
15
|
$textColor?: string | undefined;
|
|
9
16
|
$variant?: GuidanceMessageVariant | undefined;
|
|
@@ -50,4 +50,4 @@ export type VideoIdWizardProps = {
|
|
|
50
50
|
verbiage?: VideoIdWizardVerbiage;
|
|
51
51
|
debugMode?: boolean;
|
|
52
52
|
};
|
|
53
|
-
export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, idCaptureProps, faceLivenessProps, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, showIdCardBackDurationMs, readTextPrompt, readTextTimeoutDurationMs, skipIdCapture, skipShowIdCardBack, assets, classNames, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
|
|
53
|
+
export declare const VideoIdWizard: ({ onComplete, onExitCapture, onExitAfterFailure, onUserCancel, idCaptureProps, faceLivenessProps, idCardFrontDetectionThreshold, idCardFrontFocusThreshold, goodIdCardFrontFramesThreshold, showIdCardBackDurationMs, readTextPrompt, readTextTimeoutDurationMs, skipIdCapture, skipShowIdCardBack, skipSuccessScreen, assets, classNames, colors, verbiage, debugMode, }: VideoIdWizardProps) => ReactElement;
|
|
@@ -12,6 +12,7 @@ var tf = require('@tensorflow/tfjs');
|
|
|
12
12
|
var useDebounce = require('use-debounce');
|
|
13
13
|
var LanguageDetector = require('i18next-browser-languagedetector');
|
|
14
14
|
var i18n = require('i18next');
|
|
15
|
+
var reactDom = require('react-dom');
|
|
15
16
|
var tasksVision = require('@mediapipe/tasks-vision');
|
|
16
17
|
var SignatureCanvas = require('react-signature-canvas');
|
|
17
18
|
|
|
@@ -47,7 +48,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
47
48
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
48
49
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
49
50
|
|
|
50
|
-
var webSdkVersion = '1.0.
|
|
51
|
+
var webSdkVersion = '1.0.155';
|
|
51
52
|
|
|
52
53
|
function getPlatform() {
|
|
53
54
|
if (typeof window === 'undefined') return;
|
|
@@ -9680,10 +9681,16 @@ function useTranslations(verbiage, fallbacks) {
|
|
|
9680
9681
|
}, [fallbacks, i18n.language, t, verbiage]);
|
|
9681
9682
|
}
|
|
9682
9683
|
|
|
9683
|
-
var
|
|
9684
|
+
var GuidanceMessageContainerDiv = styled__default['default'].div(templateObject_1$v || (templateObject_1$v = tslib.__makeTemplateObject(["\n position: absolute;\n top: calc(", ");\n ", "\n font-weight: bold;\n width: 100%;\n display: flex;\n"], ["\n position: absolute;\n top: calc(", ");\n ", "\n font-weight: bold;\n width: 100%;\n display: flex;\n"])), function (_a) {
|
|
9684
9685
|
var $top = _a.$top;
|
|
9685
9686
|
return $top !== null && $top !== void 0 ? $top : '10vh';
|
|
9687
|
+
}, function (_a) {
|
|
9688
|
+
var $bottom = _a.$bottom;
|
|
9689
|
+
return $bottom ? "bottom: ".concat($bottom, ";") : "";
|
|
9686
9690
|
});
|
|
9691
|
+
var GuidanceMessageContainer = function GuidanceMessageContainer(props) {
|
|
9692
|
+
return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainerDiv, tslib.__assign({}, props)), document.getElementById('idmission-above-guides-content'));
|
|
9693
|
+
};
|
|
9687
9694
|
var GuidanceMessage = styled__default['default'].div(templateObject_2$k || (templateObject_2$k = tslib.__makeTemplateObject(["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n z-index: 10001;\n"], ["\n margin-left: auto;\n margin-right: auto;\n background: ", ";\n color: ", ";\n padding: 10px 12px 8px;\n border-radius: 8px;\n z-index: 10001;\n"])), function (props) {
|
|
9688
9695
|
var _a, _b, _c, _d, _e, _f;
|
|
9689
9696
|
return (_f = (_a = props.$background) !== null && _a !== void 0 ? _a : (_e = (_c = (_b = props.theme) === null || _b === void 0 ? void 0 : _b.guidanceMessages) === null || _c === void 0 ? void 0 : _c[(_d = props.$variant) !== null && _d !== void 0 ? _d : 'default']) === null || _e === void 0 ? void 0 : _e.backgroundColor) !== null && _f !== void 0 ? _f : '#ccc';
|
|
@@ -9979,7 +9986,8 @@ var IdCapture = function IdCapture(_a) {
|
|
|
9979
9986
|
ref: ref,
|
|
9980
9987
|
className: "flex ".concat((_j = classNames.container) !== null && _j !== void 0 ? _j : '')
|
|
9981
9988
|
}, guidanceMessage !== '' && ( /*#__PURE__*/React__default['default'].createElement(GuidanceMessageContainer, {
|
|
9982
|
-
"$top": "
|
|
9989
|
+
"$top": "",
|
|
9990
|
+
"$bottom": "12.5dvh",
|
|
9983
9991
|
className: classNames.guidanceMessageContainer
|
|
9984
9992
|
}, /*#__PURE__*/React__default['default'].createElement(GuidanceMessage, {
|
|
9985
9993
|
"$variant": satisfied ? 'positive' : 'default',
|
|
@@ -10538,7 +10546,7 @@ var GuideOrientationContext = /*#__PURE__*/React.createContext({
|
|
|
10538
10546
|
var StyledPageContainer = styled__default['default'](PageContainer)(templateObject_1$m || (templateObject_1$m = tslib.__makeTemplateObject(["\n z-index: 1000;\n"], ["\n z-index: 1000;\n"])));
|
|
10539
10547
|
var GuidesContainer = styled__default['default'].div(templateObject_2$f || (templateObject_2$f = tslib.__makeTemplateObject(["\n display: flex;\n flex-flow: column nowrap;\n width: 100%;\n height: 100%;\n"], ["\n display: flex;\n flex-flow: column nowrap;\n width: 100%;\n height: 100%;\n"])));
|
|
10540
10548
|
var GuideCenterRow = styled__default['default'].div(templateObject_3$a || (templateObject_3$a = tslib.__makeTemplateObject(["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n"], ["\n position: relative;\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n justify-items: center;\n box-sizing: border-box;\n max-width: 100%;\n max-height: 100%;\n"])));
|
|
10541
|
-
var GuideRegion = styled__default['default'].div(templateObject_4$6 || (templateObject_4$6 = tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background: ", ";\n color: ", ";\n text-align: center;\n ", "\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background: ", ";\n color: ", ";\n text-align: center;\n ", "\n ", "\n"])), function (props) {
|
|
10549
|
+
var GuideRegion = styled__default['default'].div(templateObject_4$6 || (templateObject_4$6 = tslib.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n position: relative;\n z-index: 1000;\n background: ", ";\n color: ", ";\n text-align: center;\n ", "\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n justify-content: end;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n position: relative;\n z-index: 1000;\n background: ", ";\n color: ", ";\n text-align: center;\n ", "\n ", "\n"])), function (props) {
|
|
10542
10550
|
var _a, _b, _c, _d, _e;
|
|
10543
10551
|
return (_e = (_a = props.$maskColor) !== null && _a !== void 0 ? _a : (_d = (_c = (_b = props.theme) === null || _b === void 0 ? void 0 : _b.idCapture) === null || _c === void 0 ? void 0 : _c.guideOverlay) === null || _d === void 0 ? void 0 : _d.backgroundColor) !== null && _e !== void 0 ? _e : 'rgba(0, 0, 0, 0.5)';
|
|
10544
10552
|
}, function (props) {
|
|
@@ -10557,7 +10565,7 @@ var GuideCenterBorder = styled__default['default'].div(templateObject_6$2 || (te
|
|
|
10557
10565
|
return "".concat((_a = props.$borderWidth) !== null && _a !== void 0 ? _a : 4, "px solid ").concat((_b = props.$borderColor) !== null && _b !== void 0 ? _b : 'white');
|
|
10558
10566
|
});
|
|
10559
10567
|
var GuideText = styled__default['default'].span(templateObject_7$1 || (templateObject_7$1 = tslib.__makeTemplateObject(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"], ["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n"])));
|
|
10560
|
-
var GuideImage = styled__default['default'].img(templateObject_8 || (templateObject_8 = tslib.__makeTemplateObject(["\n display: block;\n padding: ", "px;\n box-sizing: border-box;\n ", "\n ", "\n"], ["\n display: block;\n padding: ", "px;\n box-sizing: border-box;\n ", "\n ", "\n"])), function (props) {
|
|
10568
|
+
var GuideImage = styled__default['default'].img(templateObject_8 || (templateObject_8 = tslib.__makeTemplateObject(["\n position: relative;\n z-index: 1;\n display: block;\n padding: ", "px;\n box-sizing: border-box;\n ", "\n ", "\n"], ["\n position: relative;\n z-index: 1;\n display: block;\n padding: ", "px;\n box-sizing: border-box;\n ", "\n ", "\n"])), function (props) {
|
|
10561
10569
|
return props.$padding;
|
|
10562
10570
|
}, function (props) {
|
|
10563
10571
|
return props.$width ? "width: ".concat(props.$width, "px;\n max-width: ").concat(props.$width, "px;") : "max-width: none;";
|
|
@@ -11497,7 +11505,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
|
|
|
11497
11505
|
classNames: (_g = classNames.capture) === null || _g === void 0 ? void 0 : _g.imagePreview,
|
|
11498
11506
|
text: (_h = idCaptureVerbiages === null || idCaptureVerbiages === void 0 ? void 0 : idCaptureVerbiages.idCardFront) === null || _h === void 0 ? void 0 : _h.processingIdCardText,
|
|
11499
11507
|
imageUrl: imageUrl
|
|
11500
|
-
})), /*#__PURE__*/React__default['default'].createElement(
|
|
11508
|
+
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11509
|
+
id: "idmission-above-guides-content"
|
|
11510
|
+
}), /*#__PURE__*/React__default['default'].createElement(ExitCaptureButton, {
|
|
11501
11511
|
onClick: onExit,
|
|
11502
11512
|
className: (_j = classNames.capture) === null || _j === void 0 ? void 0 : _j.exitCaptureBtn
|
|
11503
11513
|
}), !overlayDismissed && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureLoadingOverlay, {
|
|
@@ -14251,25 +14261,27 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
14251
14261
|
skipIdCapture = _h === void 0 ? false : _h,
|
|
14252
14262
|
_j = _a.skipShowIdCardBack,
|
|
14253
14263
|
skipShowIdCardBack = _j === void 0 ? false : _j,
|
|
14254
|
-
_k = _a.
|
|
14255
|
-
|
|
14256
|
-
_l = _a.
|
|
14257
|
-
|
|
14258
|
-
_m = _a.
|
|
14259
|
-
|
|
14260
|
-
_o = _a.
|
|
14261
|
-
|
|
14262
|
-
_p = _a.
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
|
|
14264
|
+
_k = _a.skipSuccessScreen,
|
|
14265
|
+
skipSuccessScreen = _k === void 0 ? false : _k,
|
|
14266
|
+
_l = _a.assets,
|
|
14267
|
+
assets = _l === void 0 ? {} : _l,
|
|
14268
|
+
_m = _a.classNames,
|
|
14269
|
+
classNames = _m === void 0 ? {} : _m,
|
|
14270
|
+
_o = _a.colors,
|
|
14271
|
+
colors = _o === void 0 ? {} : _o,
|
|
14272
|
+
_p = _a.verbiage,
|
|
14273
|
+
verbiage = _p === void 0 ? {} : _p,
|
|
14274
|
+
_q = _a.debugMode,
|
|
14275
|
+
debugMode = _q === void 0 ? false : _q;
|
|
14276
|
+
var _r = React.useContext(SubmissionContext),
|
|
14277
|
+
submissionStatus = _r.submissionStatus,
|
|
14278
|
+
idCaptureVideoUrl = _r.idCaptureVideoUrl,
|
|
14279
|
+
setIdCaptureVideoUrl = _r.setIdCaptureVideoUrl,
|
|
14280
|
+
setIdCaptureVideoIdFrontImage = _r.setIdCaptureVideoIdFrontImage,
|
|
14281
|
+
setIdCaptureVideoIdBackImage = _r.setIdCaptureVideoIdBackImage;
|
|
14282
|
+
var _s = React.useState('CAPTURING_ID'),
|
|
14283
|
+
captureState = _s[0],
|
|
14284
|
+
setCaptureState = _s[1];
|
|
14273
14285
|
React.useEffect(function () {
|
|
14274
14286
|
if (skipIdCapture && captureState === 'CAPTURING_ID') setCaptureState('CHECKING_LIVENESS');
|
|
14275
14287
|
}, [captureState, skipIdCapture]);
|
|
@@ -14291,16 +14303,17 @@ var VideoIdWizard = function VideoIdWizard(_a) {
|
|
|
14291
14303
|
return tslib.__generator(this, function (_a) {
|
|
14292
14304
|
setIdCaptureVideoUrl(videoUrl);
|
|
14293
14305
|
setCaptureState('SUCCESS');
|
|
14306
|
+
if (skipSuccessScreen) onComplete === null || onComplete === void 0 ? void 0 : onComplete();
|
|
14294
14307
|
return [2 /*return*/];
|
|
14295
14308
|
});
|
|
14296
14309
|
});
|
|
14297
|
-
}, [setIdCaptureVideoUrl]);
|
|
14310
|
+
}, [onComplete, setIdCaptureVideoUrl, skipSuccessScreen]);
|
|
14298
14311
|
var onVideoCaptureFaceNotDetected = React.useCallback(function () {
|
|
14299
14312
|
setCaptureState('CHECKING_LIVENESS');
|
|
14300
14313
|
}, []);
|
|
14301
|
-
var
|
|
14302
|
-
attempt =
|
|
14303
|
-
setAttempt =
|
|
14314
|
+
var _t = React.useState(0),
|
|
14315
|
+
attempt = _t[0],
|
|
14316
|
+
setAttempt = _t[1];
|
|
14304
14317
|
var userSuppliedExitAfterFailure = onExitAfterFailure !== null && onExitAfterFailure !== void 0 ? onExitAfterFailure : faceLivenessProps.onExitAfterFailure;
|
|
14305
14318
|
var onFaceCaptureExitAfterFailure = React.useCallback(function (resp, req) {
|
|
14306
14319
|
userSuppliedExitAfterFailure === null || userSuppliedExitAfterFailure === void 0 ? void 0 : userSuppliedExitAfterFailure(resp, req);
|