@web3modal/scaffold
Advanced tools
Comparing version 3.4.0-7da5cccb to 3.4.0-7f62a20e
@@ -77,2 +77,5 @@ import { AccountController, BlockchainApiController, ConnectionController, ConnectorController, CoreHelperUtil, EventsController, ModalController, NetworkController, OptionsController, PublicStateController, ThemeController, SIWEController } from '@web3modal/core'; | ||
} | ||
setLoading(loading) { | ||
ModalController.setLoading(loading); | ||
} | ||
getThemeMode() { | ||
@@ -79,0 +82,0 @@ return ThemeController.state.themeMode; |
@@ -20,3 +20,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
this.open = ModalController.state.open; | ||
this.unsubscribe.push(ModalController.subscribeKey('open', val => (this.open = val))); | ||
this.loading = ModalController.state.loading; | ||
this.unsubscribe.push(ModalController.subscribe(val => { | ||
this.open = val.open; | ||
this.loading = val.loading; | ||
})); | ||
} | ||
@@ -27,9 +31,10 @@ disconnectedCallback() { | ||
render() { | ||
const isLoading = this.loading || this.open; | ||
return html ` | ||
<wui-connect-button | ||
size=${ifDefined(this.size)} | ||
.loading=${this.open} | ||
.loading=${isLoading} | ||
@click=${this.onClick.bind(this)} | ||
> | ||
${this.open ? this.loadingLabel : this.label} | ||
${isLoading ? this.loadingLabel : this.label} | ||
</wui-connect-button> | ||
@@ -59,2 +64,5 @@ `; | ||
], W3mConnectButton.prototype, "open", void 0); | ||
__decorate([ | ||
state() | ||
], W3mConnectButton.prototype, "loading", void 0); | ||
W3mConnectButton = __decorate([ | ||
@@ -61,0 +69,0 @@ customElement('w3m-connect-button') |
@@ -19,5 +19,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
this.connected = AccountController.state.isConnected; | ||
this.loading = ModalController.state.loading; | ||
this.unsubscribe.push(...[ | ||
NetworkController.subscribeKey('caipNetwork', val => (this.network = val)), | ||
AccountController.subscribeKey('isConnected', val => (this.connected = val)) | ||
AccountController.subscribeKey('isConnected', val => (this.connected = val)), | ||
ModalController.subscribeKey('loading', val => (this.loading = val)) | ||
]); | ||
@@ -31,3 +33,3 @@ } | ||
<wui-network-button | ||
.disabled=${Boolean(this.disabled)} | ||
.disabled=${Boolean(this.disabled || this.loading)} | ||
imageSrc=${ifDefined(AssetUtil.getNetworkImage(this.network))} | ||
@@ -53,2 +55,5 @@ @click=${this.onClick.bind(this)} | ||
], W3mNetworkButton.prototype, "connected", void 0); | ||
__decorate([ | ||
state() | ||
], W3mNetworkButton.prototype, "loading", void 0); | ||
W3mNetworkButton = __decorate([ | ||
@@ -55,0 +60,0 @@ customElement('w3m-network-button') |
@@ -35,2 +35,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
render() { | ||
const multipleConnectors = this.connectors.length > 1; | ||
const connector = this.connectors.find(c => c.type === 'EMAIL'); | ||
@@ -66,3 +67,3 @@ const isSubmit = !this.loading && this.email.length > 3; | ||
</form> | ||
<wui-separator text="or"></wui-separator> | ||
${multipleConnectors ? html `<wui-separator text="or"></wui-separator>` : null} | ||
`; | ||
@@ -69,0 +70,0 @@ } |
@@ -7,3 +7,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
}; | ||
import { AccountController, AssetController, ConnectionController, CoreHelperUtil, EventsController, ModalController, NetworkController, RouterController, SnackController } from '@web3modal/core'; | ||
import { AccountController, AssetController, ConnectionController, CoreHelperUtil, EventsController, ModalController, NetworkController, RouterController, SnackController, ConnectorController, ConstantsUtil, StorageUtil } from '@web3modal/core'; | ||
import { UiHelperUtil, customElement } from '@web3modal/ui'; | ||
@@ -19,2 +19,3 @@ import { LitElement, html } from 'lit'; | ||
this.networkImages = AssetController.state.networkImages; | ||
this.connectors = ConnectorController.state.connectors; | ||
this.address = AccountController.state.address; | ||
@@ -102,2 +103,4 @@ this.profileImage = AccountController.state.profileImage; | ||
<wui-flex flexDirection="column" gap="xs" .padding=${['0', 's', 's', 's']}> | ||
${this.emailCardTemplate()} | ||
<wui-list-item | ||
@@ -137,2 +140,17 @@ .variant=${networkImage ? 'image' : 'icon'} | ||
} | ||
emailCardTemplate() { | ||
const type = StorageUtil.getConnectedConnector(); | ||
const isEmail = this.connectors.find(c => c.type === 'EMAIL'); | ||
if (!isEmail || type !== 'EMAIL') { | ||
return null; | ||
} | ||
return html ` | ||
<wui-notice-card | ||
@click=${this.onGoToSecureSite.bind(this)} | ||
label="Enjoy all your wallet potential" | ||
description="Switch to a Non Custodial Wallet in a minute" | ||
icon="wallet" | ||
></wui-notice-card> | ||
`; | ||
} | ||
explorerBtnTemplate() { | ||
@@ -198,2 +216,5 @@ const { addressExplorerUrl } = AccountController.state; | ||
} | ||
onGoToSecureSite() { | ||
CoreHelperUtil.openHref(ConstantsUtil.SECURE_SITE_DASHBOARD, '_blank'); | ||
} | ||
}; | ||
@@ -200,0 +221,0 @@ W3mAccountView.styles = styles; |
@@ -14,3 +14,7 @@ import { css } from 'lit'; | ||
} | ||
wui-notice-card { | ||
margin-bottom: var(--wui-spacing-3xs); | ||
} | ||
`; | ||
//# sourceMappingURL=styles.js.map |
@@ -71,2 +71,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
featuredTemplate() { | ||
const connector = this.connectors.find(c => c.type === 'WALLET_CONNECT'); | ||
if (!connector) { | ||
return null; | ||
} | ||
const { featured } = ApiController.state; | ||
@@ -153,2 +157,6 @@ if (!featured.length) { | ||
allWalletsTemplate() { | ||
const connector = this.connectors.find(c => c.type === 'WALLET_CONNECT'); | ||
if (!connector) { | ||
return null; | ||
} | ||
const roundedCount = Math.floor(ApiController.state.count / 10) * 10; | ||
@@ -167,2 +175,6 @@ return html ` | ||
recommendedTemplate() { | ||
const connector = this.connectors.find(c => c.type === 'WALLET_CONNECT'); | ||
if (!connector) { | ||
return null; | ||
} | ||
const { recommended } = ApiController.state; | ||
@@ -169,0 +181,0 @@ const { customWallets, featuredWalletIds } = OptionsController.state; |
@@ -1,2 +0,2 @@ | ||
import type { ConnectionControllerClient, SIWEControllerClient, EventsControllerState, NetworkControllerClient, NetworkControllerState, OptionsControllerState, PublicStateControllerState, ThemeControllerState, ThemeMode, ThemeVariables, SIWEControllerClientState } from '@web3modal/core'; | ||
import type { ConnectionControllerClient, SIWEControllerClient, EventsControllerState, NetworkControllerClient, NetworkControllerState, OptionsControllerState, PublicStateControllerState, ThemeControllerState, ThemeMode, ThemeVariables, SIWEControllerClientState, ModalControllerState } from '@web3modal/core'; | ||
import { AccountController, BlockchainApiController, ConnectionController, ConnectorController, NetworkController, SIWEController } from '@web3modal/core'; | ||
@@ -32,2 +32,3 @@ export interface LibraryOptions { | ||
close(): Promise<void>; | ||
setLoading(loading: ModalControllerState['loading']): void; | ||
getThemeMode(): ThemeMode; | ||
@@ -72,3 +73,3 @@ getThemeVariables(): ThemeVariables; | ||
protected getSIWESession: () => import("@web3modal/core").SIWESession | undefined; | ||
protected getSIWEStatus: () => "error" | "success" | "ready" | "loading" | "uninitialized" | "rejected"; | ||
protected getSIWEStatus: () => "loading" | "error" | "success" | "ready" | "uninitialized" | "rejected"; | ||
protected getSIWEMessage: () => string | undefined; | ||
@@ -75,0 +76,0 @@ private initControllers; |
@@ -9,2 +9,3 @@ import type { WuiConnectButton } from '@web3modal/ui'; | ||
private open; | ||
private loading; | ||
constructor(); | ||
@@ -11,0 +12,0 @@ disconnectedCallback(): void; |
@@ -8,2 +8,3 @@ import type { WuiNetworkButton } from '@web3modal/ui'; | ||
private connected; | ||
private loading; | ||
constructor(); | ||
@@ -10,0 +11,0 @@ disconnectedCallback(): void; |
@@ -6,2 +6,3 @@ import { LitElement } from 'lit'; | ||
private readonly networkImages; | ||
private readonly connectors; | ||
private address; | ||
@@ -17,2 +18,3 @@ private profileImage; | ||
render(): import("lit-html").TemplateResult<1>; | ||
private emailCardTemplate; | ||
private explorerBtnTemplate; | ||
@@ -25,2 +27,3 @@ private isAllowedNetworkSwitch; | ||
private onExplorer; | ||
private onGoToSecureSite; | ||
} | ||
@@ -27,0 +30,0 @@ declare global { |
{ | ||
"name": "@web3modal/scaffold", | ||
"version": "3.4.0-7da5cccb", | ||
"version": "3.4.0-7f62a20e", | ||
"type": "module", | ||
@@ -19,8 +19,8 @@ "main": "./dist/esm/index.js", | ||
"dependencies": { | ||
"@web3modal/core": "3.4.0-7da5cccb", | ||
"@web3modal/ui": "3.4.0-7da5cccb", | ||
"lit": "3.0.2" | ||
"@web3modal/core": "3.4.0-7f62a20e", | ||
"@web3modal/ui": "3.4.0-7f62a20e", | ||
"lit": "3.1.0" | ||
}, | ||
"devDependencies": { | ||
"@web3modal/smart-account": "3.4.0-7da5cccb" | ||
"@web3modal/smart-account": "3.4.0-7f62a20e" | ||
}, | ||
@@ -27,0 +27,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
304775
5126
+ Added@web3modal/common@3.4.0-7f62a20e(transitive)
+ Added@web3modal/core@3.4.0-7f62a20e(transitive)
+ Added@web3modal/ui@3.4.0-7f62a20e(transitive)
+ Addedlit@3.1.0(transitive)
- Removed@web3modal/common@3.4.0-7da5cccb(transitive)
- Removed@web3modal/core@3.4.0-7da5cccb(transitive)
- Removed@web3modal/ui@3.4.0-7da5cccb(transitive)
- Removedlit@3.0.2(transitive)
Updated@web3modal/ui@3.4.0-7f62a20e
Updatedlit@3.1.0