@aptos-labs/wallet-adapter-mui-design 3.1.0 → 4.0.1
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/CHANGELOG.md +17 -0
- package/dist/index.js +9 -4
- package/dist/index.mjs +9 -4
- package/package.json +2 -2
- package/src/WalletButton.tsx +2 -2
- package/src/WalletMenu.tsx +1 -1
- package/src/WalletModel.tsx +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @aptos-labs/wallet-adapter-mui-design
|
|
2
2
|
|
|
3
|
+
## 4.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @aptos-labs/wallet-adapter-react@4.0.1
|
|
8
|
+
|
|
9
|
+
## 4.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- ce53a2b: Major upgrade to only support AIP-62 standard compatible wallets
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [ce53a2b]
|
|
18
|
+
- @aptos-labs/wallet-adapter-react@4.0.0
|
|
19
|
+
|
|
3
20
|
## 3.1.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/index.js
CHANGED
|
@@ -56,7 +56,8 @@ function WalletMenu({
|
|
|
56
56
|
};
|
|
57
57
|
const [tooltipOpen, setTooltipOpen] = (0, import_react.useState)(false);
|
|
58
58
|
const copyAddress = async () => {
|
|
59
|
-
|
|
59
|
+
var _a;
|
|
60
|
+
await navigator.clipboard.writeText((_a = account == null ? void 0 : account.address) == null ? void 0 : _a.toString());
|
|
60
61
|
setTooltipOpen(true);
|
|
61
62
|
setTimeout(() => {
|
|
62
63
|
setTooltipOpen(false);
|
|
@@ -119,6 +120,7 @@ function WalletButton({
|
|
|
119
120
|
handleModalOpen,
|
|
120
121
|
handleNavigate
|
|
121
122
|
}) {
|
|
123
|
+
var _a;
|
|
122
124
|
const { connected, account, wallet } = (0, import_wallet_adapter_react2.useWallet)();
|
|
123
125
|
const [popoverAnchor, setPopoverAnchor] = (0, import_react2.useState)(
|
|
124
126
|
null
|
|
@@ -151,7 +153,7 @@ function WalletButton({
|
|
|
151
153
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material2.Typography, {
|
|
152
154
|
noWrap: true,
|
|
153
155
|
ml: 2,
|
|
154
|
-
children: (account == null ? void 0 : account.ansName) || (0, import_wallet_adapter_react2.truncateAddress)(account == null ? void 0 : account.address) || "Unknown"
|
|
156
|
+
children: (account == null ? void 0 : account.ansName) || (0, import_wallet_adapter_react2.truncateAddress)((_a = account == null ? void 0 : account.address) == null ? void 0 : _a.toString()) || "Unknown"
|
|
155
157
|
})
|
|
156
158
|
]
|
|
157
159
|
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
@@ -207,8 +209,11 @@ function WalletsModal({
|
|
|
207
209
|
}) {
|
|
208
210
|
const theme = (0, import_material3.useTheme)();
|
|
209
211
|
const [expanded, setExpanded] = (0, import_react3.useState)(false);
|
|
210
|
-
const { wallets = [] } = (0, import_wallet_adapter_react3.useWallet)();
|
|
211
|
-
const { aptosConnectWallets, availableWallets, installableWallets } = (0, import_wallet_adapter_react3.groupAndSortWallets)(
|
|
212
|
+
const { wallets = [], notDetectedWallets = [] } = (0, import_wallet_adapter_react3.useWallet)();
|
|
213
|
+
const { aptosConnectWallets, availableWallets, installableWallets } = (0, import_wallet_adapter_react3.groupAndSortWallets)(
|
|
214
|
+
[...wallets, ...notDetectedWallets],
|
|
215
|
+
walletSortingOptions
|
|
216
|
+
);
|
|
212
217
|
const hasAptosConnectWallets = !!aptosConnectWallets.length;
|
|
213
218
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material3.Dialog, {
|
|
214
219
|
open: modalOpen,
|
package/dist/index.mjs
CHANGED
|
@@ -37,7 +37,8 @@ function WalletMenu({
|
|
|
37
37
|
};
|
|
38
38
|
const [tooltipOpen, setTooltipOpen] = useState(false);
|
|
39
39
|
const copyAddress = async () => {
|
|
40
|
-
|
|
40
|
+
var _a;
|
|
41
|
+
await navigator.clipboard.writeText((_a = account == null ? void 0 : account.address) == null ? void 0 : _a.toString());
|
|
41
42
|
setTooltipOpen(true);
|
|
42
43
|
setTimeout(() => {
|
|
43
44
|
setTooltipOpen(false);
|
|
@@ -100,6 +101,7 @@ function WalletButton({
|
|
|
100
101
|
handleModalOpen,
|
|
101
102
|
handleNavigate
|
|
102
103
|
}) {
|
|
104
|
+
var _a;
|
|
103
105
|
const { connected, account, wallet } = useWallet2();
|
|
104
106
|
const [popoverAnchor, setPopoverAnchor] = useState2(
|
|
105
107
|
null
|
|
@@ -132,7 +134,7 @@ function WalletButton({
|
|
|
132
134
|
/* @__PURE__ */ jsx2(Typography, {
|
|
133
135
|
noWrap: true,
|
|
134
136
|
ml: 2,
|
|
135
|
-
children: (account == null ? void 0 : account.ansName) || truncateAddress(account == null ? void 0 : account.address) || "Unknown"
|
|
137
|
+
children: (account == null ? void 0 : account.ansName) || truncateAddress((_a = account == null ? void 0 : account.address) == null ? void 0 : _a.toString()) || "Unknown"
|
|
136
138
|
})
|
|
137
139
|
]
|
|
138
140
|
}) : /* @__PURE__ */ jsxs2(Fragment, {
|
|
@@ -213,8 +215,11 @@ function WalletsModal({
|
|
|
213
215
|
}) {
|
|
214
216
|
const theme = useTheme();
|
|
215
217
|
const [expanded, setExpanded] = useState3(false);
|
|
216
|
-
const { wallets = [] } = useWallet3();
|
|
217
|
-
const { aptosConnectWallets, availableWallets, installableWallets } = groupAndSortWallets(
|
|
218
|
+
const { wallets = [], notDetectedWallets = [] } = useWallet3();
|
|
219
|
+
const { aptosConnectWallets, availableWallets, installableWallets } = groupAndSortWallets(
|
|
220
|
+
[...wallets, ...notDetectedWallets],
|
|
221
|
+
walletSortingOptions
|
|
222
|
+
);
|
|
218
223
|
const hasAptosConnectWallets = !!aptosConnectWallets.length;
|
|
219
224
|
return /* @__PURE__ */ jsx3(Dialog, {
|
|
220
225
|
open: modalOpen,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aptos-labs/wallet-adapter-mui-design",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Aptos Wallet Adapter mui design",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@emotion/styled": "^11.10.5",
|
|
42
42
|
"@mui/icons-material": "^5.11.0",
|
|
43
43
|
"@mui/material": "^5.11.6",
|
|
44
|
-
"@aptos-labs/wallet-adapter-react": "
|
|
44
|
+
"@aptos-labs/wallet-adapter-react": "4.0.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": "^18",
|
package/src/WalletButton.tsx
CHANGED
|
@@ -16,7 +16,7 @@ export default function WalletButton({
|
|
|
16
16
|
const { connected, account, wallet } = useWallet();
|
|
17
17
|
|
|
18
18
|
const [popoverAnchor, setPopoverAnchor] = useState<HTMLButtonElement | null>(
|
|
19
|
-
null
|
|
19
|
+
null
|
|
20
20
|
);
|
|
21
21
|
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
|
|
22
22
|
setPopoverAnchor(event.currentTarget);
|
|
@@ -49,7 +49,7 @@ export default function WalletButton({
|
|
|
49
49
|
/>
|
|
50
50
|
<Typography noWrap ml={2}>
|
|
51
51
|
{account?.ansName ||
|
|
52
|
-
truncateAddress(account?.address) ||
|
|
52
|
+
truncateAddress(account?.address?.toString()) ||
|
|
53
53
|
"Unknown"}
|
|
54
54
|
</Typography>
|
|
55
55
|
</>
|
package/src/WalletMenu.tsx
CHANGED
|
@@ -37,7 +37,7 @@ export default function WalletMenu({
|
|
|
37
37
|
const [tooltipOpen, setTooltipOpen] = useState<boolean>(false);
|
|
38
38
|
|
|
39
39
|
const copyAddress = async () => {
|
|
40
|
-
await navigator.clipboard.writeText(account?.address!);
|
|
40
|
+
await navigator.clipboard.writeText(account?.address?.toString()!);
|
|
41
41
|
|
|
42
42
|
setTooltipOpen(true);
|
|
43
43
|
|
package/src/WalletModel.tsx
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AboutAptosConnect,
|
|
3
3
|
AboutAptosConnectEducationScreen,
|
|
4
|
-
|
|
4
|
+
AdapterNotDetectedWallet,
|
|
5
|
+
AdapterWallet,
|
|
5
6
|
AptosPrivacyPolicy,
|
|
6
7
|
WalletItem,
|
|
7
8
|
WalletSortingOptions,
|
|
@@ -51,10 +52,13 @@ export default function WalletsModal({
|
|
|
51
52
|
const theme = useTheme();
|
|
52
53
|
const [expanded, setExpanded] = useState(false);
|
|
53
54
|
|
|
54
|
-
const { wallets = [] } = useWallet();
|
|
55
|
+
const { wallets = [], notDetectedWallets = [] } = useWallet();
|
|
55
56
|
|
|
56
57
|
const { aptosConnectWallets, availableWallets, installableWallets } =
|
|
57
|
-
groupAndSortWallets(
|
|
58
|
+
groupAndSortWallets(
|
|
59
|
+
[...wallets, ...notDetectedWallets],
|
|
60
|
+
walletSortingOptions
|
|
61
|
+
);
|
|
58
62
|
|
|
59
63
|
const hasAptosConnectWallets = !!aptosConnectWallets.length;
|
|
60
64
|
|
|
@@ -250,7 +254,7 @@ export default function WalletsModal({
|
|
|
250
254
|
}
|
|
251
255
|
|
|
252
256
|
interface WalletRowProps {
|
|
253
|
-
wallet:
|
|
257
|
+
wallet: AdapterWallet | AdapterNotDetectedWallet;
|
|
254
258
|
onConnect?: () => void;
|
|
255
259
|
}
|
|
256
260
|
|