@classic-homes/theme-mcp 0.1.18 → 0.1.19
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 +6 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -7030,7 +7030,7 @@ var component_catalog_default = {
|
|
|
7030
7030
|
},
|
|
7031
7031
|
{
|
|
7032
7032
|
title: "Complete Implementation",
|
|
7033
|
-
code: "<script>\n import {\n NotificationList,\n NotificationFilters,\n NotificationBulkActions,\n
|
|
7033
|
+
code: "<script>\n import { toastStore } from '@classic-homes/theme-svelte';\n import {\n NotificationList,\n NotificationFilters,\n NotificationBulkActions,\n } from '@classic-homes/theme-svelte/notifications';\n import type { Notification, NotificationFilter, NotificationCounts } from '@classic-homes/notifications/core';\n\n let notifications = $state<Notification[]>([...]);\n let filter = $state<NotificationFilter>('all');\n let selectedIds = $state(new Set<string>());\n\n const filteredNotifications = $derived(() => {\n switch (filter) {\n case 'unread': return notifications.filter(n => !n.read);\n case 'read': return notifications.filter(n => n.read);\n default: return notifications;\n }\n });\n\n const counts = $derived<NotificationCounts>({\n all: notifications.length,\n unread: notifications.filter(n => !n.read).length,\n read: notifications.filter(n => n.read).length,\n });\n\n const allSelected = $derived(\n filteredNotifications().length > 0 &&\n filteredNotifications().every(n => selectedIds.has(n.id))\n );\n\n function handleToggleSelect(id: string, selected: boolean) {\n const newSet = new Set(selectedIds);\n if (selected) newSet.add(id);\n else newSet.delete(id);\n selectedIds = newSet;\n }\n\n function handleSelectAll(selected: boolean) {\n if (selected) {\n selectedIds = new Set(filteredNotifications().map(n => n.id));\n } else {\n selectedIds = new Set();\n }\n }\n\n function handleClearSelection() {\n selectedIds = new Set();\n }\n\n function handleBulkMarkRead() {\n notifications = notifications.map(n =>\n selectedIds.has(n.id)\n ? { ...n, read: true, readAt: new Date().toISOString() }\n : n\n );\n selectedIds = new Set();\n toastStore.success('Marked as read');\n }\n\n function handleBulkMarkUnread() {\n notifications = notifications.map(n =>\n selectedIds.has(n.id)\n ? { ...n, read: false, readAt: undefined }\n : n\n );\n selectedIds = new Set();\n toastStore.info('Marked as unread');\n }\n\n function handleBulkDelete() {\n notifications = notifications.filter(n => !selectedIds.has(n.id));\n selectedIds = new Set();\n toastStore.info('Deleted');\n }\n</script>\n\n<NotificationFilters bind:filter {counts} onFilterChange={() => (selectedIds = new Set())} />\n\n{#if filteredNotifications().length > 0}\n <NotificationBulkActions\n selectedCount={selectedIds.size}\n totalCount={filteredNotifications().length}\n {allSelected}\n onSelectAll={handleSelectAll}\n onMarkRead={handleBulkMarkRead}\n onMarkUnread={handleBulkMarkUnread}\n onDelete={handleBulkDelete}\n onClearSelection={handleClearSelection}\n />\n{/if}\n\n<NotificationList\n notifications={filteredNotifications()}\n {selectedIds}\n selectable={true}\n onToggleSelect={handleToggleSelect}\n/>"
|
|
7034
7034
|
}
|
|
7035
7035
|
],
|
|
7036
7036
|
relatedComponents: [
|
|
@@ -7108,7 +7108,7 @@ var component_catalog_default = {
|
|
|
7108
7108
|
},
|
|
7109
7109
|
{
|
|
7110
7110
|
title: "Complete Implementation",
|
|
7111
|
-
code: "<script>\n import { NotificationList, NotificationDialog
|
|
7111
|
+
code: "<script>\n import { toastStore } from '@classic-homes/theme-svelte';\n import { NotificationList, NotificationDialog } from '@classic-homes/theme-svelte/notifications';\n import type { Notification } from '@classic-homes/notifications/core';\n\n let notifications = $state<Notification[]>([...]);\n let selectedNotification = $state<Notification | null>(null);\n let dialogOpen = $state(false);\n\n function handleNotificationClick(notification: Notification) {\n selectedNotification = notification;\n dialogOpen = true;\n }\n\n function handleDialogClose() {\n dialogOpen = false;\n selectedNotification = null;\n }\n\n function markAsRead(id: string) {\n notifications = notifications.map(n =>\n n.id === id ? { ...n, read: true, readAt: new Date().toISOString() } : n\n );\n toastStore.success('Notification marked as read');\n }\n\n function markAsUnread(id: string) {\n notifications = notifications.map(n =>\n n.id === id ? { ...n, read: false, readAt: undefined } : n\n );\n toastStore.info('Notification marked as unread');\n }\n\n function deleteNotification(id: string) {\n notifications = notifications.filter(n => n.id !== id);\n handleDialogClose();\n toastStore.info('Notification deleted');\n }\n</script>\n\n<NotificationList {notifications} onNotificationClick={handleNotificationClick} />\n\n<NotificationDialog\n notification={selectedNotification}\n bind:open={dialogOpen}\n onClose={handleDialogClose}\n onMarkRead={markAsRead}\n onMarkUnread={markAsUnread}\n onDelete={deleteNotification}\n/>"
|
|
7112
7112
|
},
|
|
7113
7113
|
{
|
|
7114
7114
|
title: "With Action Links",
|
|
@@ -7170,7 +7170,7 @@ var component_catalog_default = {
|
|
|
7170
7170
|
},
|
|
7171
7171
|
{
|
|
7172
7172
|
title: "With Notification List",
|
|
7173
|
-
code: "<script>\n import {\n NotificationFilters,\n NotificationList,\n } from '@classic-homes/theme-svelte';\n import type { Notification, NotificationFilter, NotificationCounts } from '@classic-homes/notifications/core';\n\n let notifications = $state<Notification[]>([...]);\n let filter = $state<NotificationFilter>('all');\n\n const counts = $derived<NotificationCounts>({\n all: notifications.length,\n unread: notifications.filter(n => !n.read).length,\n read: notifications.filter(n => n.read).length,\n });\n\n const filteredNotifications = $derived(() => {\n switch (filter) {\n case 'unread': return notifications.filter(n => !n.read);\n case 'read': return notifications.filter(n => n.read);\n default: return notifications;\n }\n });\n</script>\n\n<NotificationFilters bind:filter {counts} />\n\n<NotificationList\n notifications={filteredNotifications()}\n emptyTitle={filter === 'unread'\n ? 'No unread notifications'\n : filter === 'read'\n ? 'No read notifications'\n : 'No notifications'}\n/>"
|
|
7173
|
+
code: "<script>\n import {\n NotificationFilters,\n NotificationList,\n } from '@classic-homes/theme-svelte/notifications';\n import type { Notification, NotificationFilter, NotificationCounts } from '@classic-homes/notifications/core';\n\n let notifications = $state<Notification[]>([...]);\n let filter = $state<NotificationFilter>('all');\n\n const counts = $derived<NotificationCounts>({\n all: notifications.length,\n unread: notifications.filter(n => !n.read).length,\n read: notifications.filter(n => n.read).length,\n });\n\n const filteredNotifications = $derived(() => {\n switch (filter) {\n case 'unread': return notifications.filter(n => !n.read);\n case 'read': return notifications.filter(n => n.read);\n default: return notifications;\n }\n });\n</script>\n\n<NotificationFilters bind:filter {counts} />\n\n<NotificationList\n notifications={filteredNotifications()}\n emptyTitle={filter === 'unread'\n ? 'No unread notifications'\n : filter === 'read'\n ? 'No read notifications'\n : 'No notifications'}\n/>"
|
|
7174
7174
|
},
|
|
7175
7175
|
{
|
|
7176
7176
|
title: "Reset Selection on Filter Change",
|
|
@@ -7365,7 +7365,7 @@ var component_catalog_default = {
|
|
|
7365
7365
|
},
|
|
7366
7366
|
{
|
|
7367
7367
|
title: "Complete Notification Center",
|
|
7368
|
-
code: "<script>\n import {\n NotificationList,\n NotificationFilters,\n NotificationBulkActions,\n NotificationDialog,\n } from '@classic-homes/theme-svelte';\n import type { Notification, NotificationFilter, NotificationCounts } from '@classic-homes/notifications/core';\n\n let notifications = $state<Notification[]>([...]);\n let filter = $state<NotificationFilter>('all');\n let selectedIds = $state(new Set<string>());\n let dialogOpen = $state(false);\n let selectedNotification = $state<Notification | null>(null);\n\n const filteredNotifications = $derived(() => {\n switch (filter) {\n case 'unread': return notifications.filter(n => !n.read);\n case 'read': return notifications.filter(n => n.read);\n default: return notifications;\n }\n });\n\n const counts: NotificationCounts = $derived({\n all: notifications.length,\n unread: notifications.filter(n => !n.read).length,\n read: notifications.filter(n => n.read).length,\n });\n</script>\n\n<NotificationFilters bind:filter {counts} />\n\n<NotificationBulkActions\n selectedCount={selectedIds.size}\n totalCount={filteredNotifications().length}\n onSelectAll={(selected) => {\n /* ... */\n }}\n onMarkRead={() => {\n /* ... */\n }}\n onDelete={() => {\n /* ... */\n }}\n/>\n\n<NotificationList\n notifications={filteredNotifications()}\n {selectedIds}\n selectable={true}\n onToggleSelect={handleToggleSelect}\n onNotificationClick={handleNotificationClick}\n/>\n\n<NotificationDialog notification={selectedNotification} bind:open={dialogOpen} />"
|
|
7368
|
+
code: "<script>\n import {\n NotificationList,\n NotificationFilters,\n NotificationBulkActions,\n NotificationDialog,\n } from '@classic-homes/theme-svelte/notifications';\n import type { Notification, NotificationFilter, NotificationCounts } from '@classic-homes/notifications/core';\n\n let notifications = $state<Notification[]>([...]);\n let filter = $state<NotificationFilter>('all');\n let selectedIds = $state(new Set<string>());\n let dialogOpen = $state(false);\n let selectedNotification = $state<Notification | null>(null);\n\n const filteredNotifications = $derived(() => {\n switch (filter) {\n case 'unread': return notifications.filter(n => !n.read);\n case 'read': return notifications.filter(n => n.read);\n default: return notifications;\n }\n });\n\n const counts: NotificationCounts = $derived({\n all: notifications.length,\n unread: notifications.filter(n => !n.read).length,\n read: notifications.filter(n => n.read).length,\n });\n</script>\n\n<NotificationFilters bind:filter {counts} />\n\n<NotificationBulkActions\n selectedCount={selectedIds.size}\n totalCount={filteredNotifications().length}\n onSelectAll={(selected) => {\n /* ... */\n }}\n onMarkRead={() => {\n /* ... */\n }}\n onDelete={() => {\n /* ... */\n }}\n/>\n\n<NotificationList\n notifications={filteredNotifications()}\n {selectedIds}\n selectable={true}\n onToggleSelect={handleToggleSelect}\n onNotificationClick={handleNotificationClick}\n/>\n\n<NotificationDialog notification={selectedNotification} bind:open={dialogOpen} />"
|
|
7369
7369
|
},
|
|
7370
7370
|
{
|
|
7371
7371
|
title: "With Filter-Specific Empty States",
|
|
@@ -12044,7 +12044,8 @@ var pattern_library_default = {
|
|
|
12044
12044
|
"Button"
|
|
12045
12045
|
],
|
|
12046
12046
|
example: `<script lang="ts">
|
|
12047
|
-
import {
|
|
12047
|
+
import { Button, DropdownMenu } from '@classic-homes/theme-svelte';
|
|
12048
|
+
import { NotificationBadge, NotificationList } from '@classic-homes/theme-svelte/notifications';
|
|
12048
12049
|
import { notificationService } from '@classic-homes/notifications/core';
|
|
12049
12050
|
import type { Notification } from '@classic-homes/notifications/core';
|
|
12050
12051
|
import { goto } from '$app/navigation';
|