@djangocfg/layouts 2.1.366 → 2.1.368
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.
|
|
3
|
+
"version": "2.1.368",
|
|
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.368",
|
|
88
|
+
"@djangocfg/centrifugo": "^2.1.368",
|
|
89
|
+
"@djangocfg/debuger": "^2.1.368",
|
|
90
|
+
"@djangocfg/i18n": "^2.1.368",
|
|
91
|
+
"@djangocfg/monitor": "^2.1.368",
|
|
92
|
+
"@djangocfg/ui-core": "^2.1.368",
|
|
93
|
+
"@djangocfg/ui-nextjs": "^2.1.368",
|
|
94
94
|
"@hookform/resolvers": "^5.2.2",
|
|
95
95
|
"consola": "^3.4.2",
|
|
96
96
|
"lucide-react": "^0.545.0",
|
|
@@ -121,15 +121,15 @@
|
|
|
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.
|
|
124
|
+
"@djangocfg/api": "^2.1.368",
|
|
125
|
+
"@djangocfg/centrifugo": "^2.1.368",
|
|
126
|
+
"@djangocfg/debuger": "^2.1.368",
|
|
127
|
+
"@djangocfg/i18n": "^2.1.368",
|
|
128
|
+
"@djangocfg/monitor": "^2.1.368",
|
|
129
|
+
"@djangocfg/typescript-config": "^2.1.368",
|
|
130
|
+
"@djangocfg/ui-core": "^2.1.368",
|
|
131
|
+
"@djangocfg/ui-nextjs": "^2.1.368",
|
|
132
|
+
"@djangocfg/ui-tools": "^2.1.368",
|
|
133
133
|
"@types/node": "^24.7.2",
|
|
134
134
|
"@types/react": "^19.1.0",
|
|
135
135
|
"@types/react-dom": "^19.1.0",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
'use client';
|
|
38
38
|
|
|
39
39
|
import { nodeEnv } from "@djangocfg/ui-core/lib";
|
|
40
|
-
import dynamic from 'next/dynamic';
|
|
41
40
|
import NextTopLoader from 'nextjs-toploader';
|
|
42
41
|
import { SWRConfig } from 'swr';
|
|
43
42
|
|
|
@@ -61,10 +60,9 @@ import { A2HSHint, PWAPageResumeManager, PwaProvider } from '@djangocfg/ui-nextj
|
|
|
61
60
|
import type { BaseLayoutProps } from '../types/layout.types';
|
|
62
61
|
import { LayoutI18nProvider } from './LayoutI18nProvider';
|
|
63
62
|
|
|
64
|
-
|
|
65
|
-
const DebugButton =
|
|
66
|
-
|
|
67
|
-
{ ssr: false }
|
|
63
|
+
import React from 'react';
|
|
64
|
+
const DebugButton = React.lazy(() =>
|
|
65
|
+
import('@djangocfg/debuger').then((m) => ({ default: m.DebugButton }))
|
|
68
66
|
);
|
|
69
67
|
|
|
70
68
|
// For backwards compatibility, re-export as BaseAppProps
|
|
@@ -93,6 +91,10 @@ export function BaseApp({
|
|
|
93
91
|
debug,
|
|
94
92
|
i18n,
|
|
95
93
|
}: BaseAppProps) {
|
|
94
|
+
// auth=false disables AuthProvider entirely (public apps with no login)
|
|
95
|
+
const authEnabled = auth !== false;
|
|
96
|
+
const authConfig = auth === false ? undefined : auth;
|
|
97
|
+
|
|
96
98
|
// ErrorBoundary is enabled by default
|
|
97
99
|
const enableErrorBoundary = errorBoundary?.enabled !== false;
|
|
98
100
|
|
|
@@ -139,7 +141,7 @@ export function BaseApp({
|
|
|
139
141
|
dedupingInterval: swr?.dedupingInterval ?? 2000,
|
|
140
142
|
}}
|
|
141
143
|
>
|
|
142
|
-
<AuthProvider config={
|
|
144
|
+
<AuthProvider config={authEnabled ? authConfig : undefined} enabled={authEnabled}>
|
|
143
145
|
<AnalyticsProvider trackingId={analytics?.googleTrackingId}>
|
|
144
146
|
<CentrifugoProvider
|
|
145
147
|
enabled={centrifugoEnabled}
|
|
@@ -188,8 +190,8 @@ export function BaseApp({
|
|
|
188
190
|
<PWAPageResumeManager enabled={true} />
|
|
189
191
|
)}
|
|
190
192
|
|
|
191
|
-
{/* Auth Dialog -
|
|
192
|
-
<AuthDialog authPath={
|
|
193
|
+
{/* Auth Dialog - only when auth is enabled */}
|
|
194
|
+
{authEnabled && <AuthDialog authPath={authConfig?.routes?.auth} />}
|
|
193
195
|
|
|
194
196
|
{/* Debug Panel — auto in dev, ?debug=1 in prod, disable with debug={{ enabled: false }} */}
|
|
195
197
|
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
'use client';
|
|
10
10
|
|
|
11
11
|
import React, { ReactNode } from 'react';
|
|
12
|
-
import dynamic from 'next/dynamic';
|
|
13
12
|
|
|
14
13
|
import { Preloader } from '@djangocfg/ui-core/components';
|
|
15
14
|
import { SidebarInset, SidebarProvider } from '@djangocfg/ui-core/components';
|
|
@@ -43,10 +42,8 @@ export { SidebarBrandSwitcher } from './components';
|
|
|
43
42
|
|
|
44
43
|
export { PrivateLayoutProps };
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
() => import('../ProfileLayout/ProfileDialog/ProfileDialog').then((m) => m.ProfileDialog),
|
|
49
|
-
{ ssr: false },
|
|
45
|
+
const ProfileDialog = React.lazy(() =>
|
|
46
|
+
import('../ProfileLayout/ProfileDialog/ProfileDialog').then((m) => ({ default: m.ProfileDialog }))
|
|
50
47
|
);
|
|
51
48
|
|
|
52
49
|
export function PrivateLayout({
|
|
@@ -65,6 +65,8 @@ export interface UserMenuProps {
|
|
|
65
65
|
groups?: UserMenuGroup[];
|
|
66
66
|
/** Auth page path (for sign in button) */
|
|
67
67
|
authPath?: string;
|
|
68
|
+
/** Disable the sign-in button (guest state, auth not available) */
|
|
69
|
+
disableAuth?: boolean;
|
|
68
70
|
/**
|
|
69
71
|
* Language switching inside this menu (desktop: submenu; mobile: button row).
|
|
70
72
|
* Prefer this over nesting `<LocaleSwitcher />` in the same dropdown — nested menus close each other.
|
|
@@ -76,6 +78,7 @@ export function UserMenu({
|
|
|
76
78
|
variant = 'desktop',
|
|
77
79
|
groups,
|
|
78
80
|
authPath = '/auth',
|
|
81
|
+
disableAuth = false,
|
|
79
82
|
i18n,
|
|
80
83
|
}: UserMenuProps) {
|
|
81
84
|
const { user, isAuthenticated } = useAuth();
|
|
@@ -144,6 +147,13 @@ export function UserMenu({
|
|
|
144
147
|
</div>
|
|
145
148
|
);
|
|
146
149
|
}
|
|
150
|
+
if (disableAuth) {
|
|
151
|
+
return (
|
|
152
|
+
<Button variant="default" size="sm" className="rounded-full px-5" disabled>
|
|
153
|
+
{labels.signIn}
|
|
154
|
+
</Button>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
147
157
|
return (
|
|
148
158
|
<Link href={authPath}>
|
|
149
159
|
<Button variant="default" size="sm" className="rounded-full px-5">
|
|
@@ -44,8 +44,8 @@ export interface BaseLayoutProps {
|
|
|
44
44
|
/** Theme configuration */
|
|
45
45
|
theme?: ThemeConfig;
|
|
46
46
|
|
|
47
|
-
/** Auth configuration */
|
|
48
|
-
auth?: AuthConfig;
|
|
47
|
+
/** Auth configuration. Pass `false` to disable AuthProvider entirely (public apps). */
|
|
48
|
+
auth?: AuthConfig | false;
|
|
49
49
|
|
|
50
50
|
/** Analytics configuration (from snippets/Analytics) */
|
|
51
51
|
analytics?: AnalyticsConfig;
|