@stacksjs/defaults 0.75.672 → 0.75.683

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 (69) 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 +26 -5
  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 +22 -9
  30. package/resources/components/Dashboard/MobileSidebar.stx +1 -1
  31. package/resources/components/Dashboard/Settings/AppearanceSettingsDashboard.stx +37 -92
  32. package/resources/components/Dashboard/Settings/DashboardSettingsFrame.stx +98 -0
  33. package/resources/components/Dashboard/Settings/DashboardThemePicker.stx +213 -0
  34. package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +162 -167
  35. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +34 -30
  36. package/resources/components/Dashboard/Settings/SoftwareUpdateDashboard.stx +229 -0
  37. package/resources/components/Dashboard/UI/ActivityTable.stx +7 -7
  38. package/resources/components/Dashboard/UI/Button.stx +6 -3
  39. package/resources/components/Dashboard/UI/Card.stx +1 -1
  40. package/resources/components/Dashboard/UI/DashboardNavigationCards.stx +44 -0
  41. package/resources/components/Dashboard/UI/Drawer.stx +1 -1
  42. package/resources/components/Dashboard/UI/Input.stx +1 -0
  43. package/resources/components/Dashboard/UI/Modal.stx +1 -0
  44. package/resources/components/Dashboard/UI/PageHeader.stx +1 -1
  45. package/resources/components/Dashboard/UI/QuickLinks.stx +7 -5
  46. package/resources/components/Dashboard/UI/Select.stx +1 -0
  47. package/resources/components/Dashboard/UI/ServiceHealth.stx +6 -6
  48. package/resources/components/Dashboard/UI/StatsCard.stx +5 -5
  49. package/resources/components/Dashboard/UI/Table.stx +2 -1
  50. package/resources/components/Dashboard/UI/Textarea.stx +1 -0
  51. package/resources/components/Marketing/SubscribeForm.stx +29 -8
  52. package/resources/functions/dashboard/section-landing.ts +201 -0
  53. package/resources/functions/dashboard/section-navigation.ts +95 -0
  54. package/styles/dashboard-theme.css +1017 -0
  55. package/views/dashboard/composables/dashboard-theme-bootstrap.ts +11 -0
  56. package/views/dashboard/composables/dashboard-themes.ts +180 -0
  57. package/views/dashboard/composables/settings-window.ts +116 -0
  58. package/views/dashboard/composables/useAppearance.ts +34 -13
  59. package/views/dashboard/composables/useDashboardThemes.ts +80 -0
  60. package/views/dashboard/composables/useSettingsWindow.ts +23 -0
  61. package/views/dashboard/layouts/default.stx +74 -59
  62. package/views/dashboard/layouts/guest.stx +11 -1
  63. package/views/dashboard/layouts/settings.stx +48 -0
  64. package/views/dashboard/sections/[section].stx +19 -0
  65. package/views/dashboard/settings/appearance.stx +4 -2
  66. package/views/dashboard/settings/billing.stx +3 -4
  67. package/views/dashboard/settings/index.stx +4 -2
  68. package/views/dashboard/settings/mail.stx +3 -3
  69. package/views/dashboard/settings/software-update.stx +9 -0
@@ -17,9 +17,11 @@
17
17
  // `storage/framework/tsconfig.app.json` and falls back to the installed
18
18
  // package when there is none, so it resolves in both layouts.
19
19
  import { dashboardProjectIdentity } from '@stacksjs/defaults/resources/functions/dashboard/project-switcher'
20
+ import { buildDashboardSectionHubs } from '@stacksjs/defaults/resources/functions/dashboard/section-navigation'
20
21
  import { buildWebSidebarSections, webSidebarRoleMap } from '@stacksjs/defaults/resources/functions/dashboard/sidebar'
21
22
 
22
23
  export const sidebarSections = buildWebSidebarSections()
24
+ export const sectionHubs = buildDashboardSectionHubs(sidebarSections)
23
25
 
