@dashadmin/dash-boilerplate 1.3.73 → 1.3.74-srcfree.2

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.
@@ -0,0 +1,7 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ export interface AppWrapperLightProps extends PropsWithChildren {
3
+ onReset?: () => void;
4
+ showSplash?: boolean;
5
+ }
6
+ export declare const AppWrapperLight: React.FC<AppWrapperLightProps>;
7
+ export default AppWrapperLight;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ export interface CustomErrorBoundaryProps {
3
+ children: React.ReactNode;
4
+ fallback?: React.ReactNode;
5
+ onError?: (error: Error, errorInfo: React.ErrorInfo) => void;
6
+ }
7
+ interface CustomErrorBoundaryState {
8
+ hasError: boolean;
9
+ error?: Error;
10
+ }
11
+ export declare class CustomErrorBoundary extends React.Component<CustomErrorBoundaryProps, CustomErrorBoundaryState> {
12
+ constructor(props: CustomErrorBoundaryProps);
13
+ static getDerivedStateFromError(error: Error): CustomErrorBoundaryState;
14
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
15
+ handleReload: () => void;
16
+ render(): React.ReactNode;
17
+ }
18
+ export default CustomErrorBoundary;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const DarkToggleModeLight: React.FC;
3
+ export default DarkToggleModeLight;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ export interface DefaultErrorFallbackProps {
3
+ error?: Error | string | null;
4
+ message?: string;
5
+ onRetry?: () => void;
6
+ retryLabel?: string;
7
+ containerStyle?: React.CSSProperties;
8
+ messageStyle?: React.CSSProperties;
9
+ buttonStyle?: React.CSSProperties;
10
+ }
11
+ export interface DefaultLoadingFallbackProps {
12
+ message?: string;
13
+ containerStyle?: React.CSSProperties;
14
+ }
15
+ export declare const DefaultInitializationErrorFallback: React.FC<DefaultErrorFallbackProps>;
16
+ export declare const DefaultAppLoadErrorFallback: React.FC<DefaultErrorFallbackProps>;
17
+ export interface CreateLazyAppLoaderOptions {
18
+ importFn: () => Promise<{
19
+ default: React.ComponentType<any>;
20
+ }>;
21
+ delay?: number;
22
+ ErrorFallback?: React.FC<DefaultErrorFallbackProps>;
23
+ errorMessage?: string;
24
+ }
25
+ export declare const createLazyAppLoader: ({ importFn, delay, ErrorFallback, errorMessage, }: CreateLazyAppLoaderOptions) => React.LazyExoticComponent<React.ComponentType<any>>;
26
+ declare const _default: {
27
+ DefaultInitializationErrorFallback: React.FC<DefaultErrorFallbackProps>;
28
+ DefaultAppLoadErrorFallback: React.FC<DefaultErrorFallbackProps>;
29
+ createLazyAppLoader: ({ importFn, delay, ErrorFallback, errorMessage, }: CreateLazyAppLoaderOptions) => React.LazyExoticComponent<React.ComponentType<any>>;
30
+ };
31
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export interface GlobalSmallLoaderProps {
3
+ message?: string;
4
+ showMessage?: boolean;
5
+ }
6
+ export declare const setGlobalLoaderIcon: (svgMarkup: string) => void;
7
+ export declare const GlobalSmallLoader: React.FC<GlobalSmallLoaderProps>;
8
+ export declare const GlobalLoaderHtmlMarkup: (message?: string) => string;
9
+ export declare const injectCriticalStyles: () => void;
10
+ export default GlobalSmallLoader;
@@ -0,0 +1,9 @@
1
+ export { GlobalSmallLoader, GlobalLoaderHtmlMarkup, injectCriticalStyles, setGlobalLoaderIcon } from './GlobalSmallLoader';
2
+ export type { GlobalSmallLoaderProps } from './GlobalSmallLoader';
3
+ export { CustomErrorBoundary } from './CustomErrorBoundary';
4
+ export type { CustomErrorBoundaryProps } from './CustomErrorBoundary';
5
+ export { AppWrapperLight } from './AppWrapperLight';
6
+ export type { AppWrapperLightProps } from './AppWrapperLight';
7
+ export { DarkToggleModeLight } from './DarkToggleModeLight';
8
+ export { DefaultInitializationErrorFallback, DefaultAppLoadErrorFallback, createLazyAppLoader, } from './DefaultFallbacks';
9
+ export type { DefaultErrorFallbackProps, DefaultLoadingFallbackProps, CreateLazyAppLoaderOptions, } from './DefaultFallbacks';
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { SimpleI18nProvider } from './types';
3
+ export declare const LOCALE_CHANGE_EVENT = "dash:locale-change";
4
+ interface I18nBridgeContextValue {
5
+ i18nProvider: SimpleI18nProvider | null;
6
+ locale: string;
7
+ setI18nProvider: (provider: SimpleI18nProvider) => void;
8
+ setLocale: (locale: string) => void;
9
+ }
10
+ declare const I18nBridgeContext: React.Context<I18nBridgeContextValue>;
11
+ export interface I18nBridgeProviderLightProps {
12
+ children: React.ReactNode;
13
+ defaultLocale?: string;
14
+ }
15
+ export declare const I18nBridgeProviderLight: React.FC<I18nBridgeProviderLightProps>;
16
+ export declare const useI18nBridgeLight: () => I18nBridgeContextValue;
17
+ export declare const useBridgedLocalesLight: () => {
18
+ locale: string;
19
+ name: string;
20
+ }[];
21
+ export declare const useBridgedChangeLocaleLight: () => (locale: string) => Promise<void>;
22
+ export declare const useBridgedLocaleLight: () => string;
23
+ export declare const useTranslateLight: () => (key: string, options?: Record<string, any>) => string;
24
+ export { I18nBridgeContext };
25
+ export default I18nBridgeProviderLight;
@@ -0,0 +1,10 @@
1
+ import { SimpleI18nProvider, TranslationsMap, LocaleDefinition } from './types';
2
+ export interface CreateSimpleI18nProviderOptions {
3
+ translations: TranslationsMap;
4
+ initialLocale?: string;
5
+ fallbackLocale?: string;
6
+ locales?: LocaleDefinition[];
7
+ onLocaleChange?: (locale: string) => void;
8
+ }
9
+ export declare const createSimpleI18nProvider: (options: CreateSimpleI18nProviderOptions) => SimpleI18nProvider;
10
+ export default createSimpleI18nProvider;
@@ -0,0 +1,5 @@
1
+ export * from './types';
2
+ export { createSimpleI18nProvider } from './createSimpleI18nProvider';
3
+ export type { CreateSimpleI18nProviderOptions } from './createSimpleI18nProvider';
4
+ export { I18nBridgeProviderLight, useI18nBridgeLight, useBridgedLocalesLight, useBridgedChangeLocaleLight, useBridgedLocaleLight, useTranslateLight, I18nBridgeContext, } from './I18nBridgeProviderLight';
5
+ export type { I18nBridgeProviderLightProps } from './I18nBridgeProviderLight';
@@ -0,0 +1,18 @@
1
+ export interface SimpleI18nProvider {
2
+ translate: (key: string, options?: Record<string, any>) => string;
3
+ changeLocale: (locale: string) => Promise<void>;
4
+ getLocale: () => string;
5
+ getLocales?: () => Array<{
6
+ locale: string;
7
+ name: string;
8
+ }>;
9
+ getMessages?: (locale: string) => Record<string, any>;
10
+ }
11
+ export interface LocaleDefinition {
12
+ locale: string;
13
+ name: string;
14
+ languageId?: string;
15
+ icon?: string;
16
+ }
17
+ export type TranslationMessages = Record<string, any>;
18
+ export type TranslationsMap = Record<string, TranslationMessages>;
@@ -0,0 +1,8 @@
1
+ export { createSimpleI18nProvider, I18nBridgeProviderLight, useI18nBridgeLight, useBridgedLocalesLight, useBridgedChangeLocaleLight, useBridgedLocaleLight, useTranslateLight, I18nBridgeContext, } from './i18n';
2
+ export type { SimpleI18nProvider, LocaleDefinition, TranslationMessages, TranslationsMap, I18nBridgeProviderLightProps, CreateSimpleI18nProviderOptions, } from './i18n';
3
+ export { GlobalSmallLoader, GlobalLoaderHtmlMarkup, injectCriticalStyles, setGlobalLoaderIcon, CustomErrorBoundary, AppWrapperLight, DarkToggleModeLight, DefaultInitializationErrorFallback, DefaultAppLoadErrorFallback, createLazyAppLoader, } from './components';
4
+ export type { GlobalSmallLoaderProps, CustomErrorBoundaryProps, AppWrapperLightProps, DefaultErrorFallbackProps, DefaultLoadingFallbackProps, CreateLazyAppLoaderOptions, } from './components';
5
+ export { DashThemeProviderLight, useDashThemeContextLight, DashThemeContext, } from './theme';
6
+ export type { DashThemeContextType, DashThemeProviderLightProps, } from './theme';
7
+ export { useInitializeReduxFromPersisted, useLogoutEventListener, useAppInitialization, usePendingRedirect, useUrlLocaleDetection, usePathnameTracker, useEarlyThemeInit, initializeThemeEarly, syncElectronStore, syncElectronStoreToLocalStorage, isElectron, getElectronStoreValue, setElectronStoreValue, getCssVariableNumber, getCssVariableString, getLayoutDimensionsFromCss, createDefaultPanelSettings, DEFAULT_LAYOUT_DIMENSIONS, } from './utils';
8
+ export type { AppInitializationResult, LayoutDimensions, PanelSettingsOptions } from './utils';
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { Theme } from '@mui/material';
3
+ export interface DashThemeContextType {
4
+ theme: Theme;
5
+ currentMode: 'light' | 'dark';
6
+ setMode: (mode: 'light' | 'dark') => void;
7
+ toggleMode: () => void;
8
+ refreshTheme: () => void;
9
+ }
10
+ declare const DashThemeContext: React.Context<DashThemeContextType>;
11
+ export declare const useDashThemeContextLight: () => DashThemeContextType;
12
+ export interface DashThemeProviderLightProps {
13
+ children: React.ReactNode;
14
+ extendedOptions?: any;
15
+ defaultMode?: 'light' | 'dark';
16
+ }
17
+ export declare const DashThemeProviderLight: React.FC<DashThemeProviderLightProps>;
18
+ export { DashThemeContext };
19
+ export default DashThemeProviderLight;
@@ -0,0 +1,2 @@
1
+ export { DashThemeProviderLight, useDashThemeContextLight, DashThemeContext, } from './DashThemeProviderLight';
2
+ export type { DashThemeProviderLightProps, DashThemeContextType } from './DashThemeProviderLight';
@@ -0,0 +1,14 @@
1
+ export interface AppInitializationResult {
2
+ isLoading: boolean;
3
+ initializationError: string | null;
4
+ }
5
+ export declare const useInitializeReduxFromPersisted: (currentAuthState: boolean) => void;
6
+ export declare const useLogoutEventListener: () => void;
7
+ export declare const useAppInitialization: () => AppInitializationResult;
8
+ export declare const usePendingRedirect: () => void;
9
+ export declare const LOCALE_CHANGE_EVENT = "dash:locale-change";
10
+ export declare const useUrlLocaleDetection: (availableLocales?: string[], defaultLocale?: string) => void;
11
+ export declare const usePathnameTracker: () => string;
12
+ export declare const useEarlyThemeInit: (defaultTheme?: "light" | "dark") => void;
13
+ export declare const initializeThemeEarly: (defaultTheme: string) => void;
14
+ export declare const syncElectronStore: () => Promise<void>;
@@ -0,0 +1,37 @@
1
+ export declare const getCssVariableNumber: (varName: string, defaultValue: number) => number;
2
+ export declare const getCssVariableString: (varName: string, defaultValue?: string) => string;
3
+ export interface LayoutDimensions {
4
+ sidebarLargeWidth: number;
5
+ sidebarSmallWidth: number;
6
+ sidebarHorizontalHeight: number;
7
+ logoVerticalMaxWidth: number;
8
+ logoVerticalMaxHeight: number;
9
+ logoHorizontalMaxWidth: number;
10
+ logoHorizontalMaxHeight: number;
11
+ }
12
+ export declare const DEFAULT_LAYOUT_DIMENSIONS: LayoutDimensions;
13
+ export declare const getLayoutDimensionsFromCss: () => LayoutDimensions;
14
+ export interface PanelSettingsOptions {
15
+ appName?: string;
16
+ horizontalLogo?: React.ReactNode;
17
+ squaredLogo?: React.ReactNode;
18
+ loginBackground?: string;
19
+ sidebarPosition?: 'left' | 'right' | 'top' | 'bottom';
20
+ layoutDimensions?: Partial<LayoutDimensions>;
21
+ }
22
+ export declare const createDefaultPanelSettings: (options?: PanelSettingsOptions) => {
23
+ paddingHorizontal: number;
24
+ paddingVertical: number;
25
+ sidebarLargeWidth: number;
26
+ sidebarSmallWidth: number;
27
+ sidebarHorizontalHeight: number;
28
+ logoVerticalMaxWidth: number;
29
+ logoVerticalMaxHeight: number;
30
+ logoHorizontalMaxWidth: number;
31
+ logoHorizontalMaxHeight: number;
32
+ appName: string;
33
+ horizontalLogo: import("react").ReactNode;
34
+ squaredLogo: import("react").ReactNode;
35
+ loginBackground: string;
36
+ sidebarPosition: "left" | "right" | "bottom" | "top";
37
+ };
@@ -0,0 +1,4 @@
1
+ export declare const syncElectronStoreToLocalStorage: () => Promise<void>;
2
+ export declare const isElectron: () => boolean;
3
+ export declare const getElectronStoreValue: (key: string, defaultValue?: any) => Promise<any>;
4
+ export declare const setElectronStoreValue: (key: string, value: any) => Promise<void>;
@@ -0,0 +1,5 @@
1
+ export { useInitializeReduxFromPersisted, useLogoutEventListener, useAppInitialization, usePendingRedirect, useUrlLocaleDetection, usePathnameTracker, useEarlyThemeInit, initializeThemeEarly, syncElectronStore, } from './DashBootstrapUtils';
2
+ export type { AppInitializationResult } from './DashBootstrapUtils';
3
+ export { syncElectronStoreToLocalStorage, isElectron, getElectronStoreValue, setElectronStoreValue, } from './electronStore';
4
+ export { getCssVariableNumber, getCssVariableString, getLayoutDimensionsFromCss, createDefaultPanelSettings, DEFAULT_LAYOUT_DIMENSIONS, } from './cssVariables';
5
+ export type { LayoutDimensions, PanelSettingsOptions } from './cssVariables';
package/package.json CHANGED
@@ -1,26 +1,27 @@
1
1
  {
2
2
  "name": "@dashadmin/dash-boilerplate",
3
- "version": "1.3.73",
3
+ "version": "1.3.74-srcfree.2",
4
4
  "main": "dist/index.cjs",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "lint": "eslint --ext .ts,.tsx .",
8
8
  "format": "pnpm prettier --write .",
9
9
  "typecheck": "tsc --noEmit",
10
- "build": "tsup"
10
+ "build": "tsup && pnpm run build:types",
11
+ "build:types": "../../node_modules/.bin/tsc -p tsconfig.json --declaration --emitDeclarationOnly --noEmit false --outDir dist --rootDir src --skipLibCheck; test -f dist/index.d.ts"
11
12
  },
