@dynamic-labs/sdk-react-core 4.10.0 → 4.10.2

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 (92) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/package.cjs +1 -1
  3. package/package.js +1 -1
  4. package/package.json +11 -11
  5. package/src/api.d.ts +1 -0
  6. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +1 -1
  7. package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +1 -1
  8. package/src/lib/components/DynamicSpinner/DynamicSpinner.d.ts +3 -0
  9. package/src/lib/components/DynamicSpinner/index.d.ts +1 -0
  10. package/src/lib/components/IconWithSpinner/IconWithSpinner.cjs +2 -5
  11. package/src/lib/components/IconWithSpinner/IconWithSpinner.d.ts +3 -3
  12. package/src/lib/components/IconWithSpinner/IconWithSpinner.js +2 -5
  13. package/src/lib/components/Popper/PopperContext/PopperContext.cjs +2 -2
  14. package/src/lib/components/Popper/PopperContext/PopperContext.d.ts +2 -1
  15. package/src/lib/components/Popper/PopperContext/PopperContext.js +2 -2
  16. package/src/lib/components/QrCodeWrapper/QrCodeWrapper.cjs +7 -7
  17. package/src/lib/components/QrCodeWrapper/QrCodeWrapper.js +7 -7
  18. package/src/lib/components/SocialSignIn/SocialSignIn.cjs +1 -1
  19. package/src/lib/components/SocialSignIn/SocialSignIn.js +1 -1
  20. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +8 -8
  21. package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +8 -8
  22. package/src/lib/components/Typography/Typography.cjs +1 -0
  23. package/src/lib/components/Typography/Typography.js +1 -0
  24. package/src/lib/components/Typography/Typography.types.d.ts +1 -1
  25. package/src/lib/components/index.d.ts +8 -7
  26. package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs +4 -0
  27. package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js +4 -0
  28. package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.cjs +1 -1
  29. package/src/lib/context/SocialRedirectContext/hooks/useRedirectSocialHandler/useRedirectSocialHandler.js +1 -1
  30. package/src/lib/data/api/index.d.ts +1 -0
  31. package/src/lib/data/api/transactions/index.d.ts +1 -0
  32. package/src/lib/events/dynamicEvents.cjs +1 -0
  33. package/src/lib/events/dynamicEvents.d.ts +2 -2
  34. package/src/lib/events/dynamicEvents.js +1 -0
  35. package/src/lib/events/ui.d.ts +8 -0
  36. package/src/lib/main.global.cjs +1 -1
  37. package/src/lib/main.global.js +1 -1
  38. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.cjs +8 -8
  39. package/src/lib/modals/SignMessageConfirmationModal/SignMessageConfirmationModal.js +8 -8
  40. package/src/lib/shared/assets/index.d.ts +2 -1
  41. package/src/lib/shared/types/dynamicEventsCallbacks.d.ts +6 -1
  42. package/src/lib/shared/types/wallets.d.ts +10 -0
  43. package/src/lib/styles/index.shadow.cjs +1 -1
  44. package/src/lib/styles/index.shadow.js +1 -1
  45. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +1 -1
  46. package/src/lib/utils/hooks/useMfa/useMfa.cjs +56 -39
  47. package/src/lib/utils/hooks/useMfa/useMfa.d.ts +5 -0
  48. package/src/lib/utils/hooks/useMfa/useMfa.js +57 -40
  49. package/src/lib/utils/hooks/useRefreshUser/useRefreshUser.cjs +23 -82
  50. package/src/lib/utils/hooks/useRefreshUser/useRefreshUser.js +23 -82
  51. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +1 -1
  52. package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +1 -1
  53. package/src/lib/utils/hooks/useSocialAuth/farcaster/farcaster.cjs +13 -6
  54. package/src/lib/utils/hooks/useSocialAuth/farcaster/farcaster.d.ts +13 -3
  55. package/src/lib/utils/hooks/useSocialAuth/farcaster/farcaster.js +13 -6
  56. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +13 -12
  57. package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +13 -12
  58. package/src/lib/utils/hooks/useSyncEmbeddedWalletFlow/useSyncEmbeddedWalletFlow.cjs +1 -1
  59. package/src/lib/utils/hooks/useSyncEmbeddedWalletFlow/useSyncEmbeddedWalletFlow.js +1 -1
  60. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +1 -1
  61. package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +1 -1
  62. package/src/lib/utils/hooks/useTelegramLogin/useTelegramLogin.cjs +1 -1
  63. package/src/lib/utils/hooks/useTelegramLogin/useTelegramLogin.js +1 -1
  64. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +1 -1
  65. package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +1 -1
  66. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +1 -1
  67. package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +1 -1
  68. package/src/lib/views/MfaRecoveryView/MfaRecoveryView.cjs +1 -1
  69. package/src/lib/views/MfaRecoveryView/MfaRecoveryView.js +1 -1
  70. package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +4 -4
  71. package/src/lib/views/MfaVerificationView/MfaVerificationView.js +4 -4
  72. package/src/lib/views/Passkey/PasskeyRecovery/AddRecoveryEmail/AddRecoveryEmail.cjs +1 -1
  73. package/src/lib/views/Passkey/PasskeyRecovery/AddRecoveryEmail/AddRecoveryEmail.js +1 -1
  74. package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +1 -1
  75. package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +1 -1
  76. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
  77. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
  78. package/src/lib/views/WalletList/hooks/useTabState.cjs +29 -4
  79. package/src/lib/views/WalletList/hooks/useTabState.d.ts +2 -2
  80. package/src/lib/views/WalletList/hooks/useTabState.js +30 -5
  81. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.cjs +1 -1
  82. package/src/lib/views/WalletSignSpinnerView/WalletSignSpinnerView.js +1 -1
  83. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.cjs +1 -1
  84. package/src/lib/widgets/DynamicBridgeWidget/components/DynamicBridgeUserProfile/DynamicBridgeUserProfile.js +1 -1
  85. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +1 -1
  86. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +1 -1
  87. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.cjs +1 -1
  88. package/src/lib/widgets/DynamicWidget/views/AccountAndSecuritySettingsView/AccountAndSecuritySettingsView.js +1 -1
  89. package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.cjs +1 -1
  90. package/src/lib/widgets/DynamicWidget/views/GlobalWalletView/GlobalWalletView.js +1 -1
  91. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.cjs +2 -2
  92. package/src/lib/widgets/DynamicWidget/views/SettingsView/SettingsView.js +2 -2
