@1001-digital/components 1.1.5 → 1.1.6
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/package.json +2 -2
- package/src/base/components/Button.vue +4 -0
- package/src/base/components/Dialog.vue +14 -0
- package/src/evm/components/EvmConnect.vue +28 -18
- package/src/evm/components/EvmInAppWalletSetup.vue +41 -28
- package/src/evm/components/EvmMetaMaskQR.vue +19 -0
- package/src/evm/components/EvmProfile.vue +3 -6
- package/src/evm/components/EvmSeedPhraseInput.vue +8 -11
- package/src/evm/components/EvmSwitchNetwork.vue +1 -3
- package/src/evm/components/EvmWalletConnectWallets.vue +9 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1001-digital/components",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@wagmi/vue": ">=0.5.0",
|
|
18
18
|
"viem": ">=2.0.0",
|
|
19
19
|
"vue": "^3.5.0",
|
|
20
|
-
"@1001-digital/styles": "^1.0.
|
|
20
|
+
"@1001-digital/styles": "^1.0.1"
|
|
21
21
|
},
|
|
22
22
|
"peerDependenciesMeta": {
|
|
23
23
|
"@wagmi/core": {
|
|
@@ -271,6 +271,20 @@ onBeforeUnmount(() => {
|
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
/* Stacked compat dialog z-index layering */
|
|
275
|
+
.overlay ~ .dialog.compat {
|
|
276
|
+
z-index: calc(var(--z-index-dialog) + 2);
|
|
277
|
+
}
|
|
278
|
+
.overlay ~ .dialog.compat.open + .overlay {
|
|
279
|
+
z-index: calc(var(--z-index-dialog) + 1);
|
|
280
|
+
}
|
|
281
|
+
.overlay ~ .overlay ~ .dialog.compat {
|
|
282
|
+
z-index: calc(var(--z-index-dialog) + 4);
|
|
283
|
+
}
|
|
284
|
+
.overlay ~ .overlay ~ .dialog.compat.open + .overlay {
|
|
285
|
+
z-index: calc(var(--z-index-dialog) + 3);
|
|
286
|
+
}
|
|
287
|
+
|
|
274
288
|
html:has(dialog[open]),
|
|
275
289
|
body:has(dialog[open]),
|
|
276
290
|
html:has(.dialog.open),
|
|
@@ -25,19 +25,27 @@
|
|
|
25
25
|
@connected="onInAppConnected"
|
|
26
26
|
@back="showInAppSetup = false"
|
|
27
27
|
/>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
<template v-else-if="errorMessage">
|
|
29
|
+
<Alert type="error">
|
|
30
|
+
{{ errorMessage }}
|
|
31
|
+
</Alert>
|
|
32
|
+
<Button
|
|
33
|
+
class="link muted small"
|
|
34
|
+
@click="resetConnection"
|
|
35
|
+
>
|
|
36
|
+
<Icon type="chevron-left" />
|
|
37
|
+
<span>Back</span>
|
|
38
|
+
</Button>
|
|
39
|
+
</template>
|
|
34
40
|
<EvmMetaMaskQR
|
|
35
41
|
v-else-if="metaMaskUri"
|
|
36
42
|
:uri="metaMaskUri"
|
|
43
|
+
@back="resetConnection"
|
|
37
44
|
/>
|
|
38
45
|
<EvmWalletConnectWallets
|
|
39
46
|
v-else-if="walletConnectUri"
|
|
40
47
|
:uri="walletConnectUri"
|
|
48
|
+
@back="resetConnection"
|
|
41
49
|
/>
|
|
42
50
|
<template v-else-if="isConnecting">
|
|
43
51
|
<Loading
|
|
@@ -54,7 +62,7 @@
|
|
|
54
62
|
v-for="connector in shownConnectors"
|
|
55
63
|
:key="connector.uid"
|
|
56
64
|
@click="() => login(connector)"
|
|
57
|
-
class="choose-connector"
|
|
65
|
+
class="block choose-connector"
|
|
58
66
|
>
|
|
59
67
|
<img
|
|
60
68
|
v-if="ICONS[connector.name] || connector.icon"
|
|
@@ -72,7 +80,7 @@
|
|
|
72
80
|
<Button
|
|
73
81
|
v-if="wcConnector"
|
|
74
82
|
@click="loginWithSafe"
|
|
75
|
-
class="choose-connector"
|
|
83
|
+
class="block choose-connector"
|
|
76
84
|
>
|
|
77
85
|
<img
|
|
78
86
|
:src="safeIcon"
|
|
@@ -83,7 +91,7 @@
|
|
|
83
91
|
<Button
|
|
84
92
|
v-if="inAppConnector"
|
|
85
93
|
@click="showInAppSetup = true"
|
|
86
|
-
class="choose-connector"
|
|
94
|
+
class="block choose-connector"
|
|
87
95
|
>
|
|
88
96
|
<img
|
|
89
97
|
:src="inAppIcon"
|
|
@@ -277,18 +285,23 @@ const login = async (connector: Connector) => {
|
|
|
277
285
|
}
|
|
278
286
|
}
|
|
279
287
|
|
|
280
|
-
const
|
|
281
|
-
chooseModalOpen.value = false
|
|
282
|
-
showInAppSetup.value = false
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
const onModalClosed = () => {
|
|
288
|
+
const resetConnection = () => {
|
|
286
289
|
errorMessage.value = ''
|
|
287
290
|
isConnecting.value = false
|
|
288
291
|
connectingWallet.value = ''
|
|
289
292
|
metaMaskUri.value = ''
|
|
290
293
|
walletConnectUri.value = ''
|
|
291
294
|
safeDeepLink.value = false
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const onInAppConnected = () => {
|
|
298
|
+
chooseModalOpen.value = false
|
|
299
|
+
showInAppSetup.value = false
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const onModalClosed = () => {
|
|
303
|
+
chooseModalOpen.value = false
|
|
304
|
+
resetConnection()
|
|
292
305
|
showInAppSetup.value = false
|
|
293
306
|
}
|
|
294
307
|
|
|
@@ -309,8 +322,6 @@ onMounted(() => check())
|
|
|
309
322
|
gap: var(--spacer);
|
|
310
323
|
|
|
311
324
|
button.choose-connector {
|
|
312
|
-
width: 100%;
|
|
313
|
-
inline-size: auto;
|
|
314
325
|
justify-content: flex-start;
|
|
315
326
|
padding-inline-start: var(--ui-padding-inline);
|
|
316
327
|
|
|
@@ -337,6 +348,5 @@ onMounted(() => check())
|
|
|
337
348
|
|
|
338
349
|
.link.muted {
|
|
339
350
|
justify-self: center;
|
|
340
|
-
font-size: var(--font-xs);
|
|
341
351
|
}
|
|
342
352
|
</style>
|
|
@@ -5,21 +5,29 @@
|
|
|
5
5
|
v-if="step === 'choose'"
|
|
6
6
|
class="setup-step"
|
|
7
7
|
>
|
|
8
|
+
<p class="muted font-sm">{{ note }}</p>
|
|
9
|
+
|
|
8
10
|
<div class="setup-options">
|
|
9
|
-
<Button
|
|
11
|
+
<Button
|
|
12
|
+
class="block"
|
|
13
|
+
@click="startGenerate"
|
|
14
|
+
>
|
|
10
15
|
<Icon type="plus" />
|
|
11
16
|
<span>Create New Wallet</span>
|
|
12
17
|
</Button>
|
|
13
|
-
<Button
|
|
18
|
+
<Button
|
|
19
|
+
class="block"
|
|
20
|
+
@click="step = 'restore'"
|
|
21
|
+
>
|
|
14
22
|
<Icon type="key" />
|
|
15
|
-
<span>
|
|
23
|
+
<span>Use Existing Recovery Key</span>
|
|
16
24
|
</Button>
|
|
17
25
|
</div>
|
|
18
26
|
<Button
|
|
19
27
|
class="link muted small"
|
|
20
28
|
@click="$emit('back')"
|
|
21
29
|
>
|
|
22
|
-
<Icon type="
|
|
30
|
+
<Icon type="chevron-left" />
|
|
23
31
|
<span>Back</span>
|
|
24
32
|
</Button>
|
|
25
33
|
</div>
|
|
@@ -29,9 +37,11 @@
|
|
|
29
37
|
v-else-if="step === 'generate'"
|
|
30
38
|
class="setup-step"
|
|
31
39
|
>
|
|
32
|
-
<
|
|
33
|
-
Write down these 12 words in order.
|
|
34
|
-
|
|
40
|
+
<p class="muted font-sm">
|
|
41
|
+
Write down these 12 words in order. Think of them as your secure
|
|
42
|
+
password so keep them safe - you will need them to restore your account.
|
|
43
|
+
They will not be shown again.
|
|
44
|
+
</p>
|
|
35
45
|
|
|
36
46
|
<div class="generated-words">
|
|
37
47
|
<div
|
|
@@ -44,11 +54,14 @@
|
|
|
44
54
|
</div>
|
|
45
55
|
</div>
|
|
46
56
|
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
<div>
|
|
58
|
+
<FormCheckbox v-model="backupConfirmed">
|
|
59
|
+
I've saved my seed phrase
|
|
60
|
+
</FormCheckbox>
|
|
61
|
+
</div>
|
|
50
62
|
|
|
51
63
|
<Button
|
|
64
|
+
class="block"
|
|
52
65
|
:disabled="!backupConfirmed"
|
|
53
66
|
@click="confirmGenerated"
|
|
54
67
|
>
|
|
@@ -58,7 +71,7 @@
|
|
|
58
71
|
class="link muted small"
|
|
59
72
|
@click="step = 'choose'"
|
|
60
73
|
>
|
|
61
|
-
<Icon type="
|
|
74
|
+
<Icon type="chevron-left" />
|
|
62
75
|
<span>Back</span>
|
|
63
76
|
</Button>
|
|
64
77
|
</div>
|
|
@@ -68,7 +81,9 @@
|
|
|
68
81
|
v-else-if="step === 'restore'"
|
|
69
82
|
class="setup-step"
|
|
70
83
|
>
|
|
71
|
-
<p class="muted font-sm">
|
|
84
|
+
<p class="muted font-sm">
|
|
85
|
+
Enter your 12-word seed phrase to restore your wallet.
|
|
86
|
+
</p>
|
|
72
87
|
|
|
73
88
|
<EvmSeedPhraseInput
|
|
74
89
|
v-model="restorePhrase"
|
|
@@ -77,6 +92,7 @@
|
|
|
77
92
|
/>
|
|
78
93
|
|
|
79
94
|
<Button
|
|
95
|
+
class="block"
|
|
80
96
|
:disabled="!restoreValid"
|
|
81
97
|
@click="restoreWallet"
|
|
82
98
|
>
|
|
@@ -86,7 +102,7 @@
|
|
|
86
102
|
class="link muted small"
|
|
87
103
|
@click="step = 'choose'"
|
|
88
104
|
>
|
|
89
|
-
<Icon type="
|
|
105
|
+
<Icon type="chevron-left" />
|
|
90
106
|
<span>Back</span>
|
|
91
107
|
</Button>
|
|
92
108
|
</div>
|
|
@@ -116,6 +132,15 @@ import Loading from '../../base/components/Loading.vue'
|
|
|
116
132
|
import EvmSeedPhraseInput from './EvmSeedPhraseInput.vue'
|
|
117
133
|
import { prepareInAppWallet } from '../connectors/inAppWallet'
|
|
118
134
|
|
|
135
|
+
const props = withDefaults(
|
|
136
|
+
defineProps<{
|
|
137
|
+
note?: string
|
|
138
|
+
}>(),
|
|
139
|
+
{
|
|
140
|
+
note: 'Create a browser-based wallet stored locally on this device. Only you have access to your keys.',
|
|
141
|
+
},
|
|
142
|
+
)
|
|
143
|
+
|
|
119
144
|
const emit = defineEmits<{
|
|
120
145
|
connected: []
|
|
121
146
|
back: []
|
|
@@ -190,11 +215,6 @@ async function restoreWallet() {
|
|
|
190
215
|
.setup-options {
|
|
191
216
|
display: grid;
|
|
192
217
|
gap: var(--spacer);
|
|
193
|
-
|
|
194
|
-
:deep(button),
|
|
195
|
-
:deep(.button) {
|
|
196
|
-
width: 100%;
|
|
197
|
-
}
|
|
198
218
|
}
|
|
199
219
|
|
|
200
220
|
.generated-words {
|
|
@@ -203,25 +223,20 @@ async function restoreWallet() {
|
|
|
203
223
|
gap: var(--spacer-sm);
|
|
204
224
|
}
|
|
205
225
|
|
|
206
|
-
@media (min-width: 600px) {
|
|
207
|
-
.generated-words {
|
|
208
|
-
grid-template-columns: repeat(4, 1fr);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
226
|
.generated-word {
|
|
213
227
|
display: flex;
|
|
214
228
|
align-items: center;
|
|
215
|
-
gap: var(--spacer-
|
|
229
|
+
gap: var(--spacer-sm);
|
|
216
230
|
border: var(--border);
|
|
217
231
|
border-radius: var(--border-radius);
|
|
218
|
-
padding: var(--spacer-
|
|
232
|
+
padding: var(--spacer-sm);
|
|
219
233
|
|
|
220
234
|
.word-number {
|
|
221
235
|
font-size: var(--font-xs);
|
|
222
236
|
color: var(--muted);
|
|
223
237
|
min-width: 1.5em;
|
|
224
238
|
text-align: right;
|
|
239
|
+
user-select: none;
|
|
225
240
|
}
|
|
226
241
|
|
|
227
242
|
.word-text {
|
|
@@ -232,7 +247,5 @@ async function restoreWallet() {
|
|
|
232
247
|
|
|
233
248
|
.link.muted {
|
|
234
249
|
justify-self: center;
|
|
235
|
-
font-size: var(--font-xs);
|
|
236
250
|
}
|
|
237
|
-
|
|
238
251
|
</style>
|
|
@@ -4,12 +4,31 @@
|
|
|
4
4
|
Scan the code in your MetaMask mobile app
|
|
5
5
|
</template>
|
|
6
6
|
</EvmConnectorQR>
|
|
7
|
+
<Button
|
|
8
|
+
class="link muted small"
|
|
9
|
+
@click="$emit('back')"
|
|
10
|
+
>
|
|
11
|
+
<Icon type="chevron-left" />
|
|
12
|
+
<span>Back</span>
|
|
13
|
+
</Button>
|
|
7
14
|
</template>
|
|
8
15
|
|
|
9
16
|
<script setup lang="ts">
|
|
10
17
|
import EvmConnectorQR from './EvmConnectorQR.vue'
|
|
18
|
+
import Button from '../../base/components/Button.vue'
|
|
19
|
+
import Icon from '../../base/components/Icon.vue'
|
|
11
20
|
|
|
12
21
|
defineProps<{
|
|
13
22
|
uri: string
|
|
14
23
|
}>()
|
|
24
|
+
|
|
25
|
+
defineEmits<{
|
|
26
|
+
back: []
|
|
27
|
+
}>()
|
|
15
28
|
</script>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
.link.muted {
|
|
32
|
+
justify-self: center;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
<div class="profile-actions">
|
|
49
49
|
<slot name="actions" />
|
|
50
50
|
|
|
51
|
-
<EvmSwitchNetwork>
|
|
51
|
+
<EvmSwitchNetwork class-name="block">
|
|
52
52
|
<template #default="{ currentChain }">
|
|
53
53
|
<Icon type="wallet" />
|
|
54
54
|
<span>Switch Network ({{ currentChain?.name || 'Unknown' }})</span>
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
|
|
58
58
|
<Button
|
|
59
59
|
v-if="ensName"
|
|
60
|
+
class="block"
|
|
60
61
|
:to="`https://app.ens.domains/${ensName}`"
|
|
61
62
|
target="_blank"
|
|
62
63
|
>
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
</Button>
|
|
66
67
|
|
|
67
68
|
<Button
|
|
68
|
-
class="danger"
|
|
69
|
+
class="block danger"
|
|
69
70
|
@click="disconnect"
|
|
70
71
|
>
|
|
71
72
|
<span>Disconnect</span>
|
|
@@ -181,9 +182,5 @@ const disconnect = async () => {
|
|
|
181
182
|
gap: var(--spacer);
|
|
182
183
|
padding-block-start: var(--spacer);
|
|
183
184
|
|
|
184
|
-
& :deep(.button),
|
|
185
|
-
& :deep(button) {
|
|
186
|
-
width: 100%;
|
|
187
|
-
}
|
|
188
185
|
}
|
|
189
186
|
</style>
|
|
@@ -10,7 +10,11 @@
|
|
|
10
10
|
<label :for="`seed-word-${i}`">{{ i + 1 }}</label>
|
|
11
11
|
<input
|
|
12
12
|
:id="`seed-word-${i}`"
|
|
13
|
-
:ref="
|
|
13
|
+
:ref="
|
|
14
|
+
(el) => {
|
|
15
|
+
if (el) inputRefs[i] = el as HTMLInputElement
|
|
16
|
+
}
|
|
17
|
+
"
|
|
14
18
|
v-model="words[i]"
|
|
15
19
|
type="text"
|
|
16
20
|
autocomplete="off"
|
|
@@ -55,9 +59,7 @@ const isValid = computed(() =>
|
|
|
55
59
|
)
|
|
56
60
|
|
|
57
61
|
const phrase = computed(() =>
|
|
58
|
-
words.value
|
|
59
|
-
.map((w) => w.trim().toLowerCase())
|
|
60
|
-
.join(' '),
|
|
62
|
+
words.value.map((w) => w.trim().toLowerCase()).join(' '),
|
|
61
63
|
)
|
|
62
64
|
|
|
63
65
|
watch(
|
|
@@ -155,19 +157,14 @@ onMounted(() => {
|
|
|
155
157
|
gap: var(--spacer-sm);
|
|
156
158
|
}
|
|
157
159
|
|
|
158
|
-
@media (min-width: 600px) {
|
|
159
|
-
.seed-phrase-grid {
|
|
160
|
-
grid-template-columns: repeat(4, 1fr);
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
160
|
|
|
164
161
|
.seed-word {
|
|
165
162
|
display: flex;
|
|
166
163
|
align-items: center;
|
|
167
|
-
gap: var(--spacer-
|
|
164
|
+
gap: var(--spacer-sm);
|
|
168
165
|
border: var(--border);
|
|
169
166
|
border-radius: var(--border-radius);
|
|
170
|
-
padding: var(--spacer-
|
|
167
|
+
padding: var(--spacer-sm);
|
|
171
168
|
transition: border-color var(--speed);
|
|
172
169
|
|
|
173
170
|
&:focus-within {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
v-for="chain in chains"
|
|
38
38
|
:key="chain.id"
|
|
39
39
|
:disabled="chain.id === currentChainId || undefined"
|
|
40
|
-
:class="['chain-item', { active: chain.id === currentChainId }]"
|
|
40
|
+
:class="['block', 'chain-item', { active: chain.id === currentChainId }]"
|
|
41
41
|
@click="() => switchTo(chain)"
|
|
42
42
|
>
|
|
43
43
|
<span>{{ chain.name }}</span>
|
|
@@ -122,8 +122,6 @@ const onClosed = () => {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
.chain-item {
|
|
125
|
-
width: 100%;
|
|
126
|
-
inline-size: auto;
|
|
127
125
|
justify-content: space-between;
|
|
128
126
|
|
|
129
127
|
&.active {
|
|
@@ -58,12 +58,11 @@
|
|
|
58
58
|
/>
|
|
59
59
|
|
|
60
60
|
<Button
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class="link muted small help-link"
|
|
61
|
+
class="link muted small"
|
|
62
|
+
@click="$emit('back')"
|
|
64
63
|
>
|
|
65
|
-
<Icon type="
|
|
66
|
-
<span>
|
|
64
|
+
<Icon type="chevron-left" />
|
|
65
|
+
<span>Back</span>
|
|
67
66
|
</Button>
|
|
68
67
|
</div>
|
|
69
68
|
</template>
|
|
@@ -84,6 +83,10 @@ const props = defineProps<{
|
|
|
84
83
|
uri: string
|
|
85
84
|
}>()
|
|
86
85
|
|
|
86
|
+
defineEmits<{
|
|
87
|
+
back: []
|
|
88
|
+
}>()
|
|
89
|
+
|
|
87
90
|
const explorer = useWalletExplorer()
|
|
88
91
|
const searchQuery = ref('')
|
|
89
92
|
let searchTimeout: ReturnType<typeof setTimeout>
|
|
@@ -184,10 +187,8 @@ onMounted(() => {
|
|
|
184
187
|
}
|
|
185
188
|
}
|
|
186
189
|
|
|
187
|
-
|
|
188
|
-
.help-link {
|
|
190
|
+
.link.muted {
|
|
189
191
|
justify-self: center;
|
|
190
|
-
font-size: var(--font-xs);
|
|
191
192
|
}
|
|
192
193
|
|
|
193
194
|
/* Empty state */
|