idmission-web-sdk 1.0.270 → 1.0.272

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.
@@ -51,7 +51,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
51
51
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
52
52
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
53
53
 
54
- var webSdkVersion = '1.0.270';
54
+ var webSdkVersion = '1.0.272';
55
55
 
56
56
  function getPlatform() {
57
57
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -13625,34 +13625,34 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13625
13625
  classNames = _f === void 0 ? {} : _f,
13626
13626
  _g = _a.colors,
13627
13627
  colors = _g === void 0 ? {} : _g,
13628
- _h = _a.verbiage,
13629
- rawVerbiage = _h === void 0 ? {} : _h,
13630
- _j = _a.debugMode,
13631
- debugMode = _j === void 0 ? false : _j;
13632
- var _k = React.useContext(CameraStateContext),
13633
- cameraRef = _k.cameraRef,
13634
- videoRef = _k.videoRef;
13635
- var _l = useResizeObserver__default['default'](),
13636
- ref = _l.ref,
13637
- width = _l.width,
13638
- height = _l.height;
13628
+ _j = _a.verbiage,
13629
+ rawVerbiage = _j === void 0 ? {} : _j,
13630
+ _k = _a.debugMode,
13631
+ debugMode = _k === void 0 ? false : _k;
13632
+ var _l = React.useContext(CameraStateContext),
13633
+ cameraRef = _l.cameraRef,
13634
+ videoRef = _l.videoRef;
13635
+ var _m = useResizeObserver__default['default'](),
13636
+ ref = _m.ref;
13637
+ _m.width;
13638
+ _m.height;
13639
13639
  var signaturePad = React.useRef(null);
13640
13640
  var signatureRecorder = React.useRef(null);
13641
13641
  // const recordedChunks = useRef<BlobPart[]>([])
13642
13642
  var onPredictionMade = React.useContext(HighPerformanceSelfieGuidanceModelsContext).onPredictionMade;
13643
- var _m = useVideoRecorder(cameraRef.current),
13644
- isRecording = _m.isRecording,
13645
- startRecording = _m.startRecording,
13646
- stopRecording = _m.stopRecording;
13647
- var _o = React.useState(null),
13648
- signatureData = _o[0],
13649
- setSignatureData = _o[1];
13643
+ var _o = useVideoRecorder(cameraRef.current),
13644
+ isRecording = _o.isRecording,
13645
+ startRecording = _o.startRecording,
13646
+ stopRecording = _o.stopRecording;
13650
13647
  var _p = React.useState(null),
13651
- signatureDataUrl = _p[0],
13652
- setSignatureDataUrl = _p[1];
13648
+ signatureData = _p[0],
13649
+ setSignatureData = _p[1];
13653
13650
  var _q = React.useState(null),
13654
- signatureVideoData = _q[0];
13655
- _q[1];
13651
+ signatureDataUrl = _q[0],
13652
+ setSignatureDataUrl = _q[1];
13653
+ var _r = React.useState(null),
13654
+ signatureVideoData = _r[0];
13655
+ _r[1];
13656
13656
  colors.guidanceMessageBackgroundColor || (colors.guidanceMessageBackgroundColor = '#ccc');
13657
13657
  colors.guidanceMessageTextColor || (colors.guidanceMessageTextColor = 'black');
13658
13658
  var verbiage = useTranslations(rawVerbiage, {
@@ -13711,19 +13711,26 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13711
13711
  if (!ctx) return;
13712
13712
  animationFrame.current = requestAnimationFrame(function runFrame() {
13713
13713
  return tslib.__awaiter(this, void 0, void 0, function () {
13714
- var rect;
13715
13714
  return tslib.__generator(this, function (_a) {
13716
13715
  if (!signaturePad.current || !videoRef.current || !outputCanvas.current) {
13717
13716
  cancelAnimationFrame(animationFrame.current);
13718
13717
  return [2 /*return*/];
13719
13718
  }
13720
- rect = [w * (isPortrait ? 0.02 : 0.15), h * (isPortrait ? 0.15 : 0.25), w * (isPortrait ? 0.96 : 0.7), h * (isPortrait ? 0.7 : 0.5)];
13721
- ctx.drawImage(videoRef.current, 0, 0, w, h);
13722
- ctx.beginPath();
13723
- ctx.fillStyle = 'rgba(255,255,255,0.5)';
13724
- ctx.roundRect.apply(ctx, tslib.__spreadArray(tslib.__spreadArray([], rect, false), [16], false));
13725
- ctx.fill();
13726
- ctx.drawImage.apply(ctx, tslib.__spreadArray([signaturePad.current.getCanvas()], rect, false));
13719
+ // const rect: [number, number, number, number] = [
13720
+ // w * (isPortrait ? 0.02 : 0.15),
13721
+ // h * (isPortrait ? 0.15 : 0.25),
13722
+ // w * (isPortrait ? 0.96 : 0.7),
13723
+ // h * (isPortrait ? 0.7 : 0.5),
13724
+ // ]
13725
+ //
13726
+ // ctx.drawImage(videoRef.current, 0, 0, w, h)
13727
+ //
13728
+ // ctx.beginPath()
13729
+ // ctx.fillStyle = 'rgba(255,255,255,0.5)'
13730
+ // ctx.roundRect(...rect, 16)
13731
+ // ctx.fill()
13732
+ //
13733
+ // ctx.drawImage(signaturePad.current.getCanvas(), ...rect)
13727
13734
  animationFrame.current = requestAnimationFrame(runFrame);
13728
13735
  return [2 /*return*/];
13729
13736
  });
@@ -13733,9 +13740,9 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13733
13740
  cancelAnimationFrame(animationFrame.current);
13734
13741
  };
13735
13742
  }, [cameraRef, isRecording, onFaceNotDetected, videoRef]);
13736
- var _r = React.useState(0),
13737
- numFramesWithoutFaces = _r[0],
13738
- setNumFramesWithoutFaces = _r[1];
13743
+ var _s = React.useState(0),
13744
+ numFramesWithoutFaces = _s[0],
13745
+ setNumFramesWithoutFaces = _s[1];
13739
13746
  React.useEffect(function () {
13740
13747
  onPredictionMade(function (faces) {
13741
13748
  setNumFramesWithoutFaces(function (n) {
@@ -13771,14 +13778,7 @@ var VideoSignatureCapture = function VideoSignatureCapture(_a) {
13771
13778
  }, /*#__PURE__*/React__default['default'].createElement(SignaturePad, {
13772
13779
  ref: ref,
13773
13780
  className: classNames.canvasInner
13774
- }, /*#__PURE__*/React__default['default'].createElement(SignatureCanvas__default['default'], {
13775
- ref: signaturePad,
13776
- canvasProps: {
13777
- width: width,
13778
- height: height,
13779
- className: classNames.canvas
13780
- }
13781
- })), /*#__PURE__*/React__default['default'].createElement(SignatureButtonsContainer, {
13781
+ }), /*#__PURE__*/React__default['default'].createElement(SignatureButtonsContainer, {
13782
13782
  className: classNames.buttonsRow
13783
13783
  }, /*#__PURE__*/React__default['default'].createElement(LoaderButton, {
13784
13784
  variant: "secondary",