@dynamic-labs/sdk-react-core 2.0.6 → 2.0.8
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 +18 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +12 -12
- package/src/index.d.ts +1 -1
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.cjs +9 -1
- package/src/lib/context/DynamicContext/hooks/useTieCallbacksToEvents/useTieCallbacksToEvents.js +9 -1
- package/src/lib/context/LoadingContext/LoadingContext.cjs +1 -1
- package/src/lib/context/LoadingContext/LoadingContext.js +1 -1
- package/src/lib/data/api/user/user.cjs +3 -2
- package/src/lib/data/api/user/user.js +3 -2
- package/src/lib/events/auth.d.ts +25 -0
- package/src/lib/events/dynamicEvents.d.ts +8 -31
- package/src/lib/events/embeddedWallet.d.ts +14 -0
- package/src/lib/events/otp.d.ts +5 -0
- package/src/lib/events/passkey.d.ts +5 -0
- package/src/lib/events/social.d.ts +3 -0
- package/src/lib/events/ui.d.ts +10 -0
- package/src/lib/events/wallet.d.ts +7 -0
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +21 -5
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +21 -5
- package/src/lib/shared/types/dynamicEventsCallbacks.d.ts +12 -1
- package/src/lib/utils/hooks/events/useDynamicEvents/useDynamicEvents.d.ts +2 -2
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.cjs +27 -14
- package/src/lib/utils/hooks/useEmailProvider/useEmailProvider.js +27 -14
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.cjs +6 -6
- package/src/lib/utils/hooks/useSocialAccounts/useSocialAccounts.js +6 -6
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +35 -24
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.d.ts +1 -1
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +35 -24
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.cjs +1 -1
- package/src/lib/utils/hooks/useUserDataForm/useUserDataForm.js +1 -1
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.cjs +13 -2
- package/src/lib/utils/hooks/useVerifyWallet/useVerifyWallet.js +13 -2
- package/src/lib/views/EmailVerification/EmailVerification.cjs +2 -0
- package/src/lib/views/EmailVerification/EmailVerification.js +2 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.cjs +4 -0
- package/src/lib/views/EmailWalletOTPVerificationView/EmailWalletOTPVerificationView.js +4 -0
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.cjs +9 -1
- package/src/lib/views/LoginView/sections/PhoneNumberSignInSection/useSubmitPhoneNumber/useSubmitPhoneNumber.js +9 -1
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.cjs +5 -2
- package/src/lib/views/SmsVerification/useSmsVerification/useSmsVerification.js +5 -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/prompts/PendingConnectionModal/PendingConnectionModal.cjs +3 -3
- package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js +3 -3
|
@@ -97,13 +97,16 @@ const useSmsVerification = (type) => {
|
|
|
97
97
|
/** Whether verification was successfully performed */
|
|
98
98
|
const isValidatedRef = React.useRef(false);
|
|
99
99
|
useOnUnmount.useOnUnmount(() => {
|
|
100
|
-
|
|
100
|
+
const phone = retryData !== null && retryData !== void 0 ? retryData : {
|
|
101
101
|
dialCode: '',
|
|
102
102
|
iso2: '',
|
|
103
103
|
phone: '',
|
|
104
|
-
}
|
|
104
|
+
};
|
|
105
105
|
if (!retryData)
|
|
106
106
|
logger.logger.warn('WARNING: emitted smsVerificationResult with incomplete params because retryData was undefined');
|
|
107
|
+
dynamicEvents.dynamicEvents.emit('smsVerificationResult', isValidatedRef.current, phone);
|
|
108
|
+
if (!isValidatedRef.current)
|
|
109
|
+
dynamicEvents.dynamicEvents.emit('authFailure', { option: phone, type: 'sms' }, 'user-cancelled');
|
|
107
110
|
});
|
|
108
111
|
const retryOneTimePassword = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
109
112
|
setError(undefined);
|
|
@@ -93,13 +93,16 @@ const useSmsVerification = (type) => {
|
|
|
93
93
|
/** Whether verification was successfully performed */
|
|
94
94
|
const isValidatedRef = useRef(false);
|
|
95
95
|
useOnUnmount(() => {
|
|
96
|
-
|
|
96
|
+
const phone = retryData !== null && retryData !== void 0 ? retryData : {
|
|
97
97
|
dialCode: '',
|
|
98
98
|
iso2: '',
|
|
99
99
|
phone: '',
|
|
100
|
-
}
|
|
100
|
+
};
|
|
101
101
|
if (!retryData)
|
|
102
102
|
logger.warn('WARNING: emitted smsVerificationResult with incomplete params because retryData was undefined');
|
|
103
|
+
dynamicEvents.emit('smsVerificationResult', isValidatedRef.current, phone);
|
|
104
|
+
if (!isValidatedRef.current)
|
|
105
|
+
dynamicEvents.emit('authFailure', { option: phone, type: 'sms' }, 'user-cancelled');
|
|
103
106
|
});
|
|
104
107
|
const retryOneTimePassword = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
105
108
|
setError(undefined);
|
|
@@ -27,9 +27,9 @@ require('../../../locale/locale.cjs');
|
|
|
27
27
|
require('../../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
28
28
|
require('../../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
29
29
|
require('../../../context/UserWalletsContext/UserWalletsContext.cjs');
|
|
30
|
+
require('../../../events/dynamicEvents.cjs');
|
|
30
31
|
require('../../../context/VerificationContext/VerificationContext.cjs');
|
|
31
32
|
require('react-dom');
|
|
32
|
-
require('../../../events/dynamicEvents.cjs');
|
|
33
33
|
require('../../../context/WalletContext/WalletContext.cjs');
|
|
34
34
|
require('../../../context/ThemeContext/ThemeContext.cjs');
|
|
35
35
|
var useKYCFlag = require('../../../utils/hooks/useKYCFlag/useKYCFlag.cjs');
|
|
@@ -23,9 +23,9 @@ import '../../../locale/locale.js';
|
|
|
23
23
|
import '../../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
24
24
|
import '../../../context/AccountExistsContext/AccountExistsContext.js';
|
|
25
25
|
import '../../../context/UserWalletsContext/UserWalletsContext.js';
|
|
26
|
+
import '../../../events/dynamicEvents.js';
|
|
26
27
|
import '../../../context/VerificationContext/VerificationContext.js';
|
|
27
28
|
import 'react-dom';
|
|
28
|
-
import '../../../events/dynamicEvents.js';
|
|
29
29
|
import '../../../context/WalletContext/WalletContext.js';
|
|
30
30
|
import '../../../context/ThemeContext/ThemeContext.js';
|
|
31
31
|
import { useKYCFlag } from '../../../utils/hooks/useKYCFlag/useKYCFlag.js';
|
package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.cjs
CHANGED
|
@@ -53,8 +53,7 @@ require('../../../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.
|
|
|
53
53
|
require('../../../../context/SocialRedirectContext/SocialRedirectContext.cjs');
|
|
54
54
|
require('../../../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
55
55
|
require('../../components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
56
|
-
var
|
|
57
|
-
require('react-focus-lock');
|
|
56
|
+
var PromptModal = require('../../components/PromptModal/PromptModal.cjs');
|
|
58
57
|
var WidgetPortal = require('../../components/WidgetPortal/WidgetPortal.cjs');
|
|
59
58
|
var useCloseMultiWalletPrompt = require('../../hooks/useCloseMultiWalletPrompt/useCloseMultiWalletPrompt.cjs');
|
|
60
59
|
var DefaultPromptModal = require('../DefaultPromptModal/DefaultPromptModal.cjs');
|
|
@@ -74,6 +73,7 @@ require('../../../../components/InlineWidget/InlineWidget.cjs');
|
|
|
74
73
|
require('../../../../components/IsBrowser/IsBrowser.cjs');
|
|
75
74
|
require('../../../../components/Popper/Popper/Popper.cjs');
|
|
76
75
|
require('../../../../components/Popper/PopperContext/PopperContext.cjs');
|
|
76
|
+
require('react-focus-lock');
|
|
77
77
|
require('qrcode');
|
|
78
78
|
require('../../../../views/WalletList/WalletList.cjs');
|
|
79
79
|
require('../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.cjs');
|
|
@@ -97,7 +97,7 @@ const PendingConnectionContent = () => {
|
|
|
97
97
|
return (jsxRuntime.jsx(DefaultPromptModal.DefaultPromptLayout, { dataTestId: 'pending-connection-modal', icon: jsxRuntime.jsx(AuthProviderIcon.AuthProviderIcon // eslint-disable-line
|
|
98
98
|
, { jwt: authToken, wallet: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet }), title: title, children: jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: description }) }));
|
|
99
99
|
};
|
|
100
|
-
const PendingConnectionModal = () => (jsxRuntime.jsx(
|
|
100
|
+
const PendingConnectionModal = () => (jsxRuntime.jsx(PromptModal.PromptModal, { onClose: useCloseMultiWalletPrompt.useCloseMultiWalletPrompt, children: jsxRuntime.jsx(PendingConnectionContent, {}) }));
|
|
101
101
|
const PendingConnectionWidgetPortal = () => (jsxRuntime.jsx(WidgetPortal.WidgetPortal, { onClose: useCloseMultiWalletPrompt.useCloseMultiWalletPrompt(), children: jsxRuntime.jsx(PendingConnectionContent, {}) }));
|
|
102
102
|
|
|
103
103
|
exports.PendingConnectionModal = PendingConnectionModal;
|
package/src/lib/widgets/DynamicWidget/prompts/PendingConnectionModal/PendingConnectionModal.js
CHANGED
|
@@ -49,8 +49,7 @@ import '../../../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.j
|
|
|
49
49
|
import '../../../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
50
50
|
import '../../../../context/WalletGroupContext/WalletGroupContext.js';
|
|
51
51
|
import '../../components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
52
|
-
import {
|
|
53
|
-
import 'react-focus-lock';
|
|
52
|
+
import { PromptModal } from '../../components/PromptModal/PromptModal.js';
|
|
54
53
|
import { WidgetPortal } from '../../components/WidgetPortal/WidgetPortal.js';
|
|
55
54
|
import { useCloseMultiWalletPrompt } from '../../hooks/useCloseMultiWalletPrompt/useCloseMultiWalletPrompt.js';
|
|
56
55
|
import { DefaultPromptLayout } from '../DefaultPromptModal/DefaultPromptModal.js';
|
|
@@ -70,6 +69,7 @@ import '../../../../components/InlineWidget/InlineWidget.js';
|
|
|
70
69
|
import '../../../../components/IsBrowser/IsBrowser.js';
|
|
71
70
|
import '../../../../components/Popper/Popper/Popper.js';
|
|
72
71
|
import '../../../../components/Popper/PopperContext/PopperContext.js';
|
|
72
|
+
import 'react-focus-lock';
|
|
73
73
|
import 'qrcode';
|
|
74
74
|
import '../../../../views/WalletList/WalletList.js';
|
|
75
75
|
import '../../../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
@@ -93,7 +93,7 @@ const PendingConnectionContent = () => {
|
|
|
93
93
|
return (jsx(DefaultPromptLayout, { dataTestId: 'pending-connection-modal', icon: jsx(AuthProviderIcon // eslint-disable-line
|
|
94
94
|
, { jwt: authToken, wallet: selectedWalletWithAction === null || selectedWalletWithAction === void 0 ? void 0 : selectedWalletWithAction.wallet }), title: title, children: jsx(Typography, { variant: 'body_normal', color: 'secondary', weight: 'regular', "data-testid": 'content', children: description }) }));
|
|
95
95
|
};
|
|
96
|
-
const PendingConnectionModal = () => (jsx(
|
|
96
|
+
const PendingConnectionModal = () => (jsx(PromptModal, { onClose: useCloseMultiWalletPrompt, children: jsx(PendingConnectionContent, {}) }));
|
|
97
97
|
const PendingConnectionWidgetPortal = () => (jsx(WidgetPortal, { onClose: useCloseMultiWalletPrompt(), children: jsx(PendingConnectionContent, {}) }));
|
|
98
98
|
|
|
99
99
|
export { PendingConnectionModal, PendingConnectionWidgetPortal };
|