@djangocfg/layouts 1.2.55 → 1.2.57

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": "1.2.55",
3
+ "version": "1.2.57",
4
4
  "description": "Layout system and components for Unrealon applications",
5
5
  "author": {
6
6
  "name": "DjangoCFG",
@@ -63,9 +63,9 @@
63
63
  "check": "tsc --noEmit"
64
64
  },
65
65
  "peerDependencies": {
66
- "@djangocfg/api": "^1.2.55",
67
- "@djangocfg/og-image": "^1.2.55",
68
- "@djangocfg/ui": "^1.2.55",
66
+ "@djangocfg/api": "^1.2.57",
67
+ "@djangocfg/og-image": "^1.2.57",
68
+ "@djangocfg/ui": "^1.2.57",
69
69
  "@hookform/resolvers": "^5.2.0",
70
70
  "consola": "^3.4.2",
71
71
  "lucide-react": "^0.468.0",
@@ -86,7 +86,7 @@
86
86
  "vidstack": "0.6.15"
87
87
  },
88
88
  "devDependencies": {
89
- "@djangocfg/typescript-config": "^1.2.55",
89
+ "@djangocfg/typescript-config": "^1.2.57",
90
90
  "@types/node": "^24.7.2",
91
91
  "@types/react": "19.2.2",
92
92
  "@types/react-dom": "19.2.1",
@@ -38,6 +38,8 @@ import { determineLayoutMode, getRedirectUrl } from './utils';
38
38
  import { useAuth } from '../../auth';
39
39
  import type { AppLayoutConfig } from './types';
40
40
  import type { ValidationErrorConfig, CORSErrorConfig, NetworkErrorConfig } from '../../validation';
41
+ import type { PageWithConfig } from '../../types/pageConfig';
42
+ import { determinePageConfig } from '../../types/pageConfig';
41
43
 
42
44
  // Dynamic import for AdminLayout to prevent SSR hydration issues
43
45
  const AdminLayout = dynamic(
@@ -48,6 +50,16 @@ const AdminLayout = dynamic(
48
50
  export interface AppLayoutProps {
49
51
  children: ReactNode;
50
52
  config: AppLayoutConfig;
53
+ /**
54
+ * Next.js page component (for reading pageConfig)
55
+ * @example component={Component}
56
+ */
57
+ component?: PageWithConfig;
58
+ /**
59
+ * Next.js page props (for reading dynamic pageConfig from SSR)
60
+ * @example pageProps={pageProps}
61
+ */
62
+ pageProps?: Record<string, any>;
51
63
  /**
52
64
  * Disable layout rendering (Navigation, Sidebar, Footer)
53
65
  * Only providers and SEO remain active
@@ -264,7 +276,7 @@ function LayoutRouter({
264
276
  * </AppLayout>
265
277
  * ```
266
278
  */
267
- export function AppLayout({ children, config, disableLayout = false, forceLayout, fontFamily, showPackageVersions, validation, cors, network }: AppLayoutProps) {
279
+ export function AppLayout({ children, config, component, pageProps, disableLayout = false, forceLayout, fontFamily, showPackageVersions, validation, cors, network }: AppLayoutProps) {
268
280
  const router = useRouter();
269
281
 
270
282
  // Check if ErrorBoundary is enabled (default: true)
@@ -272,18 +284,28 @@ export function AppLayout({ children, config, disableLayout = false, forceLayout
272
284
  const supportEmail = config.errors?.supportEmail;
273
285
  const onError = config.errors?.onError;
274
286
 
287
+ // Determine final pageConfig (merges static + dynamic from SSR)
288
+ const finalPageConfig = component && pageProps
289
+ ? determinePageConfig(
290
+ component,
291
+ pageProps,
292
+ config.app.name,
293
+ config.app.description
294
+ )
295
+ : {
296
+ title: config.app.name,
297
+ description: config.app.description,
298
+ ogImage: {
299
+ title: config.app.name,
300
+ subtitle: config.app.description,
301
+ },
302
+ };
303
+
275
304
  const appContent = (
276
305
  <AppContextProvider config={config} showPackageVersions={showPackageVersions}>
277
306
  {/* SEO Meta Tags */}
278
307
  <Seo
279
- pageConfig={{
280
- title: config.app.name,
281
- description: config.app.description,
282
- ogImage: {
283
- title: config.app.name,
284
- subtitle: config.app.description,
285
- },
286
- }}
308
+ pageConfig={finalPageConfig}
287
309
  icons={config.app.icons}
288
310
  siteUrl={config.app.siteUrl}
289
311
  />
@@ -16,36 +16,36 @@ export interface PackageInfo {
16
16
  /**
17
17
  * Package versions registry
18
18
  * Auto-synced from package.json files
19
- * Last updated: 2025-11-22T08:28:22.393Z
19
+ * Last updated: 2025-11-23T06:13:14.600Z
20
20
  */
21
21
  const PACKAGE_VERSIONS: PackageInfo[] = [
22
22
  {
23
23
  "name": "@djangocfg/ui",
24
- "version": "1.2.55"
24
+ "version": "1.2.57"
25
25
  },
26
26
  {
27
27
  "name": "@djangocfg/api",
28
- "version": "1.2.55"
28
+ "version": "1.2.57"
29
29
  },
30
30
  {
31
31
  "name": "@djangocfg/layouts",
32
- "version": "1.2.55"
32
+ "version": "1.2.57"
33
33
  },
34
34
  {
35
35
  "name": "@djangocfg/markdown",
36
- "version": "1.2.55"
36
+ "version": "1.2.57"
37
37
  },
38
38
  {
39
39
  "name": "@djangocfg/og-image",
40
- "version": "1.2.55"
40
+ "version": "1.2.57"
41
41
  },
42
42
  {
43
43
  "name": "@djangocfg/eslint-config",
44
- "version": "1.2.55"
44
+ "version": "1.2.57"
45
45
  },
46
46
  {
47
47
  "name": "@djangocfg/typescript-config",
48
- "version": "1.2.55"
48
+ "version": "1.2.57"
49
49
  }
50
50
  ];
51
51
 
@@ -30,6 +30,17 @@ export function generateAIContext(): string {
30
30
  let output = `# ${projectName} v${version}\n\n`;
31
31
  output += `${description}\n\n`;
32
32
 
33
+ // Quick Reference - Available Components
34
+ output += `## 📋 Quick Reference - Available Components\n\n`;
35
+ const categories = getAllCategories();
36
+ categories.forEach(category => {
37
+ const comps = COMPONENTS_CONFIG.filter(comp => comp.category === category);
38
+ const componentNames = comps.map(c => c.name).join(', ');
39
+ output += `### ${category.charAt(0).toUpperCase() + category.slice(1)} (${comps.length})\n`;
40
+ output += `${componentNames}\n\n`;
41
+ });
42
+ output += `---\n\n`;
43
+
33
44
  // Tailwind 4 Guide
34
45
  output += `## Tailwind CSS v${TAILWIND_GUIDE.version} Guidelines\n\n`;
35
46
 
@@ -59,8 +70,6 @@ export function generateAIContext(): string {
59
70
  });
60
71
 
61
72
  // Components by Category
62
- const categories = getAllCategories();
63
-
64
73
  categories.forEach(category => {
65
74
  const comps = COMPONENTS_CONFIG.filter(comp => comp.category === category);
66
75
 
@@ -125,10 +125,6 @@ export type {
125
125
 
126
126
  export {
127
127
  // AI Export utilities
128
- generateAIContext as generateAIContextNew,
129
- generateTailwindSection,
130
- generateComponentsSection,
131
- generateComponentDoc,
132
128
  formatComponentAsMarkdown,
133
129
  formatComponentsAsMarkdownList,
134
130
  formatImports,
@@ -2,5 +2,4 @@
2
2
  * AI Export Utilities
3
3
  */
4
4
 
5
- export * from './generators';
6
5
  export * from './formatters';
@@ -1,155 +0,0 @@
1
- /**
2
- * AI Export Generators
3
- * Functions for generating AI-friendly documentation
4
- */
5
-
6
- import type { ComponentConfig } from '../../types';
7
- import type { TailwindGuide } from '../../config/tailwind.config';
8
-
9
- export interface UILibraryConfig {
10
- projectName: string;
11
- version: string;
12
- description: string;
13
- totalComponents: number;
14
- }
15
-
16
- /**
17
- * Generate complete AI context from components and config
18
- */
19
- export function generateAIContext(
20
- components: ComponentConfig[],
21
- tailwindGuide: TailwindGuide,
22
- config: UILibraryConfig
23
- ): string {
24
- const { projectName, version, description } = config;
25
-
26
- let output = `# ${projectName} v${version}\n\n`;
27
- output += `${description}\n\n`;
28
-
29
- // Quick Reference Section - ADDED FOR AI
30
- output += generateQuickReference(components);
31
-
32
- // Tailwind Guide Section
33
- output += generateTailwindSection(tailwindGuide);
34
-
35
- // Components by Category
36
- output += generateComponentsSection(components);
37
-
38
- return output;
39
- }
40
-
41
- /**
42
- * Generate Quick Reference section with all component names
43
- * This helps AI understand what's available without reading the entire document
44
- */
45
- export function generateQuickReference(components: ComponentConfig[]): string {
46
- let output = `## 📋 Quick Reference - Available Components\n\n`;
47
-
48
- // Group components by category
49
- const byCategory = groupByCategory(components);
50
-
51
- // Generate compact list for each category
52
- Object.entries(byCategory).forEach(([category, comps]) => {
53
- const componentNames = comps.map((c) => c.name).join(', ');
54
- output += `### ${formatCategoryName(category)} (${comps.length})\n`;
55
- output += `${componentNames}\n\n`;
56
- });
57
-
58
- output += `---\n\n`;
59
-
60
- return output;
61
- }
62
-
63
- /**
64
- * Generate Tailwind CSS section
65
- */
66
- export function generateTailwindSection(guide: TailwindGuide): string {
67
- let output = `## Tailwind CSS v${guide.version} Guidelines\n\n`;
68
-
69
- output += `### Key Changes\n`;
70
- guide.keyChanges.forEach((change) => {
71
- output += `- ${change}\n`;
72
- });
73
- output += `\n`;
74
-
75
- output += `### Best Practices\n`;
76
- guide.bestPractices.forEach((practice) => {
77
- output += `- ${practice}\n`;
78
- });
79
- output += `\n`;
80
-
81
- output += `### Migration Steps\n`;
82
- guide.migrationSteps.forEach((step, index) => {
83
- output += `${index + 1}. ${step}\n`;
84
- });
85
- output += `\n`;
86
-
87
- output += `### Examples\n\n`;
88
- guide.examples.forEach((example) => {
89
- output += `#### ${example.title}\n`;
90
- output += `${example.description}\n\n`;
91
- output += `\`\`\`css\n${example.code}\n\`\`\`\n\n`;
92
- });
93
-
94
- return output;
95
- }
96
-
97
- /**
98
- * Generate components section grouped by category
99
- */
100
- export function generateComponentsSection(components: ComponentConfig[]): string {
101
- let output = '';
102
-
103
- // Group components by category
104
- const byCategory = groupByCategory(components);
105
-
106
- // Generate section for each category
107
- Object.entries(byCategory).forEach(([category, comps]) => {
108
- output += `## ${formatCategoryName(category)} (${comps.length})\n\n`;
109
-
110
- comps.forEach((comp) => {
111
- output += generateComponentDoc(comp);
112
- });
113
- });
114
-
115
- return output;
116
- }
117
-
118
- /**
119
- * Generate documentation for a single component
120
- */
121
- export function generateComponentDoc(component: ComponentConfig): string {
122
- let output = `### ${component.name}\n`;
123
- output += `${component.description}\n\n`;
124
- output += `\`\`\`tsx\n`;
125
- output += `${component.importPath}\n\n`;
126
- output += `${component.example}\n`;
127
- output += `\`\`\`\n\n`;
128
-
129
- return output;
130
- }
131
-
132
- /**
133
- * Group components by category
134
- */
135
- function groupByCategory(
136
- components: ComponentConfig[]
137
- ): Record<string, ComponentConfig[]> {
138
- return components.reduce(
139
- (acc, comp) => {
140
- if (!acc[comp.category]) {
141
- acc[comp.category] = [];
142
- }
143
- acc[comp.category].push(comp);
144
- return acc;
145
- },
146
- {} as Record<string, ComponentConfig[]>
147
- );
148
- }
149
-
150
- /**
151
- * Format category name for display
152
- */
153
- function formatCategoryName(category: string): string {
154
- return category.charAt(0).toUpperCase() + category.slice(1);
155
- }