@dynamic-labs/sdk-react-core 0.19.4 → 0.19.5
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 +12 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +9 -9
- package/src/index.cjs +4 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -1
- package/src/lib/components/NeedHelpSection/NeedHelpSection.cjs +84 -5
- package/src/lib/components/NeedHelpSection/NeedHelpSection.js +85 -6
- package/src/lib/layout/DynamicAuthLayout/Header/header.cjs +9 -11
- package/src/lib/layout/DynamicAuthLayout/Header/header.js +10 -12
- package/src/lib/locale/en/translation.cjs +7 -3
- package/src/lib/locale/en/translation.d.ts +6 -2
- package/src/lib/locale/en/translation.js +7 -3
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.cjs +1 -1
- package/src/lib/modals/SignMessageConfirmationModal/getProperErrorMessage.js +1 -1
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/hooks/index.d.ts +1 -0
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.cjs +8 -1
- package/src/lib/utils/hooks/useFetchProjectSettings/useFetchProjectSettings.js +9 -2
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.cjs +8 -0
- package/src/lib/utils/hooks/useWalletConnectors/useWalletConnectors.js +9 -1
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.cjs +2 -5
- package/src/lib/views/LoginView/sections/SocialSignInSection/SocialSignInSection.js +2 -5
- package/src/lib/views/LoginView/useLoginView.cjs +101 -84
- package/src/lib/views/LoginView/useLoginView.js +102 -85
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs +16 -6
- package/src/lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js +16 -6
- package/src/lib/utils/functions/getEnabledProviders/index.cjs +0 -7
- package/src/lib/utils/functions/getEnabledProviders/index.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
|
|
2
|
+
### [0.19.5](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.4...v0.19.5) (2023-12-05)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Bug Fixes
|
|
6
|
+
|
|
7
|
+
* add support for embedded wallets in connect-only ([#4041](https://github.com/dynamic-labs/DynamicAuth/issues/4041)) ([#4056](https://github.com/dynamic-labs/DynamicAuth/issues/4056)) ([78f34cb](https://github.com/dynamic-labs/DynamicAuth/commit/78f34cbedf127c301997a72e058f9a4ff62badad))
|
|
8
|
+
* show full passkey name on management view ([#4057](https://github.com/dynamic-labs/DynamicAuth/issues/4057)) ([be9c65a](https://github.com/dynamic-labs/DynamicAuth/commit/be9c65a04143b7253b9b6641e153cb100f626343)), closes [#4043](https://github.com/dynamic-labs/DynamicAuth/issues/4043)
|
|
9
|
+
* make passkey recovery more easily discoverable ([#4058](https://github.com/dynamic-labs/DynamicAuth/issues/4058)) ([#4061](https://github.com/dynamic-labs/DynamicAuth/issues/4061)) ([93c4c4f](https://github.com/dynamic-labs/DynamicAuth/commit/93c4c4fb563bc723e3cd180ba44925db87b25459))
|
|
10
|
+
* fix network picker when using embedded wallet ([#4054](https://github.com/dynamic-labs/DynamicAuth/issues/4054)) ([3bac838](https://github.com/dynamic-labs/DynamicAuth/commit/3bac838d434464ab33bca0fefb0c53208014f41b))
|
|
11
|
+
* clear project settings on page refresh ([#3826](https://github.com/dynamic-labs/DynamicAuth/issues/3826)) ([#4039](https://github.com/dynamic-labs/DynamicAuth/issues/4039)) ([bfbb7b2](https://github.com/dynamic-labs/DynamicAuth/commit/bfbb7b2c3349895e0812c3e884a1e71e4ab84c58))
|
|
12
|
+
* add close button to wallets list ([#4036](https://github.com/dynamic-labs/DynamicAuth/issues/4036)) ([#4046](https://github.com/dynamic-labs/DynamicAuth/issues/4046)) ([6e4038d](https://github.com/dynamic-labs/DynamicAuth/commit/6e4038d49de5c26ceda9be723298daaef4bf8356))
|
|
13
|
+
|
|
2
14
|
### [0.19.4](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.3...v0.19.4) (2023-11-29)
|
|
3
15
|
|
|
4
16
|
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/sdk-react-core",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"react-focus-lock": "2.9.2",
|
|
18
18
|
"react-i18next": "^13.2.0",
|
|
19
19
|
"yup": "0.32.11",
|
|
20
|
-
"@dynamic-labs/ethereum": "0.19.
|
|
21
|
-
"@dynamic-labs/logger": "0.19.
|
|
22
|
-
"@dynamic-labs/multi-wallet": "0.19.
|
|
23
|
-
"@dynamic-labs/rpc-providers": "0.19.
|
|
24
|
-
"@dynamic-labs/types": "0.19.
|
|
25
|
-
"@dynamic-labs/utils": "0.19.
|
|
26
|
-
"@dynamic-labs/wallet-book": "0.19.
|
|
27
|
-
"@dynamic-labs/wallet-connector-core": "0.19.
|
|
20
|
+
"@dynamic-labs/ethereum": "0.19.5",
|
|
21
|
+
"@dynamic-labs/logger": "0.19.5",
|
|
22
|
+
"@dynamic-labs/multi-wallet": "0.19.5",
|
|
23
|
+
"@dynamic-labs/rpc-providers": "0.19.5",
|
|
24
|
+
"@dynamic-labs/types": "0.19.5",
|
|
25
|
+
"@dynamic-labs/utils": "0.19.5",
|
|
26
|
+
"@dynamic-labs/wallet-book": "0.19.5",
|
|
27
|
+
"@dynamic-labs/wallet-connector-core": "0.19.5",
|
|
28
28
|
"eventemitter3": "5.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
package/src/index.cjs
CHANGED
|
@@ -149,12 +149,13 @@ require('formik');
|
|
|
149
149
|
require('viem');
|
|
150
150
|
require('./lib/components/IconButton/IconButton.cjs');
|
|
151
151
|
require('./lib/components/Alert/Alert.cjs');
|
|
152
|
-
var
|
|
152
|
+
var usePasskeyRecovery = require('./lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs');
|
|
153
153
|
require('./lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
154
154
|
var useWalletItemActions = require('./lib/utils/hooks/useWalletItemActions/useWalletItemActions.cjs');
|
|
155
155
|
var useAuthenticateConnectedUser = require('./lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.cjs');
|
|
156
156
|
require('./lib/context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
157
157
|
require('./lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
158
|
+
var useEmbeddedWallet = require('./lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.cjs');
|
|
158
159
|
var useIsLoggedIn = require('./lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.cjs');
|
|
159
160
|
var DynamicConnectButton = require('./lib/components/DynamicConnectButton/DynamicConnectButton.cjs');
|
|
160
161
|
require('./lib/components/Popper/Popper/Popper.cjs');
|
|
@@ -305,9 +306,10 @@ exports.useEmailVerificationRequest = useEmailVerificationRequest.useEmailVerifi
|
|
|
305
306
|
exports.DynamicWidgetContextProvider = DynamicWidgetContext.DynamicWidgetContextProvider;
|
|
306
307
|
exports.useSocialAccounts = useSocialAccounts.useSocialAccounts;
|
|
307
308
|
exports.useUserUpdateRequest = useUserUpdateRequest.useUserUpdateRequest;
|
|
308
|
-
exports.
|
|
309
|
+
exports.usePasskeyRecovery = usePasskeyRecovery.usePasskeyRecovery;
|
|
309
310
|
exports.useWalletItemActions = useWalletItemActions.useWalletItemActions;
|
|
310
311
|
exports.useAuthenticateConnectedUser = useAuthenticateConnectedUser.useAuthenticateConnectedUser;
|
|
312
|
+
exports.useEmbeddedWallet = useEmbeddedWallet.useEmbeddedWallet;
|
|
311
313
|
exports.useIsLoggedIn = useIsLoggedIn.useIsLoggedIn;
|
|
312
314
|
exports.DynamicConnectButton = DynamicConnectButton.DynamicConnectButton;
|
|
313
315
|
exports.WalletList = WalletList.WalletList;
|
package/src/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { classNames } from './lib/utils/functions/classNames';
|
|
|
23
23
|
export { getNetwork } from './lib/utils/functions/getNetwork';
|
|
24
24
|
export * from './lib/utils/functions/walletFilters';
|
|
25
25
|
export { DynamicWidgetContextProvider } from './lib/widgets/DynamicWidget/context';
|
|
26
|
-
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, useIsLoggedIn, } from './lib/utils/hooks';
|
|
26
|
+
export { useWalletItemActions, useAuthenticateConnectedUser, useSocialAccounts, useEmbeddedWallet, usePasskeyRecovery, useIsLoggedIn, } from './lib/utils/hooks';
|
|
27
27
|
export { useUserUpdateRequest } from './lib/utils/hooks';
|
|
28
28
|
export { type VerifyEmailCallback, useEmailVerificationRequest, } from './lib/utils/hooks/authenticationHooks/';
|
|
29
29
|
export type { UpdateUserFieldsArg } from './lib/utils/hooks/';
|
package/src/index.js
CHANGED
|
@@ -145,12 +145,13 @@ import 'formik';
|
|
|
145
145
|
import 'viem';
|
|
146
146
|
import './lib/components/IconButton/IconButton.js';
|
|
147
147
|
import './lib/components/Alert/Alert.js';
|
|
148
|
-
export {
|
|
148
|
+
export { usePasskeyRecovery } from './lib/utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js';
|
|
149
149
|
import './lib/widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
150
150
|
export { useWalletItemActions } from './lib/utils/hooks/useWalletItemActions/useWalletItemActions.js';
|
|
151
151
|
export { useAuthenticateConnectedUser } from './lib/utils/hooks/useAuthenticateConnectedUser/useAuthenticateConnectedUser.js';
|
|
152
152
|
import './lib/context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
153
153
|
import './lib/utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
154
|
+
export { useEmbeddedWallet } from './lib/utils/hooks/useEmbeddedWallet/useEmbeddedWallet.js';
|
|
154
155
|
export { useIsLoggedIn } from './lib/utils/hooks/useIsLoggedIn/useIsLoggedIn.js';
|
|
155
156
|
export { DynamicConnectButton } from './lib/components/DynamicConnectButton/DynamicConnectButton.js';
|
|
156
157
|
import './lib/components/Popper/Popper/Popper.js';
|
|
@@ -5,18 +5,97 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var reactI18next = require('react-i18next');
|
|
7
7
|
var useInternalDynamicContext = require('../../context/DynamicContext/useInternalDynamicContext.cjs');
|
|
8
|
+
require('react');
|
|
9
|
+
require('@dynamic-labs/utils');
|
|
10
|
+
require('@dynamic-labs/sdk-api');
|
|
11
|
+
require('../../config/ApiEndpoint.cjs');
|
|
12
|
+
require('../../shared/logger.cjs');
|
|
13
|
+
require('@dynamic-labs/iconic');
|
|
14
|
+
require('@dynamic-labs/wallet-connector-core');
|
|
15
|
+
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
16
|
+
require('@dynamic-labs/wallet-book');
|
|
17
|
+
require('../../utils/constants/colors.cjs');
|
|
18
|
+
require('../../shared/utils/classes/storage/localStorage.cjs');
|
|
19
|
+
require('viem');
|
|
20
|
+
require('../../shared/consts/index.cjs');
|
|
21
|
+
require('@dynamic-labs/multi-wallet');
|
|
22
|
+
require('@dynamic-labs/rpc-providers');
|
|
23
|
+
require('../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.cjs');
|
|
24
|
+
require('../../context/ErrorContext/ErrorContext.cjs');
|
|
25
|
+
require('../../context/AccessDeniedContext/AccessDeniedContext.cjs');
|
|
26
|
+
require('../../context/AccountExistsContext/AccountExistsContext.cjs');
|
|
27
|
+
require('react-dom');
|
|
8
28
|
var Typography = require('../Typography/Typography.cjs');
|
|
29
|
+
require('../ShadowDOM/ShadowDOM.cjs');
|
|
30
|
+
require('../../context/ThemeContext/ThemeContext.cjs');
|
|
31
|
+
var classNames = require('../../utils/functions/classNames/classNames.cjs');
|
|
32
|
+
require('react-focus-lock');
|
|
33
|
+
require('../Transition/ZoomTransition/ZoomTransition.cjs');
|
|
34
|
+
require('../Transition/SlideInUpTransition/SlideInUpTransition.cjs');
|
|
35
|
+
require('../Transition/OpacityTransition/OpacityTransition.cjs');
|
|
36
|
+
var TextButton = require('../TextButton/TextButton.cjs');
|
|
37
|
+
require('../IconButton/IconButton.cjs');
|
|
38
|
+
require('../Alert/Alert.cjs');
|
|
39
|
+
require('../Popper/Popper/Popper.cjs');
|
|
40
|
+
require('../Popper/PopperContext/PopperContext.cjs');
|
|
41
|
+
require('formik');
|
|
42
|
+
require('yup');
|
|
43
|
+
require('../InlineWidget/InlineWidget.cjs');
|
|
44
|
+
require('../MenuList/Dropdown/Dropdown.cjs');
|
|
45
|
+
require('../OverlayCard/OverlayCard.context.cjs');
|
|
46
|
+
require('../../context/FooterAnimationContext/index.cjs');
|
|
47
|
+
require('../../context/MockContext/MockContext.cjs');
|
|
48
|
+
require('../../context/QrCodeContext/QrCodeContext.cjs');
|
|
49
|
+
require('../../context/WalletGroupContext/WalletGroupContext.cjs');
|
|
50
|
+
require('../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.cjs');
|
|
51
|
+
require('../../context/CaptchaContext/CaptchaContext.cjs');
|
|
52
|
+
require('../../context/EmailVerificationContext/EmailVerificationContext.cjs');
|
|
53
|
+
require('qrcode');
|
|
54
|
+
require('../../context/LoadingContext/LoadingContext.cjs');
|
|
55
|
+
require('i18next');
|
|
56
|
+
require('../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
57
|
+
require('../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.cjs');
|
|
58
|
+
require('@dynamic-labs/types');
|
|
59
|
+
require('../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.cjs');
|
|
60
|
+
require('../../context/UserFieldEditorContext/UserFieldEditorContext.cjs');
|
|
61
|
+
var usePasskeyRecovery = require('../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.cjs');
|
|
62
|
+
require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
9
63
|
|
|
10
64
|
const NeedHelpSection = () => {
|
|
65
|
+
var _a, _b, _c, _d;
|
|
11
66
|
const { projectSettings } = useInternalDynamicContext.useInternalDynamicContext();
|
|
12
67
|
const { t } = reactI18next.useTranslation();
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
68
|
+
const { initPasskeyRecoveryProcess } = usePasskeyRecovery.usePasskeyRecovery();
|
|
69
|
+
const { view } = ViewContext.useViewContext();
|
|
70
|
+
const supportEmail = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportEmail;
|
|
71
|
+
const supportUrl = ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _b === void 0 ? void 0 : _b.supportUrls) &&
|
|
72
|
+
((_c = Object.values(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.supportUrls)) === null || _c === void 0 ? void 0 : _c[0]);
|
|
73
|
+
// don't show passkey recovery helper on passkey creation flow views
|
|
74
|
+
const isRecoveryEnabled = !view.startsWith('passkey') &&
|
|
75
|
+
Boolean((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.passkeyEmbeddedWalletRecoveryEnabled);
|
|
76
|
+
const hasContactInfo = Boolean(supportEmail || supportUrl);
|
|
77
|
+
const getSupportHelpSession = () => {
|
|
78
|
+
if (!hasContactInfo) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return (jsxRuntime.jsxs("div", { className: 'need-help-section__links', children: [supportUrl && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'link', children: jsxRuntime.jsx("a", { href: supportUrl, rel: 'noreferrer', target: '_blank', children: t('dyn_need_help_section.contact_support') }) })), supportEmail && (jsxRuntime.jsx(Typography.Typography, { variant: 'body_small', color: 'link', children: jsxRuntime.jsx("a", { href: `mailto:${supportEmail}`, children: supportEmail }) }))] }));
|
|
82
|
+
};
|
|
83
|
+
const getPasskeyRecoverySession = () => {
|
|
84
|
+
if (!isRecoveryEnabled) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
const recoveryText = t('dyn_need_help_section.recovery_button');
|
|
88
|
+
const finalRecoveryText = hasContactInfo
|
|
89
|
+
? recoveryText
|
|
90
|
+
: recoveryText.slice(0, 1).toUpperCase() + recoveryText.slice(1);
|
|
91
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasContactInfo && (jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_need_help_section.divider') })), jsxRuntime.jsx(TextButton.TextButton, { className: classNames.classNames('helper-link', {
|
|
92
|
+
'need-help-section--captalize': !hasContactInfo,
|
|
93
|
+
}), onClick: initPasskeyRecoveryProcess, children: finalRecoveryText })] }));
|
|
94
|
+
};
|
|
95
|
+
if (!hasContactInfo && !isRecoveryEnabled) {
|
|
17
96
|
return null;
|
|
18
97
|
}
|
|
19
|
-
return (jsxRuntime.jsxs("div", { className: 'need-help-section', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_need_help_section.info') }),
|
|
98
|
+
return (jsxRuntime.jsxs("div", { className: 'need-help-section', children: [jsxRuntime.jsx(Typography.Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_need_help_section.info') }), getSupportHelpSession(), getPasskeyRecoverySession()] }));
|
|
20
99
|
};
|
|
21
100
|
|
|
22
101
|
exports.NeedHelpSection = NeedHelpSection;
|
|
@@ -1,18 +1,97 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { useInternalDynamicContext } from '../../context/DynamicContext/useInternalDynamicContext.js';
|
|
4
|
+
import 'react';
|
|
5
|
+
import '@dynamic-labs/utils';
|
|
6
|
+
import '@dynamic-labs/sdk-api';
|
|
7
|
+
import '../../config/ApiEndpoint.js';
|
|
8
|
+
import '../../shared/logger.js';
|
|
9
|
+
import '@dynamic-labs/iconic';
|
|
10
|
+
import '@dynamic-labs/wallet-connector-core';
|
|
11
|
+
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
12
|
+
import '@dynamic-labs/wallet-book';
|
|
13
|
+
import '../../utils/constants/colors.js';
|
|
14
|
+
import '../../shared/utils/classes/storage/localStorage.js';
|
|
15
|
+
import 'viem';
|
|
16
|
+
import '../../shared/consts/index.js';
|
|
17
|
+
import '@dynamic-labs/multi-wallet';
|
|
18
|
+
import '@dynamic-labs/rpc-providers';
|
|
19
|
+
import '../../utils/hooks/useWallets/utils/verifyMagicIsSetup/verifyMagicIsSetup.js';
|
|
20
|
+
import '../../context/ErrorContext/ErrorContext.js';
|
|
21
|
+
import '../../context/AccessDeniedContext/AccessDeniedContext.js';
|
|
22
|
+
import '../../context/AccountExistsContext/AccountExistsContext.js';
|
|
23
|
+
import 'react-dom';
|
|
4
24
|
import { Typography } from '../Typography/Typography.js';
|
|
25
|
+
import '../ShadowDOM/ShadowDOM.js';
|
|
26
|
+
import '../../context/ThemeContext/ThemeContext.js';
|
|
27
|
+
import { classNames } from '../../utils/functions/classNames/classNames.js';
|
|
28
|
+
import 'react-focus-lock';
|
|
29
|
+
import '../Transition/ZoomTransition/ZoomTransition.js';
|
|
30
|
+
import '../Transition/SlideInUpTransition/SlideInUpTransition.js';
|
|
31
|
+
import '../Transition/OpacityTransition/OpacityTransition.js';
|
|
32
|
+
import { TextButton } from '../TextButton/TextButton.js';
|
|
33
|
+
import '../IconButton/IconButton.js';
|
|
34
|
+
import '../Alert/Alert.js';
|
|
35
|
+
import '../Popper/Popper/Popper.js';
|
|
36
|
+
import '../Popper/PopperContext/PopperContext.js';
|
|
37
|
+
import 'formik';
|
|
38
|
+
import 'yup';
|
|
39
|
+
import '../InlineWidget/InlineWidget.js';
|
|
40
|
+
import '../MenuList/Dropdown/Dropdown.js';
|
|
41
|
+
import '../OverlayCard/OverlayCard.context.js';
|
|
42
|
+
import '../../context/FooterAnimationContext/index.js';
|
|
43
|
+
import '../../context/MockContext/MockContext.js';
|
|
44
|
+
import '../../context/QrCodeContext/QrCodeContext.js';
|
|
45
|
+
import '../../context/WalletGroupContext/WalletGroupContext.js';
|
|
46
|
+
import '../../widgets/DynamicWidget/components/DynamicWidgetHeader/DynamicWidgetHeader.js';
|
|
47
|
+
import '../../context/CaptchaContext/CaptchaContext.js';
|
|
48
|
+
import '../../context/EmailVerificationContext/EmailVerificationContext.js';
|
|
49
|
+
import 'qrcode';
|
|
50
|
+
import '../../context/LoadingContext/LoadingContext.js';
|
|
51
|
+
import 'i18next';
|
|
52
|
+
import '../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
53
|
+
import '../UserProfile/parts/UserProfileField/components/VerifiedEmailIcon/VerifiedEmailIcon.js';
|
|
54
|
+
import '@dynamic-labs/types';
|
|
55
|
+
import '../../utils/hooks/useUserUpdateRequest/useUpdateUser/useUpdateUser.js';
|
|
56
|
+
import '../../context/UserFieldEditorContext/UserFieldEditorContext.js';
|
|
57
|
+
import { usePasskeyRecovery } from '../../utils/hooks/usePasskeyRecovery/usePasskeyRecovery.js';
|
|
58
|
+
import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
5
59
|
|
|
6
60
|
const NeedHelpSection = () => {
|
|
61
|
+
var _a, _b, _c, _d;
|
|
7
62
|
const { projectSettings } = useInternalDynamicContext();
|
|
8
63
|
const { t } = useTranslation();
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
64
|
+
const { initPasskeyRecoveryProcess } = usePasskeyRecovery();
|
|
65
|
+
const { view } = useViewContext();
|
|
66
|
+
const supportEmail = (_a = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _a === void 0 ? void 0 : _a.supportEmail;
|
|
67
|
+
const supportUrl = ((_b = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general) === null || _b === void 0 ? void 0 : _b.supportUrls) &&
|
|
68
|
+
((_c = Object.values(projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.general.supportUrls)) === null || _c === void 0 ? void 0 : _c[0]);
|
|
69
|
+
// don't show passkey recovery helper on passkey creation flow views
|
|
70
|
+
const isRecoveryEnabled = !view.startsWith('passkey') &&
|
|
71
|
+
Boolean((_d = projectSettings === null || projectSettings === void 0 ? void 0 : projectSettings.sdk) === null || _d === void 0 ? void 0 : _d.passkeyEmbeddedWalletRecoveryEnabled);
|
|
72
|
+
const hasContactInfo = Boolean(supportEmail || supportUrl);
|
|
73
|
+
const getSupportHelpSession = () => {
|
|
74
|
+
if (!hasContactInfo) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
return (jsxs("div", { className: 'need-help-section__links', children: [supportUrl && (jsx(Typography, { variant: 'body_small', color: 'link', children: jsx("a", { href: supportUrl, rel: 'noreferrer', target: '_blank', children: t('dyn_need_help_section.contact_support') }) })), supportEmail && (jsx(Typography, { variant: 'body_small', color: 'link', children: jsx("a", { href: `mailto:${supportEmail}`, children: supportEmail }) }))] }));
|
|
78
|
+
};
|
|
79
|
+
const getPasskeyRecoverySession = () => {
|
|
80
|
+
if (!isRecoveryEnabled) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const recoveryText = t('dyn_need_help_section.recovery_button');
|
|
84
|
+
const finalRecoveryText = hasContactInfo
|
|
85
|
+
? recoveryText
|
|
86
|
+
: recoveryText.slice(0, 1).toUpperCase() + recoveryText.slice(1);
|
|
87
|
+
return (jsxs(Fragment, { children: [hasContactInfo && (jsx(Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_need_help_section.divider') })), jsx(TextButton, { className: classNames('helper-link', {
|
|
88
|
+
'need-help-section--captalize': !hasContactInfo,
|
|
89
|
+
}), onClick: initPasskeyRecoveryProcess, children: finalRecoveryText })] }));
|
|
90
|
+
};
|
|
91
|
+
if (!hasContactInfo && !isRecoveryEnabled) {
|
|
13
92
|
return null;
|
|
14
93
|
}
|
|
15
|
-
return (jsxs("div", { className: 'need-help-section', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_need_help_section.info') }),
|
|
94
|
+
return (jsxs("div", { className: 'need-help-section', children: [jsx(Typography, { color: 'secondary', variant: 'body_small', children: t('dyn_need_help_section.info') }), getSupportHelpSession(), getPasskeyRecoverySession()] }));
|
|
16
95
|
};
|
|
17
96
|
|
|
18
97
|
export { NeedHelpSection };
|
|
@@ -89,20 +89,18 @@ const Header = ({ onClose: handleClose, heading, projectSettings, walletConnecto
|
|
|
89
89
|
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name,
|
|
90
90
|
clearStatesOnBackClick,
|
|
91
91
|
]);
|
|
92
|
-
const leadingButtons = React.useMemo(() => {
|
|
93
|
-
let buttons = [];
|
|
94
|
-
if (showBackButton) {
|
|
95
|
-
buttons = [
|
|
96
|
-
...buttons,
|
|
97
|
-
jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }, 'back-button'),
|
|
98
|
-
];
|
|
99
|
-
}
|
|
100
|
-
return buttons;
|
|
101
|
-
}, [handleBackClick, showBackButton]);
|
|
102
92
|
const closeButton = showCloseButton && handleClose && (jsxRuntime.jsx(IconButton.IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'header__icon', children: jsxRuntime.jsx(close.ReactComponent, {}) }));
|
|
103
93
|
const infoButton = showHelpContent && (jsxRuntime.jsx(Tooltip.Tooltip, { content: 'Need some help?', className: 'header__tooltip', children: jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon', children: isWalletListTypeView ? jsxRuntime.jsx(questionMark.ReactComponent, {}) : jsxRuntime.jsx(footerInfoIcon.ReactComponent, {}) }) }, 'info-button'));
|
|
94
|
+
const leadingButtons = [];
|
|
95
|
+
if (showBackButton) {
|
|
96
|
+
leadingButtons.push(jsxRuntime.jsx(IconButton.IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsxRuntime.jsx(arrowLeft.ReactComponent, {}) }, 'back-button'));
|
|
97
|
+
}
|
|
98
|
+
// if has close button and info button, info button should be on the right
|
|
99
|
+
if (closeButton && infoButton) {
|
|
100
|
+
leadingButtons.push(infoButton);
|
|
101
|
+
}
|
|
104
102
|
const qrCodePreHeader = (jsxRuntime.jsxs("div", { className: 'qr-code-view__scan-issue-message', children: [jsxRuntime.jsx(Typography.Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsxRuntime.jsx("button", { className: 'qr-code-view__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] }));
|
|
105
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: leadingButtons, trailing:
|
|
103
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(ModalHeader.ModalHeader, { leading: leadingButtons, trailing: closeButton || infoButton, displayBorder: displayBorderBelowHeader, children: jsxRuntime.jsx(Typography.Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: !projectSettings ? (jsxRuntime.jsx(Skeleton.Skeleton, { className: 'header__skeleton' })) : (heading) }) }), showQrCodePreHeader && qrCodePreHeader] }));
|
|
106
104
|
};
|
|
107
105
|
|
|
108
106
|
exports.Header = Header;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useCallback
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
3
|
import { Typography } from '../../../components/Typography/Typography.js';
|
|
4
4
|
import '@dynamic-labs/sdk-api';
|
|
5
5
|
import '../../../shared/logger.js';
|
|
@@ -85,20 +85,18 @@ const Header = ({ onClose: handleClose, heading, projectSettings, walletConnecto
|
|
|
85
85
|
selectedWalletConnector === null || selectedWalletConnector === void 0 ? void 0 : selectedWalletConnector.name,
|
|
86
86
|
clearStatesOnBackClick,
|
|
87
87
|
]);
|
|
88
|
-
const leadingButtons = useMemo(() => {
|
|
89
|
-
let buttons = [];
|
|
90
|
-
if (showBackButton) {
|
|
91
|
-
buttons = [
|
|
92
|
-
...buttons,
|
|
93
|
-
jsx(IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsx(SvgArrowLeft, {}) }, 'back-button'),
|
|
94
|
-
];
|
|
95
|
-
}
|
|
96
|
-
return buttons;
|
|
97
|
-
}, [handleBackClick, showBackButton]);
|
|
98
88
|
const closeButton = showCloseButton && handleClose && (jsx(IconButton, { onClick: handleClose, type: 'button', id: 'close-button', "data-testid": 'close-button', className: 'header__icon', children: jsx(SvgClose, {}) }));
|
|
99
89
|
const infoButton = showHelpContent && (jsx(Tooltip, { content: 'Need some help?', className: 'header__tooltip', children: jsx(IconButton, { type: 'button', onClick: () => setIsFooterExpanded(!isFooterExpanded), "data-testid": 'info-button', className: 'header__icon', children: isWalletListTypeView ? jsx(SvgQuestionMark, {}) : jsx(SvgFooterInfoIcon, {}) }) }, 'info-button'));
|
|
90
|
+
const leadingButtons = [];
|
|
91
|
+
if (showBackButton) {
|
|
92
|
+
leadingButtons.push(jsx(IconButton, { type: 'button', onClick: handleBackClick, "data-testid": 'back-button', className: 'header__icon', children: jsx(SvgArrowLeft, {}) }, 'back-button'));
|
|
93
|
+
}
|
|
94
|
+
// if has close button and info button, info button should be on the right
|
|
95
|
+
if (closeButton && infoButton) {
|
|
96
|
+
leadingButtons.push(infoButton);
|
|
97
|
+
}
|
|
100
98
|
const qrCodePreHeader = (jsxs("div", { className: 'qr-code-view__scan-issue-message', children: [jsx(Typography, { color: 'primary', variant: 'body_small', children: "If you're having issues scanning, click\u00A0" }), jsx("button", { className: 'qr-code-view__scan-issue-button', onClick: () => setShowQrCodeImage(true), children: "here" })] }));
|
|
101
|
-
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: leadingButtons, trailing:
|
|
99
|
+
return (jsxs(Fragment, { children: [jsx(ModalHeader, { leading: leadingButtons, trailing: closeButton || infoButton, displayBorder: displayBorderBelowHeader, children: jsx(Typography, { as: 'h1', variant: 'title', color: 'primary', "data-testid": 'dynamic-auth-modal-heading', className: 'header__typography', children: !projectSettings ? (jsx(Skeleton, { className: 'header__skeleton' })) : (heading) }) }), showQrCodePreHeader && qrCodePreHeader] }));
|
|
102
100
|
};
|
|
103
101
|
|
|
104
102
|
export { Header };
|
|
@@ -372,13 +372,17 @@ const translation = {
|
|
|
372
372
|
* @description copy key for Dynamic need help footer section
|
|
373
373
|
* @default
|
|
374
374
|
* {
|
|
375
|
-
info: '
|
|
376
|
-
contact_support: 'Contact
|
|
375
|
+
info: 'Can’t find your passkey?',
|
|
376
|
+
contact_support: 'Contact support',
|
|
377
|
+
divider: 'or',
|
|
378
|
+
recovery_button: 'generate a new one.',
|
|
377
379
|
}
|
|
378
380
|
*/
|
|
379
381
|
dyn_need_help_section: {
|
|
380
|
-
info: '
|
|
382
|
+
info: 'Can’t find your passkey?',
|
|
381
383
|
contact_support: 'Contact support',
|
|
384
|
+
divider: 'or',
|
|
385
|
+
recovery_button: 'generate a new one.',
|
|
382
386
|
},
|
|
383
387
|
/**
|
|
384
388
|
* @description copy keys for network not supported view
|
|
@@ -367,13 +367,17 @@ export declare const translation: {
|
|
|
367
367
|
* @description copy key for Dynamic need help footer section
|
|
368
368
|
* @default
|
|
369
369
|
* {
|
|
370
|
-
info: '
|
|
371
|
-
contact_support: 'Contact
|
|
370
|
+
info: 'Can’t find your passkey?',
|
|
371
|
+
contact_support: 'Contact support',
|
|
372
|
+
divider: 'or',
|
|
373
|
+
recovery_button: 'generate a new one.',
|
|
372
374
|
}
|
|
373
375
|
*/
|
|
374
376
|
dyn_need_help_section: {
|
|
375
377
|
info: string;
|
|
376
378
|
contact_support: string;
|
|
379
|
+
divider: string;
|
|
380
|
+
recovery_button: string;
|
|
377
381
|
};
|
|
378
382
|
/**
|
|
379
383
|
* @description copy keys for network not supported view
|
|
@@ -368,13 +368,17 @@ const translation = {
|
|
|
368
368
|
* @description copy key for Dynamic need help footer section
|
|
369
369
|
* @default
|
|
370
370
|
* {
|
|
371
|
-
info: '
|
|
372
|
-
contact_support: 'Contact
|
|
371
|
+
info: 'Can’t find your passkey?',
|
|
372
|
+
contact_support: 'Contact support',
|
|
373
|
+
divider: 'or',
|
|
374
|
+
recovery_button: 'generate a new one.',
|
|
373
375
|
}
|
|
374
376
|
*/
|
|
375
377
|
dyn_need_help_section: {
|
|
376
|
-
info: '
|
|
378
|
+
info: 'Can’t find your passkey?',
|
|
377
379
|
contact_support: 'Contact support',
|
|
380
|
+
divider: 'or',
|
|
381
|
+
recovery_button: 'generate a new one.',
|
|
378
382
|
},
|
|
379
383
|
/**
|
|
380
384
|
* @description copy keys for network not supported view
|
|
@@ -8,7 +8,7 @@ const TurnkeyErrorMap = {
|
|
|
8
8
|
3: 'You reached the limit of passkeys for this account.',
|
|
9
9
|
};
|
|
10
10
|
const DOMExceptionErrorMap = {
|
|
11
|
-
NotAllowedError: '
|
|
11
|
+
NotAllowedError: 'Request Cancelled. Select a device or password manager to set up a passkey.',
|
|
12
12
|
};
|
|
13
13
|
const getProperErrorMessage = (originalError) => {
|
|
14
14
|
var _a, _b;
|
|
@@ -4,7 +4,7 @@ const TurnkeyErrorMap = {
|
|
|
4
4
|
3: 'You reached the limit of passkeys for this account.',
|
|
5
5
|
};
|
|
6
6
|
const DOMExceptionErrorMap = {
|
|
7
|
-
NotAllowedError: '
|
|
7
|
+
NotAllowedError: 'Request Cancelled. Select a device or password manager to set up a passkey.',
|
|
8
8
|
};
|
|
9
9
|
const getProperErrorMessage = (originalError) => {
|
|
10
10
|
var _a, _b;
|