@djangocfg/layouts 2.1.233 → 2.1.235

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": "2.1.233",
3
+ "version": "2.1.235",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -74,14 +74,14 @@
74
74
  "check": "tsc --noEmit"
75
75
  },
76
76
  "peerDependencies": {
77
- "@djangocfg/api": "^2.1.233",
78
- "@djangocfg/centrifugo": "^2.1.233",
79
- "@djangocfg/i18n": "^2.1.233",
80
- "@djangocfg/monitor": "^2.1.233",
81
- "@djangocfg/debuger": "^2.1.233",
82
- "@djangocfg/ui-core": "^2.1.233",
83
- "@djangocfg/ui-nextjs": "^2.1.233",
84
- "@djangocfg/ui-tools": "^2.1.233",
77
+ "@djangocfg/api": "^2.1.235",
78
+ "@djangocfg/centrifugo": "^2.1.235",
79
+ "@djangocfg/i18n": "^2.1.235",
80
+ "@djangocfg/monitor": "^2.1.235",
81
+ "@djangocfg/debuger": "^2.1.235",
82
+ "@djangocfg/ui-core": "^2.1.235",
83
+ "@djangocfg/ui-nextjs": "^2.1.235",
84
+ "@djangocfg/ui-tools": "^2.1.235",
85
85
  "@hookform/resolvers": "^5.2.2",
86
86
  "consola": "^3.4.2",
87
87
  "lucide-react": "^0.545.0",
@@ -109,15 +109,15 @@
109
109
  "uuid": "^11.1.0"
110
110
  },
111
111
  "devDependencies": {
112
- "@djangocfg/api": "^2.1.233",
113
- "@djangocfg/i18n": "^2.1.233",
114
- "@djangocfg/centrifugo": "^2.1.233",
115
- "@djangocfg/monitor": "^2.1.233",
116
- "@djangocfg/debuger": "^2.1.233",
117
- "@djangocfg/typescript-config": "^2.1.233",
118
- "@djangocfg/ui-core": "^2.1.233",
119
- "@djangocfg/ui-nextjs": "^2.1.233",
120
- "@djangocfg/ui-tools": "^2.1.233",
112
+ "@djangocfg/api": "^2.1.235",
113
+ "@djangocfg/i18n": "^2.1.235",
114
+ "@djangocfg/centrifugo": "^2.1.235",
115
+ "@djangocfg/monitor": "^2.1.235",
116
+ "@djangocfg/debuger": "^2.1.235",
117
+ "@djangocfg/typescript-config": "^2.1.235",
118
+ "@djangocfg/ui-core": "^2.1.235",
119
+ "@djangocfg/ui-nextjs": "^2.1.235",
120
+ "@djangocfg/ui-tools": "^2.1.235",
121
121
  "@types/node": "^24.7.2",
122
122
  "@types/react": "^19.1.0",
123
123
  "@types/react-dom": "^19.1.0",
@@ -6,6 +6,7 @@
6
6
 
7
7
  'use client';
8
8
 
9
+ import { isDev } from "@djangocfg/ui-core/lib";
9
10
  import React, { Component, ErrorInfo, ReactNode } from 'react';
10
11
 
11
12
  import { getT } from '@djangocfg/i18n';
@@ -38,7 +39,7 @@ export class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundarySt
38
39
  }
39
40
 
40
41
  // Log to console in development
41
- if (process.env.NODE_ENV === 'development') {
42
+ if (isDev) {
42
43
  console.error('ErrorBoundary caught an error:', error, errorInfo);
43
44
  }
44
45
  }
@@ -36,6 +36,7 @@
36
36
 
37
37
  'use client';
38
38
 
39
+ import { nodeEnv } from "@djangocfg/ui-core/lib";
39
40
  import dynamic from 'next/dynamic';
40
41
  import NextTopLoader from 'nextjs-toploader';
41
42
  import { SWRConfig } from 'swr';
@@ -98,14 +99,14 @@ export function BaseApp({
98
99
  const centrifugoUrl = centrifugo?.url || process.env.NEXT_PUBLIC_CENTRIFUGO_URL;
99
100
  const centrifugoEnabled = centrifugo?.enabled !== false;
100
101
 
101
- // Debug panel — enabled by default, disabled with { enabled: false }
102
- const { enabled: debugEnabled = true, ...debugProps } = debug ?? {};
102
+ // Debug panel — always mounted, DebugButton handles visibility itself
103
+ const { enabled: debugEnabled, ...debugProps } = debug ?? {};
103
104
 
104
105
 
105
106
  // Monitor — project prop as default, override with monitor config
106
107
  const monitorConfig = {
107
108
  project,
108
- environment: process.env.NODE_ENV,
109
+ environment: nodeEnv,
109
110
  ...monitor,
110
111
  };
111
112
 
@@ -169,8 +170,8 @@ export function BaseApp({
169
170
  {/* Auth Dialog - global auth prompt */}
170
171
  <AuthDialog authPath={auth?.routes?.auth} />
171
172
 
172
- {/* Debug Panel — enabled by default, disable with debug={{ enabled: false }} */}
173
- {debugEnabled && <DebugButton {...debugProps} />}
173
+ {/* Debug Panel — auto in dev, ?debug=1 in prod, disable with debug={{ enabled: false }} */}
174
+ <DebugButton enabled={debugEnabled} {...debugProps} />
174
175
  </ErrorTrackingProvider>
175
176
  </PwaProvider>
176
177
  </CentrifugoProvider>
@@ -64,9 +64,9 @@ export interface BaseLayoutProps {
64
64
  debug?: DebugConfig;
65
65
  }
66
66
 
67
- /** Debug panel config — enabled by default, pass enabled: false to disable */
67
+ /** Debug panel config — enabled in development by default, pass enabled: true/false to override */
68
68
  export interface DebugConfig extends DebugButtonProps {
69
- /** Set false to disable the debug panel. Default: true */
69
+ /** Set false to disable, true to force-enable. Default: process.env.NODE_ENV === 'development' */
70
70
  enabled?: boolean;
71
71
  }
72
72
 
@@ -15,7 +15,7 @@ import ReactGA from 'react-ga4';
15
15
  import { useAuth } from '@djangocfg/api/auth';
16
16
 
17
17
  // Check if we're in production
18
- const isProduction = process.env.NODE_ENV === 'production';
18
+ import { isProd as isProduction } from '@djangocfg/ui-core/lib';
19
19
 
20
20
  // Tracking state
21
21
  let isInitialized = false;
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * Frontend configuration from environment variables
3
3
  */
4
+ import { isDev } from '@djangocfg/ui-core/lib';
5
+
4
6
  export const config = {
5
7
  /**
6
8
  * Development mode flag
7
9
  * In development mode, any OTP code is accepted for authentication
8
10
  */
9
- isDevelopment: process.env.NODE_ENV === 'development',
11
+ isDevelopment: isDev,
10
12
  } as const;
@@ -12,7 +12,7 @@ import { createConsola } from 'consola';
12
12
  * - 4: debug
13
13
  * - 5: trace, verbose
14
14
  */
15
- const isDevelopment = process.env.NODE_ENV === 'development';
15
+ import { isDev as isDevelopment } from '@djangocfg/ui-core/lib';
16
16
  const isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === 'true';
17
17
  const showLogs = isDevelopment || isStaticBuild;
18
18