@dynamic-labs/sdk-react-core 1.1.0-alpha.23 → 1.1.0-alpha.24
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 +7 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +11 -11
- package/src/lib/context/DynamicContext/DynamicContext.cjs +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +1 -0
- package/src/lib/locale/en/translation.cjs +3 -2
- package/src/lib/locale/en/translation.d.ts +2 -1
- package/src/lib/locale/en/translation.js +3 -2
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.cjs +5 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.d.ts +2 -1
- package/src/lib/utils/hooks/useConnectWallet/useConnectWallet.js +5 -1
- package/src/lib/views/AccountExistsView/AccountExistsView.cjs +2 -6
- package/src/lib/views/AccountExistsView/AccountExistsView.js +2 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
|
|
2
|
+
## [1.1.0-alpha.24](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.23...v1.1.0-alpha.24) (2024-02-02)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* remove isFullyConnected when unable to restore wallet ([#4575](https://github.com/dynamic-labs/DynamicAuth/issues/4575)) ([4504ff0](https://github.com/dynamic-labs/DynamicAuth/commit/4504ff03f594cd9a60055e6f52b7ea8001542bbe))
|
|
8
|
+
|
|
2
9
|
## [1.1.0-alpha.23](https://github.com/dynamic-labs/DynamicAuth/compare/v1.1.0-alpha.22...v1.1.0-alpha.23) (2024-02-01)
|
|
3
10
|
|
|
4
11
|
|
package/package.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "1.1.0-alpha.
|
|
5
|
+
var version = "1.1.0-alpha.24";
|
|
6
6
|
var dependencies = {
|
|
7
7
|
"@dynamic-labs/iconic": "0.1.50",
|
|
8
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api": "0.0.361",
|
|
9
9
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
10
10
|
"country-list": "2.3.0",
|
|
11
11
|
formik: "2.2.9",
|
package/package.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var version = "1.1.0-alpha.
|
|
1
|
+
var version = "1.1.0-alpha.24";
|
|
2
2
|
var dependencies = {
|
|
3
3
|
"@dynamic-labs/iconic": "0.1.50",
|
|
4
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api": "0.0.361",
|
|
5
5
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
6
6
|
"country-list": "2.3.0",
|
|
7
7
|
formik: "2.2.9",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "1.1.0-alpha.
|
|
3
|
+
"version": "1.1.0-alpha.24",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@dynamic-labs/iconic": "0.1.50",
|
|
11
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
11
|
+
"@dynamic-labs/sdk-api": "0.0.361",
|
|
12
12
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
13
13
|
"country-list": "2.3.0",
|
|
14
14
|
"formik": "2.2.9",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"react-focus-lock": "2.9.2",
|
|
18
18
|
"react-i18next": "^13.2.0",
|
|
19
19
|
"yup": "0.32.11",
|
|
20
|
-
"@dynamic-labs/ethereum": "1.1.0-alpha.
|
|
21
|
-
"@dynamic-labs/logger": "1.1.0-alpha.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "1.1.0-alpha.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "1.1.0-alpha.
|
|
24
|
-
"@dynamic-labs/types": "1.1.0-alpha.
|
|
25
|
-
"@dynamic-labs/utils": "1.1.0-alpha.
|
|
26
|
-
"@dynamic-labs/viem-utils": "1.1.0-alpha.
|
|
27
|
-
"@dynamic-labs/wallet-book": "1.1.0-alpha.
|
|
28
|
-
"@dynamic-labs/wallet-connector-core": "1.1.0-alpha.
|
|
20
|
+
"@dynamic-labs/ethereum": "1.1.0-alpha.24",
|
|
21
|
+
"@dynamic-labs/logger": "1.1.0-alpha.24",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "1.1.0-alpha.24",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "1.1.0-alpha.24",
|
|
24
|
+
"@dynamic-labs/types": "1.1.0-alpha.24",
|
|
25
|
+
"@dynamic-labs/utils": "1.1.0-alpha.24",
|
|
26
|
+
"@dynamic-labs/viem-utils": "1.1.0-alpha.24",
|
|
27
|
+
"@dynamic-labs/wallet-book": "1.1.0-alpha.24",
|
|
28
|
+
"@dynamic-labs/wallet-connector-core": "1.1.0-alpha.24",
|
|
29
29
|
"eventemitter3": "5.0.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
@@ -17,8 +17,9 @@ const translation = {
|
|
|
17
17
|
*/
|
|
18
18
|
dyn_account_exists: {
|
|
19
19
|
connect: 'Connect with {{socialOauth}}',
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
description_email: 'It looks like an account already exists using',
|
|
21
|
+
description_social: 'To restore your account to the right place, we need you to log in again.',
|
|
22
|
+
title: 'Re-Authentication Required',
|
|
22
23
|
trail_message_email: '. Please log in with your email.',
|
|
23
24
|
trail_message_social: 'through {{socialOauth}}',
|
|
24
25
|
},
|
|
@@ -13,8 +13,9 @@ const translation = {
|
|
|
13
13
|
*/
|
|
14
14
|
dyn_account_exists: {
|
|
15
15
|
connect: 'Connect with {{socialOauth}}',
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
description_email: 'It looks like an account already exists using',
|
|
17
|
+
description_social: 'To restore your account to the right place, we need you to log in again.',
|
|
18
|
+
title: 'Re-Authentication Required',
|
|
18
19
|
trail_message_email: '. Please log in with your email.',
|
|
19
20
|
trail_message_social: 'through {{socialOauth}}',
|
|
20
21
|
},
|
|
@@ -27,7 +27,7 @@ require('viem/chains');
|
|
|
27
27
|
var getWalletProvider = require('../../functions/getWalletProvider/getWalletProvider.cjs');
|
|
28
28
|
var updateUserWalletsFromConnectedWallets = require('./updateUserWalletsFromConnectedWallets/updateUserWalletsFromConnectedWallets.cjs');
|
|
29
29
|
|
|
30
|
-
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, walletConnectorOptions, onDisconnect, onBeforeConnectSuccessConfirmation, setShowAuthFlow, isBridgeFlow, }) => {
|
|
30
|
+
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, walletConnectorOptions, onDisconnect, onBeforeConnectSuccessConfirmation, removeIsFullyConnected, setShowAuthFlow, isBridgeFlow, }) => {
|
|
31
31
|
const [connectedWalletsInfo, setConnectedWalletsInfo, removeConnectedWalletsInfo,] = useLocalStorage.useLocalStorage(localStorage.CONNECTED_WALLETS_INFO, []);
|
|
32
32
|
const [connectedWallets, _setConnectedWallets] = React.useState([]);
|
|
33
33
|
const { setUserWallets } = UserWalletsContext.useInternalUserWallets();
|
|
@@ -41,6 +41,9 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
41
41
|
yield (walletToDisconnect === null || walletToDisconnect === void 0 ? void 0 : walletToDisconnect.connector.endSession());
|
|
42
42
|
const updatedConnectedWalletsInfo = connectedWalletsInfo.filter((wallet) => wallet.id !== walletId);
|
|
43
43
|
setConnectedWalletsInfo(updatedConnectedWalletsInfo);
|
|
44
|
+
if (updatedConnectedWalletsInfo.length === 0) {
|
|
45
|
+
removeIsFullyConnected();
|
|
46
|
+
}
|
|
44
47
|
onDisconnect(updatedConnectedWalletsInfo, walletToDisconnect);
|
|
45
48
|
if (walletId !== primaryWalletId) {
|
|
46
49
|
return;
|
|
@@ -59,6 +62,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
59
62
|
isBridgeFlow,
|
|
60
63
|
onDisconnect,
|
|
61
64
|
primaryWalletId,
|
|
65
|
+
removeIsFullyConnected,
|
|
62
66
|
setConnectedWalletsInfo,
|
|
63
67
|
setPrimaryWalletId,
|
|
64
68
|
]);
|
|
@@ -18,6 +18,7 @@ type Props = {
|
|
|
18
18
|
walletConnectorOptions: WalletOption[];
|
|
19
19
|
onDisconnect: (connectedWalletsInfo: ConnectedWalletConnectorType[], wallet?: Wallet) => void;
|
|
20
20
|
onBeforeConnectSuccessConfirmation: OnBeforeConnectSuccessConfirmation | undefined;
|
|
21
|
+
removeIsFullyConnected: () => void;
|
|
21
22
|
setShowAuthFlow: SetShowAuthFlow;
|
|
22
23
|
isBridgeFlow: boolean;
|
|
23
24
|
};
|
|
@@ -30,5 +31,5 @@ type UseConnectWalletValue = {
|
|
|
30
31
|
removeConnectedWalletsInfo: () => void;
|
|
31
32
|
disconnectWallet: (walletId: string) => Promise<void>;
|
|
32
33
|
};
|
|
33
|
-
export declare const useConnectWallet: ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, walletConnectorOptions, onDisconnect, onBeforeConnectSuccessConfirmation, setShowAuthFlow, isBridgeFlow, }: Props) => UseConnectWalletValue;
|
|
34
|
+
export declare const useConnectWallet: ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, walletConnectorOptions, onDisconnect, onBeforeConnectSuccessConfirmation, removeIsFullyConnected, setShowAuthFlow, isBridgeFlow, }: Props) => UseConnectWalletValue;
|
|
34
35
|
export {};
|
|
@@ -23,7 +23,7 @@ import 'viem/chains';
|
|
|
23
23
|
import { getWalletProvider } from '../../functions/getWalletProvider/getWalletProvider.js';
|
|
24
24
|
import { updateUserWalletsFromConnectedWallets } from './updateUserWalletsFromConnectedWallets/updateUserWalletsFromConnectedWallets.js';
|
|
25
25
|
|
|
26
|
-
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, walletConnectorOptions, onDisconnect, onBeforeConnectSuccessConfirmation, setShowAuthFlow, isBridgeFlow, }) => {
|
|
26
|
+
const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingOnConnectOnly, environmentId, primaryWalletId, setPrimaryWalletId, walletConnectorOptions, onDisconnect, onBeforeConnectSuccessConfirmation, removeIsFullyConnected, setShowAuthFlow, isBridgeFlow, }) => {
|
|
27
27
|
const [connectedWalletsInfo, setConnectedWalletsInfo, removeConnectedWalletsInfo,] = useLocalStorage(CONNECTED_WALLETS_INFO, []);
|
|
28
28
|
const [connectedWallets, _setConnectedWallets] = useState([]);
|
|
29
29
|
const { setUserWallets } = useInternalUserWallets();
|
|
@@ -37,6 +37,9 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
37
37
|
yield (walletToDisconnect === null || walletToDisconnect === void 0 ? void 0 : walletToDisconnect.connector.endSession());
|
|
38
38
|
const updatedConnectedWalletsInfo = connectedWalletsInfo.filter((wallet) => wallet.id !== walletId);
|
|
39
39
|
setConnectedWalletsInfo(updatedConnectedWalletsInfo);
|
|
40
|
+
if (updatedConnectedWalletsInfo.length === 0) {
|
|
41
|
+
removeIsFullyConnected();
|
|
42
|
+
}
|
|
40
43
|
onDisconnect(updatedConnectedWalletsInfo, walletToDisconnect);
|
|
41
44
|
if (walletId !== primaryWalletId) {
|
|
42
45
|
return;
|
|
@@ -55,6 +58,7 @@ const useConnectWallet = ({ authMode, clearPrimaryWalletId, enableVisitTrackingO
|
|
|
55
58
|
isBridgeFlow,
|
|
56
59
|
onDisconnect,
|
|
57
60
|
primaryWalletId,
|
|
61
|
+
removeIsFullyConnected,
|
|
58
62
|
setConnectedWalletsInfo,
|
|
59
63
|
setPrimaryWalletId,
|
|
60
64
|
]);
|
|
@@ -88,12 +88,8 @@ const AccountExistsView = () => {
|
|
|
88
88
|
return socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.connect(embeddedSocialSigninProvider);
|
|
89
89
|
}));
|
|
90
90
|
const renderFullMessage = () => {
|
|
91
|
-
const messageTrail = embeddedSocialSigninProvider
|
|
92
|
-
|
|
93
|
-
socialOauth: capitalize.capitalize(embeddedSocialSigninProvider),
|
|
94
|
-
})
|
|
95
|
-
: t('dyn_account_exists.trail_message_email');
|
|
96
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [t('dyn_account_exists.description'), " ", jsxRuntime.jsx("strong", { children: email }), ' ', messageTrail] }));
|
|
91
|
+
const messageTrail = embeddedSocialSigninProvider ? (t('dyn_account_exists.description_social')) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [t('dyn_account_exists.description_email'), " ", jsxRuntime.jsx("strong", { children: email }), ' ', t('dyn_account_exists.trail_message_email')] }));
|
|
92
|
+
return messageTrail;
|
|
97
93
|
};
|
|
98
94
|
return (jsxRuntime.jsxs("div", { className: 'account-exists__container', children: [jsxRuntime.jsx(iconic.UserProfileIcon, { className: 'account-exists__image' }), jsxRuntime.jsxs("div", { className: 'account-exists__main', children: [jsxRuntime.jsx("div", { className: 'account-exists__content', children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'account-exists__content--secondary', copykey: 'dyn_account_exists', children: renderFullMessage() }) }), embeddedSocialSigninProvider ? (jsxRuntime.jsxs(IconListTile.IconListTile, { dataTestId: `inline-${embeddedSocialSigninProvider}`, onClick: () => handleNewLoging(), className: 'social-sign-in--tile', children: [jsxRuntime.jsx(IconWithSpinner.IconWithSpinner, { Icon: findSocialIcon(embeddedSocialSigninProvider), isSpinning: socialProvider === existingSocialSignInProvider, iconSize: 32 }), jsxRuntime.jsx(Typography.Typography, { variant: 'button_primary', copykey: 'dyn_account_exists.connect', children: t('dyn_account_exists.connect', {
|
|
99
95
|
socialOauth: capitalize.capitalize(embeddedSocialSigninProvider === null || embeddedSocialSigninProvider === void 0 ? void 0 : embeddedSocialSigninProvider.toString()),
|
|
@@ -84,12 +84,8 @@ const AccountExistsView = () => {
|
|
|
84
84
|
return socialWalletConnector === null || socialWalletConnector === void 0 ? void 0 : socialWalletConnector.connect(embeddedSocialSigninProvider);
|
|
85
85
|
}));
|
|
86
86
|
const renderFullMessage = () => {
|
|
87
|
-
const messageTrail = embeddedSocialSigninProvider
|
|
88
|
-
|
|
89
|
-
socialOauth: capitalize(embeddedSocialSigninProvider),
|
|
90
|
-
})
|
|
91
|
-
: t('dyn_account_exists.trail_message_email');
|
|
92
|
-
return (jsxs(Fragment, { children: [t('dyn_account_exists.description'), " ", jsx("strong", { children: email }), ' ', messageTrail] }));
|
|
87
|
+
const messageTrail = embeddedSocialSigninProvider ? (t('dyn_account_exists.description_social')) : (jsxs(Fragment, { children: [t('dyn_account_exists.description_email'), " ", jsx("strong", { children: email }), ' ', t('dyn_account_exists.trail_message_email')] }));
|
|
88
|
+
return messageTrail;
|
|
93
89
|
};
|
|
94
90
|
return (jsxs("div", { className: 'account-exists__container', children: [jsx(UserProfileIcon, { className: 'account-exists__image' }), jsxs("div", { className: 'account-exists__main', children: [jsx("div", { className: 'account-exists__content', children: jsx(Typography, { variant: 'body_normal', weight: 'regular', color: 'secondary', className: 'account-exists__content--secondary', copykey: 'dyn_account_exists', children: renderFullMessage() }) }), embeddedSocialSigninProvider ? (jsxs(IconListTile, { dataTestId: `inline-${embeddedSocialSigninProvider}`, onClick: () => handleNewLoging(), className: 'social-sign-in--tile', children: [jsx(IconWithSpinner, { Icon: findSocialIcon(embeddedSocialSigninProvider), isSpinning: socialProvider === existingSocialSignInProvider, iconSize: 32 }), jsx(Typography, { variant: 'button_primary', copykey: 'dyn_account_exists.connect', children: t('dyn_account_exists.connect', {
|
|
95
91
|
socialOauth: capitalize(embeddedSocialSigninProvider === null || embeddedSocialSigninProvider === void 0 ? void 0 : embeddedSocialSigninProvider.toString()),
|