idmission-web-sdk 1.0.179 → 1.0.181

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.
@@ -12,6 +12,7 @@ export type IdCaptureFitGuideProps = {
12
12
  borderWidth?: number;
13
13
  padding?: number;
14
14
  imageUrl?: string;
15
+ imageVisible?: boolean;
15
16
  frontImageUrl?: string;
16
17
  backImageUrl?: string;
17
18
  isMirrored?: boolean;
@@ -19,4 +20,4 @@ export type IdCaptureFitGuideProps = {
19
20
  requestingFlip?: boolean;
20
21
  classNames?: IdCaptureFitGuideClassNames;
21
22
  };
22
- export declare const IdCaptureFitGuide: ({ aspectRatio, maskColor, borderRadius, borderColor, borderWidth, padding, imageUrl, frontImageUrl, backImageUrl, isMirrored, instruction, requestingFlip, classNames, }: IdCaptureFitGuideProps) => React.JSX.Element;
23
+ export declare const IdCaptureFitGuide: ({ aspectRatio, maskColor, borderRadius, borderColor, borderWidth, padding, imageUrl, imageVisible, frontImageUrl, backImageUrl, isMirrored, instruction, requestingFlip, classNames, }: IdCaptureFitGuideProps) => React.JSX.Element;
@@ -832,6 +832,7 @@ export declare const GuideImage: import("styled-components").IStyledComponent<"w
832
832
  $width?: number | undefined;
833
833
  $height?: number | undefined;
834
834
  $padding: number;
835
+ $visible?: boolean | undefined;
835
836
  }>>;
