@classic-homes/theme-mcp 0.1.10 → 0.1.11

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 CHANGED
@@ -10833,7 +10833,7 @@ var pattern_library_default = {
10833
10833
  {
10834
10834
  id: "dashboard-page",
10835
10835
  name: "Dashboard Page",
10836
- description: "Full dashboard layout with sidebar navigation",
10836
+ description: "Full dashboard layout with sidebar navigation, role-based section expansion, and user-driven pinning",
10837
10837
  useCase: "Authenticated dashboard pages",
10838
10838
  components: [
10839
10839
  "DashboardLayout",
@@ -10843,7 +10843,10 @@ var pattern_library_default = {
10843
10843
  props: {
10844
10844
  navigation: "NavSection[]",
10845
10845
  user: "User",
10846
- sidebarVariant: "'light' | 'dark'"
10846
+ sidebarVariant: "'light' | 'dark'",
10847
+ enablePinning: "boolean",
10848
+ initialPinnedItems: "string[]",
10849
+ onPinnedChange: "(pinnedIds: string[]) => void"
10847
10850
  },
10848
10851
  example: `<script lang="ts">
10849
10852
  import { DashboardLayout } from '@classic-homes/theme-svelte';
@@ -10853,8 +10856,18 @@ var pattern_library_default = {
10853
10856
  {
10854
10857
  id: 'main',
10855
10858
  items: [
10856
- { id: 'dashboard', name: 'Dashboard', href: '/dashboard', icon: 'home' },
10857
- { id: 'settings', name: 'Settings', href: '/settings', icon: 'settings' },
10859
+ { id: 'dashboard', name: 'Dashboard', href: '/dashboard', icon: 'home', pinnable: true },
10860
+ { id: 'settings', name: 'Settings', href: '/settings', icon: 'settings', pinnable: true },
10861
+ ],
10862
+ },
10863
+ {
10864
+ id: 'admin',
10865
+ title: 'Administration',
10866
+ collapsible: true,
10867
+ expandForRoles: ['admin', 'superuser'],
10868
+ items: [
10869
+ { id: 'users', name: 'Users', href: '/admin/users', icon: 'users', pinnable: true },
10870
+ { id: 'roles', name: 'Roles', href: '/admin/roles', icon: 'shield', pinnable: true },
10858
10871
  ],
10859
10872
  },
10860
10873
  ];
@@ -10863,10 +10876,24 @@ var pattern_library_default = {
10863
10876
  id: '1',
10864
10877
  name: 'John Doe',
10865
10878
  email: 'john@example.com',
10879
+ roles: ['admin'],
10866
10880
  };
10881
+
10882
+ async function handlePinnedChange(pinnedIds: string[]) {
10883
+ await fetch('/api/user/preferences', {
10884
+ method: 'PATCH',
10885
+ body: JSON.stringify({ pinnedItems: pinnedIds }),
10886
+ });
10887
+ }
10867
10888
  </script>
10868
10889
 
10869
- <DashboardLayout {navigation} {user} appName="My App">
10890
+ <DashboardLayout
10891
+ {navigation}
10892
+ {user}
10893
+ appName="My App"
10894
+ enablePinning={true}
10895
+ onPinnedChange={handlePinnedChange}
10896
+ >
10870
10897
  <h1>Welcome to Dashboard</h1>
10871
10898
  </DashboardLayout>`
10872
10899
  },
@@ -13443,7 +13470,10 @@ function registerLayoutPagePrompt(server) {
13443
13470
  const layoutGuide = {
13444
13471
  dashboard: `DashboardLayout - For authenticated dashboard pages with sidebar navigation
13445
13472
  - Props: navigation (NavSection[]), user (User), appName, pageTitle, sidebarVariant, headerSearch
13446
- - Supports: collapsible sidebar, user menu, quick links, mobile responsive`,
13473
+ - Pinning Props: enablePinning, pinnedSectionTitle, initialPinnedItems, onPinnedChange, pinIcon
13474
+ - Supports: collapsible sidebar, user menu, quick links, mobile responsive
13475
+ - Role-based Expansion: Use expandForRoles on NavSection to auto-expand sections for users with specific roles
13476
+ - User Pinning: Enable pinnable items (pinnable: true on NavItem) with onPinnedChange callback for persistence`,
13447
13477
  public: `PublicLayout - For public-facing pages with header and footer
13448
13478
  - Props: navigation (NavItem[]), footerLinks (NavSection[]), copyright, headerSearch
13449
13479
  - Supports: responsive header nav, footer link sections, logo customization`,
@@ -13485,12 +13515,16 @@ interface NavItem {
13485
13515
  badge?: string | number;
13486
13516
  children?: NavItem[];
13487
13517
  active?: boolean;
13518
+ pinnable?: boolean; // Allow this item to be pinned by users
13488
13519
  }
13489
13520
 
13490
13521
  interface NavSection {
13491
13522
  id: string;
13492
13523
  title?: string;
13493
13524
  items: NavItem[];
13525
+ collapsible?: boolean;
13526
+ expanded?: boolean;
13527
+ expandForRoles?: string[]; // Auto-expand for users with these roles
13494
13528
  }
13495
13529
 
13496
13530
  interface User {
@@ -13498,7 +13532,14 @@ interface User {
13498
13532
  name: string;
13499
13533
  email?: string;
13500
13534
  avatar?: string;
13501
- roles?: string[];
13535
+ roles?: string[]; // Used for role-based section expansion
13536
+ }
13537
+
13538
+ // For external persistence of sidebar preferences
13539
+ interface SidebarPreferences {
13540
+ pinnedItems: string[];
13541
+ expandedSections: string[];
13542
+ expandedItems: string[];
13502
13543
  }
13503
13544
  \`\`\`
13504
13545