@dynamic-labs/sdk-react-core 0.19.5 → 0.19.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 +24 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/index.cjs +2 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -0
- package/src/lib/Main.cjs +1 -0
- package/src/lib/Main.js +1 -0
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -1
- package/src/lib/components/Accordion/components/AccordionItem/AccordionItem.js +1 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.cjs +1 -1
- package/src/lib/components/AnimatePresence/AnimatePresence.js +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.cjs +1 -1
- package/src/lib/components/AuthProviderIcon/AuthProviderIcon.js +1 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.cjs +1 -1
- package/src/lib/components/MenuList/Dropdown/Dropdown.js +1 -1
- package/src/lib/components/Modal/Modal.cjs +1 -1
- package/src/lib/components/Modal/Modal.js +1 -1
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +5 -4
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +5 -4
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +11 -9
- package/src/lib/components/NetworkPicker/NetworkPicker.d.ts +2 -1
- package/src/lib/components/NetworkPicker/NetworkPicker.js +11 -9
- package/src/lib/components/OverlayCard/OverlayCard.cjs +1 -1
- package/src/lib/components/OverlayCard/OverlayCard.js +1 -1
- package/src/lib/components/Portal/Portal.cjs +1 -1
- package/src/lib/components/Portal/Portal.js +1 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.cjs +2 -1
- package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.js +2 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.cjs +1 -1
- package/src/lib/components/SocialSignIn/SocialSignIn.js +1 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.cjs +1 -1
- package/src/lib/components/SyncPasskeyFlow/SyncPasskeyFlow.js +1 -1
- package/src/lib/components/Tooltip/Tooltip.cjs +1 -1
- package/src/lib/components/Tooltip/Tooltip.js +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.cjs +1 -1
- package/src/lib/components/TransactionStatusLayout/TransactionStatusLayout.js +1 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.cjs +1 -1
- package/src/lib/components/Transition/VerticalDrawerTransition/VerticalDrawerTransition.js +1 -1
- package/src/lib/components/UserAddress/UserAddress.cjs +1 -1
- package/src/lib/components/UserAddress/UserAddress.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +16 -13
- package/src/lib/context/DynamicContext/DynamicContext.js +16 -13
- package/src/lib/context/DynamicContext/useCustomerCallbacks/types.d.ts +3 -5
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.js +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.cjs +5 -24
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.d.ts +1 -1
- package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerCallbacks.js +5 -24
- package/src/lib/context/MockContext/MockContext.cjs +1 -0
- package/src/lib/context/MockContext/MockContext.js +1 -0
- package/src/lib/context/QrCodeContext/QrCodeContext.cjs +1 -1
- package/src/lib/context/QrCodeContext/QrCodeContext.js +1 -1
- package/src/lib/context/SendBalanceContext/SendBalanceContext.cjs +1 -1
- package/src/lib/context/SendBalanceContext/SendBalanceContext.js +1 -1
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.cjs +16 -2
- package/src/lib/context/SocialRedirectContext/SocialRedirectContext.js +17 -3
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.cjs +1 -1
- package/src/lib/context/UserFieldEditorContext/UserFieldEditorContext.js +1 -1
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +1 -0
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +1 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.cjs +5 -3
- package/src/lib/utils/functions/walletListBuilder/utils/groupWalletOptions/groupWalletOptions.js +5 -3
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.cjs +8 -9
- package/src/lib/utils/hooks/useConnectedWalletsNetworkValidation/useConnectedWalletsNetworkValidation.js +8 -9
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.cjs +34 -5
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.d.ts +33 -1
- package/src/lib/utils/hooks/useWalletConnectorEvent/useWalletConnectorEvent.js +34 -5
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.cjs +19 -18
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletEventListeners/useWalletEventListeners.js +19 -18
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.cjs +1 -1
- package/src/lib/utils/hooks/useWalletUiUtils/useWalletUiUtils.js +1 -1
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.cjs +32 -8
- package/src/lib/utils/hooks/useWalletsConnectionState/useWalletsConnectionState.js +33 -9
- package/src/lib/views/CollectUserDataView/CollectUserDataView.cjs +1 -1
- package/src/lib/views/CollectUserDataView/CollectUserDataView.js +1 -1
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -5
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -5
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +9 -3
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +9 -3
- package/src/lib/views/LoginView/useLoginView.cjs +5 -0
- package/src/lib/views/LoginView/useLoginView.js +5 -0
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.cjs +6 -3
- package/src/lib/views/NetworkNotSupported/NetworkNotSupported.js +6 -3
- package/src/lib/views/QrCodeView/QRCode.cjs +1 -1
- package/src/lib/views/QrCodeView/QRCode.js +1 -1
- package/src/lib/views/QrCodeView/QrCodeView.cjs +1 -1
- package/src/lib/views/QrCodeView/QrCodeView.js +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.cjs +1 -1
- package/src/lib/views/SendBalanceView/components/TransactionStage/TransactionStage.js +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/TransactionConfirmationView.js +1 -1
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.cjs +1 -1
- package/src/lib/views/TransactionConfirmationView/hooks/useTransactionGas/useTransactionGas.js +1 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.cjs +1 -0
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicNav/DynamicNav.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -0
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetVariants/variants/DynamicWidgetDropdown/DynamicWidgetDropdown.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.cjs +6 -2
- package/src/lib/widgets/DynamicWidget/components/EmailOTPConnectorPendingSignModalContent/EmailOTPConnectorPendingSignModalContent.js +6 -2
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/context/DynamicWidgetContext.js +1 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.cjs +7 -7
- package/src/lib/widgets/DynamicWidget/helpers/helpers.d.ts +1 -1
- package/src/lib/widgets/DynamicWidget/helpers/helpers.js +7 -7
|
@@ -35,6 +35,7 @@ import '../Popper/Popper/Popper.js';
|
|
|
35
35
|
import '../Popper/PopperContext/PopperContext.js';
|
|
36
36
|
import 'formik';
|
|
37
37
|
import 'yup';
|
|
38
|
+
import 'i18next';
|
|
38
39
|
import '../InlineWidget/InlineWidget.js';
|
|
39
40
|
import '../MenuList/Dropdown/Dropdown.js';
|
|
40
41
|
import '../OverlayCard/OverlayCard.context.js';
|
|
@@ -47,7 +48,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
47
48
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
48
49
|
import 'qrcode';
|
|
49
50
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
50
|
-
import 'i18next';
|
|
51
51
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
52
52
|
import '../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
53
53
|
import '@dynamic-labs/types';
|
package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.cjs
CHANGED
|
@@ -19,11 +19,12 @@ require('../../../../context/ViewContext/ViewContext.cjs');
|
|
|
19
19
|
require('../../../../shared/consts/index.cjs');
|
|
20
20
|
var Icon = require('../../../Icon/Icon.cjs');
|
|
21
21
|
var Typography = require('../../../Typography/Typography.cjs');
|
|
22
|
+
var helpers = require('../../../../widgets/DynamicWidget/helpers/helpers.cjs');
|
|
22
23
|
|
|
23
24
|
const TokenBalanceCard = ({ chain, currencySymbol, balance, }) => {
|
|
24
25
|
const ChainIcon = getChainIcon.getChainIcon(chain);
|
|
25
26
|
const { t } = reactI18next.useTranslation();
|
|
26
|
-
return (jsxRuntime.jsxs("div", { className: 'token-balance-card', children: [jsxRuntime.jsxs("div", { className: 'token-balance-card__chain', children: [jsxRuntime.jsx(Icon.Icon, { size: 'small', children: jsxRuntime.jsx(ChainIcon, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: currencySymbol })] }),
|
|
27
|
+
return (jsxRuntime.jsxs("div", { className: 'token-balance-card', children: [jsxRuntime.jsxs("div", { className: 'token-balance-card__chain', children: [jsxRuntime.jsx(Icon.Icon, { size: 'small', children: jsxRuntime.jsx(ChainIcon, {}) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', children: currencySymbol })] }), balance !== undefined && (jsxRuntime.jsxs("div", { className: 'token-balance-card__balance-container', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'tertiary', children: t('dyn_send_transaction.data.balance.label') }), jsxRuntime.jsxs("div", { className: 'token-balance-card__balance', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'secondary', children: helpers.roundBalance(balance, 6) }), jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'tertiary', children: currencySymbol })] })] }))] }));
|
|
27
28
|
};
|
|
28
29
|
|
|
29
30
|
exports.TokenBalanceCard = TokenBalanceCard;
|
package/src/lib/components/SendBalancePageLayout/components/TokenBalanceCard/TokenBalanceCard.js
CHANGED
|
@@ -15,11 +15,12 @@ import '../../../../context/ViewContext/ViewContext.js';
|
|
|
15
15
|
import '../../../../shared/consts/index.js';
|
|
16
16
|
import { Icon } from '../../../Icon/Icon.js';
|
|
17
17
|
import { Typography } from '../../../Typography/Typography.js';
|
|
18
|
+
import { roundBalance } from '../../../../widgets/DynamicWidget/helpers/helpers.js';
|
|
18
19
|
|
|
19
20
|
const TokenBalanceCard = ({ chain, currencySymbol, balance, }) => {
|
|
20
21
|
const ChainIcon = getChainIcon(chain);
|
|
21
22
|
const { t } = useTranslation();
|
|
22
|
-
return (jsxs("div", { className: 'token-balance-card', children: [jsxs("div", { className: 'token-balance-card__chain', children: [jsx(Icon, { size: 'small', children: jsx(ChainIcon, {}) }), jsx(Typography, { variant: 'body_normal', color: 'primary', children: currencySymbol })] }),
|
|
23
|
+
return (jsxs("div", { className: 'token-balance-card', children: [jsxs("div", { className: 'token-balance-card__chain', children: [jsx(Icon, { size: 'small', children: jsx(ChainIcon, {}) }), jsx(Typography, { variant: 'body_normal', color: 'primary', children: currencySymbol })] }), balance !== undefined && (jsxs("div", { className: 'token-balance-card__balance-container', children: [jsx(Typography, { variant: 'body_small', color: 'tertiary', children: t('dyn_send_transaction.data.balance.label') }), jsxs("div", { className: 'token-balance-card__balance', children: [jsx(Typography, { variant: 'body_small', color: 'secondary', children: roundBalance(balance, 6) }), jsx(Typography, { variant: 'body_small', color: 'tertiary', children: currencySymbol })] })] }))] }));
|
|
23
24
|
};
|
|
24
25
|
|
|
25
26
|
export { TokenBalanceCard };
|
|
@@ -46,6 +46,7 @@ require('../Popper/Popper/Popper.cjs');
|
|
|
46
46
|
require('../Popper/PopperContext/PopperContext.cjs');
|
|
47
47
|
require('formik');
|
|
48
48
|
require('yup');
|
|
49
|
+
require('i18next');
|
|
49
50
|
require('../InlineWidget/InlineWidget.cjs');
|
|
50
51
|
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
51
52
|
var OverlayCard = require('../OverlayCard/OverlayCard.cjs');
|
|
@@ -59,7 +60,6 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
59
60
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
60
61
|
require('qrcode');
|
|
61
62
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
62
|
-
require('i18next');
|
|
63
63
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
64
64
|
require('../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
65
65
|
require('@dynamic-labs/types');
|
|
@@ -42,6 +42,7 @@ import '../Popper/Popper/Popper.js';
|
|
|
42
42
|
import '../Popper/PopperContext/PopperContext.js';
|
|
43
43
|
import 'formik';
|
|
44
44
|
import 'yup';
|
|
45
|
+
import 'i18next';
|
|
45
46
|
import '../InlineWidget/InlineWidget.js';
|
|
46
47
|
import '../MenuList/Dropdown/Dropdown.js';
|
|
47
48
|
import { OverlayCard } from '../OverlayCard/OverlayCard.js';
|
|
@@ -55,7 +56,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
55
56
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
56
57
|
import 'qrcode';
|
|
57
58
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
58
|
-
import 'i18next';
|
|
59
59
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
60
60
|
import '../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
61
61
|
import '@dynamic-labs/types';
|
|
@@ -40,6 +40,7 @@ require('../Popper/Popper/Popper.cjs');
|
|
|
40
40
|
require('../Popper/PopperContext/PopperContext.cjs');
|
|
41
41
|
require('formik');
|
|
42
42
|
require('yup');
|
|
43
|
+
require('i18next');
|
|
43
44
|
require('../InlineWidget/InlineWidget.cjs');
|
|
44
45
|
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
45
46
|
require('../OverlayCard/OverlayCard.context.cjs');
|
|
@@ -52,7 +53,6 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
52
53
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
53
54
|
require('qrcode');
|
|
54
55
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
55
|
-
require('i18next');
|
|
56
56
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
57
57
|
require('../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
58
58
|
require('@dynamic-labs/types');
|
|
@@ -36,6 +36,7 @@ import '../Popper/Popper/Popper.js';
|
|
|
36
36
|
import '../Popper/PopperContext/PopperContext.js';
|
|
37
37
|
import 'formik';
|
|
38
38
|
import 'yup';
|
|
39
|
+
import 'i18next';
|
|
39
40
|
import '../InlineWidget/InlineWidget.js';
|
|
40
41
|
import '../MenuList/Dropdown/Dropdown.js';
|
|
41
42
|
import '../OverlayCard/OverlayCard.context.js';
|
|
@@ -48,7 +49,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
48
49
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
49
50
|
import 'qrcode';
|
|
50
51
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
51
|
-
import 'i18next';
|
|
52
52
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
53
53
|
import '../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
54
54
|
import '@dynamic-labs/types';
|
|
@@ -43,6 +43,7 @@ require('../Popper/Popper/Popper.cjs');
|
|
|
43
43
|
require('../Popper/PopperContext/PopperContext.cjs');
|
|
44
44
|
require('formik');
|
|
45
45
|
require('yup');
|
|
46
|
+
require('i18next');
|
|
46
47
|
require('../InlineWidget/InlineWidget.cjs');
|
|
47
48
|
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
48
49
|
require('../OverlayCard/OverlayCard.context.cjs');
|
|
@@ -55,7 +56,6 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
55
56
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
56
57
|
require('qrcode');
|
|
57
58
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
58
|
-
require('i18next');
|
|
59
59
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
60
60
|
require('../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
61
61
|
require('@dynamic-labs/types');
|
|
@@ -39,6 +39,7 @@ import '../Popper/Popper/Popper.js';
|
|
|
39
39
|
import '../Popper/PopperContext/PopperContext.js';
|
|
40
40
|
import 'formik';
|
|
41
41
|
import 'yup';
|
|
42
|
+
import 'i18next';
|
|
42
43
|
import '../InlineWidget/InlineWidget.js';
|
|
43
44
|
import '../MenuList/Dropdown/Dropdown.js';
|
|
44
45
|
import '../OverlayCard/OverlayCard.context.js';
|
|
@@ -51,7 +52,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
51
52
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
52
53
|
import 'qrcode';
|
|
53
54
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
54
|
-
import 'i18next';
|
|
55
55
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
56
56
|
import '../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
57
57
|
import '@dynamic-labs/types';
|
|
@@ -46,6 +46,7 @@ require('../Popper/Popper/Popper.cjs');
|
|
|
46
46
|
require('../Popper/PopperContext/PopperContext.cjs');
|
|
47
47
|
require('formik');
|
|
48
48
|
require('yup');
|
|
49
|
+
require('i18next');
|
|
49
50
|
require('../InlineWidget/InlineWidget.cjs');
|
|
50
51
|
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
51
52
|
require('../OverlayCard/OverlayCard.context.cjs');
|
|
@@ -58,7 +59,6 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
58
59
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
59
60
|
require('qrcode');
|
|
60
61
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
61
|
-
require('i18next');
|
|
62
62
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
63
63
|
require('../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
64
64
|
require('@dynamic-labs/types');
|
|
@@ -42,6 +42,7 @@ import '../Popper/Popper/Popper.js';
|
|
|
42
42
|
import '../Popper/PopperContext/PopperContext.js';
|
|
43
43
|
import 'formik';
|
|
44
44
|
import 'yup';
|
|
45
|
+
import 'i18next';
|
|
45
46
|
import '../InlineWidget/InlineWidget.js';
|
|
46
47
|
import '../MenuList/Dropdown/Dropdown.js';
|
|
47
48
|
import '../OverlayCard/OverlayCard.context.js';
|
|
@@ -54,7 +55,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
54
55
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
55
56
|
import 'qrcode';
|
|
56
57
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
57
|
-
import 'i18next';
|
|
58
58
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
59
59
|
import '../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
60
60
|
import '@dynamic-labs/types';
|
|
@@ -41,6 +41,7 @@ require('../../Popper/Popper/Popper.cjs');
|
|
|
41
41
|
require('../../Popper/PopperContext/PopperContext.cjs');
|
|
42
42
|
require('formik');
|
|
43
43
|
require('yup');
|
|
44
|
+
require('i18next');
|
|
44
45
|
require('../../InlineWidget/InlineWidget.cjs');
|
|
45
46
|
require('../../MenuList/Dropdown/Dropdown.cjs');
|
|
46
47
|
require('../../OverlayCard/OverlayCard.context.cjs');
|
|
@@ -53,7 +54,6 @@ require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
53
54
|
require('../../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
54
55
|
require('qrcode');
|
|
55
56
|
require('../../../context/LoadingContext/LoadingContext.cjs');
|
|
56
|
-
require('i18next');
|
|
57
57
|
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
58
58
|
require('../../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
59
59
|
require('@dynamic-labs/types');
|
|
@@ -37,6 +37,7 @@ import '../../Popper/Popper/Popper.js';
|
|
|
37
37
|
import '../../Popper/PopperContext/PopperContext.js';
|
|
38
38
|
import 'formik';
|
|
39
39
|
import 'yup';
|
|
40
|
+
import 'i18next';
|
|
40
41
|
import '../../InlineWidget/InlineWidget.js';
|
|
41
42
|
import '../../MenuList/Dropdown/Dropdown.js';
|
|
42
43
|
import '../../OverlayCard/OverlayCard.context.js';
|
|
@@ -49,7 +50,6 @@ import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
|
49
50
|
import '../../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
50
51
|
import 'qrcode';
|
|
51
52
|
import '../../../context/LoadingContext/LoadingContext.js';
|
|
52
|
-
import 'i18next';
|
|
53
53
|
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
54
54
|
import '../../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
55
55
|
import '@dynamic-labs/types';
|
|
@@ -41,6 +41,7 @@ require('../Popper/Popper/Popper.cjs');
|
|
|
41
41
|
require('../Popper/PopperContext/PopperContext.cjs');
|
|
42
42
|
require('formik');
|
|
43
43
|
require('yup');
|
|
44
|
+
require('i18next');
|
|
44
45
|
require('../InlineWidget/InlineWidget.cjs');
|
|
45
46
|
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
46
47
|
require('../OverlayCard/OverlayCard.context.cjs');
|
|
@@ -54,7 +55,6 @@ require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
|
54
55
|
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
55
56
|
require('qrcode');
|
|
56
57
|
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
57
|
-
require('i18next');
|
|
58
58
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
59
59
|
require('../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
60
60
|
require('@dynamic-labs/types');
|
|
@@ -37,6 +37,7 @@ import '../Popper/Popper/Popper.js';
|
|
|
37
37
|
import '../Popper/PopperContext/PopperContext.js';
|
|
38
38
|
import 'formik';
|
|
39
39
|
import 'yup';
|
|
40
|
+
import 'i18next';
|
|
40
41
|
import '../InlineWidget/InlineWidget.js';
|
|
41
42
|
import '../MenuList/Dropdown/Dropdown.js';
|
|
42
43
|
import '../OverlayCard/OverlayCard.context.js';
|
|
@@ -50,7 +51,6 @@ import '../../context/CaptchaContext/CaptchaContext.js';
|
|
|
50
51
|
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
51
52
|
import 'qrcode';
|
|
52
53
|
import '../../context/LoadingContext/LoadingContext.js';
|
|
53
|
-
import 'i18next';
|
|
54
54
|
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
55
55
|
import '../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
56
56
|
import '@dynamic-labs/types';
|
|
@@ -57,6 +57,7 @@ require('../../components/Alert/Alert.cjs');
|
|
|
57
57
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
58
58
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
59
59
|
require('formik');
|
|
60
|
+
require('i18next');
|
|
60
61
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
61
62
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
62
63
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -80,7 +81,6 @@ var DynamicBridgeWidgetContext = require('../../widgets/DynamicBridgeWidget/cont
|
|
|
80
81
|
var DynamicWidgetContext = require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
81
82
|
require('../../widgets/DynamicWidget/components/DynamicWidgetCard/DynamicWidgetCard.cjs');
|
|
82
83
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
83
|
-
require('i18next');
|
|
84
84
|
require('../FooterAnimationContext/index.cjs');
|
|
85
85
|
require('../SocialRedirectContext/SocialRedirectContext.cjs');
|
|
86
86
|
var QrCodeContext = require('../QrCodeContext/QrCodeContext.cjs');
|
|
@@ -392,24 +392,27 @@ const DynamicContextProvider = ({ children, theme, settings, locale: locale$1, }
|
|
|
392
392
|
helpers.initExpirationTime(handleLogOut);
|
|
393
393
|
}, [handleLogOut]);
|
|
394
394
|
useCustomerAuthFlowCallbacks.useCustomerAuthFlowCallbacks({ eventsCallbacks, showAuthFlow });
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
395
|
+
// "useTieCallbacksToEvents"
|
|
396
|
+
React.useEffect(() => {
|
|
397
|
+
const dynamicEvents = internalEventsRef.current;
|
|
398
|
+
const emailCallback = (result, email) => {
|
|
399
|
+
var _a, _b;
|
|
400
|
+
if (result)
|
|
401
|
+
(_a = eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onEmailVerificationSuccess) === null || _a === void 0 ? void 0 : _a.call(eventsCallbacks, email);
|
|
402
|
+
else
|
|
403
|
+
(_b = eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onEmailVerificationFailure) === null || _b === void 0 ? void 0 : _b.call(eventsCallbacks, email);
|
|
404
|
+
};
|
|
405
|
+
dynamicEvents.on('emailVerificationResult', emailCallback);
|
|
406
|
+
return () => {
|
|
407
|
+
dynamicEvents.off('emailVerificationResult', emailCallback);
|
|
408
|
+
};
|
|
409
|
+
}, [eventsCallbacks]);
|
|
405
410
|
const { setCallback } = useCustomerCallbacks.useCustomerCallbacks({
|
|
406
411
|
authMode,
|
|
407
412
|
callbacks: {
|
|
408
413
|
onAuthSuccess: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onAuthSuccess,
|
|
409
414
|
onBeforeConnectSuccessConfirmation: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onBeforeConnectSuccessConfirmation,
|
|
410
415
|
onConnect: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onConnect,
|
|
411
|
-
onEmailVerificationFailure,
|
|
412
|
-
onEmailVerificationSuccess,
|
|
413
416
|
onEmbeddedWalletCreated: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onEmbeddedWalletCreated,
|
|
414
417
|
onLinkSuccess: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onLinkSuccess,
|
|
415
418
|
onUserProfileUpdate: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onUserProfileUpdate,
|
|
@@ -53,6 +53,7 @@ import '../../components/Alert/Alert.js';
|
|
|
53
53
|
import '../../components/Popper/Popper/Popper.js';
|
|
54
54
|
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
55
55
|
import 'formik';
|
|
56
|
+
import 'i18next';
|
|
56
57
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
57
58
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
58
59
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -76,7 +77,6 @@ import { DynamicBridgeWidgetContextProvider } from '../../widgets/DynamicBridgeW
|
|
|
76
77
|
import { DynamicWidgetContextProvider } from '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
77
78
|
import '../../widgets/DynamicWidget/components/DynamicWidgetCard/DynamicWidgetCard.js';
|
|
78
79
|
import '../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
79
|
-
import 'i18next';
|
|
80
80
|
import '../FooterAnimationContext/index.js';
|
|
81
81
|
import '../SocialRedirectContext/SocialRedirectContext.js';
|
|
82
82
|
import { QrCodeContextProvider } from '../QrCodeContext/QrCodeContext.js';
|
|
@@ -388,24 +388,27 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
|
|
|
388
388
|
initExpirationTime(handleLogOut);
|
|
389
389
|
}, [handleLogOut]);
|
|
390
390
|
useCustomerAuthFlowCallbacks({ eventsCallbacks, showAuthFlow });
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
391
|
+
// "useTieCallbacksToEvents"
|
|
392
|
+
useEffect(() => {
|
|
393
|
+
const dynamicEvents = internalEventsRef.current;
|
|
394
|
+
const emailCallback = (result, email) => {
|
|
395
|
+
var _a, _b;
|
|
396
|
+
if (result)
|
|
397
|
+
(_a = eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onEmailVerificationSuccess) === null || _a === void 0 ? void 0 : _a.call(eventsCallbacks, email);
|
|
398
|
+
else
|
|
399
|
+
(_b = eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onEmailVerificationFailure) === null || _b === void 0 ? void 0 : _b.call(eventsCallbacks, email);
|
|
400
|
+
};
|
|
401
|
+
dynamicEvents.on('emailVerificationResult', emailCallback);
|
|
402
|
+
return () => {
|
|
403
|
+
dynamicEvents.off('emailVerificationResult', emailCallback);
|
|
404
|
+
};
|
|
405
|
+
}, [eventsCallbacks]);
|
|
401
406
|
const { setCallback } = useCustomerCallbacks({
|
|
402
407
|
authMode,
|
|
403
408
|
callbacks: {
|
|
404
409
|
onAuthSuccess: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onAuthSuccess,
|
|
405
410
|
onBeforeConnectSuccessConfirmation: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onBeforeConnectSuccessConfirmation,
|
|
406
411
|
onConnect: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onConnect,
|
|
407
|
-
onEmailVerificationFailure,
|
|
408
|
-
onEmailVerificationSuccess,
|
|
409
412
|
onEmbeddedWalletCreated: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onEmbeddedWalletCreated,
|
|
410
413
|
onLinkSuccess: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onLinkSuccess,
|
|
411
414
|
onUserProfileUpdate: eventsCallbacks === null || eventsCallbacks === void 0 ? void 0 : eventsCallbacks.onUserProfileUpdate,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { JwtVerifiedCredential } from '@dynamic-labs/sdk-api/src/models/JwtVerifiedCredential';
|
|
2
2
|
import { WalletConnectorCore } from '@dynamic-labs/wallet-connector-core';
|
|
3
3
|
import { WalletConnector } from '../../../..';
|
|
4
|
-
import { AuthModeType, OnAuthSuccess, OnBeforeConnectSuccessConfirmation, onConnect,
|
|
4
|
+
import { AuthModeType, OnAuthSuccess, OnBeforeConnectSuccessConfirmation, onConnect, OnEmbeddedWalletCreated, OnUserProfileUpdate, UserProfile, Wallet } from '../../../shared/types';
|
|
5
5
|
import { IDynamicContext } from '../types';
|
|
6
|
-
export type Callback = 'authSuccess' | 'linkSuccess' | '
|
|
6
|
+
export type Callback = 'authSuccess' | 'linkSuccess' | 'userProfileUpdate' | 'connectSuccess' | 'onBeforeConnectSuccessConfirmation' | 'embeddedWalletCreated';
|
|
7
7
|
export type CallbackParams = {
|
|
8
|
-
/** For
|
|
8
|
+
/** For embedded wallet events */
|
|
9
9
|
email?: string;
|
|
10
10
|
verifiedCredential?: JwtVerifiedCredential;
|
|
11
11
|
/** Used to indicate which wallet connector the callback refers to (ex onLinkSuccess) */
|
|
@@ -15,8 +15,6 @@ export type UseCustomerCallbacksArgs = {
|
|
|
15
15
|
authMode: AuthModeType;
|
|
16
16
|
callbacks: {
|
|
17
17
|
onAuthSuccess?: OnAuthSuccess;
|
|
18
|
-
onEmailVerificationSuccess?: OnEmailVerificationSuccess;
|
|
19
|
-
onEmailVerificationFailure?: OnEmailVerificationFailure;
|
|
20
18
|
onConnect?: onConnect;
|
|
21
19
|
onBeforeConnectSuccessConfirmation?: OnBeforeConnectSuccessConfirmation;
|
|
22
20
|
onLinkSuccess?: OnAuthSuccess;
|
package/src/lib/context/DynamicContext/useCustomerCallbacks/useCustomerAuthFlowCallbacks.cjs
CHANGED
|
@@ -38,6 +38,7 @@ require('../../../components/Popper/Popper/Popper.cjs');
|
|
|
38
38
|
require('../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
39
39
|
require('formik');
|
|
40
40
|
require('yup');
|
|
41
|
+
require('i18next');
|
|
41
42
|
require('../../../components/InlineWidget/InlineWidget.cjs');
|
|
42
43
|
require('../../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
43
44
|
require('../../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -50,7 +51,6 @@ require('../../CaptchaContext/CaptchaContext.cjs');
|
|
|
50
51
|
require('../../EmailVerificationContext/EmailVerificationContext.cjs');
|
|
51
52
|
require('qrcode');
|
|
52
53
|
require('../../LoadingContext/LoadingContext.cjs');
|
|
53
|
-
require('i18next');
|
|
54
54
|
require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
55
55
|
require('../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
56
56
|
require('@dynamic-labs/types');
|
|
@@ -34,6 +34,7 @@ import '../../../components/Popper/Popper/Popper.js';
|
|
|
34
34
|
import '../../../components/Popper/PopperContext/PopperContext.js';
|
|
35
35
|
import 'formik';
|
|
36
36
|
import 'yup';
|
|
37
|
+
import 'i18next';
|
|
37
38
|
import '../../../components/InlineWidget/InlineWidget.js';
|
|
38
39
|
import '../../../components/MenuList/Dropdown/Dropdown.js';
|
|
39
40
|
import '../../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -46,7 +47,6 @@ import '../../CaptchaContext/CaptchaContext.js';
|
|
|
46
47
|
import '../../EmailVerificationContext/EmailVerificationContext.js';
|
|
47
48
|
import 'qrcode';
|
|
48
49
|
import '../../LoadingContext/LoadingContext.js';
|
|
49
|
-
import 'i18next';
|
|
50
50
|
import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
51
51
|
import '../../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
52
52
|
import '@dynamic-labs/types';
|
|
@@ -19,7 +19,7 @@ require('@dynamic-labs/multi-wallet');
|
|
|
19
19
|
var getAuthToken = require('../../../utils/functions/getAuthToken/getAuthToken.cjs');
|
|
20
20
|
var isConnectOnly = require('../../../utils/hooks/authenticationHooks/helpers/isConnectOnly.cjs');
|
|
21
21
|
|
|
22
|
-
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnect,
|
|
22
|
+
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnect, onEmbeddedWalletCreated, }, handleLogOut, primaryWallet, selectedWalletConnector, user, isAuthenticated, authMode, setIsVerificationInProgress, }) => {
|
|
23
23
|
const [callbackQueue, setCallbackQueue] = React.useState([]);
|
|
24
24
|
const isConnectOnlyAndCallbackIsConnectSuccess = React.useCallback((next) => isConnectOnly.isConnectOnly(user, authMode) &&
|
|
25
25
|
Boolean(primaryWallet) &&
|
|
@@ -53,7 +53,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
53
53
|
setIsVerificationInProgress,
|
|
54
54
|
]);
|
|
55
55
|
const handleNextCallback = React.useCallback((next, authToken, user) => {
|
|
56
|
-
var _a, _b
|
|
56
|
+
var _a, _b;
|
|
57
57
|
switch (next === null || next === void 0 ? void 0 : next.callback) {
|
|
58
58
|
case 'authSuccess': {
|
|
59
59
|
try {
|
|
@@ -72,24 +72,6 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
72
72
|
}
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
|
-
case 'emailVerificationFailure': {
|
|
76
|
-
try {
|
|
77
|
-
onEmailVerificationFailure === null || onEmailVerificationFailure === void 0 ? void 0 : onEmailVerificationFailure((_b = (_a = next.params) === null || _a === void 0 ? void 0 : _a.email) !== null && _b !== void 0 ? _b : '');
|
|
78
|
-
}
|
|
79
|
-
catch (e) {
|
|
80
|
-
logger.logger.error('Error calling onEmailVerificationFailure: ', e);
|
|
81
|
-
}
|
|
82
|
-
break;
|
|
83
|
-
}
|
|
84
|
-
case 'emailVerificationSuccess': {
|
|
85
|
-
try {
|
|
86
|
-
onEmailVerificationSuccess === null || onEmailVerificationSuccess === void 0 ? void 0 : onEmailVerificationSuccess((_d = (_c = next.params) === null || _c === void 0 ? void 0 : _c.email) !== null && _d !== void 0 ? _d : '');
|
|
87
|
-
}
|
|
88
|
-
catch (e) {
|
|
89
|
-
logger.logger.error('Error calling onEmailVerificationSuccess: ', e);
|
|
90
|
-
}
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
75
|
case 'linkSuccess': {
|
|
94
76
|
try {
|
|
95
77
|
onLinkSuccess === null || onLinkSuccess === void 0 ? void 0 : onLinkSuccess({
|
|
@@ -98,7 +80,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
98
80
|
isAuthenticated,
|
|
99
81
|
primaryWallet,
|
|
100
82
|
user,
|
|
101
|
-
walletConnector: (
|
|
83
|
+
walletConnector: (_a = next.params) === null || _a === void 0 ? void 0 : _a.walletConnector,
|
|
102
84
|
});
|
|
103
85
|
}
|
|
104
86
|
catch (e) {
|
|
@@ -117,7 +99,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
117
99
|
}
|
|
118
100
|
case 'embeddedWalletCreated': {
|
|
119
101
|
try {
|
|
120
|
-
onEmbeddedWalletCreated === null || onEmbeddedWalletCreated === void 0 ? void 0 : onEmbeddedWalletCreated((
|
|
102
|
+
onEmbeddedWalletCreated === null || onEmbeddedWalletCreated === void 0 ? void 0 : onEmbeddedWalletCreated((_b = next.params) === null || _b === void 0 ? void 0 : _b.verifiedCredential);
|
|
121
103
|
}
|
|
122
104
|
catch (e) {
|
|
123
105
|
logger.logger.error('Error calling onEmbeddedWalletCreated: ', e);
|
|
@@ -128,8 +110,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
128
110
|
handleLogOut,
|
|
129
111
|
isAuthenticated,
|
|
130
112
|
onAuthSuccess,
|
|
131
|
-
|
|
132
|
-
onEmailVerificationSuccess,
|
|
113
|
+
onEmbeddedWalletCreated,
|
|
133
114
|
onLinkSuccess,
|
|
134
115
|
onUserProfileUpdate,
|
|
135
116
|
primaryWallet,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SetCallbackType, UseCustomerCallbacksArgs } from './types';
|
|
2
|
-
export declare const useCustomerCallbacks: ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnect,
|
|
2
|
+
export declare const useCustomerCallbacks: ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnect, onEmbeddedWalletCreated, }, handleLogOut, primaryWallet, selectedWalletConnector, user, isAuthenticated, authMode, setIsVerificationInProgress, }: UseCustomerCallbacksArgs) => {
|
|
3
3
|
setCallback: SetCallbackType;
|
|
4
4
|
};
|
|
@@ -15,7 +15,7 @@ import '@dynamic-labs/multi-wallet';
|
|
|
15
15
|
import { getAuthToken } from '../../../utils/functions/getAuthToken/getAuthToken.js';
|
|
16
16
|
import { isConnectOnly } from '../../../utils/hooks/authenticationHooks/helpers/isConnectOnly.js';
|
|
17
17
|
|
|
18
|
-
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnect,
|
|
18
|
+
const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUserProfileUpdate, onConnect, onEmbeddedWalletCreated, }, handleLogOut, primaryWallet, selectedWalletConnector, user, isAuthenticated, authMode, setIsVerificationInProgress, }) => {
|
|
19
19
|
const [callbackQueue, setCallbackQueue] = useState([]);
|
|
20
20
|
const isConnectOnlyAndCallbackIsConnectSuccess = useCallback((next) => isConnectOnly(user, authMode) &&
|
|
21
21
|
Boolean(primaryWallet) &&
|
|
@@ -49,7 +49,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
49
49
|
setIsVerificationInProgress,
|
|
50
50
|
]);
|
|
51
51
|
const handleNextCallback = useCallback((next, authToken, user) => {
|
|
52
|
-
var _a, _b
|
|
52
|
+
var _a, _b;
|
|
53
53
|
switch (next === null || next === void 0 ? void 0 : next.callback) {
|
|
54
54
|
case 'authSuccess': {
|
|
55
55
|
try {
|
|
@@ -68,24 +68,6 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
68
68
|
}
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
71
|
-
case 'emailVerificationFailure': {
|
|
72
|
-
try {
|
|
73
|
-
onEmailVerificationFailure === null || onEmailVerificationFailure === void 0 ? void 0 : onEmailVerificationFailure((_b = (_a = next.params) === null || _a === void 0 ? void 0 : _a.email) !== null && _b !== void 0 ? _b : '');
|
|
74
|
-
}
|
|
75
|
-
catch (e) {
|
|
76
|
-
logger.error('Error calling onEmailVerificationFailure: ', e);
|
|
77
|
-
}
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
case 'emailVerificationSuccess': {
|
|
81
|
-
try {
|
|
82
|
-
onEmailVerificationSuccess === null || onEmailVerificationSuccess === void 0 ? void 0 : onEmailVerificationSuccess((_d = (_c = next.params) === null || _c === void 0 ? void 0 : _c.email) !== null && _d !== void 0 ? _d : '');
|
|
83
|
-
}
|
|
84
|
-
catch (e) {
|
|
85
|
-
logger.error('Error calling onEmailVerificationSuccess: ', e);
|
|
86
|
-
}
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
71
|
case 'linkSuccess': {
|
|
90
72
|
try {
|
|
91
73
|
onLinkSuccess === null || onLinkSuccess === void 0 ? void 0 : onLinkSuccess({
|
|
@@ -94,7 +76,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
94
76
|
isAuthenticated,
|
|
95
77
|
primaryWallet,
|
|
96
78
|
user,
|
|
97
|
-
walletConnector: (
|
|
79
|
+
walletConnector: (_a = next.params) === null || _a === void 0 ? void 0 : _a.walletConnector,
|
|
98
80
|
});
|
|
99
81
|
}
|
|
100
82
|
catch (e) {
|
|
@@ -113,7 +95,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
113
95
|
}
|
|
114
96
|
case 'embeddedWalletCreated': {
|
|
115
97
|
try {
|
|
116
|
-
onEmbeddedWalletCreated === null || onEmbeddedWalletCreated === void 0 ? void 0 : onEmbeddedWalletCreated((
|
|
98
|
+
onEmbeddedWalletCreated === null || onEmbeddedWalletCreated === void 0 ? void 0 : onEmbeddedWalletCreated((_b = next.params) === null || _b === void 0 ? void 0 : _b.verifiedCredential);
|
|
117
99
|
}
|
|
118
100
|
catch (e) {
|
|
119
101
|
logger.error('Error calling onEmbeddedWalletCreated: ', e);
|
|
@@ -124,8 +106,7 @@ const useCustomerCallbacks = ({ callbacks: { onAuthSuccess, onLinkSuccess, onUse
|
|
|
124
106
|
handleLogOut,
|
|
125
107
|
isAuthenticated,
|
|
126
108
|
onAuthSuccess,
|
|
127
|
-
|
|
128
|
-
onEmailVerificationSuccess,
|
|
109
|
+
onEmbeddedWalletCreated,
|
|
129
110
|
onLinkSuccess,
|
|
130
111
|
onUserProfileUpdate,
|
|
131
112
|
primaryWallet,
|
|
@@ -44,6 +44,7 @@ require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs'
|
|
|
44
44
|
require('../UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
45
45
|
require('../../components/Popper/Popper/Popper.cjs');
|
|
46
46
|
var PopperContext = require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
47
|
+
require('i18next');
|
|
47
48
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
48
49
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
49
50
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -40,6 +40,7 @@ import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
|
40
40
|
import '../UserFieldEditorContext/UserFieldEditorContext.js';
|
|
41
41
|
import '../../components/Popper/Popper/Popper.js';
|
|
42
42
|
import { PopperProvider } from '../../components/Popper/PopperContext/PopperContext.js';
|
|
43
|
+
import 'i18next';
|
|
43
44
|
import '../../components/InlineWidget/InlineWidget.js';
|
|
44
45
|
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
45
46
|
import '../../components/OverlayCard/OverlayCard.context.js';
|
|
@@ -37,6 +37,7 @@ require('../../components/Popper/Popper/Popper.cjs');
|
|
|
37
37
|
require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
38
38
|
require('formik');
|
|
39
39
|
require('yup');
|
|
40
|
+
require('i18next');
|
|
40
41
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
41
42
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
42
43
|
require('../../components/OverlayCard/OverlayCard.context.cjs');
|
|
@@ -48,7 +49,6 @@ require('../CaptchaContext/CaptchaContext.cjs');
|
|
|
48
49
|
require('../EmailVerificationContext/EmailVerificationContext.cjs');
|
|
49
50
|
require('qrcode');
|
|
50
51
|
require('../LoadingContext/LoadingContext.cjs');
|
|
51
|
-
require('i18next');
|
|
52
52
|
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
53
53
|
require('../../components/UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
54
54
|
require('@dynamic-labs/types');
|