24
26
  // The project this dashboard serves, for the switcher at the top of the
25
27
  // sidebar. Only its name: the list of other projects is fetched by the
@@ -47,14 +49,16 @@ defineClientPayload({ sidebarRoleMap, sidebarSections })
47
49
  @head
48
50
  <link rel="icon" href="/images/logos/favicon.svg" type="image/svg+xml">
49
51
  <link rel="icon" href="/images/logos/favicon-dark.svg" type="image/svg+xml" media="(prefers-color-scheme: dark)">
52
+ <link rel="stylesheet" href="/__deps/dashboard-theme.css">
53
+ <script src="/__deps/dashboard-theme.js"></script>
50
54
  @endhead
51
55
 
52
56
  <!-- Dashboard icon stylesheet. Most dashboard icons are applied via dynamic
53
57
  `:class="…"` bindings whose class names live in client script state, which the
54
58
  stx Crosswind extractor cannot see, so their CSS is never generated inline and
55
- they render as empty boxes. The dev server generates the full icon set once and
59
+ they render as empty boxes. The dashboard generates the full icon set once and
56
60
  serves it here (browser-cached), instead of inlining ~260KB into every page.
57
- Route: `/__deps/dashboard-icons.css` in actions/src/dev/dashboard.ts.
61
+ Route: `/__deps/dashboard-icons.css` in actions/src/dashboard-assets.ts.
58
62
 
59
63
  No angle-bracket tag names in this comment. stx parses them as elements, which
60
64
  breaks OUT of the comment: the closing marker is then never emitted, and the
@@ -221,7 +225,7 @@ html .dashboard-modal-layer {
221
225
  * attribute is what wins, and it wins by specificity rather than by `!important`
222
226
  * so the rules stay overridable downstream.
223
227
  * ======================================================================== */
224
- html[data-appearance="arc"] {
228
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) {
225
229
  /* Warmer and a shade deeper than the content card it carries. The stx `arc`
226
230
  theme paints its pane at #f7f5f1 over whatever sits behind it; here the
227
231
  panel IS the backdrop, so it has to be flat and darker than white or the
@@ -232,26 +236,26 @@ html[data-appearance="arc"] {
232
236
  }
233
237
  /* The dark class is written onto the root element itself, so it stacks with
234
238
  the appearance attribute rather than sitting above it. */
235
- html[data-appearance="arc"].dark {
239
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark {
236
240
  --dash-arc-panel: #171717;
237
241
  }
238
242
 
239
243
  /* The gap around the content card is the body showing through, which is what
240
244
  makes the card read as floating on the sidebar rather than beside it. */
241
- html[data-appearance="arc"] body {
245
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) body {
242
246
  background: var(--dash-arc-panel);
243
247
  }
244
248
 
245
249
  /* The card owns scrolling, so the page must not also scroll: a document
246
250
  scrollbar would eat the right-hand gap and there would be nothing for it to
247
251
  scroll anyway. */
248
- html[data-appearance="arc"],
249
- html[data-appearance="arc"] body {
252
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])),
253
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) body {
250
254
  height: 100%;
251
255
  overflow: hidden;
252
256
  }
253
257
 
