@stacksjs/defaults 0.75.674 → 0.75.685

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.
Files changed (57) hide show
  1. package/ai/skills/stacks-ai/SKILL.md +7 -2
  2. package/ai/skills/stacks-api/SKILL.md +1 -1
  3. package/ai/skills/stacks-dashboard/SKILL.md +9 -2
  4. package/ai/skills/stacks-deploy/SKILL.md +8 -0
  5. package/ai/skills/stacks-desktop/SKILL.md +31 -0
  6. package/ai/skills/stacks-development/SKILL.md +5 -7
  7. package/ai/skills/stacks-health/SKILL.md +19 -9
  8. package/ai/skills/stacks-native/CATALOG.md +24 -24
  9. package/ai/skills/stacks-newsletter/SKILL.md +10 -4
  10. package/ai/skills/stacks-router/SKILL.md +2 -2
  11. package/ai/skills/stacks-routes/SKILL.md +2 -2
  12. package/ai/skills/stacks-scheduler/SKILL.md +16 -2
  13. package/ai/skills/stacks-security/SKILL.md +24 -0
  14. package/ai/skills/stacks-socials/SKILL.md +17 -1
  15. package/ai/skills/stacks-storage/SKILL.md +34 -15
  16. package/app/Actions/SubscriberEmailAction.ts +26 -10
  17. package/app/Jobs/Inspire.ts +33 -0
  18. package/functions/dashboard-sidebar-order.ts +3 -0
  19. package/ide/vscode/package.json +1 -1
  20. package/package.json +8 -7
  21. package/project/storage/framework/types/request-context.d.ts +3 -0
  22. package/resources/components/Dashboard/Billing/BillingPaymentMethodsPanel.stx +3 -10
  23. package/resources/components/Dashboard/Billing/BillingPlanSummary.stx +3 -10
  24. package/resources/components/Dashboard/Billing/BillingSettings.stx +13 -15
  25. package/resources/components/Dashboard/Billing/BillingTransactionHistory.stx +2 -9
  26. package/resources/components/Dashboard/DashboardSectionLanding.stx +72 -0
  27. package/resources/components/Dashboard/DashboardSectionSidebar.stx +78 -0
  28. package/resources/components/Dashboard/GlobalSearch.stx +3 -1
  29. package/resources/components/Dashboard/Home/DashboardHome.stx +14 -1
  30. package/resources/components/Dashboard/Settings/AppearanceSettingsDashboard.stx +21 -92
  31. package/resources/components/Dashboard/Settings/DashboardSettingsFrame.stx +98 -0
  32. package/resources/components/Dashboard/Settings/DashboardThemePicker.stx +4 -9
  33. package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +162 -167
  34. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +34 -30
  35. package/resources/components/Dashboard/Settings/SoftwareUpdateDashboard.stx +229 -0
  36. package/resources/components/Dashboard/UI/DashboardNavigationCards.stx +44 -0
  37. package/resources/components/Dashboard/UI/Input.stx +1 -0
  38. package/resources/components/Dashboard/UI/Select.stx +1 -0
  39. package/resources/components/Dashboard/UI/Table.stx +1 -0
  40. package/resources/components/Dashboard/UI/Textarea.stx +1 -0
  41. package/resources/components/Marketing/SubscribeForm.stx +29 -8
  42. package/resources/functions/dashboard/section-landing.ts +201 -0
  43. package/resources/functions/dashboard/section-navigation.ts +95 -0
  44. package/styles/dashboard-theme.css +778 -9
  45. package/views/dashboard/composables/dashboard-themes.ts +5 -5
  46. package/views/dashboard/composables/settings-window.ts +116 -0
  47. package/views/dashboard/composables/useAppearance.ts +13 -4
  48. package/views/dashboard/composables/useDashboardThemes.ts +2 -1
  49. package/views/dashboard/composables/useSettingsWindow.ts +23 -0
  50. package/views/dashboard/layouts/default.stx +32 -20
  51. package/views/dashboard/layouts/settings.stx +48 -0
  52. package/views/dashboard/sections/[section].stx +19 -0
  53. package/views/dashboard/settings/appearance.stx +4 -2
  54. package/views/dashboard/settings/billing.stx +3 -4
  55. package/views/dashboard/settings/index.stx +4 -2
  56. package/views/dashboard/settings/mail.stx +3 -3
  57. package/views/dashboard/settings/software-update.stx +9 -0
