@digitaldefiance/express-suite-react-components 5.0.2 → 5.0.4
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/package.json +5 -4
- package/src/auth/AdminRoute.d.ts +8 -0
- package/src/auth/AdminRoute.d.ts.map +1 -0
- package/src/auth/AdminRoute.js +28 -0
- package/src/auth/Private.d.ts +6 -0
- package/src/auth/Private.d.ts.map +1 -0
- package/src/auth/Private.js +14 -0
- package/src/auth/PrivateRoute.d.ts +8 -0
- package/src/auth/PrivateRoute.d.ts.map +1 -0
- package/src/auth/PrivateRoute.js +23 -0
- package/src/auth/UnAuth.d.ts +6 -0
- package/src/auth/UnAuth.d.ts.map +1 -0
- package/src/auth/UnAuth.js +14 -0
- package/src/auth/UnAuthRoute.d.ts +8 -0
- package/src/auth/UnAuthRoute.d.ts.map +1 -0
- package/src/auth/UnAuthRoute.js +22 -0
- package/src/auth/{index.ts → index.d.ts} +3 -2
- package/src/auth/index.d.ts.map +1 -0
- package/src/auth/index.js +12 -0
- package/src/components/ApiAccess.d.ts +16 -0
- package/src/components/ApiAccess.d.ts.map +1 -0
- package/src/components/ApiAccess.js +77 -0
- package/src/components/BackupCodeLoginForm.d.ts +43 -0
- package/src/components/BackupCodeLoginForm.d.ts.map +1 -0
- package/src/components/BackupCodeLoginForm.js +139 -0
- package/src/components/BackupCodesForm.d.ts +26 -0
- package/src/components/BackupCodesForm.d.ts.map +1 -0
- package/src/components/BackupCodesForm.js +120 -0
- package/src/components/CategoryMenu.d.ts +17 -0
- package/src/components/CategoryMenu.d.ts.map +1 -0
- package/src/components/CategoryMenu.js +65 -0
- package/src/components/ChangePasswordForm.d.ts +26 -0
- package/src/components/ChangePasswordForm.d.ts.map +1 -0
- package/src/components/ChangePasswordForm.js +78 -0
- package/src/components/ConfirmationDialog.d.ts +13 -0
- package/src/components/ConfirmationDialog.d.ts.map +1 -0
- package/src/components/ConfirmationDialog.js +10 -0
- package/src/components/CurrencyCodeSelector.d.ts +9 -0
- package/src/components/CurrencyCodeSelector.d.ts.map +1 -0
- package/src/components/CurrencyCodeSelector.js +31 -0
- package/src/components/CurrencyInput.d.ts +13 -0
- package/src/components/CurrencyInput.d.ts.map +1 -0
- package/src/components/CurrencyInput.js +22 -0
- package/src/components/DashboardPage.d.ts +8 -0
- package/src/components/DashboardPage.d.ts.map +1 -0
- package/src/components/DashboardPage.js +10 -0
- package/src/components/DropdownMenu.d.ts +13 -0
- package/src/components/DropdownMenu.d.ts.map +1 -0
- package/src/components/DropdownMenu.js +63 -0
- package/src/components/ExpirationSecondsSelector.d.ts +13 -0
- package/src/components/ExpirationSecondsSelector.d.ts.map +1 -0
- package/src/components/ExpirationSecondsSelector.js +32 -0
- package/src/components/FakeEmailAdminPanel.d.ts +23 -0
- package/src/components/FakeEmailAdminPanel.d.ts.map +1 -0
- package/src/components/FakeEmailAdminPanel.js +147 -0
- package/src/components/Flag.d.ts +20 -0
- package/src/components/Flag.d.ts.map +1 -0
- package/src/components/Flag.js +43 -0
- package/src/components/ForgotPasswordForm.d.ts +18 -0
- package/src/components/ForgotPasswordForm.d.ts.map +1 -0
- package/src/components/ForgotPasswordForm.js +61 -0
- package/src/components/LoginForm.d.ts +44 -0
- package/src/components/LoginForm.d.ts.map +1 -0
- package/src/components/LoginForm.js +123 -0
- package/src/components/LogoutPage.d.ts +8 -0
- package/src/components/LogoutPage.d.ts.map +1 -0
- package/src/components/LogoutPage.js +16 -0
- package/src/components/RegisterForm.d.ts +100 -0
- package/src/components/RegisterForm.d.ts.map +1 -0
- package/src/components/RegisterForm.js +306 -0
- package/src/components/ResetPasswordForm.d.ts +23 -0
- package/src/components/ResetPasswordForm.d.ts.map +1 -0
- package/src/components/ResetPasswordForm.js +78 -0
- package/src/components/SideMenu.d.ts +8 -0
- package/src/components/SideMenu.d.ts.map +1 -0
- package/src/components/SideMenu.js +25 -0
- package/src/components/SideMenuListItem.d.ts +13 -0
- package/src/components/SideMenuListItem.d.ts.map +1 -0
- package/src/components/SideMenuListItem.js +44 -0
- package/src/components/T.d.ts +7 -0
- package/src/components/T.d.ts.map +1 -0
- package/src/components/T.js +13 -0
- package/src/components/TDiv.d.ts +9 -0
- package/src/components/TDiv.d.ts.map +1 -0
- package/src/components/TDiv.js +14 -0
- package/src/components/TImgAlt.d.ts +10 -0
- package/src/components/TImgAlt.d.ts.map +1 -0
- package/src/components/TImgAlt.js +14 -0
- package/src/components/TopMenu.d.ts +50 -0
- package/src/components/TopMenu.d.ts.map +1 -0
- package/src/components/TopMenu.js +79 -0
- package/src/components/TotpSetupForm.d.ts +24 -0
- package/src/components/TotpSetupForm.d.ts.map +1 -0
- package/src/components/TotpSetupForm.js +82 -0
- package/src/components/TotpVerificationForm.d.ts +23 -0
- package/src/components/TotpVerificationForm.d.ts.map +1 -0
- package/src/components/TotpVerificationForm.js +66 -0
- package/src/components/TranslatedTitle.d.ts +8 -0
- package/src/components/TranslatedTitle.d.ts.map +1 -0
- package/src/components/TranslatedTitle.js +15 -0
- package/src/components/UserLanguageSelector.d.ts +4 -0
- package/src/components/UserLanguageSelector.d.ts.map +1 -0
- package/src/components/UserLanguageSelector.js +31 -0
- package/src/components/UserMenu.d.ts +4 -0
- package/src/components/UserMenu.d.ts.map +1 -0
- package/src/components/UserMenu.js +12 -0
- package/src/components/UserSettingsForm.d.ts +113 -0
- package/src/components/UserSettingsForm.d.ts.map +1 -0
- package/src/components/UserSettingsForm.js +269 -0
- package/src/components/VerifyEmailPage.d.ts +24 -0
- package/src/components/VerifyEmailPage.d.ts.map +1 -0
- package/src/components/VerifyEmailPage.js +81 -0
- package/src/components/{index.ts → index.d.ts} +1 -1
- package/src/components/index.d.ts.map +1 -0
- package/src/components/index.js +35 -0
- package/src/contexts/AuthProvider.d.ts +19 -0
- package/src/contexts/AuthProvider.d.ts.map +1 -0
- package/src/contexts/AuthProvider.js +514 -0
- package/src/contexts/I18nProvider.d.ts +27 -0
- package/src/contexts/I18nProvider.d.ts.map +1 -0
- package/src/contexts/I18nProvider.js +60 -0
- package/src/contexts/MenuContext.d.ts +28 -0
- package/src/contexts/MenuContext.d.ts.map +1 -0
- package/src/contexts/MenuContext.js +307 -0
- package/src/contexts/SuiteConfigProvider.d.ts +44 -0
- package/src/contexts/SuiteConfigProvider.d.ts.map +1 -0
- package/src/contexts/SuiteConfigProvider.js +43 -0
- package/src/contexts/ThemeProvider.d.ts +15 -0
- package/src/contexts/ThemeProvider.d.ts.map +1 -0
- package/src/contexts/ThemeProvider.js +36 -0
- package/src/contexts/auth-context.d.ts +172 -0
- package/src/contexts/auth-context.d.ts.map +1 -0
- package/src/contexts/auth-context.js +13 -0
- package/src/contexts/{index.ts → index.d.ts} +1 -0
- package/src/contexts/index.d.ts.map +1 -0
- package/src/contexts/index.js +8 -0
- package/src/hooks/{index.ts → index.d.ts} +1 -0
- package/src/hooks/index.d.ts.map +1 -0
- package/src/hooks/index.js +9 -0
- package/src/hooks/useAuthenticatedApi.d.ts +34 -0
- package/src/hooks/useAuthenticatedApi.d.ts.map +1 -0
- package/src/hooks/useAuthenticatedApi.js +46 -0
- package/src/hooks/useBackupCodes.d.ts +15 -0
- package/src/hooks/useBackupCodes.d.ts.map +1 -0
- package/src/hooks/useBackupCodes.js +74 -0
- package/src/hooks/useEmailVerification.d.ts +10 -0
- package/src/hooks/useEmailVerification.d.ts.map +1 -0
- package/src/hooks/useEmailVerification.js +40 -0
- package/src/hooks/useExpiringValue.d.ts +14 -0
- package/src/hooks/useExpiringValue.d.ts.map +1 -0
- package/src/hooks/useExpiringValue.js +53 -0
- package/src/hooks/useLocalStorage.d.ts +2 -0
- package/src/hooks/useLocalStorage.d.ts.map +1 -0
- package/src/hooks/useLocalStorage.js +15 -0
- package/src/hooks/useUserSettings.d.ts +48 -0
- package/src/hooks/useUserSettings.d.ts.map +1 -0
- package/src/hooks/useUserSettings.js +171 -0
- package/src/{index.ts → index.d.ts} +1 -1
- package/src/index.d.ts.map +1 -0
- package/src/index.js +12 -0
- package/src/interfaces/IAppConfig.d.ts +8 -0
- package/src/interfaces/IAppConfig.d.ts.map +1 -0
- package/src/interfaces/IAppConfig.js +2 -0
- package/src/interfaces/ICategoryConfig.d.ts +41 -0
- package/src/interfaces/ICategoryConfig.d.ts.map +1 -0
- package/src/interfaces/ICategoryConfig.js +2 -0
- package/src/interfaces/IMenuConfig.d.ts +28 -0
- package/src/interfaces/IMenuConfig.d.ts.map +1 -0
- package/src/interfaces/IMenuConfig.js +2 -0
- package/src/interfaces/IMenuOption.d.ts +82 -0
- package/src/interfaces/IMenuOption.d.ts.map +1 -0
- package/src/interfaces/IMenuOption.js +2 -0
- package/src/interfaces/{index.ts → index.d.ts} +1 -0
- package/src/interfaces/index.d.ts.map +1 -0
- package/src/interfaces/index.js +7 -0
- package/src/services/__mocks__/authService.d.ts +21 -0
- package/src/services/__mocks__/authService.d.ts.map +1 -0
- package/src/services/__mocks__/authService.js +15 -0
- package/src/services/api.d.ts +3 -0
- package/src/services/api.d.ts.map +1 -0
- package/src/services/api.js +14 -0
- package/src/services/authService.d.ts +126 -0
- package/src/services/authService.d.ts.map +1 -0
- package/src/services/authService.js +471 -0
- package/src/services/authenticatedApi.d.ts +3 -0
- package/src/services/authenticatedApi.d.ts.map +1 -0
- package/src/services/authenticatedApi.js +18 -0
- package/src/services/index.d.ts +4 -0
- package/src/services/index.d.ts.map +1 -0
- package/src/services/index.js +6 -0
- package/src/types/MenuType.d.ts +11 -0
- package/src/types/MenuType.d.ts.map +1 -0
- package/src/types/MenuType.js +12 -0
- package/src/types/expirationSeconds.d.ts +3 -0
- package/src/types/expirationSeconds.d.ts.map +1 -0
- package/src/types/expirationSeconds.js +17 -0
- package/src/types/index.d.ts +2 -0
- package/src/types/index.d.ts.map +1 -0
- package/src/types/index.js +4 -0
- package/src/types/translation.d.ts +10 -0
- package/src/types/translation.d.ts.map +1 -0
- package/src/types/translation.js +9 -0
- package/src/wrappers/BackupCodeLoginWrapper.d.ts +8 -0
- package/src/wrappers/BackupCodeLoginWrapper.d.ts.map +1 -0
- package/src/wrappers/BackupCodeLoginWrapper.js +20 -0
- package/src/wrappers/BackupCodesWrapper.d.ts +7 -0
- package/src/wrappers/BackupCodesWrapper.d.ts.map +1 -0
- package/src/wrappers/BackupCodesWrapper.js +17 -0
- package/src/wrappers/ChangePasswordFormWrapper.d.ts +8 -0
- package/src/wrappers/ChangePasswordFormWrapper.d.ts.map +1 -0
- package/src/wrappers/ChangePasswordFormWrapper.js +21 -0
- package/src/wrappers/ForgotPasswordFormWrapper.d.ts +8 -0
- package/src/wrappers/ForgotPasswordFormWrapper.d.ts.map +1 -0
- package/src/wrappers/ForgotPasswordFormWrapper.js +29 -0
- package/src/wrappers/LoginFormWrapper.d.ts +21 -0
- package/src/wrappers/LoginFormWrapper.d.ts.map +1 -0
- package/src/wrappers/LoginFormWrapper.js +72 -0
- package/src/wrappers/LogoutPageWrapper.d.ts +9 -0
- package/src/wrappers/LogoutPageWrapper.d.ts.map +1 -0
- package/src/wrappers/LogoutPageWrapper.js +21 -0
- package/src/wrappers/RegisterFormWrapper.d.ts +20 -0
- package/src/wrappers/RegisterFormWrapper.d.ts.map +1 -0
- package/src/wrappers/RegisterFormWrapper.js +51 -0
- package/src/wrappers/ResetPasswordFormWrapper.d.ts +9 -0
- package/src/wrappers/ResetPasswordFormWrapper.d.ts.map +1 -0
- package/src/wrappers/ResetPasswordFormWrapper.js +34 -0
- package/src/wrappers/UserSettingsFormWrapper.d.ts +29 -0
- package/src/wrappers/UserSettingsFormWrapper.d.ts.map +1 -0
- package/src/wrappers/UserSettingsFormWrapper.js +95 -0
- package/src/wrappers/VerifyEmailPageWrapper.d.ts +8 -0
- package/src/wrappers/VerifyEmailPageWrapper.d.ts.map +1 -0
- package/src/wrappers/VerifyEmailPageWrapper.js +21 -0
- package/src/wrappers/{index.tsx → index.d.ts} +1 -10
- package/src/wrappers/index.d.ts.map +1 -0
- package/src/wrappers/index.js +24 -0
- package/LICENSE +0 -21
- package/src/auth/AdminRoute.tsx +0 -54
- package/src/auth/Private.tsx +0 -17
- package/src/auth/PrivateRoute.tsx +0 -28
- package/src/auth/UnAuth.tsx +0 -16
- package/src/auth/UnAuthRoute.tsx +0 -30
- package/src/components/ApiAccess.tsx +0 -175
- package/src/components/BackupCodeLoginForm.tsx +0 -489
- package/src/components/BackupCodesForm.tsx +0 -287
- package/src/components/CategoryMenu.tsx +0 -155
- package/src/components/ChangePasswordForm.tsx +0 -273
- package/src/components/ConfirmationDialog.tsx +0 -48
- package/src/components/CurrencyCodeSelector.tsx +0 -60
- package/src/components/CurrencyInput.tsx +0 -80
- package/src/components/DashboardPage.tsx +0 -24
- package/src/components/DropdownMenu.tsx +0 -105
- package/src/components/ExpirationSecondsSelector.tsx +0 -60
- package/src/components/FakeEmailAdminPanel.tsx +0 -374
- package/src/components/Flag.tsx +0 -52
- package/src/components/ForgotPasswordForm.tsx +0 -174
- package/src/components/LoginForm.tsx +0 -468
- package/src/components/LogoutPage.tsx +0 -21
- package/src/components/RegisterForm.tsx +0 -1169
- package/src/components/ResetPasswordForm.tsx +0 -247
- package/src/components/SideMenu.tsx +0 -46
- package/src/components/SideMenuListItem.tsx +0 -75
- package/src/components/T.tsx +0 -24
- package/src/components/TDiv.tsx +0 -26
- package/src/components/TImgAlt.tsx +0 -28
- package/src/components/TopMenu.tsx +0 -252
- package/src/components/TotpSetupForm.tsx +0 -188
- package/src/components/TotpVerificationForm.tsx +0 -148
- package/src/components/TranslatedTitle.tsx +0 -31
- package/src/components/UserLanguageSelector.tsx +0 -45
- package/src/components/UserMenu.tsx +0 -15
- package/src/components/UserSettingsForm.tsx +0 -904
- package/src/components/VerifyEmailPage.tsx +0 -222
- package/src/components/__tests__/RegisterForm.totp.spec.tsx +0 -377
- package/src/components/__tests__/TotpSetupForm.spec.tsx +0 -258
- package/src/components/__tests__/TotpVerificationForm.spec.tsx +0 -259
- package/src/components/__tests__/UserSettingsForm.totp.spec.tsx +0 -396
- package/src/contexts/AuthProvider.spec.tsx +0 -1284
- package/src/contexts/AuthProvider.tsx +0 -977
- package/src/contexts/I18nProvider.tsx +0 -164
- package/src/contexts/MenuContext.tsx +0 -426
- package/src/contexts/SuiteConfigProvider.tsx +0 -93
- package/src/contexts/ThemeProvider.tsx +0 -67
- package/src/hooks/useAuthenticatedApi.tsx +0 -67
- package/src/hooks/useBackupCodes.ts +0 -105
- package/src/hooks/useEmailVerification.ts +0 -54
- package/src/hooks/useExpiringValue.ts +0 -78
- package/src/hooks/useLocalStorage.ts +0 -18
- package/src/hooks/useUserSettings.ts +0 -271
- package/src/interfaces/IAppConfig.ts +0 -7
- package/src/interfaces/ICategoryConfig.ts +0 -41
- package/src/interfaces/IMenuConfig.ts +0 -28
- package/src/interfaces/IMenuOption.ts +0 -79
- package/src/services/__mocks__/authService.ts +0 -14
- package/src/services/__tests__/authService.totp.property.spec.ts +0 -360
- package/src/services/__tests__/authService.totp.spec.ts +0 -439
- package/src/services/api.ts +0 -13
- package/src/services/authService.ts +0 -692
- package/src/services/authenticatedApi.ts +0 -17
- package/src/services/index.ts +0 -3
- package/src/types/MenuType.ts +0 -15
- package/src/types/expirationSeconds.ts +0 -18
- package/src/types/index.ts +0 -1
- package/src/types/translation.ts +0 -20
- package/src/wrappers/BackupCodeLoginWrapper.tsx +0 -34
- package/src/wrappers/BackupCodesWrapper.tsx +0 -28
- package/src/wrappers/ChangePasswordFormWrapper.tsx +0 -34
- package/src/wrappers/ForgotPasswordFormWrapper.tsx +0 -45
- package/src/wrappers/LoginFormWrapper.tsx +0 -108
- package/src/wrappers/LogoutPageWrapper.tsx +0 -30
- package/src/wrappers/RegisterFormWrapper.tsx +0 -109
- package/src/wrappers/ResetPasswordFormWrapper.tsx +0 -57
- package/src/wrappers/UserSettingsFormWrapper.tsx +0 -140
- package/src/wrappers/VerifyEmailPageWrapper.tsx +0 -27
- package/src/wrappers/__tests__/LoginFormWrapper.totp.spec.tsx +0 -339
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMenu = exports.MenuProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
// src/app/menuContext.tsx
|
|
6
|
+
const suite_core_lib_1 = require("@digitaldefiance/suite-core-lib");
|
|
7
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const MenuType_1 = require("../types/MenuType");
|
|
10
|
+
const auth_context_1 = require("./auth-context");
|
|
11
|
+
const I18nProvider_1 = require("./I18nProvider");
|
|
12
|
+
const SuiteConfigProvider_1 = require("./SuiteConfigProvider");
|
|
13
|
+
const ThemeProvider_1 = require("./ThemeProvider");
|
|
14
|
+
const MenuContext = (0, react_1.createContext)(undefined);
|
|
15
|
+
const MenuProvider = ({ children, menuConfigs = [], enableBackupCodes = true, hiddenMenuIds = [], }) => {
|
|
16
|
+
const { userData: user, isAuthenticated, admin: isGlobalAdmin, mnemonic, clearMnemonic, wallet, clearWallet, } = (0, auth_context_1.useAuth)();
|
|
17
|
+
const { mode: colorMode, toggleColorMode: themeToggle } = (0, ThemeProvider_1.useTheme)();
|
|
18
|
+
const registeredMenuOptions = (0, react_1.useRef)(new Set());
|
|
19
|
+
const [registeredOptions, setRegisteredOptions] = (0, react_1.useState)(new Map());
|
|
20
|
+
const { tComponent } = (0, I18nProvider_1.useI18n)();
|
|
21
|
+
const { baseUrl } = (0, SuiteConfigProvider_1.useSuiteConfig)();
|
|
22
|
+
// Flip the theme immediately with the crypto-free ThemeProvider toggle, then persist the choice to the server as a
|
|
23
|
+
// best-effort side effect. The persistence path (which pulls ecies-lib + axios) is loaded lazily via dynamic import
|
|
24
|
+
// ONLY when an authenticated user toggles, so it stays out of the static bundle for consumers that only use the menu.
|
|
25
|
+
const toggleColorMode = (0, react_1.useCallback)(() => {
|
|
26
|
+
const next = colorMode === 'dark' ? 'light' : 'dark';
|
|
27
|
+
themeToggle();
|
|
28
|
+
if (!isAuthenticated)
|
|
29
|
+
return;
|
|
30
|
+
void (async () => {
|
|
31
|
+
try {
|
|
32
|
+
const [{ createAuthenticatedApiClient }, { dehydrateUserSettings }] = await Promise.all([
|
|
33
|
+
import('../services/index.js'),
|
|
34
|
+
import('@digitaldefiance/suite-core-lib'),
|
|
35
|
+
]);
|
|
36
|
+
const api = createAuthenticatedApiClient(baseUrl);
|
|
37
|
+
await api.post('/user/settings', dehydrateUserSettings({ darkMode: next === 'dark' }));
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// Best-effort: the theme already flipped; a failed persist just means it is not remembered server-side.
|
|
41
|
+
}
|
|
42
|
+
})();
|
|
43
|
+
}, [colorMode, themeToggle, isAuthenticated, baseUrl]);
|
|
44
|
+
const registerMenuOption = (0, react_1.useCallback)((option) => {
|
|
45
|
+
const unregister = () => {
|
|
46
|
+
setRegisteredOptions((prev) => {
|
|
47
|
+
const newMap = new Map(prev);
|
|
48
|
+
newMap.delete(option.id);
|
|
49
|
+
return newMap;
|
|
50
|
+
});
|
|
51
|
+
registeredMenuOptions.current.delete(unregister);
|
|
52
|
+
};
|
|
53
|
+
setRegisteredOptions((prev) => {
|
|
54
|
+
const newMap = new Map(prev);
|
|
55
|
+
newMap.set(option.id, option);
|
|
56
|
+
return newMap;
|
|
57
|
+
});
|
|
58
|
+
registeredMenuOptions.current.add(unregister);
|
|
59
|
+
return unregister;
|
|
60
|
+
}, []);
|
|
61
|
+
const registerMenuOptions = (0, react_1.useCallback)((options) => {
|
|
62
|
+
const unregisterFunctions = options.map(registerMenuOption);
|
|
63
|
+
return () => unregisterFunctions.forEach((f) => f());
|
|
64
|
+
}, [registerMenuOption]);
|
|
65
|
+
const menuOptions = (0, react_1.useMemo)(() => {
|
|
66
|
+
const isUserRestricted = () => {
|
|
67
|
+
return user?.roles?.some((role) => role.child) ?? false;
|
|
68
|
+
};
|
|
69
|
+
let index = 0;
|
|
70
|
+
const baseOptions = [
|
|
71
|
+
{
|
|
72
|
+
id: 'dashboard',
|
|
73
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_Dashboard),
|
|
74
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.Dashboard, {}),
|
|
75
|
+
link: '/dashboard',
|
|
76
|
+
requiresAuth: true,
|
|
77
|
+
includeOnMenus: [MenuType_1.MenuTypes.SideMenu],
|
|
78
|
+
index: index++,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
id: 'user-divider',
|
|
82
|
+
label: '',
|
|
83
|
+
divider: true,
|
|
84
|
+
includeOnMenus: [MenuType_1.MenuTypes.SideMenu],
|
|
85
|
+
index: index++,
|
|
86
|
+
requiresAuth: false,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'logout',
|
|
90
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.LogoutButton),
|
|
91
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.ExitToApp, {}),
|
|
92
|
+
link: '/logout',
|
|
93
|
+
requiresAuth: true,
|
|
94
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
95
|
+
index: index++,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'login',
|
|
99
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Login_LoginButton),
|
|
100
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.Login, {}),
|
|
101
|
+
link: '/login',
|
|
102
|
+
requiresAuth: false,
|
|
103
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
104
|
+
index: index++,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: 'register',
|
|
108
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.RegisterButton),
|
|
109
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.PersonAdd, {}),
|
|
110
|
+
link: '/register',
|
|
111
|
+
requiresAuth: false,
|
|
112
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
113
|
+
index: index++,
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
id: 'forgot-password',
|
|
117
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.ForgotPassword_Title),
|
|
118
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.LockOpen, {}),
|
|
119
|
+
link: '/forgot-password',
|
|
120
|
+
requiresAuth: false,
|
|
121
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
122
|
+
index: index++,
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: 'change-password',
|
|
126
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ChangePassword),
|
|
127
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.LockReset, {}),
|
|
128
|
+
link: '/change-password',
|
|
129
|
+
requiresAuth: true,
|
|
130
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
131
|
+
index: index++,
|
|
132
|
+
},
|
|
133
|
+
...(enableBackupCodes
|
|
134
|
+
? [
|
|
135
|
+
{
|
|
136
|
+
id: 'backup-code',
|
|
137
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.BackupCodeRecovery_Title),
|
|
138
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.Key, {}),
|
|
139
|
+
link: '/backup-code',
|
|
140
|
+
requiresAuth: false,
|
|
141
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
142
|
+
index: index++,
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 'backup-codes',
|
|
146
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.BackupCodeRecovery_GenerateNewCodes),
|
|
147
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.Autorenew, {}),
|
|
148
|
+
link: '/backup-codes',
|
|
149
|
+
requiresAuth: true,
|
|
150
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
151
|
+
index: index++,
|
|
152
|
+
},
|
|
153
|
+
]
|
|
154
|
+
: []),
|
|
155
|
+
{
|
|
156
|
+
id: 'divider',
|
|
157
|
+
label: '',
|
|
158
|
+
divider: true,
|
|
159
|
+
includeOnMenus: [MenuType_1.MenuTypes.SideMenu],
|
|
160
|
+
index: index++,
|
|
161
|
+
requiresAuth: false,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: 'clear-mnemonic',
|
|
165
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ClearMnemonic),
|
|
166
|
+
action: clearMnemonic,
|
|
167
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.Key, {}),
|
|
168
|
+
requiresAuth: true,
|
|
169
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
170
|
+
index: index++,
|
|
171
|
+
filter: () => !!mnemonic,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: 'clear-wallet',
|
|
175
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ClearWallet),
|
|
176
|
+
action: clearWallet,
|
|
177
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.Key, {}),
|
|
178
|
+
requiresAuth: true,
|
|
179
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
180
|
+
index: index++,
|
|
181
|
+
filter: () => !!wallet,
|
|
182
|
+
},
|
|
183
|
+
...(isUserRestricted() ? [] : []),
|
|
184
|
+
{
|
|
185
|
+
id: 'color-divider',
|
|
186
|
+
label: '',
|
|
187
|
+
divider: true,
|
|
188
|
+
includeOnMenus: [MenuType_1.MenuTypes.SideMenu],
|
|
189
|
+
index: index++,
|
|
190
|
+
requiresAuth: undefined,
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: 'theme-toggle',
|
|
194
|
+
label: colorMode === 'dark'
|
|
195
|
+
? tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ThemeToggle_Light)
|
|
196
|
+
: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Common_ThemeToggle_Dark),
|
|
197
|
+
icon: colorMode === 'dark' ? (0, jsx_runtime_1.jsx)(icons_material_1.Brightness7, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.Brightness4, {}),
|
|
198
|
+
includeOnMenus: [MenuType_1.MenuTypes.SideMenu],
|
|
199
|
+
index: index++,
|
|
200
|
+
requiresAuth: undefined,
|
|
201
|
+
action: toggleColorMode,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
id: 'user-settings',
|
|
205
|
+
label: tComponent(suite_core_lib_1.SuiteCoreComponentId, suite_core_lib_1.SuiteCoreStringKey.Settings_Title),
|
|
206
|
+
icon: (0, jsx_runtime_1.jsx)(icons_material_1.Settings, {}),
|
|
207
|
+
link: '/user-settings',
|
|
208
|
+
requiresAuth: true,
|
|
209
|
+
includeOnMenus: [MenuType_1.MenuTypes.UserMenu, MenuType_1.MenuTypes.SideMenu],
|
|
210
|
+
index: index++,
|
|
211
|
+
},
|
|
212
|
+
];
|
|
213
|
+
const allOptions = [...baseOptions, ...registeredOptions.values()];
|
|
214
|
+
return allOptions.sort((a, b) => a.index - b.index);
|
|
215
|
+
}, [
|
|
216
|
+
tComponent,
|
|
217
|
+
registeredOptions,
|
|
218
|
+
user?.roles,
|
|
219
|
+
colorMode,
|
|
220
|
+
toggleColorMode,
|
|
221
|
+
clearMnemonic,
|
|
222
|
+
clearWallet,
|
|
223
|
+
mnemonic,
|
|
224
|
+
wallet,
|
|
225
|
+
enableBackupCodes,
|
|
226
|
+
]);
|
|
227
|
+
const getMenuOptions = (0, react_1.useCallback)((menuType, includeDividers) => {
|
|
228
|
+
const hidden = new Set(hiddenMenuIds);
|
|
229
|
+
const MenuFilter = (o) => {
|
|
230
|
+
// Suppress any option whose id the consumer asked to hide.
|
|
231
|
+
if (hidden.has(o.id))
|
|
232
|
+
return false;
|
|
233
|
+
// Apply the custom filter first
|
|
234
|
+
let customFilterPasses = true;
|
|
235
|
+
if (o.filter !== undefined) {
|
|
236
|
+
customFilterPasses = o.filter(o);
|
|
237
|
+
}
|
|
238
|
+
if (!customFilterPasses)
|
|
239
|
+
return false;
|
|
240
|
+
if (o.divider === true && !includeDividers)
|
|
241
|
+
return false;
|
|
242
|
+
if (o.requiresAdmin === true && !isGlobalAdmin)
|
|
243
|
+
return false;
|
|
244
|
+
return (o.includeOnMenus.includes(menuType) &&
|
|
245
|
+
(o.requiresAuth === undefined || o.requiresAuth === isAuthenticated));
|
|
246
|
+
};
|
|
247
|
+
const filtered = menuOptions.filter(MenuFilter);
|
|
248
|
+
// Drop dividers left orphaned once hidden items are removed: a divider at
|
|
249
|
+
// the start or end of the list, or immediately following another divider,
|
|
250
|
+
// carries no meaning and would show as a stray separator.
|
|
251
|
+
return filtered.filter((o, i) => {
|
|
252
|
+
if (o.divider !== true)
|
|
253
|
+
return true;
|
|
254
|
+
const prev = filtered[i - 1];
|
|
255
|
+
if (prev === undefined || prev.divider === true)
|
|
256
|
+
return false;
|
|
257
|
+
if (i === filtered.length - 1)
|
|
258
|
+
return false;
|
|
259
|
+
return true;
|
|
260
|
+
});
|
|
261
|
+
}, [hiddenMenuIds, isAuthenticated, isGlobalAdmin, menuOptions]);
|
|
262
|
+
(0, react_1.useEffect)(() => {
|
|
263
|
+
if (menuConfigs.length > 0) {
|
|
264
|
+
return registerMenuOptions(menuConfigs.flatMap((config) => config.options));
|
|
265
|
+
}
|
|
266
|
+
return undefined;
|
|
267
|
+
}, [menuConfigs, registerMenuOptions]);
|
|
268
|
+
const getTopMenus = (0, react_1.useCallback)(() => {
|
|
269
|
+
const menus = [
|
|
270
|
+
...menuConfigs.map((config) => ({ ...config, isUserMenu: false })),
|
|
271
|
+
{
|
|
272
|
+
menuType: MenuType_1.MenuTypes.UserMenu,
|
|
273
|
+
menuIcon: (0, jsx_runtime_1.jsx)(icons_material_1.AccountCircle, {}),
|
|
274
|
+
priority: 0,
|
|
275
|
+
options: [],
|
|
276
|
+
isUserMenu: true,
|
|
277
|
+
},
|
|
278
|
+
];
|
|
279
|
+
return menus.sort((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
280
|
+
}, [menuConfigs]);
|
|
281
|
+
const contextValue = (0, react_1.useMemo)(() => {
|
|
282
|
+
return {
|
|
283
|
+
menuOptions: menuOptions,
|
|
284
|
+
getMenuOptions: getMenuOptions,
|
|
285
|
+
registerMenuOption: registerMenuOption,
|
|
286
|
+
registerMenuOptions: registerMenuOptions,
|
|
287
|
+
getTopMenus: getTopMenus,
|
|
288
|
+
};
|
|
289
|
+
}, [
|
|
290
|
+
menuOptions,
|
|
291
|
+
getMenuOptions,
|
|
292
|
+
registerMenuOption,
|
|
293
|
+
registerMenuOptions,
|
|
294
|
+
getTopMenus,
|
|
295
|
+
]);
|
|
296
|
+
const memoizedChildren = (0, react_1.useMemo)(() => children, [children]);
|
|
297
|
+
return ((0, jsx_runtime_1.jsx)(MenuContext.Provider, { value: contextValue, children: memoizedChildren }));
|
|
298
|
+
};
|
|
299
|
+
exports.MenuProvider = MenuProvider;
|
|
300
|
+
const useMenu = () => {
|
|
301
|
+
const context = (0, react_1.useContext)(MenuContext);
|
|
302
|
+
if (context === undefined) {
|
|
303
|
+
throw new Error('useMenu must be used within a MenuProvider');
|
|
304
|
+
}
|
|
305
|
+
return context;
|
|
306
|
+
};
|
|
307
|
+
exports.useMenu = useMenu;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SuiteConfigRoutes {
|
|
3
|
+
dashboard?: string;
|
|
4
|
+
login?: string;
|
|
5
|
+
register?: string;
|
|
6
|
+
verifyEmail?: string;
|
|
7
|
+
forgotPassword?: string;
|
|
8
|
+
resetPassword?: string;
|
|
9
|
+
settings?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SuiteConfigContextData {
|
|
12
|
+
/**
|
|
13
|
+
* Base URL for API calls
|
|
14
|
+
*/
|
|
15
|
+
baseUrl: string;
|
|
16
|
+
/**
|
|
17
|
+
* Application routes for navigation
|
|
18
|
+
*/
|
|
19
|
+
routes: SuiteConfigRoutes;
|
|
20
|
+
/**
|
|
21
|
+
* Available languages for the application
|
|
22
|
+
*/
|
|
23
|
+
languages: Array<{
|
|
24
|
+
code: string;
|
|
25
|
+
label: string;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Available timezones
|
|
29
|
+
*/
|
|
30
|
+
timezones?: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface SuiteConfigProviderProps {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
baseUrl: string;
|
|
35
|
+
routes?: Partial<SuiteConfigRoutes>;
|
|
36
|
+
languages?: Array<{
|
|
37
|
+
code: string;
|
|
38
|
+
label: string;
|
|
39
|
+
}>;
|
|
40
|
+
timezones?: string[];
|
|
41
|
+
}
|
|
42
|
+
export declare const SuiteConfigProvider: ({ children, baseUrl, routes, languages, timezones, }: SuiteConfigProviderProps) => import("react").JSX.Element;
|
|
43
|
+
export declare const useSuiteConfig: () => SuiteConfigContextData;
|
|
44
|
+
//# sourceMappingURL=SuiteConfigProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SuiteConfigProvider.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/contexts/SuiteConfigProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,SAAS,EAAc,MAAM,OAAO,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,iBAAiB,CAAC;IAE1B;;OAEG;IACH,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAElD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAyBD,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,eAAO,MAAM,mBAAmB,GAAI,sDAMjC,wBAAwB,gCAa1B,CAAC;AAEF,eAAO,MAAM,cAAc,QAAO,sBAMjC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSuiteConfig = exports.SuiteConfigProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const defaultRoutes = {
|
|
7
|
+
dashboard: '/dashboard',
|
|
8
|
+
login: '/login',
|
|
9
|
+
register: '/register',
|
|
10
|
+
verifyEmail: '/verify-email',
|
|
11
|
+
forgotPassword: '/forgot-password',
|
|
12
|
+
resetPassword: '/reset-password',
|
|
13
|
+
settings: '/settings',
|
|
14
|
+
};
|
|
15
|
+
const defaultLanguages = [
|
|
16
|
+
{ code: 'en-US', label: 'English (US)' },
|
|
17
|
+
{ code: 'en-GB', label: 'English (UK)' },
|
|
18
|
+
{ code: 'es-ES', label: 'Español' },
|
|
19
|
+
{ code: 'fr-FR', label: 'Français' },
|
|
20
|
+
{ code: 'de-DE', label: 'Deutsch' },
|
|
21
|
+
{ code: 'ja', label: '日本語' },
|
|
22
|
+
{ code: 'zh-CN', label: '中文 (简体)' },
|
|
23
|
+
{ code: 'uk', label: 'Українська' },
|
|
24
|
+
];
|
|
25
|
+
const SuiteConfigContext = (0, react_1.createContext)(undefined);
|
|
26
|
+
const SuiteConfigProvider = ({ children, baseUrl, routes = {}, languages = defaultLanguages, timezones, }) => {
|
|
27
|
+
const value = {
|
|
28
|
+
baseUrl,
|
|
29
|
+
routes: { ...defaultRoutes, ...routes },
|
|
30
|
+
languages,
|
|
31
|
+
timezones,
|
|
32
|
+
};
|
|
33
|
+
return ((0, jsx_runtime_1.jsx)(SuiteConfigContext.Provider, { value: value, children: children }));
|
|
34
|
+
};
|
|
35
|
+
exports.SuiteConfigProvider = SuiteConfigProvider;
|
|
36
|
+
const useSuiteConfig = () => {
|
|
37
|
+
const context = (0, react_1.useContext)(SuiteConfigContext);
|
|
38
|
+
if (!context) {
|
|
39
|
+
throw new Error('useSuiteConfig must be used within a SuiteConfigProvider');
|
|
40
|
+
}
|
|
41
|
+
return context;
|
|
42
|
+
};
|
|
43
|
+
exports.useSuiteConfig = useSuiteConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PaletteMode, Theme } from '@mui/material';
|
|
2
|
+
import { FC, ReactNode } from 'react';
|
|
3
|
+
export interface ThemeContextType {
|
|
4
|
+
toggleColorMode: () => void;
|
|
5
|
+
setColorMode: (mode: PaletteMode) => void;
|
|
6
|
+
mode: PaletteMode;
|
|
7
|
+
}
|
|
8
|
+
export declare const useTheme: () => ThemeContextType;
|
|
9
|
+
export interface AppThemeProviderProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
customTheme?: (mode: PaletteMode) => Theme;
|
|
12
|
+
}
|
|
13
|
+
export declare const AppThemeProvider: FC<AppThemeProviderProps>;
|
|
14
|
+
export declare const ThemeToggleButton: FC;
|
|
15
|
+
//# sourceMappingURL=ThemeProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/contexts/ThemeProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,WAAW,EAEX,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,EAAE,EAAE,SAAS,EAAgD,MAAM,OAAO,CAAC;AAEpF,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,IAAI,EAAE,WAAW,CAAC;CACnB;AAID,eAAO,MAAM,QAAQ,wBAMpB,CAAC;AAEF,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,KAAK,CAAC;CAC5C;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CA0BtD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,EAO/B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeToggleButton = exports.AppThemeProvider = exports.useTheme = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const ThemeContext = (0, react_1.createContext)(undefined);
|
|
9
|
+
const useTheme = () => {
|
|
10
|
+
const context = (0, react_1.useContext)(ThemeContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error('useTheme must be used within an AppThemeProvider');
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
};
|
|
16
|
+
exports.useTheme = useTheme;
|
|
17
|
+
const AppThemeProvider = ({ children, customTheme }) => {
|
|
18
|
+
const [mode, setMode] = (0, react_1.useState)('light');
|
|
19
|
+
const colorMode = (0, react_1.useMemo)(() => ({
|
|
20
|
+
toggleColorMode: () => {
|
|
21
|
+
setMode((prevMode) => (prevMode === 'light' ? 'dark' : 'light'));
|
|
22
|
+
},
|
|
23
|
+
setColorMode: (newMode) => {
|
|
24
|
+
setMode(newMode);
|
|
25
|
+
},
|
|
26
|
+
mode,
|
|
27
|
+
}), [mode]);
|
|
28
|
+
const theme = (0, react_1.useMemo)(() => (customTheme ? customTheme(mode) : (0, material_1.createTheme)({ palette: { mode } })), [mode, customTheme]);
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(ThemeContext.Provider, { value: colorMode, children: (0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: theme, children: children }) }));
|
|
30
|
+
};
|
|
31
|
+
exports.AppThemeProvider = AppThemeProvider;
|
|
32
|
+
const ThemeToggleButton = () => {
|
|
33
|
+
const { mode, toggleColorMode } = (0, exports.useTheme)();
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: toggleColorMode, color: "inherit", children: mode === 'dark' ? (0, jsx_runtime_1.jsx)(icons_material_1.Brightness7, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.Brightness4, {}) }));
|
|
35
|
+
};
|
|
36
|
+
exports.ThemeToggleButton = ThemeToggleButton;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { EmailString, Member as FrontendMember, SecureString } from '@digitaldefiance/ecies-lib';
|
|
2
|
+
import type { CurrencyCode } from '@digitaldefiance/i18n-lib';
|
|
3
|
+
import type { IRequestUserDTO, ISuccessMessage, IUserSettings } from '@digitaldefiance/suite-core-lib';
|
|
4
|
+
import type { Wallet } from '@ethereumjs/wallet';
|
|
5
|
+
import type { PaletteMode } from '@mui/material';
|
|
6
|
+
export interface AuthContextData {
|
|
7
|
+
/**
|
|
8
|
+
* True if the user has a global admin role
|
|
9
|
+
*/
|
|
10
|
+
admin: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Counter that increments on login/logout to trigger effects in dependent components
|
|
13
|
+
*/
|
|
14
|
+
authState: number;
|
|
15
|
+
/**
|
|
16
|
+
* Performs a server side backup-code login
|
|
17
|
+
* @param identifier
|
|
18
|
+
* @param code
|
|
19
|
+
* @param isEmail
|
|
20
|
+
* @param recoverMnemonic
|
|
21
|
+
* @param newPassword
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
backupCodeLogin: (identifier: string, code: string, isEmail: boolean, recoverMnemonic: boolean, newPassword?: string) => Promise<{
|
|
25
|
+
token: string;
|
|
26
|
+
codeCount: number;
|
|
27
|
+
mnemonic?: string;
|
|
28
|
+
message?: string;
|
|
29
|
+
} | {
|
|
30
|
+
error: string;
|
|
31
|
+
status?: number;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Verifies the stored token (if any) and updates auth state
|
|
35
|
+
* @returns void
|
|
36
|
+
*/
|
|
37
|
+
checkAuth: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Changes the stored browser password login mnemonic
|
|
40
|
+
* @param currentPassword
|
|
41
|
+
* @param newPassword
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
changePassword: (currentPassword: string, newPassword: string) => Promise<ISuccessMessage | {
|
|
45
|
+
error: string;
|
|
46
|
+
errorType?: string | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
clearMnemonic: () => void;
|
|
49
|
+
clearWallet: () => void;
|
|
50
|
+
colorMode?: PaletteMode;
|
|
51
|
+
currencyCode?: CurrencyCode;
|
|
52
|
+
directLogin: (mnemonic: SecureString, username?: string, email?: EmailString, expireMnemonicSeconds?: number, expireWalletSeconds?: number) => Promise<{
|
|
53
|
+
token: string;
|
|
54
|
+
user: IRequestUserDTO;
|
|
55
|
+
wallet: Wallet;
|
|
56
|
+
} | {
|
|
57
|
+
pendingTotpToken: string;
|
|
58
|
+
} | {
|
|
59
|
+
error: string;
|
|
60
|
+
errorType?: string;
|
|
61
|
+
}>;
|
|
62
|
+
emailChallengeLogin: (mnemonic: SecureString, token: string, username?: string, email?: EmailString, expireMnemonicSeconds?: number, expireWalletSeconds?: number) => Promise<{
|
|
63
|
+
token: string;
|
|
64
|
+
user: IRequestUserDTO;
|
|
65
|
+
wallet: Wallet;
|
|
66
|
+
message: string;
|
|
67
|
+
} | {
|
|
68
|
+
pendingTotpToken: string;
|
|
69
|
+
} | {
|
|
70
|
+
error: string;
|
|
71
|
+
errorType?: string;
|
|
72
|
+
}>;
|
|
73
|
+
isAuthenticated: boolean;
|
|
74
|
+
isCheckingAuth: boolean;
|
|
75
|
+
isBrowserPasswordLoginAvailable?: () => boolean;
|
|
76
|
+
loading: boolean;
|
|
77
|
+
logout: () => void;
|
|
78
|
+
mnemonic?: SecureString;
|
|
79
|
+
mnemonicExpirationSeconds: number;
|
|
80
|
+
passwordLogin: (password: SecureString, username?: string, email?: EmailString) => Promise<{
|
|
81
|
+
token: string;
|
|
82
|
+
user: IRequestUserDTO;
|
|
83
|
+
wallet: Wallet;
|
|
84
|
+
} | {
|
|
85
|
+
pendingTotpToken: string;
|
|
86
|
+
} | {
|
|
87
|
+
error: string;
|
|
88
|
+
errorType?: string;
|
|
89
|
+
}>;
|
|
90
|
+
requestEmailLogin: (username?: string, email?: EmailString) => Promise<string | {
|
|
91
|
+
error: string;
|
|
92
|
+
errorType?: string;
|
|
93
|
+
}>;
|
|
94
|
+
refreshToken: () => Promise<{
|
|
95
|
+
token: string;
|
|
96
|
+
user: IRequestUserDTO;
|
|
97
|
+
}>;
|
|
98
|
+
register: (username: string, email: string, timezone: string, password?: string, mnemonic?: string, displayName?: string, directChallenge?: boolean) => Promise<{
|
|
99
|
+
success: boolean;
|
|
100
|
+
message: string;
|
|
101
|
+
mnemonic: string;
|
|
102
|
+
} | {
|
|
103
|
+
error: string;
|
|
104
|
+
errorType?: string;
|
|
105
|
+
field?: string;
|
|
106
|
+
errors?: Array<{
|
|
107
|
+
path: string;
|
|
108
|
+
msg: string;
|
|
109
|
+
}>;
|
|
110
|
+
}>;
|
|
111
|
+
serverPublicKey: string | null;
|
|
112
|
+
/**
|
|
113
|
+
* Gets the remaining time in seconds for the mnemonic expiration
|
|
114
|
+
* @returns Number of seconds remaining, or 0 if no mnemonic is set
|
|
115
|
+
*/
|
|
116
|
+
getMnemonicRemainingTime: () => number;
|
|
117
|
+
/**
|
|
118
|
+
* Gets the remaining time in seconds for the wallet expiration
|
|
119
|
+
* @returns Number of seconds remaining, or 0 if no wallet is set
|
|
120
|
+
*/
|
|
121
|
+
getWalletRemainingTime: () => number;
|
|
122
|
+
setMnemonic: (mnemonic: SecureString, durationSeconds?: number) => void;
|
|
123
|
+
setMnemonicExpirationSeconds: (seconds: number) => void;
|
|
124
|
+
setWalletExpirationSeconds: (seconds: number) => void;
|
|
125
|
+
setUpBrowserPasswordLogin: (mnemonic: SecureString, password: SecureString, username?: string, email?: EmailString) => Promise<{
|
|
126
|
+
success: boolean;
|
|
127
|
+
message: string;
|
|
128
|
+
} | {
|
|
129
|
+
error: string;
|
|
130
|
+
errorType?: string;
|
|
131
|
+
}>;
|
|
132
|
+
setUser: (user: IRequestUserDTO | null) => Promise<void>;
|
|
133
|
+
setUserSetting: (setting?: Partial<IUserSettings>) => Promise<void>;
|
|
134
|
+
setWallet: (wallet: Wallet, durationSeconds?: number) => void;
|
|
135
|
+
user: FrontendMember | null;
|
|
136
|
+
userData: IRequestUserDTO | null;
|
|
137
|
+
userSettings: IUserSettings | undefined;
|
|
138
|
+
token: string | null;
|
|
139
|
+
wallet?: Wallet;
|
|
140
|
+
walletExpirationSeconds: number;
|
|
141
|
+
verifyToken: (token: string) => Promise<boolean>;
|
|
142
|
+
/**
|
|
143
|
+
* Initiates TOTP setup for the authenticated user.
|
|
144
|
+
* Returns the provisioning URI and raw base32 secret on success.
|
|
145
|
+
*/
|
|
146
|
+
setupTotp: () => Promise<{
|
|
147
|
+
provisioningUri: string;
|
|
148
|
+
secret: string;
|
|
149
|
+
} | {
|
|
150
|
+
error: string;
|
|
151
|
+
}>;
|
|
152
|
+
/**
|
|
153
|
+
* Confirms TOTP setup with a 6-digit code.
|
|
154
|
+
*/
|
|
155
|
+
confirmTotp: (code: string) => Promise<{
|
|
156
|
+
success: boolean;
|
|
157
|
+
} | {
|
|
158
|
+
error: string;
|
|
159
|
+
}>;
|
|
160
|
+
/**
|
|
161
|
+
* Completes TOTP login by verifying a 6-digit code against a pending TOTP token.
|
|
162
|
+
*/
|
|
163
|
+
verifyTotpLogin: (pendingTotpToken: string, code: string) => Promise<{
|
|
164
|
+
token: string;
|
|
165
|
+
user: IRequestUserDTO;
|
|
166
|
+
} | {
|
|
167
|
+
error: string;
|
|
168
|
+
}>;
|
|
169
|
+
}
|
|
170
|
+
export declare const AuthContext: import("react").Context<AuthContextData>;
|
|
171
|
+
export declare const useAuth: () => AuthContextData;
|
|
172
|
+
//# sourceMappingURL=auth-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-context.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/contexts/auth-context.tsx"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAuth = exports.AuthContext = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The authentication context, its data shape, and the `useAuth` hook, split out of AuthProvider so consumers that only
|
|
6
|
+
* read auth state (e.g. the menu components) need not pull AuthProvider's runtime crypto/HTTP stack (ecies-lib,
|
|
7
|
+
* @ethereumjs/wallet, axios) into their bundle. The crypto/suite symbols are imported as TYPES only, so they are erased
|
|
8
|
+
* at build time and add no runtime weight. AuthProvider re-exports these, so the public API is unchanged.
|
|
9
|
+
*/
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
exports.AuthContext = (0, react_1.createContext)({});
|
|
12
|
+
const useAuth = () => (0, react_1.useContext)(exports.AuthContext);
|
|
13
|
+
exports.useAuth = useAuth;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
|