12
13
  "dependencies": {
13
14
  "@emotion/react": "latest",
14
15
  "@emotion/styled": "latest",
15
16
  "@mui/icons-material": "^9.3.0",
16
17
  "@mui/material": "^9.3.0",
17
- "@dashadmin/dash-admin": "1.3.73",
18
- "@dashadmin/dash-admin-state": "1.3.73",
19
- "@dashadmin/dash-auth": "1.3.73",
20
- "@dashadmin/dash-auto-admin": "1.3.73",
21
- "@dashadmin/dash-axios-hook": "1.3.73",
22
- "@dashadmin/dash-constants": "1.3.73",
23
- "@dashadmin/dash-utils": "1.3.73",
18
+ "@dashadmin/dash-admin": "1.3.74-srcfree.2",
19
+ "@dashadmin/dash-admin-state": "1.3.74-srcfree.2",
20
+ "@dashadmin/dash-auth": "1.3.74-srcfree.2",
21
+ "@dashadmin/dash-auto-admin": "1.3.74-srcfree.2",
22
+ "@dashadmin/dash-axios-hook": "1.3.74-srcfree.2",
23
+ "@dashadmin/dash-constants": "1.3.74-srcfree.2",
24
+ "@dashadmin/dash-utils": "1.3.74-srcfree.2",
24
25
  "numeral": "^2.0.6",
25
26
  "react": "19.2.8",
26
27
  "react-admin": "5.15.1",
@@ -33,9 +34,9 @@
33
34
  "@types/numeral": "^2.0.5",
34
35
  "@types/react": "latest",
35
36
  "@types/react-dom": "latest",
36
- "@dashadmin/dash-eslint": "1.3.73",
37
- "@dashadmin/dash-prettier": "1.3.73",
38
- "@dashadmin/dash-tsconfig": "1.3.73",
37
+ "@dashadmin/dash-eslint": "1.3.74-srcfree.2",
38
+ "@dashadmin/dash-prettier": "1.3.74-srcfree.2",
39
+ "@dashadmin/dash-tsconfig": "1.3.74-srcfree.2",
39
40
  "typescript": "latest"
40
41
  },
41
42
  "module": "dist/index.js",