@seams/wallet 0.10.2 → 0.12.0
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/README.md +3 -3
- package/THIRD_PARTY_NOTICES.md +33 -1812
- package/dist/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/operations/recovery/walletRecoveryCodeBackup.js +100 -0
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +236 -97
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/RecoveryCodeBackupSurface.js +558 -0
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/mountRecoveryCodeBackupSurface.js +82 -0
- package/dist/esm/core/types/sdkSentEvents.js +9 -0
- package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonMock.js +189 -0
- package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonView.js +137 -0
- package/dist/esm/react/components/AccountMenuButton/AccountMenuDeviceDetails.js +39 -0
- package/dist/esm/react/components/AccountMenuButton/AccountMenuDialog.js +39 -13
- package/dist/esm/react/components/AccountMenuButton/AccountMenuMockScreens.js +247 -0
- package/dist/esm/react/components/AccountMenuButton/AccountMenuScreen.js +41 -0
- package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodRow.js +79 -0
- package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsModal.js +168 -174
- package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsView.js +19 -0
- package/dist/esm/react/components/AccountMenuButton/ExportKeysScreen.js +30 -0
- package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.css +148 -87
- package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.js +26 -5
- package/dist/esm/react/components/AccountMenuButton/MenuItem.js +28 -13
- package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.css +73 -69
- package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.js +56 -68
- package/dist/esm/react/components/AccountMenuButton/RecoveryCodeAcknowledgement.js +27 -0
- package/dist/esm/react/components/AccountMenuButton/RecoveryCodeActions.js +53 -0
- package/dist/esm/react/components/AccountMenuButton/TransactionSettingsSection.css +3 -1
- package/dist/esm/react/components/AccountMenuButton/TransactionSettingsSection.js +2 -8
- package/dist/esm/react/components/AccountMenuButton/UserAccountButton.css +1 -1
- package/dist/esm/react/components/AccountMenuButton/UserAccountButton.js +6 -3
- package/dist/esm/react/components/AccountMenuButton/WalletRegionSection.js +4 -4
- package/dist/esm/react/components/AccountMenuButton/Web3AuthProfileButton.css +443 -12
- package/dist/esm/react/components/AccountMenuButton/hooks/useProfileState.js +1 -1
- package/dist/esm/react/components/AccountMenuButton/icons/LayersIcon.js +8 -0
- package/dist/esm/react/components/AccountMenuButton/icons/LockKeyholeIcon.js +22 -0
- package/dist/esm/react/components/AccountMenuButton/icons/PlusIcon.js +8 -0
- package/dist/esm/react/components/AccountMenuButton/icons/SunIcon.js +2 -2
- package/dist/esm/react/components/AccountMenuButton/icons/TouchIcon.css +0 -8
- package/dist/esm/react/components/AccountMenuButton/index.js +135 -115
- package/dist/esm/react/components/QRCodeScanner.js +64 -40
- package/dist/esm/react/components/QRCodeScannerCamera.js +16 -0
- package/dist/esm/react/components/ShowQRCode.js +2 -2
- package/dist/esm/react/externalEvm.js +2 -2
- package/dist/esm/react/index.js +2 -1
- package/dist/esm/react/styles/styles.css +520 -91
- package/dist/esm/react/transactionReview/TransactionReviewHost.js +3 -3
- package/dist/esm/sdk/{adapters-DYPu0nK9.js → adapters-CGvNLOfZ.js} +1 -1
- package/dist/{public/sdk/display-DjoWrSgE.js → esm/sdk/display-DTbGoX4e.js} +1 -1
- package/dist/{public/sdk/exportKeypairOperation-DYCzCbqL.js → esm/sdk/exportKeypairOperation-BHXMSA3v.js} +1 -1
- package/dist/{public/sdk/host-D5b19B_h.js → esm/sdk/host-CHQwi-Nm.js} +1 -1
- package/dist/esm/sdk/{localOnly-KvZeKkH5.js → localOnly-CUVRoMy2.js} +1 -1
- package/dist/esm/sdk/{mountRecoveryCodeBackupSurface-BA2ttbTM.js → mountRecoveryCodeBackupSurface-D1G-iCPI.js} +2 -2
- package/dist/esm/sdk/{pendingWalletRecoveryCodeBackup-BkIrbd6Q.js → pendingWalletRecoveryCodeBackup-DMg5U0Fk.js} +1 -1
- package/dist/esm/sdk/{recovery-entrypoint-DoXswV9I.js → recovery-entrypoint-EHY_b7Z-.js} +1 -1
- package/dist/esm/sdk/registration-CQxxUt5s.js +1 -0
- package/dist/esm/sdk/{registration-BFHEYmgh.js → registration-Drtkzrlc.js} +1 -1
- package/dist/esm/sdk/{requireStepUpAuth-C67sluoC.js → requireStepUpAuth-FqZSU021.js} +1 -1
- package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/esm/sdk/runtime-auth-DtpRz88X.js +1 -0
- package/dist/esm/sdk/{runtime-device-link-pf-a_-3u.js → runtime-device-link-DXjabXJb.js} +1 -1
- package/dist/esm/sdk/{runtime-ecdsa-tempo-Ddnuti6f.js → runtime-ecdsa-tempo-DlKMIbyP.js} +1 -1
- package/dist/esm/sdk/{runtime-email-otp-BAG8ZC1J.js → runtime-email-otp-BBPghU2G.js} +1 -1
- package/dist/esm/sdk/{runtime-export-DxL99xfn.js → runtime-export-pw-xJL8o.js} +1 -1
- package/dist/esm/sdk/{runtime-near-BrWP4IxC.js → runtime-near-B-vYxGjl.js} +1 -1
- package/dist/esm/sdk/{runtime-preferences-BjVdHYL0.js → runtime-preferences-D-hY0RfC.js} +1 -1
- package/dist/esm/sdk/{runtime-recovery-BNd_GX5q.js → runtime-recovery-Vg1ND2nl.js} +1 -1
- package/dist/esm/sdk/{runtime-recovery-codes-Dn-NccpU.js → runtime-recovery-codes-rLR4Guy4.js} +1 -1
- package/dist/esm/sdk/sdkSentEvents-Dl8fOL50.js +1 -0
- package/dist/esm/sdk/shared-6bpRPbcM.js +6 -0
- package/dist/{public/sdk/signEvmFamily-DjD3tn8e.js → esm/sdk/signEvmFamily-M0trbeZe.js} +1 -1
- package/dist/esm/sdk/{signEvmFamilyWithUiConfirmForTempo-CwRFbaLM.js → signEvmFamilyWithUiConfirmForTempo-Bo25SwuV.js} +1 -1
- package/dist/esm/sdk/{signEvmWithUiConfirm-BHG0dwVG.js → signEvmWithUiConfirm-CFcqJRj3.js} +1 -1
- package/dist/{public/sdk/signNear-D0tlQXb9.js → esm/sdk/signNear-DGUQZ44s.js} +1 -1
- package/dist/esm/sdk/{signingFlow-Mym5j6aw.js → signingFlow-DZvV4AgG.js} +1 -1
- package/dist/esm/sdk/{transaction-activity-Cb2JyYKv.js → transaction-activity-xfeHKJoq.js} +1 -1
- package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/esm/sdk/{wallet-recovery-D7ywcIHw.js → wallet-recovery-LMtGiEL3.js} +1 -1
- package/dist/esm/sdk/wallet-ui.css +1 -1
- package/dist/{public/sdk/walletCustodyEcdsaContinuity-B8aO2NFb.js → esm/sdk/walletCustodyEcdsaContinuity-D-gYxv6e.js} +1 -1
- package/dist/{public/sdk/walletRecoveryCommit-C3EgMjo-.js → esm/sdk/walletRecoveryCommit-BYRC_2li.js} +1 -1
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/{adapters-DYPu0nK9.js → adapters-CGvNLOfZ.js} +1 -1
- package/dist/{esm/sdk/display-DjoWrSgE.js → public/sdk/display-DTbGoX4e.js} +1 -1
- package/dist/{esm/sdk/exportKeypairOperation-DYCzCbqL.js → public/sdk/exportKeypairOperation-BHXMSA3v.js} +1 -1
- package/dist/{esm/sdk/host-D5b19B_h.js → public/sdk/host-CHQwi-Nm.js} +1 -1
- package/dist/public/sdk/{localOnly-KvZeKkH5.js → localOnly-CUVRoMy2.js} +1 -1
- package/dist/public/sdk/{mountRecoveryCodeBackupSurface-BA2ttbTM.js → mountRecoveryCodeBackupSurface-D1G-iCPI.js} +2 -2
- package/dist/public/sdk/{pendingWalletRecoveryCodeBackup-BkIrbd6Q.js → pendingWalletRecoveryCodeBackup-DMg5U0Fk.js} +1 -1
- package/dist/public/sdk/{recovery-entrypoint-DoXswV9I.js → recovery-entrypoint-EHY_b7Z-.js} +1 -1
- package/dist/public/sdk/registration-CQxxUt5s.js +1 -0
- package/dist/public/sdk/{registration-BFHEYmgh.js → registration-Drtkzrlc.js} +1 -1
- package/dist/public/sdk/{requireStepUpAuth-C67sluoC.js → requireStepUpAuth-FqZSU021.js} +1 -1
- package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/sdk/runtime-auth-DtpRz88X.js +1 -0
- package/dist/public/sdk/{runtime-device-link-pf-a_-3u.js → runtime-device-link-DXjabXJb.js} +1 -1
- package/dist/public/sdk/{runtime-ecdsa-tempo-Ddnuti6f.js → runtime-ecdsa-tempo-DlKMIbyP.js} +1 -1
- package/dist/public/sdk/{runtime-email-otp-BAG8ZC1J.js → runtime-email-otp-BBPghU2G.js} +1 -1
- package/dist/public/sdk/{runtime-export-DxL99xfn.js → runtime-export-pw-xJL8o.js} +1 -1
- package/dist/public/sdk/{runtime-near-BrWP4IxC.js → runtime-near-B-vYxGjl.js} +1 -1
- package/dist/public/sdk/{runtime-preferences-BjVdHYL0.js → runtime-preferences-D-hY0RfC.js} +1 -1
- package/dist/public/sdk/{runtime-recovery-BNd_GX5q.js → runtime-recovery-Vg1ND2nl.js} +1 -1
- package/dist/public/sdk/{runtime-recovery-codes-Dn-NccpU.js → runtime-recovery-codes-rLR4Guy4.js} +1 -1
- package/dist/public/sdk/sdkSentEvents-Dl8fOL50.js +1 -0
- package/dist/public/sdk/shared-6bpRPbcM.js +6 -0
- package/dist/{esm/sdk/signEvmFamily-DjD3tn8e.js → public/sdk/signEvmFamily-M0trbeZe.js} +1 -1
- package/dist/public/sdk/{signEvmFamilyWithUiConfirmForTempo-CwRFbaLM.js → signEvmFamilyWithUiConfirmForTempo-Bo25SwuV.js} +1 -1
- package/dist/public/sdk/{signEvmWithUiConfirm-BHG0dwVG.js → signEvmWithUiConfirm-CFcqJRj3.js} +1 -1
- package/dist/{esm/sdk/signNear-D0tlQXb9.js → public/sdk/signNear-DGUQZ44s.js} +1 -1
- package/dist/public/sdk/{signingFlow-Mym5j6aw.js → signingFlow-DZvV4AgG.js} +1 -1
- package/dist/public/sdk/{transaction-activity-Cb2JyYKv.js → transaction-activity-xfeHKJoq.js} +1 -1
- package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/public/sdk/{wallet-recovery-D7ywcIHw.js → wallet-recovery-LMtGiEL3.js} +1 -1
- package/dist/public/sdk/wallet-ui.css +1 -1
- package/dist/{esm/sdk/walletCustodyEcdsaContinuity-B8aO2NFb.js → public/sdk/walletCustodyEcdsaContinuity-D-gYxv6e.js} +1 -1
- package/dist/{esm/sdk/walletRecoveryCommit-C3EgMjo-.js → public/sdk/walletRecoveryCommit-BYRC_2li.js} +1 -1
- package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
- package/dist/public/sdk/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
- package/dist/public/sdk/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/public/sdk/workers/wasm_signer_worker_bg.wasm +0 -0
- package/dist/public/wallet-assets.manifest.json +64 -64
- package/dist/public/wallet-service/index.html +4 -4
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/domain.d.ts +9 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/session.d.ts +7 -3
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.d.ts +8 -5
- package/dist/types/wallet/src/core/types/sdkSentEvents.d.ts +4 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuButtonMock.d.ts +17 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuButtonView.d.ts +17 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuDeviceDetails.d.ts +13 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuDialog.d.ts +1 -1
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuMockScreens.d.ts +43 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuScreen.d.ts +9 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/AuthenticationMethodRow.d.ts +14 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/AuthenticationMethodsModal.d.ts +1 -1
- package/dist/types/wallet/src/react/components/AccountMenuButton/AuthenticationMethodsView.d.ts +8 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/ExportKeysScreen.d.ts +7 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/LinkedDevicesModal.d.ts +1 -1
- package/dist/types/wallet/src/react/components/AccountMenuButton/ProfileDropdown.d.ts +2 -14
- package/dist/types/wallet/src/react/components/AccountMenuButton/RecoveryCodeAcknowledgement.d.ts +5 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/RecoveryCodeActions.d.ts +5 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/icons/LayersIcon.d.ts +2 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/icons/LockKeyholeIcon.d.ts +2 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/icons/PlusIcon.d.ts +2 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/index.d.ts +2 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/types.d.ts +1 -14
- package/dist/types/wallet/src/react/components/QRCodeScanner.d.ts +1 -0
- package/dist/types/wallet/src/react/components/QRCodeScannerCamera.d.ts +5 -0
- package/dist/types/wallet/src/react/index.d.ts +2 -1
- package/dist/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/workers/evm_crypto_bg.wasm +0 -0
- package/dist/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/workers/tempo_signer_bg.wasm +0 -0
- package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
- package/package.json +1 -3
- package/dist/esm/sdk/registration-Cx_f58rb.js +0 -1
- package/dist/esm/sdk/runtime-auth-CKUleRYA.js +0 -1
- package/dist/esm/sdk/sdkSentEvents-DiQ3YVlj.js +0 -1
- package/dist/esm/sdk/shared-CSfgTVcf.js +0 -6
- package/dist/public/sdk/registration-Cx_f58rb.js +0 -1
- package/dist/public/sdk/runtime-auth-CKUleRYA.js +0 -1
- package/dist/public/sdk/sdkSentEvents-DiQ3YVlj.js +0 -1
- package/dist/public/sdk/shared-CSfgTVcf.js +0 -6
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { Theme } from "../theme/ThemeProvider.js";
|
|
2
|
+
import { ScanIcon } from "./icons/ScanIcon.js";
|
|
3
|
+
import { KeyIcon } from "./icons/KeyIcon.js";
|
|
4
|
+
import { LinkIcon } from "./icons/LinkIcon.js";
|
|
5
|
+
import { GlobeIcon } from "./icons/GlobeIcon.js";
|
|
6
|
+
import { SlidersIcon } from "./icons/SlidersIcon.js";
|
|
7
|
+
import { RecoveryCodesIcon } from "./icons/RecoveryCodesIcon.js";
|
|
8
|
+
import TouchIcon from "./icons/TouchIcon.js";
|
|
9
|
+
import { AccountMenuButtonView } from "./AccountMenuButtonView.js";
|
|
10
|
+
import { useProfileState } from "./hooks/useProfileState.js";
|
|
11
|
+
import { TransactionSettingsSection } from "./TransactionSettingsSection.js";
|
|
12
|
+
import { AccountMenuMockScreens } from "./AccountMenuMockScreens.js";
|
|
13
|
+
import { useEffect, useState } from "react";
|
|
14
|
+
import { jsx } from "react/jsx-runtime";
|
|
15
|
+
//#region src/react/components/AccountMenuButton/AccountMenuButtonMock.tsx
|
|
16
|
+
const accounts = [{
|
|
17
|
+
id: "near",
|
|
18
|
+
label: "NEAR",
|
|
19
|
+
address: "alex.near",
|
|
20
|
+
href: "https://nearblocks.io/address/alex.near"
|
|
21
|
+
}, {
|
|
22
|
+
id: "evm",
|
|
23
|
+
label: "Base",
|
|
24
|
+
address: "0x42010000000000000000000000000000000000891c",
|
|
25
|
+
href: "https://basescan.org/address/0x42010000000000000000000000000000000000891c"
|
|
26
|
+
}];
|
|
27
|
+
function selectMode(setConfig, uiMode) {
|
|
28
|
+
setConfig({
|
|
29
|
+
uiMode,
|
|
30
|
+
behavior: uiMode === "none" ? "skipClick" : "requireClick"
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function toggleClick(setConfig, current) {
|
|
34
|
+
setConfig({
|
|
35
|
+
uiMode: current.uiMode,
|
|
36
|
+
behavior: current.behavior === "requireClick" ? "skipClick" : "requireClick"
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function setDelay(setConfig, current, autoProceedDelay) {
|
|
40
|
+
setConfig({
|
|
41
|
+
uiMode: current.uiMode,
|
|
42
|
+
behavior: current.behavior,
|
|
43
|
+
autoProceedDelay
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function lockPreview(setStatus, close) {
|
|
47
|
+
setStatus("logged_out");
|
|
48
|
+
close();
|
|
49
|
+
}
|
|
50
|
+
function openPreview(setStatus, toggle) {
|
|
51
|
+
setStatus("ready");
|
|
52
|
+
toggle();
|
|
53
|
+
}
|
|
54
|
+
function resetPreviewNavigation(isOpen, setScreen) {
|
|
55
|
+
if (!isOpen) setScreen({ kind: "overview" });
|
|
56
|
+
}
|
|
57
|
+
function AccountMenuPreview({ username = "Alex Chen", walletId = "alex.near", theme = "light", defaultOpen = true, className, style }) {
|
|
58
|
+
const [open, setOpen] = useState(defaultOpen);
|
|
59
|
+
const [status, setStatus] = useState("ready");
|
|
60
|
+
const [screen, setScreen] = useState({ kind: "overview" });
|
|
61
|
+
const [confirmation, setConfirmation] = useState({
|
|
62
|
+
uiMode: "modal",
|
|
63
|
+
behavior: "requireClick"
|
|
64
|
+
});
|
|
65
|
+
const { refs, isOpen, handleToggle, handleClose } = useProfileState({
|
|
66
|
+
open,
|
|
67
|
+
onOpenChange: setOpen
|
|
68
|
+
});
|
|
69
|
+
useEffect(resetPreviewNavigation.bind(null, isOpen, setScreen), [isOpen]);
|
|
70
|
+
const menuItems = [
|
|
71
|
+
{
|
|
72
|
+
id: "accounts",
|
|
73
|
+
icon: /* @__PURE__ */ jsx(GlobeIcon, {}),
|
|
74
|
+
label: "Accounts",
|
|
75
|
+
description: "View accounts on block explorers",
|
|
76
|
+
disabled: false,
|
|
77
|
+
keepOpenOnClick: true,
|
|
78
|
+
onClick: setScreen.bind(null, { kind: "accounts" })
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: "export-keys",
|
|
82
|
+
icon: /* @__PURE__ */ jsx(KeyIcon, {}),
|
|
83
|
+
label: "Export keys",
|
|
84
|
+
description: "Export wallet signing keys",
|
|
85
|
+
disabled: false,
|
|
86
|
+
keepOpenOnClick: true,
|
|
87
|
+
onClick: setScreen.bind(null, { kind: "export-keys" })
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "recovery-codes",
|
|
91
|
+
icon: /* @__PURE__ */ jsx(RecoveryCodesIcon, {}),
|
|
92
|
+
label: "Recovery codes",
|
|
93
|
+
description: "Back up wallet recovery codes",
|
|
94
|
+
disabled: false,
|
|
95
|
+
keepOpenOnClick: true,
|
|
96
|
+
onClick: setScreen.bind(null, {
|
|
97
|
+
kind: "recovery",
|
|
98
|
+
revealed: false
|
|
99
|
+
})
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "authentication-methods",
|
|
103
|
+
icon: /* @__PURE__ */ jsx(TouchIcon, {}),
|
|
104
|
+
label: "Authentication methods",
|
|
105
|
+
description: "Add or remove ways to unlock this device",
|
|
106
|
+
disabled: false,
|
|
107
|
+
keepOpenOnClick: true,
|
|
108
|
+
onClick: setScreen.bind(null, { kind: "methods" })
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: "scan-link-device",
|
|
112
|
+
icon: /* @__PURE__ */ jsx(ScanIcon, {}),
|
|
113
|
+
label: "Scan and link device",
|
|
114
|
+
description: "Scan QR to link a device",
|
|
115
|
+
disabled: false,
|
|
116
|
+
keepOpenOnClick: true,
|
|
117
|
+
onClick: setScreen.bind(null, { kind: "scanner" })
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: "linked-devices",
|
|
121
|
+
icon: /* @__PURE__ */ jsx(LinkIcon, {}),
|
|
122
|
+
label: "Linked devices",
|
|
123
|
+
description: "See devices using this wallet",
|
|
124
|
+
disabled: false,
|
|
125
|
+
keepOpenOnClick: true,
|
|
126
|
+
onClick: setScreen.bind(null, { kind: "linked" })
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: "transaction-settings",
|
|
130
|
+
icon: /* @__PURE__ */ jsx(SlidersIcon, {}),
|
|
131
|
+
label: "Transaction settings",
|
|
132
|
+
description: "Customize confirmation behavior",
|
|
133
|
+
disabled: false,
|
|
134
|
+
keepOpenOnClick: true,
|
|
135
|
+
onClick: setScreen.bind(null, { kind: "transactions" })
|
|
136
|
+
}
|
|
137
|
+
];
|
|
138
|
+
return /* @__PURE__ */ jsx(AccountMenuButtonView, {
|
|
139
|
+
buttonRef: refs.buttonRef,
|
|
140
|
+
dropdownRef: refs.dropdownRef,
|
|
141
|
+
className,
|
|
142
|
+
style,
|
|
143
|
+
trigger: {
|
|
144
|
+
label: status === "logged_out" ? "Logged out" : "Settings",
|
|
145
|
+
username,
|
|
146
|
+
fullAccountId: walletId,
|
|
147
|
+
hideUsername: false,
|
|
148
|
+
isOpen,
|
|
149
|
+
onClick: openPreview.bind(null, setStatus, handleToggle),
|
|
150
|
+
theme
|
|
151
|
+
},
|
|
152
|
+
dropdown: {
|
|
153
|
+
isOpen,
|
|
154
|
+
menuItems,
|
|
155
|
+
menuItemsRef: refs.menuItemsRef,
|
|
156
|
+
onClose: handleClose,
|
|
157
|
+
onLock: lockPreview.bind(null, setStatus, handleClose),
|
|
158
|
+
theme
|
|
159
|
+
},
|
|
160
|
+
children: screen.kind === "overview" ? null : /* @__PURE__ */ jsx(AccountMenuMockScreens, {
|
|
161
|
+
screen,
|
|
162
|
+
setScreen,
|
|
163
|
+
accounts,
|
|
164
|
+
walletId,
|
|
165
|
+
transactionSettings: /* @__PURE__ */ jsx(TransactionSettingsSection, {
|
|
166
|
+
currentConfirmConfig: confirmation,
|
|
167
|
+
onSetUiMode: selectMode.bind(null, setConfirmation),
|
|
168
|
+
onToggleSkipClick: toggleClick.bind(null, setConfirmation, confirmation),
|
|
169
|
+
onSetDelay: setDelay.bind(null, setConfirmation, confirmation),
|
|
170
|
+
isOpen: true,
|
|
171
|
+
theme
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/** Provider-free interactive preview using the connected AccountMenuButton's renderer.
|
|
177
|
+
* Navigation, confirmation preferences, devices, recovery and export previews stay local.
|
|
178
|
+
* This component never opens a camera, signs, exports keys or accesses storage.
|
|
179
|
+
*/
|
|
180
|
+
function AccountMenuButtonMock(props) {
|
|
181
|
+
return /* @__PURE__ */ jsx(Theme, {
|
|
182
|
+
theme: props.theme ?? "light",
|
|
183
|
+
children: /* @__PURE__ */ jsx(AccountMenuPreview, { ...props })
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
//#endregion
|
|
187
|
+
export { AccountMenuButtonMock };
|
|
188
|
+
|
|
189
|
+
//# sourceMappingURL=AccountMenuButtonMock.js.map
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { SEAMS_STANDARD_WORDMARK_PATH } from "../../../core/signingEngine/uiConfirm/ui/seamsWordmarkPaths.js";
|
|
2
|
+
import TouchIcon from "./icons/TouchIcon.js";
|
|
3
|
+
import { UserAccountButton } from "./UserAccountButton.js";
|
|
4
|
+
import { ProfileDropdown } from "./ProfileDropdown.js";
|
|
5
|
+
import { LockKeyholeIcon } from "./icons/LockKeyholeIcon.js";
|
|
6
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import "./Web3AuthProfileButton.css";
|
|
9
|
+
//#region src/react/components/AccountMenuButton/AccountMenuButtonView.tsx
|
|
10
|
+
function measurePanel(element, setHeight) {
|
|
11
|
+
setHeight(element.getBoundingClientRect().height);
|
|
12
|
+
}
|
|
13
|
+
function observePanel(contentRef, isOpen, setHeight) {
|
|
14
|
+
const content = contentRef.current;
|
|
15
|
+
if (!content || !isOpen) {
|
|
16
|
+
setHeight(null);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const measure = measurePanel.bind(null, content, setHeight);
|
|
20
|
+
measure();
|
|
21
|
+
const observer = new ResizeObserver(measure);
|
|
22
|
+
observer.observe(content);
|
|
23
|
+
return observer.disconnect.bind(observer);
|
|
24
|
+
}
|
|
25
|
+
function closeWithEscape(onClose, event) {
|
|
26
|
+
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
onClose();
|
|
29
|
+
}
|
|
30
|
+
function restoreTriggerFocus(buttonRef, previousOpen, isOpen) {
|
|
31
|
+
if (previousOpen.current && !isOpen) buttonRef.current?.querySelector("[aria-expanded]")?.focus({ preventScroll: true });
|
|
32
|
+
previousOpen.current = isOpen;
|
|
33
|
+
}
|
|
34
|
+
function restoreOverviewFocus(buttonRef, previousScreen, hasScreen) {
|
|
35
|
+
if (previousScreen.current && !hasScreen) buttonRef.current?.querySelector(".seams-account-identity")?.focus({ preventScroll: true });
|
|
36
|
+
previousScreen.current = hasScreen;
|
|
37
|
+
}
|
|
38
|
+
/** One shell for live account screens and the provider-free preview. */
|
|
39
|
+
function AccountMenuButtonView({ buttonRef, dropdownRef, trigger, dropdown, className, style, children }) {
|
|
40
|
+
const contentRef = useRef(null);
|
|
41
|
+
const hasScreen = children !== null && children !== void 0;
|
|
42
|
+
const previousScreen = useRef(hasScreen);
|
|
43
|
+
useLayoutEffect(restoreOverviewFocus.bind(null, buttonRef, previousScreen, hasScreen), [buttonRef, hasScreen]);
|
|
44
|
+
const previousOpen = useRef(trigger.isOpen);
|
|
45
|
+
useLayoutEffect(restoreTriggerFocus.bind(null, buttonRef, previousOpen, trigger.isOpen), [buttonRef, trigger.isOpen]);
|
|
46
|
+
const [height, setHeight] = useState(null);
|
|
47
|
+
useLayoutEffect(observePanel.bind(null, contentRef, trigger.isOpen, setHeight), [trigger.isOpen]);
|
|
48
|
+
return /* @__PURE__ */ jsx("div", {
|
|
49
|
+
ref: buttonRef,
|
|
50
|
+
className: `seams-profile-button-morphable ${trigger.isOpen ? "open" : "closed"} ${className ?? ""}`,
|
|
51
|
+
style: trigger.isOpen ? style : {
|
|
52
|
+
...style,
|
|
53
|
+
width: "fit-content"
|
|
54
|
+
},
|
|
55
|
+
"data-state": trigger.isOpen ? "open" : "closed",
|
|
56
|
+
children: trigger.isOpen ? /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: "seams-account-resize",
|
|
58
|
+
onKeyDown: closeWithEscape.bind(null, dropdown.onClose),
|
|
59
|
+
style: { height: height ?? void 0 },
|
|
60
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
61
|
+
ref: contentRef,
|
|
62
|
+
className: "seams-account-panel-content",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsxs("header", {
|
|
65
|
+
className: "seams-account-origin",
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ jsx(LockKeyholeIcon, { size: 14 }),
|
|
68
|
+
/* @__PURE__ */ jsx("span", { children: typeof window === "undefined" ? "" : window.location.host }),
|
|
69
|
+
/* @__PURE__ */ jsx("button", {
|
|
70
|
+
type: "button",
|
|
71
|
+
"aria-label": "Close wallet settings",
|
|
72
|
+
onClick: dropdown.onClose,
|
|
73
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
74
|
+
width: "18",
|
|
75
|
+
height: "18",
|
|
76
|
+
viewBox: "0 0 24 24",
|
|
77
|
+
fill: "none",
|
|
78
|
+
stroke: "currentColor",
|
|
79
|
+
strokeWidth: "1.5",
|
|
80
|
+
children: /* @__PURE__ */ jsx("path", { d: "m6 6 12 12M18 6 6 18" })
|
|
81
|
+
})
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
}),
|
|
85
|
+
/* @__PURE__ */ jsx("div", {
|
|
86
|
+
className: "seams-account-main",
|
|
87
|
+
ref: dropdownRef,
|
|
88
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
|
|
89
|
+
className: "seams-account-identity",
|
|
90
|
+
tabIndex: -1,
|
|
91
|
+
role: "group",
|
|
92
|
+
"aria-label": "Wallet account",
|
|
93
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
94
|
+
className: "seams-account-avatar",
|
|
95
|
+
children: /* @__PURE__ */ jsx(TouchIcon, {
|
|
96
|
+
width: 23,
|
|
97
|
+
height: 23,
|
|
98
|
+
strokeWidth: 1.5
|
|
99
|
+
})
|
|
100
|
+
}), /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("strong", { children: trigger.fullAccountId ?? trigger.username }), trigger.emailAddress ? /* @__PURE__ */ jsx("small", { children: trigger.emailAddress }) : null] })]
|
|
101
|
+
}), /* @__PURE__ */ jsx(ProfileDropdown, { ...dropdown })] })
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ jsxs("footer", {
|
|
104
|
+
className: "seams-account-footer",
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsxs("svg", {
|
|
107
|
+
width: "17",
|
|
108
|
+
height: "17",
|
|
109
|
+
viewBox: "0 0 24 24",
|
|
110
|
+
fill: "none",
|
|
111
|
+
stroke: "currentColor",
|
|
112
|
+
strokeWidth: "1.5",
|
|
113
|
+
children: [/* @__PURE__ */ jsx("path", { d: "m12 3 8 3v6c0 5-8 9-8 9s-8-4-8-9V6z" }), /* @__PURE__ */ jsx("path", { d: "m8 12 3 3 5-6" })]
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ jsx("span", { children: "Secured by" }),
|
|
116
|
+
/* @__PURE__ */ jsx("svg", {
|
|
117
|
+
className: "seams-account-wordmark",
|
|
118
|
+
viewBox: "0 0 1428 285",
|
|
119
|
+
role: "img",
|
|
120
|
+
"aria-label": "seams",
|
|
121
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
122
|
+
d: SEAMS_STANDARD_WORDMARK_PATH,
|
|
123
|
+
fill: "currentColor",
|
|
124
|
+
fillRule: "evenodd"
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
})
|
|
131
|
+
}) : /* @__PURE__ */ jsx(UserAccountButton, { ...trigger })
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
export { AccountMenuButtonView };
|
|
136
|
+
|
|
137
|
+
//# sourceMappingURL=AccountMenuButtonView.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import TouchIcon from "./icons/TouchIcon.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/react/components/AccountMenuButton/AccountMenuDeviceDetails.tsx
|
|
5
|
+
/** Display data only. Removal and authentication remain owned by the caller. */
|
|
6
|
+
function AccountMenuDeviceDetails({ title, description, details, children, icon }) {
|
|
7
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
8
|
+
/* @__PURE__ */ jsxs("div", {
|
|
9
|
+
className: "seams-account-device-hero",
|
|
10
|
+
children: [
|
|
11
|
+
/* @__PURE__ */ jsx("span", {
|
|
12
|
+
className: "seams-account-avatar",
|
|
13
|
+
children: icon ?? /* @__PURE__ */ jsx(TouchIcon, {
|
|
14
|
+
width: 30,
|
|
15
|
+
height: 30,
|
|
16
|
+
strokeWidth: 1.5
|
|
17
|
+
})
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ jsx("h3", { children: title }),
|
|
20
|
+
/* @__PURE__ */ jsx("p", { children: description })
|
|
21
|
+
]
|
|
22
|
+
}),
|
|
23
|
+
/* @__PURE__ */ jsx("dl", {
|
|
24
|
+
className: "seams-account-inset",
|
|
25
|
+
children: details.map(renderDetail)
|
|
26
|
+
}),
|
|
27
|
+
children
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
function renderDetail(detail) {
|
|
31
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
32
|
+
className: "seams-account-detail-row",
|
|
33
|
+
children: [/* @__PURE__ */ jsx("dt", { children: detail.label }), /* @__PURE__ */ jsx("dd", { children: detail.value })]
|
|
34
|
+
}, detail.label);
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { AccountMenuDeviceDetails };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=AccountMenuDeviceDetails.js.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { Theme, useTheme } from "../theme/ThemeProvider.js";
|
|
2
|
+
import { AccountMenuScreen } from "./AccountMenuScreen.js";
|
|
3
|
+
import { LockKeyholeIcon } from "./icons/LockKeyholeIcon.js";
|
|
4
|
+
import { LayersIcon } from "./icons/LayersIcon.js";
|
|
2
5
|
import React, { useEffect } from "react";
|
|
3
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
7
|
//#region src/react/components/AccountMenuButton/AccountMenuDialog.tsx
|
|
@@ -33,7 +36,7 @@ function useAccountMenuDialogKeyboard(input) {
|
|
|
33
36
|
onClose
|
|
34
37
|
]);
|
|
35
38
|
useEffect(() => {
|
|
36
|
-
if (!isOpen || presentation
|
|
39
|
+
if (!isOpen || presentation !== "modal") return;
|
|
37
40
|
previousFocusRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
38
41
|
dialogRef.current?.focus({ preventScroll: true });
|
|
39
42
|
window.addEventListener("keydown", handleDialogKeyDown);
|
|
@@ -51,9 +54,16 @@ function useAccountMenuDialogKeyboard(input) {
|
|
|
51
54
|
}
|
|
52
55
|
const AccountMenuDialogFrame = ({ presentation, onClose, dialogRef, contentClassName, titleId, title, closeLabel, children }) => {
|
|
53
56
|
const { theme, tokens } = useTheme();
|
|
57
|
+
const scopedTokens = React.useMemo(() => theme === "dark" ? { dark: tokens } : { light: tokens }, [theme, tokens]);
|
|
58
|
+
if (presentation === "embedded") return /* @__PURE__ */ jsx(AccountMenuScreen, {
|
|
59
|
+
title,
|
|
60
|
+
onBack: onClose,
|
|
61
|
+
className: contentClassName,
|
|
62
|
+
children
|
|
63
|
+
});
|
|
54
64
|
return /* @__PURE__ */ jsx(Theme, {
|
|
55
65
|
theme,
|
|
56
|
-
tokens:
|
|
66
|
+
tokens: scopedTokens,
|
|
57
67
|
children: /* @__PURE__ */ jsx("div", {
|
|
58
68
|
className: `seams-linked-devices-modal-backdrop theme-${theme}`,
|
|
59
69
|
"data-presentation": presentation,
|
|
@@ -69,19 +79,35 @@ const AccountMenuDialogFrame = ({ presentation, onClose, dialogRef, contentClass
|
|
|
69
79
|
"aria-labelledby": titleId,
|
|
70
80
|
tabIndex: -1,
|
|
71
81
|
children: [
|
|
72
|
-
presentation === "modal" ? /* @__PURE__ */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
presentation === "modal" ? /* @__PURE__ */ jsxs("header", {
|
|
83
|
+
className: "seams-account-menu-dialog-header",
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ jsx(LockKeyholeIcon, { size: 13 }),
|
|
86
|
+
/* @__PURE__ */ jsx("span", {
|
|
87
|
+
className: "seams-account-menu-dialog-host",
|
|
88
|
+
children: window.location.host
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ jsx("button", {
|
|
91
|
+
type: "button",
|
|
92
|
+
className: "seams-linked-devices-modal-close",
|
|
93
|
+
onClick: onClose,
|
|
94
|
+
"aria-label": closeLabel,
|
|
95
|
+
children: "✕"
|
|
96
|
+
})
|
|
97
|
+
]
|
|
78
98
|
}) : null,
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
99
|
+
/* @__PURE__ */ jsxs("div", {
|
|
100
|
+
className: "seams-account-menu-dialog-main",
|
|
101
|
+
children: [/* @__PURE__ */ jsx("h2", {
|
|
102
|
+
id: titleId,
|
|
103
|
+
className: "seams-linked-devices-modal-title",
|
|
104
|
+
children: title
|
|
105
|
+
}), children]
|
|
83
106
|
}),
|
|
84
|
-
|
|
107
|
+
presentation === "modal" ? /* @__PURE__ */ jsxs("footer", {
|
|
108
|
+
className: "seams-account-menu-dialog-footer",
|
|
109
|
+
children: [/* @__PURE__ */ jsx(LayersIcon, { size: 13 }), "Powered by seams"]
|
|
110
|
+
}) : null
|
|
85
111
|
]
|
|
86
112
|
})
|
|
87
113
|
})
|