@djangocfg/layouts 1.2.39 → 1.2.41

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/layouts",
3
- "version": "1.2.39",
3
+ "version": "1.2.41",
4
4
  "description": "Layout system and components for Unrealon applications",
5
5
  "author": {
6
6
  "name": "DjangoCFG",
@@ -63,9 +63,9 @@
63
63
  "check": "tsc --noEmit"
64
64
  },
65
65
  "peerDependencies": {
66
- "@djangocfg/api": "^1.2.39",
67
- "@djangocfg/og-image": "^1.2.39",
68
- "@djangocfg/ui": "^1.2.39",
66
+ "@djangocfg/api": "^1.2.41",
67
+ "@djangocfg/og-image": "^1.2.41",
68
+ "@djangocfg/ui": "^1.2.41",
69
69
  "@hookform/resolvers": "^5.2.0",
70
70
  "consola": "^3.4.2",
71
71
  "lucide-react": "^0.468.0",
@@ -86,7 +86,7 @@
86
86
  "vidstack": "0.6.15"
87
87
  },
88
88
  "devDependencies": {
89
- "@djangocfg/typescript-config": "^1.2.39",
89
+ "@djangocfg/typescript-config": "^1.2.41",
90
90
  "@types/node": "^24.7.2",
91
91
  "@types/react": "19.2.2",
92
92
  "@types/react-dom": "19.2.1",
@@ -37,7 +37,7 @@ import { PagePreloader } from './layouts/AdminLayout/components';
37
37
  import { determineLayoutMode, getRedirectUrl } from './utils';
38
38
  import { useAuth } from '../../auth';
39
39
  import type { AppLayoutConfig } from './types';
40
- import type { ValidationErrorConfig } from '../../validation';
40
+ import type { ValidationErrorConfig, CORSErrorConfig, NetworkErrorConfig } from '../../validation';
41
41
 
42
42
  // Dynamic import for AdminLayout to prevent SSR hydration issues
43
43
  const AdminLayout = dynamic(
@@ -78,11 +78,20 @@ export interface AppLayoutProps {
78
78
  */
79
79
  showPackageVersions?: boolean;
80
80
  /**
81
- * Configuration for validation error tracking
82
- * @default { enableToast: true, maxErrors: 50 }
83
- * @example validationConfig={{ enableToast: false }}
81
+ * Validation error tracking configuration
82
+ * @default { enabled: true, showToast: true, maxErrors: 50 }
84
83
  */
85
- validationConfig?: Partial<ValidationErrorConfig>;
84
+ validation?: Partial<ValidationErrorConfig>;
85
+ /**
86
+ * CORS error tracking configuration
87
+ * @default { enabled: true, showToast: true }
88
+ */
89
+ cors?: Partial<CORSErrorConfig>;
90
+ /**
91
+ * Network error tracking configuration
92
+ * @default { enabled: false }
93
+ */
94
+ network?: Partial<NetworkErrorConfig>;
86
95
  }
87
96
 
88
97
  /**
@@ -255,7 +264,7 @@ function LayoutRouter({
255
264
  * </AppLayout>
256
265
  * ```
257
266
  */
258
- export function AppLayout({ children, config, disableLayout = false, forceLayout, fontFamily, showPackageVersions, validationConfig }: AppLayoutProps) {
267
+ export function AppLayout({ children, config, disableLayout = false, forceLayout, fontFamily, showPackageVersions, validation, cors, network }: AppLayoutProps) {
259
268
  const router = useRouter();
260
269
 
261
270
  // Check if ErrorBoundary is enabled (default: true)
@@ -298,7 +307,7 @@ export function AppLayout({ children, config, disableLayout = false, forceLayout
298
307
  }} />
299
308
  )}
300
309
 
301
- <CoreProviders config={config} validationConfig={validationConfig}>
310
+ <CoreProviders config={config} validation={validation} cors={cors} network={network}>
302
311
  {appContent}
303
312
  </CoreProviders>
304
313
  </>
@@ -16,36 +16,36 @@ export interface PackageInfo {
16
16
  /**
17
17
  * Package versions registry
18
18
  * Auto-synced from package.json files
19
- * Last updated: 2025-11-19T04:18:48.875Z
19
+ * Last updated: 2025-11-19T12:08:51.786Z
20
20
  */
21
21
  const PACKAGE_VERSIONS: PackageInfo[] = [
22
22
  {
23
23
  "name": "@djangocfg/ui",
24
- "version": "1.2.39"
24
+ "version": "1.2.41"
25
25
  },
26
26
  {
27
27
  "name": "@djangocfg/api",
28
- "version": "1.2.39"
28
+ "version": "1.2.41"
29
29
  },
30
30
  {
31
31
  "name": "@djangocfg/layouts",
32
- "version": "1.2.39"
32
+ "version": "1.2.41"
33
33
  },
34
34
  {
35
35
  "name": "@djangocfg/markdown",
36
- "version": "1.2.39"
36
+ "version": "1.2.41"
37
37
  },
38
38
  {
39
39
  "name": "@djangocfg/og-image",
40
- "version": "1.2.39"
40
+ "version": "1.2.41"
41
41
  },
42
42
  {
43
43
  "name": "@djangocfg/eslint-config",
44
- "version": "1.2.39"
44
+ "version": "1.2.41"
45
45
  },
46
46
  {
47
47
  "name": "@djangocfg/typescript-config",
48
- "version": "1.2.39"
48
+ "version": "1.2.41"
49
49
  }
50
50
  ];
51
51
 
@@ -9,18 +9,32 @@
9
9
  import React, { ReactNode } from 'react';
10
10
  import { ThemeProvider, Toaster } from '@djangocfg/ui';
11
11
  import { AuthProvider } from '../../../auth';
12
- import { ValidationErrorProvider } from '../../../validation';
12
+ import { ErrorTrackingProvider } from '../../../validation';
13
13
  import type { AppLayoutConfig } from '../types';
14
- import type { ValidationErrorConfig } from '../../../validation';
14
+ import type { ValidationErrorConfig, CORSErrorConfig, NetworkErrorConfig } from '../../../validation';
15
15
 
16
16
  export interface CoreProvidersProps {
17
17
  children: ReactNode;
18
18
  config: AppLayoutConfig;
19
19
  /**
20
- * Configuration for validation error tracking
21
- * @default { enableToast: true, maxErrors: 50 }
20
+ * Validation error tracking configuration
21
+ * @default { enabled: true, showToast: true, maxErrors: 50 }
22
22
  */
23
- validationConfig?: Partial<ValidationErrorConfig>;
23
+ validation?: Partial<ValidationErrorConfig>;
24
+ /**
25
+ * CORS error tracking configuration
26
+ * @default { enabled: true, showToast: true }
27
+ */
28
+ cors?: Partial<CORSErrorConfig>;
29
+ /**
30
+ * Network error tracking configuration
31
+ * @default { enabled: false }
32
+ */
33
+ network?: Partial<NetworkErrorConfig>;
34
+ /**
35
+ * Custom error handler for all error types
36
+ */
37
+ onError?: (error: any) => boolean | void;
24
38
  }
25
39
 
26
40
  /**
@@ -29,10 +43,10 @@ export interface CoreProvidersProps {
29
43
  * Provides:
30
44
  * - ThemeProvider (dark/light mode)
31
45
  * - AuthProvider (authentication)
32
- * - ValidationErrorProvider (Zod validation error tracking)
46
+ * - ErrorTrackingProvider (validation, CORS & network error tracking)
33
47
  * - Toaster (notifications)
34
48
  */
35
- export function CoreProviders({ children, config, validationConfig }: CoreProvidersProps) {
49
+ export function CoreProviders({ children, config, validation, cors, network, onError }: CoreProvidersProps) {
36
50
  return (
37
51
  <ThemeProvider>
38
52
  <AuthProvider
@@ -45,9 +59,14 @@ export function CoreProviders({ children, config, validationConfig }: CoreProvid
45
59
  },
46
60
  }}
47
61
  >
48
- <ValidationErrorProvider config={validationConfig}>
62
+ <ErrorTrackingProvider
63
+ validation={validation}
64
+ cors={cors}
65
+ network={network}
66
+ onError={onError}
67
+ >
49
68
  {children}
50
- </ValidationErrorProvider>
69
+ </ErrorTrackingProvider>
51
70
  </AuthProvider>
52
71
 
53
72
  {/* Global toast notifications */}