@djangocfg/layouts 1.4.27 → 1.4.28
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 +5 -5
- package/src/auth/middlewares/index.ts +1 -1
- package/src/auth/middlewares/proxy.ts +10 -2
- package/src/layouts/index.ts +0 -3
- package/src/snippets/ContactForm/ContactPage.tsx +16 -3
- package/src/layouts/UILayout/README.md +0 -267
- package/src/layouts/UILayout/SUMMARY.md +0 -298
- package/src/layouts/UILayout/TOOLS_INTEGRATION.md +0 -216
- package/src/layouts/UILayout/components/AutoComponentDemo.tsx +0 -77
- package/src/layouts/UILayout/components/CategoryRenderer.tsx +0 -45
- package/src/layouts/UILayout/components/TailwindGuideRenderer.tsx +0 -138
- package/src/layouts/UILayout/components/index.ts +0 -15
- package/src/layouts/UILayout/components/layout/Header/CopyAIButton.tsx +0 -58
- package/src/layouts/UILayout/components/layout/Header/Header.tsx +0 -60
- package/src/layouts/UILayout/components/layout/Header/HeaderDesktop.tsx +0 -51
- package/src/layouts/UILayout/components/layout/Header/HeaderMobile.tsx +0 -71
- package/src/layouts/UILayout/components/layout/Header/TestValidationButton.tsx +0 -268
- package/src/layouts/UILayout/components/layout/Header/index.ts +0 -11
- package/src/layouts/UILayout/components/layout/MobileOverlay/MobileOverlay.tsx +0 -47
- package/src/layouts/UILayout/components/layout/MobileOverlay/index.ts +0 -6
- package/src/layouts/UILayout/components/layout/Sidebar/Sidebar.tsx +0 -95
- package/src/layouts/UILayout/components/layout/Sidebar/SidebarCategory.tsx +0 -54
- package/src/layouts/UILayout/components/layout/Sidebar/SidebarContent.tsx +0 -93
- package/src/layouts/UILayout/components/layout/Sidebar/SidebarFooter.tsx +0 -49
- package/src/layouts/UILayout/components/layout/Sidebar/index.ts +0 -9
- package/src/layouts/UILayout/components/layout/index.ts +0 -8
- package/src/layouts/UILayout/components/shared/Badge/CountBadge.tsx +0 -38
- package/src/layouts/UILayout/components/shared/Badge/index.ts +0 -5
- package/src/layouts/UILayout/components/shared/CodeBlock/CodeBlock.tsx +0 -48
- package/src/layouts/UILayout/components/shared/CodeBlock/CopyButton.tsx +0 -49
- package/src/layouts/UILayout/components/shared/CodeBlock/index.ts +0 -6
- package/src/layouts/UILayout/components/shared/Section/Section.tsx +0 -63
- package/src/layouts/UILayout/components/shared/Section/index.ts +0 -5
- package/src/layouts/UILayout/components/shared/index.ts +0 -8
- package/src/layouts/UILayout/config/ai-export.config.ts +0 -89
- package/src/layouts/UILayout/config/categories.config.tsx +0 -122
- package/src/layouts/UILayout/config/components/blocks.config.tsx +0 -239
- package/src/layouts/UILayout/config/components/data.config.tsx +0 -433
- package/src/layouts/UILayout/config/components/feedback.config.tsx +0 -290
- package/src/layouts/UILayout/config/components/forms.config.tsx +0 -996
- package/src/layouts/UILayout/config/components/hooks.config.tsx +0 -168
- package/src/layouts/UILayout/config/components/index.ts +0 -72
- package/src/layouts/UILayout/config/components/layout.config.tsx +0 -246
- package/src/layouts/UILayout/config/components/navigation.config.tsx +0 -352
- package/src/layouts/UILayout/config/components/overlay.config.tsx +0 -569
- package/src/layouts/UILayout/config/components/specialized.config.tsx +0 -400
- package/src/layouts/UILayout/config/components/tools.config.tsx +0 -234
- package/src/layouts/UILayout/config/components/types.ts +0 -14
- package/src/layouts/UILayout/config/index.ts +0 -42
- package/src/layouts/UILayout/config/tailwind.config.ts +0 -131
- package/src/layouts/UILayout/constants.ts +0 -23
- package/src/layouts/UILayout/context/ShowcaseContext.tsx +0 -81
- package/src/layouts/UILayout/context/index.ts +0 -1
- package/src/layouts/UILayout/core/UIGuideApp.client.tsx +0 -18
- package/src/layouts/UILayout/core/UIGuideApp.tsx +0 -33
- package/src/layouts/UILayout/core/UIGuideLanding.tsx +0 -172
- package/src/layouts/UILayout/core/UIGuideView.tsx +0 -61
- package/src/layouts/UILayout/core/UILayout.tsx +0 -125
- package/src/layouts/UILayout/core/UILayoutSidebar.tsx +0 -11
- package/src/layouts/UILayout/core/index.ts +0 -10
- package/src/layouts/UILayout/hooks/index.ts +0 -9
- package/src/layouts/UILayout/hooks/useAIExport.ts +0 -78
- package/src/layouts/UILayout/hooks/useCategoryNavigation.ts +0 -92
- package/src/layouts/UILayout/hooks/useComponentSearch.ts +0 -81
- package/src/layouts/UILayout/hooks/useSidebarState.ts +0 -36
- package/src/layouts/UILayout/index.ts +0 -160
- package/src/layouts/UILayout/types/component.ts +0 -45
- package/src/layouts/UILayout/types/index.ts +0 -23
- package/src/layouts/UILayout/types/layout.ts +0 -57
- package/src/layouts/UILayout/types/navigation.ts +0 -33
- package/src/layouts/UILayout/utils/ai-export/formatters.ts +0 -71
- package/src/layouts/UILayout/utils/ai-export/index.ts +0 -5
- package/src/layouts/UILayout/utils/component-helpers/filter.ts +0 -109
- package/src/layouts/UILayout/utils/component-helpers/index.ts +0 -6
- package/src/layouts/UILayout/utils/component-helpers/search.ts +0 -95
- package/src/layouts/UILayout/utils/index.ts +0 -6
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component Filter Utilities
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { ComponentConfig } from '../../types';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Filter options
|
|
9
|
-
*/
|
|
10
|
-
export interface FilterOptions {
|
|
11
|
-
/** Category to filter by */
|
|
12
|
-
category?: string;
|
|
13
|
-
/** Tags to filter by (OR logic) */
|
|
14
|
-
tags?: string[];
|
|
15
|
-
/** Search query */
|
|
16
|
-
query?: string;
|
|
17
|
-
/** Search fields */
|
|
18
|
-
searchFields?: Array<keyof ComponentConfig>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Apply multiple filters to components
|
|
23
|
-
*/
|
|
24
|
-
export function applyFilters(
|
|
25
|
-
components: ComponentConfig[],
|
|
26
|
-
options: FilterOptions
|
|
27
|
-
): ComponentConfig[] {
|
|
28
|
-
let filtered = components;
|
|
29
|
-
|
|
30
|
-
// Filter by category
|
|
31
|
-
if (options.category) {
|
|
32
|
-
filtered = filtered.filter((comp) => comp.category === options.category);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// Filter by tags
|
|
36
|
-
if (options.tags && options.tags.length > 0) {
|
|
37
|
-
filtered = filtered.filter((comp) => {
|
|
38
|
-
if (!comp.tags) return false;
|
|
39
|
-
return options.tags!.some((tag) => comp.tags?.includes(tag));
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Filter by search query
|
|
44
|
-
if (options.query && options.query.trim()) {
|
|
45
|
-
const lowerQuery = options.query.toLowerCase();
|
|
46
|
-
const searchFields = options.searchFields || [
|
|
47
|
-
'name',
|
|
48
|
-
'description',
|
|
49
|
-
'category',
|
|
50
|
-
];
|
|
51
|
-
|
|
52
|
-
filtered = filtered.filter((comp) => {
|
|
53
|
-
return searchFields.some((field) => {
|
|
54
|
-
const value = comp[field];
|
|
55
|
-
if (typeof value === 'string') {
|
|
56
|
-
return value.toLowerCase().includes(lowerQuery);
|
|
57
|
-
}
|
|
58
|
-
if (Array.isArray(value)) {
|
|
59
|
-
return value.some((item) =>
|
|
60
|
-
String(item).toLowerCase().includes(lowerQuery)
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
return false;
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
return filtered;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Sort components by field
|
|
73
|
-
*/
|
|
74
|
-
export function sortComponents(
|
|
75
|
-
components: ComponentConfig[],
|
|
76
|
-
field: keyof ComponentConfig,
|
|
77
|
-
order: 'asc' | 'desc' = 'asc'
|
|
78
|
-
): ComponentConfig[] {
|
|
79
|
-
return [...components].sort((a, b) => {
|
|
80
|
-
const aVal = String(a[field]);
|
|
81
|
-
const bVal = String(b[field]);
|
|
82
|
-
|
|
83
|
-
if (order === 'asc') {
|
|
84
|
-
return aVal.localeCompare(bVal);
|
|
85
|
-
} else {
|
|
86
|
-
return bVal.localeCompare(aVal);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Group components by field
|
|
93
|
-
*/
|
|
94
|
-
export function groupComponentsBy<K extends keyof ComponentConfig>(
|
|
95
|
-
components: ComponentConfig[],
|
|
96
|
-
field: K
|
|
97
|
-
): Record<string, ComponentConfig[]> {
|
|
98
|
-
return components.reduce(
|
|
99
|
-
(acc, comp) => {
|
|
100
|
-
const key = String(comp[field]);
|
|
101
|
-
if (!acc[key]) {
|
|
102
|
-
acc[key] = [];
|
|
103
|
-
}
|
|
104
|
-
acc[key].push(comp);
|
|
105
|
-
return acc;
|
|
106
|
-
},
|
|
107
|
-
{} as Record<string, ComponentConfig[]>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Component Search Utilities
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import type { ComponentConfig } from '../../types';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Search components by query
|
|
9
|
-
*/
|
|
10
|
-
export function searchComponents(
|
|
11
|
-
components: ComponentConfig[],
|
|
12
|
-
query: string,
|
|
13
|
-
fields: Array<keyof ComponentConfig> = ['name', 'description', 'category']
|
|
14
|
-
): ComponentConfig[] {
|
|
15
|
-
if (!query.trim()) {
|
|
16
|
-
return components;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const lowerQuery = query.toLowerCase();
|
|
20
|
-
|
|
21
|
-
return components.filter((component) => {
|
|
22
|
-
return fields.some((field) => {
|
|
23
|
-
const value = component[field];
|
|
24
|
-
if (typeof value === 'string') {
|
|
25
|
-
return value.toLowerCase().includes(lowerQuery);
|
|
26
|
-
}
|
|
27
|
-
if (Array.isArray(value)) {
|
|
28
|
-
return value.some((item) =>
|
|
29
|
-
String(item).toLowerCase().includes(lowerQuery)
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
return false;
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Filter components by category
|
|
39
|
-
*/
|
|
40
|
-
export function filterByCategory(
|
|
41
|
-
components: ComponentConfig[],
|
|
42
|
-
category: string
|
|
43
|
-
): ComponentConfig[] {
|
|
44
|
-
return components.filter((comp) => comp.category === category);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Filter components by tags
|
|
49
|
-
*/
|
|
50
|
-
export function filterByTags(
|
|
51
|
-
components: ComponentConfig[],
|
|
52
|
-
tags: string[]
|
|
53
|
-
): ComponentConfig[] {
|
|
54
|
-
if (tags.length === 0) {
|
|
55
|
-
return components;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return components.filter((comp) => {
|
|
59
|
-
if (!comp.tags) return false;
|
|
60
|
-
return tags.some((tag) => comp.tags?.includes(tag));
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Get unique categories from components
|
|
66
|
-
*/
|
|
67
|
-
export function getUniqueCategories(
|
|
68
|
-
components: ComponentConfig[]
|
|
69
|
-
): string[] {
|
|
70
|
-
const categories = new Set(components.map((c) => c.category));
|
|
71
|
-
return Array.from(categories).sort();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Get unique tags from components
|
|
76
|
-
*/
|
|
77
|
-
export function getUniqueTags(components: ComponentConfig[]): string[] {
|
|
78
|
-
const tags = new Set<string>();
|
|
79
|
-
components.forEach((comp) => {
|
|
80
|
-
comp.tags?.forEach((tag) => tags.add(tag));
|
|
81
|
-
});
|
|
82
|
-
return Array.from(tags).sort();
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Find component by name
|
|
87
|
-
*/
|
|
88
|
-
export function findComponentByName(
|
|
89
|
-
components: ComponentConfig[],
|
|
90
|
-
name: string
|
|
91
|
-
): ComponentConfig | undefined {
|
|
92
|
-
return components.find(
|
|
93
|
-
(comp) => comp.name.toLowerCase() === name.toLowerCase()
|
|
94
|
-
);
|
|
95
|
-
}
|