idmission-web-sdk 1.0.140 → 1.0.142

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/index.d.ts CHANGED
@@ -8,7 +8,7 @@ import { SignatureKYC, SignatureKYCProps } from './components/customer_flows/Sig
8
8
  import { VideoIdValidation, VideoIdValidationProps } from './components/customer_flows/VideoIdValidation';
9
9
  import { preloadModels } from './lib/models/preloadModels';
10
10
  import { CustomerBiometricsEnrollment } from './components/customer_flows/CustomerBiometricsEnrollment';
11
- import { themes } from './themes';
11
+ import { Theme, themes } from './themes';
12
12
  import { SubmissionRequest, SubmissionResponse } from './contexts/SubmissionContext';
13
13
  import { DocumentCapture, DocumentCaptureProps } from './components/customer_flows/DocumentCapture';
14
14
  import { CapturedDocumentImg } from './components/common/CapturedDocumentImg';
@@ -42,4 +42,4 @@ export type IDmissionSDK = {
42
42
  declare global {
43
43
  var IDmissionSDK: IDmissionSDK;
44
44
  }
45
- export { preloadModels, themes, IdValidation, FaceValidation, IdAndFaceValidation, CustomerIdAndBiometricsEnrollment, CustomerBiometricsEnrollment, CustomerVerification, CustomerIdentification, SignatureKYC, VideoIdValidation, DocumentCapture, SubmissionRequest, SubmissionResponse, CapturedDocumentImg, };
45
+ export { preloadModels, themes, Theme, IdValidation, FaceValidation, IdAndFaceValidation, CustomerIdAndBiometricsEnrollment, CustomerBiometricsEnrollment, CustomerVerification, CustomerIdentification, SignatureKYC, VideoIdValidation, DocumentCapture, SubmissionRequest, SubmissionResponse, CapturedDocumentImg, };
@@ -47,7 +47,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
47
47
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
48
48
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
49
49
 
50
- var webSdkVersion = '1.0.140';
50
+ var webSdkVersion = '1.0.142';
51
51
 
52
52
  function getPlatform() {
53
53
  if (typeof window === 'undefined') return;
@@ -10903,12 +10903,11 @@ var regionClsx = function regionClsx(classNames, which) {
10903
10903
  var templateObject_1$j, templateObject_2$d;
10904
10904
 
10905
10905
  var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
10906
- var _b, _c, _d, _e, _f, _g, _h, _j, _k;
10906
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
10907
10907
  var aspectRatio = _a.aspectRatio,
10908
- _l = _a.maskColor,
10909
- maskColor = _l === void 0 ? 'gray' : _l,
10910
- _m = _a.borderRadius,
10911
- borderRadius = _m === void 0 ? 33 : _m,
10908
+ maskColor = _a.maskColor,
10909
+ _p = _a.borderRadius,
10910
+ borderRadius = _p === void 0 ? 33 : _p,
10912
10911
  borderColor = _a.borderColor,
10913
10912
  borderWidth = _a.borderWidth,
10914
10913
  padding = _a.padding,
@@ -10917,23 +10916,23 @@ var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
10917
10916
  backImageUrl = _a.backImageUrl,
10918
10917
  isMirrored = _a.isMirrored,
10919
10918
  instruction = _a.instruction,
10920
- _o = _a.requestingFlip,
10921
- requestingFlip = _o === void 0 ? false : _o,
10922
- _p = _a.classNames,
10923
- classNames = _p === void 0 ? {} : _p;
10924
- var _q = useIdCaptureState(),
10925
- _r = _q[0],
10926
- redrawing = _r.redrawing,
10927
- guideImageWidth = _r.guideImageWidth,
10928
- guideImageHeight = _r.guideImageHeight,
10929
- dispatch = _q[1];
10919
+ _q = _a.requestingFlip,
10920
+ requestingFlip = _q === void 0 ? false : _q,
10921
+ _r = _a.classNames,
10922
+ classNames = _r === void 0 ? {} : _r;
10923
+ var _s = useIdCaptureState(),
10924
+ _t = _s[0],
10925
+ redrawing = _t.redrawing,
10926
+ guideImageWidth = _t.guideImageWidth,
10927
+ guideImageHeight = _t.guideImageHeight,
10928
+ dispatch = _s[1];
10930
10929
  var canvasRef = React.useRef(null);
10931
- var _s = useResizeObserver__default['default'](),
10932
- wrapperRef = _s.ref,
10933
- _t = _s.width,
10934
- wrapperWidth = _t === void 0 ? 1 : _t,
10935
- _u = _s.height,
10936
- wrapperHeight = _u === void 0 ? 1 : _u;
10930
+ var _u = useResizeObserver__default['default'](),
10931
+ wrapperRef = _u.ref,
10932
+ _v = _u.width,
10933
+ wrapperWidth = _v === void 0 ? 1 : _v,
10934
+ _w = _u.height,
10935
+ wrapperHeight = _w === void 0 ? 1 : _w;
10937
10936
  var theme = styled.useTheme();
10938
10937
  if (borderWidth === undefined) borderWidth = (_d = (_c = (_b = theme.idCapture) === null || _b === void 0 ? void 0 : _b.guideBox) === null || _c === void 0 ? void 0 : _c.borderWidth) !== null && _d !== void 0 ? _d : 4;
10939
10938
  if (padding === undefined) {
@@ -10942,6 +10941,9 @@ var IdCaptureFitGuide = function IdCaptureFitGuide(_a) {
10942
10941
  if (aspectRatio === undefined && guideImageWidth !== 0) {
10943
10942
  aspectRatio = guideImageWidth / guideImageHeight;
10944
10943
  }
10944
+ if (maskColor === undefined) {
10945
+ maskColor = (_o = (_m = (_l = theme.idCapture) === null || _l === void 0 ? void 0 : _l.guideOverlay) === null || _m === void 0 ? void 0 : _m.backgroundColor) !== null && _o !== void 0 ? _o : '#888';
10946
+ }
10945
10947
  React.useEffect(function () {
10946
10948
  var canvas = canvasRef.current;
10947
10949
  if (!canvas) return;
@@ -11202,63 +11204,63 @@ var reducer$4 = function reducer(state, action) {
11202
11204
  }
11203
11205
  };
11204
11206
  var IdCaptureWizard = function IdCaptureWizard(_a) {
11205
- var _b;
11206
- var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
11207
+ var _b, _c, _d;
11208
+ var _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
11207
11209
  var onSuccess = _a.onSuccess,
11208
11210
  onExitCapture = _a.onExitCapture,
11209
11211
  onUserCancel = _a.onUserCancel,
11210
11212
  precapturedDocuments = _a.precapturedDocuments,
11211
- _o = _a.captureRequirement,
11212
- captureRequirement = _o === void 0 ? 'idCardOrPassport' : _o,
11213
- _p = _a.autoCaptureEnabled,
11214
- autoCaptureEnabled = _p === void 0 ? true : _p,
11215
- _q = _a.autoCaptureGoodFramesRequired,
11216
- autoCaptureGoodFramesRequired = _q === void 0 ? 3 : _q,
11217
- _r = _a.autoCaptureBarcodeRequired,
11218
- autoCaptureBarcodeRequired = _r === void 0 ? 'mobile' : _r,
11219
- _s = _a.barcodeScanningEnabled,
11220
- barcodeScanningEnabled = _s === void 0 ? false : _s,
11221
- _t = _a.idCardAutoCaptureScoreThreshold,
11222
- idCardAutoCaptureScoreThreshold = _t === void 0 ? 0.8 : _t,
11223
- _u = _a.passportAutoCaptureScoreThreshold,
11224
- passportAutoCaptureScoreThreshold = _u === void 0 ? 0.75 : _u,
11225
- _v = _a.mrzDetectionScoreThreshold,
11226
- mrzDetectionScoreThreshold = _v === void 0 ? 0.25 : _v,
11227
- _w = _a.idCardFocusScoreThreshold,
11228
- idCardFocusScoreThreshold = _w === void 0 ? 0.3 : _w,
11229
- _x = _a.passportFocusScoreThreshold,
11230
- passportFocusScoreThreshold = _x === void 0 ? 0.3 : _x,
11231
- _y = _a.skipSuccessScreen,
11232
- skipSuccessScreen = _y === void 0 ? false : _y,
11213
+ _q = _a.captureRequirement,
11214
+ captureRequirement = _q === void 0 ? 'idCardOrPassport' : _q,
11215
+ _r = _a.autoCaptureEnabled,
11216
+ autoCaptureEnabled = _r === void 0 ? true : _r,
11217
+ _s = _a.autoCaptureGoodFramesRequired,
11218
+ autoCaptureGoodFramesRequired = _s === void 0 ? 3 : _s,
11219
+ _t = _a.autoCaptureBarcodeRequired,
11220
+ autoCaptureBarcodeRequired = _t === void 0 ? 'mobile' : _t,
11221
+ _u = _a.barcodeScanningEnabled,
11222
+ barcodeScanningEnabled = _u === void 0 ? false : _u,
11223
+ _v = _a.idCardAutoCaptureScoreThreshold,
11224
+ idCardAutoCaptureScoreThreshold = _v === void 0 ? 0.8 : _v,
11225
+ _w = _a.passportAutoCaptureScoreThreshold,
11226
+ passportAutoCaptureScoreThreshold = _w === void 0 ? 0.75 : _w,
11227
+ _x = _a.mrzDetectionScoreThreshold,
11228
+ mrzDetectionScoreThreshold = _x === void 0 ? 0.25 : _x,
11229
+ _y = _a.idCardFocusScoreThreshold,
11230
+ idCardFocusScoreThreshold = _y === void 0 ? 0.3 : _y,
11231
+ _z = _a.passportFocusScoreThreshold,
11232
+ passportFocusScoreThreshold = _z === void 0 ? 0.3 : _z,
11233
+ _0 = _a.skipSuccessScreen,
11234
+ skipSuccessScreen = _0 === void 0 ? false : _0,
11233
11235
  instructions = _a.instructions,
11234
- _z = _a.releaseCameraAccessOnExit,
11235
- releaseCameraAccessOnExit = _z === void 0 ? true : _z,
11236
- _0 = _a.guideType,
11237
- guideType = _0 === void 0 ? 'fit' : _0,
11238
- _1 = _a.assets,
11239
- assets = _1 === void 0 ? {} : _1,
11240
- _2 = _a.classNames,
11241
- classNames = _2 === void 0 ? {} : _2,
11242
- _3 = _a.colors,
11243
- colors = _3 === void 0 ? {} : _3,
11244
- _4 = _a.verbiage,
11245
- verbiage = _4 === void 0 ? {} : _4,
11246
- _5 = _a.debugMode,
11247
- debugMode = _5 === void 0 ? false : _5;
11248
- var _6 = React.useReducer(reducer$4, initialState$4),
11249
- state = _6[0],
11250
- dispatch = _6[1];
11236
+ _1 = _a.releaseCameraAccessOnExit,
11237
+ releaseCameraAccessOnExit = _1 === void 0 ? true : _1,
11238
+ _2 = _a.guideType,
11239
+ guideType = _2 === void 0 ? 'fit' : _2,
11240
+ _3 = _a.assets,
11241
+ assets = _3 === void 0 ? {} : _3,
11242
+ _4 = _a.classNames,
11243
+ classNames = _4 === void 0 ? {} : _4,
11244
+ _5 = _a.colors,
11245
+ colors = _5 === void 0 ? {} : _5,
11246
+ _6 = _a.verbiage,
11247
+ verbiage = _6 === void 0 ? {} : _6,
11248
+ _7 = _a.debugMode,
11249
+ debugMode = _7 === void 0 ? false : _7;
11250
+ var _8 = React.useReducer(reducer$4, initialState$4),
11251
+ state = _8[0],
11252
+ dispatch = _8[1];
11251
11253
  var releaseCameraAccess = React.useContext(CameraStateContext).releaseCameraAccess;
11252
- var _7 = React.useState(false),
11253
- overlayDismissed = _7[0],
11254
- setOverlayDismissed = _7[1];
11255
- var _8 = React.useContext(SubmissionContext),
11256
- submissionStatus = _8.submissionStatus,
11257
- setIdFrontImage = _8.setIdFrontImage,
11258
- setIdBackImage = _8.setIdBackImage,
11259
- setPassportImage = _8.setPassportImage,
11260
- logIdFrontCaptureAttempt = _8.logIdFrontCaptureAttempt,
11261
- logIdBackCaptureAttempt = _8.logIdBackCaptureAttempt;
11254
+ var _9 = React.useState(false),
11255
+ overlayDismissed = _9[0],
11256
+ setOverlayDismissed = _9[1];
11257
+ var _10 = React.useContext(SubmissionContext),
11258
+ submissionStatus = _10.submissionStatus,
11259
+ setIdFrontImage = _10.setIdFrontImage,
11260
+ setIdBackImage = _10.setIdBackImage,
11261
+ setPassportImage = _10.setPassportImage,
11262
+ logIdFrontCaptureAttempt = _10.logIdFrontCaptureAttempt,
11263
+ logIdBackCaptureAttempt = _10.logIdBackCaptureAttempt;
11262
11264
  var modelsError = React.useContext(IdCaptureModelsContext).error;
11263
11265
  var operationStartedAt = React.useRef();
11264
11266
  React.useEffect(function () {
@@ -11331,9 +11333,9 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
11331
11333
  type: 'reset'
11332
11334
  });
11333
11335
  }, []);
11334
- var _9 = React.useState(0),
11335
- attempt = _9[0],
11336
- setAttempt = _9[1];
11336
+ var _11 = React.useState(0),
11337
+ attempt = _11[0],
11338
+ setAttempt = _11[1];
11337
11339
  var onExit = React.useCallback(function () {
11338
11340
  setOverlayDismissed(false);
11339
11341
  setAttempt(function (n) {
@@ -11350,19 +11352,19 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
11350
11352
  }
11351
11353
  }, [releaseCameraAccess, releaseCameraAccessOnExit, submissionStatus]);
11352
11354
  assets.idCardFront || (assets.idCardFront = {});
11353
- (_c = assets.idCardFront).portraitGuidesImageUrl || (_c.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
11354
- (_d = assets.idCardFront).landscapeGuidesImageUrl || (_d.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
11355
+ (_e = assets.idCardFront).portraitGuidesImageUrl || (_e.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Portrait-2.svg"));
11356
+ (_f = assets.idCardFront).landscapeGuidesImageUrl || (_f.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Front-SVG-Landscape-2.svg"));
11355
11357
  assets.idCardBack || (assets.idCardBack = {});
11356
- (_e = assets.idCardBack).portraitGuidesImageUrl || (_e.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
11357
- (_f = assets.idCardBack).landscapeGuidesImageUrl || (_f.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
11358
+ (_g = assets.idCardBack).portraitGuidesImageUrl || (_g.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Portrait-2.svg"));
11359
+ (_h = assets.idCardBack).landscapeGuidesImageUrl || (_h.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-IDCard-Back-SVG-Landscape-2.svg"));
11358
11360
  assets.passport || (assets.passport = {});
11359
- (_g = assets.passport).portraitGuidesImageUrl || (_g.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
11360
- (_h = assets.passport).landscapeGuidesImageUrl || (_h.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
11361
+ (_j = assets.passport).portraitGuidesImageUrl || (_j.portraitGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Portrait-2.svg"));
11362
+ (_k = assets.passport).landscapeGuidesImageUrl || (_k.landscapeGuidesImageUrl = "".concat(DEFAULT_CDN_URL, "/Shieldout-Passport-Front-SVG-Landscape-2.svg"));
11361
11363
  assets.flipIdPrompt || (assets.flipIdPrompt = {});
11362
- (_j = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_j.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
11363
- (_k = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_k.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
11364
- (_l = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_l.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
11365
- (_m = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_m.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
11364
+ (_l = assets.flipIdPrompt).frontPortraitGuidesImageUrl || (_l.frontPortraitGuidesImageUrl = assets.idCardFront.portraitGuidesImageUrl);
11365
+ (_m = assets.flipIdPrompt).frontLandscapeGuidesImageUrl || (_m.frontLandscapeGuidesImageUrl = assets.idCardFront.landscapeGuidesImageUrl);
11366
+ (_o = assets.flipIdPrompt).backPortraitGuidesImageUrl || (_o.backPortraitGuidesImageUrl = assets.idCardBack.portraitGuidesImageUrl);
11367
+ (_p = assets.flipIdPrompt).backLandscapeGuidesImageUrl || (_p.backLandscapeGuidesImageUrl = assets.idCardBack.landscapeGuidesImageUrl);
11366
11368
  var idCaptureVerbiages = {
11367
11369
  idCardFront: useTranslations(verbiage.idCardFront, {
11368
11370
  instructionText: 'Scan the front of ID',
@@ -11375,11 +11377,11 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
11375
11377
  instructionText: 'Scan the ID page of passport'
11376
11378
  })
11377
11379
  };
11378
- var _10 = useIdCaptureState()[0],
11379
- guideRectX = _10.guideRectX,
11380
- guideRectY = _10.guideRectY,
11381
- guideRectWidth = _10.guideRectWidth,
11382
- guideRectHeight = _10.guideRectHeight;
11380
+ var _12 = useIdCaptureState()[0],
11381
+ guideRectX = _12.guideRectX,
11382
+ guideRectY = _12.guideRectY,
11383
+ guideRectWidth = _12.guideRectWidth,
11384
+ guideRectHeight = _12.guideRectHeight;
11383
11385
  var idCaptureAssets = assets[state.requestedDocumentType];
11384
11386
  var idCaptureVerbiage = idCaptureVerbiages[state.requestedDocumentType];
11385
11387
  React.useEffect(function () {
@@ -11489,8 +11491,8 @@ var IdCaptureWizard = function IdCaptureWizard(_a) {
11489
11491
  }(), /*#__PURE__*/React__default['default'].createElement(IdCaptureGuides, {
11490
11492
  guideType: guideType,
11491
11493
  requestingFlip: state.captureState === 'requestingFlip',
11492
- frontImageUrl: assets === null || assets === void 0 ? void 0 : assets.idCardFront.landscapeGuidesImageUrl,
11493
- backImageUrl: assets === null || assets === void 0 ? void 0 : assets.idCardBack.landscapeGuidesImageUrl,
11494
+ frontImageUrl: (_c = assets === null || assets === void 0 ? void 0 : assets.flipIdPrompt) === null || _c === void 0 ? void 0 : _c.frontLandscapeGuidesImageUrl,
11495
+ backImageUrl: (_d = assets === null || assets === void 0 ? void 0 : assets.flipIdPrompt) === null || _d === void 0 ? void 0 : _d.backLandscapeGuidesImageUrl,
11494
11496
  classNames: classNames,
11495
11497
  assets: idCaptureAssets,
11496
11498
  colors: colors,