@djangocfg/layouts 2.1.217 → 2.1.219
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
|
@@ -49,6 +49,7 @@ export default function RootLayout({ children }) {
|
|
|
49
49
|
- **PwaProvider** - PWA installation (optional)
|
|
50
50
|
- **ErrorTrackingProvider** - Error handling and tracking
|
|
51
51
|
- **ErrorBoundary** - React error boundary
|
|
52
|
+
- **MonitorProvider** - Frontend error monitoring via `@djangocfg/monitor` (optional)
|
|
52
53
|
- **MCP Chat Widget** - AI chat assistant (optional)
|
|
53
54
|
|
|
54
55
|
**Global components:**
|
|
@@ -104,6 +105,22 @@ export default function RootLayout({ children }) {
|
|
|
104
105
|
}
|
|
105
106
|
```
|
|
106
107
|
|
|
108
|
+
**Monitor prop** — pass `monitor` to enable frontend error monitoring (installs `window.monitor` in DevTools):
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
<AppLayout
|
|
112
|
+
monitor={{
|
|
113
|
+
project: 'my-app',
|
|
114
|
+
environment: process.env.NODE_ENV,
|
|
115
|
+
}}
|
|
116
|
+
// ...
|
|
117
|
+
>
|
|
118
|
+
{children}
|
|
119
|
+
</AppLayout>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
After mount, `window.monitor.error(...)`, `.warn(...)`, `.flush()`, `.status()` are available in the browser console.
|
|
123
|
+
|
|
107
124
|
**Layout priority:** Admin → Private → Public → Fallback
|
|
108
125
|
|
|
109
126
|
**noLayoutPaths:** Paths that render without any layout wrapper. Useful for fullscreen pages (terminal, embed, print). Providers (auth, theme, centrifugo) are still applied.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.219",
|
|
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.
|
|
78
|
-
"@djangocfg/centrifugo": "^2.1.
|
|
79
|
-
"@djangocfg/i18n": "^2.1.
|
|
80
|
-
"@djangocfg/monitor": "^2.1.
|
|
81
|
-
"@djangocfg/ui-core": "^2.1.
|
|
82
|
-
"@djangocfg/ui-nextjs": "^2.1.
|
|
83
|
-
"@djangocfg/ui-tools": "^2.1.
|
|
77
|
+
"@djangocfg/api": "^2.1.219",
|
|
78
|
+
"@djangocfg/centrifugo": "^2.1.219",
|
|
79
|
+
"@djangocfg/i18n": "^2.1.219",
|
|
80
|
+
"@djangocfg/monitor": "^2.1.219",
|
|
81
|
+
"@djangocfg/ui-core": "^2.1.219",
|
|
82
|
+
"@djangocfg/ui-nextjs": "^2.1.219",
|
|
83
|
+
"@djangocfg/ui-tools": "^2.1.219",
|
|
84
84
|
"@hookform/resolvers": "^5.2.2",
|
|
85
85
|
"consola": "^3.4.2",
|
|
86
86
|
"lucide-react": "^0.545.0",
|
|
@@ -108,14 +108,14 @@
|
|
|
108
108
|
"uuid": "^11.1.0"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
|
-
"@djangocfg/api": "^2.1.
|
|
112
|
-
"@djangocfg/i18n": "^2.1.
|
|
113
|
-
"@djangocfg/centrifugo": "^2.1.
|
|
114
|
-
"@djangocfg/monitor": "^2.1.
|
|
115
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
116
|
-
"@djangocfg/ui-core": "^2.1.
|
|
117
|
-
"@djangocfg/ui-nextjs": "^2.1.
|
|
118
|
-
"@djangocfg/ui-tools": "^2.1.
|
|
111
|
+
"@djangocfg/api": "^2.1.219",
|
|
112
|
+
"@djangocfg/i18n": "^2.1.219",
|
|
113
|
+
"@djangocfg/centrifugo": "^2.1.219",
|
|
114
|
+
"@djangocfg/monitor": "^2.1.219",
|
|
115
|
+
"@djangocfg/typescript-config": "^2.1.219",
|
|
116
|
+
"@djangocfg/ui-core": "^2.1.219",
|
|
117
|
+
"@djangocfg/ui-nextjs": "^2.1.219",
|
|
118
|
+
"@djangocfg/ui-tools": "^2.1.219",
|
|
119
119
|
"@types/node": "^24.7.2",
|
|
120
120
|
"@types/react": "^19.1.0",
|
|
121
121
|
"@types/react-dom": "^19.1.0",
|
|
@@ -50,6 +50,7 @@ import type {
|
|
|
50
50
|
PwaInstallConfig,
|
|
51
51
|
} from '../types';
|
|
52
52
|
import type { AuthConfig } from '@djangocfg/api/auth';
|
|
53
|
+
import type { MonitorConfig } from '@djangocfg/monitor';
|
|
53
54
|
|
|
54
55
|
export type LayoutMode = 'public' | 'private' | 'admin';
|
|
55
56
|
|
|
@@ -135,6 +136,9 @@ export interface AppLayoutProps {
|
|
|
135
136
|
|
|
136
137
|
/** i18n configuration for locale switching (applies to all layouts) */
|
|
137
138
|
i18n?: I18nLayoutConfig;
|
|
139
|
+
|
|
140
|
+
/** Monitor configuration — initialises window.monitor + auto-captures JS errors & console */
|
|
141
|
+
monitor?: MonitorConfig;
|
|
138
142
|
}
|
|
139
143
|
|
|
140
144
|
/**
|
|
@@ -256,6 +260,7 @@ export function AppLayout(props: AppLayoutProps) {
|
|
|
256
260
|
swr,
|
|
257
261
|
mcpChat,
|
|
258
262
|
pwaInstall,
|
|
263
|
+
monitor,
|
|
259
264
|
} = props;
|
|
260
265
|
|
|
261
266
|
return (
|
|
@@ -269,6 +274,7 @@ export function AppLayout(props: AppLayoutProps) {
|
|
|
269
274
|
swr={swr}
|
|
270
275
|
mcpChat={mcpChat}
|
|
271
276
|
pwaInstall={pwaInstall}
|
|
277
|
+
monitor={monitor}
|
|
272
278
|
>
|
|
273
279
|
<AppLayoutContent {...props} />
|
|
274
280
|
</BaseApp>
|
|
@@ -42,6 +42,7 @@ import dynamic from 'next/dynamic';
|
|
|
42
42
|
import NextTopLoader from 'nextjs-toploader';
|
|
43
43
|
import { SWRConfig } from 'swr';
|
|
44
44
|
|
|
45
|
+
import { MonitorProvider } from '@djangocfg/monitor/client';
|
|
45
46
|
import { getCentrifugoAuthTokenRetrieve } from '@djangocfg/api';
|
|
46
47
|
import { AuthProvider } from '@djangocfg/api/auth';
|
|
47
48
|
import { CentrifugoProvider } from '@djangocfg/centrifugo';
|
|
@@ -84,6 +85,7 @@ export function BaseApp({
|
|
|
84
85
|
swr,
|
|
85
86
|
mcpChat,
|
|
86
87
|
pwaInstall,
|
|
88
|
+
monitor,
|
|
87
89
|
}: BaseAppProps) {
|
|
88
90
|
// ErrorBoundary is enabled by default
|
|
89
91
|
const enableErrorBoundary = errorBoundary?.enabled !== false;
|
|
@@ -128,6 +130,7 @@ export function BaseApp({
|
|
|
128
130
|
network={errorTracking?.network}
|
|
129
131
|
onError={errorTracking?.onError}
|
|
130
132
|
>
|
|
133
|
+
{monitor && <MonitorProvider {...monitor} />}
|
|
131
134
|
{children}
|
|
132
135
|
<NextTopLoader
|
|
133
136
|
color="hsl(var(--primary))"
|
|
@@ -14,6 +14,7 @@ import type { ErrorBoundaryConfig, ErrorTrackingConfig } from '../../components/
|
|
|
14
14
|
|
|
15
15
|
// Import local provider configs
|
|
16
16
|
import type { ThemeConfig, SWRConfigOptions, McpChatConfig, CentrifugoConfig } from './providers.types';
|
|
17
|
+
import type { MonitorConfig } from '@djangocfg/monitor';
|
|
17
18
|
|
|
18
19
|
// ============================================================================
|
|
19
20
|
// Base Layout Props
|
|
@@ -54,4 +55,7 @@ export interface BaseLayoutProps {
|
|
|
54
55
|
|
|
55
56
|
/** PWA Install configuration (from snippets/PWAInstall) */
|
|
56
57
|
pwaInstall?: PwaInstallConfig;
|
|
58
|
+
|
|
59
|
+
/** Monitor configuration — initialises window.monitor + auto-captures JS errors & console */
|
|
60
|
+
monitor?: MonitorConfig;
|
|
57
61
|
}
|