@oila/0account 3.5.2 → 3.5.3
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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/qr-code_2.cjs.entry.js +7 -12
- package/dist/cjs/qr-code_2.cjs.entry.js.map +1 -1
- package/dist/cjs/zero-account.cjs.js +1 -1
- package/dist/collection/components/zero-account/websocket.js +3 -3
- package/dist/collection/components/zero-account/websocket.js.map +1 -1
- package/dist/collection/components/zero-account/zero-account.js +4 -62
- package/dist/collection/components/zero-account/zero-account.js.map +1 -1
- package/dist/components/zero-account.js +7 -15
- package/dist/components/zero-account.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/qr-code_2.entry.js +7 -12
- package/dist/esm/qr-code_2.entry.js.map +1 -1
- package/dist/esm/zero-account.js +1 -1
- package/dist/types/components/zero-account/zero-account.d.ts +0 -3
- package/dist/types/components.d.ts +0 -6
- package/dist/zero-account/{p-1c2b839d.entry.js → p-f8e874af.entry.js} +2 -2
- package/dist/zero-account/p-f8e874af.entry.js.map +1 -0
- package/dist/zero-account/zero-account.esm.js +1 -1
- package/dist/zero-account/zero-account.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/zero-account/p-1c2b839d.entry.js.map +0 -1
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ const index = require('./index-ef57218a.js');
|
|
|
6
6
|
|
|
7
7
|
const defineCustomElements = (win, options) => {
|
|
8
8
|
if (typeof window === 'undefined') return undefined;
|
|
9
|
-
return index.bootstrapLazy([["qr-code_2.cjs",[[1,"zero-account",{"appId":[1,"app-id"],"updateInterval":[2,"update-interval"],"callbackURL":[1,"callback-url"],"
|
|
9
|
+
return index.bootstrapLazy([["qr-code_2.cjs",[[1,"zero-account",{"appId":[1,"app-id"],"updateInterval":[2,"update-interval"],"callbackURL":[1,"callback-url"],"level":[1],"environment":[1],"enableWithCredentials":[4,"enable-with-credentials"],"themePreset":[1,"theme-preset"],"autoStartApp":[4,"auto-start-app"],"modalOpen":[32],"isAnimating":[32],"url":[32]},[[4,"0account-toggle-modal","toggleModal"],[4,"0account-close-modal","_closeModal"],[4,"0account-authenticated","_closeModal"],[4,"0account-logout","logout"],[4,"0account-open-app","openApp"]]],[0,"qr-code",{"url":[1],"level":[1],"class":[1],"color":[1]}]]]], options);
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
exports.setNonce = index.setNonce;
|
|
@@ -1254,10 +1254,10 @@ const zeroAuthenticated = '0account-authenticated';
|
|
|
1254
1254
|
// const zeroAuthenticationFailed = '0account-authentication-failed';
|
|
1255
1255
|
function debounce(func, timeout = 300) {
|
|
1256
1256
|
let timer;
|
|
1257
|
-
return (
|
|
1257
|
+
return () => {
|
|
1258
1258
|
clearTimeout(timer);
|
|
1259
1259
|
timer = setTimeout(() => {
|
|
1260
|
-
func
|
|
1260
|
+
func();
|
|
1261
1261
|
}, timeout);
|
|
1262
1262
|
};
|
|
1263
1263
|
}
|
|
@@ -1341,7 +1341,7 @@ class WS {
|
|
|
1341
1341
|
}
|
|
1342
1342
|
send(action, data) {
|
|
1343
1343
|
if (!this.socket || !this.socket.readyState || this.socket.readyState !== WebSocket.OPEN) {
|
|
1344
|
-
const retry = debounce(this.send.bind(this), 1000);
|
|
1344
|
+
const retry = debounce(this.send.bind(this, action, data), 1000);
|
|
1345
1345
|
return retry();
|
|
1346
1346
|
}
|
|
1347
1347
|
const msg = {
|
|
@@ -1447,10 +1447,7 @@ const ZeroAccount = class {
|
|
|
1447
1447
|
this.appId = undefined;
|
|
1448
1448
|
this.updateInterval = 3 * 60 * 1000;
|
|
1449
1449
|
this.callbackURL = DEFAULT_CALLBACK_URL;
|
|
1450
|
-
this.modal = true;
|
|
1451
1450
|
this.level = ErrorCorrectionLevel.M;
|
|
1452
|
-
this.primaryColor = '#3C444F';
|
|
1453
|
-
this.secondaryColor = undefined;
|
|
1454
1451
|
this.environment = Environment.production;
|
|
1455
1452
|
this.enableWithCredentials = false;
|
|
1456
1453
|
this.themePreset = ThemePreset.light;
|
|
@@ -1484,16 +1481,14 @@ const ZeroAccount = class {
|
|
|
1484
1481
|
this._closeModal();
|
|
1485
1482
|
}
|
|
1486
1483
|
openApp() {
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
window.location.href = this.url;
|
|
1490
|
-
}
|
|
1484
|
+
this.refreshQR(true);
|
|
1485
|
+
window.location.assign(this.url);
|
|
1491
1486
|
}
|
|
1492
1487
|
render() {
|
|
1493
1488
|
const logoColor = this.themePreset === ThemePreset.light ? '#7263FA' : '#FFFFF9';
|
|
1494
1489
|
const qrColor = '#000';
|
|
1495
|
-
return (index.h(index.Host, { key: '
|
|
1496
|
-
index.h("button", { class: `button ${this.themePreset}`, onClick: () => this.toggleModal() }, index.h(Logo, { className: 'button__logo', color: logoColor }), "use 0account"), index.h("div", { key: '
|
|
1490
|
+
return (index.h(index.Host, { key: 'd040d1baf982d80122894d74cb3c6a1006ad55d2' }, index.h("slot", { key: '4ef5cf8eb17120f75a55f4156b6aa35b8b606a2f' }), this.host.childNodes.length === 0 &&
|
|
1491
|
+
index.h("button", { class: `button ${this.themePreset}`, onClick: () => this.toggleModal() }, index.h(Logo, { className: 'button__logo', color: logoColor }), "use 0account"), index.h("div", { key: 'ef6940947a74ee650607e784a29bf688de571d6f', ref: el => this.modalEl = el, onClick: (e) => this.closeModal(e), class: `modal ${this.themePreset} ${this.isAnimating ? 'modal-animated' : ''} ${this.modalOpen ? '' : 'modal--hidden'}` }, index.h("div", { key: 'e04280fa23b3472e866b5c4245ef5b1158f6ffe4', class: 'modal__content' }, index.h("div", { key: 'faf17215389285c8694038495df5268168229e91', ref: el => this.closeButtonEl = el, class: 'modal__close-button' }), index.h("div", { key: 'e5f42d45b8f18a4301f511c9ea4c83ceb298f072', class: 'modal__qrcode__container' }, index.h("qr-code", { key: '37175c2f97073d2c98093265e765d1dd80a2df7b', url: this.url, class: `modal__qrcode`, level: this.level, color: qrColor }), index.h("div", { key: 'bdf8e52beac917b311791da030c60aef2c21bbc9', class: 'circle__overlay' }, index.h("div", { key: 'cd9d96ff07fe1564739caa9a46021abb86519415', class: 'circle' }), index.h("div", { key: 'a707a2f44968790acaf34aa756e6ac9e5bf6ab10', class: 'circle circle--medium' }), index.h("div", { key: '9d89f75b0099596a09465dc46b99a7c20a7b0265', class: 'circle circle--large' })), index.h(Logo, { key: '99f112786915ad6bc0c15e4167d284f3ee0de6a0', className: 'modal__logo', color: logoColor })), index.h("div", { key: '8189e5b4f00076e6918fa7c988e0931ea8ad53ce', class: 'modal__buttons' }, index.h("button", { key: '4d2abae182bef662107ae3408c3d5d3e11b6ce46', disabled: this.isAnimating, onClick: () => this.openApp(), class: 'modal__button' }, "Open 0account"), index.h("a", { key: '9419f987ec6a438a1b9cf27cded8b0f9e5cdadd6', href: 'https://0account.com/downloads', class: 'modal__link' }, "Download"))))));
|
|
1497
1492
|
}
|
|
1498
1493
|
initServices() {
|
|
1499
1494
|
if (this.logger && this.uaParser && this.ws)
|