idmission-web-sdk 1.0.198 → 1.0.200
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/video_id/IdVideoCaptureFlipIdPrompt.d.ts +3 -1
- package/dist/components/video_id/IdVideoCaptureGuides.d.ts +6 -3
- package/dist/sdk2.cjs.development.js +61 -53
- 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 +61 -53
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +61 -53
- 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/themes/index.d.ts +10 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -10,8 +10,10 @@ export type IdVideoCaptureFlipIdPromptVerbiage = {
|
|
|
10
10
|
export type IdVideoCaptureFlipIdPromptProps = {
|
|
11
11
|
imageWidth?: number;
|
|
12
12
|
imageHeight?: number;
|
|
13
|
+
borderWidth?: number;
|
|
14
|
+
borderColor?: string;
|
|
13
15
|
style?: CSSProperties;
|
|
14
16
|
assets?: IdVideoCaptureFlipIdPromptAssets;
|
|
15
17
|
verbiage?: IdVideoCaptureFlipIdPromptVerbiage;
|
|
16
18
|
};
|
|
17
|
-
export declare const IdVideoCaptureFlipIdPrompt: ({ imageWidth, imageHeight, style, assets, verbiage, }: IdVideoCaptureFlipIdPromptProps) => ReactElement;
|
|
19
|
+
export declare const IdVideoCaptureFlipIdPrompt: ({ imageWidth, imageHeight, borderWidth, borderColor, style, assets, verbiage, }: IdVideoCaptureFlipIdPromptProps) => ReactElement;
|
|
@@ -11,10 +11,13 @@ export type IdVideoCaptureGuidesVerbiage = {
|
|
|
11
11
|
flipIdInstructionText?: CustomerSuppliedVerbiage;
|
|
12
12
|
};
|
|
13
13
|
export type IdVideoCaptureGuidesProps = {
|
|
14
|
-
borderWidth?: number;
|
|
15
|
-
borderColor?: string;
|
|
16
14
|
requestedAction?: Action;
|
|
15
|
+
satisfied?: boolean;
|
|
16
|
+
faceGuideBorderWidth?: number;
|
|
17
|
+
faceGuideBorderColor?: string;
|
|
18
|
+
idCardGuideBorderWidth?: number;
|
|
19
|
+
idCardGuideBorderColor?: string;
|
|
17
20
|
assets?: IdVideoCaptureGuidesAssets;
|
|
18
21
|
verbiage?: IdVideoCaptureGuidesVerbiage;
|
|
19
22
|
};
|
|
20
|
-
export declare const IdVideoCaptureGuides: ({ requestedAction,
|
|
23
|
+
export declare const IdVideoCaptureGuides: ({ requestedAction, satisfied, faceGuideBorderWidth, faceGuideBorderColor, idCardGuideBorderWidth, idCardGuideBorderColor, assets, verbiage: rawVerbiage, }: IdVideoCaptureGuidesProps) => ReactElement;
|
|
@@ -48,7 +48,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
|
|
|
48
48
|
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
49
49
|
var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
|
|
50
50
|
|
|
51
|
-
var webSdkVersion = '1.0.
|
|
51
|
+
var webSdkVersion = '1.0.200';
|
|
52
52
|
|
|
53
53
|
function getPlatform() {
|
|
54
54
|
if (typeof window === 'undefined') return;
|
|
@@ -13639,44 +13639,41 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
|
|
|
13639
13639
|
var _b;
|
|
13640
13640
|
var imageWidth = _a.imageWidth,
|
|
13641
13641
|
imageHeight = _a.imageHeight,
|
|
13642
|
-
_c = _a.
|
|
13643
|
-
|
|
13644
|
-
_d = _a.
|
|
13645
|
-
|
|
13646
|
-
_e = _a.
|
|
13647
|
-
|
|
13648
|
-
|
|
13649
|
-
|
|
13650
|
-
_g =
|
|
13651
|
-
|
|
13652
|
-
|
|
13653
|
-
|
|
13642
|
+
_c = _a.borderWidth,
|
|
13643
|
+
borderWidth = _c === void 0 ? 4 : _c,
|
|
13644
|
+
_d = _a.borderColor,
|
|
13645
|
+
borderColor = _d === void 0 ? 'white' : _d,
|
|
13646
|
+
_e = _a.style,
|
|
13647
|
+
style = _e === void 0 ? {} : _e,
|
|
13648
|
+
_f = _a.assets,
|
|
13649
|
+
assets = _f === void 0 ? {} : _f,
|
|
13650
|
+
_g = _a.verbiage,
|
|
13651
|
+
verbiage = _g === void 0 ? {} : _g;
|
|
13652
|
+
var _h = useResizeObserver__default['default'](),
|
|
13653
|
+
ref = _h.ref,
|
|
13654
|
+
_j = _h.width,
|
|
13655
|
+
width = _j === void 0 ? 1 : _j,
|
|
13656
|
+
_k = _h.height,
|
|
13657
|
+
height = _k === void 0 ? 1 : _k;
|
|
13654
13658
|
var cameraRef = React.useContext(CameraStateContext).cameraRef;
|
|
13655
13659
|
assets.frontImageUrl || (assets.frontImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
13656
13660
|
assets.backImageUrl || (assets.backImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
|
|
13657
13661
|
var instructionText = useVerbiage(verbiage.instructionText, 'Please flip your ID card...');
|
|
13658
13662
|
var padding = 0;
|
|
13659
|
-
var borderWidth = 4;
|
|
13660
|
-
var borderColor = 'white';
|
|
13661
13663
|
var isMirrored = !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing);
|
|
13662
13664
|
// const [imageLoaded, setImageLoaded] = useState(false)
|
|
13663
13665
|
var onImageLoaded = React.useCallback(function () {
|
|
13664
13666
|
// setImageLoaded(true)
|
|
13665
13667
|
}, []);
|
|
13666
13668
|
var imageStyle = {
|
|
13667
|
-
|
|
13668
|
-
};
|
|
13669
|
-
// if (imageAspectRatio >= wrapperAspectRatio) {
|
|
13670
|
-
imageStyle = {
|
|
13671
|
-
width: width - padding * 2 - borderWidth * 2
|
|
13669
|
+
width: width - padding * 2
|
|
13672
13670
|
};
|
|
13673
|
-
|
|
13674
|
-
|
|
13675
|
-
|
|
13676
|
-
|
|
13677
|
-
|
|
13678
|
-
|
|
13679
|
-
setRotationAngle = _k[1];
|
|
13671
|
+
var _l = React.useState(1),
|
|
13672
|
+
transitionTime = _l[0],
|
|
13673
|
+
setTransitionTime = _l[1];
|
|
13674
|
+
var _m = React.useState(0),
|
|
13675
|
+
rotationAngle = _m[0],
|
|
13676
|
+
setRotationAngle = _m[1];
|
|
13680
13677
|
var frontTransforms = ["rotateY(".concat(rotationAngle, "deg)")];
|
|
13681
13678
|
if (isMirrored) frontTransforms.push('scaleX(-1)');
|
|
13682
13679
|
var backTransforms = ["rotateY(".concat(180 - rotationAngle, "deg)")];
|
|
@@ -13699,7 +13696,8 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
|
|
|
13699
13696
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13700
13697
|
ref: ref,
|
|
13701
13698
|
style: tslib.__assign(tslib.__assign({}, style), {
|
|
13702
|
-
position: 'relative'
|
|
13699
|
+
position: 'relative',
|
|
13700
|
+
top: -5
|
|
13703
13701
|
})
|
|
13704
13702
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13705
13703
|
style: {
|
|
@@ -13732,7 +13730,7 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
|
|
|
13732
13730
|
alignItems: 'center',
|
|
13733
13731
|
justifyItems: 'center',
|
|
13734
13732
|
maxWidth: "calc(100%)",
|
|
13735
|
-
maxHeight: "calc(100% - ".concat(padding * 2, "px
|
|
13733
|
+
maxHeight: "calc(100% - ".concat(padding * 2, "px)")
|
|
13736
13734
|
}
|
|
13737
13735
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13738
13736
|
style: {
|
|
@@ -13809,25 +13807,27 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
|
|
|
13809
13807
|
};
|
|
13810
13808
|
|
|
13811
13809
|
var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
13812
|
-
var _b;
|
|
13813
|
-
var
|
|
13814
|
-
requestedAction =
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
|
|
13821
|
-
|
|
13822
|
-
|
|
13810
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
13811
|
+
var _u = _a.requestedAction,
|
|
13812
|
+
requestedAction = _u === void 0 ? 'SHOW_ID_FRONT' : _u,
|
|
13813
|
+
_v = _a.satisfied,
|
|
13814
|
+
satisfied = _v === void 0 ? false : _v,
|
|
13815
|
+
faceGuideBorderWidth = _a.faceGuideBorderWidth,
|
|
13816
|
+
faceGuideBorderColor = _a.faceGuideBorderColor,
|
|
13817
|
+
idCardGuideBorderWidth = _a.idCardGuideBorderWidth,
|
|
13818
|
+
idCardGuideBorderColor = _a.idCardGuideBorderColor,
|
|
13819
|
+
_w = _a.assets,
|
|
13820
|
+
assets = _w === void 0 ? {} : _w,
|
|
13821
|
+
_x = _a.verbiage,
|
|
13822
|
+
rawVerbiage = _x === void 0 ? {} : _x;
|
|
13823
13823
|
var cameraRef = React.useContext(CameraStateContext).cameraRef;
|
|
13824
13824
|
var imageRef = React.useRef(null);
|
|
13825
|
-
var
|
|
13826
|
-
imageWidth =
|
|
13827
|
-
setImageWidth =
|
|
13828
|
-
var
|
|
13829
|
-
imageHeight =
|
|
13830
|
-
setImageHeight =
|
|
13825
|
+
var _y = React.useState(0),
|
|
13826
|
+
imageWidth = _y[0],
|
|
13827
|
+
setImageWidth = _y[1];
|
|
13828
|
+
var _z = React.useState(0),
|
|
13829
|
+
imageHeight = _z[0],
|
|
13830
|
+
setImageHeight = _z[1];
|
|
13831
13831
|
assets.frontImageUrl || (assets.frontImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
|
|
13832
13832
|
assets.backImageUrl || (assets.backImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
|
|
13833
13833
|
var verbiage = useTranslations(rawVerbiage, {
|
|
@@ -13836,6 +13836,11 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
|
13836
13836
|
});
|
|
13837
13837
|
var instructionText = requestedAction === 'SHOW_ID_FRONT' ? verbiage.idFrontInstructionText : verbiage.idBackInstructionText;
|
|
13838
13838
|
var idGuideWidth = typeof window !== 'undefined' && window.innerWidth > window.innerHeight ? '30%' : '75%';
|
|
13839
|
+
var theme = styled.useTheme();
|
|
13840
|
+
if (faceGuideBorderWidth === undefined) faceGuideBorderWidth = (_d = (_c = (_b = theme.idVideoCapture) === null || _b === void 0 ? void 0 : _b.faceGuides) === null || _c === void 0 ? void 0 : _c.borderWidth) !== null && _d !== void 0 ? _d : 4;
|
|
13841
|
+
if (faceGuideBorderColor === undefined) faceGuideBorderColor = (_j = satisfied ? (_f = (_e = theme.idVideoCapture) === null || _e === void 0 ? void 0 : _e.faceGuides) === null || _f === void 0 ? void 0 : _f.satisfiedColor : (_h = (_g = theme.idVideoCapture) === null || _g === void 0 ? void 0 : _g.faceGuides) === null || _h === void 0 ? void 0 : _h.unsatisfiedColor) !== null && _j !== void 0 ? _j : 'white';
|
|
13842
|
+
if (idCardGuideBorderWidth === undefined) idCardGuideBorderWidth = (_m = (_l = (_k = theme.idVideoCapture) === null || _k === void 0 ? void 0 : _k.idCardGuides) === null || _l === void 0 ? void 0 : _l.borderWidth) !== null && _m !== void 0 ? _m : 4;
|
|
13843
|
+
if (idCardGuideBorderColor === undefined) idCardGuideBorderColor = (_s = satisfied ? (_p = (_o = theme.idVideoCapture) === null || _o === void 0 ? void 0 : _o.idCardGuides) === null || _p === void 0 ? void 0 : _p.satisfiedColor : (_r = (_q = theme.idVideoCapture) === null || _q === void 0 ? void 0 : _q.idCardGuides) === null || _r === void 0 ? void 0 : _r.unsatisfiedColor) !== null && _s !== void 0 ? _s : 'white';
|
|
13839
13844
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13840
13845
|
style: {
|
|
13841
13846
|
position: 'absolute',
|
|
@@ -13847,8 +13852,8 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
|
13847
13852
|
}
|
|
13848
13853
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13849
13854
|
style: {
|
|
13850
|
-
borderWidth:
|
|
13851
|
-
borderColor:
|
|
13855
|
+
borderWidth: faceGuideBorderWidth,
|
|
13856
|
+
borderColor: faceGuideBorderColor,
|
|
13852
13857
|
borderStyle: 'solid',
|
|
13853
13858
|
borderRadius: '50%',
|
|
13854
13859
|
aspectRatio: '1 / 1.618',
|
|
@@ -13862,6 +13867,8 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
|
13862
13867
|
},
|
|
13863
13868
|
imageWidth: imageWidth,
|
|
13864
13869
|
imageHeight: imageHeight,
|
|
13870
|
+
borderWidth: idCardGuideBorderWidth,
|
|
13871
|
+
borderColor: idCardGuideBorderColor,
|
|
13865
13872
|
style: {
|
|
13866
13873
|
width: idGuideWidth,
|
|
13867
13874
|
margin: '2% auto 2%'
|
|
@@ -13892,13 +13899,13 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
|
|
|
13892
13899
|
}
|
|
13893
13900
|
}, instructionText)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
13894
13901
|
style: {
|
|
13895
|
-
border: "
|
|
13902
|
+
border: "".concat(idCardGuideBorderWidth, "px solid ").concat(idCardGuideBorderColor)
|
|
13896
13903
|
}
|
|
13897
13904
|
}, /*#__PURE__*/React__default['default'].createElement(GuideImage, {
|
|
13898
13905
|
ref: imageRef,
|
|
13899
13906
|
src: requestedAction === 'SHOW_ID_BACK' ? assets.backImageUrl : assets.frontImageUrl,
|
|
13900
13907
|
alt: "",
|
|
13901
|
-
"$isMirrored": !((
|
|
13908
|
+
"$isMirrored": !((_t = cameraRef.current) === null || _t === void 0 ? void 0 : _t.isRearFacing),
|
|
13902
13909
|
onLoad: function onLoad() {
|
|
13903
13910
|
var _a, _b, _c, _d;
|
|
13904
13911
|
if (!imageWidth) setImageWidth((_b = (_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0);
|
|
@@ -14164,6 +14171,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14164
14171
|
switch (_a.label) {
|
|
14165
14172
|
case 0:
|
|
14166
14173
|
if (!satisfied) return [3 /*break*/, 5];
|
|
14174
|
+
setDetectedObjects([]);
|
|
14167
14175
|
setCurrentDetectionScore(0);
|
|
14168
14176
|
setCurrentFocusScore(0);
|
|
14169
14177
|
setGoodFramesCount(0);
|
|
@@ -14225,8 +14233,6 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14225
14233
|
onFaceNotDetected === null || onFaceNotDetected === void 0 ? void 0 : onFaceNotDetected();
|
|
14226
14234
|
}
|
|
14227
14235
|
}, [numFramesWithoutFaces, onFaceNotDetected]);
|
|
14228
|
-
colors.guidesSatisfiedColor || (colors.guidesSatisfiedColor = 'green');
|
|
14229
|
-
colors.guidesUnsatisfiedColor || (colors.guidesUnsatisfiedColor = 'white');
|
|
14230
14236
|
var theme = styled.useTheme();
|
|
14231
14237
|
var faceNotCenteredText = useTranslations(rawVerbiage, {
|
|
14232
14238
|
faceNotCenteredText: 'Please move your face to the center...'
|
|
@@ -14256,7 +14262,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
|
|
|
14256
14262
|
assets: assets.guides,
|
|
14257
14263
|
verbiage: rawVerbiage.guides,
|
|
14258
14264
|
requestedAction: requestedAction,
|
|
14259
|
-
|
|
14265
|
+
satisfied: satisfied,
|
|
14266
|
+
faceGuideBorderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor,
|
|
14267
|
+
idCardGuideBorderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor
|
|
14260
14268
|
}), debugMode && ['SHOW_ID_FRONT', 'SHOW_ID_BACK'].includes(requestedAction) && ( /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ObjectDetectionDebugOverlayDiv, {
|
|
14261
14269
|
"$flipX": !((_m = cameraRef.current) === null || _m === void 0 ? void 0 : _m.isRearFacing)
|
|
14262
14270
|
}, detectedObjects.map(function (obj, i) {
|