@djangocfg/layouts 2.1.409 → 2.1.412
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 +23 -23
- package/src/components/errors/ErrorBoundary.tsx +23 -2
- package/src/components/errors/ErrorLayout.tsx +2 -3
- package/src/layouts/AppLayout/AppLayout.tsx +2 -2
- package/src/layouts/AppLayout/BaseApp.tsx +1 -1
- package/src/layouts/AppLayout/index.ts +2 -2
- package/src/layouts/ProfileLayout/components/PreferencesSection.tsx +1 -1
- package/src/layouts/PublicLayout/footers/DefaultFooter/DefaultFooter.tsx +1 -1
- package/src/layouts/PublicLayout/primitives/NavControls.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.412",
|
|
4
4
|
"description": "Simple, straightforward layout components for Next.js - import and use with props",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"layouts",
|
|
@@ -84,13 +84,13 @@
|
|
|
84
84
|
"check": "tsc --noEmit"
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@djangocfg/api": "^2.1.
|
|
88
|
-
"@djangocfg/centrifugo": "^2.1.
|
|
89
|
-
"@djangocfg/debuger": "^2.1.
|
|
90
|
-
"@djangocfg/i18n": "^2.1.
|
|
91
|
-
"@djangocfg/monitor": "^2.1.
|
|
92
|
-
"@djangocfg/ui-core": "^2.1.
|
|
93
|
-
"@djangocfg/ui-nextjs": "^2.1.
|
|
87
|
+
"@djangocfg/api": "^2.1.412",
|
|
88
|
+
"@djangocfg/centrifugo": "^2.1.412",
|
|
89
|
+
"@djangocfg/debuger": "^2.1.412",
|
|
90
|
+
"@djangocfg/i18n": "^2.1.412",
|
|
91
|
+
"@djangocfg/monitor": "^2.1.412",
|
|
92
|
+
"@djangocfg/ui-core": "^2.1.412",
|
|
93
|
+
"@djangocfg/ui-nextjs": "^2.1.412",
|
|
94
94
|
"@hookform/resolvers": "^5.2.2",
|
|
95
95
|
"consola": "^3.4.2",
|
|
96
96
|
"lucide-react": "^0.545.0",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
"next": "^16.2.2",
|
|
99
99
|
"next-intl": "^4.9.1",
|
|
100
100
|
"p-retry": "^7.0.0",
|
|
101
|
-
"react": "^19.
|
|
102
|
-
"react-dom": "^19.
|
|
101
|
+
"react": "^19.2.4",
|
|
102
|
+
"react-dom": "^19.2.4",
|
|
103
103
|
"react-hook-form": "^7.69.0",
|
|
104
104
|
"sonner": "2.0.7",
|
|
105
105
|
"swr": "^2.3.7",
|
|
@@ -121,22 +121,22 @@
|
|
|
121
121
|
"uuid": "^11.1.0"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@djangocfg/api": "^2.1.
|
|
125
|
-
"@djangocfg/centrifugo": "^2.1.
|
|
126
|
-
"@djangocfg/debuger": "^2.1.
|
|
127
|
-
"@djangocfg/i18n": "^2.1.
|
|
128
|
-
"@djangocfg/monitor": "^2.1.
|
|
129
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
130
|
-
"@djangocfg/ui-core": "^2.1.
|
|
131
|
-
"@djangocfg/ui-nextjs": "^2.1.
|
|
132
|
-
"@djangocfg/ui-tools": "^2.1.
|
|
133
|
-
"@types/node": "^
|
|
134
|
-
"@types/react": "^19.
|
|
135
|
-
"@types/react-dom": "^19.
|
|
124
|
+
"@djangocfg/api": "^2.1.412",
|
|
125
|
+
"@djangocfg/centrifugo": "^2.1.412",
|
|
126
|
+
"@djangocfg/debuger": "^2.1.412",
|
|
127
|
+
"@djangocfg/i18n": "^2.1.412",
|
|
128
|
+
"@djangocfg/monitor": "^2.1.412",
|
|
129
|
+
"@djangocfg/typescript-config": "^2.1.412",
|
|
130
|
+
"@djangocfg/ui-core": "^2.1.412",
|
|
131
|
+
"@djangocfg/ui-nextjs": "^2.1.412",
|
|
132
|
+
"@djangocfg/ui-tools": "^2.1.412",
|
|
133
|
+
"@types/node": "^25.2.3",
|
|
134
|
+
"@types/react": "^19.2.15",
|
|
135
|
+
"@types/react-dom": "^19.2.3",
|
|
136
136
|
"eslint": "^9.37.0",
|
|
137
137
|
"next-intl": "^4.9.1",
|
|
138
138
|
"typescript": "^5.9.3",
|
|
139
|
-
"zustand": "^5.0.
|
|
139
|
+
"zustand": "^5.0.9"
|
|
140
140
|
},
|
|
141
141
|
"publishConfig": {
|
|
142
142
|
"access": "public"
|
|
@@ -23,6 +23,8 @@ interface ErrorBoundaryState {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
26
|
+
private handlePopState: (() => void) | null = null;
|
|
27
|
+
|
|
26
28
|
constructor(props: ErrorBoundaryProps) {
|
|
27
29
|
super(props);
|
|
28
30
|
this.state = { hasError: false, error: null };
|
|
@@ -33,17 +35,36 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
|
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
|
|
36
|
-
// Call custom error handler if provided
|
|
37
38
|
if (this.props.onError) {
|
|
38
39
|
this.props.onError(error, errorInfo);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
|
-
// Log to console in development
|
|
42
42
|
if (isDev) {
|
|
43
43
|
console.error('ErrorBoundary caught an error:', error, errorInfo);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
componentDidUpdate(_prevProps: ErrorBoundaryProps, prevState: ErrorBoundaryState) {
|
|
48
|
+
if (this.state.hasError && !prevState.hasError) {
|
|
49
|
+
this.handlePopState = () => {
|
|
50
|
+
window.location.reload();
|
|
51
|
+
};
|
|
52
|
+
window.addEventListener('popstate', this.handlePopState);
|
|
53
|
+
} else if (!this.state.hasError && prevState.hasError) {
|
|
54
|
+
if (this.handlePopState) {
|
|
55
|
+
window.removeEventListener('popstate', this.handlePopState);
|
|
56
|
+
this.handlePopState = null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
componentWillUnmount() {
|
|
62
|
+
if (this.handlePopState) {
|
|
63
|
+
window.removeEventListener('popstate', this.handlePopState);
|
|
64
|
+
this.handlePopState = null;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
47
68
|
render() {
|
|
48
69
|
if (this.state.hasError) {
|
|
49
70
|
const title = getT('layouts.errors.somethingWentWrong');
|
|
@@ -258,10 +258,9 @@ export function ErrorLayout({
|
|
|
258
258
|
const handleGoBack = () => {
|
|
259
259
|
if (document.referrer && document.referrer !== window.location.href) {
|
|
260
260
|
window.location.href = document.referrer;
|
|
261
|
-
} else if (window.history.length > 1) {
|
|
262
|
-
window.history.back();
|
|
263
261
|
} else {
|
|
264
|
-
window.
|
|
262
|
+
window.history.back();
|
|
263
|
+
setTimeout(() => window.location.reload(), 100);
|
|
265
264
|
}
|
|
266
265
|
};
|
|
267
266
|
|
|
@@ -39,7 +39,7 @@ import { usePathnameWithoutLocale } from '../../hooks';
|
|
|
39
39
|
import { matchesPath } from '../../utils/pathMatcher';
|
|
40
40
|
import { BaseApp } from './BaseApp';
|
|
41
41
|
import { useLayoutI18nOptional } from './LayoutI18nProvider';
|
|
42
|
-
import { ForcedThemeProvider, ThemeOverride, resolveForcedTheme } from '@djangocfg/ui-
|
|
42
|
+
import { ForcedThemeProvider, ThemeOverride, resolveForcedTheme } from '@djangocfg/ui-core/theme';
|
|
43
43
|
|
|
44
44
|
import type {
|
|
45
45
|
ThemeConfig,
|
|
@@ -55,7 +55,7 @@ import type {
|
|
|
55
55
|
export type { I18nLayoutConfig } from '../types';
|
|
56
56
|
import type { AuthConfig } from '@djangocfg/api/auth';
|
|
57
57
|
import type { MonitorConfig } from '@djangocfg/monitor';
|
|
58
|
-
import type { ThemeOverrideRule } from '@djangocfg/ui-
|
|
58
|
+
import type { ThemeOverrideRule } from '@djangocfg/ui-core/theme';
|
|
59
59
|
|
|
60
60
|
import type { FloatingNavbarConfig } from '../PublicLayout/navbars/FloatingNavbar';
|
|
61
61
|
import type { DefaultFooterConfig } from '../PublicLayout/footers/DefaultFooter/types';
|
|
@@ -49,7 +49,7 @@ import { Toaster, TooltipProvider } from '@djangocfg/ui-core/components';
|
|
|
49
49
|
import { DialogProvider } from '@djangocfg/ui-core/lib/dialog-service';
|
|
50
50
|
import { NextRouterAdapter, NextLinkProvider } from '@djangocfg/ui-core/adapters/nextjs';
|
|
51
51
|
import { NextIntlLinkBridge } from './NextIntlLinkBridge';
|
|
52
|
-
import { ThemeProvider } from '@djangocfg/ui-
|
|
52
|
+
import { ThemeProvider } from '@djangocfg/ui-core/theme';
|
|
53
53
|
import { ThemeStyleBridge } from '../../theme/ThemeStyleBridge';
|
|
54
54
|
import { ErrorBoundary } from '../../components/errors/ErrorBoundary';
|
|
55
55
|
import { ErrorTrackingProvider } from '../../components/errors/ErrorsTracker';
|
|
@@ -34,10 +34,10 @@ export {
|
|
|
34
34
|
resolveForcedTheme,
|
|
35
35
|
ForcedThemeProvider,
|
|
36
36
|
useForcedTheme,
|
|
37
|
-
} from '@djangocfg/ui-
|
|
37
|
+
} from '@djangocfg/ui-core/theme';
|
|
38
38
|
export type {
|
|
39
39
|
ThemeOverrideRule,
|
|
40
40
|
ThemeOverrideProps,
|
|
41
41
|
ForcedTheme,
|
|
42
|
-
} from '@djangocfg/ui-
|
|
42
|
+
} from '@djangocfg/ui-core/theme';
|
|
43
43
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
|
|
12
|
-
import { ThemeToggle } from '@djangocfg/ui-
|
|
12
|
+
import { ThemeToggle } from '@djangocfg/ui-core/theme';
|
|
13
13
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
14
14
|
|
|
15
15
|
import { LocaleSwitcherDropdown } from '../../_components/locale-switcher';
|
|
@@ -10,7 +10,7 @@ import React, { memo, useEffect, useMemo, useState } from 'react';
|
|
|
10
10
|
import { Laptop, Moon, Sun } from 'lucide-react';
|
|
11
11
|
|
|
12
12
|
import { Button } from '@djangocfg/ui-core/components';
|
|
13
|
-
import { useForcedTheme, useThemeContext } from '@djangocfg/ui-
|
|
13
|
+
import { useForcedTheme, useThemeContext } from '@djangocfg/ui-core/theme';
|
|
14
14
|
|
|
15
15
|
import { Link } from '@djangocfg/ui-core/components';
|
|
16
16
|
|
|
@@ -5,7 +5,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
5
5
|
|
|
6
6
|
import { Button } from '@djangocfg/ui-core/components';
|
|
7
7
|
import { cn } from '@djangocfg/ui-core/lib';
|
|
8
|
-
import { useThemeContext } from '@djangocfg/ui-
|
|
8
|
+
import { useThemeContext } from '@djangocfg/ui-core/theme';
|
|
9
9
|
|
|
10
10
|
import { LocaleSwitcher } from '../../_components/LocaleSwitcher';
|
|
11
11
|
import { useLayoutI18nOptional } from '../../AppLayout/LayoutI18nProvider';
|