@@ -0,0 +1,95 @@
1
+ import type { WebSidebarItem, WebSidebarSection } from './sidebar'
2
+
3
+ export interface DashboardNavigationCard {
4
+ id: string
5
+ href: string
6
+ label: string
7
+ icon: string
8
+ description?: string
9
+ section: string
10
+ /** Each option is a path through the navigation tree. Every role group on one path must pass. */
11
+ roleOptions: string[][][]
12
+ }
13
+
14
+ export interface DashboardNavigationHub extends DashboardNavigationCard {
15
+ destinations: DashboardNavigationCard[]
16
+ }
17
+
18
+ const sectionDetails: Record<string, { icon: string, description: string }> = {
19
+ library: { icon: 'i-f7-cube-box', description: 'Components, functions, releases, and packages' },
20
+ content: { icon: 'i-f7-doc-text', description: 'Pages, posts, files, and publishing' },
21
+ app: { icon: 'i-f7-bolt', description: 'Deployments, requests, jobs, and inboxes' },
22
+ data: { icon: 'i-f7-table', description: 'People, activity, and application models' },
23
+ commerce: { icon: 'i-f7-cart', description: 'Orders, customers, products, and payments' },
24
+ delivery: { icon: 'i-f7-car-fill', description: 'Shipping, couriers, and digital delivery' },
25
+ marketing: { icon: 'i-f7-speaker-2', description: 'Campaigns, lists, and social posts' },
26
+ analytics: { icon: 'i-f7-chart-bar', description: 'Traffic, audiences, and events' },
27
+ management: { icon: 'i-f7-rectangle-stack', description: 'Infrastructure, permissions, and system health' },
28
+ utilities: { icon: 'i-f7-gear-alt', description: 'Environment, access tokens, and settings' },
29
+ }
30
+
31
+ export function buildDashboardSectionHubs(sections: readonly WebSidebarSection[]): DashboardNavigationHub[] {
32
+ const hubs: DashboardNavigationHub[] = []
33
+ for (const section of sections) {
34
+ if (!section.label)
35
+ continue
36
+
37
+ function destinations(items: readonly WebSidebarItem[], inheritedRoles: string[][] = []): DashboardNavigationCard[] {
38
+ return items.flatMap((item) => {
39
+ const roles = item.roles?.length ? [...inheritedRoles, item.roles] : inheritedRoles
40
+ const children = destinations(item.children ?? [], roles)
41
+ if (!item.href)
42
+ return children
43
+ const { id, href, label, icon } = item
44
+ const description = href.startsWith('/models/') ? 'Model records' : undefined
45
+ return [{ id, href, label, icon, description, section: section.id, roleOptions: [roles] }, ...children]
46
+ })
47
+ }
48
+
49
+ const cards = destinations(section.items)
50
+ if (!cards.length)
51
+ continue
52
+
53
+ const details = sectionDetails[section.id]
54
+ hubs.push({
55
+ id: section.id,
56
+ href: `/sections/${encodeURIComponent(section.id)}`,
57
+ label: section.label,
58
+ icon: details?.icon ?? 'i-f7-square-grid-2x2',
59
+ description: details?.description,
60
+ section: section.id,
61
+ roleOptions: cards.some(card => canSeeDashboardCard(card, [], false)) ? [[]] : cards.flatMap(card => card.roleOptions),
62
+ destinations: cards,
63
+ })
64
+ }
65
+ return hubs
66
+ }
67
+
68
+ export function canSeeDashboardCard(card: DashboardNavigationCard, roles: readonly string[], localViewer: boolean): boolean {
69
+ return localViewer || card.roleOptions.some(option => option.every(group => group.some(role => roles.includes(role))))
70
+ }
71
+
72
+ export function dashboardNavigationPath(path: string): string {
73
+ return path.split(/[?#]/, 1)[0]?.replace(/\/+$/, '') || '/'
74
+ }
75
+
76
+ export function activeDashboardSection(hubs: readonly DashboardNavigationHub[], path: string): string | undefined {
77
+ const current = dashboardNavigationPath(path)
78
+ if (current === '/')
79
+ return 'top'
80
+
81
+ let matched: string | undefined
82
+ let longest = 0
83
+ for (const hub of hubs) {
84
+ for (const { href } of [hub, ...hub.destinations]) {
85
+ if (!href.startsWith('/') || href.startsWith('//'))
86
+ continue
87
+ const candidate = dashboardNavigationPath(href)
88
+ if (candidate !== '/' && (current === candidate || current.startsWith(`${candidate}/`)) && candidate.length > longest) {
89
+ matched = hub.id
90
+ longest = candidate.length
91
+ }
92
+ }
93
+ }
94
+ return matched
95
+ }