@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.
Files changed (104) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +10 -10
  5. package/src/index.cjs +16 -0
  6. package/src/index.d.ts +2 -1
  7. package/src/index.js +8 -0
  8. package/src/lib/components/index.d.ts +1 -0
  9. package/src/lib/context/ViewContext/ViewContext.d.ts +1 -1
  10. package/src/lib/data/api.cjs +15 -0
  11. package/src/lib/data/api.d.ts +7 -1
  12. package/src/lib/data/api.js +16 -2
  13. package/src/lib/events/dynamicEvents.d.ts +2 -0
  14. package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -0
  15. package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +2 -1
  16. package/src/lib/locale/en/translation.cjs +71 -1
  17. package/src/lib/locale/en/translation.d.ts +70 -0
  18. package/src/lib/locale/en/translation.js +71 -1
  19. package/src/lib/shared/assets/alt-embedded-wallet.cjs +54 -0
  20. package/src/lib/shared/assets/alt-embedded-wallet.js +30 -0
  21. package/src/lib/shared/assets/export-embedded-hero.cjs +90 -0
  22. package/src/lib/shared/assets/export-embedded-hero.js +66 -0
  23. package/src/lib/shared/assets/eye-off-icon.cjs +53 -0
  24. package/src/lib/shared/assets/eye-off-icon.js +29 -0
  25. package/src/lib/shared/assets/face-id.cjs +53 -0
  26. package/src/lib/shared/assets/face-id.js +29 -0
  27. package/src/lib/shared/assets/index.d.ts +6 -0
  28. package/src/lib/shared/assets/lock.cjs +54 -0
  29. package/src/lib/shared/assets/lock.js +30 -0
  30. package/src/lib/shared/assets/wallet-v2.cjs +53 -0
  31. package/src/lib/shared/assets/wallet-v2.js +29 -0
  32. package/src/lib/styles/index.shadow.cjs +1 -1
  33. package/src/lib/styles/index.shadow.js +1 -1
  34. package/src/lib/utils/functions/index.d.ts +1 -0
  35. package/src/lib/utils/functions/isEmailValid/index.d.ts +1 -0
  36. package/src/lib/utils/functions/isEmailValid/isEmailValid.cjs +8 -0
  37. package/src/lib/utils/functions/isEmailValid/isEmailValid.d.ts +1 -0
  38. package/src/lib/utils/functions/isEmailValid/isEmailValid.js +4 -0
  39. package/src/lib/utils/functions/isProviderEnabled/isProviderEnabled.cjs +9 -1
  40. package/src/lib/utils/functions/isProviderEnabled/isProviderEnabled.js +9 -1
  41. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.cjs +28 -1
  42. package/src/lib/utils/hooks/authenticationHooks/useEmailVerificationRequest/useEmailVerificationRequest.js +28 -1
  43. package/src/lib/utils/hooks/index.d.ts +1 -0
  44. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +4 -1
  45. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.d.ts +1 -0
  46. package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +4 -1
  47. package/src/lib/utils/hooks/useConnectWithEmailOtp/index.d.ts +1 -0
  48. package/src/lib/utils/hooks/useConnectWithEmailOtp/useConnectWithEmailOtp.cjs +150 -0
  49. package/src/lib/utils/hooks/useConnectWithEmailOtp/useConnectWithEmailOtp.d.ts +32 -0
  50. package/src/lib/utils/hooks/useConnectWithEmailOtp/useConnectWithEmailOtp.js +146 -0
  51. package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +3 -3
  52. package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +3 -3
  53. package/src/lib/utils/hooks/useEmbeddedReveal/index.d.ts +1 -0
  54. package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.cjs +60 -0
  55. package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.d.ts +4 -0
  56. package/src/lib/utils/hooks/useEmbeddedReveal/useEmbeddedReveal.js +56 -0
  57. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +3 -0
  58. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +3 -0
  59. package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs +2 -27
  60. package/src/lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js +2 -27
  61. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +20 -14
  62. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +20 -14
  63. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs +26 -4
  64. package/src/lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js +26 -4
  65. package/src/lib/views/EmailVerification/EmailVerification.cjs +34 -23
  66. package/src/lib/views/EmailVerification/EmailVerification.js +34 -23
  67. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.cjs +158 -0
  68. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.d.ts +2 -0
  69. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/EmbeddedRevealView.js +154 -0
  70. package/src/lib/views/EmbeddedReveal/EmbeddedRevealView/index.d.ts +1 -0
  71. package/src/lib/views/EmbeddedReveal/constants.cjs +9 -0
  72. package/src/lib/views/EmbeddedReveal/constants.d.ts +2 -0
  73. package/src/lib/views/EmbeddedReveal/constants.js +4 -0
  74. package/src/lib/views/EmbeddedReveal/index.d.ts +1 -0
  75. package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/index.d.ts +1 -0
  76. package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +114 -0
  77. package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.d.ts +15 -0
  78. package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +108 -0
  79. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +2 -3
  80. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.d.ts +0 -1
  81. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +3 -3
  82. package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.cjs +2 -2
  83. package/src/lib/views/Passkey/PasskeyRecovery/InitRecovery/PasskeyInitRecovery.js +2 -2
  84. package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.cjs +2 -2
  85. package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.d.ts +2 -2
  86. package/src/lib/views/Passkey/utils/passkeyRecovery/passkeyRecovery.js +2 -2
  87. package/src/lib/views/WalletList/WalletList.cjs +5 -8
  88. package/src/lib/views/WalletList/WalletList.js +5 -8
  89. package/src/lib/views/viewToComponentMap.cjs +2 -0
  90. package/src/lib/views/viewToComponentMap.js +2 -0
  91. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +2 -2
  92. package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +2 -2
  93. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.cjs +2 -0
  94. package/src/lib/widgets/DynamicWidget/components/DynamicWidgetViews/DynamicWidgetViews.js +2 -0
  95. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.cjs +2 -0
  96. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.d.ts +3 -1
  97. package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.types.js +2 -1
  98. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.cjs +4 -4
  99. package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/ManagePasskeysWidgetView.js +4 -4
  100. package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.cjs +93 -0
  101. package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.d.ts +2 -0
  102. package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/WalletSettingsView.js +89 -0
  103. package/src/lib/widgets/DynamicWidget/views/WalletSettingsView/index.d.ts +1 -0
  104. 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';