@@ -4,19 +4,44 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var React = require('react');
7
+ var dynamicEvents = require('../../../events/dynamicEvents.cjs');
8
+ var logger = require('../../../shared/logger.cjs');
7
9
 
8
10
  const useTabState = ({ settingsOverrides, }) => {
9
- var _a, _b, _c;
11
+ var _a, _b, _c, _d;
10
12
  const walletListViewSettings = (_a = settingsOverrides === null || settingsOverrides === void 0 ? void 0 : settingsOverrides.views) === null || _a === void 0 ? void 0 : _a.find((view) => view.type === 'wallet-list');
11
- const [selectedTabIndex, setSelectedTabIndex] = React.useState(0);
13
+ const [selectedTabIndex, _setSelectedTabIndex] = React.useState(0);
14
+ const setSelectedTabIndex = React.useCallback((value) => {
15
+ const validateSelectedTabIndex = (index) => {
16
+ var _a, _b;
17
+ const tab = (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[index];
18
+ if (!tab) {
19
+ logger.logger.error(`Tab with index ${index} not found. Available tabs: ${JSON.stringify((_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items)}`);
20
+ return;
21
+ }
22
+ dynamicEvents.dynamicEvents.emit('walletTabSelected', { index, tab });
23
+ return index;
24
+ };
25
+ if (typeof value === 'number') {
26
+ const newIndex = validateSelectedTabIndex(value);
27
+ if (newIndex !== undefined)
28
+ _setSelectedTabIndex(newIndex);
29
+ return;
30
+ }
31
+ _setSelectedTabIndex((current) => {
32
+ var _a;
33
+ const newIndex = value(current);
34
+ return (_a = validateSelectedTabIndex(newIndex)) !== null && _a !== void 0 ? _a : current;
35
+ });
36
+ }, [(_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items]);
12
37
  const selectedTabSettings = selectedTabIndex === null
13
38
  ? undefined
14
- : (_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items[selectedTabIndex];
39
+ : (_c = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _c === void 0 ? void 0 : _c.items[selectedTabIndex];
15
40
  return {
16
41
  selectedTabIndex,
17
42
  selectedTabSettings,
18
43
  setSelectedTabIndex,
19
- tabsItems: (_c = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _c === void 0 ? void 0 : _c.items,
44
+ tabsItems: (_d = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _d === void 0 ? void 0 : _d.items,
20
45
  };
21
46
  };
22
47
 
@@ -1,10 +1,10 @@
1
- /// <reference types="react" />
1
+ import { Dispatch, SetStateAction } from 'react';
2
2
  import { SettingsOverrides } from '../../../context/DynamicContext/types';
3
3
  export declare const useTabState: ({ settingsOverrides, }: {
4
4
  settingsOverrides: SettingsOverrides | undefined;
5
5
  }) => {
6
6
  selectedTabIndex: number;
7
7
  selectedTabSettings: import("../../../shared").WalletListViewTabItem | undefined;
8
- setSelectedTabIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
8
+ setSelectedTabIndex: Dispatch<SetStateAction<number>>;
9
9
  tabsItems: import("../../../shared").WalletListViewTabItem[] | undefined;
10
10
  };
@@ -1,18 +1,43 @@
1
1
  'use client'
2
- import { useState } from 'react';
2
+ import { useState, useCallback } from 'react';
3
+ import { dynamicEvents } from '../../../events/dynamicEvents.js';
4
+ import { logger } from '../../../shared/logger.js';
3
5
 
4
6
  const useTabState = ({ settingsOverrides, }) => {
5
- var _a, _b, _c;
7
+ var _a, _b, _c, _d;
6
8
  const walletListViewSettings = (_a = settingsOverrides === null || settingsOverrides === void 0 ? void 0 : settingsOverrides.views) === null || _a === void 0 ? void 0 : _a.find((view) => view.type === 'wallet-list');
7
- const [selectedTabIndex, setSelectedTabIndex] = useState(0);
9
+ const [selectedTabIndex, _setSelectedTabIndex] = useState(0);
10
+ const setSelectedTabIndex = useCallback((value) => {
11
+ const validateSelectedTabIndex = (index) => {
12
+ var _a, _b;
13
+ const tab = (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[index];
14
+ if (!tab) {
15
+ logger.error(`Tab with index ${index} not found. Available tabs: ${JSON.stringify((_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items)}`);
16
+ return;
17
+ }
18
+ dynamicEvents.emit('walletTabSelected', { index, tab });
19
+ return index;
20
+ };
21
+ if (typeof value === 'number') {
22
+ const newIndex = validateSelectedTabIndex(value);
23
+ if (newIndex !== undefined)
24
+ _setSelectedTabIndex(newIndex);
25
+ return;
26
+ }
27
+ _setSelectedTabIndex((current) => {
28
+ var _a;
29
+ const newIndex = value(current);
30
+ return (_a = validateSelectedTabIndex(newIndex)) !== null && _a !== void 0 ? _a : current;
31
+ });
32
+ }, [(_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items]);
8
33
  const selectedTabSettings = selectedTabIndex === null
9
34
  ? undefined
10
- : (_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items[selectedTabIndex];
35
+ : (_c = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _c === void 0 ? void 0 : _c.items[selectedTabIndex];
11
36
  return {
12
37
  selectedTabIndex,
13
38
  selectedTabSettings,
14
39
  setSelectedTabIndex,
15
- tabsItems: (_c = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _c === void 0 ? void 0 : _c.items,
40
+ tabsItems: (_d = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _d === void 0 ? void 0 : _d.items,
16
41
  };
17
42
  };
18
43
 
@@ -60,8 +60,8 @@ require('../../components/Alert/Alert.cjs');
60
60
  var Typography = require('../../components/Typography/Typography.cjs');
61
61
  require('../../components/ShadowDOM/ShadowDOM.cjs');
62
62
  var TypographyButton = require('../../components/TypographyButton/TypographyButton.cjs');
63
- require('../../components/IconButton/IconButton.cjs');
64
63
  var IconWithSpinner = require('../../components/IconWithSpinner/IconWithSpinner.cjs');
64
+ require('../../components/IconButton/IconButton.cjs');
65
65
  require('../../components/InlineWidget/InlineWidget.cjs');
66
66
  require('../../components/Input/Input.cjs');
67
67
  require('../../components/IsBrowser/IsBrowser.cjs');
@@ -56,8 +56,8 @@ import '../../components/Alert/Alert.js';
56
56
  import { Typography } from '../../components/Typography/Typography.js';
57
57
  import '../../components/ShadowDOM/ShadowDOM.js';
58
58
  import { TypographyButton } from '../../components/TypographyButton/TypographyButton.js';
59
- import '../../components/IconButton/IconButton.js';
60
59
  import { iconRatio, IconWithSpinner } from '../../components/IconWithSpinner/IconWithSpinner.js';
60
+ import '../../components/IconButton/IconButton.js';
61
61
  import '../../components/InlineWidget/InlineWidget.js';
62
62
  import '../../components/Input/Input.js';
63
63
  import '../../components/IsBrowser/IsBrowser.js';
@@ -97,9 +97,9 @@ require('../../../../store/state/tokenBalances.cjs');
97
97
  require('../../../../shared/utils/functions/getInitialUrl/getInitialUrl.cjs');
98
98
  require('../../../../components/InlineWidget/InlineWidget.cjs');
99
99
  require('../../../../components/IsBrowser/IsBrowser.cjs');
100
+ var OptionsSwitcher = require('../../../../components/OptionsSwitcher/OptionsSwitcher.cjs');
100
101
  require('../../../../components/Popper/Popper/Popper.cjs');
101
102
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
102
- var OptionsSwitcher = require('../../../../components/OptionsSwitcher/OptionsSwitcher.cjs');
103
103
 
104
104
  const options = [
105
105
  {
@@ -93,9 +93,9 @@ import '../../../../store/state/tokenBalances.js';
93
93
  import '../../../../shared/utils/functions/getInitialUrl/getInitialUrl.js';
94
94
  import '../../../../components/InlineWidget/InlineWidget.js';
95
95
  import '../../../../components/IsBrowser/IsBrowser.js';
96
+ import { OptionsSwitcher } from '../../../../components/OptionsSwitcher/OptionsSwitcher.js';
96
97
  import '../../../../components/Popper/Popper/Popper.js';
97
98
  import '../../../../components/Popper/PopperContext/PopperContext.js';
98
- import { OptionsSwitcher } from '../../../../components/OptionsSwitcher/OptionsSwitcher.js';
99
99
 
100
100
  const options = [
101
101
  {
@@ -62,6 +62,7 @@ var classNames = require('../../../../utils/functions/classNames/classNames.cjs'
62
62
  require('../../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
63
63
  require('../../../../components/Alert/Alert.cjs');
64
64
  var Typography = require('../../../../components/Typography/Typography.cjs');
65
+ var AuthProviderIcon = require('../../../../components/AuthProviderIcon/AuthProviderIcon.cjs');
65
66
  require('../../../../components/ShadowDOM/ShadowDOM.cjs');
66
67
  require('../../../../components/IconButton/IconButton.cjs');
67
68
  require('../../../../components/InlineWidget/InlineWidget.cjs');
@@ -77,7 +78,6 @@ require('../../../../components/Popper/Popper/Popper.cjs');
77
78
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
78
79
  require('react-focus-lock');
79
80
  require('qrcode');
80
- var AuthProviderIcon = require('../../../../components/AuthProviderIcon/AuthProviderIcon.cjs');
81
81
  require('formik');
82
82
  require('../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.cjs');
83
83
  require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
@@ -58,6 +58,7 @@ import { classNames } from '../../../../utils/functions/classNames/classNames.js
58
58
  import '../../../../components/Accordion/components/AccordionItem/AccordionItem.js';
59
59
  import '../../../../components/Alert/Alert.js';
60
60
  import { Typography } from '../../../../components/Typography/Typography.js';
61
+ import { AuthProviderIcon } from '../../../../components/AuthProviderIcon/AuthProviderIcon.js';
61
62
  import '../../../../components/ShadowDOM/ShadowDOM.js';
62
63
  import '../../../../components/IconButton/IconButton.js';
63
64
  import '../../../../components/InlineWidget/InlineWidget.js';
@@ -73,7 +74,6 @@ import '../../../../components/Popper/Popper/Popper.js';
73
74
  import '../../../../components/Popper/PopperContext/PopperContext.js';
74
75
  import 'react-focus-lock';
75
76
  import 'qrcode';
76
- import { AuthProviderIcon } from '../../../../components/AuthProviderIcon/AuthProviderIcon.js';
77
77
  import 'formik';
78
78
  import '../../../../utils/hooks/useSubdomainCheck/useSubdomainCheck.js';
79
79
  import '../../../../context/WalletGroupContext/WalletGroupContext.js';
@@ -229,7 +229,7 @@ const AccountAndSecuritySettingsView = () => {
229
229
  // eslint-disable-next-line react/jsx-wrap-multilines
230
230
  jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportPrivateKey.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.private_key_button', children: t('dyn_settings.export_section.private_key_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'embedded-reveal-button', onClick: handleExportWithPhraseClick, buttonClassName: 'settings-view__body__section__button', startSlot:
231
231
  // eslint-disable-next-line react/jsx-wrap-multilines
232
- jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportRecoveryPhrase.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] })] }))] }) }), jsxRuntime.jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', color: 'error-1', variant: 'body_small', weight: 'medium', className: 'account-and-security-settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) })] }));
232
+ jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(exportRecoveryPhrase.ReactComponent, { className: exportIconClasses }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] })] }))] }) }), jsxRuntime.jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, "data-testid": 'delete-account-button', color: 'error-1', variant: 'body_small', weight: 'medium', className: 'account-and-security-settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) })] }));
233
233
  };
