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.
package/dist/sdk2.esm.js CHANGED
@@ -204,7 +204,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
204
204
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
205
205
  };
206
206
 
207
- var webSdkVersion = '2.3.25';
207
+ var webSdkVersion = '2.3.26';
208
208
 
209
209
  function getPlatform() {
210
210
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -7916,10 +7916,12 @@ function resetCanvasDimensions(canvas) {
7916
7916
  canvas.style.height = '0';
7917
7917
  }
7918
7918
 
7919
- 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) {
7919
+ 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) {
7920
7920
  return props.$isVisible ? '' : 'opacity: 0;';
7921
+ }, function (props) {
7922
+ return props.$aspectRatio;
7921
7923
  });
7922
- 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) {
7924
+ 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) {
7923
7925
  return props.$isMirrored ? 'transform: scaleX(-1);' : '';
7924
7926
  }, function (props) {
7925
7927
  return props.$isInvisible ? 'opacity: 0;' : '';
@@ -8449,10 +8451,16 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8449
8451
  var imagesByUrl = useGuideImagesByUrl(images);
8450
8452
  var orientation = getOrientation(portraitGuidesOnMobile);
8451
8453
  var currentImage = images[orientation][requestedAction === 'FLIP_ID' ? 'SHOW_ID_FRONT' : requestedAction];
8452
- 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;
8453
- var imageWidth = state.guideRectWidth - imagePadding * 2;
8454
- var imageHeight = state.guideRectHeight - imagePadding * 2;
8454
+ 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';
8455
+ if (typeof imagePadding === 'number') {
8456
+ imagePadding = "".concat(imagePadding, "px");
8457
+ }
8458
+ var paddingForMath = imagePadding.replace(/[^0-9\s]/g, '').split(' ').map(Number);
8459
+ var paddingForMathMax = Math.max.apply(Math, paddingForMath);
8460
+ var imageWidth = state.guideRectWidth - paddingForMathMax * 2;
8461
+ var imageHeight = state.guideRectHeight - paddingForMathMax * 2;
8455
8462
  var centerRegionMinWidth = imageAspectRatio >= wrapperAspectRatio ? wrapperWidth - paddingAndBorderPx : undefined;
8463
+ var cardAspectRatio = orientation === 'landscape' ? '16/10' : '10/16';
8456
8464
  var onImageLoaded = useCallback(function (e) {
8457
8465
  var _a, _b;
8458
8466
  guideOrientationOnImageLoaded(e);
@@ -8502,7 +8510,8 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
8502
8510
  progress: progress,
8503
8511
  borderWidth: idCardBorderWidth,
8504
8512
  borderColor: idCardBorderColor,
8505
- "$isVisible": requestedAction !== 'FLIP_ID'
8513
+ "$isVisible": requestedAction !== 'FLIP_ID',
8514
+ "$aspectRatio": cardAspectRatio
8506
8515
  }, /*#__PURE__*/React__default.createElement(IdCardGuideImage, {
8507
8516
  alt: "",
8508
8517
  src: currentImage.url,
@@ -8564,7 +8573,7 @@ var GuideCenterBorder = styled.div(templateObject_7$4 || (templateObject_7$4 = _
8564
8573
  var _a, _b;
8565
8574
  return "".concat((_a = props.$borderWidth) !== null && _a !== void 0 ? _a : 4, "px solid ").concat((_b = props.$borderColor) !== null && _b !== void 0 ? _b : 'white');
8566
8575
  }, function (props) {
8567
- return props.$padding ? "padding: ".concat(props.$padding, "px;") : '';
8576
+ return props.$padding ? "padding: ".concat(props.$padding, ";") : '';
8568
8577
  });
8569
8578
  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"])));
8570
8579
  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"])));
@@ -15700,7 +15709,7 @@ var defaultTheme = {
15700
15709
  borderWidth: 4,
15701
15710
  desktopPadding: 50,
15702
15711
  mobilePadding: 0,
15703
- imagePadding: 50,
15712
+ imagePadding: '0 50px',
15704
15713
  wavesDisabled: false,
15705
15714
  wavesColor: '#287ec6',
15706
15715
  progressBarColor: 'white',