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.
package/dist/sdk2.esm.js CHANGED
@@ -203,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
203
203
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
204
204
  };
205
205
 
206
- var webSdkVersion = '2.2.149';
206
+ var webSdkVersion = '2.2.151';
207
207
 
208
208
  function getPlatform() {
209
209
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -13084,39 +13084,40 @@ var videoSignatureInitialState = {
13084
13084
  var VideoSignatureContext = /*#__PURE__*/createContext(videoSignatureInitialState);
13085
13085
  function VideoSignatureContextProvider(_a) {
13086
13086
  var _this = this;
13087
+ var _b, _c;
13087
13088
  var children = _a.children,
13088
- _b = _a.captureAudio,
13089
- captureAudio = _b === void 0 ? false : _b;
13089
+ _d = _a.captureAudio,
13090
+ captureAudio = _d === void 0 ? false : _d;
13090
13091
  var signaturePad = useRef(null);
13091
- var _c = useState(null),
13092
- signatureData = _c[0],
13093
- setSignatureData = _c[1];
13094
- var _d = useState(null),
13095
- signatureDataUrl = _d[0],
13096
- setSignatureDataUrl = _d[1];
13097
13092
  var _e = useState(null),
13098
- signatureVideoData = _e[0],
13099
- setSignatureVideoData = _e[1];
13093
+ signatureData = _e[0],
13094
+ setSignatureData = _e[1];
13100
13095
  var _f = useState(null),
13101
- signatureVideoUrl = _f[0],
13102
- setSignatureVideoUrl = _f[1];
13096
+ signatureDataUrl = _f[0],
13097
+ setSignatureDataUrl = _f[1];
13098
+ var _g = useState(null),
13099
+ signatureVideoData = _g[0],
13100
+ setSignatureVideoData = _g[1];
13101
+ var _h = useState(null),
13102
+ signatureVideoUrl = _h[0],
13103
+ setSignatureVideoUrl = _h[1];
13103
13104
  var signatureRecorder = useRef(null);
13104
13105
  var recordedChunks = useRef([]);
13105
- var _g = useCameraStore(),
13106
- camera = _g.camera,
13107
- videoRef = _g.videoRef,
13108
- audioStream = _g.audioStream;
13109
- var _h = useVideoRecorder(camera, audioStream, captureAudio),
13110
- isRecordingVideo = _h.isRecordingVideo,
13111
- startRecordingVideo = _h.startRecordingVideo,
13112
- stopRecordingVideo = _h.stopRecordingVideo,
13113
- startRecordingAudio = _h.startRecordingAudio,
13114
- stopRecordingAudio = _h.stopRecordingAudio;
13106
+ var _j = useCameraStore(),
13107
+ camera = _j.camera,
13108
+ videoRef = _j.videoRef,
13109
+ audioStream = _j.audioStream;
13110
+ var _k = useVideoRecorder(camera, audioStream, captureAudio),
13111
+ isRecordingVideo = _k.isRecordingVideo,
13112
+ startRecordingVideo = _k.startRecordingVideo,
13113
+ stopRecordingVideo = _k.stopRecordingVideo,
13114
+ startRecordingAudio = _k.startRecordingAudio,
13115
+ stopRecordingAudio = _k.stopRecordingAudio;
13115
13116
  var outputCanvas = useRef(null);
13116
13117
  var recordingLock = useRef(false);
13117
- var _j = useState(false),
13118
- isRecording = _j[0],
13119
- setIsRecording = _j[1];
13118
+ var _l = useState(false),
13119
+ isRecording = _l[0],
13120
+ setIsRecording = _l[1];
13120
13121
  var startRecording = useCallback(function () {
13121
13122
  setIsRecording(true);
13122
13123
  }, []);
@@ -13247,7 +13248,9 @@ function VideoSignatureContextProvider(_a) {
13247
13248
  return /*#__PURE__*/React__default.createElement(VideoSignatureContext.Provider, {
13248
13249
  value: value
13249
13250
  }, children, /*#__PURE__*/React__default.createElement(InvisibleCanvas, {
13250
- ref: outputCanvas
13251
+ ref: outputCanvas,
13252
+ width: (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth,
13253
+ height: (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.videoHeight
13251
13254
  }));
13252
13255
  }
13253
13256
  function useVideoSignatureContext() {
@@ -13257,24 +13260,26 @@ function useVideoSignatureContext() {
13257
13260
  }
13258
13261
 
13259
13262
  function VideoSignatureGuides(_a) {
13260
- var _b;
13261
- var _c = _a.requestedAction,
13262
- requestedAction = _c === void 0 ? 'VERIFY_LIVENESS' : _c,
13263
- _d = _a.faceGuideStatus,
13264
- faceGuideStatus = _d === void 0 ? 'success' : _d,
13263
+ var _b = _a.requestedAction,
13264
+ requestedAction = _b === void 0 ? 'VERIFY_LIVENESS' : _b,
13265
+ _c = _a.faceGuideStatus,
13266
+ faceGuideStatus = _c === void 0 ? 'success' : _c,
13265
13267
  faceGuideBorderWidth = _a.faceGuideBorderWidth,
13266
13268
  faceGuideBorderColor = _a.faceGuideBorderColor,
13267
- _e = _a.classNames,
13268
- classNames = _e === void 0 ? {} : _e,
13269
- _f = _a.verbiage,
13270
- rawVerbiage = _f === void 0 ? {} : _f;
13271
- var _g = useResizeObserver(),
13272
- ref = _g.ref,
13273
- width = _g.width,
13274
- height = _g.height;
13275
- var _h = useVideoSignatureContext(),
13276
- signaturePad = _h.signaturePad,
13277
- onAcceptClicked = _h.onAcceptClicked;
13269
+ _d = _a.classNames,
13270
+ classNames = _d === void 0 ? {} : _d,
13271
+ _e = _a.verbiage,
13272
+ rawVerbiage = _e === void 0 ? {} : _e;
13273
+ var _f = useResizeObserver(),
13274
+ ref = _f.ref,
13275
+ width = _f.width,
13276
+ height = _f.height;
13277
+ var _g = useVideoSignatureContext(),
13278
+ signaturePad = _g.signaturePad,
13279
+ onAcceptClicked = _g.onAcceptClicked;
13280
+ var _h = useState(true),
13281
+ isSignaturePadEmpty = _h[0],
13282
+ setIsSignaturePadEmpty = _h[1];
13278
13283
  var verbiage = useTranslations(rawVerbiage, {
13279
13284
  clearSignatureBtnText: 'Clear',
13280
13285
  acceptSignatureBtnText: 'Accept'
@@ -13308,19 +13313,27 @@ function VideoSignatureGuides(_a) {
13308
13313
  className: classNames.signatureCanvasInner
13309
13314
  }, /*#__PURE__*/React__default.createElement(SignatureCanvas, {
13310
13315
  ref: signaturePad,
13311
- canvasProps: canvasProps
13316
+ canvasProps: canvasProps,
13317
+ onEnd: function onEnd() {
13318
+ var _a;
13319
+ setIsSignaturePadEmpty(!!((_a = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _a === void 0 ? void 0 : _a.isEmpty()));
13320
+ }
13312
13321
  })), /*#__PURE__*/React__default.createElement(SignatureButtonsContainer, {
13313
13322
  className: classNames.signatureButtonsRow
13314
13323
  }, /*#__PURE__*/React__default.createElement(LoaderButton, {
13315
13324
  variant: "secondary",
13316
13325
  className: classNames.clearSignatureBtn,
13317
- onClick: (_b = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _b === void 0 ? void 0 : _b.clear,
13326
+ onClick: function onClick() {
13327
+ var _a, _b;
13328
+ (_a = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _a === void 0 ? void 0 : _a.clear();
13329
+ setIsSignaturePadEmpty(!!((_b = signaturePad === null || signaturePad === void 0 ? void 0 : signaturePad.current) === null || _b === void 0 ? void 0 : _b.isEmpty()));
13330
+ },
13318
13331
  disabled: requestedAction === 'VERIFY_LIVENESS',
13319
13332
  finished: true
13320
13333
  }, verbiage.clearSignatureBtnText), /*#__PURE__*/React__default.createElement(AcceptBtn, {
13321
13334
  variant: "positive",
13322
13335
  className: classNames.acceptSignatureBtn,
13323
- disabled: requestedAction === 'VERIFY_LIVENESS',
13336
+ disabled: requestedAction === 'VERIFY_LIVENESS' || isSignaturePadEmpty,
13324
13337
  onClick: onAcceptClicked,
13325
13338
  finished: true
13326
13339
  }, verbiage.acceptSignatureBtnText))))));