idmission-web-sdk 0.0.25 → 0.0.26

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.
@@ -9315,6 +9315,9 @@ var reducer$4 = function reducer(state, action) {
9315
9315
  if (prediction.documentType === 'PASSPORT' && state.requestedDocumentType !== 'PASSPORT') {
9316
9316
  newState.requestedDocumentType = DocumentType.PASSPORT;
9317
9317
  }
9318
+ if (prediction.documentType === 'ID_CARD_FRONT' && state.requestedDocumentType === 'PASSPORT') {
9319
+ newState.requestedDocumentType = DocumentType.ID_CARD_FRONT;
9320
+ }
9318
9321
  return newState;
9319
9322
  }
9320
9323
  case 'barcodeScanned':
@@ -9478,9 +9481,6 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9478
9481
  releaseCameraAccess();
9479
9482
  }
9480
9483
  }, [releaseCameraAccess, submissionStatus]);
9481
- if (submissionResponse) {
9482
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("h1", null, "Submission completed!"), /*#__PURE__*/React__default['default'].createElement("pre", null, JSON.stringify(submissionResponse, null, 2)));
9483
- }
9484
9484
  assets.idCardFrontPortraitGuidesImageUrl = assets.idCardFrontPortraitGuidesImageUrl || "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg");
9485
9485
  assets.idCardFrontLandscapeGuidesImageUrl = assets.idCardFrontLandscapeGuidesImageUrl || "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg");
9486
9486
  assets.idCardBackPortraitGuidesImageUrl = assets.idCardBackPortraitGuidesImageUrl || "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg");
@@ -9491,6 +9491,48 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9491
9491
  verbiage.idCardFrontInstructionText = verbiage.idCardFrontInstructionText || t('Scan the front of ID');
9492
9492
  verbiage.idCardBackInstructionText = verbiage.idCardBackInstructionText || t('Scan the back of ID');
9493
9493
  verbiage.passportInstructionText = verbiage.passportInstructionText || t('Scan the ID page of passport');
9494
+ var idCardFrontAssets = React.useMemo(function () {
9495
+ return {
9496
+ portraitGuidesImageUrl: assets.idCardFrontPortraitGuidesImageUrl,
9497
+ landscapeGuidesImageUrl: assets.idCardFrontLandscapeGuidesImageUrl
9498
+ };
9499
+ }, [assets.idCardFrontLandscapeGuidesImageUrl, assets.idCardFrontPortraitGuidesImageUrl]);
9500
+ var idCardFrontVerbiage = React.useMemo(function () {
9501
+ return {
9502
+ instructionText: verbiage.idCardFrontInstructionText,
9503
+ capturingText: verbiage.capturingText,
9504
+ captureFailedText: verbiage.captureFailedText
9505
+ };
9506
+ }, [verbiage.captureFailedText, verbiage.capturingText, verbiage.idCardFrontInstructionText]);
9507
+ var idCardBackAssets = React.useMemo(function () {
9508
+ return {
9509
+ portraitGuidesImageUrl: assets.idCardBackPortraitGuidesImageUrl,
9510
+ landscapeGuidesImageUrl: assets.idCardBackLandscapeGuidesImageUrl
9511
+ };
9512
+ }, [assets.idCardBackLandscapeGuidesImageUrl, assets.idCardBackPortraitGuidesImageUrl]);
9513
+ var idCardBackVerbiage = React.useMemo(function () {
9514
+ return {
9515
+ instructionText: verbiage.idCardBackInstructionText,
9516
+ capturingText: verbiage.capturingText,
9517
+ captureFailedText: verbiage.captureFailedText
9518
+ };
9519
+ }, [verbiage.captureFailedText, verbiage.capturingText, verbiage.idCardBackInstructionText]);
9520
+ var passportAssets = React.useMemo(function () {
9521
+ return {
9522
+ portraitGuidesImageUrl: assets.passportPortraitGuidesImageUrl,
9523
+ landscapeGuidesImageUrl: assets.passportLandscapeGuidesImageUrl
9524
+ };
9525
+ }, [assets.passportLandscapeGuidesImageUrl, assets.passportPortraitGuidesImageUrl]);
9526
+ var passportVerbiage = React.useMemo(function () {
9527
+ return {
9528
+ instructionText: verbiage.passportInstructionText,
9529
+ capturingText: verbiage.capturingText,
9530
+ captureFailedText: verbiage.captureFailedText
9531
+ };
9532
+ }, [verbiage.captureFailedText, verbiage.capturingText, verbiage.passportInstructionText]);
9533
+ if (submissionResponse) {
9534
+ return /*#__PURE__*/React__default['default'].createElement(PageContainer, null, /*#__PURE__*/React__default['default'].createElement("h1", null, "Submission completed!"), /*#__PURE__*/React__default['default'].createElement("pre", null, JSON.stringify(submissionResponse, null, 2)));
9535
+ }
9494
9536
  var flipIdPrompt = /*#__PURE__*/React__default['default'].createElement(FlipIdPrompt, {
9495
9537
  instructionText: verbiage.flipIdInstructionText,
9496
9538
  frontPortraitGuidesImage: assets.idCardFrontPortraitGuidesImageUrl,
@@ -9517,15 +9559,8 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9517
9559
  onCapture: onCapture,
9518
9560
  processingScreen: flipIdPrompt,
9519
9561
  processingDelay: 3500,
9520
- assets: {
9521
- portraitGuidesImageUrl: assets.idCardFrontPortraitGuidesImageUrl,
9522
- landscapeGuidesImageUrl: assets.idCardFrontLandscapeGuidesImageUrl
9523
- },
9524
- verbiage: {
9525
- instructionText: verbiage.idCardFrontInstructionText,
9526
- capturingText: verbiage.capturingText,
9527
- captureFailedText: verbiage.captureFailedText
9528
- },
9562
+ assets: idCardFrontAssets,
9563
+ verbiage: idCardFrontVerbiage,
9529
9564
  debugMode: debugMode
9530
9565
  });
