@dynamic-labs/sdk-react-core 1.1.0-alpha.3 → 1.1.0-alpha.5
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/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +10 -10
- package/src/index.cjs +16 -0
- package/src/index.d.ts +2 -1
- package/src/index.js +8 -0
- package/src/lib/components/index.d.ts +1 -0
- package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
- package/src/lib/data/api.cjs +15 -0
- package/src/lib/data/api.d.ts +7 -1
- package/src/lib/data/api.js +16 -2
- package/src/lib/events/dynamicEvents.d.ts +2 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +2 -1
- package/src/lib/locale/en/translation.cjs +71 -1
- package/src/lib/locale/en/translation.d.ts +70 -0
- package/src/lib/locale/en/translation.js +71 -1
- package/src/lib/shared/assets/alt-embedded-wallet.cjs +54 -0
- package/src/lib/shared/assets/alt-embedded-wallet.js +30 -0
- package/src/lib/shared/assets/export-embedded-hero.cjs +90 -0
- package/src/lib/shared/assets/export-embedded-hero.js +66 -0
- package/src/lib/shared/assets/eye-off-icon.cjs +53 -0
- package/src/lib/shared/assets/eye-off-icon.js +29 -0
- package/src/lib/shared/assets/face-id.cjs +53 -0
- package/src/lib/shared/assets/face-id.js +29 -0
- package/src/lib/shared/assets/index.d.ts +6 -0
- package/src/lib/shared/assets/lock.cjs +54 -0
- package/src/lib/shared/assets/lock.js +30 -0
- package/src/lib/shared/assets/wallet-v2.cjs +53 -0
- package/src/lib/shared/assets/wallet-v2.js +29 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/functions/isEmailValid/index.d.ts +1 -0
- package/src/lib/utils/functions/isEmailValid/isEmailValid.cjs +8 -0
- package/src/lib/utils/functions/isEmailValid/isEmailValid.d.ts +1 -0
- package/src/lib/utils/functions/isEmailValid/isEmailValid.js +4 -0
- package/src/lib/utils/functions/isProviderEnabled/isProviderEnabled.cjs +9 -1
- package/src/lib/utils/functions/isProviderEnabled/isProviderEnabled.js +9 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +28 -1
- package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +28 -1
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +4 -1
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +4 -1
- package/src/lib/utils/hooks/useConnectWithEmailOtp/index.d.ts +1 -0
- package/src/lib/utils/hooks/useConnectWithEmailOtp/useConnectWithEmailOtp.cjs +150 -0
- package/src/lib/utils/hooks/useConnectWithEmailOtp/useConnectWithEmailOtp.d.ts +32 -0
- package/src/lib/utils/hooks/useConnectWithEmailOtp/useConnectWithEmailOtp.js +146 -0
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +3 -3
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +3 -3
- package/src/lib/utils/hooks/useEmbeddedReveal/index.d.ts +1 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +60 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.d.ts +4 -0
- package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +56 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +3 -0
- package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +3 -0
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +2 -27
- package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +2 -27
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +20 -14
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +20 -14
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +26 -4
- package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +26 -4
- package/src/lib/views/EmailVerification/EmailVerification.cjs +34 -23
- package/src/lib/views/EmailVerification/EmailVerification.js +34 -23
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +158 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.d.ts +2 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +154 -0
- package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/constants.cjs +9 -0
- package/src/lib/views/EmbeddedReveal/constants.d.ts +2 -0
- package/src/lib/views/EmbeddedReveal/constants.js +4 -0
- package/src/lib/views/EmbeddedReveal/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/index.d.ts +1 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +114 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.d.ts +15 -0
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +108 -0
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +2 -3
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.d.ts +0 -1
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +3 -3
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +2 -2
- package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.d.ts +2 -2
- package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +2 -2
- package/src/lib/views/WalletList/WalletList.cjs +5 -8
- package/src/lib/views/WalletList/WalletList.js +5 -8
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.js +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.cjs +2 -0
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +3 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.js +2 -1
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +4 -4
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +4 -4
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +93 -0
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.d.ts +2 -0
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +89 -0
- package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/index.d.ts +1 -0
- package/src/lib/widgets/DynamicWidget/views/index.d.ts +1 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import 'react';
|
|
4
|
+
import '../../../../events/dynamicEvents.js';
|
|
5
|
+
import '@dynamic-labs/utils';
|
|
6
|
+
import { useInternalDynamicContext } from '../../../../context/DynamicContext/useInternalDynamicContext.js';
|
|
7
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
8
|
+
import '../../../../context/CaptchaContext/CaptchaContext.js';
|
|
9
|
+
import '../../../../context/ErrorContext/ErrorContext.js';
|
|
10
|
+
import '../../../../context/ViewContext/ViewContext.js';
|
|
11
|
+
import { decodeJwt } from '../../../../shared/utils/functions/decodeJwt/decodeJwt.js';
|
|
12
|
+
import '@dynamic-labs/iconic';
|
|
13
|
+
import { ReactComponent as SvgCheckCircle } from '../../../../shared/assets/check-circle.js';
|
|
14
|
+
import { ReactComponent as SvgChevronLeft } from '../../../../shared/assets/chevron-left.js';
|
|
15
|
+
import { ReactComponent as SvgLock } from '../../../../shared/assets/lock.js';
|
|
16
|
+
import { ReactComponent as SvgAltEmbeddedWallet } from '../../../../shared/assets/alt-embedded-wallet.js';
|
|
17
|
+
import { ReactComponent as SvgFaceId } from '../../../../shared/assets/face-id.js';
|
|
18
|
+
import '../../../../shared/logger.js';
|
|
19
|
+
import '@dynamic-labs/wallet-book';
|
|
20
|
+
import '../../../../utils/constants/colors.js';
|
|
21
|
+
import '../../../../shared/utils/classes/storage/localStorage.js';
|
|
22
|
+
import 'viem';
|
|
23
|
+
import '../../../../shared/consts/index.js';
|
|
24
|
+
import '@dynamic-labs/multi-wallet';
|
|
25
|
+
import '@dynamic-labs/sdk-api';
|
|
26
|
+
import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
27
|
+
import '../../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
28
|
+
import '../../../../config/ApiEndpoint.js';
|
|
29
|
+
import '../../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
30
|
+
import 'react-dom';
|
|
31
|
+
import '../../../../context/ThemeContext/ThemeContext.js';
|
|
32
|
+
import '@dynamic-labs/types';
|
|
33
|
+
import 'yup';
|
|
34
|
+
import '../../../../context/MockContext/MockContext.js';
|
|
35
|
+
import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
36
|
+
import '../../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
37
|
+
import '@dynamic-labs/rpc-providers';
|
|
38
|
+
import '../../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
39
|
+
import '../../../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
40
|
+
import '../../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
41
|
+
import '../../../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
42
|
+
import '../../../../components/ShadowDOM/ShadowDOM.js';
|
|
43
|
+
import '../../../../components/OverlayCard/OverlayCard.context.js';
|
|
44
|
+
import '../../../../context/FooterAnimationContext/index.js';
|
|
45
|
+
import '../../../../context/QrCodeContext/QrCodeContext.js';
|
|
46
|
+
import { useIsTurnkeyWallet } from '../../../../utils/hooks/useIsTurnkeyWallet/useIsTurnkeyWallet.js';
|
|
47
|
+
import { Typography } from '../../../../components/Typography/Typography.js';
|
|
48
|
+
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
49
|
+
import '../../components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
50
|
+
import 'qrcode';
|
|
51
|
+
import '../../../../context/LoadingContext/LoadingContext.js';
|
|
52
|
+
import 'i18next';
|
|
53
|
+
import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
|
|
54
|
+
import '../../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
55
|
+
import 'formik';
|
|
56
|
+
import { Button } from '../../../../components/Button/Button.js';
|
|
57
|
+
import { ModalHeader } from '../../../../components/ModalHeader/ModalHeader.js';
|
|
58
|
+
import { IconButton } from '../../../../components/IconButton/IconButton.js';
|
|
59
|
+
import '../../../../components/Alert/Alert.js';
|
|
60
|
+
import '@dynamic-labs/viem-utils';
|
|
61
|
+
import '../ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
62
|
+
import { useEmbeddedReveal } from '../../../../utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js';
|
|
63
|
+
import '../../../../components/InlineWidget/InlineWidget.js';
|
|
64
|
+
import '../../../../components/MenuList/Dropdown/Dropdown.js';
|
|
65
|
+
import '../../../../components/Popper/Popper/Popper.js';
|
|
66
|
+
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
67
|
+
import 'react-focus-lock';
|
|
68
|
+
|
|
69
|
+
const WalletSettingsView = () => {
|
|
70
|
+
var _a, _b;
|
|
71
|
+
const { goToInitialDynamicWidgetView, setDynamicWidgetView } = useWidgetContext();
|
|
72
|
+
const { authToken } = useInternalDynamicContext();
|
|
73
|
+
const { initExportProcess } = useEmbeddedReveal();
|
|
74
|
+
const { isTurnkeyWallet, isTurnkeyWalletWithoutAuthenticator } = useIsTurnkeyWallet();
|
|
75
|
+
const { t } = useTranslation();
|
|
76
|
+
const decodedJwt = decodeJwt(authToken);
|
|
77
|
+
const walletProperties = (_b = (_a = decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.verifiedCredentials) === null || _a === void 0 ? void 0 : _a.find(({ walletName }) => walletName === null || walletName === void 0 ? void 0 : walletName.startsWith('turnkey'))) === null || _b === void 0 ? void 0 : _b.walletProperties;
|
|
78
|
+
const isTurnkeyHDWallet = walletProperties === null || walletProperties === void 0 ? void 0 : walletProperties.turnkeyHDWalletId;
|
|
79
|
+
const backButton = (jsx(IconButton, { type: 'button', onClick: goToInitialDynamicWidgetView, "data-testid": 'back-button', children: jsx(SvgChevronLeft, {}) }));
|
|
80
|
+
return (jsxs("div", { className: 'wallet-settings-view', children: [jsx(ModalHeader, { leading: backButton, children: jsx("div", { className: 'wallet-settings-view__header', children: jsx(Typography, { variant: 'title', color: 'primary', children: t('dyn_wallet_settings.title') }) }) }), jsxs("div", { className: 'wallet-settings-view__body', children: [jsxs("div", { className: 'wallet-settings-view__body__section', children: [jsx("div", { className: 'wallet-settings-view__body__section__title', children: t('dyn_wallet_settings.signing_section.title') }), jsx(Button, { dataTestId: 'manage-passkeys-button', onClick: () => setDynamicWidgetView('manage-passkeys'), buttonClassName: 'wallet-settings-view__body__section__button', startSlot:
|
|
81
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
82
|
+
jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsx(SvgFaceId, { className: 'wallet-settings-view__body__section__button__icon' }), jsx(Typography, { weight: 'medium', children: t('dyn_wallet_settings.signing_section.passkey_button') })] }), endSlot: isTurnkeyWallet && !isTurnkeyWalletWithoutAuthenticator ? (jsx(SvgCheckCircle, { className: 'wallet-settings-view__body__section__button__icon-secondary--success' })) : undefined, showInternalLoading: false })] }), jsxs("div", { className: 'wallet-settings-view__body__section', children: [jsx("div", { className: 'wallet-settings-view__body__section__title', children: t('dyn_wallet_settings.export_section.title') }), jsx(Button, { dataTestId: 'embedded-reveal-button', onClick: initExportProcess, buttonClassName: 'wallet-settings-view__body__section__button', disabled: !isTurnkeyWallet || isTurnkeyWalletWithoutAuthenticator, startSlot:
|
|
83
|
+
// eslint-disable-next-line react/jsx-wrap-multilines
|
|
84
|
+
jsxs("div", { className: 'wallet-settings-view__body__section__button__start-slot', children: [jsx(SvgAltEmbeddedWallet, { className: 'wallet-settings-view__body__section__button__icon' }), jsx(Typography, { weight: 'medium', children: isTurnkeyHDWallet
|
|
85
|
+
? t('dyn_wallet_settings.export_section.srp_button')
|
|
86
|
+
: t('dyn_wallet_settings.export_section.private_key_button') })] }), endSlot: isTurnkeyWallet && !isTurnkeyWalletWithoutAuthenticator ? (jsx(SvgChevronLeft, { className: 'wallet-settings-view__body__section__button__icon-secondary--rotate' })) : (jsx(SvgLock, { className: 'wallet-settings-view__body__section__button__icon-secondary' })), showInternalLoading: false })] })] })] }));
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { WalletSettingsView };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletSettingsView } from './WalletSettingsView';
|
|
@@ -3,3 +3,4 @@ export { ProfileView } from './ProfileView/ProfileView';
|
|
|
3
3
|
export { EditProfileView } from './EditProfileView/EditProfileView';
|
|
4
4
|
export { SendBalanceWidgetView } from './SendBalanceWidgetView';
|
|
5
5
|
export { ManagePasskeysWidgetView } from './ManagePasskeysWidgetView';
|
|
6
|
+
export { WalletSettingsView } from './WalletSettingsView';
|