idmission-web-sdk 1.0.310 → 1.0.311

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/sdk2.esm.js CHANGED
@@ -14,7 +14,7 @@ import i18n from 'i18next';
14
14
  import { createPortal } from 'react-dom';
15
15
  import SignatureCanvas from 'react-signature-canvas';
16
16
 
17
- var webSdkVersion = '1.0.310';
17
+ var webSdkVersion = '1.0.311';
18
18
 
19
19
  function getPlatform() {
20
20
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -15706,29 +15706,29 @@ var FlipImage = styled.img(templateObject_1$8 || (templateObject_1$8 = __makeTem
15706
15706
  var templateObject_1$8;
15707
15707
 
15708
15708
  var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
15709
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
15710
- var _u = _a.requestedAction,
15711
- requestedAction = _u === void 0 ? 'SHOW_ID_FRONT' : _u,
15712
- _v = _a.satisfied,
15713
- satisfied = _v === void 0 ? false : _v,
15709
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
15710
+ var _y = _a.requestedAction,
15711
+ requestedAction = _y === void 0 ? 'SHOW_ID_FRONT' : _y,
15712
+ _z = _a.satisfied,
15713
+ satisfied = _z === void 0 ? false : _z,
15714
15714
  faceGuideBorderWidth = _a.faceGuideBorderWidth,
15715
15715
  faceGuideBorderColor = _a.faceGuideBorderColor,
15716
15716
  idCardGuideBorderWidth = _a.idCardGuideBorderWidth,
15717
15717
  idCardGuideBorderColor = _a.idCardGuideBorderColor,
15718
- _w = _a.assets,
15719
- assets = _w === void 0 ? {} : _w,
15720
- _x = _a.classNames,
15721
- classNames = _x === void 0 ? {} : _x,
15722
- _y = _a.verbiage,
15723
- rawVerbiage = _y === void 0 ? {} : _y;
15718
+ _0 = _a.assets,
15719
+ assets = _0 === void 0 ? {} : _0,
15720
+ _1 = _a.classNames,
15721
+ classNames = _1 === void 0 ? {} : _1,
15722
+ _2 = _a.verbiage,
15723
+ rawVerbiage = _2 === void 0 ? {} : _2;
15724
15724
  var cameraRef = useContext(CameraStateContext).cameraRef;
15725
15725
  var imageRef = useRef(null);
15726
- var _z = useState(0),
15727
- imageWidth = _z[0],
15728
- setImageWidth = _z[1];
15729
- var _0 = useState(0),
15730
- imageHeight = _0[0],
15731
- setImageHeight = _0[1];
15726
+ var _3 = useState(0),
15727
+ imageWidth = _3[0],
15728
+ setImageWidth = _3[1];
15729
+ var _4 = useState(0),
15730
+ imageHeight = _4[0],
15731
+ setImageHeight = _4[1];
15732
15732
  assets.frontImageUrl || (assets.frontImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
15733
15733
  assets.backImageUrl || (assets.backImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
15734
15734
  var verbiage = useTranslations(rawVerbiage, {
@@ -15737,12 +15737,16 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
15737
15737
  flipIdInstructionText: 'Please flip your ID card...'
15738
15738
  });
15739
15739
  var instructionText = requestedAction === 'SHOW_ID_FRONT' ? verbiage.idFrontInstructionText : requestedAction === 'FLIP_ID' ? verbiage.flipIdInstructionText : verbiage.idBackInstructionText;
15740
- var idGuideWidth = typeof window !== 'undefined' && window.innerWidth > window.innerHeight ? '30%' : '75%';
15741
15740
  var theme = useTheme();
15742
15741
  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;
15743
15742
  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';
15744
15743
  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;
15745
15744
  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';
15745
+ var captureImageSize = function captureImageSize() {
15746
+ var _a, _b, _c, _d;
15747
+ if (!imageWidth) setImageWidth((_b = (_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0);
15748
+ if (!imageHeight) setImageHeight((_d = (_c = imageRef.current) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0);
15749
+ };
15746
15750
  return /*#__PURE__*/React__default.createElement(Container, {
15747
15751
  className: classNames.container
15748
15752
  }, /*#__PURE__*/React__default.createElement(FaceGuide, {
@@ -15750,12 +15754,13 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
15750
15754
  "$borderWidth": faceGuideBorderWidth,
15751
15755
  "$borderColor": faceGuideBorderColor
15752
15756
  }), /*#__PURE__*/React__default.createElement(IdCardGuideContainer, {
15753
- "$width": idGuideWidth,
15754
15757
  className: classNames.idCardGuideContainer
15755
15758
  }, /*#__PURE__*/React__default.createElement(IdCardGuideInstructionsContainer, {
15756
15759
  className: classNames.idCardGuideInstructionsContainer
15757
15760
  }, /*#__PURE__*/React__default.createElement(IdCardGuideInstructions, {
15758
- className: classNames.idCardGuideInstructions
15761
+ className: classNames.idCardGuideInstructions,
15762
+ "$textColor": (_u = (_t = theme.idVideoCapture) === null || _t === void 0 ? void 0 : _t.idCardGuides) === null || _u === void 0 ? void 0 : _u.instructionsTextColor,
15763
+ "$background": (_w = (_v = theme.idVideoCapture) === null || _v === void 0 ? void 0 : _v.idCardGuides) === null || _w === void 0 ? void 0 : _w.instructionsBackgroundColor
15759
15764
  }, instructionText)), /*#__PURE__*/React__default.createElement(IdCardGuideImageContainer, {
15760
15765
  "$borderWidth": idCardGuideBorderWidth,
15761
15766
  "$borderColor": idCardGuideBorderColor,
@@ -15771,30 +15776,25 @@ var IdVideoCaptureGuides = function IdVideoCaptureGuides(_a) {
15771
15776
  src: requestedAction === 'SHOW_ID_BACK' ? assets.backImageUrl : assets.frontImageUrl,
15772
15777
  alt: "",
15773
15778
  className: classNames.idCardGuideImage,
15774
- "$isMirrored": !((_t = cameraRef.current) === null || _t === void 0 ? void 0 : _t.isRearFacing),
15775
- onLoad: function onLoad() {
15776
- var _a, _b, _c, _d;
15777
- if (!imageWidth) setImageWidth((_b = (_a = imageRef.current) === null || _a === void 0 ? void 0 : _a.width) !== null && _b !== void 0 ? _b : 0);
15778
- if (!imageHeight) setImageHeight((_d = (_c = imageRef.current) === null || _c === void 0 ? void 0 : _c.height) !== null && _d !== void 0 ? _d : 0);
15779
- }
15779
+ "$isMirrored": !((_x = cameraRef.current) === null || _x === void 0 ? void 0 : _x.isRearFacing),
15780
+ onLoad: captureImageSize,
15781
+ onResize: captureImageSize
15780
15782
  })))));
15781
15783
  };
15782
15784
  var Container = styled.div(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n position: fixed;\n z-index: 1000;\n width: 100dvw;\n height: 100dvh;\n display: flex;\n flex-direction: column;\n font-family: ", ";\n"], ["\n position: fixed;\n z-index: 1000;\n width: 100dvw;\n height: 100dvh;\n display: flex;\n flex-direction: column;\n font-family: ", ";\n"])), function (props) {
15783
15785
  var _a;
15784
15786
  return (_a = props.theme) === null || _a === void 0 ? void 0 : _a.fontFamily;
15785
15787
  });
15786
- var FaceGuide = styled.div(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n border-width: ", "px;\n border-color: ", ";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 100%;\n min-height: 33dvh;\n margin: 4% auto auto;\n"], ["\n border-width: ", "px;\n border-color: ", ";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 100%;\n min-height: 33dvh;\n margin: 4% auto auto;\n"])), function (props) {
15788
+ var FaceGuide = styled.div(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n border-width: ", "px;\n border-color: ", ";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n min-height: 33dvh;\n margin: 4% auto auto;\n"], ["\n border-width: ", "px;\n border-color: ", ";\n border-style: solid;\n border-radius: 50%;\n aspect-ratio: 1 / 1.618;\n height: 50%;\n min-height: 33dvh;\n margin: 4% auto auto;\n"])), function (props) {
15787
15789
  var _a;
15788
15790
  return (_a = props.$borderWidth) !== null && _a !== void 0 ? _a : 0;
15789
15791
  }, function (props) {
15790
15792
  var _a;
15791
15793
  return (_a = props.$borderColor) !== null && _a !== void 0 ? _a : 'white';
15792
15794
  });
15793
- var IdCardGuideContainer = styled.div(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject(["\n width: ", ";\n display: flex;\n flex-flow: column nowrap;\n margin: 2% auto;\n"], ["\n width: ", ";\n display: flex;\n flex-flow: column nowrap;\n margin: 2% auto;\n"])), function (props) {
15794
- return props.$width;
15795
- });
15796
- var IdCardGuideInstructionsContainer = styled.div(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n width: 100%;\n flex-grow: 1;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n"], ["\n width: 100%;\n flex-grow: 1;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n"])));
15797
- var IdCardGuideInstructions = styled.span(templateObject_5$1 || (templateObject_5$1 = __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"])));
15795
+ var IdCardGuideContainer = styled.div(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject(["\n height: 50%;\n display: flex;\n flex-flow: column nowrap;\n margin: 2% auto;\n"], ["\n height: 50%;\n display: flex;\n flex-flow: column nowrap;\n margin: 2% auto;\n"])));
15796
+ var IdCardGuideInstructionsContainer = styled.div(templateObject_4$2 || (templateObject_4$2 = __makeTemplateObject(["\n width: 100%;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n"], ["\n width: 100%;\n text-align: center;\n color: white;\n display: flex;\n flex-direction: column;\n justify-content: end;\n"])));
15797
+ var IdCardGuideInstructions = styled(GuidanceMessage)(templateObject_5$1 || (templateObject_5$1 = __makeTemplateObject(["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n padding: 8px 12px;\n font-weight: bold;\n"], ["\n align-content: center;\n margin-top: 12px;\n margin-bottom: 12px;\n padding: 8px 12px;\n font-weight: bold;\n"])));
15798
15798
  var IdCardGuideImageContainer = styled.div(templateObject_6$1 || (templateObject_6$1 = __makeTemplateObject(["\n position: relative;\n border: ", "px solid\n ", ";\n"], ["\n position: relative;\n border: ", "px solid\n ", ";\n"])), function (props) {
15799
15799
  return props.$borderWidth;
15800
15800
  }, function (props) {