idmission-web-sdk 2.2.149 → 2.2.151

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.2.149';
214
+ var webSdkVersion = '2.2.151';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -22976,39 +22976,40 @@
22976
22976
  var VideoSignatureContext = /*#__PURE__*/React.createContext(videoSignatureInitialState);
22977
22977
  function VideoSignatureContextProvider(_a) {
22978
22978
  var _this = this;
22979
+ var _b, _c;
22979
22980
  var children = _a.children,
22980
- _b = _a.captureAudio,
22981
- captureAudio = _b === void 0 ? false : _b;
22981
+ _d = _a.captureAudio,
22982
+ captureAudio = _d === void 0 ? false : _d;
22982
22983
  var signaturePad = React.useRef(null);
22983
- var _c = React.useState(null),
22984
- signatureData = _c[0],
22985
- setSignatureData = _c[1];
22986
- var _d = React.useState(null),
22987
- signatureDataUrl = _d[0],
22988
- setSignatureDataUrl = _d[1];
22989
22984
  var _e = React.useState(null),
22990
- signatureVideoData = _e[0],
22991
- setSignatureVideoData = _e[1];
22985
+ signatureData = _e[0],
22986
+ setSignatureData = _e[1];
22992
22987
  var _f = React.useState(null),
22993
- signatureVideoUrl = _f[0],
22994
- setSignatureVideoUrl = _f[1];
22988
+ signatureDataUrl = _f[0],
22989
+ setSignatureDataUrl = _f[1];
22990
+ var _g = React.useState(null),
22991
+ signatureVideoData = _g[0],
22992
+ setSignatureVideoData = _g[1];
22993
+ var _h = React.useState(null),
22994
+ signatureVideoUrl = _h[0],
22995
+ setSignatureVideoUrl = _h[1];
22995
22996
  var signatureRecorder = React.useRef(null);
22996
22997
  var recordedChunks = React.useRef([]);
22997
- var _g = useCameraStore(),
22998
- camera = _g.camera,
22999
- videoRef = _g.videoRef,
23000
- audioStream = _g.audioStream;
23001
- var _h = useVideoRecorder(camera, audioStream, captureAudio),
23002
- isRecordingVideo = _h.isRecordingVideo,
23003
- startRecordingVideo = _h.startRecordingVideo,
23004
- stopRecordingVideo = _h.stopRecordingVideo,
23005
- startRecordingAudio = _h.startRecordingAudio,
23006
- stopRecordingAudio = _h.stopRecordingAudio;
22998
+ var _j = useCameraStore(),
22999
+ camera = _j.camera,
23000
+ videoRef = _j.videoRef,
23001
+ audioStream = _j.audioStream;
23002
+ var _k = useVideoRecorder(camera, audioStream, captureAudio),
23003
+ isRecordingVideo = _k.isRecordingVideo,
23004
+ startRecordingVideo = _k.startRecordingVideo,
23005
+ stopRecordingVideo = _k.stopRecordingVideo,
23006
+ startRecordingAudio = _k.startRecordingAudio,
23007
+ stopRecordingAudio = _k.stopRecordingAudio;
23007
23008
  var outputCanvas = React.useRef(null);
23008
23009
  var recordingLock = React.useRef(false);
23009
- var _j = React.useState(false),
23010
- isRecording = _j[0],
23011
- setIsRecording = _j[1];
23010
+ var _l = React.useState(false),
23011
+ isRecording = _l[0],
23012
+ setIsRecording = _l[1];
23012
23013
  var startRecording = React.useCallback(function () {
23013
23014
  setIsRecording(true);
23014
23015
  }, []);
@@ -23139,7 +23140,9 @@
23139
23140
  return /*#__PURE__*/React.createElement(VideoSignatureContext.Provider, {
23140
23141
  value: value
23141
23142
  }, children, /*#__PURE__*/React.createElement(InvisibleCanvas, {
23142
- ref: outputCanvas
23143
+ ref: outputCanvas,
23144
+ width: (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth,
23145
+ height: (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.videoHeight
23143
23146
  }));
23144
23147
  }
23145
23148
  function useVideoSignatureContext() {
@@ -23149,24 +23152,26 @@
23149
23152
  }
23150
23153
 
23151
23154
  function VideoSignatureGuides(_a) {
23152
- var _b;
23153
- var _c = _a.requestedAction,
23154
- requestedAction = _c === void 0 ? 'VERIFY_LIVENESS' : _c,
23155
- _d = _a.faceGuideStatus,
23156
- faceGuideStatus = _d === void 0 ? 'success' : _d,
23155
+ var _b = _a.requestedAction,
23156
+ requestedAction = _b === void 0 ? 'VERIFY_LIVENESS' : _b,
23157
+ _c = _a.faceGuideStatus,
23158
+ faceGuideStatus = _c === void 0 ? 'success' : _c,
23157
23159
  faceGuideBorderWidth = _a.faceGuideBorderWidth,
23158
23160
  faceGuideBorderColor = _a.faceGuideBorderColor,
23159
- _e = _a.classNames,
23160
- classNames = _e === void 0 ? {} : _e,
23161
- _f = _a.verbiage,
23162
- rawVerbiage = _f === void 0 ? {} : _f;
23163
- var _g = useResizeObserver(),
23164
- ref = _g.ref,
23165
- width = _g.width,
23166
- height = _g.height;
23167
- var _h = useVideoSignatureContext(),
23168
- signaturePad = _h.signaturePad,
23169
- onAcceptClicked = _h.onAcceptClicked;
23161
+ _d = _a.classNames,
23162
+ classNames = _d === void 0 ? {} : _d,
23163
+ _e = _a.verbiage,
23164
+ rawVerbiage = _e === void 0 ? {} : _e;
23165
+ var _f = useResizeObserver(),
23166
+ ref = _f.ref,
23167
+ width = _f.width,
23168
+ height = _f.height;
23169
+ var _g = useVideoSignatureContext(),
23170
+ signaturePad = _g.signaturePad,
23171
+ onAcceptClicked = _g.onAcceptClicked;
23172
+ var _h = React.useState(true),
23173
+ isSignaturePadEmpty = _h[0],
23174
+ setIsSignaturePadEmpty = _h[1];
23170
23175
  var verbiage = useTranslations(rawVerbiage, {
23171
23176
  clearSignatureBtnText: 'Clear',
23172
23177
  acceptSignatureBtnText: 'Accept'
@@ -23200,19 +23205,27 @@
23200
23205
  className: classNames.signatureCanvasInner
23201
23206
  }, /*#__PURE__*/React.createElement(SignatureCanvas, {
23202
23207
  ref: signaturePad,
23203
- canvasProps: canvasProps
23208
+ canvasProps: canvasProps,
23209
+ onEnd: function onEnd() {
23210
+ var _a;
23211
+ setIsSignaturePadEmpty(!!((_a = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _a === void 0 ? void 0 : _a.isEmpty()));
23212
+ }
23204
23213
  })), /*#__PURE__*/React.createElement(SignatureButtonsContainer, {
23205
23214
  className: classNames.signatureButtonsRow
23206
23215
  }, /*#__PURE__*/React.createElement(LoaderButton, {
23207
23216
  variant: "secondary",
23208
23217
  className: classNames.clearSignatureBtn,
23209
- onClick: (_b = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _b === void 0 ? void 0 : _b.clear,
23218
+ onClick: function onClick() {
23219
+ var _a, _b;
23220
+ (_a = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _a === void 0 ? void 0 : _a.clear();
23221
+ setIsSignaturePadEmpty(!!((_b = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _b === void 0 ? void 0 : _b.isEmpty()));
23222
+ },
23210
23223
  disabled: requestedAction === 'VERIFY_LIVENESS',
23211
23224
  finished: true
23212
23225
  }, verbiage.clearSignatureBtnText), /*#__PURE__*/React.createElement(AcceptBtn, {
23213
23226
  variant: "positive",
23214
23227
  className: classNames.acceptSignatureBtn,
23215
- disabled: requestedAction === 'VERIFY_LIVENESS',
23228
+ disabled: requestedAction === 'VERIFY_LIVENESS' || isSignaturePadEmpty,
23216
23229
  onClick: onAcceptClicked,
23217
23230
  finished: true
23218
23231
  }, verbiage.acceptSignatureBtnText))))));