@dynamic-labs/sdk-react-core 2.1.0-alpha.15 → 2.1.0-alpha.16
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 +9 -0
- package/package.cjs +3 -2
- package/package.js +3 -2
- package/package.json +13 -12
- package/src/index.cjs +0 -2
- package/src/index.d.ts +1 -3
- package/src/index.js +0 -1
- package/src/lib/components/Portal/Portal.cjs +3 -1
- package/src/lib/components/Portal/Portal.js +3 -1
- package/src/lib/context/DynamicContext/DynamicContext.cjs +19 -14
- package/src/lib/context/DynamicContext/DynamicContext.js +19 -14
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/types.d.ts +0 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.cjs +5 -1
- package/src/lib/context/DynamicContext/hooks/useHandleLogout/useHandleLogout.js +5 -1
- package/src/lib/context/DynamicContext/types/index.d.ts +4 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.cjs +2 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.d.ts +1 -1
- package/src/lib/context/DynamicContext/useDynamicContext/useDynamicContext.js +2 -1
- package/src/lib/context/DynamicContext/validators/validators.cjs +0 -29
- package/src/lib/context/DynamicContext/validators/validators.d.ts +0 -2
- package/src/lib/context/DynamicContext/validators/validators.js +1 -29
- package/src/lib/context/ViewContext/types/index.d.ts +1 -1
- package/src/lib/locale/en/translation.cjs +18 -0
- package/src/lib/locale/en/translation.d.ts +18 -0
- package/src/lib/locale/en/translation.js +18 -0
- package/src/lib/shared/utils/classes/storage/localStorage.cjs +1 -8
- package/src/lib/shared/utils/classes/storage/localStorage.js +2 -9
- package/src/lib/shared/utils/functions/index.d.ts +0 -1
- package/src/lib/store/actions/storeActions/index.d.ts +1 -0
- package/src/lib/store/actions/storeActions/storeActions.cjs +10 -0
- package/src/lib/store/actions/storeActions/storeActions.d.ts +1 -0
- package/src/lib/store/actions/storeActions/storeActions.js +6 -0
- package/src/lib/store/actions/userActions/index.d.ts +1 -0
- package/src/lib/store/actions/userActions/userActions.cjs +10 -0
- package/src/lib/store/actions/userActions/userActions.d.ts +7 -0
- package/src/lib/store/actions/userActions/userActions.js +6 -0
- package/src/lib/store/hooks/useUser/index.d.ts +1 -0
- package/src/lib/store/hooks/useUser/useUser.cjs +12 -0
- package/src/lib/store/hooks/useUser/useUser.d.ts +1 -0
- package/src/lib/store/hooks/useUser/useUser.js +8 -0
- package/src/lib/store/index.d.ts +4 -0
- package/src/lib/store/store.cjs +24 -0
- package/src/lib/store/store.d.ts +13 -0
- package/src/lib/store/store.js +19 -0
- package/src/lib/store/types.d.ts +4 -0
- package/src/lib/store/utils/createStore/createStore.cjs +21 -0
- package/src/lib/store/utils/createStore/createStore.d.ts +16 -0
- package/src/lib/store/utils/createStore/createStore.js +17 -0
- package/src/lib/store/utils/createStore/index.d.ts +1 -0
- package/src/lib/store/utils/syncLegacyStorage/index.d.ts +1 -0
- package/src/lib/store/utils/syncLegacyStorage/syncLegacyStorage.cjs +30 -0
- package/src/lib/store/utils/syncLegacyStorage/syncLegacyStorage.d.ts +2 -0
- package/src/lib/store/utils/syncLegacyStorage/syncLegacyStorage.js +26 -0
- package/src/lib/styles/index.shadow.cjs +1 -1
- package/src/lib/styles/index.shadow.js +1 -1
- package/src/lib/utils/constants/index.d.ts +1 -1
- package/src/lib/utils/constants/localStorage.cjs +2 -2
- package/src/lib/utils/constants/localStorage.d.ts +1 -1
- package/src/lib/utils/constants/localStorage.js +2 -2
- package/src/lib/utils/functions/downloadFile/downloadFile.cjs +15 -0
- package/src/lib/utils/functions/downloadFile/downloadFile.d.ts +1 -0
- package/src/lib/utils/functions/downloadFile/downloadFile.js +11 -0
- package/src/lib/utils/functions/downloadFile/index.d.ts +1 -0
- package/src/lib/utils/functions/index.d.ts +1 -0
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.cjs +4 -2
- package/src/lib/utils/hooks/useAuthLayoutChecks/useAuthLayoutChecks.js +4 -2
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.cjs +4 -0
- package/src/lib/utils/hooks/useDynamicLayoutData/useDynamicLayoutData.js +4 -0
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.cjs +6 -3
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.d.ts +1 -4
- package/src/lib/utils/hooks/useHandleUnlinkWallet/useHandleUnlinkWallet.js +5 -2
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.cjs +6 -2
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.d.ts +1 -4
- package/src/lib/utils/hooks/usePrimaryWalletId/usePrimaryWalletId.js +5 -1
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.cjs +5 -10
- package/src/lib/views/CreatePasswordView/SavePasswordStep/SavePasswordStep.js +5 -10
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs +111 -0
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.d.ts +2 -0
- package/src/lib/views/MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js +107 -0
- package/src/lib/views/MfaDisplayBackupCodesView/index.d.ts +1 -0
- package/src/lib/views/MfaVerificationView/MfaVerificationView.cjs +3 -3
- package/src/lib/views/MfaVerificationView/MfaVerificationView.js +3 -3
- package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.cjs +1 -1
- package/src/lib/views/WalletList/WalletListGridTabs/WalletListGridTabs.js +1 -1
- package/src/lib/views/WalletList/hooks/useTabState.cjs +4 -1
- package/src/lib/views/WalletList/hooks/useTabState.js +4 -1
- package/src/lib/views/WalletList/utils/getInitialTabIndex/getInitialTabIndex.cjs +22 -0
- package/src/lib/views/WalletList/utils/getInitialTabIndex/getInitialTabIndex.d.ts +2 -0
- package/src/lib/views/WalletList/utils/getInitialTabIndex/getInitialTabIndex.js +18 -0
- package/src/lib/views/WalletList/utils/getInitialTabIndex/index.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.cjs +2 -0
- package/src/lib/views/viewToComponentMap.d.ts +1 -0
- package/src/lib/views/viewToComponentMap.js +2 -0
- package/src/lib/shared/utils/functions/validateType/index.d.ts +0 -1
- package/src/lib/shared/utils/functions/validateType/validateType.cjs +0 -30
- package/src/lib/shared/utils/functions/validateType/validateType.d.ts +0 -1
- package/src/lib/shared/utils/functions/validateType/validateType.js +0 -26
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MfaDisplayBackupCodesView';
|
|
@@ -15,7 +15,7 @@ require('@dynamic-labs/sdk-api-core');
|
|
|
15
15
|
require('../../shared/logger.cjs');
|
|
16
16
|
require('@dynamic-labs/iconic');
|
|
17
17
|
require('@dynamic-labs/wallet-connector-core');
|
|
18
|
-
require('../../context/ViewContext/ViewContext.cjs');
|
|
18
|
+
var ViewContext = require('../../context/ViewContext/ViewContext.cjs');
|
|
19
19
|
var passwordHero = require('../../shared/assets/password-hero.cjs');
|
|
20
20
|
require('@dynamic-labs/wallet-book');
|
|
21
21
|
require('../../utils/constants/colors.cjs');
|
|
@@ -79,6 +79,7 @@ require('../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/
|
|
|
79
79
|
|
|
80
80
|
const MfaVerificationView = ({ type }) => {
|
|
81
81
|
const { t } = reactI18next.useTranslation();
|
|
82
|
+
const { setView } = ViewContext.useViewContext();
|
|
82
83
|
const { authDevice } = useMfa.useMfa();
|
|
83
84
|
const [code, setCode] = React.useState('');
|
|
84
85
|
const [error, setError] = React.useState();
|
|
@@ -90,8 +91,7 @@ const MfaVerificationView = ({ type }) => {
|
|
|
90
91
|
},
|
|
91
92
|
onResolve: () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
92
93
|
yield utils.sleep(1500);
|
|
93
|
-
|
|
94
|
-
//setView('mfa-display-backup-codes');
|
|
94
|
+
setView('mfa-display-backup-codes');
|
|
95
95
|
}),
|
|
96
96
|
});
|
|
97
97
|
const onCodeChange = (code) => {
|
|
@@ -11,7 +11,7 @@ import '@dynamic-labs/sdk-api-core';
|
|
|
11
11
|
import '../../shared/logger.js';
|
|
12
12
|
import '@dynamic-labs/iconic';
|
|
13
13
|
import '@dynamic-labs/wallet-connector-core';
|
|
14
|
-
import '../../context/ViewContext/ViewContext.js';
|
|
14
|
+
import { useViewContext } from '../../context/ViewContext/ViewContext.js';
|
|
15
15
|
import { ReactComponent as SvgPasswordHero } from '../../shared/assets/password-hero.js';
|
|
16
16
|
import '@dynamic-labs/wallet-book';
|
|
17
17
|
import '../../utils/constants/colors.js';
|
|
@@ -75,6 +75,7 @@ import '../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/P
|
|
|
75
75
|
|
|
76
76
|
const MfaVerificationView = ({ type }) => {
|
|
77
77
|
const { t } = useTranslation();
|
|
78
|
+
const { setView } = useViewContext();
|
|
78
79
|
const { authDevice } = useMfa();
|
|
79
80
|
const [code, setCode] = useState('');
|
|
80
81
|
const [error, setError] = useState();
|
|
@@ -86,8 +87,7 @@ const MfaVerificationView = ({ type }) => {
|
|
|
86
87
|
},
|
|
87
88
|
onResolve: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
88
89
|
yield sleep(1500);
|
|
89
|
-
|
|
90
|
-
//setView('mfa-display-backup-codes');
|
|
90
|
+
setView('mfa-display-backup-codes');
|
|
91
91
|
}),
|
|
92
92
|
});
|
|
93
93
|
const onCodeChange = (code) => {
|
|
@@ -79,7 +79,7 @@ require('../../LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSect
|
|
|
79
79
|
const WalletListGridTabs = ({ items, onSelect, value, }) => (jsxRuntime.jsx("div", { className: 'wallet-list-grid-tabs', children: items.map((item, index) => {
|
|
80
80
|
const selected = value === index;
|
|
81
81
|
const { icon, text } = item.label;
|
|
82
|
-
const key = `${text}-${icon}`;
|
|
82
|
+
const key = `${text}-${icon}-${items.indexOf(item)}`;
|
|
83
83
|
const TabIcon = typeof icon === 'string' ? jsxRuntime.jsx("img", { src: icon, alt: text }) : icon;
|
|
84
84
|
return (jsxRuntime.jsxs("button", { type: 'button', className: classNames.classNames('wallet-list-grid-tabs__button', {
|
|
85
85
|
'wallet-list-grid-tabs__button--selected': selected,
|
|
@@ -75,7 +75,7 @@ import '../../LoginView/sections/PhoneNumberSignInSection/PhoneNumberSignInSecti
|
|
|
75
75
|
const WalletListGridTabs = ({ items, onSelect, value, }) => (jsx("div", { className: 'wallet-list-grid-tabs', children: items.map((item, index) => {
|
|
76
76
|
const selected = value === index;
|
|
77
77
|
const { icon, text } = item.label;
|
|
78
|
-
const key = `${text}-${icon}`;
|
|
78
|
+
const key = `${text}-${icon}-${items.indexOf(item)}`;
|
|
79
79
|
const TabIcon = typeof icon === 'string' ? jsx("img", { src: icon, alt: text }) : icon;
|
|
80
80
|
return (jsxs("button", { type: 'button', className: classNames('wallet-list-grid-tabs__button', {
|
|
81
81
|
'wallet-list-grid-tabs__button--selected': selected,
|
|
@@ -19,6 +19,7 @@ require('../../../utils/constants/colors.cjs');
|
|
|
19
19
|
require('../../../utils/constants/values.cjs');
|
|
20
20
|
require('../../../shared/utils/classes/storage/localStorage.cjs');
|
|
21
21
|
require('../../../shared/consts/index.cjs');
|
|
22
|
+
var useInternalDynamicContext = require('../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.cjs');
|
|
22
23
|
require('../../../context/CaptchaContext/CaptchaContext.cjs');
|
|
23
24
|
require('../../../context/ErrorContext/ErrorContext.cjs');
|
|
24
25
|
require('@dynamic-labs/multi-wallet');
|
|
@@ -73,11 +74,13 @@ require('../../../widgets/DynamicWidget/context/DynamicWidgetContext.cjs');
|
|
|
73
74
|
require('../../TransactionConfirmationView/helpers/transactionErrorMessage.cjs');
|
|
74
75
|
require('../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.cjs');
|
|
75
76
|
var useViewSettings = require('../../../utils/hooks/useViewSettings/useViewSettings.cjs');
|
|
77
|
+
var getInitialTabIndex = require('../utils/getInitialTabIndex/getInitialTabIndex.cjs');
|
|
76
78
|
|
|
77
79
|
const useTabState = () => {
|
|
78
80
|
var _a, _b;
|
|
81
|
+
const { defaultTabIndex } = useInternalDynamicContext.useInternalDynamicContext();
|
|
79
82
|
const walletListViewSettings = useViewSettings.useViewSettings('wallet-list');
|
|
80
|
-
const [selectedTabIndex, setSelectedTabIndex] = React.useState(() =>
|
|
83
|
+
const [selectedTabIndex, setSelectedTabIndex] = React.useState(() => getInitialTabIndex.getInitialTabIndex(walletListViewSettings, defaultTabIndex));
|
|
81
84
|
const selectedTabSettings = selectedTabIndex === null
|
|
82
85
|
? undefined
|
|
83
86
|
: (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[selectedTabIndex];
|
|
@@ -15,6 +15,7 @@ import '../../../utils/constants/colors.js';
|
|
|
15
15
|
import '../../../utils/constants/values.js';
|
|
16
16
|
import '../../../shared/utils/classes/storage/localStorage.js';
|
|
17
17
|
import '../../../shared/consts/index.js';
|
|
18
|
+
import { useInternalDynamicContext } from '../../../context/DynamicContext/useDynamicContext/useInternalDynamicContext.js';
|
|
18
19
|
import '../../../context/CaptchaContext/CaptchaContext.js';
|
|
19
20
|
import '../../../context/ErrorContext/ErrorContext.js';
|
|
20
21
|
import '@dynamic-labs/multi-wallet';
|
|
@@ -69,11 +70,13 @@ import '../../../widgets/DynamicWidget/context/DynamicWidgetContext.js';
|
|
|
69
70
|
import '../../TransactionConfirmationView/helpers/transactionErrorMessage.js';
|
|
70
71
|
import '../../../widgets/DynamicWidget/views/ManagePasskeysWidgetView/PasskeyCard/PasskeyCard.js';
|
|
71
72
|
import { useViewSettings } from '../../../utils/hooks/useViewSettings/useViewSettings.js';
|
|
73
|
+
import { getInitialTabIndex } from '../utils/getInitialTabIndex/getInitialTabIndex.js';
|
|
72
74
|
|
|
73
75
|
const useTabState = () => {
|
|
74
76
|
var _a, _b;
|
|
77
|
+
const { defaultTabIndex } = useInternalDynamicContext();
|
|
75
78
|
const walletListViewSettings = useViewSettings('wallet-list');
|
|
76
|
-
const [selectedTabIndex, setSelectedTabIndex] = useState(() =>
|
|
79
|
+
const [selectedTabIndex, setSelectedTabIndex] = useState(() => getInitialTabIndex(walletListViewSettings, defaultTabIndex));
|
|
77
80
|
const selectedTabSettings = selectedTabIndex === null
|
|
78
81
|
? undefined
|
|
79
82
|
: (_a = walletListViewSettings === null || walletListViewSettings === void 0 ? void 0 : walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items[selectedTabIndex];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const getInitialTabIndex = (walletListViewSettings, defaultTabIndex) => {
|
|
7
|
+
var _a, _b, _c, _d;
|
|
8
|
+
if (!walletListViewSettings) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
if (!((_b = (_a = walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (defaultTabIndex < 0) {
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
const lastIndex = ((_d = (_c = walletListViewSettings.tabs) === null || _c === void 0 ? void 0 : _c.items.length) !== null && _d !== void 0 ? _d : 1) - 1;
|
|
18
|
+
const initialTabIndex = Math.min(lastIndex, defaultTabIndex);
|
|
19
|
+
return initialTabIndex;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.getInitialTabIndex = getInitialTabIndex;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
const getInitialTabIndex = (walletListViewSettings, defaultTabIndex) => {
|
|
3
|
+
var _a, _b, _c, _d;
|
|
4
|
+
if (!walletListViewSettings) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
if (!((_b = (_a = walletListViewSettings.tabs) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (defaultTabIndex < 0) {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
const lastIndex = ((_d = (_c = walletListViewSettings.tabs) === null || _c === void 0 ? void 0 : _c.items.length) !== null && _d !== void 0 ? _d : 1) - 1;
|
|
14
|
+
const initialTabIndex = Math.min(lastIndex, defaultTabIndex);
|
|
15
|
+
return initialTabIndex;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { getInitialTabIndex };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getInitialTabIndex } from './getInitialTabIndex';
|
|
@@ -115,6 +115,7 @@ var WalletLockedView = require('./WalletLockedView/WalletLockedView.cjs');
|
|
|
115
115
|
var WalletRedirectView = require('./WalletRedirectView/WalletRedirectView.cjs');
|
|
116
116
|
var WalletSignSpinnerView = require('./WalletSignSpinnerView/WalletSignSpinnerView.cjs');
|
|
117
117
|
var WalletUsedView = require('./WalletUsedView/WalletUsedView.cjs');
|
|
118
|
+
var MfaDisplayBackupCodesView = require('./MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.cjs');
|
|
118
119
|
var MfaVerificationView = require('./MfaVerificationView/MfaVerificationView.cjs');
|
|
119
120
|
var PasskeyNewDomainDetectedView = require('./Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.cjs');
|
|
120
121
|
|
|
@@ -143,6 +144,7 @@ const viewToComponentMap = {
|
|
|
143
144
|
'merge-user-accounts-conflicts': MergeUserAccountsConflictsView.MergeUserAccountsConflictsView,
|
|
144
145
|
'merge-user-accounts-with-same-email': MergeUserAccountsWithSameEmailView.MergeUserAccountsWithSameEmailView,
|
|
145
146
|
'mfa-choose-device': MfaChooseDeviceView.MfaChooseDeviceView,
|
|
147
|
+
'mfa-display-backup-codes': MfaDisplayBackupCodesView.MfaDisplayBackupCodesView,
|
|
146
148
|
'mfa-secure-device': MfaSecureDeviceView.MfaSecureDeviceView,
|
|
147
149
|
'mfa-verification': MfaVerificationView.MfaVerificationView,
|
|
148
150
|
'multi-wallet-wallet-list': WalletList.WalletList,
|
|
@@ -27,6 +27,7 @@ export declare const viewToComponentMap: {
|
|
|
27
27
|
'merge-user-accounts-conflicts': import("react").FC<import("./MergeUserAccountsConflictsView/MergeUserAccountsConflictsView").MergeUserAccountsConflictsViewProps>;
|
|
28
28
|
'merge-user-accounts-with-same-email': import("react").FC<import("./MergeUserAccountsWithSameEmailView/MergeUserAccountsWithSameEmailView").MergeUserAccountsWithSameEmailViewProps>;
|
|
29
29
|
'mfa-choose-device': () => JSX.Element;
|
|
30
|
+
'mfa-display-backup-codes': () => JSX.Element;
|
|
30
31
|
'mfa-secure-device': ({ type }: import("./MfaSecureDeviceView").MfaSecureDeviceViewProps) => JSX.Element;
|
|
31
32
|
'mfa-verification': ({ type }: import("./MfaVerificationView").MfaVerificationViewProps) => JSX.Element;
|
|
32
33
|
'multi-wallet-wallet-list': ({ isWalletConnectList, }: import("./WalletList").WalletListProps) => JSX.Element;
|
|
@@ -111,6 +111,7 @@ import { WalletLockedView } from './WalletLockedView/WalletLockedView.js';
|
|
|
111
111
|
import { WalletRedirectView } from './WalletRedirectView/WalletRedirectView.js';
|
|
112
112
|
import { WalletSignSpinnerView } from './WalletSignSpinnerView/WalletSignSpinnerView.js';
|
|
113
113
|
import { WalletUsedView } from './WalletUsedView/WalletUsedView.js';
|
|
114
|
+
import { MfaDisplayBackupCodesView } from './MfaDisplayBackupCodesView/MfaDisplayBackupCodesView.js';
|
|
114
115
|
import { MfaVerificationView } from './MfaVerificationView/MfaVerificationView.js';
|
|
115
116
|
import { PasskeyNewDomainDetectedView } from './Passkey/PasskeyNewDomainDetectedView/PasskeyNewDomainDetectedView.js';
|
|
116
117
|
|
|
@@ -139,6 +140,7 @@ const viewToComponentMap = {
|
|
|
139
140
|
'merge-user-accounts-conflicts': MergeUserAccountsConflictsView,
|
|
140
141
|
'merge-user-accounts-with-same-email': MergeUserAccountsWithSameEmailView,
|
|
141
142
|
'mfa-choose-device': MfaChooseDeviceView,
|
|
143
|
+
'mfa-display-backup-codes': MfaDisplayBackupCodesView,
|
|
142
144
|
'mfa-secure-device': MfaSecureDeviceView,
|
|
143
145
|
'mfa-verification': MfaVerificationView,
|
|
144
146
|
'multi-wallet-wallet-list': WalletList,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { validateType } from './validateType';
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
const validateType = (
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
-
newValue, validationDataValue) => {
|
|
9
|
-
// arrays are also objects, but we need to handle arrays
|
|
10
|
-
// in a different way than objects
|
|
11
|
-
if (Array.isArray(newValue) && Array.isArray(validationDataValue)) {
|
|
12
|
-
if (newValue.length === 0) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
// eslint-disable-next-line prefer-destructuring
|
|
16
|
-
const itemValidationData = validationDataValue[0];
|
|
17
|
-
// validate all items in newData array matches item validation data
|
|
18
|
-
return Object.entries(newValue).every(([arrIndex, newValueItem]) => validateType(newValueItem, itemValidationData));
|
|
19
|
-
}
|
|
20
|
-
else if (typeof newValue === 'object' &&
|
|
21
|
-
typeof validationDataValue === 'object' &&
|
|
22
|
-
validationDataValue) {
|
|
23
|
-
return Object.entries(validationDataValue).every(([key, value]) => validateType(newValue[key], value));
|
|
24
|
-
}
|
|
25
|
-
// the data types are not arrays or objects, just do a direct comparison
|
|
26
|
-
// this will apply to primitive data types (string, number, boolean)
|
|
27
|
-
return typeof newValue === typeof validationDataValue;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.validateType = validateType;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const validateType: <T>(newValue: any, validationDataValue: T) => newValue is T;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
const validateType = (
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
-
newValue, validationDataValue) => {
|
|
5
|
-
// arrays are also objects, but we need to handle arrays
|
|
6
|
-
// in a different way than objects
|
|
7
|
-
if (Array.isArray(newValue) && Array.isArray(validationDataValue)) {
|
|
8
|
-
if (newValue.length === 0) {
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
// eslint-disable-next-line prefer-destructuring
|
|
12
|
-
const itemValidationData = validationDataValue[0];
|
|
13
|
-
// validate all items in newData array matches item validation data
|
|
14
|
-
return Object.entries(newValue).every(([arrIndex, newValueItem]) => validateType(newValueItem, itemValidationData));
|
|
15
|
-
}
|
|
16
|
-
else if (typeof newValue === 'object' &&
|
|
17
|
-
typeof validationDataValue === 'object' &&
|
|
18
|
-
validationDataValue) {
|
|
19
|
-
return Object.entries(validationDataValue).every(([key, value]) => validateType(newValue[key], value));
|
|
20
|
-
}
|
|
21
|
-
// the data types are not arrays or objects, just do a direct comparison
|
|
22
|
-
// this will apply to primitive data types (string, number, boolean)
|
|
23
|
-
return typeof newValue === typeof validationDataValue;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export { validateType };
|