@djangocfg/layouts 2.1.39 → 2.1.40

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
@@ -102,6 +102,9 @@ export default function RootLayout({ children }) {
102
102
  component: AdminLayout,
103
103
  enabledPath: '/admin'
104
104
  }}
105
+
106
+ // Skip layout for fullscreen pages (providers still applied)
107
+ noLayoutPaths={['/private/terminal', '/embed']}
105
108
  >
106
109
  {children}
107
110
  </AppLayout>
@@ -113,6 +116,8 @@ export default function RootLayout({ children }) {
113
116
 
114
117
  **Layout priority:** Admin → Private → Public → Fallback
115
118
 
119
+ **noLayoutPaths:** Paths that render without any layout wrapper. Useful for fullscreen pages (terminal, embed, print). Providers (auth, theme, centrifugo) are still applied.
120
+
116
121
  ## Layouts
117
122
 
118
123
  Simple, props-based layout components. No complex configs needed!
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/layouts",
3
- "version": "2.1.39",
3
+ "version": "2.1.40",
4
4
  "description": "Simple, straightforward layout components for Next.js - import and use with props",
5
5
  "keywords": [
6
6
  "layouts",
@@ -92,9 +92,9 @@
92
92
  "check": "tsc --noEmit"
93
93
  },
94
94
  "peerDependencies": {
95
- "@djangocfg/api": "^2.1.39",
96
- "@djangocfg/centrifugo": "^2.1.39",
97
- "@djangocfg/ui-nextjs": "^2.1.39",
95
+ "@djangocfg/api": "^2.1.40",
96
+ "@djangocfg/centrifugo": "^2.1.40",
97
+ "@djangocfg/ui-nextjs": "^2.1.40",
98
98
  "@hookform/resolvers": "^5.2.0",
99
99
  "consola": "^3.4.2",
100
100
  "lucide-react": "^0.545.0",
@@ -114,7 +114,7 @@
114
114
  "uuid": "^11.1.0"
115
115
  },
116
116
  "devDependencies": {
117
- "@djangocfg/typescript-config": "^2.1.39",
117
+ "@djangocfg/typescript-config": "^2.1.40",
118
118
  "@types/node": "^24.7.2",
119
119
  "@types/react": "^19.1.0",
120
120
  "@types/react-dom": "^19.1.0",
@@ -1,33 +1,29 @@
1
1
  /**
2
2
  * AppLayout - Smart Layout Router with All Providers
3
- *
3
+ *
4
4
  * Automatically detects route type and applies the correct layout
5
5
  * Includes all necessary providers: Theme, Auth, Analytics, Centrifugo, Error Tracking
6
6
  * Simple props-based configuration - no complex configs needed!
7
- *
7
+ *
8
8
  * @example
9
9
  * ```tsx
10
10
  * import { AppLayout } from '@djangocfg/layouts';
11
- *
11
+ *
12
12
  * <AppLayout
13
13
  * publicLayout={{
14
- * logo: '/logo.svg',
15
- * siteName: 'My App',
16
- * navigation: [{ label: 'Home', href: '/' }]
14
+ * component: PublicLayout,
15
+ * enabledPath: ['/', '/about', '/contact']
17
16
  * }}
18
17
  * privateLayout={{
19
- * enabledPath: ['/dashboard', '/profile'],
20
- * sidebar: { items: [{ label: 'Dashboard', href: '/dashboard' }] }
21
- * }}
22
- * authLayout={{
23
- * enabledPath: '/auth',
24
- * logo: '/logo.svg',
25
- * siteName: 'My App'
18
+ * component: DashboardLayout,
19
+ * enabledPath: '/dashboard'
26
20
  * }}
27
21
  * adminLayout={{
28
- * enabledPath: '/admin',
29
- * sidebar: { items: [{ label: 'Admin', href: '/admin' }] }
22
+ * component: AdminLayout,
23
+ * enabledPath: '/admin'
30
24
  * }}
25
+ * // Paths that render without any layout wrapper (fullscreen pages)
26
+ * noLayoutPaths={['/private/terminal', '/embed']}
31
27
  * >
32
28
  * {children}
33
29
  * </AppLayout>
@@ -108,6 +104,13 @@ export interface AppLayoutProps {
108
104
  enabledPath?: string | string[];
109
105
  };
110
106
 
107
+ /**
108
+ * Paths that render without any layout wrapper (fullscreen pages)
109
+ * Providers (auth, theme, etc.) are still applied, only layout is skipped
110
+ * Useful for: fullscreen terminal, embed pages, print views
111
+ */
112
+ noLayoutPaths?: string | string[];
113
+
111
114
  /** Theme configuration */
112
115
  theme?: ThemeConfig;
113
116
 
@@ -150,11 +153,16 @@ function AppLayoutContent({
150
153
  publicLayout,
151
154
  privateLayout,
152
155
  adminLayout,
153
- analytics,
154
- centrifugo,
156
+ noLayoutPaths,
155
157
  }: AppLayoutProps) {
156
158
  const pathname = usePathname();
157
159
 
160
+ // Check if current path should skip layout
161
+ const shouldSkipLayout = useMemo(
162
+ () => matchesPath(pathname, noLayoutPaths),
163
+ [pathname, noLayoutPaths]
164
+ );
165
+
158
166
  const layoutMode = useMemo(
159
167
  () => determineLayoutMode(
160
168
  pathname,
@@ -167,6 +175,11 @@ function AppLayoutContent({
167
175
 
168
176
  // Render appropriate layout based on mode
169
177
  const renderLayout = () => {
178
+ // Skip layout for noLayoutPaths (fullscreen pages)
179
+ if (shouldSkipLayout) {
180
+ return children;
181
+ }
182
+
170
183
  switch (layoutMode) {
171
184
  case 'admin':
172
185
  if (!adminLayout && privateLayout) {