idmission-web-sdk 2.3.25 → 2.3.26

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.
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.3.25';
214
+ var webSdkVersion = '2.3.26';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -17054,10 +17054,12 @@
17054
17054
  canvas.style.height = '0';
17055
17055
  }
17056
17056
 
17057
- var IdCardGuideImageContainer = styled(IdCardBorder)(templateObject_1$A || (templateObject_1$A = __makeTemplateObject(["\n position: relative;\n ", "\n box-sizing: border-box;\n"], ["\n position: relative;\n ", "\n box-sizing: border-box;\n"])), function (props) {
17057
+ var IdCardGuideImageContainer = styled(IdCardBorder)(templateObject_1$A || (templateObject_1$A = __makeTemplateObject(["\n position: relative;\n ", "\n box-sizing: border-box;\n aspect-ratio: ", ";\n display: flex;\n"], ["\n position: relative;\n ", "\n box-sizing: border-box;\n aspect-ratio: ", ";\n display: flex;\n"])), function (props) {
17058
17058
  return props.$isVisible ? '' : 'opacity: 0;';
17059
+ }, function (props) {
17060
+ return props.$aspectRatio;
17059
17061
  });
17060
- var IdCardGuideImage = styled.img(templateObject_2$t || (templateObject_2$t = __makeTemplateObject(["\n transform-style: preserve-3d;\n ", "\n ", "\n"], ["\n transform-style: preserve-3d;\n ", "\n ", "\n"])), function (props) {
17062
+ var IdCardGuideImage = styled.img(templateObject_2$t || (templateObject_2$t = __makeTemplateObject(["\n transform-style: preserve-3d;\n ", "\n ", "\n max-width: 100%;\n max-height: 100%;\n"], ["\n transform-style: preserve-3d;\n ", "\n ", "\n max-width: 100%;\n max-height: 100%;\n"])), function (props) {
17061
17063
  return props.$isMirrored ? 'transform: scaleX(-1);' : '';
17062
17064
  }, function (props) {
17063
17065
  return props.$isInvisible ? 'opacity: 0;' : '';
@@ -17587,10 +17589,16 @@
17587
17589
  var imagesByUrl = useGuideImagesByUrl(images);
17588
17590
  var orientation = getOrientation(portraitGuidesOnMobile);
17589
17591
  var currentImage = images[orientation][requestedAction === 'FLIP_ID' ? 'SHOW_ID_FRONT' : requestedAction];
17590
- var imagePadding = (_o = userSuppliedImagePadding !== null && userSuppliedImagePadding !== void 0 ? userSuppliedImagePadding : (_m = (_l = theme.idCapture) === null || _l === void 0 ? void 0 : _l.guideBox) === null || _m === void 0 ? void 0 : _m.imagePadding) !== null && _o !== void 0 ? _o : 50;
17591
- var imageWidth = state.guideRectWidth - imagePadding * 2;
17592
- var imageHeight = state.guideRectHeight - imagePadding * 2;
17592
+ var imagePadding = (_o = userSuppliedImagePadding !== null && userSuppliedImagePadding !== void 0 ? userSuppliedImagePadding : (_m = (_l = theme.idCapture) === null || _l === void 0 ? void 0 : _l.guideBox) === null || _m === void 0 ? void 0 : _m.imagePadding) !== null && _o !== void 0 ? _o : '0 50px';
17593
+ if (typeof imagePadding === 'number') {
17594
+ imagePadding = "".concat(imagePadding, "px");
17595
+ }
17596
+ var paddingForMath = imagePadding.replace(/[^0-9\s]/g, '').split(' ').map(Number);
17597
+ var paddingForMathMax = Math.max.apply(Math, paddingForMath);
17598
+ var imageWidth = state.guideRectWidth - paddingForMathMax * 2;
17599
+ var imageHeight = state.guideRectHeight - paddingForMathMax * 2;
17593
17600
  var centerRegionMinWidth = imageAspectRatio >= wrapperAspectRatio ? wrapperWidth - paddingAndBorderPx : undefined;
17601
+ var cardAspectRatio = orientation === 'landscape' ? '16/10' : '10/16';
17594
17602
  var onImageLoaded = React.useCallback(function (e) {
17595
17603
  var _a, _b;
17596
17604
  guideOrientationOnImageLoaded(e);
@@ -17640,7 +17648,8 @@
17640
17648
  progress: progress,
17641
17649
  borderWidth: idCardBorderWidth,
17642
17650
  borderColor: idCardBorderColor,
17643
- "$isVisible": requestedAction !== 'FLIP_ID'
17651
+ "$isVisible": requestedAction !== 'FLIP_ID',
17652
+ "$aspectRatio": cardAspectRatio
17644
17653
  }, /*#__PURE__*/React.createElement(IdCardGuideImage, {
17645
17654
  alt: "",
17646
17655
  src: currentImage.url,
@@ -17702,7 +17711,7 @@
17702
17711
  var _a, _b;
17703
17712
  return "".concat((_a = props.$borderWidth) !== null && _a !== void 0 ? _a : 4, "px solid ").concat((_b = props.$borderColor) !== null && _b !== void 0 ? _b : 'white');
17704
17713
  }, function (props) {
17705
- return props.$padding ? "padding: ".concat(props.$padding, "px;") : '';
17714
+ return props.$padding ? "padding: ".concat(props.$padding, ";") : '';
17706
17715
  });
17707
17716
  var GuideText = styled.span(templateObject_8$2 || (templateObject_8$2 = __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"])));
17708
17717
  var GuideCenterInner = styled.div(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject(["\n position: relative;\n margin: auto;\n"], ["\n position: relative;\n margin: auto;\n"])));
@@ -25606,7 +25615,7 @@
25606
25615
  borderWidth: 4,
25607
25616
  desktopPadding: 50,
25608
25617
  mobilePadding: 0,
25609
- imagePadding: 50,
25618
+ imagePadding: '0 50px',
25610
25619
  wavesDisabled: false,
25611
25620
  wavesColor: '#287ec6',
25612
25621
  progressBarColor: 'white',