idmission-web-sdk 2.2.122 → 2.2.123

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
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { forwardRef, useState, useEffect, useRef, useContext, createContext, useReducer, useCallback, useMemo, useLayoutEffect } from 'react';
3
+ import * as ReactDOM from 'react-dom/client';
3
4
  import platform from 'platform';
4
5
  import styled, { keyframes, useTheme, ThemeProvider as ThemeProvider$1 } from 'styled-components';
5
6
  import { useTranslation, initReactI18next } from 'react-i18next';
@@ -202,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
202
203
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
203
204
  };
204
205
 
205
- var webSdkVersion = '2.2.122';
206
+ var webSdkVersion = '2.2.123';
206
207
 
207
208
  function getPlatform() {
208
209
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -4749,6 +4750,11 @@ var useIdCaptureStore = create()(devtools(function (set) {
4749
4750
  }));
4750
4751
  function IdCaptureStateProvider(_a) {
4751
4752
  var children = _a.children;
4753
+ useEffect(function resetWhenProviderMounts() {
4754
+ useIdCaptureStore.getState().dispatch({
4755
+ type: 'resetWizard'
4756
+ });
4757
+ }, []);
4752
4758
  var overrideWrongDocumentTypeGuidance = useIdCaptureStore(useShallow(function (state) {
4753
4759
  return state.overrideWrongDocumentTypeGuidance;
4754
4760
  }));
@@ -12031,13 +12037,6 @@ var StyledButtonsRow$6 = styled(ButtonsRow)(templateObject_2$c || (templateObjec
12031
12037
  var templateObject_1$e, templateObject_2$c;
12032
12038
 
12033
12039
  var legacyInstructionImageUrl = "".concat(DEFAULT_CDN_URL, "/Selfie-Image-1.png");
12034
- var OverlayInner = styled.div(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n"], ["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n"])), function (props) {
12035
- var _a, _b, _c, _d;
12036
- return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.selfieCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.backgroundColor) !== null && _d !== void 0 ? _d : '#ecedf3';
12037
- }, function (props) {
12038
- var _a, _b, _c, _d;
12039
- return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.selfieCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.textColor) !== null && _d !== void 0 ? _d : 'black';
12040
- });
12041
12040
  var SelfieCaptureLoadingOverlayDefault = function SelfieCaptureLoadingOverlayDefault(_a) {
12042
12041
  var onDismissed = _a.onDismissed,
12043
12042
  onUserCancel = _a.onUserCancel,
@@ -12166,6 +12165,13 @@ var SelfieCaptureLoadingOverlayDefault = function SelfieCaptureLoadingOverlayDef
12166
12165
  }
12167
12166
  }, verbiage.continueText))))));
12168
12167
  };
