Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.3.0 - Main #1117

Merged
merged 24 commits into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
263f0a5
Release 2.2.0 - Develop (#1103)
Adamj1232 Jun 28, 2022
79ee71a
feat: intergration of Rabby wallet (#1069)
vvvvvv1vvvvvv Jun 29, 2022
a9e267f
Fix typeof check for notify in core (#1106)
benjaminreid Jun 29, 2022
b84befc
Merge branch 'v2-web3-onboard-develop' of blocknative.github.com:bloc…
Adamj1232 Jun 29, 2022
7c4902c
[react-v2.2.2-alpha.1, vue-v2.1.2-alpha.1] : Update - Version bump co…
Adamj1232 Jun 29, 2022
5397eb2
Adds repository field (#1109)
taylorjdawson Jun 29, 2022
230e224
Yaml discriminates against @ characters (#1110)
taylorjdawson Jun 29, 2022
883fc52
Merge branch 'v2-web3-onboard-develop' of blocknative.github.com:bloc…
Adamj1232 Jun 29, 2022
631d34d
[core-v2.3.2-alpha.3 , react-v2.2.2-alpha.2, vue-v2.1.2-alpha.2] : Fi…
Adamj1232 Jun 29, 2022
8d32be4
2.0.3-alpha.2: [fix] - MEW Set Chain (#1102)
lnbc1QWFyb24 Jun 30, 2022
6305261
[core: 2.3.2-alpha.4]: [fix] - Recommended Injected Wallets (#1115)
lnbc1QWFyb24 Jun 30, 2022
84925bc
Merge branch 'v2-web3-onboard-develop' of blocknative.github.com:bloc…
Adamj1232 Jun 30, 2022
b8db389
added tagline (#1114)
techgangboss Jun 30, 2022
4e57f6e
Merge branch 'v2-web3-onboard-develop' of blocknative.github.com:bloc…
Adamj1232 Jun 30, 2022
62a1dcf
Bump versions for release
Adamj1232 Jun 30, 2022
dc78b96
Merge in main
Adamj1232 Jun 30, 2022
77167dc
[react-v2.2.2-alpha.3]: Fix - Next.js SSR support (#1118)
mahmud-bn Jun 30, 2022
6a78d75
Merge branch 'v2-web3-onboard-develop' of blocknative.github.com:bloc…
Adamj1232 Jun 30, 2022
5bd088b
Merge in latest from develop
Adamj1232 Jun 30, 2022
7b0015b
Bumpm demo versions
Adamj1232 Jun 30, 2022
93b4180
bump mew version
Adamj1232 Jun 30, 2022
e869041
Update naming
Adamj1232 Jul 1, 2022
f3814d7
cleanup notify disabled logic
Adamj1232 Jul 1, 2022
5c29be6
Prettier formatting
Adamj1232 Jul 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions .github/ISSUE_TEMPLATE/BUG.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,26 @@ body:
attributes:
label: What package is effected by this issue?
options:
- @web3-onboard/core
- @web3-onboard/common
- @web3-onboard/coinbase
- @web3-onboard/decent
- @web3-onboard/formatic
- @web3-onboard/gnosis
- @web3-onboard/injected
- @web3-onboard/keepkey
- @web3-onboard/keystone
- @web3-onboard/ledger
- @web3-onboard/magic
- @web3-onboard/mew
- @web3-onboard/portis
- @web3-onboard/react
- @web3-onboard/torus
- @web3-onboard/trezor
- @web3-onboard/vue
- @web3-onboard/walletconnect
- @web3-onboard/walletlink
- @web3-onboard/web3auth
- "@web3-onboard/core"
- "@web3-onboard/common"
- "@web3-onboard/coinbase"
- "@web3-onboard/decent"
- "@web3-onboard/formatic"
- "@web3-onboard/gnosis"
- "@web3-onboard/injected"
- "@web3-onboard/keepkey"
- "@web3-onboard/keystone"
- "@web3-onboard/ledger"
- "@web3-onboard/magic"
- "@web3-onboard/mew"
- "@web3-onboard/portis"
- "@web3-onboard/react"
- "@web3-onboard/torus"
- "@web3-onboard/trezor"
- "@web3-onboard/vue"
- "@web3-onboard/walletconnect"
- "@web3-onboard/walletlink"
- "@web3-onboard/web3auth"
- bnc-onboard (v1)
validations:
required: true
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Web3-Onboard
**easy way to connect users to dapps**

## Features

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web3-onboard-monorepo",
"version": "2.2.0",
"version": "2.3.0",
"private": true,
"workspaces": [
"./packages/*"
Expand Down
5 changes: 3 additions & 2 deletions packages/coinbase/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"name": "@web3-onboard/coinbase",
"version": "2.0.6",
"version": "2.0.7",
"description": "Coinbase Wallet module for web3-onboard",
"repository": "blocknative/web3-onboard",
"module": "dist/index.js",
"browser": "dist/index.js",
"main": "dist/index.js",
Expand All @@ -21,6 +22,6 @@
},
"dependencies": {
"@coinbase/wallet-sdk": "^3.0.5",
"@web3-onboard/common": "^2.1.3"
"@web3-onboard/common": "^2.1.4"
}
}
3 changes: 2 additions & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@web3-onboard/common",
"version": "2.1.3",
"version": "2.1.4",
"repository": "blocknative/web3-onboard",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
Expand Down
5 changes: 3 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@web3-onboard/core",
"version": "2.3.1",
"version": "2.3.2",
"repository": "blocknative/web3-onboard",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
Expand Down Expand Up @@ -41,7 +42,7 @@
"typescript": "^4.5.5"
},
"dependencies": {
"@web3-onboard/common": "^2.1.3",
"@web3-onboard/common": "^2.1.4",
"bignumber.js": "^9.0.0",
"bnc-sdk": "^4.4.1",
"bowser": "^2.11.0",
Expand Down
36 changes: 30 additions & 6 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import disconnectWallet from './disconnect'
import setChain from './chain'
import { state } from './store'
import { reset$ } from './streams'
import { validateInitOptions, validateNotify, validateNotifyOptions } from './validation'
import {
validateInitOptions,
validateNotify,
validateNotifyOptions
} from './validation'
import initI18N from './i18n'
import App from './views/Index.svelte'
import type { InitOptions, OnboardAPI, Notify } from './types'
Expand Down Expand Up @@ -103,14 +107,14 @@ function init(options: InitOptions): OnboardAPI {
}

// update notify
if (typeof notify !== undefined) {
if (typeof notify !== 'undefined') {
if ('desktop' in notify || 'mobile' in notify) {
const error = validateNotifyOptions(notify)

if (error) {
throw error
}

if (
(!notify.desktop || (notify.desktop && !notify.desktop.position)) &&
accountCenter &&
Expand All @@ -128,6 +132,7 @@ function init(options: InitOptions): OnboardAPI {
notify.mobile.position = accountCenter.mobile.position
}
let notifyUpdate: Partial<Notify>

if (device.type === 'mobile' && notify.mobile) {
notifyUpdate = {
...APP_INITIAL_STATE.notify,
Expand All @@ -139,15 +144,34 @@ function init(options: InitOptions): OnboardAPI {
...notify.desktop
}
}
if (!apiKey || !notifyUpdate.enabled) {
notifyUpdate.enabled = false
}
updateNotify(notifyUpdate)
} else {
const error = validateNotify(notify as Notify)

if (error) {
throw error
}
updateNotify(notify as Notify)
const notifyUpdate: Partial<Notify> = {
...APP_INITIAL_STATE.notify,
...notify
}

if (!apiKey || !notifyUpdate.enabled) {
notifyUpdate.enabled = false
}
console.log(notifyUpdate)
updateNotify(notifyUpdate)
}
} else {
const notifyUpdate: Partial<Notify> = APP_INITIAL_STATE.notify

if (!apiKey) {
notifyUpdate.enabled = false
}
updateNotify(notifyUpdate)
}

if (svelteInstance) {
Expand Down
79 changes: 71 additions & 8 deletions packages/core/src/views/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import AccountCenter from './account-center/Index.svelte'
import Notify from './notify/Index.svelte'
import { configuration } from '../configuration'
import type { Observable } from 'rxjs'
import type { Notification } from '../types'

const { device } = configuration
const accountCenter$ = state
Expand All @@ -17,12 +19,61 @@
const notify$ = state
.select('notify')
.pipe(startWith(state.get().notify), shareReplay(1))

const notifications$: Observable<Notification[]> = state
.select('notifications')
.pipe(startWith(state.get().notifications))

const positioningDefaults = {
topLeft: 'top: 0; left: 0;',
topRight: 'top: 0; right: 0;',
bottomRight: 'bottom: 0; right: 0;',
bottomLeft: 'bottom: 0; left: 0;'
}

$: sharedContainer =
$accountCenter$.enabled &&
$notify$.enabled &&
$notify$.position === $accountCenter$.position

$: samePositionOrMobile =
device.type === 'mobile' || $accountCenter$.position === $notify$.position

$: sharedMobileContainerCheck =
device.type === 'mobile' &&
(($notify$.position.includes('bottom') &&
$accountCenter$.position.includes('bottom')) ||
($notify$.position.includes('top') &&
$accountCenter$.position.includes('top')))

$: separateMobileContainerCheck =
device.type === 'mobile' &&
(($notify$.position.includes('top') &&
$accountCenter$.position.includes('bottom')) ||
($notify$.position.includes('bottom') &&
$accountCenter$.position.includes('top')))

$: displayNotifySeparate =
$notify$.enabled &&
(!$accountCenter$.enabled ||
($notify$.position !== $accountCenter$.position &&
device.type !== 'mobile') ||
separateMobileContainerCheck) &&
$wallets$.length

$: displayAccountCenterSeparate =
$accountCenter$.enabled &&
(!$notify$.enabled ||
($notify$.position !== $accountCenter$.position &&
device.type !== 'mobile') ||
separateMobileContainerCheck) &&
$wallets$.length

$: displayAccountCenterNotifySameContainer =
$notify$.enabled &&
$accountCenter$.enabled &&
$wallets$.length &&
(sharedContainer || sharedMobileContainerCheck)
</script>

<style>
Expand Down Expand Up @@ -280,7 +331,7 @@
<SwitchChain />
{/if}

{#if $notify$.enabled && $accountCenter$.enabled && $wallets$.length}
{#if displayAccountCenterNotifySameContainer}
<div
class="container flex flex-column fixed z-indexed"
style="{positioningDefaults[$accountCenter$.position]}; {device.type ===
Expand All @@ -290,8 +341,12 @@
? 'padding-top:0;'
: ''} "
>
{#if $notify$.position.includes('bottom') && $accountCenter$.position.includes('bottom') && (device.type === 'mobile' || $accountCenter$.position === $notify$.position)}
<Notify position={$notify$.position} sharedContainer={true} />
{#if $notify$.position.includes('bottom') && $accountCenter$.position.includes('bottom') && samePositionOrMobile}
<Notify
notifications={$notifications$}
position={$notify$.position}
{sharedContainer}
/>
{/if}
<div
style={!$accountCenter$.expanded &&
Expand All @@ -306,12 +361,16 @@
>
<AccountCenter settings={$accountCenter$} />
</div>
{#if $notify$.position.includes('top') && $accountCenter$.position.includes('top') && (device.type === 'mobile' || $accountCenter$.position === $notify$.position)}
<Notify position={$notify$.position} sharedContainer={true} />
{#if $notify$.position.includes('top') && $accountCenter$.position.includes('top') && samePositionOrMobile}
<Notify
notifications={$notifications$}
position={$notify$.position}
{sharedContainer}
/>
{/if}
</div>
{/if}
{#if $accountCenter$.enabled && (!$notify$.enabled || ($notify$.position !== $accountCenter$.position && device.type !== 'mobile')) && $wallets$.length}
{#if displayAccountCenterSeparate}
<div
class="container flex flex-column fixed z-indexed"
style="{positioningDefaults[$accountCenter$.position]}; {device.type ===
Expand All @@ -338,7 +397,7 @@
</div>
</div>
{/if}
{#if $notify$.enabled && (!$accountCenter$.enabled || ($notify$.position !== $accountCenter$.position && device.type !== 'mobile') || ($notify$.position.includes('top') && $accountCenter$.position.includes('bottom')) || ($notify$.position.includes('bottom') && $accountCenter$.position.includes('top'))) && $wallets$.length}
{#if displayNotifySeparate}
<div
class="container flex flex-column fixed z-indexed"
style="{positioningDefaults[$notify$.position]}; {device.type ===
Expand All @@ -348,6 +407,10 @@
? 'padding-top:0;'
: ''} "
>
<Notify position={$notify$.position} sharedContainer={false} />
<Notify
notifications={$notifications$}
position={$notify$.position}
{sharedContainer}
/>
</div>
{/if}
8 changes: 4 additions & 4 deletions packages/core/src/views/connect/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
let scrollContainer: HTMLElement

let walletToAutoSelect =
autoSelect &&
autoSelect.label &&
walletModules.find(
({ label }) => label.toLowerCase() === autoSelect.label.toLowerCase()
)
Expand Down Expand Up @@ -209,7 +209,7 @@
// user rejected account access
if (code === ProviderRpcErrorCode.ACCOUNT_ACCESS_REJECTED) {
connectionRejected = true
if (autoSelect) {
if (walletToAutoSelect) {
walletToAutoSelect = null

if (autoSelect.disableModals) {
Expand Down Expand Up @@ -360,7 +360,7 @@

<svelte:window bind:innerWidth={windowWidth} />

{#if !autoSelect || (autoSelect && !autoSelect.disableModals)}
{#if !autoSelect.disableModals}
<Modal {close}>
<div class="container relative flex">
{#if windowWidth >= 809}
Expand Down Expand Up @@ -396,7 +396,7 @@
{connectingErrorMessage}
/>
</div>
{:else if !autoSelect}
{:else}
<InstallWallet />
{/if}
{/if}
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/views/notify/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { shareReplay, startWith } from 'rxjs/operators'
import Notification from './Notification.svelte'
import { configuration } from '../../configuration'
import type { Notification as NotificationType } from '../../types'

const { device } = configuration

Expand All @@ -16,6 +17,7 @@

export let position: string
export let sharedContainer: boolean
export let notifications: NotificationType[]

let x: number
let y: number
Expand All @@ -36,8 +38,6 @@
x = 0
y = 0

const notifications$ = state.select('notifications').pipe(startWith([]))

let overflowY = 'y-scroll'
const updateScrollYOnRemove = (): void => {
if (overflowY !== 'y-visible') {
Expand Down Expand Up @@ -114,7 +114,7 @@
}
</style>

{#if $notifications$.length}
{#if notifications.length}
<ul
class="bn-notify-{position} {overflowY}"
style={`${
Expand All @@ -129,7 +129,7 @@
: '24px'
})`}
>
{#each $notifications$ as notification (notification.key)}
{#each notifications as notification (notification.key)}
<li
animate:flip={{ duration: 500 }}
on:click|stopPropagation
Expand Down
Loading