@dashadmin/dash-admin 1.3.73 → 1.3.74-srcfree.1

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 (289) hide show
  1. package/dist/components/tenant/TenancyPlan.js +307 -0
  2. package/dist/systemResources.js +18 -2
  3. package/package.json +25 -22
  4. package/src/AppAsyncWrapper.tsx +0 -42
  5. package/src/AppWrapper.tsx +0 -45
  6. package/src/DASHAdmin.tsx +0 -502
  7. package/src/DASHAdmin.tsx.old +0 -456
  8. package/src/RoutingWrapper.tsx +0 -143
  9. package/src/classes/DASHStorageClass.tsx +0 -8
  10. package/src/components/Input/RichTextField.tsx +0 -27
  11. package/src/components/Redirect.tsx +0 -46
  12. package/src/components/avatar/Avatar.tsx +0 -71
  13. package/src/components/avatar/SingleImageUploader.tsx +0 -107
  14. package/src/components/currency/Format.tsx +0 -79
  15. package/src/components/custom/Redirect.tsx +0 -23
  16. package/src/components/error/Error.tsx +0 -168
  17. package/src/components/geocoding/GeocodingField.tsx +0 -167
  18. package/src/components/i18n/BridgedLocalesMenuButton.tsx +0 -160
  19. package/src/components/i18n/LangSwitcher.tsx +0 -204
  20. package/src/components/loader/GlobalLoader.tsx +0 -49
  21. package/src/components/logs/LogFile.tsx +0 -88
  22. package/src/components/logs/LogFileById.tsx +0 -68
  23. package/src/components/logs/LogViewer.tsx +0 -43
  24. package/src/components/menu/AppMenu.tsx +0 -22
  25. package/src/components/menu/CustomMenuItemLink.tsx +0 -61
  26. package/src/components/menu/DarkToggleMode.tsx +0 -65
  27. package/src/components/menu/LanguageToggleMode.tsx +0 -120
  28. package/src/components/misc/CustomImageInput.tsx +0 -62
  29. package/src/components/misc/DASHGlobalErrorHandler.tsx +0 -194
  30. package/src/components/misc/DarkModeSwitcher.tsx +0 -112
  31. package/src/components/misc/HorizontalScroller.tsx +0 -225
  32. package/src/components/misc/LanguageSwitcher.tsx +0 -199
  33. package/src/components/misc/MUIHtmlToolTip.tsx +0 -15
  34. package/src/components/misc/MuiSimpleJsonTable.tsx +0 -279
  35. package/src/components/misc/MultiLevelTable.tsx +0 -229
  36. package/src/components/misc/NoResults.tsx +0 -28
  37. package/src/components/misc/PDFViewer.tsx +0 -85
  38. package/src/components/navigation/Breadcrumbs.tsx +0 -220
  39. package/src/components/navigation/BreadcrumbsManager.tsx +0 -310
  40. package/src/components/navigation/index.tsx +0 -5
  41. package/src/components/panel/Error.tsx +0 -168
  42. package/src/components/permission/AvailablePermissionsContext.tsx +0 -173
  43. package/src/components/permission/PermissionsSelector.tsx +0 -834
  44. package/src/components/permission/PermissionsSelectorList.tsx +0 -473
  45. package/src/components/permission/tsx +0 -0
  46. package/src/components/racustombuttons/CustomRAButton.tsx +0 -87
  47. package/src/components/racustombuttons/QuickButton.tsx +0 -117
  48. package/src/components/racustombuttons/QuickEditButton.tsx +0 -115
  49. package/src/components/racustombuttons/QuickIconButton.tsx +0 -122
  50. package/src/components/scrollbar/Scrollbar.tsx +0 -31
  51. package/src/components/selects/MultiSelect.tsx +0 -53
  52. package/src/components/selects/RASearchableSelect.tsx +0 -282
  53. package/src/components/selects/RASearchableSelectChips.tsx +0 -308
  54. package/src/components/selects/SearchableSelect.tsx +0 -139
  55. package/src/components/serviceAccount/ApiKeyRevealDialog.tsx +0 -129
  56. package/src/components/serviceAccount/ServiceAccountStatusSwitch.tsx +0 -99
  57. package/src/components/subscription/BillingCycleSelectInput.tsx +0 -68
  58. package/src/components/subscription/PlanAddonsSettings.tsx +0 -563
  59. package/src/components/subscription/PlanAuditLog.tsx +0 -453
  60. package/src/components/subscription/PlanFeaturesSettings.tsx +0 -243
  61. package/src/components/subscription/PlanLimitsSettings.tsx +0 -230
  62. package/src/components/subscription/PlanMetadataSettings.tsx +0 -306
  63. package/src/components/subscription/PlanPricesSettings.tsx +0 -307
  64. package/src/components/subscription/index.ts +0 -7
  65. package/src/components/svgelements/SvgLoading.tsx +0 -229
  66. package/src/components/svgelements/SvgLogo.tsx +0 -53
  67. package/src/components/svgelements/SvgLogoMin.tsx +0 -64
  68. package/src/components/svgelements/SvgShipping.tsx +0 -673
  69. package/src/components/tenancy/GlobalTenantWrapper.tsx +0 -84
  70. package/src/components/tenancy/TenantSwitcher.tsx +0 -514
  71. package/src/components/tenant/AvailablePermissionsContext.tsx +0 -0
  72. package/src/components/tenant/SettingsSections.tsx +0 -151
  73. package/src/components/tenant/TenancySettings.tsx +0 -122
  74. package/src/components/tenant/TenantAttributes.tsx +0 -153
  75. package/src/components/tenant/TenantAttributesContext.tsx +0 -163
  76. package/src/components/tenant/TenantSelector.tsx +0 -142
  77. package/src/components/tenant/TenantSettings.tsx +0 -184
  78. package/src/components/tenant/TenantSettingsContext.tsx +0 -165
  79. package/src/components/tenant/TenantTheme.tsx +0 -172
  80. package/src/components/user/AvatarComponent.tsx +0 -317
  81. package/src/components/user/TenantAvatarComponent.tsx +0 -99
  82. package/src/components/user/UserPreferences.tsx +0 -677
  83. package/src/config/ACTIONS.tsx +0 -26
  84. package/src/config/ConstantsService.tsx +0 -44
  85. package/src/config/DASHAdminSystemConstants.tsx +0 -183
  86. package/src/config/PARSERS.tsx +0 -9
  87. package/src/contexts/DashQueryClientContext.tsx +0 -113
  88. package/src/contexts/DashResourceContext.tsx +0 -34
  89. package/src/contexts/I18nBridgeContext.tsx +0 -156
  90. package/src/contexts/I18nBridgeSetter.tsx +0 -39
  91. package/src/contexts/I18nReduxSync.tsx +0 -27
  92. package/src/contexts/SubscriptionPlanFormatsProvider.tsx +0 -217
  93. package/src/contexts/SystemRequestsCache.tsx +0 -215
  94. package/src/contexts/auth/AuthContext.tsx +0 -567
  95. package/src/contexts/auth/AuthContextLocalStorage.tsx +0 -140
  96. package/src/contexts/auth/DASHAuthenticationService.tsx +0 -915
  97. package/src/contexts/auth/WindowContext.tsx +0 -15
  98. package/src/contexts/auth/index.tsx +0 -3
  99. package/src/contexts/com/FCMContext.tsx +0 -415
  100. package/src/contexts/com/LaravelEchoContext.tsx +0 -41
  101. package/src/contexts/com/LaravelEchoMgr.tsx +0 -155
  102. package/src/contexts/com/components/DefaultNotificationComponent.tsx +0 -20
  103. package/src/contexts/com/components/EchoNotificationsCenter.tsx +0 -65
  104. package/src/contexts/com/components/NotificationAttributesTable.tsx +0 -54
  105. package/src/contexts/com/components/NotificationRenderer.tsx +0 -42
  106. package/src/contexts/com/components/NotificationsWidget.tsx +0 -182
  107. package/src/contexts/com/components/notificationFormats.tsx +0 -50
  108. package/src/contexts/com/useLaravelEcho.tsx +0 -432
  109. package/src/contexts/dictionary/DictionaryContext.tsx +0 -94
  110. package/src/declarations.d.ts +0 -17
  111. package/src/default-theme/DASHAppProviders.tsx +0 -117
  112. package/src/default-theme/DashThemeContext.tsx +0 -209
  113. package/src/default-theme/DashThemeContext.tsx.fast +0 -143
  114. package/src/default-theme/DashThemeContext.tsx.old +0 -306
  115. package/src/default-theme/DashThemeHelperProvider.tsx +0 -98
  116. package/src/default-theme/DomainAppLayout.tsx +0 -166
  117. package/src/default-theme/DomainHeader.tsx +0 -162
  118. package/src/default-theme/DomainTheme.tsx +0 -59
  119. package/src/default-theme/FullLayoutMarkup.tsx +0 -231
  120. package/src/default-theme/StaticLayout.tsx +0 -47
  121. package/src/default-theme/index.tsx +0 -11
  122. package/src/default-theme/menu/AppDashboardGrid.tsx +0 -279
  123. package/src/default-theme/menu/AppMaterialMenu.tsx +0 -546
  124. package/src/default-theme/menu/AppMenuComponents/SubmenuPortal.tsx +0 -61
  125. package/src/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItem.tsx +0 -264
  126. package/src/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItems.tsx +0 -31
  127. package/src/default-theme/menu/AppMenuComponents/expanded/CollapsableSidebarMenu.tsx +0 -293
  128. package/src/default-theme/menu/AppMenuComponents/expanded/SidebarItem.tsx +0 -92
  129. package/src/default-theme/menu/AppMenuComponents/getItem.tsx +0 -17
  130. package/src/default-theme/menu/AppMenuComponents/interfaces.tsx +0 -41
  131. package/src/default-theme/menu/AppMenuComponents/submenuConstants.ts +0 -90
  132. package/src/default-theme/menu/AppSidebarMaterial.tsx +0 -339
  133. package/src/default-theme/menu/SidebarActions.tsx +0 -84
  134. package/src/default-theme/updateDomCssVariables.tsx +0 -176
  135. package/src/helpers/checkRole.tsx +0 -66
  136. package/src/helpers/parseAxiosError.tsx +0 -41
  137. package/src/hooks/audio/useAudio.tsx +0 -39
  138. package/src/hooks/axios.tsx +0 -165
  139. package/src/hooks/data/useDashboardStats.tsx +0 -65
  140. package/src/hooks/data/usePackageByClientsStats.tsx +0 -44
  141. package/src/hooks/data/usePackageByCommunesStats.tsx +0 -44
  142. package/src/hooks/data/usePackageStats.tsx +0 -69
  143. package/src/hooks/data/usePackageWithdrawDetails.tsx +0 -61
  144. package/src/hooks/data/useStats.tsx +0 -86
  145. package/src/hooks/isCurrentPath.tsx +0 -22
  146. package/src/hooks/notifications/WSMessagesManager.tsx +0 -152
  147. package/src/hooks/notifications/WSPusherManager.tsx +0 -92
  148. package/src/hooks/useBreadcrumbs.tsx +0 -329
  149. package/src/hooks/useClickOutside.tsx +0 -57
  150. package/src/hooks/useFormPersistance.tsx +0 -150
  151. package/src/hooks/useGlobalErrorMediator.tsx +0 -43
  152. package/src/hooks/useGlobalLoaderMgr.tsx +0 -21
  153. package/src/hooks/useHash.tsx +0 -27
  154. package/src/hooks/useLocalStorage.tsx +0 -196
  155. package/src/hooks/usePolyglotTranslation.tsx +0 -62
  156. package/src/hooks/usePrevious.tsx +0 -9
  157. package/src/hooks/usePrintSelected.tsx +0 -37
  158. package/src/hooks/useVirtualHash.tsx +0 -33
  159. package/src/hooks/window/useWindowSize.tsx +0 -36
  160. package/src/index.tsx +0 -134
  161. package/src/interfaces/IAppResourceConfig.tsx +0 -20
  162. package/src/interfaces/Log.tsx +0 -16
  163. package/src/interfaces/Tenant.tsx +0 -25
  164. package/src/interfaces/communication/IActions.tsx +0 -5
  165. package/src/interfaces/communication/INotification.tsx +0 -21
  166. package/src/interfaces/communication/IPayload.tsx +0 -3
  167. package/src/interfaces/communication/IRequestAction.tsx +0 -10
  168. package/src/interfaces/communication/IRequestPayload.tsx +0 -7
  169. package/src/interfaces/communication/IResponseAction.tsx +0 -7
  170. package/src/interfaces/misc/IAny.tsx +0 -3
  171. package/src/interfaces/misc/IFlashMessage.tsx +0 -10
  172. package/src/interfaces/navigation/IAppMenu.ts +0 -14
  173. package/src/interfaces/navigation/ICollapsableSidebarMenu.ts +0 -12
  174. package/src/interfaces/navigation/IMenuItem.ts +0 -16
  175. package/src/interfaces/notifications/IModel.tsx +0 -6
  176. package/src/interfaces/notifications/IModelField.tsx +0 -8
  177. package/src/interfaces/notifications/IUserNotification.tsx +0 -12
  178. package/src/interfaces/notifications/IUserNotificationData.tsx +0 -13
  179. package/src/interfaces/notifications/IUserNotificationPayload.tsx +0 -8
  180. package/src/interfaces/user/IGetAuth.tsx +0 -92
  181. package/src/interfaces/user/ITenantSettings.tsx +0 -3
  182. package/src/interfaces/user/IUser.tsx +0 -60
  183. package/src/interfaces/user/IUserSettings.tsx +0 -43
  184. package/src/interfaces.tsx +0 -6
  185. package/src/layout/AppLayout.tsx +0 -112
  186. package/src/layout/ApplicationLayout.tsx +0 -197
  187. package/src/layout/MotionWrapper.original.tsx +0 -236
  188. package/src/layout/MotionWrapper.tsx +0 -236
  189. package/src/layout/ResourceMenu.tsx +0 -164
  190. package/src/layout/ResoureLayout.tsx +0 -105
  191. package/src/layout/TransitionWrapper.tsx +0 -125
  192. package/src/pages/ChangePassword.tsx +0 -179
  193. package/src/pages/DASHLanding.tsx +0 -22
  194. package/src/pages/DASHLightWeightLogin.tsx +0 -611
  195. package/src/pages/DASHSimpleLogin.tsx +0 -260
  196. package/src/pages/Login.tsx +0 -111
  197. package/src/pages/Profile.tsx +0 -357
  198. package/src/pages/RecoverPassword.tsx +0 -175
  199. package/src/pages/SingleImageUploader.tsx +0 -55
  200. package/src/pages/VerifyAccount.tsx +0 -128
  201. package/src/providers/authProvider.tsx +0 -217
  202. package/src/providers/dataProvider.tsx +0 -672
  203. package/src/providers/i18n/en.ts +0 -646
  204. package/src/providers/i18n/es.ts +0 -652
  205. package/src/providers/i18n/languages.tsx +0 -8
  206. package/src/providers/i18n/mergeTranslations.ts +0 -53
  207. package/src/providers/i18nProvider.tsx +0 -23
  208. package/src/react-admin-dash/RADashComponent.tsx +0 -240
  209. package/src/react-admin-dash/Resource.tsx +0 -77
  210. package/src/resources/Brand/BrandResource.tsx +0 -130
  211. package/src/resources/DASHResourceLoader.ts +0 -180
  212. package/src/resources/Log/LogResource.tsx +0 -73
  213. package/src/resources/Tenant/ImpersonateTenantResource.tsx +0 -113
  214. package/src/resources/Trash/TrashTemplate.tsx +0 -180
  215. package/src/resources/User/components/AvatarUploadField.tsx +0 -57
  216. package/src/resources/User/components/PasswordFields.tsx +0 -73
  217. package/src/resources/User/getProfileMenu.ts +0 -57
  218. package/src/resources/User/profileResource.tsx +0 -51
  219. package/src/resources/User/userLayout.tsx +0 -62
  220. package/src/resources/User/userResource.tsx +0 -111
  221. package/src/resources/User/userSchema.tsx +0 -213
  222. package/src/resources/User/usersFilters.tsx +0 -21
  223. package/src/resources.tsx +0 -280
  224. package/src/schemas/log.tsx +0 -45
  225. package/src/schemas/notification.tsx +0 -42
  226. package/src/schemas/permissions.tsx +0 -44
  227. package/src/schemas/roles.tsx +0 -48
  228. package/src/schemas/rolesDataGrid.tsx +0 -48
  229. package/src/schemas/subscription/components/SubscriptionActions.tsx +0 -153
  230. package/src/schemas/subscription/components/SubscriptionPaymentHistory.tsx +0 -127
  231. package/src/schemas/subscription/components/SubscriptionPlanFeatures.tsx +0 -162
  232. package/src/schemas/subscription/components/SubscriptionPlanPreview.tsx +0 -141
  233. package/src/schemas/subscription/components/SubscriptionPlanStats.tsx +0 -318
  234. package/src/schemas/subscription/components/SubscriptionStatusIndicator.tsx +0 -72
  235. package/src/schemas/subscription/subscriptionPlanSchema.tsx +0 -185
  236. package/src/schemas/subscription/subscriptionSchema.tsx +0 -152
  237. package/src/schemas/subscriptionPlan.ts +0 -422
  238. package/src/schemas/tenant.tsx +0 -129
  239. package/src/schemas/tenantUser.tsx +0 -96
  240. package/src/schemas/tenant_superadmin.tsx +0 -119
  241. package/src/schemas/user.tsx +0 -26
  242. package/src/systemResources.old.tsx +0 -928
  243. package/src/systemResources.tsx +0 -1369
  244. package/src/templates/ResourceTemplate.tsx +0 -240
  245. package/src/templates/ResourceTemplate.tsx.memoized_experiment +0 -350
  246. package/src/templates/ResourceTemplate.tsx.original +0 -396
  247. package/src/templates/ResourceTemplateCreate.tsx +0 -182
  248. package/src/templates/ResourceTemplateEdit.tsx +0 -176
  249. package/src/templates/ResourceTemplateFull.tsx +0 -581
  250. package/src/templates/ResourceTemplateList.tsx +0 -340
  251. package/src/templates/ResourceTemplateOld.tsx.bkup +0 -567
  252. package/src/templates/ResourceTemplateShow.tsx +0 -88
  253. package/src/templates/TrashTemplate.tsx +0 -179
  254. package/src/tenantResources.tsx +0 -223
  255. package/src/test_portal_bubbles.tsx +0 -40
  256. package/src/theme/AppHeader.tsx +0 -52
  257. package/src/theme/AppLayoutSetting.tsx +0 -33
  258. package/src/theme/AppLogo.tsx +0 -13
  259. package/src/theme/AppSidebar.tsx +0 -12
  260. package/src/theme/AppSidebarContent.tsx +0 -105
  261. package/src/theme/AppSidebarLogo.tsx +0 -48
  262. package/src/theme/components/PageTitle.tsx +0 -37
  263. package/src/utils/cache/CacheInvalidatorContext.tsx +0 -125
  264. package/src/utils/cache/CacheInvalidatorListenerComponent.tsx +0 -10
  265. package/src/utils/cache/useCacheInvalidatorListener.tsx +0 -27
  266. package/src/utils/convertFileToBase64.tsx +0 -9
  267. package/src/utils/convertToFile.tsx +0 -14
  268. package/src/utils/cookies.tsx +0 -33
  269. package/src/utils/dashDefaultQueryClient.tsx +0 -34
  270. package/src/utils/dataUrlToBlob.tsx +0 -30
  271. package/src/utils/deepReplace.tsx +0 -19
  272. package/src/utils/getProfileMenu.tsx +0 -41
  273. package/src/utils/getTenantSettings.tsx +0 -9
  274. package/src/utils/getType.tsx +0 -8
  275. package/src/utils/getUserSettings.tsx +0 -8
  276. package/src/utils/hasCode.tsx +0 -14
  277. package/src/utils/index.ts +0 -19
  278. package/src/utils/injectTenantStyles.ts +0 -28
  279. package/src/utils/isComponent.tsx +0 -45
  280. package/src/utils/navEvents.tsx +0 -91
  281. package/src/utils/prototypes.tsx +0 -5
  282. package/src/utils/regexp.tsx +0 -4
  283. package/src/utils/resolveObjectPath.tsx +0 -4
  284. package/src/utils/setNativeValue.tsx +0 -24
  285. package/src/utils/slugify.tsx +0 -11
  286. package/src/utils/validators/emailValidator.tsx +0 -6
  287. package/src/utils/validators/requiredValidator.tsx +0 -5
  288. package/src/utils/validators/rutValidator.tsx +0 -31
  289. package/src/utils/validators.tsx +0 -96