234
234
 
235
235
  exports.AccountAndSecuritySettingsView = AccountAndSecuritySettingsView;
@@ -225,7 +225,7 @@ const AccountAndSecuritySettingsView = () => {
225
225
  // eslint-disable-next-line react/jsx-wrap-multilines
226
226
  jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportPrivateKey, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.private_key_button', children: t('dyn_settings.export_section.private_key_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }), isTurnkeyHDWallet && (jsx(TypographyButton, { dataTestId: 'embedded-reveal-button', onClick: handleExportWithPhraseClick, buttonClassName: 'settings-view__body__section__button', startSlot:
227
227
  // eslint-disable-next-line react/jsx-wrap-multilines
228
- jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportRecoveryPhrase, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] })] }))] }) }), jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsx(Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', color: 'error-1', variant: 'body_small', weight: 'medium', className: 'account-and-security-settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) })] }));
228
+ jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgExportRecoveryPhrase, { className: exportIconClasses }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.export_section.srp_button', children: t('dyn_settings.export_section.srp_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] })] }))] }) }), jsx("div", { className: 'account-and-security-settings-view__delete-account-container', children: jsx(Typography, { onClick: handleDeleteAccountClick, "data-testid": 'delete-account-button', color: 'error-1', variant: 'body_small', weight: 'medium', className: 'account-and-security-settings-view__delete-account-container__delete-button', children: t('dyn_settings.delete_account.title') }) })] }));
229
229
  };
230
230
 
231
231
  export { AccountAndSecuritySettingsView };
@@ -37,6 +37,7 @@ require('../../../../store/state/projectSettings/projectSettings.cjs');
37
37
  require('../../../../config/ApiEndpoint.cjs');
38
38
  require('../../../../store/state/user/user.cjs');
39
39
  require('../../../../locale/locale.cjs');
40
+ var blockaid = require('../../../../data/api/transactions/blockaid.cjs');
40
41
  require('../../../../store/state/dynamicContextProps/dynamicContextProps.cjs');
41
42
  require('../../../../store/state/primaryWalletId/primaryWalletId.cjs');
42
43
  require('../../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
@@ -48,7 +49,6 @@ require('react-dom');
48
49
  require('../../../../utils/functions/compareChains/compareChains.cjs');
49
50
  require('../../../../context/ThemeContext/ThemeContext.cjs');
50
51
  require('../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
51
- var blockaid = require('../../../../data/api/transactions/blockaid.cjs');
52
52
  require('bs58');
53
53
  require('@dynamic-labs/types');
54
54
  require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
@@ -33,6 +33,7 @@ import '../../../../store/state/projectSettings/projectSettings.js';
33
33
  import '../../../../config/ApiEndpoint.js';
34
34
  import '../../../../store/state/user/user.js';
35
35
  import '../../../../locale/locale.js';
36
+ import { isMaliciousUrl } from '../../../../data/api/transactions/blockaid.js';
36
37
  import '../../../../store/state/dynamicContextProps/dynamicContextProps.js';
37
38
  import '../../../../store/state/primaryWalletId/primaryWalletId.js';
38
39
  import '../../../../context/AccessDeniedContext/AccessDeniedContext.js';
@@ -44,7 +45,6 @@ import 'react-dom';
44
45
  import '../../../../utils/functions/compareChains/compareChains.js';
45
46
  import '../../../../context/ThemeContext/ThemeContext.js';
46
47
  import '../../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
47
- import { isMaliciousUrl } from '../../../../data/api/transactions/blockaid.js';
48
48
  import 'bs58';
49
49
  import '@dynamic-labs/types';
50
50
  import '../../../../context/SocialRedirectContext/SocialRedirectContext.js';
@@ -13,9 +13,9 @@ require('@dynamic-labs/sdk-api-core');
13
13
  require('../../../../shared/logger.cjs');
14
14
  require('@dynamic-labs/iconic');
15
15
  require('@dynamic-labs/wallet-connector-core');
16
+ var accountAndSecurity = require('../../../../shared/assets/account-and-security.cjs');
16
17
  var chevronLeft = require('../../../../shared/assets/chevron-left.cjs');
17
18
  var connectedApps = require('../../../../shared/assets/connected-apps.cjs');
18
- var accountAndSecurity = require('../../../../shared/assets/account-and-security.cjs');
19
19
  var ViewContext = require('../../../../context/ViewContext/ViewContext.cjs');
20
20
  require('@dynamic-labs/wallet-book');
21
21
  require('@dynamic-labs/utils');
@@ -132,7 +132,7 @@ const SettingsView = () => {
132
132
  const isMfaEnabled = Boolean((_c = (_b = projectSettings$1 === null || projectSettings$1 === void 0 ? void 0 : projectSettings$1.security) === null || _b === void 0 ? void 0 : _b.mfa) === null || _c === void 0 ? void 0 : _c.enabled);
133
133
  const isEmbeddedWallet = Boolean(wallet && ((_e = (_d = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _d === void 0 ? void 0 : _d.key) === null || _e === void 0 ? void 0 : _e.startsWith('turnkey')));
134
134
  const shouldShowAccountAndSecuritySettings = isMfaEnabled || isEmbeddedWallet;
135
- return (jsxRuntime.jsxs("div", { className: 'settings-view', children: [jsxRuntime.jsx("div", { className: 'settings-view__body', children: shouldShowAccountAndSecuritySettings || globalWallet ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [(shouldShowAccountAndSecuritySettings || globalWallet) && (jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.general_section.title', 'General') })), shouldShowAccountAndSecuritySettings && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'account-and-security-button', buttonClassName: 'settings-view__body__section__button', onClick: handleAccountSecurityClick, startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(accountAndSecurity.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }), globalWallet && (jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.global_connectivity_section.title') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleConnectedAppsClick, dataTestId: 'connected-apps-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(connectedApps.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.global_connectivity_section.connected_apps_button', children: t('dyn_settings.global_connectivity_section.connected_apps_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })] }))] })) : (jsxRuntime.jsx(EmptyScreen.EmptyScreen, {})) }), jsxRuntime.jsx("div", { className: 'settings-view__logout-button-container', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'settings-view__logout-button-container__button', onClick: handleLogOut, dataTestId: 'logout-button', copykey: 'dyn_settings.buttonLogout', children: t('dyn_settings.button_logout') }) }), !shouldShowAccountAndSecuritySettings && (jsxRuntime.jsx("div", { className: 'settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', copykey: 'dyn_settings.delete_account.title', color: 'error-1', variant: 'body_small', className: 'settings-view__delete-account-container__delete-button', weight: 'medium', children: t('dyn_settings.delete_account.title') }) }))] }));
135
+ return (jsxRuntime.jsxs("div", { className: 'settings-view', children: [jsxRuntime.jsx("div", { className: 'settings-view__body', children: shouldShowAccountAndSecuritySettings || globalWallet ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [(shouldShowAccountAndSecuritySettings || globalWallet) && (jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.general_section.title', 'General') })), shouldShowAccountAndSecuritySettings && (jsxRuntime.jsx(TypographyButton.TypographyButton, { dataTestId: 'account-and-security-button', buttonClassName: 'settings-view__body__section__button', onClick: handleAccountSecurityClick, startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(accountAndSecurity.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }), globalWallet && (jsxRuntime.jsxs("div", { className: 'settings-view__body__section', children: [jsxRuntime.jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.global_connectivity_section.title') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleConnectedAppsClick, dataTestId: 'connected-apps-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxRuntime.jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsxRuntime.jsx(connectedApps.ReactComponent, { className: 'settings-view__body__section__button__icon' }), jsxRuntime.jsx(Typography.Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.global_connectivity_section.connected_apps_button', children: t('dyn_settings.global_connectivity_section.connected_apps_button') })] }), endSlot: jsxRuntime.jsx(chevronLeft.ReactComponent, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })] }))] })) : (jsxRuntime.jsx(EmptyScreen.EmptyScreen, {})) }), jsxRuntime.jsx("div", { className: 'settings-view__logout-button-container', children: jsxRuntime.jsx(TypographyButton.TypographyButton, { buttonClassName: 'settings-view__logout-button-container__button', onClick: handleLogOut, dataTestId: 'logout-button', copykey: 'dyn_settings.buttonLogout', children: t('dyn_settings.button_logout') }) }), !shouldShowAccountAndSecuritySettings && (jsxRuntime.jsx("div", { className: 'settings-view__delete-account-container', children: jsxRuntime.jsx(Typography.Typography, { onClick: handleDeleteAccountClick, "data-testid": 'delete-account-button', copykey: 'dyn_settings.delete_account.title', color: 'error-1', variant: 'body_small', className: 'settings-view__delete-account-container__delete-button', weight: 'medium', children: t('dyn_settings.delete_account.title') }) }))] }));
136
136
  };
137
137
 
138
138
  exports.SettingsView = SettingsView;
@@ -9,9 +9,9 @@ import '@dynamic-labs/sdk-api-core';
9
9
  import '../../../../shared/logger.js';
10
10
  import '@dynamic-labs/iconic';
11
11
  import '@dynamic-labs/wallet-connector-core';
12
+ import { ReactComponent as SvgAccountAndSecurity } from '../../../../shared/assets/account-and-security.js';
12
13
  import { ReactComponent as SvgChevronLeft } from '../../../../shared/assets/chevron-left.js';
13
14
  import { ReactComponent as SvgConnectedApps } from '../../../../shared/assets/connected-apps.js';
14
- import { ReactComponent as SvgAccountAndSecurity } from '../../../../shared/assets/account-and-security.js';
15
15
  import { useViewContext } from '../../../../context/ViewContext/ViewContext.js';
16
16
  import '@dynamic-labs/wallet-book';
17
17
  import '@dynamic-labs/utils';
@@ -128,7 +128,7 @@ const SettingsView = () => {
128
128
  const isMfaEnabled = Boolean((_c = (_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.security) === null || _b === void 0 ? void 0 : _b.mfa) === null || _c === void 0 ? void 0 : _c.enabled);
129
129
  const isEmbeddedWallet = Boolean(wallet && ((_e = (_d = wallet === null || wallet === void 0 ? void 0 : wallet.connector) === null || _d === void 0 ? void 0 : _d.key) === null || _e === void 0 ? void 0 : _e.startsWith('turnkey')));
130
130
  const shouldShowAccountAndSecuritySettings = isMfaEnabled || isEmbeddedWallet;
131
- return (jsxs("div", { className: 'settings-view', children: [jsx("div", { className: 'settings-view__body', children: shouldShowAccountAndSecuritySettings || globalWallet ? (jsxs(Fragment, { children: [jsxs("div", { className: 'settings-view__body__section', children: [(shouldShowAccountAndSecuritySettings || globalWallet) && (jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.general_section.title', 'General') })), shouldShowAccountAndSecuritySettings && (jsx(TypographyButton, { dataTestId: 'account-and-security-button', buttonClassName: 'settings-view__body__section__button', onClick: handleAccountSecurityClick, startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgAccountAndSecurity, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }), globalWallet && (jsxs("div", { className: 'settings-view__body__section', children: [jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.global_connectivity_section.title') }), jsx(TypographyButton, { onClick: handleConnectedAppsClick, dataTestId: 'connected-apps-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgConnectedApps, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.global_connectivity_section.connected_apps_button', children: t('dyn_settings.global_connectivity_section.connected_apps_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })] }))] })) : (jsx(EmptyScreen, {})) }), jsx("div", { className: 'settings-view__logout-button-container', children: jsx(TypographyButton, { buttonClassName: 'settings-view__logout-button-container__button', onClick: handleLogOut, dataTestId: 'logout-button', copykey: 'dyn_settings.buttonLogout', children: t('dyn_settings.button_logout') }) }), !shouldShowAccountAndSecuritySettings && (jsx("div", { className: 'settings-view__delete-account-container', children: jsx(Typography, { onClick: handleDeleteAccountClick, dataTestId: 'delete-account-button', copykey: 'dyn_settings.delete_account.title', color: 'error-1', variant: 'body_small', className: 'settings-view__delete-account-container__delete-button', weight: 'medium', children: t('dyn_settings.delete_account.title') }) }))] }));
131
+ return (jsxs("div", { className: 'settings-view', children: [jsx("div", { className: 'settings-view__body', children: shouldShowAccountAndSecuritySettings || globalWallet ? (jsxs(Fragment, { children: [jsxs("div", { className: 'settings-view__body__section', children: [(shouldShowAccountAndSecuritySettings || globalWallet) && (jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.general_section.title', 'General') })), shouldShowAccountAndSecuritySettings && (jsx(TypographyButton, { dataTestId: 'account-and-security-button', buttonClassName: 'settings-view__body__section__button', onClick: handleAccountSecurityClick, startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgAccountAndSecurity, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.account_security.title', children: t('dyn_settings.account_security.title') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false }))] }), globalWallet && (jsxs("div", { className: 'settings-view__body__section', children: [jsx("div", { className: 'settings-view__body__section__title', children: t('dyn_settings.global_connectivity_section.title') }), jsx(TypographyButton, { onClick: handleConnectedAppsClick, dataTestId: 'connected-apps-button', buttonClassName: 'settings-view__body__section__button', startSlot: jsxs("div", { className: 'settings-view__body__section__button__start-slot', children: [jsx(SvgConnectedApps, { className: 'settings-view__body__section__button__icon' }), jsx(Typography, { color: 'primary', weight: 'medium', copykey: 'dyn_settings.global_connectivity_section.connected_apps_button', children: t('dyn_settings.global_connectivity_section.connected_apps_button') })] }), endSlot: jsx(SvgChevronLeft, { className: 'settings-view__body__section__button__icon-secondary--rotate' }), showInternalLoading: false })] }))] })) : (jsx(EmptyScreen, {})) }), jsx("div", { className: 'settings-view__logout-button-container', children: jsx(TypographyButton, { buttonClassName: 'settings-view__logout-button-container__button', onClick: handleLogOut, dataTestId: 'logout-button', copykey: 'dyn_settings.buttonLogout', children: t('dyn_settings.button_logout') }) }), !shouldShowAccountAndSecuritySettings && (jsx("div", { className: 'settings-view__delete-account-container', children: jsx(Typography, { onClick: handleDeleteAccountClick, "data-testid": 'delete-account-button', copykey: 'dyn_settings.delete_account.title', color: 'error-1', variant: 'body_small', className: 'settings-view__delete-account-container__delete-button', weight: 'medium', children: t('dyn_settings.delete_account.title') }) }))] }));
132
132
  };
133
133
 
134
134
  export { SettingsView };