@stacksjs/defaults 0.75.712 → 0.75.716
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/ai/skills/stacks-dashboard/SKILL.md +20 -6
- package/ai/skills/stacks-dns/SKILL.md +17 -2
- package/ai/skills/stacks-native/CATALOG.md +5 -5
- package/app/Actions/Dashboard/Infrastructure/dns-overview.ts +2 -2
- package/app/Actions/Dashboard/Infrastructure/environment-file.ts +1 -12
- package/functions/dashboard-api.ts +5 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +6 -5
- package/resources/components/Dashboard/Buddy/BuddyAssistant.stx +1 -1
- package/resources/components/Dashboard/DashboardSectionSidebar.stx +12 -3
- package/resources/components/Dashboard/Environment/EnvironmentDashboard.stx +88 -68
- package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +1 -0
- package/resources/components/Dashboard/Projects/GitHubIssuesDashboard.stx +165 -0
- package/resources/components/Dashboard/Settings/DashboardSettingsIntro.stx +10 -0
- package/resources/components/Dashboard/Settings/DashboardSettingsSearch.stx +32 -0
- package/resources/components/Dashboard/Settings/DnsRecordsSettings.stx +181 -0
- package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +7 -5
- package/resources/components/Dashboard/Settings/SettingsCodeEditor.stx +27 -0
- package/resources/components/Dashboard/Settings/SettingsDashboard.stx +187 -270
- package/resources/components/Dashboard/Settings/SettingsPicker.stx +87 -0
- package/resources/functions/dashboard/environment-value.ts +11 -0
- package/resources/functions/dashboard/page-availability.ts +1 -1
- package/resources/functions/dashboard/project-config-sections.ts +105 -0
- package/resources/functions/dashboard/section-landing.ts +1 -1
- package/resources/functions/dashboard/settings-panes.ts +26 -0
- package/resources/functions/dashboard/sidebar.ts +7 -7
- package/styles/dashboard-theme.css +281 -25
- package/views/dashboard/composables/dashboard-theme-bootstrap.ts +7 -0
- package/views/dashboard/composables/settings-dialog.ts +22 -0
- package/views/dashboard/composables/settings-window.ts +10 -4
- package/views/dashboard/composables/useProjectConfigEditor.ts +244 -0
- package/views/dashboard/composables/useSettingsWindow.ts +23 -1
- package/views/dashboard/github-issues.stx +18 -0
- package/views/dashboard/layouts/default.stx +1 -1
- package/views/dashboard/layouts/settings.stx +147 -10
- package/views/dashboard/settings/appearance.stx +2 -3
- package/views/dashboard/settings/billing.stx +2 -3
- package/views/dashboard/settings/config/[section].stx +22 -0
- package/views/dashboard/{environment/index.stx → settings/environment.stx} +1 -1
- package/views/dashboard/settings/index.stx +1 -3
- package/views/dashboard/settings/mail.stx +2 -3
- package/views/dashboard/settings/software-update.stx +2 -3
- package/resources/components/Dashboard/CodeEditor.stx +0 -73
- package/resources/components/Dashboard/Settings/DashboardSettingsFrame.stx +0 -101
- package/resources/functions/dashboard/config-io.ts +0 -401
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export interface ProjectConfigFile {
|
|
2
|
+
name: string
|
|
3
|
+
title: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export const projectConfigSections = [
|
|
7
|
+
{ id: 'general', label: 'General', icon: 'i-f7-gear-alt-fill', tone: 'grey', description: 'Project identity, URLs, language, and framework extensions.', files: ['app', 'sites', 'stacks', 'feature-flags'] },
|
|
8
|
+
{ id: 'data', label: 'Database & Storage', icon: 'i-f7-tray-2-fill', tone: 'blue', description: 'Database connections, query behavior, and storage disks.', files: ['database', 'query-builder', 'qb', 'filesystems', 'storage'] },
|
|
9
|
+
{ id: 'security', label: 'Auth & Security', icon: 'i-f7-lock-shield-fill', tone: 'purple', description: 'Authentication, access, password hashing, and security policies.', files: ['auth', 'security', 'hashing', 'team'] },
|
|
10
|
+
{ id: 'network', label: 'Server & Networking', icon: 'i-f7-antenna-radiowaves-left-right', tone: 'blue', description: 'Server behavior, local ports, cross-origin requests, and realtime connections.', files: ['server', 'ports', 'cors', 'realtime', 'http'] },
|
|
11
|
+
{ id: 'cloud', label: 'Cloud & Domains', icon: 'i-f7-cloud-fill', tone: 'blue', description: 'Hosting, deployments, domains, and remote hosts.', files: ['cloud', 'domains', 'remote', 'deploy'] },
|
|
12
|
+
{ id: 'dns', label: 'DNS Records', icon: 'i-f7-globe', tone: 'blue', description: 'Declare the verification, mail, and alias records this project publishes on deploy.', files: ['dns'] },
|
|
13
|
+
{ id: 'jobs', label: 'Jobs & Cache', icon: 'i-f7-clock-fill', tone: 'grey', description: 'Job queues, schedules, cache stores, and background processing.', files: ['queue', 'cache', 'scheduler', 'cron', 'jobs'] },
|
|
14
|
+
{ id: 'interface', label: 'UI & Desktop', icon: 'i-f7-desktopcomputer', tone: 'purple', description: 'STX rendering, CSS, dashboard navigation, and native app options.', files: ['dashboard', 'ui', 'css', 'desktop', 'mobile', 'images'] },
|
|
15
|
+
{ id: 'messaging', label: 'Email & Messaging', icon: 'i-f7-envelope-fill', tone: 'blue', description: 'Project defaults for email, notifications, SMS, and social providers.', files: ['email', 'notification', 'sms', 'phone', 'socials'] },
|
|
16
|
+
{ id: 'monitoring', label: 'Analytics & Logs', icon: 'i-f7-chart-bar-fill', tone: 'green', description: 'Analytics, logging, error reporting, and application monitoring.', files: ['analytics', 'logging', 'errors', 'monitoring', 'telemetry'] },
|
|
17
|
+
{ id: 'content', label: 'Content & Search', icon: 'i-f7-doc-text-fill', tone: 'grey', description: 'Content, documentation, forms, and search indexes.', files: ['blog', 'cms', 'docs', 'search-engine', 'forms'] },
|
|
18
|
+
{ id: 'commerce', label: 'Commerce & Growth', icon: 'i-f7-cart-fill', tone: 'green', description: 'Commerce, payments, subscriptions, and marketing.', files: ['commerce', 'payment', 'saas', 'marketing'] },
|
|
19
|
+
{ id: 'integrations', label: 'AI & Integrations', icon: 'i-f7-bolt-fill', tone: 'purple', description: 'AI providers, external services, and shared packages.', files: ['ai', 'services', 'library'] },
|
|
20
|
+
{ id: 'development', label: 'Developer Tools', icon: 'i-f7-hammer-fill', tone: 'grey', description: 'Buddy, dependencies, Git, linting, and code style.', files: ['cli', 'deps', 'git', 'commit', 'changelog', 'buddy-bot', 'code-style', 'lint'] },
|
|
21
|
+
{ id: 'environment-schema', label: 'Environment Schema', icon: 'i-f7-list-bullet', tone: 'purple', description: 'Declare environment variable types, defaults, and validation rules.', files: ['env'] },
|
|
22
|
+
{ id: 'custom', label: 'Custom Configuration', icon: 'i-f7-folder-fill', tone: 'grey', description: 'Configuration files added by this project.', files: [] },
|
|
23
|
+
] as const
|
|
24
|
+
|
|
25
|
+
export type ProjectConfigSection = typeof projectConfigSections[number]['id']
|
|
26
|
+
|
|
27
|
+
export function projectConfigSection(id: string): typeof projectConfigSections[number] | undefined {
|
|
28
|
+
return projectConfigSections.find(section => section.id === id)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const configSectionByFile = new Map<string, ProjectConfigSection>(
|
|
32
|
+
projectConfigSections.flatMap(section => section.files.map(file => [file, section.id])),
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
export function sectionForConfig(file: string): ProjectConfigSection {
|
|
36
|
+
return configSectionByFile.get(file) ?? 'custom'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function projectConfigHref(section: ProjectConfigSection, file?: string): string {
|
|
40
|
+
const path = section === 'general' ? '/settings' : `/settings/config/${section}`
|
|
41
|
+
return file ? `${path}?file=${encodeURIComponent(file)}` : path
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const labelOverrides: Record<string, string> = {
|
|
45
|
+
ai: 'AI',
|
|
46
|
+
api: 'API',
|
|
47
|
+
aws: 'AWS',
|
|
48
|
+
cli: 'CLI',
|
|
49
|
+
cms: 'CMS',
|
|
50
|
+
cors: 'CORS',
|
|
51
|
+
cpu: 'CPU',
|
|
52
|
+
css: 'CSS',
|
|
53
|
+
db: 'DB',
|
|
54
|
+
dns: 'DNS',
|
|
55
|
+
dsn: 'DSN',
|
|
56
|
+
html: 'HTML',
|
|
57
|
+
http: 'HTTP',
|
|
58
|
+
https: 'HTTPS',
|
|
59
|
+
id: 'ID',
|
|
60
|
+
ip: 'IP',
|
|
61
|
+
ipv4: 'IPv4',
|
|
62
|
+
ipv6: 'IPv6',
|
|
63
|
+
json: 'JSON',
|
|
64
|
+
mysql: 'MySQL',
|
|
65
|
+
oauth: 'OAuth',
|
|
66
|
+
seo: 'SEO',
|
|
67
|
+
ses: 'SES',
|
|
68
|
+
singlestore: 'SingleStore',
|
|
69
|
+
sms: 'SMS',
|
|
70
|
+
smtp: 'SMTP',
|
|
71
|
+
sql: 'SQL',
|
|
72
|
+
sqlite: 'SQLite',
|
|
73
|
+
timezone: 'Time Zone',
|
|
74
|
+
ssl: 'SSL',
|
|
75
|
+
tls: 'TLS',
|
|
76
|
+
ttl: 'TTL',
|
|
77
|
+
ui: 'UI',
|
|
78
|
+
url: 'URL',
|
|
79
|
+
urls: 'URLs',
|
|
80
|
+
uuid: 'UUID',
|
|
81
|
+
webhook: 'Webhook',
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function configLabel(key: string): string {
|
|
85
|
+
return key.replace(/([a-z\d])([A-Z])/g, '$1 $2')
|
|
86
|
+
.replace(/([A-Z])([A-Z][a-z])/g, '$1 $2')
|
|
87
|
+
.split(/[_.\s-]+/)
|
|
88
|
+
.filter(Boolean)
|
|
89
|
+
.map(word => Object.hasOwn(labelOverrides, word.toLowerCase()) ? labelOverrides[word.toLowerCase()] : word.charAt(0).toUpperCase() + word.slice(1))
|
|
90
|
+
.join(' ') || key
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const fileLabels = new Map([
|
|
94
|
+
['app', 'Application'],
|
|
95
|
+
['cli', 'Buddy CLI'],
|
|
96
|
+
['css', 'Stylesheets'],
|
|
97
|
+
['deps', 'Dependencies'],
|
|
98
|
+
['env', 'Variable Definitions'],
|
|
99
|
+
['qb', 'Query Builder Alias'],
|
|
100
|
+
['stacks', 'Stack Extensions'],
|
|
101
|
+
])
|
|
102
|
+
|
|
103
|
+
export function configFileLabel(file: string): string {
|
|
104
|
+
return fileLabels.get(file) ?? file.split('/').map(configLabel).join(' › ')
|
|
105
|
+
}
|
|
@@ -132,7 +132,7 @@ const landings: Record<string, LandingDefinition> = {
|
|
|
132
132
|
primary: '/settings',
|
|
133
133
|
featured: {
|
|
134
134
|
'/settings/appearance': 'Choose a dashboard theme and color mode.',
|
|
135
|
-
'/environment': 'Review the environment your application runs in.',
|
|
135
|
+
'/settings/environment': 'Review the environment your application runs in.',
|
|
136
136
|
'/access-tokens': 'Manage tokens used to connect to the application.',
|
|
137
137
|
'/buddy': 'Browse commands for building and operating the project.',
|
|
138
138
|
},
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { projectConfigSection } from './project-config-sections'
|
|
2
|
+
|
|
3
|
+
export const settingsPanes = [
|
|
4
|
+
{ id: 'environment', label: 'Variables', href: '/settings/environment', icon: 'i-f7-gear', tone: 'grey', description: '', group: 'environment', keywords: 'environment env dotenv secrets variables bindings' },
|
|
5
|
+
{ id: 'appearance', label: 'Appearance', href: '/settings/appearance', icon: 'i-f7-circle-lefthalf-fill', tone: 'purple', description: 'Choose how the dashboard looks and which sections are shown in the sidebar.', group: 'dashboard', keywords: 'theme color mode dark light sidebar display' },
|
|
6
|
+
{ id: 'software-update', label: 'Software Update', href: '/settings/software-update', icon: 'i-f7-arrow-down-circle-fill', tone: 'blue', description: 'Check for Stacks releases and update your projects through Buddy.', group: 'dashboard', keywords: 'upgrade framework version install dependencies' },
|
|
7
|
+
{ id: 'mail', label: 'Mail Delivery', href: '/settings/mail', icon: 'i-f7-paperplane-fill', tone: 'blue', description: 'Set the sender, delivery driver, and credentials for outgoing mail.', group: 'dashboard', keywords: 'email smtp sender transport' },
|
|
8
|
+
{ id: 'billing', label: 'Billing', href: '/settings/billing', icon: 'i-f7-creditcard-fill', tone: 'green', description: 'View your subscription, payment methods, and transactions.', group: 'dashboard', keywords: 'subscription payment transaction invoice' },
|
|
9
|
+
] as const
|
|
10
|
+
|
|
11
|
+
export function settingsPanePath(href: string): string {
|
|
12
|
+
return href.split(/[?#]/, 1)[0]?.replace(/\/+$/, '') || '/settings'
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function settingsPaneLabel(href: string): string {
|
|
16
|
+
const pathname = settingsPanePath(href)
|
|
17
|
+
if (pathname === '/settings/environment')
|
|
18
|
+
return 'Environment Variables'
|
|
19
|
+
const pane = settingsPanes.find(item => item.href === pathname)
|
|
20
|
+
if (pane)
|
|
21
|
+
return pane.label
|
|
22
|
+
if (pathname === '/settings')
|
|
23
|
+
return 'General'
|
|
24
|
+
const prefix = '/settings/config/'
|
|
25
|
+
return (pathname.startsWith(prefix) && projectConfigSection(pathname.slice(prefix.length))?.label) || 'Settings'
|
|
26
|
+
}
|
|
@@ -12,6 +12,7 @@ import { existsSync, readFileSync } from 'node:fs'
|
|
|
12
12
|
import { createRequire } from 'node:module'
|
|
13
13
|
import { resolve } from 'node:path'
|
|
14
14
|
import { dashboardPageAvailable, readDashboardPageAvailability, unavailableDashboardPages } from './page-availability'
|
|
15
|
+
import { dashboardProjectIdentity } from './project-switcher'
|
|
15
16
|
|
|
16
17
|
type ModelCategory = 'userland' | 'data' | 'commerce' | 'content' | 'marketing' | 'system'
|
|
17
18
|
|
|
@@ -599,17 +600,11 @@ export function buildNavSections(
|
|
|
599
600
|
sections.push(['management', 'management', managementItems])
|
|
600
601
|
}
|
|
601
602
|
|
|
602
|
-
// Utilities section: real paths are flat (`/buddy`, `/environment`,
|
|
603
|
-
// `/access-tokens`) or under `/settings/*` for billing/mail. The
|
|
604
|
-
// historical `/utilities/*` URLs were uniformly 404s.
|
|
605
603
|
if (toggles.utilities) {
|
|
606
604
|
sections.push(['utilities', 'utilities', [
|
|
607
605
|
{ to: '/buddy', icon: 'terminal', text: 'Buddy CLI' },
|
|
608
|
-
{ to: '/environment', icon: 'settings', text: 'Environment' },
|
|
609
606
|
{ to: '/access-tokens', icon: 'lock', text: 'Access Tokens' },
|
|
610
607
|
{ to: '/settings', icon: 'settings', text: 'Settings' },
|
|
611
|
-
{ to: '/settings/appearance', icon: 'paintbrush', text: 'Appearance' },
|
|
612
|
-
{ to: '/settings/mail', icon: 'mail', text: 'Mail Settings' },
|
|
613
608
|
]])
|
|
614
609
|
}
|
|
615
610
|
|
|
@@ -779,7 +774,12 @@ export function buildWebSidebarSections(): WebSidebarSection[] {
|
|
|
779
774
|
{
|
|
780
775
|
id: 'top',
|
|
781
776
|
label: '',
|
|
782
|
-
items: [
|
|
777
|
+
items: [
|
|
778
|
+
{ id: 'home', label: 'Home', icon: NAV_ICON_CLASSES.home!, iconColor: 'blue', href: '/' },
|
|
779
|
+
...(dashboardProjectIdentity().enabled
|
|
780
|
+
? [{ id: 'github-issues', label: 'GitHub Issues', icon: 'i-hugeicons-github', iconColor: 'blue', href: '/github-issues' }]
|
|
781
|
+
: []),
|
|
782
|
+
],
|
|
783
783
|
},
|
|
784
784
|
...sections.map(([key, label, items]) => ({
|
|
785
785
|
id: key,
|
|
@@ -716,9 +716,11 @@ html[data-dashboard-theme="system-cleaner"] [data-dashboard-metrics] {
|
|
|
716
716
|
}
|
|
717
717
|
|
|
718
718
|
/* Settings uses the same split view in a browser and its own Craft window. */
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
719
|
+
.dashboard-settings-outlet {
|
|
720
|
+
display: flex;
|
|
721
|
+
flex: 1;
|
|
722
|
+
flex-direction: column;
|
|
723
|
+
min-height: 0;
|
|
722
724
|
margin: 0;
|
|
723
725
|
border-radius: 0;
|
|
724
726
|
background: light-dark(#fff, #1e1e20);
|
|
@@ -732,7 +734,9 @@ html:has([data-dashboard-settings][data-settings-native="true"]) [data-dashboard
|
|
|
732
734
|
}
|
|
733
735
|
|
|
734
736
|
html:has([data-dashboard-settings-content]) .dashboard-modal-layer {
|
|
735
|
-
|
|
737
|
+
inset-inline: 0;
|
|
738
|
+
/* WebKit gives a top-layer dialog an intrinsic width when this is auto. */
|
|
739
|
+
width: 100%;
|
|
736
740
|
}
|
|
737
741
|
|
|
738
742
|
.dashboard-settings {
|
|
@@ -768,7 +772,9 @@ html:has([data-dashboard-settings-content]) .dashboard-modal-layer {
|
|
|
768
772
|
|
|
769
773
|
.dashboard-settings-sidebar {
|
|
770
774
|
padding: 0 11px 14px;
|
|
771
|
-
|
|
775
|
+
display: flex;
|
|
776
|
+
flex-direction: column;
|
|
777
|
+
min-height: 0;
|
|
772
778
|
background: var(--stx-mac-sidebar);
|
|
773
779
|
border-inline-end: 1px solid var(--stx-mac-separator);
|
|
774
780
|
}
|
|
@@ -779,6 +785,7 @@ html:has([data-dashboard-settings-content]) .dashboard-modal-layer {
|
|
|
779
785
|
|
|
780
786
|
.dashboard-settings-sidebar-chrome {
|
|
781
787
|
position: relative;
|
|
788
|
+
flex: none;
|
|
782
789
|
min-height: 50px;
|
|
783
790
|
margin-inline: -11px;
|
|
784
791
|
}
|
|
@@ -804,6 +811,43 @@ html:has([data-dashboard-settings-content]) .dashboard-modal-layer {
|
|
|
804
811
|
|
|
805
812
|
[data-settings-native="true"] .dashboard-settings-back { display: none; }
|
|
806
813
|
|
|
814
|
+
.dashboard-settings-mobile-menu {
|
|
815
|
+
display: none;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.dashboard-settings-navigation {
|
|
819
|
+
display: flex;
|
|
820
|
+
flex: 1;
|
|
821
|
+
flex-direction: column;
|
|
822
|
+
min-height: 0;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
.dashboard-settings-nav {
|
|
826
|
+
flex: 1;
|
|
827
|
+
min-height: 0;
|
|
828
|
+
overflow: auto;
|
|
829
|
+
overscroll-behavior: contain;
|
|
830
|
+
scrollbar-width: thin;
|
|
831
|
+
padding: 2px;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.dashboard-settings-nav-group + .dashboard-settings-nav-group {
|
|
835
|
+
margin-top: 14px;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.dashboard-settings-nav-group > h2 {
|
|
839
|
+
margin: 0 8px 4px;
|
|
840
|
+
color: var(--stx-mac-ink-secondary);
|
|
841
|
+
font-size: 11px;
|
|
842
|
+
font-weight: 650;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
.dashboard-settings-result-detail {
|
|
846
|
+
display: block;
|
|
847
|
+
color: var(--stx-mac-ink-secondary);
|
|
848
|
+
font-size: 11px;
|
|
849
|
+
}
|
|
850
|
+
|
|
807
851
|
.dashboard-settings-search {
|
|
808
852
|
display: flex;
|
|
809
853
|
align-items: center;
|
|
@@ -995,35 +1039,226 @@ html:has([data-dashboard-settings-content]) .dashboard-modal-layer {
|
|
|
995
1039
|
white-space: normal;
|
|
996
1040
|
}
|
|
997
1041
|
|
|
998
|
-
.dashboard-
|
|
1042
|
+
.dashboard-config-intro {
|
|
1043
|
+
margin: 0;
|
|
1044
|
+
color: var(--stx-mac-ink-secondary);
|
|
1045
|
+
font-size: 13px;
|
|
1046
|
+
line-height: 1.45;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
.dashboard-settings-picker {
|
|
1050
|
+
display: grid;
|
|
1051
|
+
min-width: 0;
|
|
1052
|
+
gap: 4px;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
.dashboard-settings-picker-label {
|
|
1056
|
+
font-size: 13px;
|
|
1057
|
+
font-weight: 550;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
.dashboard-settings-picker-control {
|
|
1061
|
+
position: relative;
|
|
1062
|
+
display: grid;
|
|
1063
|
+
min-width: 0;
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
.dashboard-settings-picker-button {
|
|
1067
|
+
min-height: 26px;
|
|
1068
|
+
max-width: 100%;
|
|
1069
|
+
appearance: none;
|
|
1070
|
+
padding: 3px 25px 3px 8px;
|
|
1071
|
+
border: 1px solid var(--stx-mac-control-line);
|
|
1072
|
+
border-radius: 6px;
|
|
1073
|
+
color: var(--stx-mac-ink);
|
|
1074
|
+
background: var(--stx-mac-window);
|
|
1075
|
+
overflow: hidden;
|
|
1076
|
+
font-size: 13px;
|
|
1077
|
+
line-height: 1.25;
|
|
1078
|
+
text-align: start;
|
|
1079
|
+
text-overflow: ellipsis;
|
|
1080
|
+
white-space: nowrap;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
.dashboard-settings-picker-button:not(:disabled):hover {
|
|
1084
|
+
border-color: var(--stx-mac-ink-secondary);
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
.dashboard-settings-picker-button:disabled {
|
|
1088
|
+
opacity: .55;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
.dashboard-settings-picker-button[aria-invalid="true"] {
|
|
1092
|
+
border-color: light-dark(#bd293d, #f06e81);
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
.dashboard-settings-picker-glyph {
|
|
1096
|
+
position: absolute;
|
|
1097
|
+
inset-inline-end: 6px;
|
|
1098
|
+
top: 50%;
|
|
1099
|
+
width: 13px;
|
|
1100
|
+
height: 13px;
|
|
1101
|
+
transform: translateY(-50%);
|
|
1102
|
+
pointer-events: none;
|
|
1103
|
+
color: var(--stx-mac-ink-secondary);
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
.dashboard-settings-picker-hint {
|
|
1107
|
+
color: var(--stx-mac-ink-secondary);
|
|
1108
|
+
font-size: 12px;
|
|
1109
|
+
line-height: 1.4;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
.dashboard-settings-picker-hint[data-invalid="true"] {
|
|
1113
|
+
color: light-dark(#ae2438, #ff8898);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
.dashboard-config-header {
|
|
999
1117
|
display: flex;
|
|
1118
|
+
flex-wrap: wrap;
|
|
1000
1119
|
align-items: center;
|
|
1001
1120
|
justify-content: space-between;
|
|
1121
|
+
gap: 8px 14px;
|
|
1122
|
+
padding: 12px 14px;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
.dashboard-config-header h2 {
|
|
1126
|
+
margin: 0;
|
|
1127
|
+
overflow-wrap: anywhere;
|
|
1128
|
+
font-size: 17px;
|
|
1129
|
+
font-weight: 650;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
.dashboard-config-path {
|
|
1133
|
+
margin: 2px 0 0;
|
|
1134
|
+
color: var(--stx-mac-ink-secondary);
|
|
1135
|
+
font: 11px ui-monospace, monospace;
|
|
1136
|
+
overflow-wrap: anywhere;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
.dashboard-config-field-tools {
|
|
1140
|
+
display: grid;
|
|
1141
|
+
gap: 7px;
|
|
1142
|
+
padding: 0 14px 12px;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
.dashboard-config-subheading {
|
|
1146
|
+
margin: 0;
|
|
1147
|
+
padding: 8px 14px 4px;
|
|
1148
|
+
border-block-start: 1px solid var(--stx-mac-separator);
|
|
1149
|
+
color: var(--stx-mac-ink-secondary);
|
|
1150
|
+
font-size: 11px;
|
|
1151
|
+
font-weight: 650;
|
|
1152
|
+
overflow-wrap: anywhere;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
.dashboard-config-subheading + .dashboard-config-field {
|
|
1156
|
+
border-block-start: 0;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
.dashboard-config-field-label,
|
|
1160
|
+
.dashboard-config-field-description {
|
|
1161
|
+
overflow-wrap: anywhere;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
.dashboard-config-field-label {
|
|
1165
|
+
font-size: 13px;
|
|
1166
|
+
font-weight: 550;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
.dashboard-config-field-description {
|
|
1170
|
+
margin: 2px 0 0;
|
|
1171
|
+
color: var(--stx-mac-ink-secondary);
|
|
1172
|
+
font-size: 12px;
|
|
1173
|
+
line-height: 1.4;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
.dashboard-settings-picker-button:focus-visible,
|
|
1177
|
+
.dashboard-settings-mobile-menu:focus-visible,
|
|
1178
|
+
.dashboard-config-input:focus-visible {
|
|
1179
|
+
outline: 2px solid var(--stx-mac-accent);
|
|
1180
|
+
outline-offset: 2px;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
.dashboard-config-field {
|
|
1184
|
+
display: grid;
|
|
1185
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
1186
|
+
align-items: center;
|
|
1002
1187
|
gap: 10px;
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1188
|
+
padding: 8px 14px;
|
|
1189
|
+
border-block-start: 1px solid var(--stx-mac-separator);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
.dashboard-config-field-tools ~ div > [data-settings-row] {
|
|
1193
|
+
border-block-start: 1px solid var(--stx-mac-separator);
|
|
1008
1194
|
}
|
|
1009
1195
|
|
|
1010
|
-
.dashboard-
|
|
1011
|
-
|
|
1196
|
+
.dashboard-config-subheading + [data-settings-row] {
|
|
1197
|
+
border-block-start: 0;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
.dashboard-dns-settings {
|
|
1201
|
+
display: grid;
|
|
1202
|
+
gap: 10px;
|
|
1203
|
+
padding: 0 14px 14px;
|
|
1204
|
+
}
|
|
1012
1205
|
|
|
1013
|
-
.dashboard-
|
|
1014
|
-
display:
|
|
1206
|
+
.dashboard-dns-toolbar {
|
|
1207
|
+
display: flex;
|
|
1208
|
+
flex-wrap: wrap;
|
|
1015
1209
|
align-items: center;
|
|
1016
|
-
gap:
|
|
1210
|
+
gap: 8px 14px;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
.dashboard-dns-toolbar p {
|
|
1214
|
+
flex: 1 1 230px;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
.dashboard-dns-record-row {
|
|
1218
|
+
display: grid;
|
|
1219
|
+
grid-template-columns: 44px minmax(0, 1fr) auto;
|
|
1220
|
+
align-items: start;
|
|
1221
|
+
gap: 8px;
|
|
1222
|
+
padding: 10px 0;
|
|
1223
|
+
border-block-start: 1px solid var(--stx-mac-separator);
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
.dashboard-dns-type {
|
|
1227
|
+
justify-self: start;
|
|
1228
|
+
padding: 2px 5px;
|
|
1229
|
+
border-radius: 5px;
|
|
1230
|
+
background: var(--stx-mac-well);
|
|
1231
|
+
font: 11px ui-monospace, monospace;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
.dashboard-dns-meta,
|
|
1235
|
+
.dashboard-dns-value {
|
|
1017
1236
|
color: var(--stx-mac-ink-secondary);
|
|
1237
|
+
font-size: 12px;
|
|
1018
1238
|
}
|
|
1019
1239
|
|
|
1020
|
-
.dashboard-
|
|
1021
|
-
|
|
1022
|
-
|
|
1240
|
+
.dashboard-dns-value {
|
|
1241
|
+
display: block;
|
|
1242
|
+
overflow-wrap: anywhere;
|
|
1243
|
+
white-space: pre-wrap;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
@media (max-width: 480px) {
|
|
1247
|
+
.dashboard-dns-record-row { grid-template-columns: 44px minmax(0, 1fr); }
|
|
1248
|
+
.dashboard-dns-meta { grid-column: 2; }
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
.dashboard-config-input {
|
|
1252
|
+
width: 100%;
|
|
1253
|
+
min-width: 0;
|
|
1254
|
+
padding: 5px 8px;
|
|
1255
|
+
border: 1px solid var(--stx-mac-control-line);
|
|
1256
|
+
border-radius: 6px;
|
|
1257
|
+
font-size: 13px;
|
|
1023
1258
|
}
|
|
1024
1259
|
|
|
1025
|
-
|
|
1026
|
-
|
|
1260
|
+
@media (max-width: 420px) {
|
|
1261
|
+
.dashboard-config-field { grid-template-columns: minmax(0, 1fr); }
|
|
1027
1262
|
}
|
|
1028
1263
|
|
|
1029
1264
|
html .dashboard-settings [data-dashboard-field]:not(:disabled) {
|
|
@@ -1059,6 +1294,14 @@ html .dashboard-settings [data-dashboard-button="secondary"]:hover {
|
|
|
1059
1294
|
background: var(--stx-mac-sidebar);
|
|
1060
1295
|
}
|
|
1061
1296
|
|
|
1297
|
+
@media (min-width: 591px) {
|
|
1298
|
+
html:has([data-dashboard-settings-content]),
|
|
1299
|
+
html:has([data-dashboard-settings-content]) body {
|
|
1300
|
+
height: 100%;
|
|
1301
|
+
overflow: hidden;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
|
|
1062
1305
|
@media (max-width: 590px) {
|
|
1063
1306
|
.dashboard-settings {
|
|
1064
1307
|
display: block;
|
|
@@ -1072,12 +1315,25 @@ html .dashboard-settings [data-dashboard-button="secondary"]:hover {
|
|
|
1072
1315
|
border-block-end: 1px solid var(--stx-mac-separator);
|
|
1073
1316
|
}
|
|
1074
1317
|
|
|
1075
|
-
.dashboard-settings-
|
|
1076
|
-
display:
|
|
1077
|
-
|
|
1078
|
-
|
|
1318
|
+
.dashboard-settings-mobile-menu {
|
|
1319
|
+
display: flex;
|
|
1320
|
+
width: 100%;
|
|
1321
|
+
align-items: center;
|
|
1322
|
+
justify-content: space-between;
|
|
1323
|
+
padding: 6px 8px;
|
|
1324
|
+
border-radius: 7px;
|
|
1325
|
+
background: var(--stx-mac-well);
|
|
1326
|
+
font-size: 13px;
|
|
1327
|
+
font-weight: 600;
|
|
1079
1328
|
}
|
|
1080
1329
|
|
|
1330
|
+
.dashboard-settings-navigation {
|
|
1331
|
+
margin-top: 8px;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
.dashboard-settings-navigation[data-menu-open="false"] { display: none; }
|
|
1335
|
+
.dashboard-settings-nav { max-height: 48dvh; }
|
|
1336
|
+
|
|
1081
1337
|
.dashboard-settings-pane { overflow: visible; }
|
|
1082
1338
|
}
|
|
1083
1339
|
|
|
@@ -9,3 +9,10 @@ catch {
|
|
|
9
9
|
// The browser can refuse access to localStorage itself.
|
|
10
10
|
applyDashboardTheme(root)
|
|
11
11
|
}
|
|
12
|
+
|
|
13
|
+
// Router options are read at startup. Settings uses a persistent window shell
|
|
14
|
+
// and immediate pane changes, including Back and Forward in that window.
|
|
15
|
+
if (document.currentScript?.hasAttribute('data-settings-router')) {
|
|
16
|
+
const settingsWindow = window as Window & { STX_ROUTER_OPTIONS?: { viewTransitions?: boolean, routeFocus?: boolean, progress?: boolean } }
|
|
17
|
+
settingsWindow.STX_ROUTER_OPTIONS = { ...settingsWindow.STX_ROUTER_OPTIONS, viewTransitions: false, routeFocus: false, progress: false }
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isAvailable, showMessageBox } from '@stacksjs/desktop/browser'
|
|
2
|
+
|
|
3
|
+
/** Ask Craft for a platform alert. Null lets the caller open its accessible web dialog. */
|
|
4
|
+
export async function confirmSettingsDiscard(message: string, description: string, action: string): Promise<boolean | null> {
|
|
5
|
+
if (!isAvailable('dialog'))
|
|
6
|
+
return null
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const result = await showMessageBox({
|
|
10
|
+
type: 'warning',
|
|
11
|
+
message,
|
|
12
|
+
detail: description,
|
|
13
|
+
buttons: ['Cancel', action],
|
|
14
|
+
defaultButton: 0,
|
|
15
|
+
cancelButton: 0,
|
|
16
|
+
})
|
|
17
|
+
return result.response === 1
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return null
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
|
+
import { projectConfigSection } from '@stacksjs/defaults/resources/functions/dashboard/project-config-sections'
|
|
2
|
+
import { settingsPanes } from '@stacksjs/defaults/resources/functions/dashboard/settings-panes'
|
|
1
3
|
import { nativeWindow } from '@stacksjs/desktop/browser'
|
|
2
4
|
|
|
3
5
|
const windowName = 'stacks-dashboard-settings'
|
|
4
6
|
const paneChannel = 'stacks.dashboard.settings-pane'
|
|
5
|
-
const settingsPaths = ['/settings', '/settings/appearance', '/settings/mail', '/settings/billing', '/settings/software-update']
|
|
6
7
|
let browserWindow: Window | null = null
|
|
7
8
|
|
|
8
9
|
export function isDashboardSettingsPath(path: string): boolean {
|
|
9
|
-
|
|
10
|
+
const normalized = path.replace(/\/+$/, '')
|
|
11
|
+
if (normalized === '/settings' || settingsPanes.some(pane => pane.href === normalized))
|
|
12
|
+
return true
|
|
13
|
+
const prefix = '/settings/config/'
|
|
14
|
+
const section = normalized.startsWith(prefix) && projectConfigSection(normalized.slice(prefix.length))
|
|
15
|
+
return Boolean(section && section.id !== 'general')
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
/** Return false when the link should continue through ordinary navigation. */
|
|
@@ -37,7 +43,7 @@ export function openDashboardSettings(href = '/settings'): boolean {
|
|
|
37
43
|
}).then(() => {
|
|
38
44
|
// Craft focuses an existing named window and leaves its webview in place.
|
|
39
45
|
// A pane-specific link can request a change from that existing webview.
|
|
40
|
-
if (url.pathname !== '/settings' && typeof BroadcastChannel !== 'undefined') {
|
|
46
|
+
if ((url.pathname !== '/settings' || url.search) && typeof BroadcastChannel !== 'undefined') {
|
|
41
47
|
const channel = new BroadcastChannel(paneChannel)
|
|
42
48
|
channel.postMessage(url.pathname + url.search + url.hash)
|
|
43
49
|
channel.close()
|
|
@@ -51,7 +57,7 @@ export function openDashboardSettings(href = '/settings'): boolean {
|
|
|
51
57
|
if (!browserWindow)
|
|
52
58
|
return false
|
|
53
59
|
}
|
|
54
|
-
else if (url.pathname !== '/settings') {
|
|
60
|
+
else if (url.pathname !== '/settings' || url.search) {
|
|
55
61
|
// An authentication redirect can temporarily take the popup off-origin.
|
|
56
62
|
// Its URL is writeable even when its current value cannot be read.
|
|
57
63
|
let current: string | undefined
|