idmission-web-sdk 2.2.101 → 2.2.103

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.2.101';
207
+ var webSdkVersion = '2.2.103';
208
208
 
209
209
  function getPlatform() {
210
210
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -9042,6 +9042,8 @@ var IdCaptureFallback = function IdCaptureFallback(_a) {
9042
9042
  }
9043
9043
  if (!isMobile() && documentToCapture || useFallback) {
9044
9044
  return /*#__PURE__*/React__default.createElement(DocumentCaptureWizard, {
9045
+ classNames: classNames === null || classNames === void 0 ? void 0 : classNames.documentCaptureClassNames,
9046
+ verbiage: rawVerbiage === null || rawVerbiage === void 0 ? void 0 : rawVerbiage.documentCaptureVerbiage,
9045
9047
  documents: [{
9046
9048
  title: documentToCapture
9047
9049
  }],
@@ -9258,6 +9260,7 @@ function IdCaptureOrUploadScreen(_a) {
9258
9260
  }, /*#__PURE__*/React__default.createElement(XIcon, null)))));
9259
9261
  }
9260
9262
  function PassportUploadScreen(_a) {
9263
+ var _this = this;
9261
9264
  var _b = _a.classNames,
9262
9265
  classNames = _b === void 0 ? {} : _b,
9263
9266
  _c = _a.verbiage,
@@ -9265,7 +9268,6 @@ function PassportUploadScreen(_a) {
9265
9268
  var _d = useState(null),
9266
9269
  file = _d[0],
9267
9270
  setFile = _d[1];
9268
- var onCapturedManually = useOnCapturedManually();
9269
9271
  var verbiage = useTranslations(rawVerbiage, {
9270
9272
  uploadPassportText: 'Upload Passport',
9271
9273
  loadingText: 'Loading...',
@@ -9291,7 +9293,23 @@ function PassportUploadScreen(_a) {
9291
9293
  disabled: !file,
9292
9294
  colors: buttonColors,
9293
9295
  onClick: function onClick() {
9294
- return onCapturedManually(file);
9296
+ return __awaiter(_this, void 0, void 0, function () {
9297
+ var _a;
9298
+ var _b, _c;
9299
+ return __generator(this, function (_d) {
9300
+ switch (_d.label) {
9301
+ case 0:
9302
+ _a = dispatchIdCaptureAction;
9303
+ _b = {
9304
+ type: 'documentCaptured'
9305
+ };
9306
+ _c = {};
9307
+ return [4 /*yield*/, readFile(file)];
9308
+ case 1:
9309
+ return [2 /*return*/, _a.apply(void 0, [(_b.payload = (_c.imageData = _d.sent(), _c.documentType = 'passport', _c.width = 0, _c.height = 0, _c), _b)])];
9310
+ }
9311
+ });
9312
+ });
9295
9313
  }
9296
9314
  }, verbiage.continueText)));
9297
9315
  }
