@djangocfg/layouts 2.1.221 → 2.1.223
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/README.md
CHANGED
|
@@ -36,7 +36,6 @@ export default function RootLayout({ children }) {
|
|
|
36
36
|
theme={{ defaultTheme: 'dark', storageKey: 'my-theme' }}
|
|
37
37
|
auth={{ apiUrl: process.env.NEXT_PUBLIC_API_URL }}
|
|
38
38
|
analytics={{ googleTrackingId: 'G-XXXXXXXXXX' }}
|
|
39
|
-
debug={true}
|
|
40
39
|
>
|
|
41
40
|
{children}
|
|
42
41
|
</BaseApp>
|
|
@@ -61,7 +60,7 @@ export default function RootLayout({ children }) {
|
|
|
61
60
|
| `pwaInstall` | `PwaInstallConfig` | — | PWA install prompt |
|
|
62
61
|
| `mcpChat` | `McpChatConfig` | — | AI chat widget |
|
|
63
62
|
| `monitor` | `MonitorConfig` | — | Override monitor config (project/environment come from `project` prop by default) |
|
|
64
|
-
| `debug` | `
|
|
63
|
+
| `debug` | `DebugConfig` | enabled | Debug panel config — see below |
|
|
65
64
|
|
|
66
65
|
**Included automatically:**
|
|
67
66
|
- ThemeProvider, TooltipProvider, SWRConfig, DialogProvider
|
|
@@ -69,7 +68,7 @@ export default function RootLayout({ children }) {
|
|
|
69
68
|
- AnalyticsProvider, CentrifugoProvider, PwaProvider
|
|
70
69
|
- ErrorTrackingProvider, ErrorBoundary
|
|
71
70
|
- MonitorProvider (auto-enabled via `project` prop)
|
|
72
|
-
- DebugButton from `@djangocfg/debuger`
|
|
71
|
+
- DebugButton from `@djangocfg/debuger`
|
|
73
72
|
- NextTopLoader, Toaster
|
|
74
73
|
|
|
75
74
|
## AppLayout
|
|
@@ -90,7 +89,6 @@ export default function RootLayout({ children }) {
|
|
|
90
89
|
project="my-app"
|
|
91
90
|
theme={{ defaultTheme: 'system' }}
|
|
92
91
|
auth={{ apiUrl: process.env.NEXT_PUBLIC_API_URL }}
|
|
93
|
-
debug={true}
|
|
94
92
|
|
|
95
93
|
publicLayout={{ component: PublicLayout, enabledPath: ['/', '/legal', '/contact'] }}
|
|
96
94
|
privateLayout={{ component: PrivateLayout, enabledPath: ['/dashboard', '/profile'] }}
|
|
@@ -162,10 +160,10 @@ import { PublicLayout, PrivateLayout, AuthLayout, AdminLayout, ProfileLayout } f
|
|
|
162
160
|
|
|
163
161
|
## Monitor & Debug
|
|
164
162
|
|
|
165
|
-
Both
|
|
163
|
+
Both auto-enabled via `project` prop — no extra config needed.
|
|
166
164
|
|
|
167
165
|
```tsx
|
|
168
|
-
//
|
|
166
|
+
// window.monitor available in DevTools:
|
|
169
167
|
window.monitor.error('Something broke', { context: 'checkout' })
|
|
170
168
|
window.monitor.warn('Slow response', { ms: 2500 })
|
|
171
169
|
window.monitor.flush() // send buffer immediately
|
|
@@ -181,7 +179,26 @@ Override monitor defaults:
|
|
|
181
179
|
>
|
|
182
180
|
```
|
|
183
181
|
|
|
184
|
-
Debug panel
|
|
182
|
+
### Debug panel
|
|
183
|
+
|
|
184
|
+
`Cmd+D` or `?debug=1` in URL to open.
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
// enabled by default (omit or pass empty object)
|
|
188
|
+
<BaseApp project="my-app">
|
|
189
|
+
|
|
190
|
+
// disable
|
|
191
|
+
<BaseApp debug={{ enabled: false }}>
|
|
192
|
+
|
|
193
|
+
// custom tabs (e.g. Zustand store viewer)
|
|
194
|
+
import type { CustomDebugTab } from '@djangocfg/debuger';
|
|
195
|
+
|
|
196
|
+
const myTabs: CustomDebugTab[] = [
|
|
197
|
+
{ id: 'store', label: 'Stores', icon: Database, panel: StoreTab },
|
|
198
|
+
];
|
|
199
|
+
|
|
200
|
+
<AppLayout debug={{ panel: { tabs: myTabs } }}>
|
|
201
|
+
```
|
|
185
202
|
|
|
186
203
|
## Error Tracking
|
|
187
204
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.223",
|
|
4
4
|
"description": "Simple, straightforward layout components for Next.js - import and use with props",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"layouts",
|
|
@@ -74,13 +74,14 @@
|
|
|
74
74
|
"check": "tsc --noEmit"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@djangocfg/api": "^2.1.
|
|
78
|
-
"@djangocfg/centrifugo": "^2.1.
|
|
79
|
-
"@djangocfg/i18n": "^2.1.
|
|
80
|
-
"@djangocfg/monitor": "^2.1.
|
|
81
|
-
"@djangocfg/
|
|
82
|
-
"@djangocfg/ui-
|
|
83
|
-
"@djangocfg/ui-
|
|
77
|
+
"@djangocfg/api": "^2.1.223",
|
|
78
|
+
"@djangocfg/centrifugo": "^2.1.223",
|
|
79
|
+
"@djangocfg/i18n": "^2.1.223",
|
|
80
|
+
"@djangocfg/monitor": "^2.1.223",
|
|
81
|
+
"@djangocfg/debuger": "^2.1.223",
|
|
82
|
+
"@djangocfg/ui-core": "^2.1.223",
|
|
83
|
+
"@djangocfg/ui-nextjs": "^2.1.223",
|
|
84
|
+
"@djangocfg/ui-tools": "^2.1.223",
|
|
84
85
|
"@hookform/resolvers": "^5.2.2",
|
|
85
86
|
"consola": "^3.4.2",
|
|
86
87
|
"lucide-react": "^0.545.0",
|
|
@@ -102,21 +103,21 @@
|
|
|
102
103
|
}
|
|
103
104
|
},
|
|
104
105
|
"dependencies": {
|
|
105
|
-
"@djangocfg/debuger": "^2.1.221",
|
|
106
106
|
"nextjs-toploader": "^3.9.17",
|
|
107
107
|
"qrcode.react": "^4.2.0",
|
|
108
108
|
"react-ga4": "^2.1.0",
|
|
109
109
|
"uuid": "^11.1.0"
|
|
110
110
|
},
|
|
111
111
|
"devDependencies": {
|
|
112
|
-
"@djangocfg/api": "^2.1.
|
|
113
|
-
"@djangocfg/i18n": "^2.1.
|
|
114
|
-
"@djangocfg/centrifugo": "^2.1.
|
|
115
|
-
"@djangocfg/monitor": "^2.1.
|
|
116
|
-
"@djangocfg/
|
|
117
|
-
"@djangocfg/
|
|
118
|
-
"@djangocfg/ui-
|
|
119
|
-
"@djangocfg/ui-
|
|
112
|
+
"@djangocfg/api": "^2.1.223",
|
|
113
|
+
"@djangocfg/i18n": "^2.1.223",
|
|
114
|
+
"@djangocfg/centrifugo": "^2.1.223",
|
|
115
|
+
"@djangocfg/monitor": "^2.1.223",
|
|
116
|
+
"@djangocfg/debuger": "^2.1.223",
|
|
117
|
+
"@djangocfg/typescript-config": "^2.1.223",
|
|
118
|
+
"@djangocfg/ui-core": "^2.1.223",
|
|
119
|
+
"@djangocfg/ui-nextjs": "^2.1.223",
|
|
120
|
+
"@djangocfg/ui-tools": "^2.1.223",
|
|
120
121
|
"@types/node": "^24.7.2",
|
|
121
122
|
"@types/react": "^19.1.0",
|
|
122
123
|
"@types/react-dom": "^19.1.0",
|
|
@@ -48,6 +48,7 @@ import type {
|
|
|
48
48
|
SWRConfigOptions,
|
|
49
49
|
McpChatConfig,
|
|
50
50
|
PwaInstallConfig,
|
|
51
|
+
DebugConfig,
|
|
51
52
|
} from '../types';
|
|
52
53
|
import type { AuthConfig } from '@djangocfg/api/auth';
|
|
53
54
|
import type { MonitorConfig } from '@djangocfg/monitor';
|
|
@@ -143,8 +144,7 @@ export interface AppLayoutProps {
|
|
|
143
144
|
/** Monitor configuration — initialises window.monitor + auto-captures JS errors & console */
|
|
144
145
|
monitor?: MonitorConfig;
|
|
145
146
|
|
|
146
|
-
|
|
147
|
-
debug?: boolean;
|
|
147
|
+
debug?: DebugConfig;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
/**
|
|
@@ -107,6 +107,10 @@ export function BaseApp({
|
|
|
107
107
|
const centrifugoUrl = centrifugo?.url || process.env.NEXT_PUBLIC_CENTRIFUGO_URL;
|
|
108
108
|
const centrifugoEnabled = centrifugo?.enabled !== false;
|
|
109
109
|
|
|
110
|
+
// Debug panel — enabled by default, disabled with { enabled: false }
|
|
111
|
+
const { enabled: debugEnabled = true, ...debugProps } = debug ?? {};
|
|
112
|
+
|
|
113
|
+
|
|
110
114
|
// Monitor — project prop as default, override with monitor config
|
|
111
115
|
const monitorConfig = {
|
|
112
116
|
project,
|
|
@@ -188,8 +192,8 @@ export function BaseApp({
|
|
|
188
192
|
{/* Auth Dialog - global auth prompt */}
|
|
189
193
|
<AuthDialog authPath={auth?.routes?.auth} />
|
|
190
194
|
|
|
191
|
-
{/* Debug Panel — enabled by default, disable with debug={false} */}
|
|
192
|
-
{
|
|
195
|
+
{/* Debug Panel — enabled by default, disable with debug={{ enabled: false }} */}
|
|
196
|
+
{debugEnabled && <DebugButton {...debugProps} />}
|
|
193
197
|
</ErrorTrackingProvider>
|
|
194
198
|
</PwaProvider>
|
|
195
199
|
</CentrifugoProvider>
|
|
@@ -8,6 +8,7 @@ import type { ReactNode } from 'react';
|
|
|
8
8
|
import type { AuthConfig } from '@djangocfg/api/auth';
|
|
9
9
|
|
|
10
10
|
// Import provider configs from their modules
|
|
11
|
+
import type { DebugButtonProps } from '@djangocfg/debuger';
|
|
11
12
|
import type { AnalyticsConfig } from '../../snippets/Analytics/types';
|
|
12
13
|
import type { PwaInstallConfig } from '../../snippets/PWAInstall/types';
|
|
13
14
|
import type { ErrorBoundaryConfig, ErrorTrackingConfig } from '../../components/errors/types';
|
|
@@ -62,6 +63,12 @@ export interface BaseLayoutProps {
|
|
|
62
63
|
/** Monitor configuration — initialises window.monitor + auto-captures JS errors & console */
|
|
63
64
|
monitor?: MonitorConfig;
|
|
64
65
|
|
|
65
|
-
/** Debug panel
|
|
66
|
-
debug?:
|
|
66
|
+
/** Debug panel configuration */
|
|
67
|
+
debug?: DebugConfig;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Debug panel config — enabled by default, pass enabled: false to disable */
|
|
71
|
+
export interface DebugConfig extends DebugButtonProps {
|
|
72
|
+
/** Set false to disable the debug panel. Default: true */
|
|
73
|
+
enabled?: boolean;
|
|
67
74
|
}
|