12168
+ var OverlayInner = styled.div(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n"], ["\n height: 100dvh;\n display: flex;\n flex-direction: column;\n background: ", ";\n color: ", ";\n"])), function (props) {
12169
+ var _a, _b, _c, _d;
12170
+ return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.selfieCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.backgroundColor) !== null && _d !== void 0 ? _d : '#ecedf3';
12171
+ }, function (props) {
12172
+ var _a, _b, _c, _d;
12173
+ return (_d = (_c = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.selfieCapture) === null || _b === void 0 ? void 0 : _b.loadingOverlay) === null || _c === void 0 ? void 0 : _c.textColor) !== null && _d !== void 0 ? _d : 'black';
12174
+ });
12169
12175
  var OverlayHeader = styled.div(templateObject_2$b || (templateObject_2$b = __makeTemplateObject(["\n text-align: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ", "\n padding-bottom: 0;\n"], ["\n text-align: ", ";\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n ", "\n padding-bottom: 0;\n"])), function (props) {
12170
12176
  var _a;
12171
12177
  return (_a = props.theme.textAlign) !== null && _a !== void 0 ? _a : 'center';
@@ -17654,7 +17660,78 @@ var DocumentCapture = function DocumentCapture(_a) {
17654
17660
  };
17655
17661
 
17656
17662
  initializeI18n();
17663
+ function renderElement(component, targetElement) {
17664
+ if (typeof targetElement === 'string') {
17665
+ var result = document.querySelector(targetElement);
17666
+ if (!result) throw new Error("targetElement ".concat(targetElement, " not found"));
17667
+ targetElement = result;
17668
+ } else if (!targetElement) {
17669
+ targetElement = document.createElement('div');
17670
+ document.body.append(targetElement);
17671
+ }
17672
+ var root = ReactDOM.createRoot(targetElement);
17673
+ root.render( /*#__PURE__*/React__default.createElement(OverlayContainer, null, component));
17674
+ if ('remove' in targetElement) {
17675
+ var originalRemove_1 = targetElement.remove;
17676
+ targetElement.remove = function () {
17677
+ try {
17678
+ root.unmount();
17679
+ originalRemove_1();
17680
+ } catch (e) {
17681
+ debug('failed to unmount', e);
17682
+ }
17683
+ };
17684
+ }
17685
+ return targetElement;
17686
+ }
17687
+ function renderComponent(Component, targetElement, options) {
17688
+ if (!options) {
17689
+ options = targetElement;
17690
+ targetElement = undefined;
17691
+ }
17692
+ return renderElement( /*#__PURE__*/React__default.createElement(Component, _assign({}, options)), targetElement);
17693
+ }
17694
+ var renderIdValidation = function renderIdValidation(optionsOrTargetElement, options) {
17695
+ return renderComponent(IdValidation, optionsOrTargetElement, options);
17696
+ };
17697
+ var renderFaceValidation = function renderFaceValidation(optionsOrTargetElement, options) {
17698
+ return renderComponent(FaceValidation, optionsOrTargetElement, options);
17699
+ };
17700
+ var renderIdAndFaceValidation = function renderIdAndFaceValidation(optionsOrTargetElement, options) {
17701
+ return renderComponent(IdAndFaceValidation, optionsOrTargetElement, options);
17702
+ };
17703
+ var renderCustomerIdAndBiometricsEnrollment = function renderCustomerIdAndBiometricsEnrollment(optionsOrTargetElement, options) {
17704
+ return renderComponent(CustomerIdAndBiometricsEnrollment, optionsOrTargetElement, options);
17705
+ };
17706
+ var renderCustomerBiometricsEnrollment = function renderCustomerBiometricsEnrollment(optionsOrTargetElement, options) {
17707
+ return renderComponent(CustomerBiometricsEnrollment, optionsOrTargetElement, options);
17708
+ };
17709
+ var renderCustomerVerification = function renderCustomerVerification(optionsOrTargetElement, options) {
17710
+ return renderComponent(CustomerVerification, optionsOrTargetElement, options);
17711
+ };
17712
+ var renderCustomerIdentification = function renderCustomerIdentification(optionsOrTargetElement, options) {
17713
+ return renderComponent(CustomerIdentification, optionsOrTargetElement, options);
17714
+ };
17715
+ var renderSignatureKYC = function renderSignatureKYC(optionsOrTargetElement, options) {
17716
+ return renderComponent(SignatureKYC, optionsOrTargetElement, options);
17717
+ };
17718
+ var renderVideoIdValidation = function renderVideoIdValidation(optionsOrTargetElement, options) {
17719
+ return renderComponent(VideoIdValidation, optionsOrTargetElement, options);
17720
+ };
17721
+ var renderDocumentCapture = function renderDocumentCapture(optionsOrTargetElement, options) {
17722
+ return renderComponent(DocumentCapture, optionsOrTargetElement, options);
17723
+ };
17657
17724
  globalThis.IDmissionSDK = {
17725
+ renderIdValidation: renderIdValidation,
17726
+ renderFaceValidation: renderFaceValidation,
17727
+ renderIdAndFaceValidation: renderIdAndFaceValidation,
17728
+ renderCustomerIdAndBiometricsEnrollment: renderCustomerIdAndBiometricsEnrollment,
17729
+ renderCustomerBiometricsEnrollment: renderCustomerBiometricsEnrollment,
17730
+ renderCustomerVerification: renderCustomerVerification,
17731
+ renderCustomerIdentification: renderCustomerIdentification,
17732
+ renderSignatureKYC: renderSignatureKYC,
17733
+ renderVideoIdValidation: renderVideoIdValidation,
17734
+ renderDocumentCapture: renderDocumentCapture,
17658
17735
  preloadModels: preloadModels,
17659
17736
  themes: themes,
17660
17737
  version: webSdkVersion,
@@ -17666,5 +17743,5 @@ globalThis.IDmissionSDK = {
17666
17743
  setServerUrl: setServerUrl
17667
17744
  };
17668
17745
 
17669
- export { CapturedDocumentImg, CustomerBiometricsEnrollment, CustomerIdAndBiometricsEnrollment, CustomerIdentification, CustomerVerification, DocumentCapture, FaceValidation, IdAndFaceValidation, IdValidation, SignatureKYC, VideoIdValidation, allowedAuthUrls, defaultAuthUrl, defaultSubmissionUrl, isObject, preloadModels, setServerUrl, themes };
17746
+ export { CapturedDocumentImg, CustomerBiometricsEnrollment, CustomerIdAndBiometricsEnrollment, CustomerIdentification, CustomerVerification, DocumentCapture, FaceValidation, IdAndFaceValidation, IdValidation, SignatureKYC, VideoIdValidation, allowedAuthUrls, defaultAuthUrl, defaultSubmissionUrl, isObject, preloadModels, renderCustomerBiometricsEnrollment, renderCustomerIdAndBiometricsEnrollment, renderCustomerIdentification, renderCustomerVerification, renderDocumentCapture, renderFaceValidation, renderIdAndFaceValidation, renderIdValidation, renderSignatureKYC, renderVideoIdValidation, setServerUrl, themes };
17670
17747
  //# sourceMappingURL=sdk2.esm.js.map