@@ -9348,41 +9366,33 @@ function IdDocumentUploadScreen(_a) {
9348
9366
  colors: buttonColors,
9349
9367
  onClick: function onClick() {
9350
9368
  return __awaiter(_this, void 0, void 0, function () {
9351
- var _a, _b, _c, _d, _e;
9352
- var _f, _g, _h, _j, _k;
9353
- return __generator(this, function (_l) {
9354
- switch (_l.label) {
9369
+ var _a, _b, _c, _d;
9370
+ var _e, _f, _g, _h;
9371
+ return __generator(this, function (_j) {
9372
+ switch (_j.label) {
9355
9373
  case 0:
9356
- if (!(!idBackFile && state.allowSinglePageIdCapture)) return [3 /*break*/, 2];
9357
- state.dispatch({
9358
- type: 'setUploadingDocumentsType',
9359
- payload: 'singlePage'
9360
- });
9361
9374
  _b = (_a = state).dispatch;
9362
- _f = {
9363
- type: 'documentCaptured'
9375
+ _e = {
9376
+ type: 'documentsCaptured'
9364
9377
  };
9365
- _g = {};
9378
+ if (!(!idBackFile && state.allowSinglePageIdCapture)) return [3 /*break*/, 2];
9379
+ _f = {};
9366
9380
  return [4 /*yield*/, readFile(idFrontFile)];
9367
9381
  case 1:
9368
- _b.apply(_a, [(_f.payload = (_g.imageData = _l.sent(), _g.documentType = 'singlePage', _g.width = 0, _g.height = 0, _g), _f)]);
9382
+ _c = [(_f.imageData = _j.sent(), _f.documentType = 'singlePage', _f.width = 0, _f.height = 0, _f)];
9369
9383
  return [3 /*break*/, 5];
9370
9384
  case 2:
9371
- _d = (_c = state).dispatch;
9372
- _h = {
9373
- type: 'documentsCaptured'
9374
- };
9375
- _j = {};
9385
+ _g = {};
9376
9386
  return [4 /*yield*/, readFile(idFrontFile)];
9377
9387
  case 3:
9378
- _e = [(_j.imageData = _l.sent(), _j.documentType = 'idCardFront', _j.width = 0, _j.height = 0, _j)];
9379
- _k = {};
9388
+ _d = [(_g.imageData = _j.sent(), _g.documentType = 'idCardFront', _g.width = 0, _g.height = 0, _g)];
9389
+ _h = {};
9380
9390
  return [4 /*yield*/, readFile(idBackFile)];
9381
9391
  case 4:
9382
- _d.apply(_c, [(_h.payload = _e.concat([(_k.imageData = _l.sent(), _k.documentType = 'idCardBack', _k.width = 0, _k.height = 0, _k)]), _h)]);
9383
- _l.label = 5;
9392
+ _c = _d.concat([(_h.imageData = _j.sent(), _h.documentType = 'idCardBack', _h.width = 0, _h.height = 0, _h)]);
9393
+ _j.label = 5;
9384
9394
  case 5:
9385
- return [2 /*return*/];
9395
+ return [2 /*return*/, _b.apply(_a, [(_e.payload = _c, _e)])];
9386
9396
  }
9387
9397
  });
9388
9398
  });
@@ -9403,25 +9413,6 @@ function CancelUploadTypeButton(_a) {
9403
9413
  }
9404
9414
  }, children);
9405
9415
  }
9406
- function useOnCapturedManually() {
9407
- return useCallback(function () {
9408
- var files = [];
9409
- for (var _i = 0; _i < arguments.length; _i++) {
9410
- files[_i] = arguments[_i];
9411
- }
9412
- return Promise.all(files.filter(Boolean).map(readFile)).then(function (f) {
9413
- for (var _i = 0, f_1 = f; _i < f_1.length; _i++) {
9414
- var imageData = f_1[_i];
9415
- dispatchIdCaptureAction({
9416
- type: 'documentCapturedManually',
9417
- payload: {
9418
- imageData: imageData
9419
- }
9420
- });
9421
- }
9422
- });
9423
- }, []);
9424
- }
9425
9416
  function readFile(file) {
9426
9417
  return new Promise(function (resolve, reject) {
9427
9418
  if (!file) return reject(new Error('File is undefined'));
@@ -10994,6 +10985,8 @@ var SelfieCaptureFallback = function SelfieCaptureFallback(_a) {
10994
10985
  if (usingDocumentCapture || silentFallback && !!invalidSelfie && !image && !isMobile() // desktop silent fallback - not a very realistic situation
10995
10986
  ) {
10996
10987
  return /*#__PURE__*/React__default.createElement(DocumentCaptureWizard, {
10988
+ classNames: classNames === null || classNames === void 0 ? void 0 : classNames.documentCaptureClassNames,
10989
+ verbiage: rawVerbiage === null || rawVerbiage === void 0 ? void 0 : rawVerbiage.documentCaptureVerbiage,
10997
10990
  documents: [{
10998
10991
  title: invalidSelfie ? verbiage.livenessFailedText : verbiage.descriptionText
10999
10992
  }],