@dashadmin/dash-app-common 1.3.25 → 1.3.26

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.
Files changed (165) hide show
  1. package/dist/DashApp.js +176 -1
  2. package/dist/DashAppLoader.js +348 -3
  3. package/dist/DashDefaultResources.js +10 -1
  4. package/dist/components/DashDefaultPrivateApp.js +150 -1
  5. package/dist/components/DashDefaultPrivateResources.js +10 -1
  6. package/dist/components/DashDefaultPublicApp.js +20 -1
  7. package/dist/components/DashResourceLoader.js +245 -1
  8. package/dist/defaults/extensions/bootstrap/DashDefaultErrorBoundary.js +78 -1
  9. package/dist/defaults/extensions/bootstrap/dashDefaultInitializeApp.js +59 -1
  10. package/dist/defaults/extensions/bootstrap/index.js +24 -1
  11. package/dist/defaults/extensions/components/DashDefaultLoader.js +43 -2
  12. package/dist/defaults/extensions/components/dashDefaultAutoAdminComponents.js +67 -1
  13. package/dist/defaults/extensions/components/dashDefaultNotification.js +28 -1
  14. package/dist/defaults/extensions/components/dashDefaultStaticComponents.js +15 -1
  15. package/dist/defaults/extensions/components/index.js +13 -1
  16. package/dist/defaults/extensions/electron/dashDefaultIpcListeners.js +38 -1
  17. package/dist/defaults/extensions/electron/index.js +5 -1
  18. package/dist/defaults/extensions/hooks/index.js +12 -1
  19. package/dist/defaults/extensions/hooks/useDashDefaultLazyAutoAdminComponents.js +17 -1
  20. package/dist/defaults/extensions/hooks/useDashDefaultLazyI18nProvider.js +51 -1
  21. package/dist/defaults/extensions/hooks/useDashDefaultLazyResources.js +19 -1
  22. package/dist/defaults/extensions/hooks/useDashDefaultMountTracker.js +22 -1
  23. package/dist/defaults/extensions/hooks/useDashDefaultRoutePath.js +17 -1
  24. package/dist/defaults/extensions/i18n/dashDefaultI18nProvider.js +44 -1
  25. package/dist/defaults/extensions/i18n/dashDefaultTranslations.js +87 -1
  26. package/dist/defaults/extensions/i18n/index.js +24 -1
  27. package/dist/defaults/extensions/index.js +190 -1
  28. package/dist/defaults/extensions/layout/dashDefaultDomainAppLayout.js +58 -1
  29. package/dist/defaults/extensions/layout/index.js +12 -1
  30. package/dist/defaults/extensions/managers/DashDefaultWSMessagesManager.js +84 -1
  31. package/dist/defaults/extensions/managers/index.js +5 -1
  32. package/dist/defaults/extensions/providers/dashDefaultAuthProvider.js +220 -1
  33. package/dist/defaults/extensions/providers/dashDefaultDataProvider.js +395 -1
  34. package/dist/defaults/extensions/providers/index.js +24 -1
  35. package/dist/defaults/extensions/router/DashDefaultLanding.js +46 -1
  36. package/dist/defaults/extensions/router/dashDefaultPrivateRoutes.js +38 -1
  37. package/dist/defaults/extensions/router/dashDefaultPublicRoutes.js +65 -1
  38. package/dist/defaults/extensions/router/dashDefaultRouter.js +39 -1
  39. package/dist/defaults/extensions/router/dashDefaultSharedRoutes.js +40 -1
  40. package/dist/defaults/extensions/router/index.js +12 -1
  41. package/dist/defaults/extensions/state/dashDefaultAppCommon.js +57 -1
  42. package/dist/defaults/extensions/state/dashDefaultAppSettings.js +38 -1
  43. package/dist/defaults/extensions/state/dashDefaultInitialAppState.js +31 -1
  44. package/dist/defaults/extensions/state/dashDefaultLayoutSettings.js +48 -1
  45. package/dist/defaults/extensions/state/dashDefaultQueryClient.js +58 -1
  46. package/dist/defaults/extensions/state/dashDefaultResourcesIcons.js +24 -1
  47. package/dist/defaults/extensions/state/index.js +29 -1
  48. package/dist/defaults/extensions/styles/index.js +2 -1
  49. package/dist/defaults/extensions/theme/dashDefaultThemeOptions.js +74 -1
  50. package/dist/defaults/extensions/theme/index.js +6 -1
  51. package/dist/defaults/extensions/utils/IPCMessageBrokerContext.js +12 -1
  52. package/dist/defaults/extensions/utils/dashDefaultAuthProviderUtils.js +29 -1
  53. package/dist/defaults/extensions/utils/dashDefaultDataProviderUtils.js +37 -1
  54. package/dist/defaults/extensions/utils/dashDefaultNotificationsProcessor.js +149 -1
  55. package/dist/defaults/extensions/utils/index.js +44 -1
  56. package/dist/defaults/filters/demo/dashDefaultDemoFilters.js +36 -1
  57. package/dist/defaults/filters/demo/index.js +4 -1
  58. package/dist/defaults/filters/index.js +5 -1
  59. package/dist/defaults/index.js +14 -1
  60. package/dist/defaults/pages/Account/DashDefaultRegister.js +282 -1
  61. package/dist/defaults/pages/Account/DashDefaultSignUp.js +420 -1
  62. package/dist/defaults/pages/Account/DashDefaultSignUpSuccess.js +101 -1
  63. package/dist/defaults/pages/Account/index.js +8 -1
  64. package/dist/defaults/pages/DashDefaultLogin.js +218 -1
  65. package/dist/defaults/pages/Misc/DashDefaultNotFound.js +74 -1
  66. package/dist/defaults/pages/Misc/DashDefaultServerError.js +79 -1
  67. package/dist/defaults/pages/Misc/DashDefaultUnauthorized.js +90 -1
  68. package/dist/defaults/pages/Misc/index.js +8 -1
  69. package/dist/defaults/pages/Static/DashDefaultPrivacyPage.js +48 -1
  70. package/dist/defaults/pages/Static/DashDefaultStaticPage.js +55 -1
  71. package/dist/defaults/pages/Static/DashDefaultTermsPage.js +52 -1
  72. package/dist/defaults/pages/Static/index.js +8 -1
  73. package/dist/defaults/pages/index.js +25 -1
  74. package/dist/defaults/schemas/dashDefaultSchema.js +14 -1
  75. package/dist/defaults/schemas/demo/dashDefaultTodoSchema.js +24 -1
  76. package/dist/defaults/schemas/demo/index.js +4 -1
  77. package/dist/defaults/schemas/index.js +7 -1
  78. package/dist/filters/demo/todoFilters.js +36 -1
  79. package/dist/index.js +56 -5975
  80. package/dist/resources/demo/todoResource.js +58 -1
  81. package/dist/schemas/defaultSchema.js +14 -1
  82. package/dist/schemas/demo/todoSchema.js +24 -1
  83. package/package.json +132 -77
  84. package/src/DashApp.tsx +294 -0
  85. package/src/DashAppLoader.tsx +717 -0
  86. package/src/DashDefaultResources.tsx +10 -0
  87. package/src/components/DashDefaultPrivateApp.tsx +358 -0
  88. package/src/components/DashDefaultPrivateResources.tsx +10 -0
  89. package/src/components/DashDefaultPublicApp.tsx +40 -0
  90. package/src/components/DashResourceLoader.tsx +564 -0
  91. package/src/defaults/extensions/bootstrap/DashDefaultErrorBoundary.tsx +113 -0
  92. package/src/defaults/extensions/bootstrap/dashDefaultInitializeApp.ts +81 -0
  93. package/src/defaults/extensions/bootstrap/index.ts +32 -0
  94. package/src/defaults/extensions/components/DashDefaultLoader.tsx +59 -0
  95. package/src/defaults/extensions/components/dashDefaultAutoAdminComponents.tsx +49 -0
  96. package/src/defaults/extensions/components/dashDefaultNotification.tsx +37 -0
  97. package/src/defaults/extensions/components/dashDefaultStaticComponents.tsx +34 -0
  98. package/src/defaults/extensions/components/index.ts +17 -0
  99. package/src/defaults/extensions/electron/dashDefaultIpcListeners.ts +62 -0
  100. package/src/defaults/extensions/electron/index.ts +7 -0
  101. package/src/defaults/extensions/hooks/index.ts +11 -0
  102. package/src/defaults/extensions/hooks/useDashDefaultLazyAutoAdminComponents.ts +25 -0
  103. package/src/defaults/extensions/hooks/useDashDefaultLazyI18nProvider.ts +38 -0
  104. package/src/defaults/extensions/hooks/useDashDefaultLazyResources.ts +29 -0
  105. package/src/defaults/extensions/hooks/useDashDefaultMountTracker.ts +28 -0
  106. package/src/defaults/extensions/hooks/useDashDefaultRoutePath.ts +27 -0
  107. package/src/defaults/extensions/i18n/dashDefaultI18nProvider.ts +66 -0
  108. package/src/defaults/extensions/i18n/dashDefaultTranslations.ts +82 -0
  109. package/src/defaults/extensions/i18n/index.ts +22 -0
  110. package/src/defaults/extensions/index.ts +177 -0
  111. package/src/defaults/extensions/layout/dashDefaultDomainAppLayout.tsx +126 -0
  112. package/src/defaults/extensions/layout/index.ts +12 -0
  113. package/src/defaults/extensions/managers/DashDefaultWSMessagesManager.tsx +99 -0
  114. package/src/defaults/extensions/managers/index.ts +7 -0
  115. package/src/defaults/extensions/providers/dashDefaultAuthProvider.ts +256 -0
  116. package/src/defaults/extensions/providers/dashDefaultDataProvider.ts +513 -0
  117. package/src/defaults/extensions/providers/index.ts +25 -0
  118. package/src/defaults/extensions/router/DashDefaultLanding.tsx +51 -0
  119. package/src/defaults/extensions/router/dashDefaultPrivateRoutes.tsx +50 -0
  120. package/src/defaults/extensions/router/dashDefaultPublicRoutes.tsx +86 -0
  121. package/src/defaults/extensions/router/dashDefaultRouter.tsx +54 -0
  122. package/src/defaults/extensions/router/dashDefaultSharedRoutes.tsx +56 -0
  123. package/src/defaults/extensions/router/index.ts +13 -0
  124. package/src/defaults/extensions/state/dashDefaultAppCommon.ts +54 -0
  125. package/src/defaults/extensions/state/dashDefaultAppSettings.ts +29 -0
  126. package/src/defaults/extensions/state/dashDefaultInitialAppState.ts +75 -0
  127. package/src/defaults/extensions/state/dashDefaultLayoutSettings.ts +59 -0
  128. package/src/defaults/extensions/state/dashDefaultQueryClient.ts +59 -0
  129. package/src/defaults/extensions/state/dashDefaultResourcesIcons.tsx +23 -0
  130. package/src/defaults/extensions/state/index.ts +29 -0
  131. package/src/defaults/extensions/styles/index.ts +17 -0
  132. package/src/defaults/extensions/theme/dashDefaultThemeOptions.ts +89 -0
  133. package/src/defaults/extensions/theme/index.ts +7 -0
  134. package/src/defaults/extensions/utils/IPCMessageBrokerContext.tsx +22 -0
  135. package/src/defaults/extensions/utils/dashDefaultAuthProviderUtils.ts +36 -0
  136. package/src/defaults/extensions/utils/dashDefaultDataProviderUtils.ts +46 -0
  137. package/src/defaults/extensions/utils/dashDefaultNotificationsProcessor.tsx +208 -0
  138. package/src/defaults/extensions/utils/index.ts +42 -0
  139. package/src/defaults/filters/demo/dashDefaultDemoFilters.tsx +50 -0
  140. package/src/defaults/filters/demo/index.ts +6 -0
  141. package/src/defaults/filters/index.ts +11 -0
  142. package/src/defaults/index.ts +27 -0
  143. package/src/defaults/pages/Account/DashDefaultRegister.tsx +281 -0
  144. package/src/defaults/pages/Account/DashDefaultSignUp.tsx +492 -0
  145. package/src/defaults/pages/Account/DashDefaultSignUpSuccess.tsx +113 -0
  146. package/src/defaults/pages/Account/index.ts +8 -0
  147. package/src/defaults/pages/DashDefaultLogin.tsx +224 -0
  148. package/src/defaults/pages/Misc/DashDefaultNotFound.tsx +96 -0
  149. package/src/defaults/pages/Misc/DashDefaultServerError.tsx +102 -0
  150. package/src/defaults/pages/Misc/DashDefaultUnauthorized.tsx +116 -0
  151. package/src/defaults/pages/Misc/index.ts +8 -0
  152. package/src/defaults/pages/Static/DashDefaultPrivacyPage.tsx +85 -0
  153. package/src/defaults/pages/Static/DashDefaultStaticPage.tsx +75 -0
  154. package/src/defaults/pages/Static/DashDefaultTermsPage.tsx +69 -0
  155. package/src/defaults/pages/Static/index.ts +8 -0
  156. package/src/defaults/pages/index.ts +28 -0
  157. package/src/defaults/schemas/dashDefaultSchema.tsx +25 -0
  158. package/src/defaults/schemas/demo/dashDefaultTodoSchema.tsx +39 -0
  159. package/src/defaults/schemas/demo/index.ts +6 -0
  160. package/src/defaults/schemas/index.ts +14 -0
  161. package/src/filters/demo/todoFilters.tsx +39 -0
  162. package/src/index.ts +131 -0
  163. package/src/resources/demo/todoResource.tsx +68 -0
  164. package/src/schemas/defaultSchema.tsx +14 -0
  165. package/src/schemas/demo/todoSchema.tsx +27 -0
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Default Public Routes
3
+ *
4
+ * These are the default routes for the public app when no custom routes are provided.
5
+ * They include basic authentication routes (login, password recovery, etc.)
6
+ *
7
+ * NOTE: Uses standalone components that don't depend on react-admin hooks.
8
+ * react-admin hooks (useRedirect, useNotify, etc.) require <Admin> context,
9
+ * which is not available in the public routes.
10
+ */
11
+ import React, { Suspense } from 'react';
12
+ import { Route, Navigate } from 'react-router-dom';
13
+ import AppLoadingFallback from 'dash-components/src/components/theme/AppLoadingFallback';
14
+
15
+ // Lazy load auth pages - these are standalone components that use React Router hooks
16
+ const DashDefaultLogin = React.lazy(() => import('../../pages/DashDefaultLogin'));
17
+ const RecoverPassword = React.lazy(() => import('dash-admin/src/pages/RecoverPassword'));
18
+ const ChangePassword = React.lazy(() => import('dash-admin/src/pages/ChangePassword'));
19
+ const VerifyAccount = React.lazy(() => import('dash-admin/src/pages/VerifyAccount'));
20
+
21
+ // Loading fallback
22
+ const LoadingFallback = () => <AppLoadingFallback message="Loading..." />;
23
+
24
+ // Simple landing that redirects to login
25
+ const SimpleLanding = () => <Navigate to="/login" replace />;
26
+
27
+ /**
28
+ * Default Public Routes configuration
29
+ * These routes are accessible without authentication
30
+ */
31
+ export const dashDefaultPublicRoutes = () => {
32
+ return [
33
+ // Default landing page - redirect to login
34
+ <Route
35
+ key="landing"
36
+ data-layout="no-layout"
37
+ path="/"
38
+ element={<SimpleLanding />}
39
+ />,
40
+
41
+ // Login page - uses standalone component
42
+ <Route
43
+ key="login"
44
+ data-layout="no-layout"
45
+ path="/login"
46
+ element={
47
+ <Suspense fallback={<LoadingFallback />}>
48
+ <DashDefaultLogin />
49
+ </Suspense>
50
+ }
51
+ />,
52
+
53
+ // Password recovery
54
+ <Route
55
+ key="reset-password"
56
+ path="/reset-password"
57
+ element={
58
+ <Suspense fallback={<LoadingFallback />}>
59
+ <RecoverPassword />
60
+ </Suspense>
61
+ }
62
+ />,
63
+ <Route
64
+ key="change-password"
65
+ path="/change-password"
66
+ element={
67
+ <Suspense fallback={<LoadingFallback />}>
68
+ <ChangePassword />
69
+ </Suspense>
70
+ }
71
+ />,
72
+
73
+ // Account verification
74
+ <Route
75
+ key="verify-account"
76
+ path="/verify-email"
77
+ element={
78
+ <Suspense fallback={<LoadingFallback />}>
79
+ <VerifyAccount />
80
+ </Suspense>
81
+ }
82
+ />,
83
+ ];
84
+ };
85
+
86
+ export default dashDefaultPublicRoutes;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Dash Default Router Extension
3
+ *
4
+ * Router configuration and wrapper components.
5
+ */
6
+ import React from 'react';
7
+ import { DashRouterComponent } from 'dash-utils';
8
+ import { DASHAdminSystemConstants, getEnv } from 'dash-constants';
9
+
10
+ /**
11
+ * Environment variables for dash default router configuration
12
+ */
13
+ export const getDashDefaultRouterEnvVars = () => ({
14
+ PLATFORM_TYPE: getEnv('PLATFORM_TYPE') || 'desktop',
15
+ PLATFORM: getEnv('PLATFORM') || 'unknown',
16
+ BASE_PATH: DASHAdminSystemConstants.system.URL_PREFIX || '/',
17
+ IS_ELECTRON: JSON.parse(getEnv('IS_ELECTRON') || 'false'),
18
+ });
19
+
20
+ /**
21
+ * DashDefaultRouterWrapper - Memoizable router component
22
+ * Uses environment variables to determine router type
23
+ */
24
+ export const DashDefaultRouterWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => {
25
+ const envVars = getDashDefaultRouterEnvVars();
26
+
27
+ return (
28
+ <DashRouterComponent
29
+ platformType={envVars.PLATFORM_TYPE}
30
+ platform={envVars.PLATFORM}
31
+ basename={envVars.BASE_PATH}
32
+ >
33
+ {children}
34
+ </DashRouterComponent>
35
+ );
36
+ };
37
+
38
+ /**
39
+ * Create a dash default router wrapper with specific environment settings
40
+ */
41
+ export const createDashDefaultRouterWrapper = (platformType?: string, platform?: string) => {
42
+ const RouterWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => (
43
+ <DashRouterComponent
44
+ platformType={platformType || getDashDefaultRouterEnvVars().PLATFORM_TYPE}
45
+ platform={platform || getDashDefaultRouterEnvVars().PLATFORM}
46
+ >
47
+ {children}
48
+ </DashRouterComponent>
49
+ );
50
+
51
+ return RouterWrapper;
52
+ };
53
+
54
+ export default DashDefaultRouterWrapper;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Dash Default Shared Routes Extension
3
+ *
4
+ * Routes that are shared between public and private contexts.
5
+ * These can be used as base routes for both authenticated and unauthenticated users.
6
+ */
7
+ import React, { Suspense } from 'react';
8
+ import { Route } from 'react-router-dom';
9
+ import { Box } from '@mui/material';
10
+
11
+ // Loading fallback component
12
+ const DashDefaultRouteLoader = () => (
13
+ <Box
14
+ display="flex"
15
+ justifyContent="center"
16
+ alignItems="center"
17
+ minHeight="200px"
18
+ sx={{ color: 'var(--text-color, inherit)' }}
19
+ >
20
+ Loading...
21
+ </Box>
22
+ );
23
+
24
+ // Dash default simple landing component
25
+ const DashDefaultLanding = () => (
26
+ <div style={{
27
+ display: 'flex',
28
+ justifyContent: 'center',
29
+ alignItems: 'center',
30
+ height: '100vh',
31
+ background: 'linear-gradient(to bottom, var(--bodybg-primary), var(--bodybg-secondary))',
32
+ color: 'var(--text-color, @text-color--dark)'
33
+ }}>
34
+ <h1>Welcome to Dash</h1>
35
+ </div>
36
+ );
37
+
38
+ /**
39
+ * Dash Default Shared routes configuration
40
+ * These routes are accessible in both public and private contexts
41
+ */
42
+ export const dashDefaultSharedRoutes = () => [
43
+ // Landing page
44
+ <Route
45
+ key="landing"
46
+ data-layout="no-layout"
47
+ path="/"
48
+ element={
49
+ <Suspense fallback={<DashDefaultRouteLoader />}>
50
+ <DashDefaultLanding />
51
+ </Suspense>
52
+ }
53
+ />,
54
+ ];
55
+
56
+ export default dashDefaultSharedRoutes;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Router Extensions Index
3
+ *
4
+ * Router-related configurations and components.
5
+ */
6
+
7
+ // Route definitions
8
+ export { dashDefaultPublicRoutes } from './dashDefaultPublicRoutes';
9
+ export { dashDefaultPrivateRoutes } from './dashDefaultPrivateRoutes';
10
+ export { dashDefaultSharedRoutes } from './dashDefaultSharedRoutes';
11
+
12
+ // Router wrapper
13
+ export { DashDefaultRouterWrapper, createDashDefaultRouterWrapper, getDashDefaultRouterEnvVars } from './dashDefaultRouter';
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Dash Default App Common State Extension
3
+ *
4
+ * Default common state configuration for the app.
5
+ */
6
+ import React from 'react';
7
+ import { ICommonState, defaultCommon } from 'dash-admin-state';
8
+ import { AuthPersistenceService } from 'dash-auth';
9
+ import { dashStorage } from 'dash-utils';
10
+
11
+ /**
12
+ * Get dash default app common state
13
+ * Retrieves persisted tenant images and navigation state from storage
14
+ */
15
+ export const getDashDefaultAppCommon = (): ICommonState => {
16
+ const persistedTenantImages = AuthPersistenceService.getTenantImages();
17
+
18
+ return {
19
+ ...defaultCommon,
20
+ appPath: '/',
21
+ navExpanded: dashStorage.getItem('dashNavExpanded')
22
+ ? dashStorage.getItem('dashNavExpanded') === 'true'
23
+ : true,
24
+ navSize: dashStorage.getItem('dashNavSize') || 'small',
25
+ width: typeof window !== 'undefined' ? window.innerWidth : 1024,
26
+ height: typeof window !== 'undefined' ? window.innerHeight : 768,
27
+ headerToolBar: () => React.createElement(React.Fragment),
28
+ panelSettings: {
29
+ horizontalLogo: persistedTenantImages?.horizontal_logo?.original || '',
30
+ squaredLogo: persistedTenantImages?.squared_logo?.original || '',
31
+ loginBackground: persistedTenantImages?.banner?.original || '',
32
+ },
33
+ };
34
+ };
35
+
36
+ /**
37
+ * Get dash default app path
38
+ */
39
+ export const getDashDefaultAppPath = (): string => '/';
40
+
41
+ /**
42
+ * Get dash default panel images with fallbacks
43
+ */
44
+ export const getDashDefaultPanelImages = () => {
45
+ const persistedTenantImages = AuthPersistenceService.getTenantImages();
46
+
47
+ return {
48
+ horizontalLogo: persistedTenantImages?.horizontal_logo?.original || '',
49
+ squaredLogo: persistedTenantImages?.squared_logo?.original || '',
50
+ loginBackground: persistedTenantImages?.banner?.original || '',
51
+ };
52
+ };
53
+
54
+ export default getDashDefaultAppCommon;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Dash Default App Settings Extension
3
+ *
4
+ * Default application settings configuration for the app.
5
+ */
6
+ import { ISettingsState, defaultSettings } from 'dash-admin-state';
7
+ import { dashDefaultLayoutSettings } from './dashDefaultLayoutSettings';
8
+
9
+ /**
10
+ * Create dash default app settings
11
+ */
12
+ export const dashDefaultAppSettings = (): ISettingsState => ({
13
+ ...defaultSettings,
14
+ loading: false,
15
+ navStyle: dashDefaultLayoutSettings.NAV_STYLE_FIXED,
16
+ layoutType: dashDefaultLayoutSettings.LAYOUT_TYPE_FRAMED,
17
+ themeType: dashDefaultLayoutSettings.THEME_TYPE_DARK,
18
+ layoutSettings: dashDefaultLayoutSettings,
19
+ groupIcons: {},
20
+ });
21
+
22
+ /**
23
+ * Get the dash default theme type
24
+ */
25
+ export const getDashDefaultThemeType = (): string => {
26
+ return dashDefaultLayoutSettings.THEME_TYPE_DARK;
27
+ };
28
+
29
+ export default dashDefaultAppSettings;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Dash Default Initial App State Extension
3
+ *
4
+ * Defines the initial Redux state for the application.
5
+ */
6
+ import {
7
+ IDASHAppState,
8
+ defaultAuth,
9
+ defaultPageSettings,
10
+ defaultFormState
11
+ } from 'dash-admin-state';
12
+ import { IDashAutoAdminResourceConfig } from 'dash-auto-admin';
13
+ import dashDefaultAppSettings from './dashDefaultAppSettings';
14
+ import getDashDefaultAppCommon from './dashDefaultAppCommon';
15
+
16
+
17
+
18
+ /**
19
+ * Dash default user interface (minimal)
20
+ */
21
+ export interface IDashDefaultUser {
22
+ id: number | string;
23
+ name?: string;
24
+ email?: string;
25
+ roles?: string[];
26
+ [key: string]: any;
27
+ }
28
+
29
+ /**
30
+ * Dash default auth interface (minimal)
31
+ */
32
+ export interface IDashDefaultAuth {
33
+ user?: IDashDefaultUser;
34
+ token?: string;
35
+ authenticated?: boolean;
36
+ [key: string]: any;
37
+ }
38
+
39
+ /**
40
+ * Dash Default Initial application state
41
+ * Combines default settings with app-specific configurations
42
+ */
43
+ export const DASH_DEFAULT_INITIAL_APP_STATE: IDASHAppState<
44
+ IDashDefaultUser,
45
+ IDashDefaultAuth,
46
+ IDashAutoAdminResourceConfig
47
+ > = {
48
+ settings: dashDefaultAppSettings(),
49
+ common: getDashDefaultAppCommon(),
50
+ page: defaultPageSettings,
51
+ auth: defaultAuth,
52
+ resources: { items: [] },
53
+ formData: defaultFormState,
54
+ componentData: {},
55
+ };
56
+
57
+ /**
58
+ * Get a fresh copy of the dash default initial state
59
+ * Useful when you need to reset state
60
+ */
61
+ export const getDashDefaultInitialAppState = (): IDASHAppState<
62
+ IDashDefaultUser,
63
+ IDashDefaultAuth,
64
+ IDashAutoAdminResourceConfig
65
+ > => ({
66
+ settings: dashDefaultAppSettings(),
67
+ common: getDashDefaultAppCommon(),
68
+ page: defaultPageSettings,
69
+ auth: defaultAuth,
70
+ resources: { items: [] },
71
+ formData: defaultFormState,
72
+ componentData: {},
73
+ });
74
+
75
+ export default DASH_DEFAULT_INITIAL_APP_STATE;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Dash Default Layout Settings
3
+ *
4
+ * Layout configuration constants for the application.
5
+ * These define responsive breakpoints, theme types, and layout options.
6
+ */
7
+
8
+ export const dashDefaultLayoutSettings = {
9
+ // Responsive breakpoints
10
+ TAB_SIZE: 992,
11
+ MOBILE_SIZE: 575,
12
+
13
+ // Theme type constants
14
+ THEME_TYPE: 'THEME_TYPE',
15
+ THEME_TYPE_LIGHT: 'light',
16
+ THEME_TYPE_LITE: 'lite',
17
+ THEME_TYPE_DARK: 'dark',
18
+ THEME_TYPE_DASH_DEFAULT: 'light',
19
+ THEME_TYPE_SEMI_DARK: 'THEME_TYPE_SEMI_DARK',
20
+
21
+ // Theme color constants
22
+ THEME_COLOR: 'THEME_COLOR',
23
+ UPDATE_RTL_STATUS: 'UPDATE_RTL_STATUS',
24
+
25
+ // Layout type constants
26
+ LAYOUT_TYPE: 'LAYOUT_TYPE',
27
+ LAYOUT_TYPE_FRAMED: 'framed-layout',
28
+ LAYOUT_TYPE_BOXED: 'boxed-layout',
29
+ LAYOUT_TYPE_FULL: 'full-layout',
30
+
31
+ // Navigation style constants
32
+ NAV_STYLE: 'NAV_STYLE',
33
+ NAV_STYLE_FIXED: 'NAV_STYLE_FIXED',
34
+ NAV_STYLE_MINI_SIDEBAR: 'NAV_STYLE_MINI_SIDEBAR',
35
+ NAV_STYLE_DRAWER: 'NAV_STYLE_DRAWER',
36
+ NAV_STYLE_NO_HEADER_MINI_SIDEBAR: 'NAV_STYLE_NO_HEADER_MINI_SIDEBAR',
37
+ NAV_STYLE_NO_HEADER_EXPANDED_SIDEBAR: 'NAV_STYLE_NO_HEADER_EXPANDED_SIDEBAR',
38
+ NAV_STYLE_DEFAULT_HORIZONTAL: 'NAV_STYLE_DEFAULT_HORIZONTAL',
39
+ NAV_STYLE_DARK_HORIZONTAL: 'NAV_STYLE_DARK_HORIZONTAL',
40
+ NAV_STYLE_INSIDE_HEADER_HORIZONTAL: 'NAV_STYLE_INSIDE_HEADER_HORIZONTAL',
41
+ NAV_STYLE_BELOW_HEADER: 'NAV_STYLE_BELOW_HEADER',
42
+ NAV_STYLE_ABOVE_HEADER: 'NAV_STYLE_ABOVE_HEADER',
43
+ NAV_STYLE_COLLAPSABLE: 'NAV_STYLE_COLLAPSABLE',
44
+
45
+ // Color constants
46
+ LIGHT_PURPLE: 'light_purple',
47
+ LIGHT_PURPLE_SEC: '#00B378',
48
+ LIGHT_PURPLE_DARK_TEXT_COLOR: '#9799AC',
49
+ } as const;
50
+
51
+ // Type for the layout settings
52
+ export type DashDefaultLayoutSettings = typeof dashDefaultLayoutSettings;
53
+
54
+ // Helper functions
55
+ export const getDashDefaultTheme = (): string => dashDefaultLayoutSettings.THEME_TYPE_DARK;
56
+ export const getDashDefaultLightTheme = (): string => dashDefaultLayoutSettings.THEME_TYPE_LIGHT;
57
+ export const getDashDefaultDarkTheme = (): string => dashDefaultLayoutSettings.THEME_TYPE_DARK;
58
+
59
+ export default dashDefaultLayoutSettings;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Dash Default Query Client Configuration Extension
3
+ *
4
+ * React Query client configuration for data fetching and caching.
5
+ */
6
+ import { QueryClient, QueryClientConfig } from '@tanstack/react-query';
7
+
8
+ /**
9
+ * Dash default query client configuration
10
+ */
11
+ export const dashDefaultQueryClientConfig: QueryClientConfig = {
12
+ defaultOptions: {
13
+ queries: {
14
+ refetchOnWindowFocus: false,
15
+ staleTime: 5 * 60 * 1000, // 5 minutes
16
+ retry: 1,
17
+ },
18
+ },
19
+ };
20
+
21
+ /**
22
+ * Dash default development query client configuration with logging
23
+ */
24
+ export const dashDefaultDevQueryClientConfig: QueryClientConfig = {
25
+ ...dashDefaultQueryClientConfig,
26
+ // @ts-ignore: required to avoid error during development
27
+ logger: {
28
+ log: (...args: any[]) => {
29
+ console.log('[DashDefaultQueryClient]', ...args);
30
+ },
31
+ warn: (...args: any[]) => {
32
+ console.warn('[DashDefaultQueryClient]', ...args);
33
+ },
34
+ error: (...args: any[]) => {
35
+ console.error('[DashDefaultQueryClient]', ...args);
36
+ },
37
+ },
38
+ };
39
+
40
+ /**
41
+ * Create a dash default query client instance
42
+ * Uses dev config in development mode for logging
43
+ */
44
+ export const createDashDefaultQueryClient = (): QueryClient => {
45
+ // Check if we're in development mode
46
+ const isDev = typeof window !== 'undefined' &&
47
+ (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1');
48
+
49
+ const config = isDev ? dashDefaultDevQueryClientConfig : dashDefaultQueryClientConfig;
50
+
51
+ return new QueryClient(config);
52
+ };
53
+
54
+ /**
55
+ * Pre-configured dash default query client instance
56
+ */
57
+ export const dashDefaultQueryClient = createDashDefaultQueryClient();
58
+
59
+ export default dashDefaultQueryClient;
@@ -0,0 +1,23 @@
1
+ import Dashboard from '@mui/icons-material/Dashboard';
2
+ import Notifications from '@mui/icons-material/Notifications';
3
+ import LocationCity from '@mui/icons-material/LocationCity';
4
+ import Person from '@mui/icons-material/Person';
5
+ import MenuOpenOutlined from '@mui/icons-material/MenuOpenOutlined';
6
+ import { IAppResourceGroupsIcon } from 'dash-admin/src/DASHAdmin';
7
+
8
+ const dashDefaultResourceIcons: IAppResourceGroupsIcon = {
9
+ 'Administration': <Dashboard />,
10
+ 'Administración': <Dashboard />,
11
+ 'Logs and Notifications': <Notifications />,
12
+ 'Logs y Notificaciones': <Notifications />,
13
+ 'System Resources': <LocationCity />,
14
+ 'Recursos de sistema': <LocationCity />,
15
+ 'Users': <Person />,
16
+ 'Usuarios': <Person />,
17
+ 'Client': <Person />,
18
+ 'Cliente': <Person />,
19
+ 'Actions': <MenuOpenOutlined />,
20
+ 'Acciones': <MenuOpenOutlined />,
21
+ };
22
+
23
+ export default dashDefaultResourceIcons;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * State Extensions Index
3
+ *
4
+ * Application state configurations and initial states.
5
+ */
6
+
7
+ // Default App Settings
8
+ export { dashDefaultAppSettings, getDashDefaultThemeType } from './dashDefaultAppSettings';
9
+
10
+ // Default App Common State
11
+ export { getDashDefaultAppCommon, getDashDefaultAppPath, getDashDefaultPanelImages } from './dashDefaultAppCommon';
12
+
13
+ // Default Initial App State
14
+ export { DASH_DEFAULT_INITIAL_APP_STATE, getDashDefaultInitialAppState, type IDashDefaultUser, type IDashDefaultAuth } from './dashDefaultInitialAppState';
15
+
16
+ // Default Query Client
17
+ export { dashDefaultQueryClient, createDashDefaultQueryClient, dashDefaultQueryClientConfig, dashDefaultDevQueryClientConfig } from './dashDefaultQueryClient';
18
+
19
+ // Default Layout Settings
20
+ export {
21
+ dashDefaultLayoutSettings,
22
+ getDashDefaultTheme,
23
+ getDashDefaultLightTheme,
24
+ getDashDefaultDarkTheme,
25
+ type DashDefaultLayoutSettings
26
+ } from './dashDefaultLayoutSettings';
27
+
28
+ // Default Resource Icons
29
+ export { default as dashDefaultResourceIcons } from './dashDefaultResourcesIcons';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Global Styles & Assets
3
+ *
4
+ * Add all your default CSS, fonts, and global asset imports here.
5
+ * This centralizes all style dependencies for the application.
6
+ *
7
+ * Note: Order matters - base styles should come before custom overrides.
8
+ */
9
+
10
+ /* Third-party dependency styles */
11
+ import 'react-toastify/dist/ReactToastify.css';
12
+
13
+ /* Dash Design System base styles */
14
+ import "dash-styles/dash.less";
15
+
16
+ // Export nothing - this file is imported for side effects only
17
+ export {};
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Dash Default Theme Options Extension
3
+ *
4
+ * Extended theme configuration for Material UI.
5
+ * These options are merged with the base dash theme.
6
+ */
7
+
8
+ /**
9
+ * Dash default extended theme options for the app
10
+ * These are merged with the base DashAdmin theme
11
+ */
12
+ export const dashDefaultExtendedThemeOptions = {
13
+ components: {
14
+ MuiButton: {
15
+ styleOverrides: {
16
+ root: {
17
+ // Add any default button styles here
18
+ transition: 'all 0.2s ease-in-out',
19
+ }
20
+ }
21
+ },
22
+ // Add optimizations for layout components
23
+ MuiBox: {
24
+ styleOverrides: {
25
+ root: {
26
+ // Optimize box rendering
27
+ contain: 'layout style',
28
+ }
29
+ }
30
+ }
31
+ },
32
+ breakpoints: {
33
+ values: {
34
+ xs: 0,
35
+ sm: 900,
36
+ md: 900,
37
+ lg: 1200,
38
+ xl: 1536,
39
+ },
40
+ },
41
+ // Add transition optimizations
42
+ transitions: {
43
+ duration: {
44
+ shortest: 150,
45
+ shorter: 200,
46
+ short: 250,
47
+ standard: 300,
48
+ complex: 375,
49
+ enteringScreen: 225,
50
+ leavingScreen: 195,
51
+ },
52
+ easing: {
53
+ easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',
54
+ easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',
55
+ easeIn: 'cubic-bezier(0.4, 0, 1, 1)',
56
+ sharp: 'cubic-bezier(0.4, 0, 0.6, 1)',
57
+ },
58
+ }
59
+ };
60
+
61
+ /**
62
+ * Dash default palette overrides
63
+ * Uncomment and modify to customize colors
64
+ */
65
+ export const dashDefaultPalette = {
66
+ // primary: {
67
+ // main: '#1976d2',
68
+ // light: '#42a5f5',
69
+ // dark: '#1565c0',
70
+ // },
71
+ // secondary: {
72
+ // main: '#9c27b0',
73
+ // light: '#ba68c8',
74
+ // dark: '#7b1fa2',
75
+ // },
76
+ };
77
+
78
+ /**
79
+ * Dash default typography overrides
80
+ */
81
+ export const dashDefaultTypography = {
82
+ // fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
83
+ // h1: {
84
+ // fontSize: '2.5rem',
85
+ // fontWeight: 500,
86
+ // },
87
+ };
88
+
89
+ export default dashDefaultExtendedThemeOptions;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Theme Extensions Index
3
+ *
4
+ * Theme-related configurations and options.
5
+ */
6
+
7
+ export { dashDefaultExtendedThemeOptions, dashDefaultPalette, dashDefaultTypography } from './dashDefaultThemeOptions';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * DashIPCMessageBrokerContext - Re-export from dash-utils
3
+ *
4
+ * This file re-exports the IPCMessageBrokerContext from dash-utils
5
+ * with Dash prefix for dash-app-common consistency.
6
+ *
7
+ * All core functionality is now in the dash-utils package.
8
+ * New code should import directly from 'dash-utils'.
9
+ */
10
+
11
+ export {
12
+ IPCMessageBrokerContext as DashIPCMessageBrokerContext,
13
+ IPCMessageBrokerProvider as DashIPCMessageBrokerProvider,
14
+ useIPCMessageBroker as useDashIPCMessageBroker,
15
+ type LogMessage as DashLogMessage,
16
+ type SubprocessOutput as DashSubprocessOutput,
17
+ type IPCMessageBrokerContextType as DashIPCMessageBrokerContextType,
18
+ type IPCMessageBrokerConfig as DashIPCMessageBrokerConfig
19
+ } from 'dash-utils';
20
+
21
+ // Default export for backward compatibility
22
+ export { IPCMessageBrokerProvider as default } from 'dash-utils';