9531
9566
  case DocumentType.ID_CARD_BACK:
@@ -9542,15 +9577,8 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9542
9577
  onPrediction: onPrediction,
9543
9578
  onBarcodeScanned: onBarcodeScanned,
9544
9579
  onCapture: onCapture,
9545
- assets: {
9546
- portraitGuidesImageUrl: assets.idCardBackPortraitGuidesImageUrl,
9547
- landscapeGuidesImageUrl: assets.idCardBackLandscapeGuidesImageUrl
9548
- },
9549
- verbiage: {
9550
- instructionText: verbiage.idCardBackInstructionText,
9551
- capturingText: verbiage.capturingText,
9552
- captureFailedText: verbiage.captureFailedText
9553
- },
9580
+ assets: idCardBackAssets,
9581
+ verbiage: idCardBackVerbiage,
9554
9582
  debugMode: debugMode
9555
9583
  });
9556
9584
  case DocumentType.PASSPORT:
@@ -9567,15 +9595,8 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
9567
9595
  onPrediction: onPrediction,
9568
9596
  onBarcodeScanned: onBarcodeScanned,
9569
9597
  onCapture: onCapture,
9570
- assets: {
9571
- portraitGuidesImageUrl: assets.passportPortraitGuidesImageUrl,
9572
- landscapeGuidesImageUrl: assets.passportLandscapeGuidesImageUrl
9573
- },
9574
- verbiage: {
9575
- instructionText: verbiage.passportInstructionText,
9576
- capturingText: verbiage.capturingText,
9577
- captureFailedText: verbiage.captureFailedText
9578
- },
9598
+ assets: passportAssets,
9599
+ verbiage: passportVerbiage,
9579
9600
  debugMode: debugMode
9580
9601
  });
9581
9602
  default:
@@ -10796,11 +10817,10 @@ var useHighestResCaptureDevice = function useHighestResCaptureDevice(_a) {
10796
10817
  if (!((_a = navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.getUserMedia)) return cleanup;
10797
10818
  (function () {
10798
10819
  return tslib.__awaiter(void 0, void 0, void 0, function () {
10799
- var isPortrait, stream, e_1;
10820
+ var stream, e_1;
10800
10821
  return tslib.__generator(this, function (_a) {
10801
10822
  switch (_a.label) {
10802
10823
  case 0:
10803
- isPortrait = window.innerWidth < window.innerHeight;
10804
10824
  stream = null;
10805
10825
  _a.label = 1;
10806
10826
  case 1:
@@ -10812,8 +10832,9 @@ var useHighestResCaptureDevice = function useHighestResCaptureDevice(_a) {
10812
10832
  exact: videoDevice.deviceId
10813
10833
  },
10814
10834
  width: {
10815
- ideal: isPortrait ? 1080 : 1920
10816
- }
10835
+ ideal: 1920
10836
+ },
10837
+ aspectRatio: 1.777777778
10817
10838
  }
10818
10839
  })];
10819
10840
  case 2: