@dynamic-labs/sdk-react-core 3.0.0-alpha.5 → 3.0.0-alpha.7

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 (108) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/package.cjs +2 -2
  3. package/package.js +2 -2
  4. package/package.json +11 -11
  5. package/src/index.cjs +7 -1
  6. package/src/index.d.ts +3 -1
  7. package/src/index.js +4 -1
  8. package/src/lib/Main.cjs +1 -0
  9. package/src/lib/Main.js +1 -0
  10. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.cjs +2 -1
  11. package/src/lib/components/NetworkPicker/components/EvmNetworkControl/EvmNetworkControl.js +2 -1
  12. package/src/lib/components/QRCode/QRCode.d.ts +15 -0
  13. package/src/lib/context/DynamicContext/DynamicContext.cjs +15 -9
  14. package/src/lib/context/DynamicContext/DynamicContext.js +15 -9
  15. package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs +17 -8
  16. package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js +17 -8
  17. package/src/lib/context/DynamicContext/types/index.d.ts +4 -2
  18. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +3 -67
  19. package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +3 -67
  20. package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +3 -2
  21. package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
  22. package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +3 -2
  23. package/src/lib/context/WidgetRegistry/WidgetRegistryContextProvider.cjs +128 -0
  24. package/src/lib/context/WidgetRegistry/WidgetRegistryContextProvider.d.ts +6 -0
  25. package/src/lib/context/WidgetRegistry/WidgetRegistryContextProvider.js +122 -0
  26. package/src/lib/context/WidgetRegistry/index.d.ts +1 -0
  27. package/src/lib/data/api/externalAuth/externalAuth.d.ts +5 -0
  28. package/src/lib/data/api/externalAuth/index.d.ts +1 -0
  29. package/src/lib/data/api/index.d.ts +1 -0
  30. package/src/lib/data/api/wallets/wallets.cjs +2 -1
  31. package/src/lib/data/api/wallets/wallets.d.ts +2 -1
  32. package/src/lib/data/api/wallets/wallets.js +2 -1
  33. package/src/lib/events/auth.d.ts +1 -0
  34. package/src/lib/events/dynamicEvents.d.ts +2 -1
  35. package/src/lib/events/embeddedWallet.d.ts +1 -1
  36. package/src/lib/events/multiWallet.d.ts +5 -0
  37. package/src/lib/locale/en/translation.cjs +4 -4
  38. package/src/lib/locale/en/translation.d.ts +2 -2
  39. package/src/lib/locale/en/translation.js +4 -4
  40. package/src/lib/shared/types/dynamicEventsCallbacks.d.ts +1 -3
  41. package/src/lib/styles/index.shadow.cjs +1 -1
  42. package/src/lib/styles/index.shadow.js +1 -1
  43. package/src/lib/utils/functions/index.d.ts +1 -0
  44. package/src/lib/utils/functions/logVerboseTroubleshootingMessage/index.d.ts +1 -0
  45. package/src/lib/utils/functions/logVerboseTroubleshootingMessage/logVerboseTroubleshootingMessage.cjs +28 -0
  46. package/src/lib/utils/functions/logVerboseTroubleshootingMessage/logVerboseTroubleshootingMessage.d.ts +1 -0
  47. package/src/lib/utils/functions/logVerboseTroubleshootingMessage/logVerboseTroubleshootingMessage.js +24 -0
  48. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.cjs +2 -1
  49. package/src/lib/utils/functions/walletListBuilder/walletListBuilder.js +2 -1
  50. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.cjs +20 -0
  51. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +2 -2
  52. package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.js +20 -1
  53. package/src/lib/utils/hooks/index.d.ts +2 -0
  54. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.cjs +1 -2
  55. package/src/lib/utils/hooks/useCreateDynamicEmbeddedWalletMutation/useCreateDynamicEmbeddedWalletMutation.js +1 -2
  56. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs +6 -4
  57. package/src/lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js +6 -4
  58. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.cjs +1 -2
  59. package/src/lib/utils/hooks/useEmbeddedWallet/useMPCEmbeddedWallet/useCoinbaseMPC/useCoinbaseMPC.js +1 -2
  60. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.cjs +1 -2
  61. package/src/lib/utils/hooks/useEmbeddedWallet/useSecureEnclaveEmbeddedWallet/useTurnkey/useTurnkey.js +1 -2
  62. package/src/lib/utils/hooks/useExternalAuth/index.d.ts +1 -0
  63. package/src/lib/utils/hooks/useExternalAuth/useExternalAuth.d.ts +9 -0
  64. package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs +4 -7
  65. package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js +4 -7
  66. package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.cjs +6 -2
  67. package/src/lib/utils/hooks/useMergeUserAccounts/useMergeUserAccounts.js +6 -2
  68. package/src/lib/utils/hooks/useRefreshUser/index.d.ts +1 -0
  69. package/src/lib/utils/hooks/useRefreshUser/useRefreshUser.cjs +90 -0
  70. package/src/lib/utils/hooks/useRefreshUser/useRefreshUser.d.ts +8 -0
  71. package/src/lib/utils/hooks/useRefreshUser/useRefreshUser.js +86 -0
  72. package/src/lib/utils/hooks/useSwitchNetwork/index.d.ts +1 -0
  73. package/src/lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.cjs +26 -0
  74. package/src/lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.d.ts +5 -0
  75. package/src/lib/utils/hooks/useSwitchNetwork/useSwitchNetwork.js +22 -0
  76. package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.cjs +1 -1
  77. package/src/lib/utils/hooks/useSwitchWallet/useSwitchWallet.js +1 -1
  78. package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +4 -1
  79. package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +4 -1
  80. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +7 -6
  81. package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +7 -6
  82. package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.cjs +1 -1
  83. package/src/lib/utils/hooks/useWalletConnectors/utils/findWallet/findWallet.js +1 -1
  84. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +44 -27
  85. package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +45 -28
  86. package/src/lib/views/EmailVerification/EmailVerification.cjs +8 -5
  87. package/src/lib/views/EmailVerification/EmailVerification.js +8 -5
  88. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.cjs +4 -14
  89. package/src/lib/views/MergeUserAccountsView/MergeUserAccountsView.js +5 -15
  90. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +3 -1
  91. package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +3 -1
  92. package/src/lib/views/WalletList/WalletList.cjs +1 -3
  93. package/src/lib/views/WalletList/WalletList.js +1 -3
  94. package/src/lib/views/WalletList/hooks/useTabState.cjs +6 -81
  95. package/src/lib/views/WalletList/hooks/useTabState.d.ts +6 -3
  96. package/src/lib/views/WalletList/hooks/useTabState.js +6 -81
  97. package/src/lib/widgets/DynamicMultiWalletPromptsWidget/DynamicMultiWalletPromptsWidget.cjs +5 -5
  98. package/src/lib/widgets/DynamicMultiWalletPromptsWidget/DynamicMultiWalletPromptsWidget.js +5 -5
  99. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +4 -1
  100. package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +4 -1
  101. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.cjs +2 -2
  102. package/src/lib/widgets/DynamicWidget/components/Wallet/Wallet.js +2 -2
  103. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.cjs +1 -1
  104. package/src/lib/widgets/DynamicWidget/prompts/PrimaryNotConnectedModal/PrimaryNotConnectedModal.js +1 -1
  105. package/src/lib/views/WalletList/utils/getInitialTabIndex/getInitialTabIndex.cjs +0 -22
  106. package/src/lib/views/WalletList/utils/getInitialTabIndex/getInitialTabIndex.d.ts +0 -2
  107. package/src/lib/views/WalletList/utils/getInitialTabIndex/getInitialTabIndex.js +0 -18
  108. package/src/lib/views/WalletList/utils/getInitialTabIndex/index.d.ts +0 -1