@@ -1,231 +0,0 @@
1
- import * as React from 'react';
2
- import { useTheme, useMediaQuery } from '@mui/material';
3
- /* @ts-ignore */
4
- import Logo from '@app/assets/logo-horizontal.png';
5
- /* @ts-ignore */
6
- import BackImage from '@app/assets/login-back.png';
7
-
8
- export interface IFullLayoutMarkup<U = any, A = any> extends React.PropsWithChildren {
9
- logo?: string | React.ReactNode;
10
- loginBackground?: string | React.ReactNode;
11
- }
12
-
13
- const FullLayoutMarkup = <U, A>({
14
- children,
15
- className,
16
- logo = <img alt='logo' className='dash-app-login-logo' src={Logo} />,
17
- loginBackground = <img alt='' src={BackImage} />,
18
- ...props
19
- }: IFullLayoutMarkup<U, A> & { className?: string }): React.JSX.Element => {
20
- const theme = useTheme();
21
- const isXs = useMediaQuery(theme.breakpoints.only('xs'));
22
- const isSm = useMediaQuery(theme.breakpoints.only('sm'));
23
- const isMd = useMediaQuery(theme.breakpoints.only('md'));
24
- const isLg = useMediaQuery(theme.breakpoints.only('lg'));
25
- const isXl = useMediaQuery(theme.breakpoints.only('xl'));
26
- /*
27
- // Mobile and keyboard state
28
- const [isMobile, setIsMobile] = useState(false);
29
- const [isKeyboardOpen, setIsKeyboardOpen] = useState(false);
30
- const [keyboardHeight, setKeyboardHeight] = useState(0);
31
-
32
-
33
- // Check if Capacitor Keyboard is available through window
34
- const isCapacitorKeyboardAvailable = (): boolean => {
35
- const hasCapacitor = !!(window as any)?.Capacitor?.Plugins?.Keyboard;
36
- const hasCapacitorKeyboard = !!(window as any)?.CapacitorKeyboard;
37
- console.log('Checking Capacitor keyboard availability:', { hasCapacitor, hasCapacitorKeyboard });
38
- return hasCapacitor || hasCapacitorKeyboard;
39
- };
40
-
41
- // Get Capacitor Keyboard instance from window
42
- const getCapacitorKeyboard = () => {
43
- return (window as any)?.Capacitor?.Plugins?.Keyboard || (window as any)?.CapacitorKeyboard;
44
- };
45
-
46
- const checkMobileDevice = () => {
47
- // Check body classes for mobile devices
48
- const bodyClasses = document.body.className;
49
- const hasMobileClass = bodyClasses.includes('webview') ||
50
- bodyClasses.includes('android') ||
51
- bodyClasses.includes('ios') ||
52
- bodyClasses.includes('mobile');
53
-
54
- // Check screen width
55
- const screenWidth = window.innerWidth;
56
- const isSmallScreen = screenWidth < 700;
57
-
58
- // Consider mobile if either condition is true
59
- return hasMobileClass || isSmallScreen;
60
- };
61
-
62
- // Keyboard logging functions
63
- const logKeyboardShow = (height?: number, source: 'capacitor' | 'fallback' = 'capacitor') => {
64
- console.log(`🔼 KEYBOARD OPENED (${source}):`, {
65
- height: height || 'unknown',
66
- timestamp: new Date().toISOString(),
67
- isMobile,
68
- screenHeight: window.screen.height,
69
- viewportHeight: window.visualViewport?.height || window.innerHeight,
70
- source
71
- });
72
- };
73
-
74
- const logKeyboardHide = (source: 'capacitor' | 'fallback' = 'capacitor') => {
75
- console.log(`🔽 KEYBOARD CLOSED (${source}):`, {
76
- timestamp: new Date().toISOString(),
77
- isMobile,
78
- screenHeight: window.screen.height,
79
- viewportHeight: window.visualViewport?.height || window.innerHeight,
80
- source
81
- });
82
- };
83
-
84
- // Fallback keyboard detection for web/non-Capacitor environments
85
- const setupFallbackKeyboardDetection = () => {
86
- const handleResize = () => {
87
- const mobile = checkMobileDevice();
88
- setIsMobile(mobile);
89
-
90
- if (mobile) {
91
- // On mobile, detect keyboard by viewport height change
92
- const viewportHeight = window.visualViewport?.height || window.innerHeight;
93
- const screenHeight = window.screen.height;
94
-
95
- // If viewport is significantly smaller than screen, keyboard is likely open
96
- const keyboardThreshold = screenHeight * 0.75;
97
- const keyboardOpen = viewportHeight < keyboardThreshold;
98
-
99
- // Only log if keyboard state actually changed
100
- if (keyboardOpen !== isKeyboardOpen) {
101
- if (keyboardOpen) {
102
- const estimatedKeyboardHeight = screenHeight - viewportHeight;
103
- logKeyboardShow(estimatedKeyboardHeight, 'fallback');
104
- setKeyboardHeight(estimatedKeyboardHeight);
105
- } else {
106
- logKeyboardHide('fallback');
107
- setKeyboardHeight(0);
108
- }
109
- setIsKeyboardOpen(keyboardOpen);
110
- }
111
- }
112
- };
113
-
114
- // Add resize listeners
115
- window.addEventListener('resize', handleResize);
116
- if (window.visualViewport) {
117
- window.visualViewport.addEventListener('resize', handleResize);
118
- }
119
-
120
- return () => {
121
- window.removeEventListener('resize', handleResize);
122
- if (window.visualViewport) {
123
- window.visualViewport.removeEventListener('resize', handleResize);
124
- }
125
- };
126
- };
127
-
128
- // Setup keyboard detection (Capacitor or fallback)
129
- useEffect(() => {
130
- // Initial mobile check
131
- setIsMobile(checkMobileDevice());
132
-
133
- if (isCapacitorKeyboardAvailable()) {
134
- const Keyboard = getCapacitorKeyboard();
135
-
136
- if (Keyboard) {
137
- console.log('🎹 Using Capacitor Keyboard API for keyboard detection');
138
-
139
- // Setup Capacitor keyboard listeners
140
- const keyboardWillShowListener = Keyboard.addListener('keyboardWillShow', (info: any) => {
141
- console.log('📱 Capacitor: keyboard will show with height:', info.keyboardHeight);
142
- logKeyboardShow(info.keyboardHeight, 'capacitor');
143
- setIsKeyboardOpen(true);
144
- setKeyboardHeight(info.keyboardHeight);
145
- });
146
-
147
- const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', (info: any) => {
148
- console.log('📱 Capacitor: keyboard did show with height:', info.keyboardHeight);
149
- // Don't log again here to avoid duplicate logs, just ensure state is correct
150
- setIsKeyboardOpen(true);
151
- setKeyboardHeight(info.keyboardHeight);
152
- });
153
-
154
- const keyboardWillHideListener = Keyboard.addListener('keyboardWillHide', () => {
155
- console.log('📱 Capacitor: keyboard will hide');
156
- logKeyboardHide('capacitor');
157
- setIsKeyboardOpen(false);
158
- setKeyboardHeight(0);
159
- });
160
-
161
- const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', () => {
162
- console.log('📱 Capacitor: keyboard did hide');
163
- // Don't log again here to avoid duplicate logs, just ensure state is correct
164
- setIsKeyboardOpen(false);
165
- setKeyboardHeight(0);
166
- });
167
-
168
- // Cleanup function for Capacitor listeners
169
- return () => {
170
- keyboardWillShowListener.then((listener: any) => listener.remove());
171
- keyboardDidShowListener.then((listener: any) => listener.remove());
172
- keyboardWillHideListener.then((listener: any) => listener.remove());
173
- keyboardDidHideListener.then((listener: any) => listener.remove());
174
- };
175
- }
176
- }
177
-
178
- // If Capacitor is not available or Keyboard is not found, use fallback
179
- console.log('🌐 Using fallback keyboard detection (viewport-based)');
180
- return setupFallbackKeyboardDetection();
181
- }, []);
182
-
183
- // Configure Capacitor Keyboard on mount (if available)
184
- useEffect(() => {
185
- const configureKeyboard = async () => {
186
- if (isCapacitorKeyboardAvailable()) {
187
- const Keyboard = getCapacitorKeyboard();
188
-
189
- if (Keyboard) {
190
- try {
191
- console.log('⚙️ Configuring Capacitor Keyboard settings...');
192
-
193
- // Disable accessory bar for cleaner login UI
194
- await Keyboard.setAccessoryBarVisible({ isVisible: false });
195
-
196
- // Set resize mode to body for better control
197
- await Keyboard.setResizeMode({ mode: 'body' });
198
-
199
- console.log('✅ Capacitor Keyboard configured successfully');
200
- } catch (error) {
201
- console.log('❌ Error configuring Capacitor Keyboard:', error);
202
- }
203
- }
204
- }
205
- };
206
-
207
- configureKeyboard();
208
- }, []);
209
- */
210
-
211
- const currentSize = isXs ? 'xs' : isSm ? 'sm' : isMd ? 'md' : isLg ? 'lg' : isXl ? 'xl' : '';
212
- const largerToSm = currentSize === 'md' || currentSize === 'lg' || currentSize === 'xl';
213
-
214
- // `logo`/`loginBackground` are still accepted for backwards compatibility
215
- // with existing callers, but are no longer rendered as a decorative
216
- // `.dash-app-login-back` side/stacked panel here — pages that want a
217
- // logo/banner (e.g. DASHLightWeightLogin's "already logged in" screen)
218
- // now render their own, inline with their content.
219
- void largerToSm;
220
- void logo;
221
- void loginBackground;
222
-
223
- return (
224
- <div className={`dash-app-layout ${className || ''}`}>
225
- <div className='dash-app-login-wrapper'>
226
- {children}
227
- </div>
228
- </div>
229
- );
230
- };
231
- export default FullLayoutMarkup;
@@ -1,47 +0,0 @@
1
- import { IDASHAppState } from 'dash-admin-state';
2
- import { IDashAutoAdminResourceConfig } from 'dash-auto-admin';
3
- import React, { PropsWithChildren } from 'react';
4
- import { useSelector } from 'react-redux';
5
-
6
- export interface IStaticLayout<U = any, A = any> extends React.PropsWithChildren { }
7
-
8
- const StaticLayout = <U, A>({
9
- children,
10
- ...props
11
- }: IStaticLayout<U, A>): React.JSX.Element => {
12
-
13
- const panelSettings = useSelector(
14
- (state: IDASHAppState<U, A, IDashAutoAdminResourceConfig>) =>
15
- state.common.panelSettings,
16
- );
17
-
18
- //const logo = panelSettings?.logo || <>🖥 DASH</>;
19
- const squaredLogo = panelSettings?.squaredLogo || <>🖥.</>;
20
- //const loginBackground = panelSettings?.loginBackground || <> Welcome to Dash Panel </>;
21
-
22
- return (
23
- <div className='dash-app-static'>
24
- <div className='dash-app-static-wrapper'>
25
- <div className='dash-app-static-content'>
26
- <a href='/'>
27
- {typeof squaredLogo === 'string' ? (
28
- <img alt='logo' className='dash-app-static-logo' src={squaredLogo} />
29
- ) : (
30
- <div className='dash-app-static-logo'>{squaredLogo}</div>
31
- )}
32
- </a>
33
-
34
- {children}
35
- </div>
36
- {/*<div className='dash-app-back'>
37
- <img alt='logo' src={ImgLogo} className='dash-app-logo' />
38
- <div className='dash-app-login-img'>
39
- <img src={ImgLoginBack} alt='' />
40
- </div>
41
- </div>*/}
42
- </div>
43
- </div>
44
- );
45
- };
46
-
47
- export default StaticLayout;
@@ -1,11 +0,0 @@
1
- export { default as DASHAppLayout } from './DomainAppLayout';
2
- export { default as DASHAppProviders } from './DASHAppProviders';
3
-
4
- export { default as DomainTheme } from './DomainTheme';
5
- export { default as DomainHeader } from './DomainHeader';
6
- export { default as FullLayoutMarkup } from './FullLayoutMarkup';
7
- export { default as StaticLayout } from './StaticLayout';
8
- export { default as DashThemeContext } from './DashThemeContext';
9
- export { default as DashThemeHelperProvider, useDashThemeHelperContext } from './DashThemeHelperProvider';
10
- //export { default as updateDomCssVariables } from './updateDomCssVariables';
11
-
@@ -1,279 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { useSelector } from 'react-redux';
4
- import { useNavigate } from 'react-router';
5
- import { Box, Paper, ButtonBase, Typography, useTheme, SxProps, Theme } from '@mui/material';
6
- import HorizontalScroller from '../../components/misc/HorizontalScroller';
7
-
8
- import { IDashAutoAdminResourceConfig } from 'dash-auto-admin';
9
- import { IDASHAppState } from 'dash-admin-state';
10
-
11
- import checkRole from '../../helpers/checkRole';
12
- import { useAuthContext } from '../../contexts/auth/AuthContext';
13
- import { useI18nBridge } from '../../contexts/I18nBridgeContext';
14
-
15
- export type DashboardGridCardSize = 'small' | 'medium' | 'large' | number;
16
-
17
- export interface IDashboardMenuGridColumns {
18
- xs?: number;
19
- sm?: number;
20
- md?: number;
21
- lg?: number;
22
- xl?: number;
23
- }
24
-
25
- export interface IDashboardMenuGridProps {
26
- /** Number of grid columns — a single number, or MUI-style responsive breakpoints. Default: { xs: 2, sm: 3, md: 4, lg: 6 }. */
27
- columns?: number | IDashboardMenuGridColumns;
28
- /** Caps the visible grid to this many rows, scrolling internally beyond that. Omit to let the grid grow with its content. */
29
- rows?: number;
30
- /**
31
- * Which way the grid overflows once `rows` is set.
32
- *
33
- * 'vertical' (default) keeps the existing behaviour — fixed columns, scroll
34
- * down. 'horizontal' lays the cards out in `rows` fixed rows flowing left to
35
- * right and scrolls/swipes sideways, which suits a shortcut strip sharing a
36
- * dashboard with other content: it takes a predictable amount of vertical
37
- * space no matter how many resources a tenant has.
38
- *
39
- * Ignored without `rows` — there is nothing to overflow.
40
- */
41
- orientation?: 'vertical' | 'horizontal';
42
- /** Card/icon preset, or an explicit card size in pixels. Default: 'large'. */
43
- size?: DashboardGridCardSize;
44
- /** Gap between cards, in MUI spacing units. Default: 2. */
45
- gap?: number;
46
- /** Overrides the resources pulled from the Redux store — mirrors AppMaterialMenu's `menu` prop, mainly for debugging/storybook. */
47
- menu?: IDashAutoAdminResourceConfig[];
48
- debug?: boolean;
49
- sx?: SxProps<Theme>;
50
- className?: string;
51
- }
52
-
53
- interface IDashboardGridItem {
54
- key: React.Key;
55
- label: string;
56
- to: string;
57
- icon?: IDashAutoAdminResourceConfig['icon'];
58
- }
59
-
60
- const SIZE_PRESETS: Record<'small' | 'medium' | 'large', { card: number; icon: number }> = {
61
- small: { card: 96, icon: 32 },
62
- medium: { card: 128, icon: 48 },
63
- large: { card: 160, icon: 64 },
64
- };
65
-
66
- const resolveSize = (size: DashboardGridCardSize | undefined) => {
67
- if (typeof size === 'number') {
68
- return { card: size, icon: Math.round(size * 0.4) };
69
- }
70
- return SIZE_PRESETS[size ?? 'large'];
71
- };
72
-
73
- // Same convention AppMaterialMenu uses to turn a resource config into a
74
- // navigable path — kept in sync deliberately, so a resource lands on the
75
- // same URL whether it's clicked from the sidebar or from this grid.
76
- const buildMenuPath = (resource: IDashAutoAdminResourceConfig): string => {
77
- if (resource.menuOnly) {
78
- return resource.redirect || resource.path || `/${resource.model}`;
79
- }
80
- if (resource?.redirect?.startsWith('/')) {
81
- return resource.redirect;
82
- }
83
- if (resource?.redirect) {
84
- return `/${resource.model}/${resource.redirect}`.replace(/\/+/g, '/');
85
- }
86
- return `/${resource.model}`.replace(/\/+/g, '/');
87
- };
88
-
89
- const renderIcon = (icon: IDashAutoAdminResourceConfig['icon'], size: number) => {
90
- if (!icon) return null;
91
-
92
- if (React.isValidElement(icon)) {
93
- const existingSx = (icon.props as any)?.sx;
94
- return React.cloneElement(icon as React.ReactElement<any>, {
95
- sx: { fontSize: size, color: 'primary.main', ...existingSx },
96
- });
97
- }
98
-
99
- const IconComponent = icon as React.ComponentType<any>;
100
- return <IconComponent sx={{ fontSize: size, color: 'primary.main' }} />;
101
- };
102
-
103
- /**
104
- * Flat, icon-first grid of every resource/menu option the current user can
105
- * access — a launcher-style alternative to the sidebar, meant to be dropped
106
- * into an app's Dashboard. Layout (columns/rows/card size) is fully
107
- * prop-driven; the item list itself always comes from the same role-filtered
108
- * resource set AppMaterialMenu uses, so the grid never drifts out of sync
109
- * with what's actually reachable from the sidebar.
110
- */
111
- const AppDashboardGrid: React.FC<IDashboardMenuGridProps> = ({
112
- columns = { xs: 2, sm: 3, md: 4, lg: 6 },
113
- rows,
114
- size = 'large',
115
- orientation = 'vertical',
116
- gap = 2,
117
- menu,
118
- debug,
119
- sx,
120
- className,
121
- }) => {
122
- const navigate = useNavigate();
123
- const theme = useTheme();
124
- const authContext = useAuthContext();
125
- const { i18nProvider } = useI18nBridge();
126
-
127
- const translate = React.useCallback((key: string, options?: any) => {
128
- if (typeof key !== 'string') return key;
129
- if (i18nProvider?.translate) {
130
- try {
131
- return i18nProvider.translate(key, options);
132
- } catch {
133
- return key;
134
- }
135
- }
136
- return key;
137
- }, [i18nProvider]);
138
-
139
- const resources = useSelector(
140
- (state: IDASHAppState<any, any, IDashAutoAdminResourceConfig>) => {
141
- if (debug || menu) return menu;
142
- return state.resources.items;
143
- },
144
- );
145
-
146
- const items = React.useMemo<IDashboardGridItem[]>(() => {
147
- const userRoles = authContext?.user?.roles
148
- ? authContext.user.roles.flatMap((role) => role.name)
149
- : ['Public'];
150
-
151
- return (resources || [])
152
- .filter((resource) => resource.hidden !== true && checkRole(userRoles, resource.roles || []))
153
- .map((resource) => {
154
- const label = resource.label || resource.model;
155
- return {
156
- key: label,
157
- label: translate(label, { _: label }),
158
- to: buildMenuPath(resource),
159
- icon: resource.icon,
160
- };
161
- });
162
- }, [resources, authContext?.user, translate]);
163
-
164
- const { card: cardSize, icon: iconSize } = resolveSize(size);
165
-
166
- const columnTemplate = React.useMemo(() => {
167
- if (typeof columns === 'number') {
168
- return `repeat(${columns}, minmax(0, 1fr))`;
169
- }
170
- return {
171
- xs: `repeat(${columns.xs ?? 2}, minmax(0, 1fr))`,
172
- sm: `repeat(${columns.sm ?? columns.xs ?? 3}, minmax(0, 1fr))`,
173
- md: `repeat(${columns.md ?? columns.sm ?? 4}, minmax(0, 1fr))`,
174
- lg: `repeat(${columns.lg ?? columns.md ?? 6}, minmax(0, 1fr))`,
175
- xl: `repeat(${columns.xl ?? columns.lg ?? 6}, minmax(0, 1fr))`,
176
- };
177
- }, [columns]);
178
-
179
- if (!items.length) return null;
180
-
181
- const gapPx = theme.spacing(gap);
182
-
183
- // Defined once and used by both layouts — the two branches differ only in
184
- // how the cards are arranged, never in what a card is.
185
- const cards = items.map((item) => (
186
- <ButtonBase
187
- key={item.key}
188
- onClick={() => navigate(item.to)}
189
- sx={{ display: 'block', borderRadius: 2, textAlign: 'left' }}
190
- >
191
- <Paper
192
- variant="outlined"
193
- sx={{
194
- display: 'flex',
195
- flexDirection: 'column',
196
- alignItems: 'center',
197
- justifyContent: 'center',
198
- gap: 1,
199
- height: cardSize,
200
- width: '100%',
201
- p: 2,
202
- borderRadius: 2,
203
- transition: 'background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease',
204
- '&:hover': {
205
- bgcolor: 'action.hover',
206
- borderColor: 'primary.main',
207
- transform: 'translateY(-2px)',
208
- },
209
- }}
210
- >
211
- {renderIcon(item.icon, iconSize)}
212
- <Typography
213
- variant="body2"
214
- align="center"
215
- sx={{
216
- fontWeight: 500,
217
- lineHeight: 1.2,
218
- display: '-webkit-box',
219
- WebkitLineClamp: 2,
220
- WebkitBoxOrient: 'vertical',
221
- overflow: 'hidden',
222
- }}
223
- >
224
- {item.label}
225
- </Typography>
226
- </Paper>
227
- </ButtonBase>
228
- ));
229
-
230
- // The horizontal strip is wrapped in HorizontalScroller so it gets the same
231
- // arrows-plus-swipe behaviour as the category carousel on the create-tab
232
- // screen, rather than a second, subtly different way of scrolling.
233
- if (rows && orientation === 'horizontal') {
234
- return (
235
- <HorizontalScroller
236
- className={className}
237
- ariaLabel="dashboard shortcuts"
238
- step={Math.round(cardSize * 1.1) * 2}
239
- trackSx={{
240
- display: 'grid',
241
- gap,
242
- gridAutoFlow: 'column',
243
- gridTemplateRows: `repeat(${rows}, ${cardSize}px)`,
244
- // A definite column width so the content can exceed the
245
- // container; `1fr` would shrink to fit and never scroll.
246
- gridAutoColumns: `${Math.round(cardSize * 1.1)}px`,
247
- pb: 1,
248
- }}
249
- sx={sx}
250
- >
251
- {cards}
252
- </HorizontalScroller>
253
- );
254
- }
255
-
256
- return (
257
- <Box
258
- className={className}
259
- sx={{
260
- display: 'grid',
261
- gap,
262
- ...(rows
263
- ? {
264
- gridAutoRows: cardSize,
265
- maxHeight: `calc(${rows} * ${cardSize}px + ${rows - 1} * ${gapPx})`,
266
- overflowY: 'auto',
267
- pr: 1,
268
- }
269
- : {}),
270
- gridTemplateColumns: columnTemplate,
271
- ...sx,
272
- }}
273
- >
274
- {cards}
275
- </Box>
276
- );
277
- };
278
-
279
- export default AppDashboardGrid;