@dynamic-labs/sdk-react-core 2.1.0-alpha.30 → 2.1.0-alpha.32
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 +26 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +13 -13
- package/src/lib/components/SyncAuthFlow/SyncAuthFlow.cjs +2 -1
- package/src/lib/components/SyncAuthFlow/SyncAuthFlow.js +2 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +6 -9
- package/src/lib/context/DynamicContext/DynamicContext.d.ts +1 -0
- package/src/lib/context/DynamicContext/DynamicContext.js +6 -9
- package/src/lib/context/DynamicContext/types/index.d.ts +2 -3
- package/src/lib/context/PasskeyContext/PasskeyContext.cjs +3 -5
- package/src/lib/context/PasskeyContext/PasskeyContext.js +3 -5
- package/src/lib/shared/types/dynamicHandlers.d.ts +13 -0
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSyncOnboardingFlow/index.d.ts +1 -0
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.cjs +190 -0
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.d.ts +1 -0
- package/src/lib/utils/hooks/useSyncOnboardingFlow/useSyncOnboardingFlow.js +186 -0
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.cjs +10 -31
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.d.ts +5 -1
- package/src/lib/utils/hooks/useUserAuth/useUserAuth.js +10 -31
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.cjs +9 -2
- package/src/lib/views/EmbeddedReveal/utils/turnkeyExport/turnkeyExport.js +9 -2
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +4 -6
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +4 -6
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedWidget.cjs +3 -85
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedWidget.js +3 -85
- package/src/lib/widgets/DynamicWidget/DynamicWidget.cjs +1 -7
- package/src/lib/widgets/DynamicWidget/DynamicWidget.js +2 -8
|
@@ -1,92 +1,10 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import '../../context/DynamicContext/DynamicContext.js';
|
|
5
|
-
import '@dynamic-labs/sdk-api-core';
|
|
6
|
-
import '../../shared/logger.js';
|
|
7
|
-
import '@dynamic-labs/iconic';
|
|
8
|
-
import '@dynamic-labs/wallet-connector-core';
|
|
9
|
-
import '../../context/ViewContext/ViewContext.js';
|
|
10
|
-
import '@dynamic-labs/wallet-book';
|
|
11
|
-
import '../../utils/constants/colors.js';
|
|
12
|
-
import '../../utils/constants/values.js';
|
|
13
|
-
import '../../shared/utils/classes/storage/localStorage.js';
|
|
14
|
-
import '@dynamic-labs/utils';
|
|
15
|
-
import '../../shared/consts/index.js';
|
|
16
|
-
import '../../events/dynamicEvents.js';
|
|
17
|
-
import '../../../../_virtual/_tslib.js';
|
|
18
|
-
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
19
|
-
import '../../context/ErrorContext/ErrorContext.js';
|
|
20
|
-
import '@dynamic-labs/multi-wallet';
|
|
21
|
-
import 'react-international-phone';
|
|
22
|
-
import 'viem';
|
|
23
|
-
import 'viem/chains';
|
|
24
|
-
import '../../config/ApiEndpoint.js';
|
|
25
|
-
import '@dynamic-labs/store';
|
|
26
|
-
import '../../locale/locale.js';
|
|
27
|
-
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
28
|
-
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
29
|
-
import '../../context/UserWalletsContext/UserWalletsContext.js';
|
|
30
|
-
import '../../context/VerificationContext/VerificationContext.js';
|
|
31
|
-
import 'react-dom';
|
|
32
|
-
import '../../context/WalletContext/WalletContext.js';
|
|
33
|
-
import '../../context/ThemeContext/ThemeContext.js';
|
|
34
|
-
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/userFieldsSchema.js';
|
|
35
|
-
import '@dynamic-labs/types';
|
|
36
|
-
import '../../context/LoadingContext/LoadingContext.js';
|
|
37
|
-
import 'yup';
|
|
38
|
-
import '../../context/MockContext/MockContext.js';
|
|
39
|
-
import '../../views/CollectUserDataView/useFields.js';
|
|
40
|
-
import '../../context/FieldsStateContext/FieldsStateContext.js';
|
|
41
|
-
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
42
|
-
import '@dynamic-labs/rpc-providers';
|
|
43
|
-
import 'react-i18next';
|
|
44
|
-
import '../../components/Alert/Alert.js';
|
|
45
|
-
import '../../components/ShadowDOM/ShadowDOM.js';
|
|
46
|
-
import '../../components/IconButton/IconButton.js';
|
|
47
|
-
import '../../components/InlineWidget/InlineWidget.js';
|
|
48
|
-
import '../../components/Input/Input.js';
|
|
49
|
-
import '../../components/IsBrowser/IsBrowser.js';
|
|
50
|
-
import '../../components/MenuList/Dropdown/Dropdown.js';
|
|
51
|
-
import '../../components/Transition/ZoomTransition/ZoomTransition.js';
|
|
52
|
-
import '../../components/Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
53
|
-
import '../../components/Transition/OpacityTransition/OpacityTransition.js';
|
|
54
|
-
import '../../components/OverlayCard/OverlayCardTarget/OverlayCardTarget.js';
|
|
55
|
-
import '../../components/PasskeyCreatedSuccessBanner/PasskeyCreatedSuccessBanner.js';
|
|
56
|
-
import '../../components/Popper/Popper/Popper.js';
|
|
57
|
-
import '../../components/Popper/PopperContext/PopperContext.js';
|
|
58
|
-
import 'react-focus-lock';
|
|
59
|
-
import 'qrcode';
|
|
60
|
-
import 'formik';
|
|
61
|
-
import '../../views/WalletList/WalletList.js';
|
|
62
|
-
import '../../context/SocialRedirectContext/SocialRedirectContext.js';
|
|
63
|
-
import '../DynamicBridgeWidget/views/WalletsView/components/SecondaryWallets/SecondaryWallets.js';
|
|
64
|
-
import '@hcaptcha/react-hcaptcha';
|
|
65
|
-
import '../../context/FooterAnimationContext/index.js';
|
|
66
|
-
import '../../views/LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSection.js';
|
|
67
|
-
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
68
|
-
import '../../context/MfaSettingsContext/MfaSettingsContext.js';
|
|
69
|
-
import '../../context/IpConfigurationContext/IpConfigurationContext.js';
|
|
70
|
-
import '../../context/PasskeyContext/PasskeyContext.js';
|
|
71
|
-
import '../DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
72
|
-
import '../DynamicWidget/context/DynamicWidgetContext.js';
|
|
73
|
-
import '../../views/TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
74
|
-
import '../DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
75
|
-
import { useInternalDynamicContext } from '../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
76
3
|
import { DynamicEmbeddedAuthFlow } from './DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js';
|
|
77
4
|
import { DynamicEmbeddedUserProfile } from './DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js';
|
|
78
5
|
|
|
79
|
-
const DynamicEmbeddedWidget = ({ background = 'none', className, style, }) =>
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
setDynamicWidgetHasLoaded(true);
|
|
83
|
-
return () => {
|
|
84
|
-
setDynamicWidgetHasLoaded(false);
|
|
85
|
-
};
|
|
86
|
-
}, [setDynamicWidgetHasLoaded]);
|
|
87
|
-
return (
|
|
88
|
-
// Only one of these 2 show at any given time, due these components' own definitions
|
|
89
|
-
jsxs(Fragment, { children: [jsx(DynamicEmbeddedAuthFlow, { background: background, className: className, style: style }), jsx(DynamicEmbeddedUserProfile, { background: background, className: className, style: style })] }));
|
|
90
|
-
};
|
|
6
|
+
const DynamicEmbeddedWidget = ({ background = 'none', className, style, }) => (
|
|
7
|
+
// Only one of these 2 show at any given time, due these components' own definitions
|
|
8
|
+
jsxs(Fragment, { children: [jsx(DynamicEmbeddedAuthFlow, { background: background, className: className, style: style }), jsx(DynamicEmbeddedUserProfile, { background: background, className: className, style: style })] }));
|
|
91
9
|
|
|
92
10
|
export { DynamicEmbeddedWidget };
|
|
@@ -84,7 +84,7 @@ var DynamicNav = require('./components/DynamicNav/DynamicNav.cjs');
|
|
|
84
84
|
var DynamicUserProfile = require('./components/DynamicUserProfile/DynamicUserProfile.cjs');
|
|
85
85
|
|
|
86
86
|
const DynamicWidget = ({ buttonContainerClassName = '', buttonClassName = '', innerButtonComponent, variant = 'modal', }) => {
|
|
87
|
-
const { showAuthFlow, setShowDynamicUserProfile
|
|
87
|
+
const { showAuthFlow, setShowDynamicUserProfile } = useInternalDynamicContext.useInternalDynamicContext();
|
|
88
88
|
const { widgetRef, inlineControlsRef } = DynamicWidgetContext.useWidgetContext();
|
|
89
89
|
const { t } = reactI18next.useTranslation();
|
|
90
90
|
if (!innerButtonComponent) {
|
|
@@ -101,12 +101,6 @@ const DynamicWidget = ({ buttonContainerClassName = '', buttonClassName = '', in
|
|
|
101
101
|
}, [inlineControlsRef, variant, showAuthFlow, setShowDynamicUserProfile]);
|
|
102
102
|
index.useOnClickOutside(widgetRef, closeOnOutsideClick);
|
|
103
103
|
const showDynamicConnectButton = !useIsLoggedIn.useIsLoggedIn();
|
|
104
|
-
React.useEffect(() => {
|
|
105
|
-
setDynamicWidgetHasLoaded(true);
|
|
106
|
-
return () => {
|
|
107
|
-
setDynamicWidgetHasLoaded(false);
|
|
108
|
-
};
|
|
109
|
-
}, [setDynamicWidgetHasLoaded]);
|
|
110
104
|
return (jsxRuntime.jsx(ShadowDOM.ShadowDOM, { className: 'dynamic-widget__container', id: 'dynamic-widget', children: showDynamicConnectButton ? (jsxRuntime.jsx(DynamicConnectButton.DynamicConnectButton, { buttonContainerClassName: buttonContainerClassName, buttonClassName: buttonClassName, copykey: 'dyn_widget.connect', children: innerButtonComponent })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(DynamicNav.DynamicNav, {}), jsxRuntime.jsx(DynamicUserProfile.DynamicUserProfile, { variant: variant })] })) }));
|
|
111
105
|
};
|
|
112
106
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { useCallback
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import '../../events/dynamicEvents.js';
|
|
6
6
|
import '../../../../_virtual/_tslib.js';
|
|
@@ -80,7 +80,7 @@ import { DynamicNav } from './components/DynamicNav/DynamicNav.js';
|
|
|
80
80
|
import { DynamicUserProfile } from './components/DynamicUserProfile/DynamicUserProfile.js';
|
|
81
81
|
|
|
82
82
|
const DynamicWidget = ({ buttonContainerClassName = '', buttonClassName = '', innerButtonComponent, variant = 'modal', }) => {
|
|
83
|
-
const { showAuthFlow, setShowDynamicUserProfile
|
|
83
|
+
const { showAuthFlow, setShowDynamicUserProfile } = useInternalDynamicContext();
|
|
84
84
|
const { widgetRef, inlineControlsRef } = useWidgetContext();
|
|
85
85
|
const { t } = useTranslation();
|
|
86
86
|
if (!innerButtonComponent) {
|
|
@@ -97,12 +97,6 @@ const DynamicWidget = ({ buttonContainerClassName = '', buttonClassName = '', in
|
|
|
97
97
|
}, [inlineControlsRef, variant, showAuthFlow, setShowDynamicUserProfile]);
|
|
98
98
|
useOnClickOutside(widgetRef, closeOnOutsideClick);
|
|
99
99
|
const showDynamicConnectButton = !useIsLoggedIn();
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
setDynamicWidgetHasLoaded(true);
|
|
102
|
-
return () => {
|
|
103
|
-
setDynamicWidgetHasLoaded(false);
|
|
104
|
-
};
|
|
105
|
-
}, [setDynamicWidgetHasLoaded]);
|
|
106
100
|
return (jsx(ShadowDOM, { className: 'dynamic-widget__container', id: 'dynamic-widget', children: showDynamicConnectButton ? (jsx(DynamicConnectButton, { buttonContainerClassName: buttonContainerClassName, buttonClassName: buttonClassName, copykey: 'dyn_widget.connect', children: innerButtonComponent })) : (jsxs(Fragment, { children: [jsx(DynamicNav, {}), jsx(DynamicUserProfile, { variant: variant })] })) }));
|
|
107
101
|
};
|
|
108
102
|
|