836
837
  export type IdCaptureGuideOverlayClassNames = {
837
838
  container?: string;
@@ -853,6 +854,7 @@ export type IdCaptureGuideOverlayProps = {
853
854
  height?: number;
854
855
  padding?: number;
855
856
  imagePadding?: number;
857
+ imageVisible?: boolean;
856
858
  borderWidth?: number;
857
859
  borderColor?: string;
858
860
  maskColor?: string;
@@ -862,4 +864,4 @@ export type IdCaptureGuideOverlayProps = {
862
864
  landscapeGuidesImageUrl?: string;
863
865
  onClick?: () => void;
864
866
  };
865
- export declare const IdCaptureGuideOverlay: ({ classNames, width, height, padding: userSuppliedPadding, imagePadding: userSuppliedImagePadding, borderWidth, borderColor, maskColor, isMirrored, instruction, portraitGuidesImageUrl, landscapeGuidesImageUrl, onClick, }: IdCaptureGuideOverlayProps) => ReactElement;
867
+ export declare const IdCaptureGuideOverlay: ({ classNames, width, height, padding: userSuppliedPadding, imagePadding: userSuppliedImagePadding, imageVisible, borderWidth, borderColor, maskColor, isMirrored, instruction, portraitGuidesImageUrl, landscapeGuidesImageUrl, onClick, }: IdCaptureGuideOverlayProps) => 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.179';
51
+ var webSdkVersion = '1.0.181';
52
52
 
53
53
  function getPlatform() {
54
54
  if (typeof window === 'undefined') return;
@@ -1659,9 +1659,6 @@ var useHighestResCaptureDevice = function useHighestResCaptureDevice(_a) {
1659
1659
  selectedCamera || (selectedCamera = availableCameras.find(function (deviceInfo) {
1660
1660
  return labelMatches(deviceInfo, 'backdualcamera');
1661
1661
  }));
1662
- selectedCamera || (selectedCamera = availableCameras.find(function (deviceInfo) {
1663
- return labelMatches(deviceInfo, 'backdualwidecamera');
1664
- }));
1665
1662
  // if (wideAngleIsBetter()) {
1666
1663
  // selectedCamera ||= availableCameras.find((deviceInfo) =>
1667
1664
  // labelMatches(deviceInfo, backUltraWideLabels),
@@ -10621,12 +10618,14 @@ var GuideCenterBorder = styled__default['default'].div(templateObject_6$2 || (te
10621
10618
  return "".concat((_a = props.$borderWidth) !== null && _a !== void 0 ? _a : 4, "px solid ").concat((_b = props.$borderColor) !== null && _b !== void 0 ? _b : 'white');
10622
10619
  });
10623
10620
  var GuideText = styled__default['default'].span(templateObject_7$1 || (templateObject_7$1 = tslib.__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"])));
10624
- var GuideImage = styled__default['default'].img(templateObject_8 || (templateObject_8 = tslib.__makeTemplateObject(["\n position: relative;\n z-index: 1;\n display: block;\n padding: ", "px;\n box-sizing: border-box;\n ", "\n ", "\n"], ["\n position: relative;\n z-index: 1;\n display: block;\n padding: ", "px;\n box-sizing: border-box;\n ", "\n ", "\n"])), function (props) {
10621
+ var GuideImage = styled__default['default'].img(templateObject_8 || (templateObject_8 = tslib.__makeTemplateObject(["\n position: relative;\n z-index: 1;\n display: block;\n padding: ", "px;\n box-sizing: border-box;\n ", "\n ", "\n opacity: ", ";\n transition: opacity 0.5s;\n"], ["\n position: relative;\n z-index: 1;\n display: block;\n padding: ", "px;\n box-sizing: border-box;\n ", "\n ", "\n opacity: ", ";\n transition: opacity 0.5s;\n"])), function (props) {
10625
10622
  return props.$padding;
10626
10623
  }, function (props) {
10627
10624
  return props.$width ? "width: ".concat(props.$width, "px;\n max-width: ").concat(props.$width, "px;") : "max-width: none;";
10628
10625
  }, function (props) {
10629
10626
  return props.$height ? "height: ".concat(props.$height, "px;\n max-height: ").concat(props.$height, "px;") : "max-height: none;";
10627
+ }, function (props) {
10628
+ return props.$visible ? 1 : 0;
10630
10629
  });
10631
10630
  var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
10632
10631
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
@@ -10638,27 +10637,29 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
10638
10637
  height = _r === void 0 ? 0 : _r,
10639
10638
  userSuppliedPadding = _a.padding,
10640
10639
  userSuppliedImagePadding = _a.imagePadding,
10640
+ _s = _a.imageVisible,
10641
+ imageVisible = _s === void 0 ? true : _s,
10641
10642
  borderWidth = _a.borderWidth,
10642
10643
  borderColor = _a.borderColor,
10643
10644
  maskColor = _a.maskColor,
10644
- _s = _a.isMirrored,
10645
- isMirrored = _s === void 0 ? false : _s,
10646
- _t = _a.instruction,
10647
- instruction = _t === void 0 ? '' : _t,
10645
+ _t = _a.isMirrored,
10646
+ isMirrored = _t === void 0 ? false : _t,
10647
+ _u = _a.instruction,
10648
+ instruction = _u === void 0 ? '' : _u,
10648
10649
  portraitGuidesImageUrl = _a.portraitGuidesImageUrl,
10649
10650
  landscapeGuidesImageUrl = _a.landscapeGuidesImageUrl,
10650
10651
  onClick = _a.onClick;
10651
- var _u = React.useContext(GuideOrientationContext),
10652
- orientation = _u.orientation,
10653
- wrapperRef = _u.wrapperRef,
10654
- wrapperWidth = _u.wrapperWidth,
10655
- wrapperHeight = _u.wrapperHeight,
10656
- imageAspectRatio = _u.imageAspectRatio,
10657
- wrapperAspectRatio = _u.wrapperAspectRatio,
10658
- guideOrientationOnImageLoaded = _u.onImageLoaded,
10659
- setDimensions = _u.setDimensions;
10660
- var _v = useIdCaptureState(),
10661
- dispatch = _v[1];
10652
+ var _v = React.useContext(GuideOrientationContext),
10653
+ orientation = _v.orientation,
10654
+ wrapperRef = _v.wrapperRef,
10655
+ wrapperWidth = _v.wrapperWidth,
10656
+ wrapperHeight = _v.wrapperHeight,
10657
+ imageAspectRatio = _v.imageAspectRatio,
10658
+ wrapperAspectRatio = _v.wrapperAspectRatio,
10659
+ guideOrientationOnImageLoaded = _v.onImageLoaded,
10660
+ setDimensions = _v.setDimensions;
10661
+ var _w = useIdCaptureState(),
10662
+ dispatch = _w[1];
10662
10663
  function onImageLoaded(e) {
10663
10664
  guideOrientationOnImageLoaded(e);
10664
10665
  var img = e.target;
@@ -10724,7 +10725,8 @@ var IdCaptureGuideOverlay = function IdCaptureGuideOverlay(_a) {
10724
10725
  className: classNames.image,
10725
10726
  "$width": imageWidth,
10726
10727
  "$height": imageHeight,
10727
- "$padding": imagePadding
10728
+ "$padding": imagePadding,
10729
+ "$visible": imageVisible
10728
10730
  }))), /*#__PURE__*/React__default['default'].createElement(GuideRegion, {
10729
10731
  "$maskColor": maskColor,
10730
10732
  "$minWidth": padding,
@@ -10902,6 +10904,7 @@ var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
10902
10904
  borderWidth = _a.borderWidth,
10903
10905
  padding = _a.padding,
10904
10906
  imageUrl = _a.imageUrl,
10907
+ imageVisible = _a.imageVisible,
10905
10908
  frontImageUrl = _a.frontImageUrl,
10906
10909
  backImageUrl = _a.backImageUrl,
10907
10910
  isMirrored = _a.isMirrored,
@@ -11021,7 +11024,8 @@ var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
11021
11024
  borderWidth: 0,
11022
11025
  isMirrored: isMirrored,
11023
11026
  instruction: instruction,
11024
- classNames: classNames
11027
+ classNames: classNames,
11028
+ imageVisible: imageVisible
11025
11029
  })));
11026
11030
  };
11027
11031
  var CanvasWrapper$1 = styled__default['default'].div(templateObject_1$k || (templateObject_1$k = tslib.__makeTemplateObject(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n z-index: -1;\n"], ["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n flex-grow: 1;\n background-clip: padding-box;\n box-shadow: inset 0 0 0 2px ", ";\n z-index: -1;\n"])), function (props) {
@@ -11071,7 +11075,8 @@ function IdCaptureGuides(_a) {
11071
11075
  portraitGuidesImageUrl: assets.portraitGuidesImageUrl,
11072
11076
  landscapeGuidesImageUrl: assets.landscapeGuidesImageUrl,
11073
11077
  isMirrored: !((_b = cameraRef.current) === null || _b === void 0 ? void 0 : _b.isRearFacing),
11074
- borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor
11078
+ borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
11079
+ imageVisible: requestingFlip || !state.documentDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
11075
11080
  })), guideType === 'fit' && ( /*#__PURE__*/React__default['default'].createElement(IdCaptureFitGuide, {
11076
11081
  classNames: classNames,
11077
11082
  requestingFlip: requestingFlip,
@@ -11080,7 +11085,8 @@ function IdCaptureGuides(_a) {
11080
11085
  frontImageUrl: frontImageUrl,
11081
11086
  backImageUrl: backImageUrl,
11082
11087
  isMirrored: !((_c = cameraRef.current) === null || _c === void 0 ? void 0 : _c.isRearFacing),
11083
- borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor
11088
+ borderColor: state.isGoodFrame ? colors.guideBoxSatisfiedColor : colors.guideBoxUnsatisfiedColor,
11089
+ imageVisible: requestingFlip || !state.documentDetectionThresholdMet || !state.documentInBounds || state.documentTooClose
11084
11090
  })));
11085
11091
  }
11086
11092