idmission-web-sdk 1.0.199 → 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.
@@ -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, borderWidth, borderColor, assets, verbiage: rawVerbiage, }: IdVideoCaptureGuidesProps) => ReactElement;
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.199';
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.style,
13643
- style = _c === void 0 ? {} : _c,
13644
- _d = _a.assets,
13645
- assets = _d === void 0 ? {} : _d,
13646
- _e = _a.verbiage,
13647
- verbiage = _e === void 0 ? {} : _e;
13648
- var _f = useResizeObserver__default['default'](),
13649
- ref = _f.ref,
13650
- _g = _f.width,
13651
- width = _g === void 0 ? 1 : _g,
13652
- _h = _f.height,
13653
- height = _h === void 0 ? 1 : _h;
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
- height: height - padding * 2 - borderWidth * 2
13668
- };
13669
- // if (imageAspectRatio >= wrapperAspectRatio) {
13670
- imageStyle = {
13671
- width: width - padding * 2 - borderWidth * 2
13669
+ width: width - padding * 2
13672
13670
  };
13673
- // }
13674
- var _j = React.useState(1),
13675
- transitionTime = _j[0],
13676
- setTransitionTime = _j[1];
13677
- var _k = React.useState(0),
13678
- rotationAngle = _k[0],
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 - ").concat(borderWidth * 2, "px)")
13733
+ maxHeight: "calc(100% - ".concat(padding * 2, "px)")
13736
13734
  }
13737
13735
  }, /*#__PURE__*/React__default['default'].createElement("div", {
13738
13736
  style: {
@@ -13809,24 +13807,27 @@ var IdVideoCaptureFlipIdPrompt = function IdVideoCaptureFlipIdPrompt(_a) {
13809
13807
  };
13810
13808
 
13811
13809
  var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
13812
- var _b, _c, _d, _e;
13813
- var _f = _a.requestedAction,
13814
- requestedAction = _f === void 0 ? 'SHOW_ID_FRONT' : _f,
13815
- borderWidth = _a.borderWidth,
13816
- _g = _a.borderColor,
13817
- borderColor = _g === void 0 ? 'white' : _g,
13818
- _h = _a.assets,
13819
- assets = _h === void 0 ? {} : _h,
13820
- _j = _a.verbiage,
13821
- rawVerbiage = _j === void 0 ? {} : _j;
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;
13822
13823
  var cameraRef = React.useContext(CameraStateContext).cameraRef;
13823
13824
  var imageRef = React.useRef(null);
13824
- var _k = React.useState(0),
13825
- imageWidth = _k[0],
13826
- setImageWidth = _k[1];
13827
- var _l = React.useState(0),
13828
- imageHeight = _l[0],
13829
- setImageHeight = _l[1];
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];
13830
13831
  assets.frontImageUrl || (assets.frontImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
13831
13832
  assets.backImageUrl || (assets.backImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
13832
13833
  var verbiage = useTranslations(rawVerbiage, {
@@ -13836,7 +13837,10 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
13836
13837
  var instructionText = requestedAction === 'SHOW_ID_FRONT' ? verbiage.idFrontInstructionText : verbiage.idBackInstructionText;
13837
13838
  var idGuideWidth = typeof window !== 'undefined' && window.innerWidth > window.innerHeight ? '30%' : '75%';
13838
13839
  var theme = styled.useTheme();
13839
- if (borderWidth === undefined) borderWidth = (_d = (_c = (_b = theme.idVideoCapture) === null || _b === void 0 ? void 0 : _b.idCardGuides) === null || _c === void 0 ? void 0 : _c.borderWidth) !== null && _d !== void 0 ? _d : 4;
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';
13840
13844
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
13841
13845
  style: {
13842
13846
  position: 'absolute',
@@ -13848,8 +13852,8 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
13848
13852
  }
13849
13853
  }, /*#__PURE__*/React__default['default'].createElement("div", {
13850
13854
  style: {
13851
- borderWidth: borderWidth,
13852
- borderColor: borderColor,
13855
+ borderWidth: faceGuideBorderWidth,
13856
+ borderColor: faceGuideBorderColor,
13853
13857
  borderStyle: 'solid',
13854
13858
  borderRadius: '50%',
13855
13859
  aspectRatio: '1 / 1.618',
@@ -13863,6 +13867,8 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
13863
13867
  },
13864
13868
  imageWidth: imageWidth,
13865
13869
  imageHeight: imageHeight,
13870
+ borderWidth: idCardGuideBorderWidth,
13871
+ borderColor: idCardGuideBorderColor,
13866
13872
  style: {
13867
13873
  width: idGuideWidth,
13868
13874
  margin: '2% auto 2%'
@@ -13893,13 +13899,13 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
13893
13899
  }
13894
13900
  }, instructionText)), /*#__PURE__*/React__default['default'].createElement("div", {
13895
13901
  style: {
13896
- border: "4px solid ".concat(borderColor)
13902
+ border: "".concat(idCardGuideBorderWidth, "px solid ").concat(idCardGuideBorderColor)
13897
13903
  }
13898
13904
  }, /*#__PURE__*/React__default['default'].createElement(GuideImage, {
13899
13905
  ref: imageRef,
13900
13906
  src: requestedAction === 'SHOW_ID_BACK' ? assets.backImageUrl : assets.frontImageUrl,
13901
13907
  alt: "",
13902
- "$isMirrored": !((_e = cameraRef.current) === null || _e === void 0 ? void 0 : _e.isRearFacing),
13908
+ "$isMirrored": !((_t = cameraRef.current) === null || _t === void 0 ? void 0 : _t.isRearFacing),
13903
13909
  onLoad: function onLoad() {
13904
13910
  var _a, _b, _c, _d;
13905
13911
  if (!imageWidth) setImageWidth((_b = (_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0);
@@ -14165,6 +14171,7 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14165
14171
  switch (_a.label) {
14166
14172
  case 0:
14167
14173
  if (!satisfied) return [3 /*break*/, 5];
14174
+ setDetectedObjects([]);
14168
14175
  setCurrentDetectionScore(0);
14169
14176
  setCurrentFocusScore(0);
14170
14177
  setGoodFramesCount(0);
@@ -14226,8 +14233,6 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14226
14233
  onFaceNotDetected === null || onFaceNotDetected === void 0 ? void 0 : onFaceNotDetected();
14227
14234
  }
14228
14235
  }, [numFramesWithoutFaces, onFaceNotDetected]);
14229
- colors.guidesSatisfiedColor || (colors.guidesSatisfiedColor = 'green');
14230
- colors.guidesUnsatisfiedColor || (colors.guidesUnsatisfiedColor = 'white');
14231
14236
  var theme = styled.useTheme();
14232
14237
  var faceNotCenteredText = useTranslations(rawVerbiage, {
14233
14238
  faceNotCenteredText: 'Please move your face to the center...'
@@ -14257,7 +14262,9 @@ var IdVideoCapture = function IdVideoCapture(_a) {
14257
14262
  assets: assets.guides,
14258
14263
  verbiage: rawVerbiage.guides,
14259
14264
  requestedAction: requestedAction,
14260
- borderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor
14265
+ satisfied: satisfied,
14266
+ faceGuideBorderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor,
14267
+ idCardGuideBorderColor: satisfied ? colors.guidesSatisfiedColor : colors.guidesUnsatisfiedColor
14261
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, {
14262
14269
  "$flipX": !((_m = cameraRef.current) === null || _m === void 0 ? void 0 : _m.isRearFacing)
14263
14270
  }, detectedObjects.map(function (obj, i) {