254
- html[data-appearance="arc"] [data-stx-content] {
258
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-stx-content] {
255
259
  /* Only three margins. `margin-left` is deliberately left to the base rule.
256
260
 
257
261
  It is the one margin that transitions (0.3s, for the sidebar collapse),
@@ -290,7 +294,7 @@ html[data-appearance="arc"] [data-stx-content] {
290
294
  0 8px 24px rgba(0, 0, 0, 0.06);
291
295
  transition: margin-left 0.3s ease-out;
292
296
  }
293
- html[data-appearance="arc"].dark [data-stx-content] {
297
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark [data-stx-content] {
294
298
  background: #0a0a0a;
295
299
  box-shadow:
296
300
  0 0 0 0.5px rgba(255, 255, 255, 0.08),
@@ -299,38 +303,38 @@ html[data-appearance="arc"].dark [data-stx-content] {
299
303
 
300
304
  /* An overlay scrollbar inside the card, so the rounded corner is not cut by a
301
305
  full-width native gutter. */
302
- html[data-appearance="arc"] [data-stx-content] {
306
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-stx-content] {
303
307
  scrollbar-width: thin;
304
308
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
305
309
  }
306
- html[data-appearance="arc"] [data-stx-content]::-webkit-scrollbar {
310
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-stx-content]::-webkit-scrollbar {
307
311
  width: 8px;
308
312
  }
309
- html[data-appearance="arc"] [data-stx-content]::-webkit-scrollbar-thumb {
313
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-stx-content]::-webkit-scrollbar-thumb {
310
314
  border: 2px solid transparent;
311
315
  border-radius: 8px;
312
316
  background-clip: content-box;
313
317
  background-color: rgba(0, 0, 0, 0.2);
314
318
  }
315
- html[data-appearance="arc"] [data-stx-content]::-webkit-scrollbar-track {
319
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-stx-content]::-webkit-scrollbar-track {
316
320
  background: transparent;
317
321
  }
318
- html[data-appearance="arc"].dark [data-stx-content] {
322
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark [data-stx-content] {
319
323
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
320
324
  }
321
- html[data-appearance="arc"].dark [data-stx-content]::-webkit-scrollbar-thumb {
325
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark [data-stx-content]::-webkit-scrollbar-thumb {
322
326
  background-color: rgba(255, 255, 255, 0.25);
323
327
  }
324
328
 
325
329
  /* On narrow viewports the sidebar is hidden entirely, so the card would float
326
330
  on nothing. Return it to a flush pane. */
327
331
  @media (max-width: 1023px) {
328
- html[data-appearance="arc"],
329
- html[data-appearance="arc"] body {
332
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])),
333
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) body {
330
334
  height: auto;
331
335
  overflow: visible;
332
336
  }
333
- html[data-appearance="arc"] [data-stx-content] {
337
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-stx-content] {
334
338
  margin-top: 0;
335
339
  margin-right: 0;
336
340
  margin-bottom: 0;
@@ -343,41 +347,41 @@ html[data-appearance="arc"].dark [data-stx-content]::-webkit-scrollbar-thumb {
343
347
  }
344
348
 
345
349
  /* The panel is the body; the pane just holds rows. */
346
- html[data-appearance="arc"] [data-stx-sidebar] {
350
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-stx-sidebar] {
347
351
  background: transparent;
348
352
  backdrop-filter: none;
349
353
  -webkit-backdrop-filter: none;
350
354
  color: #2c2a28;
351
355
  }
352
- html[data-appearance="arc"].dark [data-stx-sidebar] {
356
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark [data-stx-sidebar] {
353
357
  color: #ededf0;
354
358
  }
355
359
  /* Liquid Glass belongs to the macOS material. Arc's panel is flat. */
356
- html[data-appearance="arc"] .stx-sidebar-rim {
360
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) .stx-sidebar-rim {
357
361
  display: none;
358
362
  }
359
363
 
360
364
  /* Rows: discrete cards with a 2px gutter, not AppKit's contiguous run. */
361
- html[data-appearance="arc"] [data-sidebar-row] {
365
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-row] {
362
366
  height: 32px;
363
367
  }
364
- html[data-appearance="arc"] [data-sidebar-item] {
368
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-item] {
365
369
  height: 30px;
366
370
  border-radius: 8px;
367
371
  color: inherit;
368
372
  }
369
- html[data-appearance="arc"] [data-sidebar-item]:hover {
373
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-item]:hover {
370
374
  background: rgba(255, 255, 255, 0.55);
371
375
  }
372
- html[data-appearance="arc"].dark [data-sidebar-item]:hover {
376
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark [data-sidebar-item]:hover {
373
377
  background: rgba(255, 255, 255, 0.08);
374
378
  }
375
379
 
376
380
  /* Selection: a raised white card, in both window states. Matching the
377
381
  component's own selector shape is what gives these the specificity to win. */
378
- html[data-appearance="arc"] [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"],
379
- html[data-appearance="arc"] [data-sidebar-selection="accent"][data-window-key="false"] [data-sidebar-item][data-active="true"],
380
- html[data-appearance="arc"] [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"]:hover {
382
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"],
383
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-selection="accent"][data-window-key="false"] [data-sidebar-item][data-active="true"],
384
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"]:hover {
381
385
  background: #fff;
382
386
  color: #1b1a19;
383
387
  font-weight: 500;
@@ -385,9 +389,9 @@ html[data-appearance="arc"] [data-sidebar-selection="accent"][data-window-key="t
385
389
  0 0 0 1px rgba(0, 0, 0, 0.05),
386
390
  0 1px 2px rgba(0, 0, 0, 0.08);
387
391
  }
388
- html[data-appearance="arc"].dark [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"],
389
- html[data-appearance="arc"].dark [data-sidebar-selection="accent"][data-window-key="false"] [data-sidebar-item][data-active="true"],
390
- html[data-appearance="arc"].dark [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"]:hover {
392
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"],
393
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark [data-sidebar-selection="accent"][data-window-key="false"] [data-sidebar-item][data-active="true"],
394
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"]:hover {
391
395
  background: rgba(255, 255, 255, 0.14);
392
396
  color: #fff;
393
397
  box-shadow:
@@ -397,20 +401,20 @@ html[data-appearance="arc"].dark [data-sidebar-selection="accent"][data-window-k
397
401
 
398
402
  /* The icon, count and chevron turn white on a macOS accent fill. On a white
399
403
  card they must not - they keep their own tint, the same as an idle row. */
400
- html[data-appearance="arc"] [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"] [data-sidebar-icon],
401
- html[data-appearance="arc"] [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"] [data-sidebar-chevron] {
404
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"] [data-sidebar-icon],
405
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"] [data-sidebar-chevron] {
402
406
  color: var(--stx-sidebar-icon, currentColor);
403
407
  }
404
- html[data-appearance="arc"] [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"] [data-sidebar-count] {
408
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"] [data-sidebar-count] {
405
409
  color: rgba(44, 42, 40, 0.45);
406
410
  }
407
- html[data-appearance="arc"].dark [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"] [data-sidebar-count] {
411
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])).dark [data-sidebar-selection="accent"][data-window-key="true"] [data-sidebar-item][data-active="true"] [data-sidebar-count] {
408
412
  color: rgba(237, 237, 240, 0.45);
409
413
  }
410
414
 
411
415
  /* Section headers: sentence case and quieter than the macOS uppercase strip. */
412
- html[data-appearance="arc"] [data-sidebar-section-header],
413
- html[data-appearance="arc"] [data-sidebar-section] > div:first-child {
416
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-section-header],
417
+ html[data-appearance="arc"]:where(:not([data-dashboard-layout])) [data-sidebar-section] > div:first-child {
414
418
  opacity: 0.55;
415
419
  }
416
420
 
@@ -492,7 +496,10 @@ import type { ToastType } from '@stacksjs/defaults/functions/toasts'
492
496
  import type { CraftSidebarSelectEvent } from '@stacksjs/defaults/functions/craft'
493
497
  import { useToasts, dismissToast } from '@stacksjs/defaults/functions/toasts'
494
498
  import { ensureCraftNativeSidebarMarker, useCraftSidebarSelection } from '@stacksjs/defaults/functions/craft'
495
- import { readStoredAppearance, useAppearance } from '@stacksjs/defaults/views/dashboard/composables/useAppearance'
499
+ import { dashboardNavigationPath } from '@stacksjs/defaults/resources/functions/dashboard/section-navigation'
500
+ import { useAppearance } from '@stacksjs/defaults/views/dashboard/composables/useAppearance'
501
+ import { handleDashboardSettingsClick, listenForSettingsCommand, openDashboardSettings } from '@stacksjs/defaults/views/dashboard/composables/settings-window'
502
+ import { useDashboardThemes } from '@stacksjs/defaults/views/dashboard/composables/useDashboardThemes'
496
503
  import { authStore } from '@stacksjs/defaults/views/dashboard/stores/auth'
497
504
  import { kanbanStore } from '@stacksjs/defaults/views/dashboard/stores/kanban'
498
505
  import { createDashboardSidebarOrder } from '@stacksjs/defaults/functions/dashboard-sidebar-order'
@@ -540,6 +547,7 @@ const sidebarOrder = createDashboardSidebarOrder({
540
547
  status: value => sidebarOrderStatus.set(value),
541
548
  })
542
549
  let removeCraftSidebarSelection = () => {}
550
+ let removeSettingsCommand: (() => void) | undefined
543
551
  ensureCraftNativeSidebarMarker()
544
552
  auth.load()
545
553
 
@@ -583,6 +591,7 @@ effect(() => {
583
591
  // ---------------------------------------------------------------------------
584
592
 
585
593
  const appearance = useAppearance()
594
+ const themes = useDashboardThemes()
586
595
 
587
596
  effect(() => {
588
597
  // Reading the signals here is what subscribes this effect to them; `apply`
@@ -603,7 +612,9 @@ function applySectionVisibility() {
603
612
  // ends up with no dependency and never runs again. The toggle then appears to
604
613
  // do nothing until a reload.
605
614
  const hidden = appearance.hiddenSections()
615
+ const flatNavigation = themes.sectionNavigation()
606
616
  for (const pane of sidebarPanes()) {
617
+ pane.setAttribute('tabindex', flatNavigation ? '-1' : '0')
607
618
  for (const section of pane.querySelectorAll<HTMLElement>('[data-sidebar-section]')) {
608
619
  const id = section.dataset.sectionId || ''
609
620
  section.setAttribute('data-viewer-hidden', String(hidden.includes(id)))
@@ -619,22 +630,12 @@ function applySectionVisibility() {
619
630
  effect(applySectionVisibility)
620
631
 
621
632
 
622
- // Another tab changed the preferences. `storage` only fires in OTHER tabs, so
623
- // this cannot loop back on the tab that made the change. The store's own
624
- // persistence writes but does not watch, so the re-read is explicit.
625
- useEventListener('storage', (event) => {
626
- if (event?.key !== 'stacks-dashboard-appearance') return
627
- const next = readStoredAppearance()
628
- appearance.sidebarStyle.set(next.sidebarStyle)
629
- appearance.colorMode.set(next.colorMode)
630
- appearance.hiddenSections.set(next.hiddenSections)
631
- appearance.apply()
633
+ useEventListener('click', handleDashboardSettingsClick, { capture: true })
634
+ useEventListener('keydown', (event) => {
635
+ if (!removeSettingsCommand && event.metaKey && event.key === ',' && openDashboardSettings())
636
+ event.preventDefault()
632
637
  })
633
638
 
634
- function normalizeRoutePath(path: string | null | undefined): string {
635
- return (path || '/').replace(/\/+$/, '') || '/'
636
- }
637
-
638
639
  // Highlight the current route. Longest-prefix matching keeps a detail page
639
640
  // such as /commerce/products/42 attached to its /commerce/products row while
640
641
  // preventing /health from matching /health-check.
@@ -647,7 +648,7 @@ function syncActiveSidebarRow(url?: string): void {
647
648
  catch {}
648
649
  }
649
650
 
650
- const currentPath = normalizeRoutePath(path)
651
+ const currentPath = dashboardNavigationPath(path || '/')
651
652
  for (const pane of sidebarPanes()) {
652
653
  let bestMatch = null
653
654
  let bestLength = -1
@@ -656,7 +657,7 @@ function syncActiveSidebarRow(url?: string): void {
656
657
  for (const link of links) {
657
658
  const href = link.getAttribute('href') || ''
658
659
  if (href.startsWith('http')) continue
659
- const candidatePath = normalizeRoutePath(href)
660
+ const candidatePath = dashboardNavigationPath(href)
660
661
  if (`${currentPath}/`.startsWith(`${candidatePath}/`) && candidatePath.length > bestLength) {
661
662
  bestMatch = link
662
663
  bestLength = candidatePath.length
@@ -679,7 +680,8 @@ function handleSidebarItemClick(payload: { item?: { href?: string }, event?: { p
679
680
  const href = payload?.item?.href
680
681
  if (!href || href.startsWith('http')) return
681
682
  payload.event?.preventDefault()
682
- navigate(href)
683
+ if (!openDashboardSettings(href))
684
+ navigate(href)
683
685
  }
684
686
 
685
687
  // Where the Sidebar sat in the window while it is lent to the drawer.
@@ -697,6 +699,7 @@ function showSidebarInDrawer() {
697
699
  drawer.appendChild(element)
698
700
  }
699
701
  applyRoleFilter()
702
+ applySectionVisibility()
700
703
  syncActiveSidebarRow()
701
704
  }
702
705
 
@@ -720,12 +723,17 @@ function handleCraftSidebarSelection(event: CraftSidebarSelectEvent | undefined)
720
723
  const link = row?.querySelector('a[data-sidebar-item][href]')
721
724
  const href = link?.getAttribute('href')
722
725
  if (href) {
723
- navigate(href)
726
+ if (!openDashboardSettings(href))
727
+ navigate(href)
724
728
  return
725
729
  }
726
730
  }
727
731
  }
728
732
 
733
+ function attachSettingsCommand(): void {
734
+ removeSettingsCommand ??= listenForSettingsCommand(() => { openDashboardSettings() })
735
+ }
736
+
729
737
  function attachCraftSidebarSelection() {
730
738
  removeCraftSidebarSelection()
731
739
  removeCraftSidebarSelection = useCraftSidebarSelection(handleCraftSidebarSelection)
@@ -736,26 +744,29 @@ useEventListener('stx:hydrated', () => syncActiveSidebarRow(), { once: true })
736
744
  useEventListener('craft:ready', () => {
737
745
  ensureCraftNativeSidebarMarker()
738
746
  attachCraftSidebarSelection()
747
+ attachSettingsCommand()
739
748
  })
740
749
 
741
750
  onMount(() => {
751
+ themes.sync()
742
752
  sidebarOrder.attach()
743
753
  void sidebarOrder.load()
744
754
  syncActiveSidebarRow()
745
755
  applyRoleFilter()
746
756
  applySectionVisibility()
747
757
  attachCraftSidebarSelection()
758
+ attachSettingsCommand()
748
759
  })
749
760
 
750
761
  onDestroy(() => {
751
762
  sidebarOrder.destroy()
763
+ removeSettingsCommand?.()
752
764
  removeCraftSidebarSelection()
753
765
  })
754
766
  </script>
755
767
 
756
768
  <div ref="dashboardSidebarHost" data-dashboard-web-sidebar>
757
769
  <Sidebar
758
- :sections="sidebarSections"
759
770
  theme="macos"
760
771
  width="250"
761
772
  placement="fixed"
@@ -778,8 +789,12 @@ onDestroy(() => {
778
789
  <ProjectSwitcher :name="dashboardProject.name" />
779
790
  @endif
780
791
  </template>
792
+ <div data-dashboard-sidebar-tree>
793
+ <SidebarSections :sections="sidebarSections" theme="macos" />
794
+ </div>
795
+ <DashboardSectionSidebar :sectionHubs="sectionHubs" />
781
796
  <template #footer>
782
- <div class="px-3 py-2 text-neutral-600 text-xs dark:text-neutral-300" data-sidebar-order-controls :data-sidebar-order-editing="sidebarReordering() ? 'true' : 'false'">
797
+ <div class="px-3 py-2 text-neutral-600 text-xs dark:text-neutral-300" data-sidebar-order-controls data-dashboard-muted :data-sidebar-order-editing="sidebarReordering() ? 'true' : 'false'">
783
798
  <p role="status" aria-live="polite" :text="sidebarOrderStatus.message"></p>
784
799
  <Button :if="sidebarOrderStatus.ready" class="dashboard-sidebar-order-mode" variant="ghost" size="xs" @click="sidebarReordering.set(!sidebarReordering())">{{ sidebarReordering() ? 'Done reordering' : 'Reorder sidebar' }}</Button>
785
800
  <Button :if="!sidebarOrderStatus.ready" variant="ghost" size="xs" @click="sidebarOrder.load()">Retry loading order</Button>
@@ -796,7 +811,7 @@ onDestroy(() => {
796
811
  <div ref="dashboardMobileSidebarHost" data-dashboard-mobile-sidebar class="h-full"></div>
797
812
  </MobileSidebar>
798
813
 
799
- <main data-stx-content>
814
+ <main data-stx-content data-dashboard-content>
800
815
  @slot('content')
801
816
  </main>
802
817
 
@@ -6,8 +6,18 @@
6
6
  <link rel="icon" href="/images/logos/favicon.svg" type="image/svg+xml" />
7
7
  <link rel="icon" href="/images/logos/favicon-dark.svg" type="image/svg+xml" media="(prefers-color-scheme: dark)" />
8
8
  <title>Stacks Dashboard</title>
9
+ <link rel="stylesheet" href="/__deps/dashboard-theme.css" />
10
+ <script src="/__deps/dashboard-theme.js"></script>
11
+ @appearanceBootstrap({
12
+ storageKey: 'stacks-dashboard-appearance',
13
+ colorMode: {
14
+ key: 'colorMode',
15
+ attribute: 'color-mode',
16
+ default: 'system',
17
+ },
18
+ })
9
19
  </head>
10
- <body class="min-h-screen bg-neutral-100 dark:bg-neutral-950">
20
+ <body data-dashboard-guest class="min-h-screen bg-neutral-100 dark:bg-neutral-950">
11
21
  <main data-stx-content>
12
22
  @yield('content')
13
23
  </main>
@@ -0,0 +1,48 @@
1
+ @head
2
+ <link rel="icon" href="/images/logos/favicon.svg" type="image/svg+xml">
3
+ <link rel="stylesheet" href="/__deps/dashboard-theme.css">
4
+ <link rel="stylesheet" href="/__deps/dashboard-icons.css">
5
+ <script src="/__deps/dashboard-theme.js"></script>
6
+ @endhead
7
+
8
+ @appearanceBootstrap({
9
+ storageKey: 'stacks-dashboard-appearance',
10
+ appearance: {
11
+ key: 'sidebarStyle',
12
+ attribute: 'appearance',
13
+ allowed: ['macos', 'arc'],
14
+ default: 'macos',
15
+ },
16
+ colorMode: {
17
+ key: 'colorMode',
18
+ attribute: 'color-mode',
19
+ default: 'system',
20
+ },
21
+ })
22
+
23
+ <script client>
24
+ import { listenForSettingsPane, setSettingsWindowAppearance } from '@stacksjs/defaults/views/dashboard/composables/settings-window'
25
+ import { useAppearance } from '@stacksjs/defaults/views/dashboard/composables/useAppearance'
26
+ import { useSettingsWindow } from '@stacksjs/defaults/views/dashboard/composables/useSettingsWindow'
27
+
28
+ const settingsWindow = useSettingsWindow
29
+ const appearance = useAppearance()
30
+ let stopListening: (() => void) | undefined
31
+
32
+ effect(() => {
33
+ const mode = appearance.colorMode()
34
+ setSettingsWindowAppearance(mode)
35
+ })
36
+
37
+ useEventListener('stx:load', () => settingsWindow.syncHistory())
38
+ useEventListener('popstate', () => settingsWindow.syncHistory())
39
+ onMount(() => {
40
+ settingsWindow.syncHistory()
41
+ stopListening = listenForSettingsPane(navigate)
42
+ })
43
+ onDestroy(() => stopListening?.())
44
+ </script>
45
+
46
+ <main data-stx-content data-dashboard-content data-dashboard-settings-content>
47
+ @slot('content')
48
+ </main>
@@ -0,0 +1,19 @@
1
+ @extends('layouts/default')
2
+
3
+ <script server>
4
+ import { buildDashboardSectionHubs } from '@stacksjs/defaults/resources/functions/dashboard/section-navigation'
5
+ import { buildWebSidebarSections } from '@stacksjs/defaults/resources/functions/dashboard/sidebar'
6
+
7
+ export const hub = buildDashboardSectionHubs(buildWebSidebarSections())
8
+ .find(section => section.id === (typeof params !== 'undefined' ? params.section : undefined))
9
+ export const sectionTitle = hub ? `Dashboard - ${hub.label}` : 'Section not found'
10
+ </script>
11
+
12
+ @section('content')
13
+ @title(sectionTitle)
14
+ @if(hub)
15
+ <DashboardSectionLanding :hub="hub" />
16
+ @else
17
+ <NotFoundDashboard />
18
+ @endif
19
+ @endsection
@@ -1,7 +1,9 @@
1
- @extends('layouts/default')
1
+ @extends('layouts/settings')
2
2
 
3
3
  @section('content')
4
4
  @title('Dashboard - Appearance')
5
5
 
6
- <AppearanceSettingsDashboard />
6
+ <DashboardSettingsFrame pane="appearance">
7
+ <AppearanceSettingsDashboard />
8
+ </DashboardSettingsFrame>
7
9
  @endsection
@@ -1,10 +1,9 @@
1
- @extends('layouts/default')
1
+ @extends('layouts/settings')
2
2
 
3
3
  @section('content')
4
4
  @title('Dashboard - Billing Settings')
5
5
 
6
- <div class="p-4 lg:p-8 min-h-[100dvh] dark:bg-neutral-900">
6
+ <DashboardSettingsFrame pane="billing">
7
7
  <BillingSettings />
8
- </div>
9
-
8
+ </DashboardSettingsFrame>
10
9
  @endsection
@@ -1,7 +1,9 @@
1
- @extends('layouts/default')
1
+ @extends('layouts/settings')
2
2
 
3
3
  @section('content')
4
4
  @title('Dashboard - Settings')
5
5
 
6
- <SettingsDashboard />
6
+ <DashboardSettingsFrame pane="general">
7
+ <SettingsDashboard />
8
+ </DashboardSettingsFrame>
7
9
  @endsection
@@ -1,9 +1,9 @@
1
- @extends('layouts/default')
1
+ @extends('layouts/settings')
2
2
 
3
3
  @section('content')
4
4
  @title('Dashboard - Mail Settings')
5
5
 
6
- <div class="mx-auto pb-12 pt-6 px-4 sm:px-6 lg:px-8 max-w-7xl">
6
+ <DashboardSettingsFrame pane="mail">
7
7
  <MailSettingsDashboard />
8
- </div>
8
+ </DashboardSettingsFrame>
9
9
  @endsection
@@ -0,0 +1,9 @@
1
+ @extends('layouts/settings')
2
+
3
+ @section('content')
4
+ @title('Dashboard - Software Update')
5
+
6
+ <DashboardSettingsFrame pane="software-update">
7
+ <SoftwareUpdateDashboard />
8
+ </DashboardSettingsFrame>
9
+ @endsection