@lukso/up-connector 0.6.0-dev.5ea12c5 → 0.6.0-dev.c21633f
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/account-modal.cjs +3 -3
- package/dist/account-modal.js +2 -2
- package/dist/auto-setup.cjs +3 -3
- package/dist/auto-setup.js +2 -2
- package/dist/backup-modal.cjs +3 -3
- package/dist/backup-modal.js +2 -2
- package/dist/{chunk-GCYDV7FB.cjs → chunk-2CKXEZQF.cjs} +46 -76
- package/dist/chunk-2CKXEZQF.cjs.map +1 -0
- package/dist/{chunk-CKVXLOXK.cjs → chunk-E34NRQRA.cjs} +3 -3
- package/dist/{chunk-CKVXLOXK.cjs.map → chunk-E34NRQRA.cjs.map} +1 -1
- package/dist/{chunk-DQ663HKR.js → chunk-I5I6SZZ5.js} +2 -2
- package/dist/{chunk-YIWSPI4I.js → chunk-LIHQISFN.js} +2 -2
- package/dist/{chunk-GFVUWAG4.cjs → chunk-MEEN5QJZ.cjs} +3 -3
- package/dist/{chunk-GFVUWAG4.cjs.map → chunk-MEEN5QJZ.cjs.map} +1 -1
- package/dist/{chunk-QZ55O6GN.js → chunk-QOAWX2VD.js} +2 -2
- package/dist/{chunk-A5RRWZ7W.js → chunk-RCCGJ3DC.js} +2 -2
- package/dist/{chunk-SAQWNAQ6.js → chunk-RO5M7PBL.js} +50 -80
- package/dist/{chunk-SAQWNAQ6.js.map → chunk-RO5M7PBL.js.map} +1 -1
- package/dist/{chunk-3IJAXTQI.cjs → chunk-U53KATZW.cjs} +3 -3
- package/dist/{chunk-3IJAXTQI.cjs.map → chunk-U53KATZW.cjs.map} +1 -1
- package/dist/{chunk-XGIT7YUY.js → chunk-UPWE4L5Z.js} +2 -2
- package/dist/{chunk-XGIT7YUY.js.map → chunk-UPWE4L5Z.js.map} +1 -1
- package/dist/{chunk-ZRA7ZVHJ.cjs → chunk-UQZN2AKN.cjs} +3 -3
- package/dist/{chunk-ZRA7ZVHJ.cjs.map → chunk-UQZN2AKN.cjs.map} +1 -1
- package/dist/{chunk-XOKG3KIL.cjs → chunk-ZWXGWUXQ.cjs} +2 -2
- package/dist/{chunk-XOKG3KIL.cjs.map → chunk-ZWXGWUXQ.cjs.map} +1 -1
- package/dist/connect-modal/index.cjs +2 -2
- package/dist/connect-modal/index.d.cts +1 -1
- package/dist/connect-modal/index.d.ts +1 -1
- package/dist/connect-modal/index.js +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/restore-modal.cjs +3 -3
- package/dist/restore-modal.js +2 -2
- package/dist/{wagmi-DgjkdmGk.d.ts → wagmi-84MPgN9w.d.cts} +0 -15
- package/dist/{wagmi-DgjkdmGk.d.cts → wagmi-84MPgN9w.d.ts} +0 -15
- package/package.json +5 -5
- package/src/connect-modal/components/connection-view.ts +16 -9
- package/src/connect-modal/components/eoa-connection-view.ts +9 -5
- package/src/connect-modal/components/qr-code-view.ts +4 -4
- package/src/connect-modal/connect-modal.templates.ts +7 -6
- package/src/connect-modal/connect-modal.ts +16 -60
- package/dist/chunk-GCYDV7FB.cjs.map +0 -1
- /package/dist/{chunk-DQ663HKR.js.map → chunk-I5I6SZZ5.js.map} +0 -0
- /package/dist/{chunk-YIWSPI4I.js.map → chunk-LIHQISFN.js.map} +0 -0
- /package/dist/{chunk-QZ55O6GN.js.map → chunk-QOAWX2VD.js.map} +0 -0
- /package/dist/{chunk-A5RRWZ7W.js.map → chunk-RCCGJ3DC.js.map} +0 -0
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk2CKXEZQFcjs = require('../chunk-2CKXEZQF.cjs');
|
|
11
11
|
require('../chunk-ZBDE64SD.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -18,5 +18,5 @@ require('../chunk-ZBDE64SD.cjs');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
exports.ConnectModal =
|
|
21
|
+
exports.ConnectModal = _chunk2CKXEZQFcjs.ConnectModal; exports.ConnectModalBase = _chunk2CKXEZQFcjs.ConnectModalBase; exports.disconnect = _chunk2CKXEZQFcjs.disconnect; exports.getConnection = _chunk2CKXEZQFcjs.getConnection; exports.getWagmiSetup = _chunk2CKXEZQFcjs.getWagmiSetup; exports.setupConnectModal = _chunk2CKXEZQFcjs.setupWagmi; exports.wagmi = _chunk2CKXEZQFcjs.wagmiService; exports.watchConnection = _chunk2CKXEZQFcjs.watchConnection;
|
|
22
22
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
export { C as ConnectModal, c as ConnectModalSetup, d as ConnectModalTheme, b as ConnectionModalView, e as WagmiConnection, a as WagmiConnector, l as Wallet, W as WalletConnector, f as disconnect, g as getConnection, h as getWagmiSetup, s as setupConnectModal, w as wagmi, i as watchConnection } from '../wagmi-
|
|
3
|
+
export { C as ConnectModal, c as ConnectModalSetup, d as ConnectModalTheme, b as ConnectionModalView, e as WagmiConnection, a as WagmiConnector, l as Wallet, W as WalletConnector, f as disconnect, g as getConnection, h as getWagmiSetup, s as setupConnectModal, w as wagmi, i as watchConnection } from '../wagmi-84MPgN9w.cjs';
|
|
4
4
|
|
|
5
5
|
declare class ConnectModalBase extends LitElement {
|
|
6
6
|
static styles: lit.CSSResult[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement } from 'lit';
|
|
3
|
-
export { C as ConnectModal, c as ConnectModalSetup, d as ConnectModalTheme, b as ConnectionModalView, e as WagmiConnection, a as WagmiConnector, l as Wallet, W as WalletConnector, f as disconnect, g as getConnection, h as getWagmiSetup, s as setupConnectModal, w as wagmi, i as watchConnection } from '../wagmi-
|
|
3
|
+
export { C as ConnectModal, c as ConnectModalSetup, d as ConnectModalTheme, b as ConnectionModalView, e as WagmiConnection, a as WagmiConnector, l as Wallet, W as WalletConnector, f as disconnect, g as getConnection, h as getWagmiSetup, s as setupConnectModal, w as wagmi, i as watchConnection } from '../wagmi-84MPgN9w.js';
|
|
4
4
|
|
|
5
5
|
declare class ConnectModalBase extends LitElement {
|
|
6
6
|
static styles: lit.CSSResult[];
|
package/dist/index.cjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkMEEN5QJZcjs = require('./chunk-MEEN5QJZ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkU53KATZWcjs = require('./chunk-U53KATZW.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
var _chunk7LQ5EB2Xcjs = require('./chunk-7LQ5EB2X.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunkUQZN2AKNcjs = require('./chunk-UQZN2AKN.cjs');
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
var
|
|
21
|
-
require('./chunk-
|
|
20
|
+
var _chunkE34NRQRAcjs = require('./chunk-E34NRQRA.cjs');
|
|
21
|
+
require('./chunk-ZWXGWUXQ.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -29,7 +29,7 @@ require('./chunk-XOKG3KIL.cjs');
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
var
|
|
32
|
+
var _chunk2CKXEZQFcjs = require('./chunk-2CKXEZQF.cjs');
|
|
33
33
|
require('./chunk-ZBDE64SD.cjs');
|
|
34
34
|
|
|
35
35
|
// src/connector.ts
|
|
@@ -87,7 +87,7 @@ var UPConnector = class {
|
|
|
87
87
|
}
|
|
88
88
|
async startWagmiSync() {
|
|
89
89
|
try {
|
|
90
|
-
const connection = await
|
|
90
|
+
const connection = await _chunk2CKXEZQFcjs.getConnection.call(void 0, );
|
|
91
91
|
if (!connection) {
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
@@ -98,7 +98,7 @@ var UPConnector = class {
|
|
|
98
98
|
connection.chainId
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
|
-
this.wagmiUnsubscribe = await
|
|
101
|
+
this.wagmiUnsubscribe = await _chunk2CKXEZQFcjs.watchConnection.call(void 0, (connection2) => {
|
|
102
102
|
const account = {
|
|
103
103
|
isConnected: connection2.status === "connected",
|
|
104
104
|
address: connection2.address,
|
|
@@ -211,7 +211,7 @@ var UPConnector = class {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
async handleDisconnection() {
|
|
214
|
-
await
|
|
214
|
+
await _chunk2CKXEZQFcjs.disconnect.call(void 0, );
|
|
215
215
|
this.connectedAddress = void 0;
|
|
216
216
|
this.connectedProvider = void 0;
|
|
217
217
|
this.connectedChainId = void 0;
|
|
@@ -796,5 +796,5 @@ var WindowPopupInstance = class extends BasePopupInstance {
|
|
|
796
796
|
|
|
797
797
|
|
|
798
798
|
|
|
799
|
-
exports.AccountModal =
|
|
799
|
+
exports.AccountModal = _chunkMEEN5QJZcjs.AccountModal; exports.BackupModal = _chunkUQZN2AKNcjs.BackupModal; exports.ConnectModal = _chunk2CKXEZQFcjs.ConnectModal; exports.DraggableAvatar = _chunk7LQ5EB2Xcjs.DraggableAvatar; exports.EMBEDDED_WALLET_ID = _chunkU53KATZWcjs.EMBEDDED_WALLET_ID; exports.EMBEDDED_WALLET_URL_DEV = _chunkU53KATZWcjs.EMBEDDED_WALLET_URL_DEV; exports.EMBEDDED_WALLET_URL_PROD = _chunkU53KATZWcjs.EMBEDDED_WALLET_URL_PROD; exports.ModalPopupInstance = ModalPopupInstance; exports.RestoreModal = _chunkE34NRQRAcjs.RestoreModal; exports.UPConnector = UPConnector; exports.UP_EXTENSION_ID = _chunkU53KATZWcjs.UP_EXTENSION_ID; exports.WindowPopupInstance = WindowPopupInstance; exports.createAvatar = _chunk7LQ5EB2Xcjs.createAvatar; exports.createConnector = createConnector; exports.default = createConnector; exports.disconnect = _chunk2CKXEZQFcjs.disconnect; exports.fromWagmiConnector = _chunk2CKXEZQFcjs.fromWagmiConnector; exports.fromWagmiConnectors = _chunk2CKXEZQFcjs.fromWagmiConnectors; exports.getConnection = _chunk2CKXEZQFcjs.getConnection; exports.getWagmiSetup = _chunk2CKXEZQFcjs.getWagmiSetup; exports.setupConnectModal = _chunk2CKXEZQFcjs.setupWagmi; exports.setupLuksoConnector = _chunkU53KATZWcjs.setupLuksoConnector; exports.wagmi = _chunk2CKXEZQFcjs.wagmiService; exports.watchConnection = _chunk2CKXEZQFcjs.watchConnection;
|
|
800
800
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ export { EMBEDDED_WALLET_ID, EMBEDDED_WALLET_URL_DEV, EMBEDDED_WALLET_URL_PROD,
|
|
|
3
3
|
import { C as ConnectorConfig, D as DraggableAvatar, a as ConnectionState } from './avatar-CQkubMTK.cjs';
|
|
4
4
|
export { A as AddressData, b as AvatarOptions, W as WalletProvider, c as createAvatar } from './avatar-CQkubMTK.cjs';
|
|
5
5
|
export { BackupModal } from './backup-modal.cjs';
|
|
6
|
-
import { W as WalletConnector, C as ConnectModal } from './wagmi-
|
|
7
|
-
export { c as ConnectModalSetup, d as ConnectModalTheme, b as ConnectionModalView, e as WagmiConnection, a as WagmiConnector, f as disconnect, j as fromWagmiConnector, k as fromWagmiConnectors, g as getConnection, h as getWagmiSetup, s as setupConnectModal, w as wagmi, i as watchConnection } from './wagmi-
|
|
6
|
+
import { W as WalletConnector, C as ConnectModal } from './wagmi-84MPgN9w.cjs';
|
|
7
|
+
export { c as ConnectModalSetup, d as ConnectModalTheme, b as ConnectionModalView, e as WagmiConnection, a as WagmiConnector, f as disconnect, j as fromWagmiConnector, k as fromWagmiConnectors, g as getConnection, h as getWagmiSetup, s as setupConnectModal, w as wagmi, i as watchConnection } from './wagmi-84MPgN9w.cjs';
|
|
8
8
|
export { RestoreModal } from './restore-modal.cjs';
|
|
9
9
|
import 'lit';
|
|
10
10
|
import './index-D2orHGFi.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export { EMBEDDED_WALLET_ID, EMBEDDED_WALLET_URL_DEV, EMBEDDED_WALLET_URL_PROD,
|
|
|
3
3
|
import { C as ConnectorConfig, D as DraggableAvatar, a as ConnectionState } from './avatar-CQkubMTK.js';
|
|
4
4
|
export { A as AddressData, b as AvatarOptions, W as WalletProvider, c as createAvatar } from './avatar-CQkubMTK.js';
|
|
5
5
|
export { BackupModal } from './backup-modal.js';
|
|
6
|
-
import { W as WalletConnector, C as ConnectModal } from './wagmi-
|
|
7
|
-
export { c as ConnectModalSetup, d as ConnectModalTheme, b as ConnectionModalView, e as WagmiConnection, a as WagmiConnector, f as disconnect, j as fromWagmiConnector, k as fromWagmiConnectors, g as getConnection, h as getWagmiSetup, s as setupConnectModal, w as wagmi, i as watchConnection } from './wagmi-
|
|
6
|
+
import { W as WalletConnector, C as ConnectModal } from './wagmi-84MPgN9w.js';
|
|
7
|
+
export { c as ConnectModalSetup, d as ConnectModalTheme, b as ConnectionModalView, e as WagmiConnection, a as WagmiConnector, f as disconnect, j as fromWagmiConnector, k as fromWagmiConnectors, g as getConnection, h as getWagmiSetup, s as setupConnectModal, w as wagmi, i as watchConnection } from './wagmi-84MPgN9w.js';
|
|
8
8
|
export { RestoreModal } from './restore-modal.js';
|
|
9
9
|
import 'lit';
|
|
10
10
|
import './index-D2orHGFi.js';
|
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AccountModal
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LIHQISFN.js";
|
|
4
4
|
import {
|
|
5
5
|
EMBEDDED_WALLET_ID,
|
|
6
6
|
EMBEDDED_WALLET_URL_DEV,
|
|
7
7
|
EMBEDDED_WALLET_URL_PROD,
|
|
8
8
|
UP_EXTENSION_ID,
|
|
9
9
|
setupLuksoConnector
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QOAWX2VD.js";
|
|
11
11
|
import {
|
|
12
12
|
DraggableAvatar,
|
|
13
13
|
createAvatar
|
|
14
14
|
} from "./chunk-GKAVIDXP.js";
|
|
15
15
|
import {
|
|
16
16
|
BackupModal
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-I5I6SZZ5.js";
|
|
18
18
|
import {
|
|
19
19
|
RestoreModal
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-RCCGJ3DC.js";
|
|
21
|
+
import "./chunk-UPWE4L5Z.js";
|
|
22
22
|
import {
|
|
23
23
|
ConnectModal,
|
|
24
24
|
disconnect,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
setupWagmi,
|
|
30
30
|
wagmiService,
|
|
31
31
|
watchConnection
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-RO5M7PBL.js";
|
|
33
33
|
import "./chunk-EUXUH3YW.js";
|
|
34
34
|
|
|
35
35
|
// src/connector.ts
|
package/dist/restore-modal.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var _chunkE34NRQRAcjs = require('./chunk-E34NRQRA.cjs');
|
|
4
|
+
require('./chunk-ZWXGWUXQ.cjs');
|
|
5
5
|
require('./chunk-ZBDE64SD.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.RestoreModal =
|
|
8
|
+
exports.RestoreModal = _chunkE34NRQRAcjs.RestoreModal;
|
|
9
9
|
//# sourceMappingURL=restore-modal.cjs.map
|
package/dist/restore-modal.js
CHANGED
|
@@ -264,29 +264,14 @@ declare global {
|
|
|
264
264
|
declare const ConnectModal_base: any;
|
|
265
265
|
declare class ConnectModal extends ConnectModal_base {
|
|
266
266
|
open: boolean;
|
|
267
|
-
theme: ConnectModalTheme;
|
|
268
267
|
private connectors;
|
|
269
|
-
private isDark;
|
|
270
268
|
private modalView;
|
|
271
269
|
private qrCodeData;
|
|
272
|
-
private mediaQueryList;
|
|
273
270
|
updated(changedProperties: Map<string, any>): void;
|
|
274
|
-
connectedCallback(): void;
|
|
275
|
-
disconnectedCallback(): void;
|
|
276
|
-
/**
|
|
277
|
-
* Handle system theme changes
|
|
278
|
-
*
|
|
279
|
-
* @param event
|
|
280
|
-
*/
|
|
281
|
-
private handleMediaQueryChange;
|
|
282
271
|
/**
|
|
283
272
|
* Close modal
|
|
284
273
|
*/
|
|
285
274
|
handleClose(): void;
|
|
286
|
-
/**
|
|
287
|
-
* Update isDark state based on theme property
|
|
288
|
-
*/
|
|
289
|
-
private updateTheme;
|
|
290
275
|
private loadConnectors;
|
|
291
276
|
/**
|
|
292
277
|
* Successful connection handler
|
|
@@ -264,29 +264,14 @@ declare global {
|
|
|
264
264
|
declare const ConnectModal_base: any;
|
|
265
265
|
declare class ConnectModal extends ConnectModal_base {
|
|
266
266
|
open: boolean;
|
|
267
|
-
theme: ConnectModalTheme;
|
|
268
267
|
private connectors;
|
|
269
|
-
private isDark;
|
|
270
268
|
private modalView;
|
|
271
269
|
private qrCodeData;
|
|
272
|
-
private mediaQueryList;
|
|
273
270
|
updated(changedProperties: Map<string, any>): void;
|
|
274
|
-
connectedCallback(): void;
|
|
275
|
-
disconnectedCallback(): void;
|
|
276
|
-
/**
|
|
277
|
-
* Handle system theme changes
|
|
278
|
-
*
|
|
279
|
-
* @param event
|
|
280
|
-
*/
|
|
281
|
-
private handleMediaQueryChange;
|
|
282
271
|
/**
|
|
283
272
|
* Close modal
|
|
284
273
|
*/
|
|
285
274
|
handleClose(): void;
|
|
286
|
-
/**
|
|
287
|
-
* Update isDark state based on theme property
|
|
288
|
-
*/
|
|
289
|
-
private updateTheme;
|
|
290
275
|
private loadConnectors;
|
|
291
276
|
/**
|
|
292
277
|
* Successful connection handler
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lukso/up-connector",
|
|
3
|
-
"version": "0.6.0-dev.
|
|
3
|
+
"version": "0.6.0-dev.c21633f",
|
|
4
4
|
"description": "Universal Profile connector with draggable avatar and connection modal",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
"lit": "^3.3.1",
|
|
83
83
|
"ws": "^8.18.3",
|
|
84
84
|
"zxcvbn": "^4.4.2",
|
|
85
|
-
"@lukso/core": "1.1.0-dev.
|
|
86
|
-
"@lukso/passkey-auth": "1.2.0-dev.
|
|
87
|
-
"@lukso/transaction-view-core": "0.5.0-dev.
|
|
88
|
-
"@lukso/transaction-view-headless": "0.4.0-dev.
|
|
85
|
+
"@lukso/core": "1.1.0-dev.c21633f",
|
|
86
|
+
"@lukso/passkey-auth": "1.2.0-dev.c21633f",
|
|
87
|
+
"@lukso/transaction-view-core": "0.5.0-dev.c21633f",
|
|
88
|
+
"@lukso/transaction-view-headless": "0.4.0-dev.c21633f"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"@wagmi/connectors": "^7.0.0",
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
* Main connection view displaying primary Lukso connectors and option to show EOA connectors.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
withDeviceService,
|
|
9
|
+
withIntlService,
|
|
10
|
+
withTheme,
|
|
11
|
+
} from '@lukso/core/mixins'
|
|
8
12
|
import { html, type TemplateResult } from 'lit'
|
|
9
13
|
import { property } from 'lit/decorators.js'
|
|
10
14
|
|
|
@@ -25,8 +29,8 @@ import { walletConnectDeepLinkUrl } from '../utils/walletConnectDeepLinkUrl'
|
|
|
25
29
|
|
|
26
30
|
const logInfo = debug('connect-modal:info')
|
|
27
31
|
|
|
28
|
-
export class ConnectionView extends
|
|
29
|
-
withDeviceService(ConnectModalBase)
|
|
32
|
+
export class ConnectionView extends withTheme(
|
|
33
|
+
withIntlService(withDeviceService(ConnectModalBase))
|
|
30
34
|
) {
|
|
31
35
|
@property({ type: Boolean }) isConnecting = false
|
|
32
36
|
@property({ type: String }) connectingRdns: string | undefined = undefined
|
|
@@ -272,6 +276,7 @@ export class ConnectionView extends withIntlService(
|
|
|
272
276
|
return html`
|
|
273
277
|
<lukso-button
|
|
274
278
|
variant="secondary"
|
|
279
|
+
.theme=${this.theme}
|
|
275
280
|
size=${this.device?.isMobile ? 'medium' : 'large'}
|
|
276
281
|
is-full-width
|
|
277
282
|
?disabled=${isDisabled}
|
|
@@ -283,7 +288,7 @@ export class ConnectionView extends withIntlService(
|
|
|
283
288
|
name=${iconName}
|
|
284
289
|
size=${this.device?.isMobile ? 'small' : 'medium'}
|
|
285
290
|
class="mr-2"
|
|
286
|
-
secondary-color="neutral-100"
|
|
291
|
+
secondary-color="${this.theme === 'dark' ? 'neutral-20' : 'neutral-100'}"
|
|
287
292
|
></lukso-icon>
|
|
288
293
|
${label}
|
|
289
294
|
</lukso-button>
|
|
@@ -344,12 +349,12 @@ export class ConnectionView extends withIntlService(
|
|
|
344
349
|
private renderDivider(): TemplateResult<1> {
|
|
345
350
|
return html`
|
|
346
351
|
<div class="relative w-full my-2">
|
|
347
|
-
<div class="paragraph-inter-12-regular relative z-[1] bg-neutral-98 dark:bg-neutral-
|
|
352
|
+
<div class="paragraph-inter-12-regular relative z-[1] bg-neutral-98 dark:bg-neutral-10 px-4 text-neutral-40 dark:text-neutral-95 inline-block">
|
|
348
353
|
${this.formatMessage('connect_modal_or')}
|
|
349
354
|
</div>
|
|
350
|
-
<div class="absolute top-[13px] left-0 right-0 h-px bg-neutral-80 dark:bg-neutral-
|
|
355
|
+
<div class="absolute top-[13px] left-0 right-0 h-px bg-neutral-80 dark:bg-neutral-80" />
|
|
351
356
|
</div>
|
|
352
|
-
<div class="paragraph-inter-16-regular py-4">
|
|
357
|
+
<div class="paragraph-inter-16-regular py-4 text-neutral-20 dark:text-neutral-100">
|
|
353
358
|
${this.formatMessage('connect_modal_or_info')}
|
|
354
359
|
</div>
|
|
355
360
|
`
|
|
@@ -361,13 +366,13 @@ export class ConnectionView extends withIntlService(
|
|
|
361
366
|
<button
|
|
362
367
|
@click=${this.handleClose}
|
|
363
368
|
>
|
|
364
|
-
${renderCloseButton()}
|
|
369
|
+
${renderCloseButton(this.theme)}
|
|
365
370
|
</button>
|
|
366
371
|
</div>
|
|
367
372
|
<div class="flex flex-col items-center text-center">
|
|
368
373
|
${renderLogo()}
|
|
369
374
|
${renderTitle(this.formatMessage('connect_modal_title'))}
|
|
370
|
-
<p class="mb-6 paragraph-inter-16-regular">
|
|
375
|
+
<p class="mb-6 paragraph-inter-16-regular text-neutral-20 dark:text-neutral-100">
|
|
371
376
|
${this.formatMessage('connect_modal_description')}
|
|
372
377
|
</p>
|
|
373
378
|
<div class="${cn('flex w-full gap-2 mb-4', this.device?.isMobile ? 'flex-col-reverse' : 'flex-col')}">
|
|
@@ -378,6 +383,7 @@ export class ConnectionView extends withIntlService(
|
|
|
378
383
|
variant="secondary"
|
|
379
384
|
size=${this.device?.isMobile ? 'medium' : 'large'}
|
|
380
385
|
is-full-width
|
|
386
|
+
.theme=${this.theme}
|
|
381
387
|
?disabled=${this.isConnecting}
|
|
382
388
|
@click=${this.handleShowEoaConnections}
|
|
383
389
|
>
|
|
@@ -385,6 +391,7 @@ export class ConnectionView extends withIntlService(
|
|
|
385
391
|
name="wallet-outline"
|
|
386
392
|
size=${this.device?.isMobile ? 'small' : 'medium'}
|
|
387
393
|
class="mr-2"
|
|
394
|
+
color="${this.theme === 'dark' ? 'neutral-100' : 'neutral-20'}"
|
|
388
395
|
></lukso-icon>
|
|
389
396
|
${this.formatMessage('connect_modal_other_connectors')}
|
|
390
397
|
</lukso-button>
|
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Task } from '@lit/task'
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
withDeviceService,
|
|
10
|
+
withIntlService,
|
|
11
|
+
withTheme,
|
|
12
|
+
} from '@lukso/core/mixins'
|
|
9
13
|
import debug from 'debug'
|
|
10
14
|
import { html, nothing, type TemplateResult } from 'lit'
|
|
11
15
|
import { property, state } from 'lit/decorators.js'
|
|
@@ -40,8 +44,8 @@ import { getWagmiSetup } from '../services/wagmi'
|
|
|
40
44
|
|
|
41
45
|
const logInfo = debug('connect-modal:info')
|
|
42
46
|
|
|
43
|
-
export class EoaConnectionView extends
|
|
44
|
-
withDeviceService(ConnectModalBase)
|
|
47
|
+
export class EoaConnectionView extends withTheme(
|
|
48
|
+
withIntlService(withDeviceService(ConnectModalBase))
|
|
45
49
|
) {
|
|
46
50
|
@property({ type: Array }) connectors: WalletConnector[] = []
|
|
47
51
|
|
|
@@ -382,13 +386,13 @@ export class EoaConnectionView extends withIntlService(
|
|
|
382
386
|
<button
|
|
383
387
|
@click=${this.handleBack}
|
|
384
388
|
>
|
|
385
|
-
${renderBackButton()}
|
|
389
|
+
${renderBackButton(this.theme)}
|
|
386
390
|
</button>
|
|
387
391
|
|
|
388
392
|
<button
|
|
389
393
|
@click=${this.handleClose}
|
|
390
394
|
>
|
|
391
|
-
${renderCloseButton()}
|
|
395
|
+
${renderCloseButton(this.theme)}
|
|
392
396
|
</button>
|
|
393
397
|
</div>
|
|
394
398
|
<div class="flex flex-col items-center text-center">
|
|
@@ -10,12 +10,12 @@ import { ConnectModalBase } from '../connect-modal.base'
|
|
|
10
10
|
|
|
11
11
|
// Import lukso web components
|
|
12
12
|
import '@lukso/web-components/dist/components/lukso-qr-code'
|
|
13
|
-
import { withIntlService } from '@lukso/core/mixins'
|
|
13
|
+
import { withIntlService, withTheme } from '@lukso/core/mixins'
|
|
14
14
|
import { property } from 'lit/decorators.js'
|
|
15
15
|
import { renderBackButton, renderCloseButton } from '../connect-modal.templates'
|
|
16
16
|
import cubeGlassImage from '../images/up-cube-glass.png'
|
|
17
17
|
|
|
18
|
-
export class QrCodeView extends withIntlService(ConnectModalBase) {
|
|
18
|
+
export class QrCodeView extends withTheme(withIntlService(ConnectModalBase)) {
|
|
19
19
|
@property({ type: String }) data: string | undefined = undefined
|
|
20
20
|
|
|
21
21
|
/**
|
|
@@ -41,13 +41,13 @@ export class QrCodeView extends withIntlService(ConnectModalBase) {
|
|
|
41
41
|
<button
|
|
42
42
|
@click=${this.handleBack}
|
|
43
43
|
>
|
|
44
|
-
${renderBackButton()}
|
|
44
|
+
${renderBackButton(this.theme)}
|
|
45
45
|
</button>
|
|
46
46
|
|
|
47
47
|
<button
|
|
48
48
|
@click=${this.handleClose}
|
|
49
49
|
>
|
|
50
|
-
${renderCloseButton()}
|
|
50
|
+
${renderCloseButton(this.theme)}
|
|
51
51
|
</button>
|
|
52
52
|
</div>
|
|
53
53
|
<div class="flex flex-col items-center text-center">
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
+
import type { Theme } from '@lukso/core'
|
|
1
2
|
import { cn } from '@lukso/web-components/tools'
|
|
2
3
|
import { html } from 'lit'
|
|
3
4
|
import cubeGlassImage from './images/up-cube-glass.png'
|
|
4
5
|
|
|
5
|
-
export const renderCloseButton = () =>
|
|
6
|
+
export const renderCloseButton = (theme: Theme) =>
|
|
6
7
|
html`<lukso-icon name="close-lg"
|
|
7
|
-
class="cursor-pointer transition-opacity hover:opacity-60"></lukso-icon>`
|
|
8
|
+
class="cursor-pointer transition-opacity hover:opacity-60" color="${theme === 'dark' ? 'neutral-100' : 'neutral-20'}"></lukso-icon>`
|
|
8
9
|
|
|
9
|
-
export const renderBackButton = () =>
|
|
10
|
-
html`<lukso-icon name="arrow-left-lg" class="cursor-pointer transition-opacity hover:opacity-60"></lukso-icon>`
|
|
10
|
+
export const renderBackButton = (theme: Theme) =>
|
|
11
|
+
html`<lukso-icon name="arrow-left-lg" class="cursor-pointer transition-opacity hover:opacity-60" color="${theme === 'dark' ? 'neutral-100' : 'neutral-20'}"></lukso-icon>`
|
|
11
12
|
|
|
12
13
|
export const renderLogo = () =>
|
|
13
14
|
html`<img src="${cubeGlassImage}" alt="" class="mb-5 w-14 animate-bounce2" />`
|
|
14
15
|
|
|
15
16
|
export const renderTitle = (title: string) =>
|
|
16
|
-
html`<h2 class="m-0 mb-4 text-neutral-20 dark:text-
|
|
17
|
+
html`<h2 class="m-0 mb-4 text-neutral-20 dark:text-neutral-100 heading-inter-21-semi-bold">
|
|
17
18
|
${title}
|
|
18
19
|
</h2>`
|
|
19
20
|
|
|
20
21
|
export const renderPlaceholder = (style: string) =>
|
|
21
|
-
html`<div class="${cn('bg-neutral-90 dark:bg-neutral-
|
|
22
|
+
html`<div class="${cn('bg-neutral-90 dark:bg-neutral-20 rounded-4 animate-pulse', style)}"></div>`
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Framework-agnostic connection modal for wallet/profile connections.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { withDeviceService } from '@lukso/core/mixins'
|
|
7
|
+
import { withDeviceService, withTheme } from '@lukso/core/mixins'
|
|
8
8
|
import debug from 'debug'
|
|
9
9
|
import { html, type TemplateResult } from 'lit'
|
|
10
10
|
import { property, state } from 'lit/decorators.js'
|
|
@@ -12,7 +12,6 @@ import { property, state } from 'lit/decorators.js'
|
|
|
12
12
|
import { ConnectModalBase } from './connect-modal.base.js'
|
|
13
13
|
import type {
|
|
14
14
|
ConnectionModalView,
|
|
15
|
-
ConnectModalTheme,
|
|
16
15
|
WalletConnector,
|
|
17
16
|
} from './connect-modal.types'
|
|
18
17
|
import { fromWagmiConnectors, getWagmiSetup } from './services/wagmi'
|
|
@@ -24,64 +23,26 @@ import './components/qr-code-view'
|
|
|
24
23
|
|
|
25
24
|
const logInfo = debug('connect-modal:info')
|
|
26
25
|
|
|
27
|
-
export class ConnectModal extends
|
|
26
|
+
export class ConnectModal extends withTheme(
|
|
27
|
+
withDeviceService(ConnectModalBase)
|
|
28
|
+
) {
|
|
28
29
|
// Public properties
|
|
29
30
|
@property({ type: Boolean, reflect: true }) open = false
|
|
30
|
-
@property({ type: String, reflect: true }) theme: ConnectModalTheme = 'light'
|
|
31
31
|
|
|
32
32
|
// Private state
|
|
33
33
|
@state() private connectors: WalletConnector[] = []
|
|
34
|
-
|
|
34
|
+
// isDark state is provided by withTheme mixin
|
|
35
35
|
@state() private modalView: ConnectionModalView = 'up_connection'
|
|
36
36
|
@state() private qrCodeData: string | undefined = undefined
|
|
37
37
|
|
|
38
|
-
private mediaQueryList: MediaQueryList | null = null
|
|
39
|
-
|
|
40
38
|
updated(changedProperties: Map<string, any>): void {
|
|
39
|
+
super.updated(changedProperties)
|
|
40
|
+
|
|
41
41
|
// Reset view and load connectors when modal opens
|
|
42
42
|
if (changedProperties.has('open') && this.open) {
|
|
43
43
|
this.modalView = 'up_connection' // Reset to main view when modal opens
|
|
44
44
|
this.loadConnectors()
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
// Handle theme changes
|
|
48
|
-
if (changedProperties.has('theme')) {
|
|
49
|
-
this.updateTheme()
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
connectedCallback(): void {
|
|
54
|
-
super.connectedCallback()
|
|
55
|
-
this.updateTheme()
|
|
56
|
-
|
|
57
|
-
// Listen for system theme changes when in 'auto' mode
|
|
58
|
-
if (this.theme === 'auto') {
|
|
59
|
-
this.mediaQueryList = window.matchMedia('(prefers-color-scheme: dark)')
|
|
60
|
-
this.mediaQueryList.addEventListener(
|
|
61
|
-
'change',
|
|
62
|
-
this.handleMediaQueryChange
|
|
63
|
-
)
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
disconnectedCallback(): void {
|
|
68
|
-
super.disconnectedCallback()
|
|
69
|
-
|
|
70
|
-
if (this.mediaQueryList) {
|
|
71
|
-
this.mediaQueryList.removeEventListener(
|
|
72
|
-
'change',
|
|
73
|
-
this.handleMediaQueryChange
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Handle system theme changes
|
|
80
|
-
*
|
|
81
|
-
* @param event
|
|
82
|
-
*/
|
|
83
|
-
private handleMediaQueryChange = (event: MediaQueryListEvent): void => {
|
|
84
|
-
this.isDark = event.matches
|
|
85
46
|
}
|
|
86
47
|
|
|
87
48
|
/**
|
|
@@ -95,17 +56,6 @@ export class ConnectModal extends withDeviceService(ConnectModalBase) {
|
|
|
95
56
|
)
|
|
96
57
|
}
|
|
97
58
|
|
|
98
|
-
/**
|
|
99
|
-
* Update isDark state based on theme property
|
|
100
|
-
*/
|
|
101
|
-
private updateTheme(): void {
|
|
102
|
-
if (this.theme === 'auto') {
|
|
103
|
-
this.isDark = window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
104
|
-
} else {
|
|
105
|
-
this.isDark = this.theme === 'dark'
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
59
|
private async loadConnectors(): Promise<void> {
|
|
110
60
|
const globalWagmiSetup = getWagmiSetup()
|
|
111
61
|
logInfo('Global wagmi setup:', globalWagmiSetup)
|
|
@@ -217,12 +167,17 @@ export class ConnectModal extends withDeviceService(ConnectModalBase) {
|
|
|
217
167
|
private renderModalContent(): TemplateResult<1> {
|
|
218
168
|
switch (this.modalView) {
|
|
219
169
|
case 'qr_code':
|
|
220
|
-
return html`<qr-code-view
|
|
221
|
-
|
|
170
|
+
return html`<qr-code-view
|
|
171
|
+
.data=${this.qrCodeData}
|
|
172
|
+
.theme=${this.theme}
|
|
173
|
+
@on-back=${this.handleBackToConnectionView}
|
|
174
|
+
@on-close=${this.handleClose}
|
|
175
|
+
></qr-code-view>`
|
|
222
176
|
case 'eoa_connection':
|
|
223
177
|
return html`
|
|
224
178
|
<eoa-connection-view
|
|
225
179
|
.connectors=${this.connectors}
|
|
180
|
+
.theme=${this.theme}
|
|
226
181
|
@on-back=${this.handleBackToConnectionView}
|
|
227
182
|
@on-close=${this.handleClose}
|
|
228
183
|
@on-connect=${this.handleOnConnectSuccess}
|
|
@@ -233,6 +188,7 @@ export class ConnectModal extends withDeviceService(ConnectModalBase) {
|
|
|
233
188
|
return html`
|
|
234
189
|
<connection-view
|
|
235
190
|
.connectors=${this.connectors}
|
|
191
|
+
.theme=${this.theme}
|
|
236
192
|
@on-back=${this.handleBackToConnectionView}
|
|
237
193
|
@on-close=${this.handleClose}
|
|
238
194
|
@on-connect=${this.handleOnConnectSuccess}
|
|
@@ -252,7 +208,7 @@ export class ConnectModal extends withDeviceService(ConnectModalBase) {
|
|
|
252
208
|
size="auto"
|
|
253
209
|
@on-backdrop-click=${this.handleClose}
|
|
254
210
|
>
|
|
255
|
-
<div class="p-6
|
|
211
|
+
<div class="p-6 w-full sm:w-[372px]">
|
|
256
212
|
${this.renderModalContent()}
|
|
257
213
|
</div>
|
|
258
214
|
</lukso-modal>
|