@idscan/onboarding 2.10.1 → 2.10.2
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/Wrapper.css +1 -1
- package/dist/Wrapper.d.ts +1 -1
- package/dist/networks/Face-chunk.js +1 -1
- package/dist/networks/MRZ-chunk.js +1 -1
- package/dist/networks/PDF-chunk.js +1 -1
- package/dist/networks/ZXing-chunk.js +1 -1
- package/dist/wrapper.es.js +13 -7
- package/dist/wrapper.umd.js +1 -1
- package/package.json +2 -2
- package/readme.md +3 -0
package/dist/wrapper.es.js
CHANGED
|
@@ -786,6 +786,7 @@ class Configs {
|
|
|
786
786
|
}
|
|
787
787
|
this.cssStyles = options == null ? void 0 : options.cssStyles;
|
|
788
788
|
this.cssVariables = options == null ? void 0 : options.cssVariables;
|
|
789
|
+
this.showQrCode = this.wrapper.preferApiConfig ? settings.showQrCode ?? true : options.showQrCode;
|
|
789
790
|
}
|
|
790
791
|
faceAuthorizationConfig(settings) {
|
|
791
792
|
settings.isShowDocumentTypeSelect = false;
|
|
@@ -885,6 +886,9 @@ class Configs {
|
|
|
885
886
|
get cssVariablesConfig() {
|
|
886
887
|
return this.cssVariables;
|
|
887
888
|
}
|
|
889
|
+
get showQrCodeConfig() {
|
|
890
|
+
return this.showQrCode;
|
|
891
|
+
}
|
|
888
892
|
get mountElement() {
|
|
889
893
|
return this.wrapper.el || "videoCapturingEl";
|
|
890
894
|
}
|
|
@@ -1272,7 +1276,8 @@ class Api {
|
|
|
1272
1276
|
headers: this.HEADERS
|
|
1273
1277
|
});
|
|
1274
1278
|
if (response.ok) {
|
|
1275
|
-
|
|
1279
|
+
const { showQrCode: _, ...result } = await response.json();
|
|
1280
|
+
return result;
|
|
1276
1281
|
}
|
|
1277
1282
|
throw new HttpError(response);
|
|
1278
1283
|
} catch (e) {
|
|
@@ -1530,10 +1535,10 @@ class Lib {
|
|
|
1530
1535
|
};
|
|
1531
1536
|
}
|
|
1532
1537
|
}
|
|
1533
|
-
const validationModalHTML = '<div class="idvc-modal-background" id="idvc-modal-background">\n
|
|
1538
|
+
const validationModalHTML = '<div class="idvc-modal-background d-none" id="idvc-modal-background">\n <div class="idvc-modal idvc-modal_validation d-none" id="idvc-modal">\n <div class="el-loading-spinner d-none" id="idvc-loading-spinner">\n <svg viewBox="25 25 50 50" class="circular">\n <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>\n </svg>\n </div>\n <div class="idvc-modal__header">\n <div class="idvc-modal__header__body">\n <div class="idvc-modal__header__sign">\n <div id="idvc-modal-header-sign-info"></div>\n <div id="idvc-modal-header-sign-check" class="d-none"></div>\n </div>\n <h2 class="idvc-modal__header__content">\n Header\n </h2>\n </div>\n <div class="idvc-modal__close-btn" id="idvc-close-modal-btn">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path></svg>\n </div>\n </div>\n <div class="idvc-modal__body">\n Please try again\n </div>\n <div class="idvc-modal__footer">\n <button type="button" class="btn btn--primary" id="idvc-modal-try-again-btn"><span>Try again</span></button>\n <button type="button" class="btn btn--default" id="idvc-modal-complete-btn"><span>Complete </span></button>\n </div>\n </div>\n</div>\n';
|
|
1534
1539
|
const infoCircleSVG = '<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M8 1C9.97933 1.052 11.6278 1.73683 12.9455 3.0545C14.2632 4.37217 14.948 6.02067 15 8C14.948 9.97933 14.2632 11.6278 12.9455 12.9455C11.6278 14.2632 9.97933 14.948 8 15C6.02067 14.948 4.37217 14.2632 3.0545 12.9455C1.73683 11.6278 1.052 9.97933 1 8C1.052 6.02067 1.73683 4.37217 3.0545 3.0545C4.37217 1.73683 6.02067 1.052 8 1ZM8 4C7.729 4 7.505 4.099 7.328 4.297C7.151 4.495 7.07283 4.72933 7.0935 5L7.453 9C7.474 9.146 7.53383 9.26317 7.6325 9.3515C7.73117 9.43983 7.8535 9.48417 7.9995 9.4845C8.1455 9.48483 8.26783 9.4405 8.3665 9.3515C8.46517 9.2625 8.525 9.14533 8.546 9L8.9055 5C8.9265 4.729 8.84833 4.49467 8.671 4.297C8.49367 4.09933 8.27067 4.00033 8 4ZM8 12C8.22933 11.9897 8.4195 11.9115 8.5705 11.7655C8.7215 11.6195 8.797 11.432 8.797 11.203C8.797 10.974 8.7215 10.7838 8.5705 10.6325C8.4195 10.4812 8.22933 10.4057 8 10.406C7.77067 10.4063 7.5805 10.4818 7.4295 10.6325C7.2785 10.7832 7.203 10.9733 7.203 11.203C7.203 11.4327 7.2785 11.6202 7.4295 11.7655C7.5805 11.9108 7.77067 11.989 8 12Z"/>\n</svg>\n';
|
|
1535
1540
|
const checkCircleSVG = '<svg width="20" height="20" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path class="color-success" d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zm-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>\n</svg>\n';
|
|
1536
|
-
const modalHTML = '<div class="idvc-modal d-none" id="idvc-modal">\n <div class="el-loading-spinner d-none" id="idvc-loading-spinner">\n
|
|
1541
|
+
const modalHTML = '<div class="idvc-modal-background d-none" id="idvc-modal-background">\n <div class="idvc-modal d-none" id="idvc-modal">\n <div class="el-loading-spinner d-none" id="idvc-loading-spinner">\n <svg viewBox="25 25 50 50" class="circular">\n <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>\n </svg>\n </div>\n <div class="idvc-modal__close-btn" id="idvc-close-modal-btn"></div>\n <div class="idvc-modal__header">\n <h2 class="idvc-modal__header__content"></h2>\n </div>\n <div class="idvc-modal__body"></div>\n <div class="idvc-modal__footer"></div>\n </div>\n</div>\n';
|
|
1537
1542
|
class Modal {
|
|
1538
1543
|
constructor(mountEl) {
|
|
1539
1544
|
this._closable = true;
|
|
@@ -4545,7 +4550,7 @@ function requireBrowser() {
|
|
|
4545
4550
|
}
|
|
4546
4551
|
var browserExports = requireBrowser();
|
|
4547
4552
|
const QRCode = /* @__PURE__ */ getDefaultExportFromCjs(browserExports);
|
|
4548
|
-
const qrCodeModalHTML = '<div class="idvc-modal-background" id="idvc-modal-background">\n <div class="el-loading-spinner" id="idvc-loading-spinner">\n <svg viewBox="25 25 50 50" class="circular">\n <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>\n </svg>\n </div>\n
|
|
4553
|
+
const qrCodeModalHTML = '<div class="idvc-modal-background d-none" id="idvc-modal-background">\n <div class="el-loading-spinner d-none" id="idvc-loading-spinner">\n <svg viewBox="25 25 50 50" class="circular">\n <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>\n </svg>\n </div>\n <div class="idvc-modal idvc-modal_qr-code" id="idvc-modal">\n <div class="idvc-modal__header-wrap qr-code__header">\n <div class="idvc-modal__close-btn" id="idvc-close-modal-btn">\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path></svg>\n </div>\n <div class="idvc-modal__header">\n <h2 class="idvc-modal__header__content idvc-modal__header__content_qr-code">\n Verify Documents by Phone\n </h2>\n </div>\n </div>\n <div class="idvc-modal__body idvc-modal__body_qr-code">\n <div class="idvc-modal__body_process_ready" id="idvc-modal__body_process_ready">\n <h3 class="idvc-modal__body_process_ready-header">Scan the QR Сode below to continue on your mobile device</h3>\n <div class="idvc-modal__body_process_ready__canvas-container">\n <canvas class="idvc-modal__body_process_ready-canvas" id="idvc-modal__body_process_ready-canvas"></canvas>\n </div>\n <div class="idvc-modal__body_process_ready-info qr-code__header">\n <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M7 0C8.97933 0.052 10.6278 0.736833 11.9455 2.0545C13.2632 3.37217 13.948 5.02067 14 7C13.948 8.97933 13.2632 10.6278 11.9455 11.9455C10.6278 13.2632 8.97933 13.948 7 14C5.02067 13.948 3.37217 13.2632 2.0545 11.9455C0.736833 10.6278 0.052 8.97933 0 7C0.052 5.02067 0.736833 3.37217 2.0545 2.0545C3.37217 0.736833 5.02067 0.052 7 0ZM7 3C6.729 3 6.505 3.099 6.328 3.297C6.151 3.495 6.07283 3.72933 6.0935 4L6.453 8C6.474 8.146 6.53383 8.26317 6.6325 8.3515C6.73117 8.43983 6.8535 8.48417 6.9995 8.4845C7.1455 8.48483 7.26783 8.4405 7.3665 8.3515C7.46517 8.2625 7.525 8.14533 7.546 8L7.9055 4C7.9265 3.729 7.84833 3.49467 7.671 3.297C7.49367 3.09933 7.26967 3.00033 6.999 3H7ZM7 11C7.22933 10.9897 7.4195 10.9115 7.5705 10.7655C7.7215 10.6195 7.797 10.432 7.797 10.203C7.797 9.974 7.7215 9.78383 7.5705 9.6325C7.4195 9.48117 7.22933 9.40567 7 9.406C6.77067 9.40633 6.5805 9.48183 6.4295 9.6325C6.2785 9.78317 6.203 9.97333 6.203 10.203C6.203 10.4327 6.2785 10.6202 6.4295 10.7655C6.5805 10.9108 6.77067 10.989 7 11Z" fill="#F7BA2A"/>\n </svg>\n <span class="idvc-modal__body_process_ready-info__text">Any images you have uploaded will be lost if you scan the QR code and continue the process on your mobile device</span>\n </div>\n </div>\n\n <div class="idvc-modal__body_process_validating d-none" id="idvc-modal__body_process_validating">\n <div class="el-loading-spinner el-loading-spinner_qr-code" id="idvc-validating-spinner">\n <svg viewBox="25 25 50 50" class="circular">\n <circle cx="50" cy="50" r="20" fill="none" class="path"></circle>\n </svg>\n <span class="idvc-modal__body_process_validating-info__text">The verification process is currently being completed using a mobile device ...</span>\n </div>\n </div>\n\n <div class="idvc-modal__body_process_done d-none" id="result-success">\n <div class="idvc-modal__body_process_done-container">\n <svg\n width="64"\n height="64"\n viewBox="0 0 64 64"\n fill="none"\n xmlns="http://www.w3.org/2000/svg">\n <path d="M31.5 0.5C40.407 0.734 47.8253 3.81575 53.7548 9.74525C59.6842 15.6748 62.766 23.093 63 32C62.766 40.907 59.6842 48.3253 53.7548 54.2548C47.8253 60.1842 40.407 63.266 31.5 63.5C22.593 63.266 15.1748 60.1842 9.24525 54.2548C3.31575 48.3253 0.234 40.907 0 32C0.234 23.093 3.31575 15.6748 9.24525 9.74525C15.1748 3.81575 22.593 0.734 31.5 0.5ZM27.5625 38.1875L20.601 31.226C20.0385 30.71 19.3942 30.452 18.6682 30.452C17.9422 30.452 17.3092 30.7212 16.7693 31.2597C16.2292 31.7982 15.96 32.4193 15.9615 33.1227C15.963 33.8263 16.221 34.4593 16.7355 35.0218L25.6657 43.952C26.1817 44.468 26.8148 44.726 27.5648 44.726C28.3148 44.726 28.9478 44.468 29.4638 43.952L47.9565 25.4593C48.66 24.7558 48.8828 23.9 48.6247 22.892C48.3667 21.884 47.7337 21.251 46.7257 20.993C45.7178 20.735 44.862 20.9578 44.1585 21.6612L27.5625 38.1875Z" fill="#5FCA71"/>\n </svg>\n <div class="idvc-modal__body_process_done__text" id="result__text-success">\n Success\n </div>\n </div>\n </div>\n\n <div class="idvc-modal__body_process_done d-none" id="result-error">\n <div class="idvc-modal__body_process_done-container">\n <svg\n xmlns="http://www.w3.org/2000/svg"\n width="64"\n height="64"\n fill="#ff0000"\n viewBox="0 0 512 512">\n <path d="M502.876 379.713l-189.486-316.329c-6.088-9.895-14.349-17.903-24.154-23.52l-0.329-0.174c-20.048-11.267-45.677-11.292-65.788 0.022-10.123 5.785-18.372 13.786-24.282 23.381l-0.167 0.291c-0.022 0.045-0.042 0.066-0.064 0.109l-189.619 316.546c-18.512 32.098-7.501 73.127 24.596 91.642 9.476 5.56 20.852 8.88 32.997 8.972h379.12c37.046-0.406 66.736-30.765 66.347-67.804-0.137-12.231-3.526-23.642-9.34-33.446l0.171 0.31zM233.656 189.931c0.138-12.246 10.097-22.12 22.363-22.12s22.225 9.874 22.363 22.107v89.466c0 0.002 0 0.003 0 0.005 0 12.347-10.010 22.356-22.356 22.356-0.002 0-0.004 0-0.005 0h0c-0.002 0-0.005 0-0.008 0-12.345 0-22.352-10.005-22.357-22.348v-0zM278.413 368.985c0 12.368-10.026 22.394-22.394 22.394s-22.394-10.026-22.394-22.394c0-12.367 10.024-22.392 22.391-22.394v0c0.001 0 0.002 0 0.002 0 12.368 0 22.394 10.026 22.394 22.394v0z"/>\n </svg>\n <div class="idvc-modal__body_process_done__text" id="result__text-error">\n Validation Failed\n </div>\n </div>\n </div>\n </div>\n <div class="idvc-modal__footer_qr-code">\n <button type="button" class="btn btn--primary" id="idvc-qr-code-terminate-process-btn">\n <span>Stop the mobile validation process</span>\n </button>\n </div>\n </div>\n</div>\n';
|
|
4549
4554
|
class QRCodeModal extends Modal {
|
|
4550
4555
|
constructor(mountEl, applicantId, domainApi, embeddedAppConnectionId, qrCodeLinkOrigin, state = QRCodeModalState.READY) {
|
|
4551
4556
|
super(mountEl);
|
|
@@ -4605,7 +4610,7 @@ class QRCodeModal extends Modal {
|
|
|
4605
4610
|
async generateQR(url) {
|
|
4606
4611
|
try {
|
|
4607
4612
|
await QRCode.toCanvas(this.qrCodeCanvas, url, {
|
|
4608
|
-
width:
|
|
4613
|
+
width: 180
|
|
4609
4614
|
});
|
|
4610
4615
|
} catch (e) {
|
|
4611
4616
|
throw new Error(`generate qr code error: ${e}`);
|
|
@@ -4628,7 +4633,7 @@ const checkIfMobile = () => {
|
|
|
4628
4633
|
const { userAgent } = navigator;
|
|
4629
4634
|
return browserRE.test(userAgent) || browserREAlt.test(userAgent.slice(0, 4)) || isiOS();
|
|
4630
4635
|
};
|
|
4631
|
-
const version = "2.10.
|
|
4636
|
+
const version = "2.10.2";
|
|
4632
4637
|
const packageJson = {
|
|
4633
4638
|
version
|
|
4634
4639
|
};
|
|
@@ -4648,7 +4653,7 @@ class Wrapper {
|
|
|
4648
4653
|
return getQueryParam("qrCode") === "true";
|
|
4649
4654
|
}
|
|
4650
4655
|
get QRCodeIsAvailable() {
|
|
4651
|
-
return !this.isEmbeddedFromQR && !this.config.demoMode && this.
|
|
4656
|
+
return !this.isEmbeddedFromQR && !this.config.demoMode && this.configs.showQrCodeConfig && !checkIfMobile();
|
|
4652
4657
|
}
|
|
4653
4658
|
updateConfig(newConfig) {
|
|
4654
4659
|
this.configs.libConfig = this.prepareConfig(newConfig);
|
|
@@ -5048,6 +5053,7 @@ class Wrapper {
|
|
|
5048
5053
|
this.form.form.remove();
|
|
5049
5054
|
}
|
|
5050
5055
|
(_b = document.getElementById(this.configs.mountElement)) == null ? void 0 : _b.classList.remove("hidden-element");
|
|
5056
|
+
this.validationModal.prepareBackgroundStyles();
|
|
5051
5057
|
this.validationModal.show();
|
|
5052
5058
|
}
|
|
5053
5059
|
return e;
|