@classic-homes/theme-mcp 0.1.10 → 0.1.12
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/dist/cli.js +48 -7
- package/dist/cli.js.map +1 -1
- package/dist/index.js +48 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10828,7 +10828,7 @@ var pattern_library_default = {
|
|
|
10828
10828
|
{
|
|
10829
10829
|
id: "dashboard-page",
|
|
10830
10830
|
name: "Dashboard Page",
|
|
10831
|
-
description: "Full dashboard layout with sidebar navigation",
|
|
10831
|
+
description: "Full dashboard layout with sidebar navigation, role-based section expansion, and user-driven pinning",
|
|
10832
10832
|
useCase: "Authenticated dashboard pages",
|
|
10833
10833
|
components: [
|
|
10834
10834
|
"DashboardLayout",
|
|
@@ -10838,7 +10838,10 @@ var pattern_library_default = {
|
|
|
10838
10838
|
props: {
|
|
10839
10839
|
navigation: "NavSection[]",
|
|
10840
10840
|
user: "User",
|
|
10841
|
-
sidebarVariant: "'light' | 'dark'"
|
|
10841
|
+
sidebarVariant: "'light' | 'dark'",
|
|
10842
|
+
enablePinning: "boolean",
|
|
10843
|
+
initialPinnedItems: "string[]",
|
|
10844
|
+
onPinnedChange: "(pinnedIds: string[]) => void"
|
|
10842
10845
|
},
|
|
10843
10846
|
example: `<script lang="ts">
|
|
10844
10847
|
import { DashboardLayout } from '@classic-homes/theme-svelte';
|
|
@@ -10848,8 +10851,18 @@ var pattern_library_default = {
|
|
|
10848
10851
|
{
|
|
10849
10852
|
id: 'main',
|
|
10850
10853
|
items: [
|
|
10851
|
-
{ id: 'dashboard', name: 'Dashboard', href: '/dashboard', icon: 'home' },
|
|
10852
|
-
{ id: 'settings', name: 'Settings', href: '/settings', icon: 'settings' },
|
|
10854
|
+
{ id: 'dashboard', name: 'Dashboard', href: '/dashboard', icon: 'home', pinnable: true },
|
|
10855
|
+
{ id: 'settings', name: 'Settings', href: '/settings', icon: 'settings', pinnable: true },
|
|
10856
|
+
],
|
|
10857
|
+
},
|
|
10858
|
+
{
|
|
10859
|
+
id: 'admin',
|
|
10860
|
+
title: 'Administration',
|
|
10861
|
+
collapsible: true,
|
|
10862
|
+
expandForRoles: ['admin', 'superuser'],
|
|
10863
|
+
items: [
|
|
10864
|
+
{ id: 'users', name: 'Users', href: '/admin/users', icon: 'users', pinnable: true },
|
|
10865
|
+
{ id: 'roles', name: 'Roles', href: '/admin/roles', icon: 'shield', pinnable: true },
|
|
10853
10866
|
],
|
|
10854
10867
|
},
|
|
10855
10868
|
];
|
|
@@ -10858,10 +10871,24 @@ var pattern_library_default = {
|
|
|
10858
10871
|
id: '1',
|
|
10859
10872
|
name: 'John Doe',
|
|
10860
10873
|
email: 'john@example.com',
|
|
10874
|
+
roles: ['admin'],
|
|
10861
10875
|
};
|
|
10876
|
+
|
|
10877
|
+
async function handlePinnedChange(pinnedIds: string[]) {
|
|
10878
|
+
await fetch('/api/user/preferences', {
|
|
10879
|
+
method: 'PATCH',
|
|
10880
|
+
body: JSON.stringify({ pinnedItems: pinnedIds }),
|
|
10881
|
+
});
|
|
10882
|
+
}
|
|
10862
10883
|
</script>
|
|
10863
10884
|
|
|
10864
|
-
<DashboardLayout
|
|
10885
|
+
<DashboardLayout
|
|
10886
|
+
{navigation}
|
|
10887
|
+
{user}
|
|
10888
|
+
appName="My App"
|
|
10889
|
+
enablePinning={true}
|
|
10890
|
+
onPinnedChange={handlePinnedChange}
|
|
10891
|
+
>
|
|
10865
10892
|
<h1>Welcome to Dashboard</h1>
|
|
10866
10893
|
</DashboardLayout>`
|
|
10867
10894
|
},
|
|
@@ -13438,7 +13465,10 @@ function registerLayoutPagePrompt(server) {
|
|
|
13438
13465
|
const layoutGuide = {
|
|
13439
13466
|
dashboard: `DashboardLayout - For authenticated dashboard pages with sidebar navigation
|
|
13440
13467
|
- Props: navigation (NavSection[]), user (User), appName, pageTitle, sidebarVariant, headerSearch
|
|
13441
|
-
-
|
|
13468
|
+
- Pinning Props: enablePinning, pinnedSectionTitle, initialPinnedItems, onPinnedChange, pinIcon
|
|
13469
|
+
- Supports: collapsible sidebar, user menu, quick links, mobile responsive
|
|
13470
|
+
- Role-based Expansion: Use expandForRoles on NavSection to auto-expand sections for users with specific roles
|
|
13471
|
+
- User Pinning: Enable pinnable items (pinnable: true on NavItem) with onPinnedChange callback for persistence`,
|
|
13442
13472
|
public: `PublicLayout - For public-facing pages with header and footer
|
|
13443
13473
|
- Props: navigation (NavItem[]), footerLinks (NavSection[]), copyright, headerSearch
|
|
13444
13474
|
- Supports: responsive header nav, footer link sections, logo customization`,
|
|
@@ -13480,12 +13510,16 @@ interface NavItem {
|
|
|
13480
13510
|
badge?: string | number;
|
|
13481
13511
|
children?: NavItem[];
|
|
13482
13512
|
active?: boolean;
|
|
13513
|
+
pinnable?: boolean; // Allow this item to be pinned by users
|
|
13483
13514
|
}
|
|
13484
13515
|
|
|
13485
13516
|
interface NavSection {
|
|
13486
13517
|
id: string;
|
|
13487
13518
|
title?: string;
|
|
13488
13519
|
items: NavItem[];
|
|
13520
|
+
collapsible?: boolean;
|
|
13521
|
+
expanded?: boolean;
|
|
13522
|
+
expandForRoles?: string[]; // Auto-expand for users with these roles
|
|
13489
13523
|
}
|
|
13490
13524
|
|
|
13491
13525
|
interface User {
|
|
@@ -13493,7 +13527,14 @@ interface User {
|
|
|
13493
13527
|
name: string;
|
|
13494
13528
|
email?: string;
|
|
13495
13529
|
avatar?: string;
|
|
13496
|
-
roles?: string[];
|
|
13530
|
+
roles?: string[]; // Used for role-based section expansion
|
|
13531
|
+
}
|
|
13532
|
+
|
|
13533
|
+
// For external persistence of sidebar preferences
|
|
13534
|
+
interface SidebarPreferences {
|
|
13535
|
+
pinnedItems: string[];
|
|
13536
|
+
expandedSections: string[];
|
|
13537
|
+
expandedItems: string[];
|
|
13497
13538
|
}
|
|
13498
13539
|
\`\`\`
|
|
13499
13540
|
|