@djangocfg/layouts 2.1.221 → 2.1.222

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` | `boolean` | `true` | Debug panel — `Cmd+D` or `?debug=1` to open |
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` (disable with `debug={false}`)
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 are auto-enabled via `project` prop — no extra config needed.
163
+ Both auto-enabled via `project` prop — no extra config needed.
166
164
 
167
165
  ```tsx
168
- // Monitor auto-starts, window.monitor available in DevTools:
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: `Cmd+D` or `?debug=1` in URL. Disable: `debug={false}`.
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.221",
3
+ "version": "2.1.222",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -74,13 +74,13 @@
74
74
  "check": "tsc --noEmit"
75
75
  },
76
76
  "peerDependencies": {
77
- "@djangocfg/api": "^2.1.221",
78
- "@djangocfg/centrifugo": "^2.1.221",
79
- "@djangocfg/i18n": "^2.1.221",
80
- "@djangocfg/monitor": "^2.1.221",
81
- "@djangocfg/ui-core": "^2.1.221",
82
- "@djangocfg/ui-nextjs": "^2.1.221",
83
- "@djangocfg/ui-tools": "^2.1.221",
77
+ "@djangocfg/api": "^2.1.222",
78
+ "@djangocfg/centrifugo": "^2.1.222",
79
+ "@djangocfg/i18n": "^2.1.222",
80
+ "@djangocfg/monitor": "^2.1.222",
81
+ "@djangocfg/ui-core": "^2.1.222",
82
+ "@djangocfg/ui-nextjs": "^2.1.222",
83
+ "@djangocfg/ui-tools": "^2.1.222",
84
84
  "@hookform/resolvers": "^5.2.2",
85
85
  "consola": "^3.4.2",
86
86
  "lucide-react": "^0.545.0",
@@ -102,21 +102,21 @@
102
102
  }
103
103
  },
104
104
  "dependencies": {
105
- "@djangocfg/debuger": "^2.1.221",
105
+ "@djangocfg/debuger": "^2.1.222",
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.221",
113
- "@djangocfg/i18n": "^2.1.221",
114
- "@djangocfg/centrifugo": "^2.1.221",
115
- "@djangocfg/monitor": "^2.1.221",
116
- "@djangocfg/typescript-config": "^2.1.221",
117
- "@djangocfg/ui-core": "^2.1.221",
118
- "@djangocfg/ui-nextjs": "^2.1.221",
119
- "@djangocfg/ui-tools": "^2.1.221",
112
+ "@djangocfg/api": "^2.1.222",
113
+ "@djangocfg/i18n": "^2.1.222",
114
+ "@djangocfg/centrifugo": "^2.1.222",
115
+ "@djangocfg/monitor": "^2.1.222",
116
+ "@djangocfg/typescript-config": "^2.1.222",
117
+ "@djangocfg/ui-core": "^2.1.222",
118
+ "@djangocfg/ui-nextjs": "^2.1.222",
119
+ "@djangocfg/ui-tools": "^2.1.222",
120
120
  "@types/node": "^24.7.2",
121
121
  "@types/react": "^19.1.0",
122
122
  "@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
- /** Debug panel — set false to disable. Default: true */
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
- {debug !== false && <DebugButton />}
195
+ {/* Debug Panel — enabled by default, disable with debug={{ enabled: false }} */}
196
+ {debugEnabled && <DebugButton {...debugProps} />}
193
197
  </ErrorTrackingProvider>
194
198
  </PwaProvider>
195
199
  </CentrifugoProvider>
@@ -43,4 +43,4 @@ export type {
43
43
  // Layout Types
44
44
  // ============================================================================
45
45
 
46
- export type { BaseLayoutProps } from './layout.types';
46
+ export type { BaseLayoutProps, DebugConfig } from './layout.types';
@@ -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 set false to disable. Default: true */
66
- debug?: boolean;
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
  }