@dynamic-labs/sdk-react-core 2.2.6 → 2.2.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.
package/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
1
 
2
+ ### [2.2.7](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.6...v2.2.7) (2024-06-28)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * coinbase smart wallet better handling in iframes ([#6190](https://github.com/dynamic-labs/DynamicAuth/issues/6190)) ([26530e6](https://github.com/dynamic-labs/DynamicAuth/commit/26530e6e7e368c83ade97ae4edd0de01944825b9))
8
+ * show user wallet in profile view on single wallet mode even if it's not primary ([#6194](https://github.com/dynamic-labs/DynamicAuth/issues/6194)) ([070db58](https://github.com/dynamic-labs/DynamicAuth/commit/070db581f487b0e9a308d99497f63679f61fba7b))
9
+
2
10
  ### [2.2.6](https://github.com/dynamic-labs/DynamicAuth/compare/v2.2.5...v2.2.6) (2024-06-26)
3
11
 
4
12
 
package/package.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "2.2.6";
6
+ var version = "2.2.7";
7
7
  var dependencies = {
8
8
  "@dynamic-labs/sdk-api-core": "0.0.460",
9
9
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use client'
2
- var version = "2.2.6";
2
+ var version = "2.2.7";
3
3
  var dependencies = {
4
4
  "@dynamic-labs/sdk-api-core": "0.0.460",
5
5
  "@hcaptcha/react-hcaptcha": "1.4.4",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/sdk-react-core",
3
- "version": "2.2.6",
3
+ "version": "2.2.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -17,18 +17,18 @@
17
17
  "react-i18next": "13.5.0",
18
18
  "yup": "0.32.11",
19
19
  "react-international-phone": "4.2.5",
20
- "@dynamic-labs/iconic": "2.2.6",
21
- "@dynamic-labs/logger": "2.2.6",
22
- "@dynamic-labs/multi-wallet": "2.2.6",
23
- "@dynamic-labs/rpc-provider-ethereum": "2.2.6",
24
- "@dynamic-labs/rpc-provider-solana": "2.2.6",
25
- "@dynamic-labs/rpc-providers": "2.2.6",
26
- "@dynamic-labs/store": "2.2.6",
27
- "@dynamic-labs/types": "2.2.6",
28
- "@dynamic-labs/utils": "2.2.6",
29
- "@dynamic-labs/viem-utils": "2.2.6",
30
- "@dynamic-labs/wallet-book": "2.2.6",
31
- "@dynamic-labs/wallet-connector-core": "2.2.6",
20
+ "@dynamic-labs/iconic": "2.2.7",
21
+ "@dynamic-labs/logger": "2.2.7",
22
+ "@dynamic-labs/multi-wallet": "2.2.7",
23
+ "@dynamic-labs/rpc-provider-ethereum": "2.2.7",
24
+ "@dynamic-labs/rpc-provider-solana": "2.2.7",
25
+ "@dynamic-labs/rpc-providers": "2.2.7",
26
+ "@dynamic-labs/store": "2.2.7",
27
+ "@dynamic-labs/types": "2.2.7",
28
+ "@dynamic-labs/utils": "2.2.7",
29
+ "@dynamic-labs/viem-utils": "2.2.7",
30
+ "@dynamic-labs/wallet-book": "2.2.7",
31
+ "@dynamic-labs/wallet-connector-core": "2.2.7",
32
32
  "eventemitter3": "5.0.1"
33
33
  },
34
34
  "devDependencies": {
@@ -41,7 +41,7 @@ require('../../locale/locale.cjs');
41
41
  var isAllowedToLinkWallet = require('../../utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.cjs');
42
42
  require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
43
43
  require('../../context/AccountExistsContext/AccountExistsContext.cjs');
44
- require('../../context/UserWalletsContext/UserWalletsContext.cjs');
44
+ var UserWalletsContext = require('../../context/UserWalletsContext/UserWalletsContext.cjs');
45
45
  require('../../context/VerificationContext/VerificationContext.cjs');
46
46
  require('react-dom');
47
47
  require('../../context/WalletContext/WalletContext.cjs');
@@ -68,8 +68,8 @@ require('../../context/MfaSettingsContext/MfaSettingsContext.cjs');
68
68
  require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
69
69
  require('react-focus-lock');
70
70
  require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
71
- require('../IconButton/IconButton.cjs');
72
- require('../MenuList/Dropdown/Dropdown.cjs');
71
+ var getWalletVerifiedCredential = require('../../utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.cjs');
72
+ var Wallet = require('../../widgets/DynamicWidget/components/Wallet/Wallet.cjs');
73
73
  var ErrorContainer = require('../ErrorContainer/ErrorContainer.cjs');
74
74
  var UserProfileField = require('./parts/UserProfileField/UserProfileField.cjs');
75
75
  var UserProfileSection = require('./parts/UserProfileSection/UserProfileSection.cjs');
@@ -77,6 +77,7 @@ var UserProfileSocialAccount = require('./parts/UserProfileSocialAccount/UserPro
77
77
  require('formik');
78
78
  var TypographyButton = require('../TypographyButton/TypographyButton.cjs');
79
79
  require('../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
80
+ require('../IconButton/IconButton.cjs');
80
81
  require('../Input/Input.cjs');
81
82
  require('../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
82
83
  require('../../context/PasskeyContext/PasskeyContext.cjs');
@@ -84,6 +85,7 @@ require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/
84
85
  var useDynamicModals = require('../../utils/hooks/useDynamicModals/useDynamicModals.cjs');
85
86
  require('../InlineWidget/InlineWidget.cjs');
86
87
  require('../IsBrowser/IsBrowser.cjs');
88
+ require('../MenuList/Dropdown/Dropdown.cjs');
87
89
  require('../Popper/Popper/Popper.cjs');
88
90
  require('../Popper/PopperContext/PopperContext.cjs');
89
91
  require('qrcode');
@@ -93,9 +95,11 @@ require('@hcaptcha/react-hcaptcha');
93
95
  require('../../context/IpConfigurationContext/IpConfigurationContext.cjs');
94
96
 
95
97
  const UserProfile = ({ rootClassName }) => {
96
- const { projectSettings, user, setSelectedWalletConnectorKey, multiWallet } = useInternalDynamicContext.useInternalDynamicContext();
98
+ var _a;
99
+ const { projectSettings, user, setSelectedWalletConnectorKey, multiWallet, primaryWallet, } = useInternalDynamicContext.useInternalDynamicContext();
97
100
  const { error } = ErrorContext.useErrorContext();
98
101
  const { setShowLinkNewWalletModal } = useDynamicModals.useDynamicModals();
102
+ const { userWallets } = UserWalletsContext.useInternalUserWallets();
99
103
  const { t } = reactI18next.useTranslation();
100
104
  const { fieldsConfig } = useFields.useFields();
101
105
  const containerRef = React.useRef(null);
@@ -120,7 +124,10 @@ const UserProfile = ({ rootClassName }) => {
120
124
  const mapFieldKeyToValue = (fieldKey) => user === null || user === void 0 ? void 0 : user[fieldKey];
121
125
  if (!user)
122
126
  return null;
123
- return (jsxRuntime.jsxs("div", { "data-testid": 'userProfile', className: classNames.classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsxRuntime.jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type }) => {
127
+ // if it's multiwallet, the wallet should appear in the wallets tab
128
+ // if there's a primary wallet, it will be displayed in the header
129
+ const wallet = !multiWallet && !primaryWallet && userWallets[0];
130
+ return (jsxRuntime.jsxs("div", { "data-testid": 'userProfile', className: classNames.classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsxRuntime.jsx(ErrorContainer.ErrorContainer, { children: error }), wallet && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.my_wallet.title'), children: jsxRuntime.jsx(Wallet.Wallet, { ens: (_a = getWalletVerifiedCredential.getWalletVerifiedCredential(wallet.address, user === null || user === void 0 ? void 0 : user.verifiedCredentials, wallet.chain)) === null || _a === void 0 ? void 0 : _a.nameService, wallet: wallet }, wallet.id) })), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsxRuntime.jsx(UserProfileSection.UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsxRuntime.jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type }) => {
124
131
  var _a, _b;
125
132
  if (type === sdkApiCore.KycFieldType.Custom) {
126
133
  const value = (_b = (_a = user.metadata) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : '';
@@ -37,7 +37,7 @@ import '../../locale/locale.js';
37
37
  import { isAllowedToLinkWallet } from '../../utils/functions/isAllowedToLinkWallet/isAllowedToLinkWallet.js';
38
38
  import '../../context/AccessDeniedContext/AccessDeniedContext.js';
39
39
  import '../../context/AccountExistsContext/AccountExistsContext.js';
40
- import '../../context/UserWalletsContext/UserWalletsContext.js';
40
+ import { useInternalUserWallets } from '../../context/UserWalletsContext/UserWalletsContext.js';
41
41
  import '../../context/VerificationContext/VerificationContext.js';
42
42
  import 'react-dom';
43
43
  import '../../context/WalletContext/WalletContext.js';
@@ -64,8 +64,8 @@ import '../../context/MfaSettingsContext/MfaSettingsContext.js';
64
64
  import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
65
65
  import 'react-focus-lock';
66
66
  import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
67
- import '../IconButton/IconButton.js';
68
- import '../MenuList/Dropdown/Dropdown.js';
67
+ import { getWalletVerifiedCredential } from '../../utils/functions/getWalletVerifiedCredential/getWalletVerifiedCredential.js';
68
+ import { Wallet } from '../../widgets/DynamicWidget/components/Wallet/Wallet.js';
69
69
  import { ErrorContainer } from '../ErrorContainer/ErrorContainer.js';
70
70
  import { UserProfileField } from './parts/UserProfileField/UserProfileField.js';
71
71
  import { UserProfileSection } from './parts/UserProfileSection/UserProfileSection.js';
@@ -73,6 +73,7 @@ import { UserProfileSocialAccount } from './parts/UserProfileSocialAccount/UserP
73
73
  import 'formik';
74
74
  import { TypographyButton } from '../TypographyButton/TypographyButton.js';
75
75
  import '../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
76
+ import '../IconButton/IconButton.js';
76
77
  import '../Input/Input.js';
77
78
  import '../PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
78
79
  import '../../context/PasskeyContext/PasskeyContext.js';
@@ -80,6 +81,7 @@ import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/P
80
81
  import { useDynamicModals } from '../../utils/hooks/useDynamicModals/useDynamicModals.js';
81
82
  import '../InlineWidget/InlineWidget.js';
82
83
  import '../IsBrowser/IsBrowser.js';
84
+ import '../MenuList/Dropdown/Dropdown.js';
83
85
  import '../Popper/Popper/Popper.js';
84
86
  import '../Popper/PopperContext/PopperContext.js';
85
87
  import 'qrcode';
@@ -89,9 +91,11 @@ import '@hcaptcha/react-hcaptcha';
89
91
  import '../../context/IpConfigurationContext/IpConfigurationContext.js';
90
92
 
91
93
  const UserProfile = ({ rootClassName }) => {
92
- const { projectSettings, user, setSelectedWalletConnectorKey, multiWallet } = useInternalDynamicContext();
94
+ var _a;
95
+ const { projectSettings, user, setSelectedWalletConnectorKey, multiWallet, primaryWallet, } = useInternalDynamicContext();
93
96
  const { error } = useErrorContext();
94
97
  const { setShowLinkNewWalletModal } = useDynamicModals();
98
+ const { userWallets } = useInternalUserWallets();
95
99
  const { t } = useTranslation();
96
100
  const { fieldsConfig } = useFields();
97
101
  const containerRef = useRef(null);
@@ -116,7 +120,10 @@ const UserProfile = ({ rootClassName }) => {
116
120
  const mapFieldKeyToValue = (fieldKey) => user === null || user === void 0 ? void 0 : user[fieldKey];
117
121
  if (!user)
118
122
  return null;
119
- return (jsxs("div", { "data-testid": 'userProfile', className: classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsx(ErrorContainer, { children: error }), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsx(UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type }) => {
123
+ // if it's multiwallet, the wallet should appear in the wallets tab
124
+ // if there's a primary wallet, it will be displayed in the header
125
+ const wallet = !multiWallet && !primaryWallet && userWallets[0];
126
+ return (jsxs("div", { "data-testid": 'userProfile', className: classNames('user-profile', rootClassName), ref: containerRef, children: [error && jsx(ErrorContainer, { children: error }), wallet && (jsx(UserProfileSection, { title: t('dyn_user_profile.my_wallet.title'), children: jsx(Wallet, { ens: (_a = getWalletVerifiedCredential(wallet.address, user === null || user === void 0 ? void 0 : user.verifiedCredentials, wallet.chain)) === null || _a === void 0 ? void 0 : _a.nameService, wallet: wallet }, wallet.id) })), (allUserFields === null || allUserFields === void 0 ? void 0 : allUserFields.length) > 0 && (jsx(UserProfileSection, { title: t('dyn_user_profile.my_information.title'), children: jsx("div", { className: 'user-profile__fields', children: allUserFields.map(({ name, validationType, type }) => {
120
127
  var _a, _b;
121
128
  if (type === KycFieldType.Custom) {
122
129
  const value = (_b = (_a = user.metadata) === null || _a === void 0 ? void 0 : _a[name]) !== null && _b !== void 0 ? _b : '';
@@ -1886,6 +1886,9 @@ const translation = {
1886
1886
  my_information: {
1887
1887
  title: 'My information',
1888
1888
  },
1889
+ my_wallet: {
1890
+ title: 'My wallet',
1891
+ },
1889
1892
  social_accounts: {
1890
1893
  title: 'Social accounts',
1891
1894
  },
@@ -1903,6 +1906,9 @@ const translation = {
1903
1906
  my_information: {
1904
1907
  title: 'My information',
1905
1908
  },
1909
+ my_wallet: {
1910
+ title: 'My wallet',
1911
+ },
1906
1912
  social_accounts: {
1907
1913
  title: 'Social accounts',
1908
1914
  },
@@ -1882,6 +1882,9 @@ export declare const translation: {
1882
1882
  my_information: {
1883
1883
  title: 'My information',
1884
1884
  },
1885
+ my_wallet: {
1886
+ title: 'My wallet',
1887
+ },
1885
1888
  social_accounts: {
1886
1889
  title: 'Social accounts',
1887
1890
  },
@@ -1899,6 +1902,9 @@ export declare const translation: {
1899
1902
  my_information: {
1900
1903
  title: string;
1901
1904
  };
1905
+ my_wallet: {
1906
+ title: string;
1907
+ };
1902
1908
  social_accounts: {
1903
1909
  title: string;
1904
1910
  };
@@ -1882,6 +1882,9 @@ const translation = {
1882
1882
  my_information: {
1883
1883
  title: 'My information',
1884
1884
  },
1885
+ my_wallet: {
1886
+ title: 'My wallet',
1887
+ },
1885
1888
  social_accounts: {
1886
1889
  title: 'Social accounts',
1887
1890
  },
@@ -1899,6 +1902,9 @@ const translation = {
1899
1902
  my_information: {
1900
1903
  title: 'My information',
1901
1904
  },
1905
+ my_wallet: {
1906
+ title: 'My wallet',
1907
+ },
1902
1908
  social_accounts: {
1903
1909
  title: 'Social accounts',
1904
1910
  },
@@ -66,10 +66,11 @@ require('react-focus-lock');
66
66
  require('../../context/DynamicWidgetContext.cjs');
67
67
  var DynamicWidgetWallets = require('../../components/DynamicWidgetWallets/DynamicWidgetWallets.cjs');
68
68
  var SingleWalletButtons = require('../../components/SingleWalletButtons/SingleWalletButtons.cjs');
69
+ require('../../../../components/IconButton/IconButton.cjs');
70
+ require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
69
71
  require('formik');
70
72
  var TypographyButton = require('../../../../components/TypographyButton/TypographyButton.cjs');
71
73
  require('../../../../views/TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
72
- require('../../../../components/IconButton/IconButton.cjs');
73
74
  require('../../../../components/Input/Input.cjs');
74
75
  require('../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.cjs');
75
76
  require('../../../../context/PasskeyContext/PasskeyContext.cjs');
@@ -78,7 +79,6 @@ var useDynamicModals = require('../../../../utils/hooks/useDynamicModals/useDyna
78
79
  require('../../../../components/InlineWidget/InlineWidget.cjs');
79
80
  require('../../../../components/IsBrowser/IsBrowser.cjs');
80
81
  var LogoutButton = require('../../../../components/LogoutButton/LogoutButton.cjs');
81
- require('../../../../components/MenuList/Dropdown/Dropdown.cjs');
82
82
  require('../../../../components/Popper/Popper/Popper.cjs');
83
83
  require('../../../../components/Popper/PopperContext/PopperContext.cjs');
84
84
  require('qrcode');
@@ -62,10 +62,11 @@ import 'react-focus-lock';
62
62
  import '../../context/DynamicWidgetContext.js';
63
63
  import { DynamicWidgetWallets } from '../../components/DynamicWidgetWallets/DynamicWidgetWallets.js';
64
64
  import { SingleWalletButtons } from '../../components/SingleWalletButtons/SingleWalletButtons.js';
65
+ import '../../../../components/IconButton/IconButton.js';
66
+ import '../../../../components/MenuList/Dropdown/Dropdown.js';
65
67
  import 'formik';
66
68
  import { TypographyButton } from '../../../../components/TypographyButton/TypographyButton.js';
67
69
  import '../../../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
68
- import '../../../../components/IconButton/IconButton.js';
69
70
  import '../../../../components/Input/Input.js';
70
71
  import '../../../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
71
72
  import '../../../../context/PasskeyContext/PasskeyContext.js';
@@ -74,7 +75,6 @@ import { useDynamicModals } from '../../../../utils/hooks/useDynamicModals/useDy
74
75
  import '../../../../components/InlineWidget/InlineWidget.js';
75
76
  import '../../../../components/IsBrowser/IsBrowser.js';
76
77
  import { LogoutButton } from '../../../../components/LogoutButton/LogoutButton.js';
77
- import '../../../../components/MenuList/Dropdown/Dropdown.js';
78
78
  import '../../../../components/Popper/Popper/Popper.js';
79
79
  import '../../../../components/Popper/PopperContext/PopperContext.js';
80
80
  import 'qrcode';