@@ -7,23 +7,20 @@ var _tslib = require('../../../../_virtual/_tslib.cjs');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
  var React = require('react');
9
9
  var reactI18next = require('react-i18next');
10
- var walletBook = require('@dynamic-labs/wallet-book');
11
- var iconic = require('@dynamic-labs/iconic');
12
10
  require('../../events/dynamicEvents.cjs');
13
11
  require('@dynamic-labs/utils');
14
12
  require('../../context/DynamicContext/DynamicContext.cjs');
15
13
  require('@dynamic-labs/sdk-api-core');
16
14
  var logger = require('../../shared/logger.cjs');
15
+ require('@dynamic-labs/iconic');
17
16
  require('@dynamic-labs/wallet-connector-core');
18
17
  var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
19
- var add = require('../../shared/assets/add.cjs');
20
- var shortenWalletAddress = require('../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.cjs');
18
+ require('@dynamic-labs/wallet-book');
21
19
  require('../../utils/constants/colors.cjs');
22
20
  require('../../utils/constants/values.cjs');
23
21
  require('../../shared/utils/classes/storage/localStorage.cjs');
24
22
  require('../../shared/utils/classes/storage/sessionStorage.cjs');
25
23
  require('../../shared/consts/index.cjs');
26
- var useInternalDynamicContext = require('../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
27
24
  require('../../context/CaptchaContext/CaptchaContext.cjs');
28
25
  require('../../context/ErrorContext/ErrorContext.cjs');
29
26
  require('@dynamic-labs/multi-wallet');
@@ -83,12 +80,11 @@ require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/
83
80
  var useMergeUserAccounts = require('../../utils/hooks/useMergeUserAccounts/useMergeUserAccounts.cjs');
84
81
 
85
82
  const MergeUserAccountsView = (props) => {
86
- const { selectedWalletConnector } = useInternalDynamicContext.useInternalDynamicContext();
87
83
  const { setView } = ViewContext.useViewContext();
88
84
  const { mergeUserAccounts } = useMergeUserAccounts.useMergeUserAccounts();
89
85
  const { t } = reactI18next.useTranslation();
90
86
  const [error, setError] = React.useState('');
91
- const { mergeConflicts, walletAddress } = props;
87
+ const { mergeConflicts } = props;
92
88
  const goToConflictsResolutionView = () => {
93
89
  // back button on conflicts resolution view should go back to this view
94
90
  const onConflictsResolutionBackClick = () => {
@@ -112,13 +108,7 @@ const MergeUserAccountsView = (props) => {
112
108
  setError(t('dyn_merge_user_accounts.errors.merge_error'));
113
109
  }
114
110
  });
115
- const renderDuplicatedInfo = () => {
116
- if (walletAddress) {
117
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key, className: 'merge-user-accounts__accounts__item__icon' }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', weight: 'bold', color: 'secondary', className: 'merge-user-accounts__accounts__item__text', children: shortenWalletAddress.shortenWalletAddress(walletAddress, 3, 3) })] }));
118
- }
119
- return (jsxRuntime.jsx(iconic.UserProfileIcon, { className: 'merge-user-accounts__accounts__item__icon' }));
120
- };
121
- return (jsxRuntime.jsxs("div", { className: 'merge-user-accounts', children: [error && (jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', className: 'merge-user-accounts__error', children: error })), jsxRuntime.jsxs("div", { className: 'merge-user-accounts__container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'merge-user-accounts__title', copykey: 'dyn_merge_user_accounts.wallet.content', children: t('dyn_merge_user_accounts.wallet.content') }), jsxRuntime.jsxs("div", { className: 'merge-user-accounts__accounts', children: [jsxRuntime.jsx("div", { className: 'merge-user-accounts__accounts__item', children: renderDuplicatedInfo() }), jsxRuntime.jsxs("div", { className: 'merge-user-accounts__accounts__divider', children: [jsxRuntime.jsx("div", { className: 'merge-user-accounts__accounts__divider__dash' }), jsxRuntime.jsx("div", { className: 'merge-user-accounts__accounts__divider__icon', children: jsxRuntime.jsx(add.ReactComponent, {}) })] }), jsxRuntime.jsx("div", { className: 'merge-user-accounts__accounts__item', children: renderDuplicatedInfo() })] }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleMergeConfirm, buttonClassName: 'merge-user-accounts__button', buttonVariant: 'brand-primary', buttonPadding: 'large', typographyProps: {
111
+ return (jsxRuntime.jsxs("div", { className: 'merge-user-accounts', children: [error && (jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', className: 'merge-user-accounts__error', children: error })), jsxRuntime.jsxs("div", { className: 'merge-user-accounts__container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'merge-user-accounts__title', copykey: 'dyn_merge_user_accounts.wallet.content', children: t('dyn_merge_user_accounts.wallet.content') }), jsxRuntime.jsx(TypographyButton.TypographyButton, { onClick: handleMergeConfirm, buttonClassName: 'merge-user-accounts__button', buttonVariant: 'brand-primary', buttonPadding: 'large', typographyProps: {
122
112
  color: 'inherit',
123
113
  }, expanded: true, copykey: 'dyn_merge_user_accounts.confirm_button', children: t('dyn_merge_user_accounts.confirm_button') })] })] }));
124
114
  };
@@ -1,25 +1,22 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../../_virtual/_tslib.js';
3
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
+ import { jsxs, jsx } from 'react/jsx-runtime';
4
4
  import { useState } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
- import { WalletIcon } from '@dynamic-labs/wallet-book';
7
- import { UserProfileIcon } from '@dynamic-labs/iconic';
8
6
  import '../../events/dynamicEvents.js';
9
7
  import '@dynamic-labs/utils';
10
8
  import '../../context/DynamicContext/DynamicContext.js';
11
9
  import '@dynamic-labs/sdk-api-core';
12
10
  import { logger } from '../../shared/logger.js';
11
+ import '@dynamic-labs/iconic';
13
12
  import '@dynamic-labs/wallet-connector-core';
14
13
  import { useViewContext } from '../../context/ViewContext/ViewContext.js';
15
- import { ReactComponent as SvgAdd } from '../../shared/assets/add.js';
16
- import { shortenWalletAddress } from '../../shared/utils/functions/shortenWalletAddress/shortenWalletAddress.js';
14
+ import '@dynamic-labs/wallet-book';
17
15
  import '../../utils/constants/colors.js';
18
16
  import '../../utils/constants/values.js';
19
17
  import '../../shared/utils/classes/storage/localStorage.js';
20
18
  import '../../shared/utils/classes/storage/sessionStorage.js';
21
19
  import '../../shared/consts/index.js';
22
- import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
23
20
  import '../../context/CaptchaContext/CaptchaContext.js';
24
21
  import '../../context/ErrorContext/ErrorContext.js';
25
22
  import '@dynamic-labs/multi-wallet';
@@ -79,12 +76,11 @@ import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/P
79
76
  import { useMergeUserAccounts } from '../../utils/hooks/useMergeUserAccounts/useMergeUserAccounts.js';
80
77
 
81
78
  const MergeUserAccountsView = (props) => {
82
- const { selectedWalletConnector } = useInternalDynamicContext();
83
79
  const { setView } = useViewContext();
84
80
  const { mergeUserAccounts } = useMergeUserAccounts();
85
81
  const { t } = useTranslation();
86
82
  const [error, setError] = useState('');
87
- const { mergeConflicts, walletAddress } = props;
83
+ const { mergeConflicts } = props;
88
84
  const goToConflictsResolutionView = () => {
89
85
  // back button on conflicts resolution view should go back to this view
90
86
  const onConflictsResolutionBackClick = () => {
@@ -108,13 +104,7 @@ const MergeUserAccountsView = (props) => {
108
104
  setError(t('dyn_merge_user_accounts.errors.merge_error'));
109
105
  }
110
106
  });
111
- const renderDuplicatedInfo = () => {
112
- if (walletAddress) {
113
- return (jsxs(Fragment, { children: [jsx(WalletIcon, { walletKey: selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.key, className: 'merge-user-accounts__accounts__item__icon' }), jsx(Typography, { variant: 'body_small', weight: 'bold', color: 'secondary', className: 'merge-user-accounts__accounts__item__text', children: shortenWalletAddress(walletAddress, 3, 3) })] }));
114
- }
115
- return (jsx(UserProfileIcon, { className: 'merge-user-accounts__accounts__item__icon' }));
116
- };
117
- return (jsxs("div", { className: 'merge-user-accounts', children: [error && (jsx(Alert, { icon: 'error', variant: 'error', className: 'merge-user-accounts__error', children: error })), jsxs("div", { className: 'merge-user-accounts__container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'merge-user-accounts__title', copykey: 'dyn_merge_user_accounts.wallet.content', children: t('dyn_merge_user_accounts.wallet.content') }), jsxs("div", { className: 'merge-user-accounts__accounts', children: [jsx("div", { className: 'merge-user-accounts__accounts__item', children: renderDuplicatedInfo() }), jsxs("div", { className: 'merge-user-accounts__accounts__divider', children: [jsx("div", { className: 'merge-user-accounts__accounts__divider__dash' }), jsx("div", { className: 'merge-user-accounts__accounts__divider__icon', children: jsx(SvgAdd, {}) })] }), jsx("div", { className: 'merge-user-accounts__accounts__item', children: renderDuplicatedInfo() })] }), jsx(TypographyButton, { onClick: handleMergeConfirm, buttonClassName: 'merge-user-accounts__button', buttonVariant: 'brand-primary', buttonPadding: 'large', typographyProps: {
107
+ return (jsxs("div", { className: 'merge-user-accounts', children: [error && (jsx(Alert, { icon: 'error', variant: 'error', className: 'merge-user-accounts__error', children: error })), jsxs("div", { className: 'merge-user-accounts__container', children: [jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'merge-user-accounts__title', copykey: 'dyn_merge_user_accounts.wallet.content', children: t('dyn_merge_user_accounts.wallet.content') }), jsx(TypographyButton, { onClick: handleMergeConfirm, buttonClassName: 'merge-user-accounts__button', buttonVariant: 'brand-primary', buttonPadding: 'large', typographyProps: {
118
108
  color: 'inherit',
119
109
  }, expanded: true, copykey: 'dyn_merge_user_accounts.confirm_button', children: t('dyn_merge_user_accounts.confirm_button') })] })] }));
120
110
  };
@@ -104,6 +104,8 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
104
104
  * to reflect the new fee on the UI
105
105
  */
106
106
  const fetchTransactionFee = () => {
107
+ if (chainName === 'Solana' && transaction.fee)
108
+ return;
107
109
  transaction.fetchFee().finally(update);
108
110
  };
109
111
  const { isLoading: isGasSponsoredLoading } = usePromise.usePromise(() => {
@@ -135,7 +137,7 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
135
137
  },
136
138
  onSuccess: (tx) => onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(tx),
137
139
  });
138
- // Refresh transaction fee
140
+ // Refresh transaction fee, Solana fees are static based on transaction data, dont need to refresh them
139
141
  useInterval.useInterval(fetchTransactionFee, isLoading ? null : FEE_REFRESH_INTERVAL);
140
142
  useEffectOnce.useEffectOnce(fetchTransactionFee);
141
143
  const total = useTransactionTotal.useTransactionTotal({
@@ -100,6 +100,8 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
100
100
  * to reflect the new fee on the UI
101
101
  */
102
102
  const fetchTransactionFee = () => {
103
+ if (chainName === 'Solana' && transaction.fee)
104
+ return;
103
105
  transaction.fetchFee().finally(update);
104
106
  };
105
107
  const { isLoading: isGasSponsoredLoading } = usePromise(() => {
@@ -131,7 +133,7 @@ const TransactionConfirmationView = ({ transaction, onError, onSuccess, mutation
131
133
  },
132
134
  onSuccess: (tx) => onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(tx),
133
135
  });
134
- // Refresh transaction fee
136
+ // Refresh transaction fee, Solana fees are static based on transaction data, dont need to refresh them
135
137
  useInterval(fetchTransactionFee, isLoading ? null : FEE_REFRESH_INTERVAL);
136
138
  useEffectOnce(fetchTransactionFee);
137
139
  const total = useTransactionTotal({
@@ -88,16 +88,14 @@ var useInternalDynamicContext = require('../../context/DynamicContext/useDynamic
88
88
  var index = require('../../utils/functions/walletFilters/index.cjs');
89
89
  var SearchNotFoundMessage = require('./SearchNotFoundMessage/SearchNotFoundMessage.cjs');
90
90
  var WalletListGridTabs = require('./WalletListGridTabs/WalletListGridTabs.cjs');
91
- var useTabState = require('./hooks/useTabState.cjs');
92
91
  var getEffectiveWalletFilter = require('./utils/getEffectiveWalletFilter.cjs');
93
92
  var getEffectiveRecommendedWallets = require('./utils/getEffectiveRecommendedWallets.cjs');
94
93
 
95
94
  localStorage.LocalStorage.setToLS(localStorage$1.WALLET_PICKER_SEARCH_KEY, '');
96
95
  const WalletList = ({ isWalletConnectList = false, }) => {
97
96
  var _a;
98
- const { walletsFilter, signWithEmailWalletName, walletConnectorOptions, projectSettings, defaultNumberOfWalletsToShow, bridgeChainsToConnect, authMode, multiWallet, recommendedWallets, } = useInternalDynamicContext.useInternalDynamicContext();
97
+ const { walletsFilter, signWithEmailWalletName, walletConnectorOptions, projectSettings, defaultNumberOfWalletsToShow, bridgeChainsToConnect, authMode, multiWallet, recommendedWallets, selectedTabIndex, setSelectedTabIndex, selectedTabSettings, tabsItems, } = useInternalDynamicContext.useInternalDynamicContext();
99
98
  const userWallets = UserWalletsContext.useUserWallets();
100
- const { selectedTabIndex, setSelectedTabIndex, selectedTabSettings, tabsItems, } = useTabState.useTabState();
101
99
  const { walletBook: walletBook$1 } = walletBook.useWalletBookContext();
102
100
  const { error } = ErrorContext.useErrorContext();
103
101
  const { showDefaultFooter } = useAuthLayoutChecks.useAuthLayoutChecks();
@@ -84,16 +84,14 @@ import { useInternalDynamicContext } from '../../context/DynamicContext/useDynam
84
84
  import { FilterBridgeChainsName } from '../../utils/functions/walletFilters/index.js';
85
85
  import { SearchNotFoundMessage } from './SearchNotFoundMessage/SearchNotFoundMessage.js';
86
86
  import { WalletListGridTabs } from './WalletListGridTabs/WalletListGridTabs.js';
87
- import { useTabState } from './hooks/useTabState.js';
88
87
  import { getEffectiveWalletFilter } from './utils/getEffectiveWalletFilter.js';
89
88
  import { getEffectiveRecommendedWallets } from './utils/getEffectiveRecommendedWallets.js';
90
89
 
91
90
  LocalStorage.setToLS(WALLET_PICKER_SEARCH_KEY, '');
92
91
  const WalletList = ({ isWalletConnectList = false, }) => {
93
92
  var _a;
94
- const { walletsFilter, signWithEmailWalletName, walletConnectorOptions, projectSettings, defaultNumberOfWalletsToShow, bridgeChainsToConnect, authMode, multiWallet, recommendedWallets, } = useInternalDynamicContext();
93
+ const { walletsFilter, signWithEmailWalletName, walletConnectorOptions, projectSettings, defaultNumberOfWalletsToShow, bridgeChainsToConnect, authMode, multiWallet, recommendedWallets, selectedTabIndex, setSelectedTabIndex, selectedTabSettings, tabsItems, } = useInternalDynamicContext();
95
94
  const userWallets = useUserWallets();
96
- const { selectedTabIndex, setSelectedTabIndex, selectedTabSettings, tabsItems, } = useTabState();
97
95
  const { walletBook } = useWalletBookContext();
98
96
  const { error } = useErrorContext();
99
97
  const { showDefaultFooter } = useAuthLayoutChecks();
@@ -4,94 +4,19 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var React = require('react');
7
- require('../../../events/dynamicEvents.cjs');
8
- require('../../../../../_virtual/_tslib.cjs');
9
- require('@dynamic-labs/utils');
10
- require('../../../context/DynamicContext/DynamicContext.cjs');
11
- require('@dynamic-labs/sdk-api-core');
12
- require('../../../shared/logger.cjs');
13
- require('@dynamic-labs/iconic');
14
- require('@dynamic-labs/wallet-connector-core');
15
- require('react/jsx-runtime');
16
- require('../../../context/ViewContext/ViewContext.cjs');
17
- require('@dynamic-labs/wallet-book');
18
- require('../../../utils/constants/colors.cjs');
19
- require('../../../utils/constants/values.cjs');
20
- require('../../../shared/utils/classes/storage/localStorage.cjs');
21
- require('../../../shared/utils/classes/storage/sessionStorage.cjs');
22
- require('../../../shared/consts/index.cjs');
23
- var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
24
- require('../../../context/CaptchaContext/CaptchaContext.cjs');
25
- require('../../../context/ErrorContext/ErrorContext.cjs');
26
- require('@dynamic-labs/multi-wallet');
27
- require('react-international-phone');
28
- require('../../../config/ApiEndpoint.cjs');
29
- require('@dynamic-labs/store');
30
- require('../../../locale/locale.cjs');
31
- require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
32
- require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
33
- require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
34
- require('../../../context/VerificationContext/VerificationContext.cjs');
35
- require('react-dom');
36
- require('../../../context/WalletContext/WalletContext.cjs');
37
- require('../../../context/ThemeContext/ThemeContext.cjs');
38
- require('../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.cjs');
39
- require('@dynamic-labs/types');
40
- require('../../../context/LoadingContext/LoadingContext.cjs');
41
- require('yup');
42
- require('../../../context/MockContext/MockContext.cjs');
43
- require('../../CollectUserDataView/useFields.cjs');
44
- require('../../../context/FieldsStateContext/FieldsStateContext.cjs');
45
- require('../../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
46
- require('@dynamic-labs/rpc-providers');
47
- require('react-i18next');
48
- require('../../../components/Accordion/components/AccordionItem/AccordionItem.cjs');
49
- require('../../../components/Alert/Alert.cjs');
50
- require('../../../components/ShadowDOM/ShadowDOM.cjs');
51
- require('../../../components/IconButton/IconButton.cjs');
52
- require('../../../components/InlineWidget/InlineWidget.cjs');
53
- require('../../../components/Input/Input.cjs');
54
- require('../../../components/IsBrowser/IsBrowser.cjs');
55
- require('../../../components/MenuList/Dropdown/Dropdown.cjs');
56
- require('../../../components/Transition/ZoomTransition/ZoomTransition.cjs');
57
- require('../../../components/Transition/SlideInUpTransition/SlideInUpTransition.cjs');
58
- require('../../../components/Transition/OpacityTransition/OpacityTransition.cjs');
59
- require('../../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.cjs');
60
- require('../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
61
- require('../../../components/Popper/Popper/Popper.cjs');
62
- require('../../../components/Popper/PopperContext/PopperContext.cjs');
63
- require('react-focus-lock');
64
- require('qrcode');
65
- require('formik');
66
- require('../WalletList.cjs');
67
- require('../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
68
- require('../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
69
- require('@hcaptcha/react-hcaptcha');
70
- require('../../../context/FooterAnimationContext/index.cjs');
71
- require('../../../context/WalletGroupContext/WalletGroupContext.cjs');
72
- require('../../../context/MfaSettingsContext/MfaSettingsContext.cjs');
73
- require('../../../context/IpConfigurationContext/IpConfigurationContext.cjs');
74
- require('../../../context/PasskeyContext/PasskeyContext.cjs');
75
- require('../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
76
- require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
77
- require('../../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
78
- require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
79
- var useViewSettings = require('../../../utils/hooks/useViewSettings/useViewSettings.cjs');
80
- var getInitialTabIndex = require('../utils/getInitialTabIndex/getInitialTabIndex.cjs');
81
7
 
82
- const useTabState = () => {
83
- var _a, _b;
84
- const { defaultTabIndex } = useInternalDynamicContext.useInternalDynamicContext();
85
- const walletListViewSettings = useViewSettings.useViewSettings('wallet-list');
86
- const [selectedTabIndex, setSelectedTabIndex] = React.useState(() => getInitialTabIndex.getInitialTabIndex(walletListViewSettings, defaultTabIndex));
8
+ const useTabState = ({ settingsOverrides, }) => {
9
+ var _a, _b, _c;
10
+ 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);
87
12
  const selectedTabSettings = selectedTabIndex === null
88
13
  ? undefined
89
- : (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[selectedTabIndex];
14
+ : (_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items[selectedTabIndex];
90
15
  return {
91
16
  selectedTabIndex,
92
17
  selectedTabSettings,
93
18
  setSelectedTabIndex,
94
- tabsItems: (_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items,
19
+ tabsItems: (_c = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _c === void 0 ? void 0 : _c.items,
95
20
  };
96
21
  };
97
22
 
@@ -1,7 +1,10 @@
1
1
  /// <reference types="react" />
2
- export declare const useTabState: () => {
3
- selectedTabIndex: number | null;
2
+ import { SettingsOverrides } from '../../../context/DynamicContext/types';
3
+ export declare const useTabState: ({ settingsOverrides, }: {
4
+ settingsOverrides: SettingsOverrides | undefined;
5
+ }) => {
6
+ selectedTabIndex: number;
4
7
  selectedTabSettings: import("../../../context/DynamicContext/types").WalletListViewTabItem | undefined;
5
- setSelectedTabIndex: import("react").Dispatch<import("react").SetStateAction<number | null>>;
8
+ setSelectedTabIndex: import("react").Dispatch<import("react").SetStateAction<number>>;
6
9
  tabsItems: import("../../../context/DynamicContext/types").WalletListViewTabItem[] | undefined;
7
10
  };
@@ -1,93 +1,18 @@
1
1
  'use client'
2
2
  import { useState } from 'react';
3
- import '../../../events/dynamicEvents.js';
4
- import '../../../../../_virtual/_tslib.js';
5
- import '@dynamic-labs/utils';
6
- import '../../../context/DynamicContext/DynamicContext.js';
7
- import '@dynamic-labs/sdk-api-core';
8
- import '../../../shared/logger.js';
9
- import '@dynamic-labs/iconic';
10
- import '@dynamic-labs/wallet-connector-core';
11
- import 'react/jsx-runtime';
12
- import '../../../context/ViewContext/ViewContext.js';
13
- import '@dynamic-labs/wallet-book';
14
- import '../../../utils/constants/colors.js';
15
- import '../../../utils/constants/values.js';
16
- import '../../../shared/utils/classes/storage/localStorage.js';
17
- import '../../../shared/utils/classes/storage/sessionStorage.js';
18
- import '../../../shared/consts/index.js';
19
- import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
20
- import '../../../context/CaptchaContext/CaptchaContext.js';
21
- import '../../../context/ErrorContext/ErrorContext.js';
22
- import '@dynamic-labs/multi-wallet';
23
- import 'react-international-phone';
24
- import '../../../config/ApiEndpoint.js';
25
- import '@dynamic-labs/store';
26
- import '../../../locale/locale.js';
27
- import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
28
- import '../../../context/AccountExistsContext/AccountExistsContext.js';
29
- import '../../../context/UserWalletsContext/UserWalletsContext.js';
30
- import '../../../context/VerificationContext/VerificationContext.js';
31
- import 'react-dom';
32
- import '../../../context/WalletContext/WalletContext.js';
33
- import '../../../context/ThemeContext/ThemeContext.js';
34
- import '../../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
35
- import '@dynamic-labs/types';
36
- import '../../../context/LoadingContext/LoadingContext.js';
37
- import 'yup';
38
- import '../../../context/MockContext/MockContext.js';
39
- import '../../CollectUserDataView/useFields.js';
40
- import '../../../context/FieldsStateContext/FieldsStateContext.js';
41
- import '../../../context/UserFieldEditorContext/UserFieldEditorContext.js';
42
- import '@dynamic-labs/rpc-providers';
43
- import 'react-i18next';
44
- import '../../../components/Accordion/components/AccordionItem/AccordionItem.js';
45
- import '../../../components/Alert/Alert.js';
46
- import '../../../components/ShadowDOM/ShadowDOM.js';
47
- import '../../../components/IconButton/IconButton.js';
48
- import '../../../components/InlineWidget/InlineWidget.js';
49
- import '../../../components/Input/Input.js';
50
- import '../../../components/IsBrowser/IsBrowser.js';
51
- import '../../../components/MenuList/Dropdown/Dropdown.js';
52
- import '../../../components/Transition/ZoomTransition/ZoomTransition.js';
53
- import '../../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
54
- import '../../../components/Transition/OpacityTransition/OpacityTransition.js';
55
- import '../../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.js';
56
- import '../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
57
- import '../../../components/Popper/Popper/Popper.js';
58
- import '../../../components/Popper/PopperContext/PopperContext.js';
59
- import 'react-focus-lock';
60
- import 'qrcode';
61
- import 'formik';
62
- import '../WalletList.js';
63
- import '../../../context/SocialRedirectContext/SocialRedirectContext.js';
64
- import '../../../widgets/DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
65
- import '@hcaptcha/react-hcaptcha';
66
- import '../../../context/FooterAnimationContext/index.js';
67
- import '../../../context/WalletGroupContext/WalletGroupContext.js';
68
- import '../../../context/MfaSettingsContext/MfaSettingsContext.js';
69
- import '../../../context/IpConfigurationContext/IpConfigurationContext.js';
70
- import '../../../context/PasskeyContext/PasskeyContext.js';
71
- import '../../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
72
- import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
73
- import '../../TransactionConfirmationView/helpers/transactionErrorMessage.js';
74
- import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
75
- import { useViewSettings } from '../../../utils/hooks/useViewSettings/useViewSettings.js';
76
- import { getInitialTabIndex } from '../utils/getInitialTabIndex/getInitialTabIndex.js';
77
3
 
78
- const useTabState = () => {
79
- var _a, _b;
80
- const { defaultTabIndex } = useInternalDynamicContext();
81
- const walletListViewSettings = useViewSettings('wallet-list');
82
- const [selectedTabIndex, setSelectedTabIndex] = useState(() => getInitialTabIndex(walletListViewSettings, defaultTabIndex));
4
+ const useTabState = ({ settingsOverrides, }) => {
5
+ var _a, _b, _c;
6
+ 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);
83
8
  const selectedTabSettings = selectedTabIndex === null
84
9
  ? undefined
85
- : (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[selectedTabIndex];
10
+ : (_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items[selectedTabIndex];
86
11
  return {
87
12
  selectedTabIndex,
88
13
  selectedTabSettings,
89
14
  setSelectedTabIndex,
90
- tabsItems: (_b = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _b === void 0 ? void 0 : _b.items,
15
+ tabsItems: (_c = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _c === void 0 ? void 0 : _c.items,
91
16
  };
92
17
  };
93
18
 
@@ -22,7 +22,7 @@ require('@dynamic-labs/sdk-api-core');
22
22
  require('../../shared/logger.cjs');
23
23
  require('@dynamic-labs/iconic');
24
24
  require('@dynamic-labs/wallet-connector-core');
25
- var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
25
+ require('../../context/ViewContext/ViewContext.cjs');
26
26
  require('@dynamic-labs/wallet-book');
27
27
  require('../../utils/constants/colors.cjs');
28
28
  require('../../utils/constants/values.cjs');
@@ -86,13 +86,13 @@ require('../DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs
86
86
  require('../DynamicWidget/context/DynamicWidgetContext.cjs');
87
87
  require('../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
88
88
  require('../DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
89
+ var WidgetRegistryContextProvider = require('../../context/WidgetRegistry/WidgetRegistryContextProvider.cjs');
89
90
 
90
- const pendingSignModalView = ['pending-signature', 'wallet-sign'];
91
91
  const DynamicMultiWalletPromptsWidget = () => {
92
92
  const isLoggedIn = useIsLoggedIn.useIsLoggedIn();
93
- const { showAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
94
- const { view } = ViewContext.useViewContext();
95
- const isRenderingSignMessageInLinkWalletModal = showAuthFlow && pendingSignModalView.includes(view.type);
93
+ const isUserProfilePresent = WidgetRegistryContextProvider.useWidgetRegistryCheck('user-profile');
94
+ const { showAuthFlow, showDynamicUserProfile } = useInternalDynamicContext.useInternalDynamicContext();
95
+ const isRenderingSignMessageInLinkWalletModal = showAuthFlow || (showDynamicUserProfile && isUserProfilePresent);
96
96
  const multiWalletPromptState = useMultiWalletPromptState.useMultiWalletPromptState();
97
97
  const mapMultiWalletPromptStateToModalComponent = {
98
98
  awaiting_connection: AwaitingConnectionModal.AwaitingConnectionModal,
@@ -18,7 +18,7 @@ import '@dynamic-labs/sdk-api-core';
18
18
  import '../../shared/logger.js';
19
19
  import '@dynamic-labs/iconic';
20
20
  import '@dynamic-labs/wallet-connector-core';
21
- import { useViewContext } from '../../context/ViewContext/ViewContext.js';
21
+ import '../../context/ViewContext/ViewContext.js';
22
22
  import '@dynamic-labs/wallet-book';
23
23
  import '../../utils/constants/colors.js';
24
24
  import '../../utils/constants/values.js';
@@ -82,13 +82,13 @@ import '../DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
82
82
  import '../DynamicWidget/context/DynamicWidgetContext.js';
83
83
  import '../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
84
84
  import '../DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
85
+ import { useWidgetRegistryCheck } from '../../context/WidgetRegistry/WidgetRegistryContextProvider.js';
85
86
 
86
- const pendingSignModalView = ['pending-signature', 'wallet-sign'];
87
87
  const DynamicMultiWalletPromptsWidget = () => {
88
88
  const isLoggedIn = useIsLoggedIn();
89
- const { showAuthFlow } = useInternalDynamicContext();
90
- const { view } = useViewContext();
91
- const isRenderingSignMessageInLinkWalletModal = showAuthFlow && pendingSignModalView.includes(view.type);
89
+ const isUserProfilePresent = useWidgetRegistryCheck('user-profile');
90
+ const { showAuthFlow, showDynamicUserProfile } = useInternalDynamicContext();
91
+ const isRenderingSignMessageInLinkWalletModal = showAuthFlow || (showDynamicUserProfile && isUserProfilePresent);
92
92
  const multiWalletPromptState = useMultiWalletPromptState();
93
93
  const mapMultiWalletPromptStateToModalComponent = {
94
94
  awaiting_connection: AwaitingConnectionModal,
@@ -79,6 +79,7 @@ var SandboxIndicatorWrapper = require('../../../../components/SandboxIndicatorWr
79
79
  var DynamicWidgetContext = require('../../context/DynamicWidgetContext.cjs');
80
80
  var DynamicWidgetCard = require('../DynamicWidgetCard/DynamicWidgetCard.cjs');
81
81
  var DynamicWidgetVariants = require('../DynamicWidgetVariants/DynamicWidgetVariants.cjs');
82
+ var WidgetRegistryContextProvider = require('../../../../context/WidgetRegistry/WidgetRegistryContextProvider.cjs');
82
83
 
83
84
  const DynamicUserProfile = ({ variant, }) => {
84
85
  const { projectSettings, setShowDynamicUserProfile, showAuthFlow } = useInternalDynamicContext.useInternalDynamicContext();
@@ -100,7 +101,9 @@ const DynamicUserProfile = ({ variant, }) => {
100
101
  }
101
102
  }, [inlineControlsRef, variant, showAuthFlow, setShowDynamicUserProfile]);
102
103
  index$1.useOnClickOutside(widgetRef, closeOnOutsideClick);
103
- if (!projectSettings)
104
+ const shouldRenderUserProfile = Boolean(projectSettings);
105
+ WidgetRegistryContextProvider.useRegisterWidget('user-profile', shouldRenderUserProfile);
106
+ if (!shouldRenderUserProfile)
104
107
  return null;
105
108
  return (jsxRuntime.jsx(IsBrowser.IsBrowser, { children: jsxRuntime.jsx(PopperContext.PopperProvider, { children: jsxRuntime.jsx(DynamicWidgetVariants.DynamicWidgetVariants, { isOpen: isOpen, setIsOpen: setIsOpen, variant: _variant, zIndex: index.widgetModalZIndex, children: jsxRuntime.jsx(SandboxIndicatorWrapper.SandboxIndicatorWrapper, { children: jsxRuntime.jsx(DynamicWidgetCard.DynamicWidgetCard, { ref: widgetRef, children: jsxRuntime.jsx(DynamicUserProfileLayout.DynamicUserProfileLayout, { variant: variant }) }) }) }) }) }));
106
109
  };
@@ -75,6 +75,7 @@ import { SandboxIndicatorWrapper } from '../../../../components/SandboxIndicator
75
75
  import { useWidgetContext } from '../../context/DynamicWidgetContext.js';
76
76
  import { DynamicWidgetCard } from '../DynamicWidgetCard/DynamicWidgetCard.js';
77
77
  import { DynamicWidgetVariants } from '../DynamicWidgetVariants/DynamicWidgetVariants.js';
78
+ import { useRegisterWidget } from '../../../../context/WidgetRegistry/WidgetRegistryContextProvider.js';
78
79
 
79
80
  const DynamicUserProfile = ({ variant, }) => {
80
81
  const { projectSettings, setShowDynamicUserProfile, showAuthFlow } = useInternalDynamicContext();
@@ -96,7 +97,9 @@ const DynamicUserProfile = ({ variant, }) => {
96
97
  }
97
98
  }, [inlineControlsRef, variant, showAuthFlow, setShowDynamicUserProfile]);
98
99
  useOnClickOutside(widgetRef, closeOnOutsideClick);
99
- if (!projectSettings)
100
+ const shouldRenderUserProfile = Boolean(projectSettings);
101
+ useRegisterWidget('user-profile', shouldRenderUserProfile);
102
+ if (!shouldRenderUserProfile)
100
103
  return null;
101
104
  return (jsx(IsBrowser, { children: jsx(PopperProvider, { children: jsx(DynamicWidgetVariants, { isOpen: isOpen, setIsOpen: setIsOpen, variant: _variant, zIndex: widgetModalZIndex, children: jsx(SandboxIndicatorWrapper, { children: jsx(DynamicWidgetCard, { ref: widgetRef, children: jsx(DynamicUserProfileLayout, { variant: variant }) }) }) }) }) }));
102
105
  };
@@ -88,7 +88,7 @@ require('../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
88
88
  var useInternalDynamicContext = require('../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
89
89
 
90
90
  const Wallet = ({ wallet, ens }) => {
91
- var _a;
91
+ var _a, _b;
92
92
  const { connector, address } = wallet;
93
93
  const switchWallet = useSwitchWallet.useSwitchWallet();
94
94
  const { setSelectedWalletWithAction, projectSettings, authMode } = useInternalDynamicContext.useInternalDynamicContext();
@@ -97,7 +97,7 @@ const Wallet = ({ wallet, ens }) => {
97
97
  {
98
98
  Icon: jsxRuntime.jsx(switchHorizontal.ReactComponent, {}),
99
99
  callback: () => switchWallet(wallet.id),
100
- hide: ((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown',
100
+ hide: ((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown' || !((_b = wallet.connector) === null || _b === void 0 ? void 0 : _b.isAvailable),
101
101
  text: 'Select wallet',
102
102
  },
103
103
  ];
@@ -84,7 +84,7 @@ import '../../views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
84
84
  import { useInternalDynamicContext } from '../../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
85
85
 
86
86
  const Wallet = ({ wallet, ens }) => {
87
- var _a;
87
+ var _a, _b;
88
88
  const { connector, address } = wallet;
89
89
  const switchWallet = useSwitchWallet();
90
90
  const { setSelectedWalletWithAction, projectSettings, authMode } = useInternalDynamicContext();
@@ -93,7 +93,7 @@ const Wallet = ({ wallet, ens }) => {
93
93
  {
94
94
  Icon: jsx(SvgSwitchHorizontal, {}),
95
95
  callback: () => switchWallet(wallet.id),
96
- hide: ((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown',
96
+ hide: ((_a = wallet.connector) === null || _a === void 0 ? void 0 : _a.key) === 'unknown' || !((_b = wallet.connector) === null || _b === void 0 ? void 0 : _b.isAvailable),
97
97
  text: 'Select wallet',
98
98
  },
99
99
  ];
@@ -87,7 +87,7 @@ require('../../../../context/IpConfigurationContext/IpConfigurationContext.cjs')
87
87
  const PrimaryNotConnectedContent = () => {
88
88
  var _a;
89
89
  const { primaryWallet } = useInternalDynamicContext.useInternalDynamicContext();
90
- return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptLayout, { dataTestId: 'wallet-not-connected', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.key }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}`, children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["Your active wallet in", ' ', jsxRuntime.jsx(Typography.Typography, { as: 'span', weight: 'medium', color: 'primary', children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name }), ' ', "is not linked. Please switch to wallet", ' ', jsxRuntime.jsx(Typography.Typography, { as: 'span', weight: 'medium', color: 'primary', children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) }), ' ', "to log in."] }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: "You can link this wallet to this account after you log in." }), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] }));
90
+ return (jsxRuntime.jsxs(DefaultPromptModal.DefaultPromptLayout, { dataTestId: 'wallet-not-connected', icon: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.key }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}`, children: [jsxRuntime.jsxs(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["Your active wallet in", ' ', jsxRuntime.jsx(Typography.Typography, { as: 'span', weight: 'medium', color: 'primary', children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name }), ' ', "is not linked. Please switch to wallet", ' ', jsxRuntime.jsx(Typography.Typography, { as: 'span', weight: 'medium', color: 'primary', children: shortenWalletAddress.shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) }), "."] }), jsxRuntime.jsx(Divider.Divider, { fullWidth: true, text: 'Or' }), jsxRuntime.jsx(LogoutButton.LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] }));
91
91
  };
92
92
  const PrimaryNotConnectedWidgetPortal = () => (jsxRuntime.jsx(WidgetPortal.WidgetPortal, { children: jsxRuntime.jsx(PrimaryNotConnectedContent, {}) }));
93
93
  const PrimaryNotConnectedModal = () => {
@@ -83,7 +83,7 @@ import '../../../../context/IpConfigurationContext/IpConfigurationContext.js';
83
83
  const PrimaryNotConnectedContent = () => {
84
84
  var _a;
85
85
  const { primaryWallet } = useInternalDynamicContext();
86
- return (jsxs(DefaultPromptLayout, { dataTestId: 'wallet-not-connected', icon: jsx(WalletIcon, { walletKey: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.key }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}`, children: [jsxs(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["Your active wallet in", ' ', jsx(Typography, { as: 'span', weight: 'medium', color: 'primary', children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name }), ' ', "is not linked. Please switch to wallet", ' ', jsx(Typography, { as: 'span', weight: 'medium', color: 'primary', children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) }), ' ', "to log in."] }), jsx(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: "You can link this wallet to this account after you log in." }), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] }));
86
+ return (jsxs(DefaultPromptLayout, { dataTestId: 'wallet-not-connected', icon: jsx(WalletIcon, { walletKey: (_a = primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector) === null || _a === void 0 ? void 0 : _a.key }), title: `Switch wallet in ${primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name}`, children: [jsxs(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: ["Your active wallet in", ' ', jsx(Typography, { as: 'span', weight: 'medium', color: 'primary', children: primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.connector.name }), ' ', "is not linked. Please switch to wallet", ' ', jsx(Typography, { as: 'span', weight: 'medium', color: 'primary', children: shortenWalletAddress(primaryWallet === null || primaryWallet === void 0 ? void 0 : primaryWallet.address, 3, 3) }), "."] }), jsx(Divider, { fullWidth: true, text: 'Or' }), jsx(LogoutButton, { isTextButton: false, buttonClassName: 'primary-not-connected__log-out-button' })] }));
87
87
  };
88
88
  const PrimaryNotConnectedWidgetPortal = () => (jsx(WidgetPortal, { children: jsx(PrimaryNotConnectedContent, {}) }));
89
89
  const PrimaryNotConnectedModal = () => {
@@ -1,22 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- const getInitialTabIndex = (walletListViewSettings, defaultTabIndex) => {
7
- var _a, _b, _c, _d;
8
- if (!walletListViewSettings) {
9
- return null;
10
- }
11
- if (!((_b = (_a = walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length)) {
12
- return null;
13
- }
14
- if (defaultTabIndex < 0) {
15
- return 0;
16
- }
17
- const lastIndex = ((_d = (_c = walletListViewSettings.tabs) === null || _c === void 0 ? void 0 : _c.items.length) !== null && _d !== void 0 ? _d : 1) - 1;
18
- const initialTabIndex = Math.min(lastIndex, defaultTabIndex);
19
- return initialTabIndex;
20
- };
21
-
22
- exports.getInitialTabIndex = getInitialTabIndex;
@@ -1,2 +0,0 @@
1
- import { WalletListViewSettings } from '../../../../context/DynamicContext/types';
2
- export declare const getInitialTabIndex: (walletListViewSettings: WalletListViewSettings | undefined, defaultTabIndex: number) => number | null;