@dynamic-labs/sdk-react-core 0.19.0-alpha.26 → 0.19.0-alpha.28
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 +31 -0
- package/package.cjs +2 -2
- package/package.js +2 -2
- package/package.json +10 -10
- package/src/lib/components/Accordion/components/VerticalAccordion/VerticalAccordion.cjs +1 -1
- package/src/lib/components/Accordion/components/VerticalAccordion/VerticalAccordion.js +1 -1
- package/src/lib/components/Accordion/components/VerticalAccordion/VerticalAccordion.types.d.ts +2 -4
- package/src/lib/components/Button/Button.cjs +1 -0
- package/src/lib/components/Button/Button.d.ts +1 -1
- package/src/lib/components/Button/Button.js +1 -0
- package/src/lib/components/LogoutButton/LogoutButton.cjs +1 -3
- package/src/lib/components/LogoutButton/LogoutButton.js +1 -3
- package/src/lib/components/NetworkPicker/NetworkPicker.cjs +5 -2
- package/src/lib/components/NetworkPicker/NetworkPicker.js +5 -2
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.cjs +1 -1
- package/src/lib/components/SendBalancePageLayout/SendBalancePageLayout.js +2 -2
- package/src/lib/components/Typography/Typography.cjs +1 -0
- package/src/lib/components/Typography/Typography.js +1 -0
- package/src/lib/components/Typography/Typography.types.d.ts +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.cjs +1 -1
- package/src/lib/components/UserProfile/parts/UserProfileField/UserProfileField.js +1 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +5 -3
- package/src/lib/context/DynamicContext/DynamicContext.js +5 -3
- package/src/lib/context/DynamicContext/internalEvents/internalEvents.d.ts +0 -1
- package/src/lib/context/DynamicContext/useDynamicContext.cjs +1 -2
- package/src/lib/context/DynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext.js +1 -2
- package/src/lib/context/ViewContext/ViewContext.cjs +14 -1
- package/src/lib/context/ViewContext/ViewContext.d.ts +3 -1
- package/src/lib/context/ViewContext/ViewContext.js +15 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.cjs +2 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.d.ts +2 -2
- package/src/lib/layout/DynamicAuthLayout/DynamicAuthLayout.js +2 -2
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.cjs +3 -2
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.d.ts +2 -3
- package/src/lib/layout/DynamicUserProfileLayout/DynamicUserProfileLayout.js +4 -3
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +1 -7
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +2 -8
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +2 -6
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.d.ts +1 -2
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +2 -6
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.cjs +15 -5
- package/src/lib/utils/hooks/useSocialAuth/useSocialAuth.js +15 -5
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +4 -2
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.d.ts +2 -1
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +4 -2
- package/src/lib/utils/types/ClassStyleProps.d.ts +5 -0
- package/src/lib/utils/types/index.d.ts +1 -0
- package/src/lib/views/LoginView/LoginView.cjs +1 -1
- package/src/lib/views/LoginView/LoginView.js +1 -1
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.cjs +7 -2
- package/src/lib/views/LoginView/sections/EmailSignInSection/LoginEmailForm.js +8 -3
- package/src/lib/views/PendingSignatureView/PendingSignatureView.cjs +1 -1
- package/src/lib/views/PendingSignatureView/PendingSignatureView.js +1 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.cjs +7 -1
- package/src/lib/views/SendBalanceView/SendBalanceView.js +7 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.cjs +2 -2
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.d.ts +4 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedAuthFlow/DynamicEmbeddedAuthFlow.js +2 -2
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.cjs +2 -2
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.d.ts +4 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedUserProfile/DynamicEmbeddedUserProfile.js +2 -2
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedWidget.cjs +2 -2
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedWidget.d.ts +4 -1
- package/src/lib/widgets/DynamicEmbeddedWidget/DynamicEmbeddedWidget.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/ActiveWalletInformation/ActiveWalletInformation.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicUserProfile/DynamicUserProfile.js +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.cjs +1 -1
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetWalletHeader/DynamicWidgetWalletHeader.js +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.cjs +2 -2
- package/src/lib/widgets/DynamicWidget/components/DynamicWidgetWallets/DynamicWidgetWallets.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
|
|
2
|
+
## [0.19.0-alpha.28](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.27...v0.19.0-alpha.28) (2023-10-26)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* do not pass TransactionType for zksync transactions in Sendbalance view due to RPC errors ([#3745](https://github.com/dynamic-labs/DynamicAuth/issues/3745)) ([27f8aa1](https://github.com/dynamic-labs/DynamicAuth/commit/27f8aa1c7c790fa24a5e6b5e4400bd9415b3c3ce))
|
|
8
|
+
|
|
9
|
+
## [0.19.0-alpha.27](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.26...v0.19.0-alpha.27) (2023-10-26)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### ⚠ BREAKING CHANGES
|
|
13
|
+
|
|
14
|
+
* **useDynamicContext:** make internalEvents private (#3709)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* add option to show continue button instead of inline submit ([#3720](https://github.com/dynamic-labs/DynamicAuth/issues/3720)) ([35e6172](https://github.com/dynamic-labs/DynamicAuth/commit/35e6172ebd692c9e5c0a96cbf97b4a3b8cea428b))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **demo:** login view sections ([#3737](https://github.com/dynamic-labs/DynamicAuth/issues/3737)) ([7387cf7](https://github.com/dynamic-labs/DynamicAuth/commit/7387cf7d0834f349e11be55a7271a67e2cc3ba83))
|
|
24
|
+
* don't set secondaryWallets if not on multi-wallet or bridge ([#3728](https://github.com/dynamic-labs/DynamicAuth/issues/3728)) ([dcfa845](https://github.com/dynamic-labs/DynamicAuth/commit/dcfa8452304f485ed5fa64e4b82687bee63a6af4))
|
|
25
|
+
* **network-picker:** update the networks when connector changes ([#3725](https://github.com/dynamic-labs/DynamicAuth/issues/3725)) ([786a33d](https://github.com/dynamic-labs/DynamicAuth/commit/786a33dc9172a9f0fca0604bb84d2fd3cad064f2))
|
|
26
|
+
* reset view on logout ([#3717](https://github.com/dynamic-labs/DynamicAuth/issues/3717)) ([78df3cf](https://github.com/dynamic-labs/DynamicAuth/commit/78df3cf642440d30ecfc51990020eaf3cbb20de9))
|
|
27
|
+
* state check for twitter happens in backend ([#3740](https://github.com/dynamic-labs/DynamicAuth/issues/3740)) ([95c3353](https://github.com/dynamic-labs/DynamicAuth/commit/95c3353d47dedd13c6d2d807be908426384fec04))
|
|
28
|
+
* **windows:** handle origin_check message from authWindow ([#3730](https://github.com/dynamic-labs/DynamicAuth/issues/3730)) ([dcd7875](https://github.com/dynamic-labs/DynamicAuth/commit/dcd787540db2aff38246cf5b1567765a0c3696f5))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
* **useDynamicContext:** make internalEvents private ([#3709](https://github.com/dynamic-labs/DynamicAuth/issues/3709)) ([750bc61](https://github.com/dynamic-labs/DynamicAuth/commit/750bc6165ee0b4ef87958988ea3ca55dc1f9f279))
|
|
32
|
+
|
|
2
33
|
## [0.19.0-alpha.26](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0-alpha.25...v0.19.0-alpha.26) (2023-10-25)
|
|
3
34
|
|
|
4
35
|
|
package/package.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var version = "0.19.0-alpha.
|
|
5
|
+
var version = "0.19.0-alpha.28";
|
|
6
6
|
var dependencies = {
|
|
7
7
|
"@dynamic-labs/iconic": "0.1.34",
|
|
8
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
8
|
+
"@dynamic-labs/sdk-api": "0.0.292",
|
|
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 = "0.19.0-alpha.
|
|
1
|
+
var version = "0.19.0-alpha.28";
|
|
2
2
|
var dependencies = {
|
|
3
3
|
"@dynamic-labs/iconic": "0.1.34",
|
|
4
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
4
|
+
"@dynamic-labs/sdk-api": "0.0.292",
|
|
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": "0.19.0-alpha.
|
|
3
|
+
"version": "0.19.0-alpha.28",
|
|
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.34",
|
|
11
|
-
"@dynamic-labs/sdk-api": "0.0.
|
|
11
|
+
"@dynamic-labs/sdk-api": "0.0.292",
|
|
12
12
|
"@hcaptcha/react-hcaptcha": "1.4.4",
|
|
13
13
|
"country-list": "2.3.0",
|
|
14
14
|
"formik": "2.2.9",
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"react-focus-lock": "2.9.2",
|
|
18
18
|
"react-i18next": "^13.2.0",
|
|
19
19
|
"yup": "0.32.11",
|
|
20
|
-
"@dynamic-labs/logger": "0.19.0-alpha.
|
|
21
|
-
"@dynamic-labs/multi-wallet": "0.19.0-alpha.
|
|
22
|
-
"@dynamic-labs/rpc-providers": "0.19.0-alpha.
|
|
23
|
-
"@dynamic-labs/types": "0.19.0-alpha.
|
|
24
|
-
"@dynamic-labs/utils": "0.19.0-alpha.
|
|
25
|
-
"@dynamic-labs/wallet-book": "0.19.0-alpha.
|
|
26
|
-
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.
|
|
20
|
+
"@dynamic-labs/logger": "0.19.0-alpha.28",
|
|
21
|
+
"@dynamic-labs/multi-wallet": "0.19.0-alpha.28",
|
|
22
|
+
"@dynamic-labs/rpc-providers": "0.19.0-alpha.28",
|
|
23
|
+
"@dynamic-labs/types": "0.19.0-alpha.28",
|
|
24
|
+
"@dynamic-labs/utils": "0.19.0-alpha.28",
|
|
25
|
+
"@dynamic-labs/wallet-book": "0.19.0-alpha.28",
|
|
26
|
+
"@dynamic-labs/wallet-connector-core": "0.19.0-alpha.28",
|
|
27
27
|
"eventemitter3": "5.0.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"semver": "7.
|
|
30
|
+
"semver": "7.5.4"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"react": "^17.0.2 || ^18.0.0",
|
|
@@ -5,6 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var classNames = require('../../../../utils/functions/classNames/classNames.cjs');
|
|
7
7
|
|
|
8
|
-
const VerticalAccordion = ({ children, className
|
|
8
|
+
const VerticalAccordion = ({ children, className, style, }) => (jsxRuntime.jsx("div", { className: classNames.classNames(className, 'vertical-accordion__container'), style: style, children: children }));
|
|
9
9
|
|
|
10
10
|
exports.VerticalAccordion = VerticalAccordion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { classNames } from '../../../../utils/functions/classNames/classNames.js';
|
|
3
3
|
|
|
4
|
-
const VerticalAccordion = ({ children, className
|
|
4
|
+
const VerticalAccordion = ({ children, className, style, }) => (jsx("div", { className: classNames(className, 'vertical-accordion__container'), style: style, children: children }));
|
|
5
5
|
|
|
6
6
|
export { VerticalAccordion };
|
package/src/lib/components/Accordion/components/VerticalAccordion/VerticalAccordion.types.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
export type VerticalAccordionComponent = FC<PropsWithChildren<VerticalAccordionProps>>;
|
|
2
|
+
import { ClassStyleProps } from '../../../../utils/types';
|
|
3
|
+
export type VerticalAccordionComponent = FC<PropsWithChildren<ClassStyleProps>>;
|
|
@@ -15,6 +15,7 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
|
|
|
15
15
|
const [internalButtonLoading, setInternalButtonLoading] = React.useState(false);
|
|
16
16
|
const [isFeedbackVisible, setIsFeedbackVisible] = React.useState(false);
|
|
17
17
|
const buttonVariantClassNameMap = {
|
|
18
|
+
'brand-primary': 'button--brand-primary',
|
|
18
19
|
primary: 'button--primary',
|
|
19
20
|
secondary: 'button--secondary',
|
|
20
21
|
tertiary: 'button--tertiary',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, FC, MouseEventHandler, ReactNode } from 'react';
|
|
2
2
|
import { TypographyProps } from '../Typography/Typography.types';
|
|
3
|
-
type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
3
|
+
type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'brand-primary';
|
|
4
4
|
type ButtonPadding = 'small' | 'medium' | 'large' | 'none';
|
|
5
5
|
export type ButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'> & {
|
|
6
6
|
buttonClassName?: string;
|
|
@@ -11,6 +11,7 @@ const Button = ({ buttonClassName = '', buttonPadding = 'medium', buttonVariant
|
|
|
11
11
|
const [internalButtonLoading, setInternalButtonLoading] = useState(false);
|
|
12
12
|
const [isFeedbackVisible, setIsFeedbackVisible] = useState(false);
|
|
13
13
|
const buttonVariantClassNameMap = {
|
|
14
|
+
'brand-primary': 'button--brand-primary',
|
|
14
15
|
primary: 'button--primary',
|
|
15
16
|
secondary: 'button--secondary',
|
|
16
17
|
tertiary: 'button--tertiary',
|
|
@@ -10,7 +10,7 @@ require('@dynamic-labs/sdk-api');
|
|
|
10
10
|
var logger = require('../../shared/logger.cjs');
|
|
11
11
|
require('@dynamic-labs/iconic');
|
|
12
12
|
require('@dynamic-labs/wallet-connector-core');
|
|
13
|
-
|
|
13
|
+
require('../../context/ViewContext/ViewContext.cjs');
|
|
14
14
|
var logout = require('../../shared/assets/logout.cjs');
|
|
15
15
|
require('@dynamic-labs/wallet-book');
|
|
16
16
|
require('@dynamic-labs/utils');
|
|
@@ -23,12 +23,10 @@ var Button = require('../Button/Button.cjs');
|
|
|
23
23
|
const LogoutButton = ({ buttonClassName = '', isTextButton = false, }) => {
|
|
24
24
|
const [loading, setLoading] = React.useState(false);
|
|
25
25
|
const { handleLogOut } = useInternalDynamicContext.useInternalDynamicContext();
|
|
26
|
-
const { goToInitialView } = ViewContext.useViewContext();
|
|
27
26
|
const onLogOutClick = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
28
27
|
try {
|
|
29
28
|
setLoading(true);
|
|
30
29
|
yield handleLogOut();
|
|
31
|
-
goToInitialView();
|
|
32
30
|
}
|
|
33
31
|
catch (e) {
|
|
34
32
|
logger.logger.error(e);
|
|
@@ -6,7 +6,7 @@ import '@dynamic-labs/sdk-api';
|
|
|
6
6
|
import { logger } from '../../shared/logger.js';
|
|
7
7
|
import '@dynamic-labs/iconic';
|
|
8
8
|
import '@dynamic-labs/wallet-connector-core';
|
|
9
|
-
import
|
|
9
|
+
import '../../context/ViewContext/ViewContext.js';
|
|
10
10
|
import { ReactComponent as SvgLogout } from '../../shared/assets/logout.js';
|
|
11
11
|
import '@dynamic-labs/wallet-book';
|
|
12
12
|
import '@dynamic-labs/utils';
|
|
@@ -19,12 +19,10 @@ import { Button } from '../Button/Button.js';
|
|
|
19
19
|
const LogoutButton = ({ buttonClassName = '', isTextButton = false, }) => {
|
|
20
20
|
const [loading, setLoading] = useState(false);
|
|
21
21
|
const { handleLogOut } = useInternalDynamicContext();
|
|
22
|
-
const { goToInitialView } = useViewContext();
|
|
23
22
|
const onLogOutClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
23
|
try {
|
|
25
24
|
setLoading(true);
|
|
26
25
|
yield handleLogOut();
|
|
27
|
-
goToInitialView();
|
|
28
26
|
}
|
|
29
27
|
catch (e) {
|
|
30
28
|
logger.error(e);
|
|
@@ -67,7 +67,7 @@ const NetworkPicker = ({ activeClassName = '', buttonClassName = '', checkboxCla
|
|
|
67
67
|
const pickerRef = React.useRef(null);
|
|
68
68
|
const [newNetworkId, setNewNetworkId] = React.useState(undefined);
|
|
69
69
|
const { loadingNetwork, network, setNetwork } = useInternalDynamicContext.useInternalDynamicContext();
|
|
70
|
-
const { data: supportedWalletNetworks } = usePromise.usePromise(() => connector === null || connector === void 0 ? void 0 : connector.getSupportedNetworks(), { deps: [
|
|
70
|
+
const { data: supportedWalletNetworks } = usePromise.usePromise(() => connector === null || connector === void 0 ? void 0 : connector.getSupportedNetworks(), { deps: [connector] });
|
|
71
71
|
const shouldAllowOpenDropdown = isNetworkUnsupported.isNetworkUnsupported(network, evmNetworks) || (evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.length) > 1;
|
|
72
72
|
// Ref to anchor popper to
|
|
73
73
|
const anchorRef = React.useRef(null);
|
|
@@ -90,7 +90,10 @@ const NetworkPicker = ({ activeClassName = '', buttonClassName = '', checkboxCla
|
|
|
90
90
|
setIsNetworkPickerOpen(false);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
return (jsxRuntime.jsxs("div", { className: classNames.classNames('non-widget-network-picker', mainClassName), ref: pickerRef, "data-testid": 'network-picker', children: [jsxRuntime.jsx(NetworkControl.NetworkControl, { evmNetworks: evmNetworks, activeClassName: activeClassName, network: network, loading: loadingNetwork, isOpen: isNetworkPickerOpen, setIsOpen: setIsNetworkPickerOpen, walletConnector: connector, showNetworkName: showNetworkName, buttonClassName: buttonClassName }), jsxRuntime.jsx("div", { ref: anchorRef,
|
|
93
|
+
return (jsxRuntime.jsxs("div", { className: classNames.classNames('non-widget-network-picker', mainClassName), ref: pickerRef, "data-testid": 'network-picker', children: [jsxRuntime.jsxs("div", { className: 'network-picker-network-control', children: [jsxRuntime.jsx(NetworkControl.NetworkControl, { evmNetworks: evmNetworks, activeClassName: activeClassName, network: network, loading: loadingNetwork, isOpen: isNetworkPickerOpen, setIsOpen: setIsNetworkPickerOpen, walletConnector: connector, showNetworkName: showNetworkName, buttonClassName: buttonClassName }), jsxRuntime.jsx("div", { ref: anchorRef, className: 'network-picker-network-control__anchor' })] }), shouldAllowOpenDropdown && (jsxRuntime.jsx(MenuList.MenuList, { className: listClassName, isOpen: isNetworkPickerOpen, onClickClose: () => setIsNetworkPickerOpen(false), popperProps: {
|
|
94
|
+
anchorOrigin: 'bottom-left',
|
|
95
|
+
anchorRef,
|
|
96
|
+
}, mobileTitle: 'Select network', children: evmNetworks.map(({ name, networkId, vanityName, iconUrls }) => (jsxRuntime.jsx(NetworkAction.NetworkAction, { iconUrl: iconUrls === null || iconUrls === void 0 ? void 0 : iconUrls[0], networkId: networkId, networkName: vanityName || name, network: network, onClick: handleNetworkChange, checkboxClassName: checkboxClassName, newNetworkId: newNetworkId, notSupported: supportedWalletNetworks &&
|
|
94
97
|
!supportedWalletNetworks.includes(`${networkId}`) }, networkId))) }))] }));
|
|
95
98
|
};
|
|
96
99
|
|
|
@@ -63,7 +63,7 @@ const NetworkPicker = ({ activeClassName = '', buttonClassName = '', checkboxCla
|
|
|
63
63
|
const pickerRef = useRef(null);
|
|
64
64
|
const [newNetworkId, setNewNetworkId] = useState(undefined);
|
|
65
65
|
const { loadingNetwork, network, setNetwork } = useInternalDynamicContext();
|
|
66
|
-
const { data: supportedWalletNetworks } = usePromise(() => connector === null || connector === void 0 ? void 0 : connector.getSupportedNetworks(), { deps: [
|
|
66
|
+
const { data: supportedWalletNetworks } = usePromise(() => connector === null || connector === void 0 ? void 0 : connector.getSupportedNetworks(), { deps: [connector] });
|
|
67
67
|
const shouldAllowOpenDropdown = isNetworkUnsupported(network, evmNetworks) || (evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.length) > 1;
|
|
68
68
|
// Ref to anchor popper to
|
|
69
69
|
const anchorRef = useRef(null);
|
|
@@ -86,7 +86,10 @@ const NetworkPicker = ({ activeClassName = '', buttonClassName = '', checkboxCla
|
|
|
86
86
|
setIsNetworkPickerOpen(false);
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
|
-
return (jsxs("div", { className: classNames('non-widget-network-picker', mainClassName), ref: pickerRef, "data-testid": 'network-picker', children: [jsx(NetworkControl, { evmNetworks: evmNetworks, activeClassName: activeClassName, network: network, loading: loadingNetwork, isOpen: isNetworkPickerOpen, setIsOpen: setIsNetworkPickerOpen, walletConnector: connector, showNetworkName: showNetworkName, buttonClassName: buttonClassName }), jsx("div", { ref: anchorRef,
|
|
89
|
+
return (jsxs("div", { className: classNames('non-widget-network-picker', mainClassName), ref: pickerRef, "data-testid": 'network-picker', children: [jsxs("div", { className: 'network-picker-network-control', children: [jsx(NetworkControl, { evmNetworks: evmNetworks, activeClassName: activeClassName, network: network, loading: loadingNetwork, isOpen: isNetworkPickerOpen, setIsOpen: setIsNetworkPickerOpen, walletConnector: connector, showNetworkName: showNetworkName, buttonClassName: buttonClassName }), jsx("div", { ref: anchorRef, className: 'network-picker-network-control__anchor' })] }), shouldAllowOpenDropdown && (jsx(MenuList, { className: listClassName, isOpen: isNetworkPickerOpen, onClickClose: () => setIsNetworkPickerOpen(false), popperProps: {
|
|
90
|
+
anchorOrigin: 'bottom-left',
|
|
91
|
+
anchorRef,
|
|
92
|
+
}, mobileTitle: 'Select network', children: evmNetworks.map(({ name, networkId, vanityName, iconUrls }) => (jsx(NetworkAction, { iconUrl: iconUrls === null || iconUrls === void 0 ? void 0 : iconUrls[0], networkId: networkId, networkName: vanityName || name, network: network, onClick: handleNetworkChange, checkboxClassName: checkboxClassName, newNetworkId: newNetworkId, notSupported: supportedWalletNetworks &&
|
|
90
93
|
!supportedWalletNetworks.includes(`${networkId}`) }, networkId))) }))] }));
|
|
91
94
|
};
|
|
92
95
|
|
|
@@ -45,7 +45,7 @@ const SendBalancePageLayout = ({ error, walletAddress, onClickClose, onClickBack
|
|
|
45
45
|
return;
|
|
46
46
|
return parseFloat(balance);
|
|
47
47
|
}, [balance]);
|
|
48
|
-
return (jsxRuntime.jsxs(
|
|
48
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: backButton, trailing: closeButton, children: jsxRuntime.jsxs("div", { className: 'send-balance-page-layout__header-content', children: [jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', as: 'p', children: "Send from" }), walletKey && (jsxRuntime.jsx(Icon.Icon, { size: 'small', children: jsxRuntime.jsx(walletBook.WalletIcon, { walletKey: walletKey }) })), jsxRuntime.jsx(Typography.Typography, { variant: 'body_normal', color: 'primary', as: 'p', children: shortenWalletAddress.shortenWalletAddress(walletAddress, 3, 3) })] }) }), jsxRuntime.jsxs("div", { className: 'send-balance-page-layout__body', children: [jsxRuntime.jsx(AnimatePresence.AnimatePresence, { animationComponent: jsxRuntime.jsx(VerticalDrawerTransition.VerticalDrawerTransition, {}), children: error && (jsxRuntime.jsx("div", { className: 'send-balance-page-layout__error', children: jsxRuntime.jsx(Alert.Alert, { icon: 'error', variant: 'error', children: error }) })) }), networkName && networkIcon && (jsxRuntime.jsx("div", { className: 'send-balance-page-layout__network-container', children: jsxRuntime.jsx(Chip.Chip, { icon: networkIcon, children: networkName }) })), jsxRuntime.jsxs("div", { className: 'send-balance-page-layout__balance-container', children: [jsxRuntime.jsx(FormFieldLabel.FormFieldLabel, { divider: true, children: "Token" }), jsxRuntime.jsx(TokenBalanceCard.TokenBalanceCard, { chain: chain, currencySymbol: currencySymbol, balance: balance })] }), jsxRuntime.jsx(SendBalanceForm.SendBalanceForm, { onSubmit: onSubmit, initialValues: initialValues, balance: balanceNumber, decimals: networkCurrencyDecimals }), displayPoweredByDynamicFooter && (jsxRuntime.jsx(PoweredByDynamic.PoweredByDynamic, { classNameRoot: 'send-balance-page-layout__footer' }))] })] }));
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
exports.SendBalancePageLayout = SendBalancePageLayout;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { WalletIcon } from '@dynamic-labs/wallet-book';
|
|
4
4
|
import { IconButton } from '../IconButton/IconButton.js';
|
|
@@ -41,7 +41,7 @@ const SendBalancePageLayout = ({ error, walletAddress, onClickClose, onClickBack
|
|
|
41
41
|
return;
|
|
42
42
|
return parseFloat(balance);
|
|
43
43
|
}, [balance]);
|
|
44
|
-
return (jsxs(
|
|
44
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: backButton, trailing: closeButton, children: jsxs("div", { className: 'send-balance-page-layout__header-content', children: [jsx(Typography, { variant: 'body_normal', color: 'primary', as: 'p', children: "Send from" }), walletKey && (jsx(Icon, { size: 'small', children: jsx(WalletIcon, { walletKey: walletKey }) })), jsx(Typography, { variant: 'body_normal', color: 'primary', as: 'p', children: shortenWalletAddress(walletAddress, 3, 3) })] }) }), jsxs("div", { className: 'send-balance-page-layout__body', children: [jsx(AnimatePresence, { animationComponent: jsx(VerticalDrawerTransition, {}), children: error && (jsx("div", { className: 'send-balance-page-layout__error', children: jsx(Alert, { icon: 'error', variant: 'error', children: error }) })) }), networkName && networkIcon && (jsx("div", { className: 'send-balance-page-layout__network-container', children: jsx(Chip, { icon: networkIcon, children: networkName }) })), jsxs("div", { className: 'send-balance-page-layout__balance-container', children: [jsx(FormFieldLabel, { divider: true, children: "Token" }), jsx(TokenBalanceCard, { chain: chain, currencySymbol: currencySymbol, balance: balance })] }), jsx(SendBalanceForm, { onSubmit: onSubmit, initialValues: initialValues, balance: balanceNumber, decimals: networkCurrencyDecimals }), displayPoweredByDynamicFooter && (jsx(PoweredByDynamic, { classNameRoot: 'send-balance-page-layout__footer' }))] })] }));
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
export { SendBalancePageLayout };
|
|
@@ -29,6 +29,7 @@ const Typography = (_a) => {
|
|
|
29
29
|
'error-1': 'typography--dynamic-error-1',
|
|
30
30
|
'error-2': 'typography--dynamic-error-2',
|
|
31
31
|
'green-1': 'typography--connection-green-1',
|
|
32
|
+
inherit: 'typography--inherit',
|
|
32
33
|
link: 'typography--link',
|
|
33
34
|
primary: 'typography--primary',
|
|
34
35
|
secondary: 'typography--secondary',
|
|
@@ -25,6 +25,7 @@ const Typography = (_a) => {
|
|
|
25
25
|
'error-1': 'typography--dynamic-error-1',
|
|
26
26
|
'error-2': 'typography--dynamic-error-2',
|
|
27
27
|
'green-1': 'typography--connection-green-1',
|
|
28
|
+
inherit: 'typography--inherit',
|
|
28
29
|
link: 'typography--link',
|
|
29
30
|
primary: 'typography--primary',
|
|
30
31
|
secondary: 'typography--secondary',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef, ElementType, ReactElement } from 'react';
|
|
2
2
|
export type TypographyTag = ElementType;
|
|
3
3
|
export type TypographyVariant = 'title' | 'body_normal' | 'body_small' | 'body_mini' | 'button_primary' | 'button_secondary' | 'button_tertiary' | 'numbers_big' | 'numbers_medium';
|
|
4
|
-
export type TypographyColor = 'primary' | 'secondary' | 'brand-primary' | 'tertiary' | 'link' | 'error-1' | 'error-2' | 'tooltip' | 'green-1';
|
|
4
|
+
export type TypographyColor = 'primary' | 'secondary' | 'brand-primary' | 'tertiary' | 'link' | 'error-1' | 'error-2' | 'tooltip' | 'green-1' | 'inherit';
|
|
5
5
|
export type TypographyWeight = 'regular' | 'medium' | 'bold';
|
|
6
6
|
export type TypographyTransform = 'uppercase';
|
|
7
7
|
export type TypographyProps<TAG extends ElementType = 'p'> = {
|
|
@@ -60,7 +60,7 @@ require('../../../MenuList/Dropdown/Dropdown.cjs');
|
|
|
60
60
|
const UserProfileField = ({ name, label, value, }) => {
|
|
61
61
|
const isEmpty = value === '';
|
|
62
62
|
const isEmailField = name === 'email';
|
|
63
|
-
return (jsxRuntime.jsxs("div", { className: 'user-profile-field', children: [label && (jsxRuntime.jsx(Typography.Typography, { as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small', children: label })), jsxRuntime.jsxs("div", { className: 'user-profile-field__value', children: [jsxRuntime.jsx(Typography.Typography, { color: isEmpty ? 'tertiary' : 'primary', as: 'p', weight: 'regular', variant: 'body_normal', children: value
|
|
63
|
+
return (jsxRuntime.jsxs("div", { className: 'user-profile-field', children: [label && (jsxRuntime.jsx(Typography.Typography, { as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small', children: label })), jsxRuntime.jsxs("div", { className: 'user-profile-field__value', children: [jsxRuntime.jsx(Typography.Typography, { color: isEmpty ? 'tertiary' : 'primary', as: 'p', weight: 'regular', variant: 'body_normal', children: value }), isEmailField && (jsxRuntime.jsx(VerifiedEmailIcon.VerifiedEmailIcon, { className: 'user-profile-field__verify-email-icon', overwriteTooltipProps: { as: 'div' } }))] })] }));
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
exports.UserProfileField = UserProfileField;
|
|
@@ -56,7 +56,7 @@ import '../../../MenuList/Dropdown/Dropdown.js';
|
|
|
56
56
|
const UserProfileField = ({ name, label, value, }) => {
|
|
57
57
|
const isEmpty = value === '';
|
|
58
58
|
const isEmailField = name === 'email';
|
|
59
|
-
return (jsxs("div", { className: 'user-profile-field', children: [label && (jsx(Typography, { as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small', children: label })), jsxs("div", { className: 'user-profile-field__value', children: [jsx(Typography, { color: isEmpty ? 'tertiary' : 'primary', as: 'p', weight: 'regular', variant: 'body_normal', children: value
|
|
59
|
+
return (jsxs("div", { className: 'user-profile-field', children: [label && (jsx(Typography, { as: 'h6', color: 'secondary', weight: 'regular', variant: 'body_small', children: label })), jsxs("div", { className: 'user-profile-field__value', children: [jsx(Typography, { color: isEmpty ? 'tertiary' : 'primary', as: 'p', weight: 'regular', variant: 'body_normal', children: value }), isEmailField && (jsx(VerifiedEmailIcon, { className: 'user-profile-field__verify-email-icon', overwriteTooltipProps: { as: 'div' } }))] })] }));
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export { UserProfileField };
|
|
@@ -145,7 +145,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale: locale$1, }
|
|
|
145
145
|
const [qrcodeUri, setQrcodeUri] = React.useState('');
|
|
146
146
|
const [desktopUri, setDesktopUri] = React.useState('');
|
|
147
147
|
const [multiWalletWidgetState, setMultiWalletWidgetState, { awaiting_account_switch: [accountSwitchState], awaiting_signature: [awaitingSignatureState], },] = useMultiWalletWidgetState.useMultiWalletWidgetState();
|
|
148
|
-
const { projectSettings, isLoading: isProjectSettingsLoading } = useFetchProjectSettings.useFetchProjectSettings({
|
|
148
|
+
const { projectSettings, isLoading: isProjectSettingsLoading, removeLsSettings, } = useFetchProjectSettings.useFetchProjectSettings({
|
|
149
149
|
authToken: getAuthToken.getAuthToken(),
|
|
150
150
|
dynamicContextProps: { settings },
|
|
151
151
|
environmentId,
|
|
@@ -196,7 +196,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale: locale$1, }
|
|
|
196
196
|
walletUiUtils,
|
|
197
197
|
});
|
|
198
198
|
const [authMode, setAuthMode] = useLocalStorage.useLocalStorage(localStorage$1.AUTH_MODE, initialAuthenticationMode);
|
|
199
|
-
const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId.usePrimaryWalletId(
|
|
199
|
+
const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId.usePrimaryWalletId();
|
|
200
200
|
const { connectWallet, removeConnectedWalletsInfo, connectedWalletsInfo, connectedWallet, getConnectedWalletById, connectedWallets, disconnectWallet, refreshConnectedWallet, } = useConnectWallet.useConnectWallet({
|
|
201
201
|
authMode,
|
|
202
202
|
clearPrimaryWalletId,
|
|
@@ -230,6 +230,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale: locale$1, }
|
|
|
230
230
|
const { computeConnectedStateForWallets, didConnectedStateLoad, walletConnectors, primaryWallet, showQrcodeModal, secondaryWallets, setPrimaryWallet, setShowQrcodeModal, } = useWalletConnectors.useWalletConnectors({
|
|
231
231
|
authMode,
|
|
232
232
|
authToken: getAuthToken.getAuthToken() || onboardingOnlyJwt,
|
|
233
|
+
canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
|
|
233
234
|
connectedWallets,
|
|
234
235
|
multiWalletWidgetState,
|
|
235
236
|
onboardingOnlyJwt,
|
|
@@ -300,6 +301,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale: locale$1, }
|
|
|
300
301
|
setShowAuthFlow(false);
|
|
301
302
|
setMultiWalletWidgetState('idle');
|
|
302
303
|
removeAuthTokenAndUser();
|
|
304
|
+
removeLsSettings();
|
|
303
305
|
handleRemoveLsNetworks();
|
|
304
306
|
setOnboardingOnlyJwt(undefined);
|
|
305
307
|
removeConnectedWalletsInfo();
|
|
@@ -728,7 +730,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale: locale$1, }
|
|
|
728
730
|
isBridgeFlow,
|
|
729
731
|
isFullyConnected,
|
|
730
732
|
isMultiWalletEnabled: multiWallet,
|
|
731
|
-
}), children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { canSync: didConnectedStateLoad, children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsxs(UserFieldEditorContext.UserFieldEditorContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), jsxRuntime.jsx(SyncPasskeyFlow.SyncPasskeyFlow, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
733
|
+
}), internalEvents: internalEventsRef, children: jsxRuntime.jsx(AccountExistsContext.AccountExistsContextProvider, { children: jsxRuntime.jsx(WalletContext.WalletContextProvider, { canSync: didConnectedStateLoad, children: jsxRuntime.jsx(QrCodeContext.QrCodeContextProvider, { children: jsxRuntime.jsx(EmailVerificationContext.EmailVerificationContextProvider, { children: jsxRuntime.jsx(DynamicWidgetContext.DynamicWidgetContextProvider, { children: jsxRuntime.jsx(DynamicBridgeWidgetContext.DynamicBridgeWidgetContextProvider, { children: jsxRuntime.jsx(CaptchaContext.CaptchaContextProvider, { children: jsxRuntime.jsx(FundingContext.FundingContextProvider, { children: jsxRuntime.jsx(AccessDeniedContext.AccessDeniedContextProvider, { children: jsxRuntime.jsx(SendBalanceContext.SendBalanceContextProvider, { children: jsxRuntime.jsx(WalletGroupContext.WalletGroupContextProvider, { children: jsxRuntime.jsxs(UserFieldEditorContext.UserFieldEditorContextProvider, { children: [jsxRuntime.jsx(app.DynamicAuthFlow, {}), jsxRuntime.jsx(Toolkit.Toolkit, {}), jsxRuntime.jsx(FundingWidget.FundingWidget, {}), jsxRuntime.jsx(SyncPasskeyFlow.SyncPasskeyFlow, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
732
734
|
};
|
|
733
735
|
|
|
734
736
|
exports.DynamicContext = DynamicContext;
|
|
@@ -141,7 +141,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
|
|
|
141
141
|
const [qrcodeUri, setQrcodeUri] = useState('');
|
|
142
142
|
const [desktopUri, setDesktopUri] = useState('');
|
|
143
143
|
const [multiWalletWidgetState, setMultiWalletWidgetState, { awaiting_account_switch: [accountSwitchState], awaiting_signature: [awaitingSignatureState], },] = useMultiWalletWidgetState();
|
|
144
|
-
const { projectSettings, isLoading: isProjectSettingsLoading } = useFetchProjectSettings({
|
|
144
|
+
const { projectSettings, isLoading: isProjectSettingsLoading, removeLsSettings, } = useFetchProjectSettings({
|
|
145
145
|
authToken: getAuthToken(),
|
|
146
146
|
dynamicContextProps: { settings },
|
|
147
147
|
environmentId,
|
|
@@ -192,7 +192,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
|
|
|
192
192
|
walletUiUtils,
|
|
193
193
|
});
|
|
194
194
|
const [authMode, setAuthMode] = useLocalStorage(AUTH_MODE, initialAuthenticationMode);
|
|
195
|
-
const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId(
|
|
195
|
+
const { clearPrimaryWalletId, primaryWalletId, setPrimaryWalletId } = usePrimaryWalletId();
|
|
196
196
|
const { connectWallet, removeConnectedWalletsInfo, connectedWalletsInfo, connectedWallet, getConnectedWalletById, connectedWallets, disconnectWallet, refreshConnectedWallet, } = useConnectWallet({
|
|
197
197
|
authMode,
|
|
198
198
|
clearPrimaryWalletId,
|
|
@@ -226,6 +226,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
|
|
|
226
226
|
const { computeConnectedStateForWallets, didConnectedStateLoad, walletConnectors, primaryWallet, showQrcodeModal, secondaryWallets, setPrimaryWallet, setShowQrcodeModal, } = useWalletConnectors({
|
|
227
227
|
authMode,
|
|
228
228
|
authToken: getAuthToken() || onboardingOnlyJwt,
|
|
229
|
+
canHaveMultipleWalletsConnected: multiWallet || isBridgeFlow,
|
|
229
230
|
connectedWallets,
|
|
230
231
|
multiWalletWidgetState,
|
|
231
232
|
onboardingOnlyJwt,
|
|
@@ -296,6 +297,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
|
|
|
296
297
|
setShowAuthFlow(false);
|
|
297
298
|
setMultiWalletWidgetState('idle');
|
|
298
299
|
removeAuthTokenAndUser();
|
|
300
|
+
removeLsSettings();
|
|
299
301
|
handleRemoveLsNetworks();
|
|
300
302
|
setOnboardingOnlyJwt(undefined);
|
|
301
303
|
removeConnectedWalletsInfo();
|
|
@@ -724,7 +726,7 @@ const DynamicContextProvider = ({ children, theme, settings, locale, }) => {
|
|
|
724
726
|
isBridgeFlow,
|
|
725
727
|
isFullyConnected,
|
|
726
728
|
isMultiWalletEnabled: multiWallet,
|
|
727
|
-
}), children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { canSync: didConnectedStateLoad, children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsxs(UserFieldEditorContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), jsx(SyncPasskeyFlow, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
729
|
+
}), internalEvents: internalEventsRef, children: jsx(AccountExistsContextProvider, { children: jsx(WalletContextProvider, { canSync: didConnectedStateLoad, children: jsx(QrCodeContextProvider, { children: jsx(EmailVerificationContextProvider, { children: jsx(DynamicWidgetContextProvider, { children: jsx(DynamicBridgeWidgetContextProvider, { children: jsx(CaptchaContextProvider, { children: jsx(FundingContextProvider, { children: jsx(AccessDeniedContextProvider, { children: jsx(SendBalanceContextProvider, { children: jsx(WalletGroupContextProvider, { children: jsxs(UserFieldEditorContextProvider, { children: [jsx(DynamicAuthFlow, {}), jsx(Toolkit, {}), jsx(FundingWidget, {}), jsx(SyncPasskeyFlow, {}), confirmationModal, children] }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
728
730
|
};
|
|
729
731
|
|
|
730
732
|
export { DynamicContext, DynamicContextProvider, PUBLIC_PROJECT_LIVE_ENVIRONMENT_ID };
|
|
@@ -3,7 +3,6 @@ import { Wallet } from '../../../shared';
|
|
|
3
3
|
/** Maps internal event names to their listeners */
|
|
4
4
|
export type InternalEventMap = {
|
|
5
5
|
emailVerificationResult: (param: boolean, email: string) => void;
|
|
6
|
-
clearPrimaryWallet: () => void;
|
|
7
6
|
embeddedWalletCreated: (wallet: Wallet) => void;
|
|
8
7
|
embeddedWalletFailed: (error: unknown) => void;
|
|
9
8
|
logout: () => void;
|
|
@@ -11,7 +11,7 @@ const useDynamicContext = () => {
|
|
|
11
11
|
if (context === undefined) {
|
|
12
12
|
throw new Error('useDynamicContext must be used within a DynamicContextProvider');
|
|
13
13
|
}
|
|
14
|
-
const { accountSwitchState, authMode, authToken, awaitingSignatureState, connectedWallets, getNameService, handleLogOut, handleUnlinkWallet, isAuthenticated, isFullyConnected, isVerificationInProgress, linkedWallets, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, rpcProviders, sdkHasLoaded, secondaryWallets, setLogInWithEmail, setMultiWalletWidgetState, setNetwork, setPrimaryWallet, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, walletConnector, wallets, walletsByChain, walletsToConnectByChain, primaryWallet, setShowBridgeWidget, sendWagmiSettings,
|
|
14
|
+
const { accountSwitchState, authMode, authToken, awaitingSignatureState, connectedWallets, getNameService, handleLogOut, handleUnlinkWallet, isAuthenticated, isFullyConnected, isVerificationInProgress, linkedWallets, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, rpcProviders, sdkHasLoaded, secondaryWallets, setLogInWithEmail, setMultiWalletWidgetState, setNetwork, setPrimaryWallet, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, walletConnector, wallets, walletsByChain, walletsToConnectByChain, primaryWallet, setShowBridgeWidget, sendWagmiSettings, } = context;
|
|
15
15
|
return {
|
|
16
16
|
accountSwitchState,
|
|
17
17
|
authMode,
|
|
@@ -21,7 +21,6 @@ const useDynamicContext = () => {
|
|
|
21
21
|
getNameService,
|
|
22
22
|
handleLogOut,
|
|
23
23
|
handleUnlinkWallet,
|
|
24
|
-
internalEvents,
|
|
25
24
|
isAuthenticated,
|
|
26
25
|
isFullyConnected,
|
|
27
26
|
isVerificationInProgress,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IDynamicContext } from './types';
|
|
2
|
-
export type UseDynamicContext = Pick<IDynamicContext, 'accountSwitchState' | 'authMode' | 'authToken' | 'awaitingSignatureState' | 'connectedWallets' | 'getNameService' | 'handleLogOut' | 'handleUnlinkWallet' | 'isAuthenticated' | 'isFullyConnected' | 'isVerificationInProgress' | 'linkedWallets' | 'loadingNetwork' | 'locale' | 'loginWithEmail' | 'multiWalletWidgetState' | 'network' | 'networkConfigurations' | 'primaryWallet' | 'qrcodeUri' | 'rpcProviders' | 'sdkHasLoaded' | 'secondaryWallets' | 'setLogInWithEmail' | 'setMultiWalletWidgetState' | 'setNetwork' | 'setPrimaryWallet' | 'setShowAuthFlow' | 'setShowDynamicUserProfile' | 'setShowQrcodeModal' | 'shadowDOMEnabled' | 'showAuthFlow' | 'showQrcodeModal' | 'user' | 'walletConnector' | 'wallets' | 'walletsByChain' | 'walletsToConnectByChain' | 'setShowBridgeWidget' | 'sendWagmiSettings'
|
|
2
|
+
export type UseDynamicContext = Pick<IDynamicContext, 'accountSwitchState' | 'authMode' | 'authToken' | 'awaitingSignatureState' | 'connectedWallets' | 'getNameService' | 'handleLogOut' | 'handleUnlinkWallet' | 'isAuthenticated' | 'isFullyConnected' | 'isVerificationInProgress' | 'linkedWallets' | 'loadingNetwork' | 'locale' | 'loginWithEmail' | 'multiWalletWidgetState' | 'network' | 'networkConfigurations' | 'primaryWallet' | 'qrcodeUri' | 'rpcProviders' | 'sdkHasLoaded' | 'secondaryWallets' | 'setLogInWithEmail' | 'setMultiWalletWidgetState' | 'setNetwork' | 'setPrimaryWallet' | 'setShowAuthFlow' | 'setShowDynamicUserProfile' | 'setShowQrcodeModal' | 'shadowDOMEnabled' | 'showAuthFlow' | 'showQrcodeModal' | 'user' | 'walletConnector' | 'wallets' | 'walletsByChain' | 'walletsToConnectByChain' | 'setShowBridgeWidget' | 'sendWagmiSettings'>;
|
|
3
3
|
export declare const useDynamicContext: () => UseDynamicContext;
|
|
@@ -7,7 +7,7 @@ const useDynamicContext = () => {
|
|
|
7
7
|
if (context === undefined) {
|
|
8
8
|
throw new Error('useDynamicContext must be used within a DynamicContextProvider');
|
|
9
9
|
}
|
|
10
|
-
const { accountSwitchState, authMode, authToken, awaitingSignatureState, connectedWallets, getNameService, handleLogOut, handleUnlinkWallet, isAuthenticated, isFullyConnected, isVerificationInProgress, linkedWallets, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, rpcProviders, sdkHasLoaded, secondaryWallets, setLogInWithEmail, setMultiWalletWidgetState, setNetwork, setPrimaryWallet, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, walletConnector, wallets, walletsByChain, walletsToConnectByChain, primaryWallet, setShowBridgeWidget, sendWagmiSettings,
|
|
10
|
+
const { accountSwitchState, authMode, authToken, awaitingSignatureState, connectedWallets, getNameService, handleLogOut, handleUnlinkWallet, isAuthenticated, isFullyConnected, isVerificationInProgress, linkedWallets, loadingNetwork, locale, loginWithEmail, multiWalletWidgetState, network, networkConfigurations, qrcodeUri, rpcProviders, sdkHasLoaded, secondaryWallets, setLogInWithEmail, setMultiWalletWidgetState, setNetwork, setPrimaryWallet, setShowAuthFlow, setShowDynamicUserProfile, setShowQrcodeModal, shadowDOMEnabled, showAuthFlow, showQrcodeModal, user, walletConnector, wallets, walletsByChain, walletsToConnectByChain, primaryWallet, setShowBridgeWidget, sendWagmiSettings, } = context;
|
|
11
11
|
return {
|
|
12
12
|
accountSwitchState,
|
|
13
13
|
authMode,
|
|
@@ -17,7 +17,6 @@ const useDynamicContext = () => {
|
|
|
17
17
|
getNameService,
|
|
18
18
|
handleLogOut,
|
|
19
19
|
handleUnlinkWallet,
|
|
20
|
-
internalEvents,
|
|
21
20
|
isAuthenticated,
|
|
22
21
|
isFullyConnected,
|
|
23
22
|
isVerificationInProgress,
|
|
@@ -6,12 +6,25 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var React = require('react');
|
|
7
7
|
|
|
8
8
|
const ViewContext = React.createContext(undefined);
|
|
9
|
-
const ViewContextProvider = ({ children, initialView = 'wallet-list' }) => {
|
|
9
|
+
const ViewContextProvider = ({ children, initialView = 'wallet-list', internalEvents }) => {
|
|
10
10
|
const [_view, setView] = React.useState(null);
|
|
11
11
|
const view = _view || initialView;
|
|
12
12
|
const goToInitialView = React.useCallback(() => {
|
|
13
13
|
setView(null);
|
|
14
14
|
}, [initialView]);
|
|
15
|
+
React.useEffect(() => {
|
|
16
|
+
if (!internalEvents) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const handleInternalLogoutEvent = () => {
|
|
20
|
+
goToInitialView();
|
|
21
|
+
};
|
|
22
|
+
const events = internalEvents.current;
|
|
23
|
+
events.on('logout', handleInternalLogoutEvent);
|
|
24
|
+
return () => {
|
|
25
|
+
events.off('logout', handleInternalLogoutEvent);
|
|
26
|
+
};
|
|
27
|
+
}, [goToInitialView, internalEvents]);
|
|
15
28
|
const value = React.useMemo(() => ({
|
|
16
29
|
goToInitialView,
|
|
17
30
|
setView: setView,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { SetStateAction, Dispatch, PropsWithChildren, FC } from 'react';
|
|
1
|
+
import { SetStateAction, Dispatch, PropsWithChildren, FC, MutableRefObject } from 'react';
|
|
2
|
+
import { InternalEventEmitter } from '../DynamicContext/internalEvents';
|
|
2
3
|
export type ViewType = 'captcha' | 'chainalysis-blocked-wallet' | 'collect-user-data' | 'collect-user-data-login-with-email' | 'login-with-email-or-wallet-full-wallet-list' | 'login-with-email-or-wallet' | 'login-with-wallet-only' | 'login-with-email-verification' | 'network-not-supported' | 'network-not-supported-manual' | 'no-access' | 'no-qr-not-installed' | 'pending-connect' | 'pending-signature-without-back-button' | 'pending-signature' | 'qr-code' | 'update-email' | 'verify-email' | 'wallet-connect-mobile-wallets-list' | 'wallet-list' | 'multi-wallet-wallet-list' | 'wallet-sign' | 'wallet-used' | 'wallet-group' | 'wait-for-email-confirmation-view' | 'email-wallet-otp-verification-view' | 'social-redirect-view' | 'wallet-locked-view' | 'social-wrong-account' | 'gate-blocked-wallet' | 'bridge-welcome' | 'bridge-summary' | 'bridge-next-wallet-connection' | 'account-exists' | 'merge-user-accounts' | 'wallet-cannot-be-transferred' | 'passkey-intro';
|
|
3
4
|
export type ViewContextProps = {
|
|
4
5
|
setView: Dispatch<SetStateAction<ViewType>>;
|
|
@@ -7,6 +8,7 @@ export type ViewContextProps = {
|
|
|
7
8
|
};
|
|
8
9
|
type ViewContextProviderProps = {
|
|
9
10
|
initialView?: ViewType;
|
|
11
|
+
internalEvents?: MutableRefObject<InternalEventEmitter>;
|
|
10
12
|
};
|
|
11
13
|
export declare const ViewContext: import("react").Context<ViewContextProps | undefined>;
|
|
12
14
|
export declare const ViewContextProvider: FC<PropsWithChildren<ViewContextProviderProps>>;
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { createContext, useState, useCallback, useMemo, useContext } from 'react';
|
|
2
|
+
import { createContext, useState, useCallback, useEffect, useMemo, useContext } from 'react';
|
|
3
3
|
|
|
4
4
|
const ViewContext = createContext(undefined);
|
|
5
|
-
const ViewContextProvider = ({ children, initialView = 'wallet-list' }) => {
|
|
5
|
+
const ViewContextProvider = ({ children, initialView = 'wallet-list', internalEvents }) => {
|
|
6
6
|
const [_view, setView] = useState(null);
|
|
7
7
|
const view = _view || initialView;
|
|
8
8
|
const goToInitialView = useCallback(() => {
|
|
9
9
|
setView(null);
|
|
10
10
|
}, [initialView]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!internalEvents) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const handleInternalLogoutEvent = () => {
|
|
16
|
+
goToInitialView();
|
|
17
|
+
};
|
|
18
|
+
const events = internalEvents.current;
|
|
19
|
+
events.on('logout', handleInternalLogoutEvent);
|
|
20
|
+
return () => {
|
|
21
|
+
events.off('logout', handleInternalLogoutEvent);
|
|
22
|
+
};
|
|
23
|
+
}, [goToInitialView, internalEvents]);
|
|
11
24
|
const value = useMemo(() => ({
|
|
12
25
|
goToInitialView,
|
|
13
26
|
setView: setView,
|
|
@@ -66,7 +66,7 @@ require('../../components/Popper/PopperContext/PopperContext.cjs');
|
|
|
66
66
|
require('../../components/InlineWidget/InlineWidget.cjs');
|
|
67
67
|
require('../../components/MenuList/Dropdown/Dropdown.cjs');
|
|
68
68
|
|
|
69
|
-
const DynamicAuthLayout = ({ children, className, onClose, projectSettings, hideBridgeProgressSteppers, }) => {
|
|
69
|
+
const DynamicAuthLayout = ({ children, className, style, onClose, projectSettings, hideBridgeProgressSteppers, }) => {
|
|
70
70
|
const { view } = ViewContext.useViewContext();
|
|
71
71
|
const { walletConnector, authMode } = useInternalDynamicContext.useInternalDynamicContext();
|
|
72
72
|
const { isFooterExpanded } = index.useFooterAnimationContext();
|
|
@@ -77,7 +77,7 @@ const DynamicAuthLayout = ({ children, className, onClose, projectSettings, hide
|
|
|
77
77
|
});
|
|
78
78
|
const { showConnectedWalletProgress } = useAuthLayoutChecks.useAuthLayoutChecks(walletConnector);
|
|
79
79
|
const { showDynamicFooter } = useAuthLayoutChecks.useAuthLayoutChecks(walletConnector);
|
|
80
|
-
return (jsxRuntime.jsx(OverlayCardTarget.OverlayCardTarget, { children: jsxRuntime.jsxs(VerticalAccordion.VerticalAccordion, { className: className, children: [jsxRuntime.jsxs(AccordionItem.AccordionItem, { isOpen: !isFooterExpanded, dimOnHide: true, children: [showConnectedWalletProgress && !hideBridgeProgressSteppers && (jsxRuntime.jsx(WalletProgressStepper.WalletProgressStepper, {})), showHeader && (jsxRuntime.jsx(header.Header, { onClose: onClose, heading: (headerData === null || headerData === void 0 ? void 0 : headerData.heading) || '', projectSettings: projectSettings, walletConnector: walletConnector })), children, showDynamicFooter && jsxRuntime.jsx(DynamicFooter.DynamicFooter, {}), showToSFooter && jsxRuntime.jsx(ToSFooter.ToSFooter, {})] }), helpHeaderData && showHelpContent && (jsxRuntime.jsx(AccordionItem.AccordionItem, { isOpen: isFooterExpanded, children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(HelpContent.HelpContent, {}) }, isFooterExpanded.toString()) }))] }) }));
|
|
80
|
+
return (jsxRuntime.jsx(OverlayCardTarget.OverlayCardTarget, { children: jsxRuntime.jsxs(VerticalAccordion.VerticalAccordion, { style: style, className: className, children: [jsxRuntime.jsxs(AccordionItem.AccordionItem, { isOpen: !isFooterExpanded, dimOnHide: true, children: [showConnectedWalletProgress && !hideBridgeProgressSteppers && (jsxRuntime.jsx(WalletProgressStepper.WalletProgressStepper, {})), showHeader && (jsxRuntime.jsx(header.Header, { onClose: onClose, heading: (headerData === null || headerData === void 0 ? void 0 : headerData.heading) || '', projectSettings: projectSettings, walletConnector: walletConnector })), children, showDynamicFooter && jsxRuntime.jsx(DynamicFooter.DynamicFooter, {}), showToSFooter && jsxRuntime.jsx(ToSFooter.ToSFooter, {})] }), helpHeaderData && showHelpContent && (jsxRuntime.jsx(AccordionItem.AccordionItem, { isOpen: isFooterExpanded, children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(HelpContent.HelpContent, {}) }, isFooterExpanded.toString()) }))] }) }));
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
exports.DynamicAuthLayout = DynamicAuthLayout;
|