@stacksjs/defaults 0.75.538 → 0.75.541

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 (152) hide show
  1. package/ai/AGENTS.md +2 -0
  2. package/ai/skills/stacks-actions/SKILL.md +1 -1
  3. package/ai/skills/stacks-auth/SKILL.md +8 -1
  4. package/ai/skills/stacks-dashboard/SKILL.md +196 -3
  5. package/ai/skills/stacks-dependencies/SKILL.md +46 -0
  6. package/ai/skills/stacks-development/SKILL.md +1 -1
  7. package/ai/skills/stacks-flow/SKILL.md +7 -0
  8. package/ai/skills/stacks-hq/SKILL.md +146 -0
  9. package/ai/skills/stacks-models/SKILL.md +21 -3
  10. package/ai/skills/stacks-native/CATALOG.md +22 -9
  11. package/ai/skills/stacks-new-app/SKILL.md +175 -0
  12. package/ai/skills/stacks-repl/SKILL.md +61 -43
  13. package/ai/skills/stacks-stx/SKILL.md +6 -2
  14. package/ai/skills/stacks-upstream/SKILL.md +188 -0
  15. package/ai/skills/stacks-writing-for-agents/SKILL.md +1 -1
  16. package/app/Actions/Dashboard/Data/UserIndexAction.ts +20 -2
  17. package/app/Actions/Dashboard/Models/ModelDestroyAction.ts +48 -12
  18. package/app/Actions/Dashboard/Models/ModelOptionsAction.ts +103 -0
  19. package/app/Actions/Dashboard/Models/ModelRelatedAction.ts +42 -0
  20. package/app/Actions/Dashboard/Models/ModelShowAction.ts +75 -12
  21. package/app/Actions/Dashboard/Models/ModelStoreAction.ts +7 -1
  22. package/app/Actions/Dashboard/Models/ModelUpdateAction.ts +16 -2
  23. package/app/Actions/Dashboard/Models/model-destroy.ts +75 -0
  24. package/app/Actions/Dashboard/Models/model-options.ts +56 -0
  25. package/app/Actions/Dashboard/Models/model-related.ts +202 -0
  26. package/app/Actions/Dashboard/Models/model-relations.ts +172 -0
  27. package/app/Actions/Dashboard/Models/model-write.ts +240 -51
  28. package/app/Actions/Dashboard/Users/UserInviteAction.ts +50 -0
  29. package/app/Actions/Dashboard/Users/user-invitation.ts +110 -0
  30. package/app/Models/Activity.ts +4 -0
  31. package/app/Models/AnalyticsEvent.ts +4 -0
  32. package/app/Models/Automation.ts +4 -0
  33. package/app/Models/AutomationRun.ts +4 -0
  34. package/app/Models/Board.ts +4 -1
  35. package/app/Models/BoardColumn.ts +4 -1
  36. package/app/Models/Campaign.ts +4 -0
  37. package/app/Models/CampaignSend.ts +4 -0
  38. package/app/Models/CampaignVariant.ts +4 -0
  39. package/app/Models/Card.ts +4 -1
  40. package/app/Models/CardAttachment.ts +4 -0
  41. package/app/Models/CommunicationSuppression.ts +4 -0
  42. package/app/Models/ConsentEvent.ts +4 -0
  43. package/app/Models/Deployment.ts +1 -0
  44. package/app/Models/EmailList.ts +4 -0
  45. package/app/Models/EmailListSubscriber.ts +4 -0
  46. package/app/Models/Error.ts +4 -0
  47. package/app/Models/FailedJob.ts +4 -0
  48. package/app/Models/FeedbackToken.ts +4 -0
  49. package/app/Models/GdprRequest.ts +4 -0
  50. package/app/Models/Job.ts +4 -0
  51. package/app/Models/Log.ts +4 -0
  52. package/app/Models/MagicLinkToken.ts +4 -0
  53. package/app/Models/MailPreference.ts +4 -0
  54. package/app/Models/Notification.ts +4 -0
  55. package/app/Models/NotificationDelivery.ts +4 -0
  56. package/app/Models/PersonalAccessToken.ts +4 -0
  57. package/app/Models/QueryLog.ts +4 -0
  58. package/app/Models/Referral.ts +4 -0
  59. package/app/Models/Release.ts +1 -0
  60. package/app/Models/Request.ts +4 -0
  61. package/app/Models/SenderDomain.ts +4 -0
  62. package/app/Models/Site.ts +1 -0
  63. package/app/Models/SiteDomain.ts +4 -0
  64. package/app/Models/SocialPost.ts +4 -0
  65. package/app/Models/StorageItemTask.ts +4 -1
  66. package/app/Models/Subscriber.ts +4 -0
  67. package/app/Models/Subscription.ts +4 -0
  68. package/app/Models/Team.ts +1 -0
  69. package/app/Models/TeamInvitation.ts +1 -0
  70. package/app/Models/TeamMember.ts +1 -0
  71. package/app/Models/UsageEvent.ts +4 -0
  72. package/app/Models/User.ts +15 -3
  73. package/functions/dashboard-model-record.test.ts +276 -18
  74. package/functions/dashboard-model-record.ts +412 -55
  75. package/functions/data.ts +2 -0
  76. package/ide/vscode/package.json +1 -1
  77. package/package.json +5 -5
  78. package/resources/components/Dashboard/Analytics/AnalyticsHub.stx +1 -1
  79. package/resources/components/Dashboard/Analytics/CampaignAnalytics.stx +1 -1
  80. package/resources/components/Dashboard/Analytics/EventAnalytics.stx +1 -1
  81. package/resources/components/Dashboard/Analytics/SalesAnalytics.stx +1 -1
  82. package/resources/components/Dashboard/Analytics/WebAnalyticsBreakdown.stx +1 -1
  83. package/resources/components/Dashboard/App/RequestsOverview.stx +1 -1
  84. package/resources/components/Dashboard/App/SourceInventory.stx +1 -1
  85. package/resources/components/Dashboard/Auth/AccessTokens.stx +1 -1
  86. package/resources/components/Dashboard/Buddy/BuddyAssistant.stx +1 -1
  87. package/resources/components/Dashboard/Ci/CiDashboard.stx +1 -1
  88. package/resources/components/Dashboard/Commerce/Delivery/DeliveryPagination.stx +1 -1
  89. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +1 -1
  90. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +1 -1
  91. package/resources/components/Dashboard/Content/BlogDashboard.stx +1 -1
  92. package/resources/components/Dashboard/DashboardLayout.stx +1 -1
  93. package/resources/components/Dashboard/Data/DataRecords.stx +43 -22
  94. package/resources/components/Dashboard/Data/UserInvite.stx +107 -0
  95. package/resources/components/Dashboard/Email/CapturedMailDashboard.stx +1 -1
  96. package/resources/components/Dashboard/Email/EmailActivityDashboard.stx +1 -1
  97. package/resources/components/Dashboard/Email/InboxDashboard.stx +1 -1
  98. package/resources/components/Dashboard/Email/InboxMessageDetail.stx +2 -2
  99. package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +1 -1
  100. package/resources/components/Dashboard/Home/DashboardHome.stx +6 -1
  101. package/resources/components/Dashboard/Infrastructure/CloudDashboard.stx +1 -1
  102. package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +1 -1
  103. package/resources/components/Dashboard/Infrastructure/HealthDashboard.stx +1 -1
  104. package/resources/components/Dashboard/Infrastructure/InsightsDashboard.stx +1 -1
  105. package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +1 -1
  106. package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +1 -1
  107. package/resources/components/Dashboard/Infrastructure/ServerDetailsDashboard.stx +1 -1
  108. package/resources/components/Dashboard/Infrastructure/ServerlessDashboard.stx +1 -1
  109. package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -1
  110. package/resources/components/Dashboard/Jobs/JobDetail.stx +1 -1
  111. package/resources/components/Dashboard/Jobs/JobTable.stx +2 -2
  112. package/resources/components/Dashboard/Kanban/KanbanBoardDashboard.stx +1 -1
  113. package/resources/components/Dashboard/Kanban/KanbanBoardsDashboard.stx +1 -1
  114. package/resources/components/Dashboard/Management/PermissionsDashboard.stx +1 -1
  115. package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +1 -1
  116. package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +1 -1
  117. package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +1 -1
  118. package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +1 -1
  119. package/resources/components/Dashboard/Models/ModelFieldInputs.stx +125 -0
  120. package/resources/components/Dashboard/Models/ModelRecordCreate.stx +24 -66
  121. package/resources/components/Dashboard/Models/ModelRecordDetail.stx +36 -8
  122. package/resources/components/Dashboard/Models/ModelRecordEdit.stx +36 -32
  123. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +72 -28
  124. package/resources/components/Dashboard/Models/ModelRelatedPanels.stx +99 -0
  125. package/resources/components/Dashboard/Models/ModelRelationPicker.stx +247 -0
  126. package/resources/components/Dashboard/Models/ModelsOverview.stx +1 -1
  127. package/resources/components/Dashboard/Notifications/NotificationDeliveries.stx +1 -1
  128. package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +1 -1
  129. package/resources/components/Dashboard/Notifications/NotificationDeliveryOverview.stx +1 -1
  130. package/resources/components/Dashboard/Queries/QueryDashboard.stx +1 -1
  131. package/resources/components/Dashboard/Queries/QueryDetail.stx +1 -1
  132. package/resources/components/Dashboard/Queue/QueueDashboard.stx +1 -1
  133. package/resources/components/Dashboard/Realtime/RealtimeDashboard.stx +1 -1
  134. package/resources/components/Dashboard/Releases/ReleaseDashboard.stx +1 -1
  135. package/resources/components/Dashboard/Search/SearchEngineDashboard.stx +1 -1
  136. package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +1 -1
  137. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +1 -1
  138. package/resources/components/Dashboard/Teams/TeamPeopleDashboard.stx +1 -1
  139. package/resources/components/Dashboard/UI/Drawer.stx +1 -1
  140. package/resources/components/Dashboard/UI/Input.stx +3 -2
  141. package/resources/components/Dashboard/UI/Modal.stx +1 -1
  142. package/resources/components/Dashboard/UI/Select.stx +8 -4
  143. package/resources/components/Dashboard/UI/Textarea.stx +18 -12
  144. package/resources/emails/password-reset.stx +3 -1
  145. package/routes/dashboard-api.ts +9 -0
  146. package/scaffold/config/analytics.ts +5 -3
  147. package/scaffold/resources/components/NextStep.stx +13 -0
  148. package/scaffold/resources/partials/head.stx +31 -0
  149. package/scaffold/resources/views/index.stx +23 -47
  150. package/scaffold/resources/views/layouts/default.stx +23 -0
  151. package/views/dashboard/data/users/invite.stx +8 -0
  152. package/views/dashboard/layouts/default.stx +21 -2
@@ -93,7 +93,7 @@ onMount(() => {
93
93
  })
94
94
  </script>
95
95
 
96
- <div class="space-y-6">
96
+ <div class="flex flex-col gap-6">
97
97
  <AnalyticsPageHeader
98
98
  title="Marketing Analytics"
99
99
  description="Delivery, engagement, and currency-safe spend from Campaign records."
@@ -114,7 +114,7 @@ onMount(() => {
114
114
  })
115
115
  </script>
116
116
 
117
- <div class="space-y-6">
117
+ <div class="flex flex-col gap-6">
118
118
  <AnalyticsPageHeader
119
119
  title="Event Analytics"
120
120
  description="Privacy-safe aggregates from first-party AnalyticsEvent records."
@@ -67,7 +67,7 @@ onMount(() => {
67
67
  })
68
68
  </script>
69
69
 
70
- <div class="space-y-6">
70
+ <div class="flex flex-col gap-6">
71
71
  <AnalyticsPageHeader
72
72
  title="Sales Analytics"
73
73
  description="Currency-safe aggregates from orders, payments, and recorded order items."
@@ -107,7 +107,7 @@ onMount(() => {
107
107
  })
108
108
  </script>
109
109
 
110
- <div class="space-y-6">
110
+ <div class="flex flex-col gap-6">
111
111
  <AnalyticsPageHeader
112
112
  :title="title"
113
113
  :description="description"
@@ -173,7 +173,7 @@ onMount(() => {
173
173
  <div class="flex flex-col gap-6">
174
174
  <header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
175
175
  <div>
176
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Requests</h1>
176
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">Requests</h1>
177
177
  <p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">Inspect HTTP activity persisted by the Request model.</p>
178
178
  </div>
179
179
  <Button variant="secondary" :loading="loading()" @click="loadRequests">
@@ -197,7 +197,7 @@ onMount(() => {
197
197
  <div class="flex flex-col gap-6">
198
198
  <header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
199
199
  <div>
200
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">{{ page().title }}</h1>
200
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">{{ page().title }}</h1>
201
201
  <p class="mt-1 max-w-3xl text-neutral-500 text-sm dark:text-neutral-400">{{ page().description }}</p>
202
202
  </div>
203
203
  <div class="flex gap-2 items-center">
@@ -214,7 +214,7 @@ onMount(() => {
214
214
  <div class="flex flex-col gap-6">
215
215
  <header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
216
216
  <div>
217
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Access Tokens</h1>
217
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">Access Tokens</h1>
218
218
  <p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">Create and revoke personal API credentials for the signed-in account.</p>
219
219
  </div>
220
220
  <Button :if="!loading() && !authenticationRequired()" @click="openCreate">
@@ -83,7 +83,7 @@ onMount(() => {
83
83
  })
84
84
  </script>
85
85
 
86
- <div class="space-y-6">
86
+ <div class="flex flex-col gap-6">
87
87
  <PageHeader title="Buddy" description="Ask framework questions through your configured Stacks AI provider.">
88
88
  <div class="flex gap-2 items-center">
89
89
  <span :class="'inline-flex items-center px-2.5 py-1 font-medium text-xs rounded-full ' + (chatState()?.configured ? 'text-green-700 bg-green-100 dark:text-green-300 dark:bg-green-950' : 'text-amber-700 bg-amber-100 dark:text-amber-300 dark:bg-amber-950')">
@@ -154,7 +154,7 @@
154
154
 
155
155
  <div :if="canView">
156
156
  <header class="mb-6">
157
- <h1 class="font-semibold text-2xl text-zinc-900 dark:text-zinc-100">CI Status</h1>
157
+ <h1 class="font-bold text-2xl text-zinc-900 dark:text-zinc-100">CI Status</h1>
158
158
  <p class="mt-1 text-sm text-zinc-500">GitHub Actions health across the configured orgs. Configure in <code class="text-xs">config/dashboard.ts</code>.</p>
159
159
  </header>
160
160
 
@@ -81,7 +81,7 @@ function emitPage(page: number | string): void {
81
81
  results
82
82
  </p>
83
83
 
84
- <nav class="inline-flex -space-x-px rounded-md shadow-sm isolate" aria-label="Pagination">
84
+ <nav class="flex gap-1 items-center" aria-label="Pagination">
85
85
  <Button
86
86
  variant="secondary"
87
87
  iconOnly
@@ -176,7 +176,7 @@ onMount(() => {
176
176
  })
177
177
  </script>
178
178
 
179
- <div class="space-y-6">
179
+ <div class="flex flex-col gap-6">
180
180
  <PageHeader title="Product Waitlist" description="Native WaitlistProduct records without simulated customers or activity.">
181
181
  <div class="flex gap-2">
182
182
  <Button variant="secondary" :loading="isLoading()" @click="loadRecords">
@@ -217,7 +217,7 @@ onMount(() => {
217
217
  })
218
218
  </script>
219
219
 
220
- <div class="space-y-6">
220
+ <div class="flex flex-col gap-6">
221
221
  <PageHeader title="Restaurant Waitlist" description="Manage persisted WaitlistRestaurant records and seating states.">
222
222
  <div class="flex gap-2">
223
223
  <Button variant="secondary" :loading="isLoading()" @click="loadRecords">
@@ -16,7 +16,7 @@ defineClientPayload({ blogUrl })
16
16
 
17
17
  <header class="flex flex-col gap-4 md:flex-row md:items-end md:justify-between pb-5 border-b border-neutral-200 dark:border-neutral-800">
18
18
  <div>
19
- <h1 class="font-semibold text-2xl tracking-tight">Blog</h1>
19
+ <h1 class="font-bold text-2xl tracking-tight">Blog</h1>
20
20
  <p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">
21
21
  Posts are markdown files in <code class="px-1 py-0.5 text-xs bg-neutral-200 dark:bg-neutral-800 rounded">content/blog</code>. Saving writes the file. Commit and push to publish.
22
22
  </p>
@@ -50,7 +50,7 @@ useEventListener('craft:ready', ensureCraftNativeSidebarMarker)
50
50
  @else
51
51
  <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
52
52
  <div>
53
- <h1 class="font-semibold text-2xl text-neutral-900 dark:text-white">{{ pageTitle }}</h1>
53
+ <h1 class="font-bold text-2xl text-neutral-900 dark:text-white">{{ pageTitle }}</h1>
54
54
  @if(pageDescription)
55
55
  <p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">{{ pageDescription }}</p>
56
56
  @endif
@@ -11,7 +11,7 @@ import type {
11
11
  } from '../../../../functions/data'
12
12
  import { fetchDashboardData } from '../../../../functions/data'
13
13
  import type { ModelWriteCapabilities } from '../../../../functions/dashboard-model-record'
14
- import { deleteModelRecord, fetchModelCapabilities, modelRecordCreateHref, modelRecordEditHref, modelRecordHref } from '../../../../functions/dashboard-model-record'
14
+ import { deleteModelRecord, fetchModelCapabilities, modelDeleteNotice, modelDeleteWarning, modelRecordCreateHref, modelRecordEditHref, modelRecordHref, NO_WRITES, userInviteHref } from '../../../../functions/dashboard-model-record'
15
15
  import { pushToast } from '../../../../functions/toasts'
16
16
 
17
17
  type DataRecord = DashboardActivity | DashboardSubscriber | DashboardTeam | DashboardUser
@@ -65,26 +65,34 @@ const metadata: Record<DataMode, { title: string, description: string, icon: str
65
65
  const page = derived(() => metadata[mode()])
66
66
 
67
67
  /**
68
- * The model behind each mode's rows, for the eye, pencil and trash. Activity
69
- * has none: an audit trail is read, never edited or deleted.
68
+ * The model behind each mode's rows, for the eye, pencil and trash. Which of
69
+ * the three a page offers comes from the model: Activity declares no write
70
+ * routes, so an audit entry can be opened and nothing more.
70
71
  */
71
- const MODEL_SLUGS: Partial<Record<DataMode, string>> = { users: 'user', teams: 'team', subscribers: 'subscriber' }
72
+ const MODEL_SLUGS: Record<DataMode, string> = { activity: 'activity', users: 'user', teams: 'team', subscribers: 'subscriber' }
72
73
  /** The row field an action names: "Edit Ava", "Delete ava@example.com". */
73
- const ACTION_LABEL_KEYS: Partial<Record<DataMode, string>> = { users: 'name', teams: 'name', subscribers: 'email' }
74
+ const ACTION_LABEL_KEYS: Record<DataMode, string> = { activity: 'description', users: 'name', teams: 'name', subscribers: 'email' }
74
75
 
75
76
  const modelSlug = derived(() => MODEL_SLUGS[mode()] ?? '')
76
- const capabilities = state<ModelWriteCapabilities>({ create: false, update: false, destroy: false })
77
+ const capabilities = state<ModelWriteCapabilities>(NO_WRITES)
77
78
  const confirmingDelete = state<Record<string, any> | null>(null)
78
79
  const working = state(false)
79
80
 
81
+ /**
82
+ * An anonymized account keeps its eye and loses its pencil and trash: its
83
+ * name and email are gone, so there is nothing to edit, and deleting it again
84
+ * would only anonymize what already is.
85
+ */
86
+ const NOT_ANONYMIZED = { key: 'anonymized', equals: false }
87
+
80
88
  /** View always; edit and delete only where the model's API allows them. */
81
89
  const rowActions = derived(() => {
82
90
  if (!modelSlug())
83
91
  return []
84
92
  return [
85
93
  { action: 'view', label: 'View' },
86
- ...(capabilities().update ? [{ action: 'edit', label: 'Edit' }] : []),
87
- ...(capabilities().destroy ? [{ action: 'delete', label: 'Delete' }] : []),
94
+ ...(capabilities().update ? [{ action: 'edit', label: 'Edit', when: NOT_ANONYMIZED }] : []),
95
+ ...(capabilities().destroy ? [{ action: 'delete', label: 'Delete', when: NOT_ANONYMIZED }] : []),
88
96
  ]
89
97
  })
90
98
  const actionLabelKey = derived(() => ACTION_LABEL_KEYS[mode()] ?? 'id')
@@ -92,12 +100,12 @@ const deleteTitle = derived(() => `Delete this ${page().one}?`)
92
100
  const deleteDescription = derived(() => {
93
101
  const row = confirmingDelete()
94
102
  const name = row ? String(row[actionLabelKey()] ?? row.id) : ''
95
- return `${name} will be removed through the model, so soft deletes and observers apply.`
103
+ return modelDeleteWarning(name, capabilities().anonymize)
96
104
  })
97
105
 
98
106
  async function loadCapabilities(): Promise<void> {
99
107
  if (!modelSlug()) {
100
- capabilities.set({ create: false, update: false, destroy: false })
108
+ capabilities.set(NO_WRITES)
101
109
  return
102
110
  }
103
111
  try {
@@ -105,17 +113,22 @@ async function loadCapabilities(): Promise<void> {
105
113
  }
106
114
  catch {
107
115
  // Without them the page still lists and views; it offers no writes.
108
- capabilities.set({ create: false, update: false, destroy: false })
116
+ capabilities.set(NO_WRITES)
109
117
  }
110
118
  }
111
119
 
112
- /** Offered where the model can be created from the dashboard at all. */
113
- const canCreate = derived(() => Boolean(modelSlug()) && capabilities().create)
114
- const createLabel = derived(() => `Create ${page().one}`)
120
+ /**
121
+ * Offered where the model can be added to from the dashboard at all. A user
122
+ * is invited, not typed in, and the button says so: pressing it leads to an
123
+ * email being sent, which "Create" would not have told anyone.
124
+ */
125
+ const canInvite = derived(() => Boolean(modelSlug()) && capabilities().invite)
126
+ const canCreate = derived(() => Boolean(modelSlug()) && (capabilities().create || capabilities().invite))
127
+ const createLabel = derived(() => canInvite() ? `Invite ${page().one}` : `Create ${page().one}`)
115
128
 
116
- // The create page comes back here, like the record's own pages.
129
+ // The create and invite pages come back here, like the record's own pages.
117
130
  function createRecord(): void {
118
- navigate(modelRecordCreateHref(modelSlug(), `/data/${mode()}`))
131
+ navigate(canInvite() ? userInviteHref(`/data/${mode()}`) : modelRecordCreateHref(modelSlug(), `/data/${mode()}`))
119
132
  }
120
133
 
121
134
  /** The eye and the pencil each open a page of the record's own, which comes back here. */
@@ -134,8 +147,9 @@ async function confirmDelete(): Promise<void> {
134
147
  return
135
148
  working.set(true)
136
149
  try {
137
- await deleteModelRecord(modelSlug(), row.id)
138
- pushToast('success', `${capitalize(page().one)} ${row[actionLabelKey()] ?? row.id} deleted`)
150
+ const outcome = await deleteModelRecord(modelSlug(), row.id)
151
+ const notice = modelDeleteNotice(`${capitalize(page().one)} ${row[actionLabelKey()] ?? row.id}`, outcome)
152
+ pushToast('success', notice.title, { detail: notice.detail })
139
153
  confirmingDelete.set(null)
140
154
  await loadRecords()
141
155
  }
@@ -195,6 +209,7 @@ const TONES = {
195
209
  positive: 'text-green-700 dark:text-green-300 bg-green-50 dark:bg-green-950/40',
196
210
  negative: 'text-red-700 dark:text-red-300 bg-red-50 dark:bg-red-950/40',
197
211
  pending: 'text-amber-700 dark:text-amber-300 bg-amber-50 dark:bg-amber-950/40',
212
+ muted: 'text-neutral-600 dark:text-neutral-300 bg-neutral-100 dark:bg-white/10',
198
213
  }
199
214
 
200
215
  function capitalize(value: string): string {
@@ -237,11 +252,17 @@ const recordColumns = derived(() => COLUMNS_BY_MODE[mode()] ?? COLUMNS_BY_MODE.a
237
252
 
238
253
  const recordRows = derived(() => filteredRecords().map((record) => {
239
254
  const row = record as Record<string, any>
255
+ // An erased account is stored as "[erased]" and "erased-13". The table names
256
+ // it for what it is, and "Unverified" would be a strange thing to say of it.
257
+ const anonymized = mode() === 'users' && row.anonymized === true
240
258
  return {
241
259
  ...row,
260
+ ...(anonymized && { name: 'Anonymized user', email: 'Name and email removed' }),
261
+ // On every row, of every mode: the pencil and trash ask for exactly false.
262
+ anonymized,
242
263
  subject: mode() === 'activity' ? formatSubject(record as DashboardActivity) : undefined,
243
- verificationTone: row.emailVerifiedAt ? 'positive' : 'pending',
244
- verificationLabel: row.emailVerifiedAt ? 'Verified' : 'Unverified',
264
+ verificationTone: anonymized ? 'muted' : row.emailVerifiedAt ? 'positive' : 'pending',
265
+ verificationLabel: anonymized ? 'Anonymized' : row.emailVerifiedAt ? 'Verified' : 'Unverified',
245
266
  statusTone: statusTone(String(row.status ?? '')),
246
267
  statusLabel: capitalize(String(row.status ?? '')),
247
268
  sourceLabel: capitalize(String(row.source ?? '')),
@@ -294,7 +315,7 @@ onMount(() => {
294
315
  <div class="flex flex-col gap-6">
295
316
  <header class="flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between">
296
317
  <div>
297
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">{{ page().title }}</h1>
318
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">{{ page().title }}</h1>
298
319
  <p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">{{ page().description }}</p>
299
320
  </div>
300
321
  <div class="flex flex-none gap-2 items-center">
@@ -303,7 +324,7 @@ onMount(() => {
303
324
  Refresh
304
325
  </Button>
305
326
  <Button :if="canCreate()" variant="primary" @click="createRecord">
306
- <span aria-hidden="true" class="h-4 w-4 i-hugeicons-add-01"></span>
327
+ <span aria-hidden="true" :class="canInvite() ? 'h-4 w-4 i-hugeicons-mail-send-01' : 'h-4 w-4 i-hugeicons-add-01'"></span>
307
328
  {{ createLabel() }}
308
329
  </Button>
309
330
  </div>
@@ -0,0 +1,107 @@
1
+ <script client>
2
+ // The page that adds a user (`/data/users/invite`), where the Invite user
3
+ // button on the Users list leads. A user is invited, not typed in: the
4
+ // account is created and its holder is mailed a link to choose their own
5
+ // password, so nobody else ever knows it. Laid out like the other record
6
+ // pages: a breadcrumb back to the list, the title, one card.
7
+ import { useNavigation } from '@stacksjs/defaults/views/dashboard/composables/useNavigation'
8
+ import { inviteUser, modelRecordBackHref, modelRecordHref } from '../../../../functions/dashboard-model-record'
9
+ import { pushToast } from '../../../../functions/toasts'
10
+
11
+ const navigation = useNavigation()
12
+ const name = state('')
13
+ const email = state('')
14
+ const sending = state(false)
15
+ const sendError = state('')
16
+ const sendErrors = state<Record<string, string[]>>({})
17
+
18
+ const from = navigation.urlQuery('from')
19
+ const listHref = derived(() => from && modelRecordBackHref('user', from) === from ? from : '/data/users')
20
+
21
+ function fieldError(field: string): string {
22
+ return sendErrors()[field]?.[0] || ''
23
+ }
24
+
25
+ async function send(): Promise<void> {
26
+ if (sending())
27
+ return
28
+ sending.set(true)
29
+ sendError.set('')
30
+ sendErrors.set({})
31
+ try {
32
+ const result = await inviteUser(name(), email())
33
+ if (!result.ok) {
34
+ sendError.set(result.error)
35
+ sendErrors.set(result.errors)
36
+ return
37
+ }
38
+ pushToast('success', 'Invitation sent', { detail: `${result.email} has ${result.expiresInDays} days to choose a password.` })
39
+ navigate(modelRecordHref('user', result.id, listHref()))
40
+ }
41
+ finally {
42
+ sending.set(false)
43
+ }
44
+ }
45
+
46
+ function cancel(): void {
47
+ if (!sending())
48
+ navigate(listHref())
49
+ }
50
+ </script>
51
+
52
+ <div class="flex flex-col gap-6">
53
+ <header class="min-w-0">
54
+ <nav aria-label="Breadcrumb" class="flex gap-2 items-center mb-2 text-neutral-500 text-sm dark:text-neutral-400">
55
+ <StxLink :to="listHref()" class="font-medium hover:text-blue-600 dark:hover:text-blue-400">Users</StxLink>
56
+ <span aria-hidden="true" class="h-4 w-4 i-hugeicons-arrow-right-01"></span>
57
+ <span aria-current="page">Invite</span>
58
+ </nav>
59
+ <h1 class="font-bold text-3xl text-neutral-900 tracking-tight truncate dark:text-white">Invite User</h1>
60
+ </header>
61
+
62
+ <form id="user-invite-form" class="flex flex-col gap-6" @submit.prevent="send">
63
+ <div :if="sendError()" role="alert" class="px-4 py-3 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/40 border border-red-200 rounded-lg dark:border-red-900">
64
+ {{ sendError() }}
65
+ </div>
66
+
67
+ <div class="max-w-3xl">
68
+ <Card padding="none">
69
+ <div class="px-6 py-4 border-b border-neutral-200 dark:border-neutral-700">
70
+ <h2 class="font-semibold text-base text-neutral-900 dark:text-white">User Details</h2>
71
+ <p class="mt-1 text-neutral-500 text-xs dark:text-neutral-400">We create the account and email this person a link to choose their own password. The link works for 7 days.</p>
72
+ </div>
73
+ <div class="flex flex-col gap-5 p-6">
74
+ <Input
75
+ name="name"
76
+ :value="name()"
77
+ type="text"
78
+ label="Name"
79
+ ariaLabel="Name"
80
+ autocomplete="off"
81
+ :required="true"
82
+ :disabled="sending()"
83
+ :error="fieldError('name')"
84
+ @update:value="name.set($event)"
85
+ />
86
+ <Input
87
+ name="email"
88
+ :value="email()"
89
+ type="email"
90
+ label="Email"
91
+ ariaLabel="Email"
92
+ autocomplete="off"
93
+ :required="true"
94
+ :disabled="sending()"
95
+ :error="fieldError('email')"
96
+ @update:value="email.set($event)"
97
+ />
98
+ </div>
99
+ </Card>
100
+ </div>
101
+
102
+ <div class="flex gap-3 items-center">
103
+ <Button type="submit" variant="primary" :loading="sending()">Send invitation</Button>
104
+ <Button variant="secondary" :disabled="sending()" @click="cancel">Cancel</Button>
105
+ </div>
106
+ </form>
107
+ </div>
@@ -100,7 +100,7 @@ onMount(() => {
100
100
  <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
101
101
  <div>
102
102
  <div class="flex gap-4 items-center">
103
- <h1 class="font-bold text-gray-900 text-xl dark:text-white">Captured Mail</h1>
103
+ <h1 class="font-bold text-2xl text-gray-900 dark:text-white">Captured Mail</h1>
104
104
  <EmailNavigation active="captured" />
105
105
  </div>
106
106
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">
@@ -265,7 +265,7 @@ onDestroy(() => {
265
265
 
266
266
  <header class="flex gap-4 items-start justify-between mt-6">
267
267
  <div>
268
- <h1 class="font-semibold leading-6 text-base text-gray-900 dark:text-neutral-100">Mail Activity</h1>
268
+ <h1 class="font-bold text-2xl text-gray-900 dark:text-neutral-100">Mail Activity</h1>
269
269
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">
270
270
  Deterministic inbound and outbound activity for {{ activity.mailbox || 'the configured mailbox' }}.
271
271
  </p>
@@ -241,7 +241,7 @@ onMount(() => {
241
241
  <header class="px-4 py-3 bg-white dark:bg-neutral-700 border-b border-gray-200 dark:border-neutral-600">
242
242
  <div class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
243
243
  <div class="flex flex-col gap-2 sm:flex-row sm:gap-4 sm:items-center min-w-0">
244
- <h1 class="font-bold text-gray-900 text-xl dark:text-white">Inbox</h1>
244
+ <h1 class="font-bold text-2xl text-gray-900 dark:text-white">Inbox</h1>
245
245
  <EmailNavigation active="inbox" />
246
246
  </div>
247
247
  <div class="flex gap-2 items-center">
@@ -27,13 +27,13 @@ function formatDate(value: string): string {
27
27
 
28
28
  <section :if="message()" aria-label="Selected message" class="flex flex-col w-full md:w-3/5 bg-white dark:bg-neutral-700">
29
29
  <div class="flex items-center justify-between px-4 py-2 border-b border-gray-200 dark:border-neutral-600">
30
- <div class="flex items-center space-x-2 min-w-0">
30
+ <div class="flex gap-2 items-center min-w-0">
31
31
  <Button variant="ghost" iconOnly ariaLabel="Close message" @click="emit('close')">
32
32
  <span class="block h-5 w-5 i-hugeicons-arrow-left-02"></span>
33
33
  </Button>
34
34
  <h2 class="font-medium text-gray-900 text-lg truncate dark:text-white">{{ message()?.subject }}</h2>
35
35
  </div>
36
- <div class="flex space-x-2">
36
+ <div class="flex gap-2">
37
37
  <Button variant="ghost" iconOnly :ariaLabel="message()?.read ? 'Mark as unread' : 'Mark as read'" @click="emit('toggle-read')">
38
38
  <span :class="'block h-5 w-5 ' + (message()?.read ? 'i-hugeicons-mail-02' : 'i-hugeicons-mail-open-01')"></span>
39
39
  </Button>
@@ -211,7 +211,7 @@
211
211
  />
212
212
  </div>
213
213
 
214
- <div :show="isLabelsSection" class="space-y-6">
214
+ <div :show="isLabelsSection" class="flex flex-col gap-6">
215
215
  <EmailSettingsList
216
216
  title="Mailbox Labels"
217
217
  description="Create labels that integrations can apply to incoming conversations."
@@ -47,10 +47,15 @@ const allQuickLinks = [
47
47
  * Cards without a `section` are always offered. A card with one waits for the
48
48
  * server to say that section exists, so the home page never links to a
49
49
  * section the sidebar has hidden and whose pages cannot load.
50
+ *
51
+ * Waits, as in `=== true`: until the answer arrives nothing is known, and
52
+ * "not false" showed the Blog and Commerce cards for a moment on every load -
53
+ * long enough for their links to be prefetched and answer 404 in an app with
54
+ * both features off.
50
55
  */
51
56
  function quickLinks() {
52
57
  const available = dashboard.sections.value
53
- return allQuickLinks.filter(link => !link.section || available[link.section] !== false)
58
+ return allQuickLinks.filter(link => !link.section || available[link.section] === true)
54
59
  }
55
60
 
56
61
  /** Orders are part of the feed only with commerce on, so they are named only then. */
@@ -118,7 +118,7 @@ onMount(() => {
118
118
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
119
119
  <div>
120
120
  <div class="flex gap-2 items-center">
121
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Cloud infrastructure</h1>
121
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">Cloud infrastructure</h1>
122
122
  <CloudStatusBadge :status="project().provider === 'not configured' ? 'inactive' : 'configured'" />
123
123
  </div>
124
124
  <p class="mt-1 max-w-2xl text-neutral-500 text-sm dark:text-neutral-400">Configuration from config/cloud.ts kept separate from deployment state persisted by ts-cloud.</p>
@@ -153,7 +153,7 @@ onMount(() => {
153
153
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
154
154
  <div>
155
155
  <div class="flex gap-2 items-center">
156
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">DNS</h1>
156
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">DNS</h1>
157
157
  <CloudStatusBadge :status="domains().length || records().length ? 'configured' : 'inactive'" />
158
158
  </div>
159
159
  <p class="mt-1 max-w-2xl text-neutral-500 text-sm dark:text-neutral-400">DNS declarations from config/dns.ts and the project domain from config/cloud.ts.</p>
@@ -147,7 +147,7 @@ onMount(() => {
147
147
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
148
148
  <div>
149
149
  <div class="flex gap-2 items-center">
150
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">System health</h1>
150
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">System health</h1>
151
151
  <span :class="overallClass()">
152
152
  <span :class="'h-1.5 w-1.5 rounded-full ' + (status() === 'healthy' ? 'bg-green-500' : status() === 'degraded' ? 'bg-red-500' : 'bg-neutral-400')"></span>
153
153
  {{ overallLabel() }}
@@ -275,7 +275,7 @@ onMount(() => {
275
275
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
276
276
  <div>
277
277
  <div class="flex gap-2 items-center">
278
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">System insights</h1>
278
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">System insights</h1>
279
279
  <span class="inline-flex gap-1.5 items-center px-2 py-1 font-semibold text-[11px] text-neutral-600 dark:text-neutral-300 bg-neutral-100 dark:bg-neutral-800 rounded-full">
280
280
  <span class="h-1.5 w-1.5 bg-blue-500 rounded-full"></span>
281
281
  current snapshot
@@ -208,7 +208,7 @@ onDestroy(() => {
208
208
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
209
209
  <div>
210
210
  <div class="flex gap-2 items-center">
211
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">System logs</h1>
211
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">System logs</h1>
212
212
  <CloudStatusBadge :status="loadError() ? 'attention' : 'configured'" />
213
213
  </div>
214
214
  <p class="mt-1 max-w-2xl text-neutral-500 text-sm dark:text-neutral-400">Persisted Log model records. Counts, filters, and details come from the same database query.</p>
@@ -155,7 +155,7 @@ onMount(() => {
155
155
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
156
156
  <div>
157
157
  <div class="flex gap-2 items-center">
158
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Mailboxes</h1>
158
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">Mailboxes</h1>
159
159
  <CloudStatusBadge :status="server().enabled ? 'configured' : 'inactive'" />
160
160
  </div>
161
161
  <p class="mt-1 max-w-2xl text-neutral-500 text-sm dark:text-neutral-400">The mailboxes and mail server set up in config/email.ts. This page shows your settings, not whether mail is being delivered.</p>
@@ -99,7 +99,7 @@ onMount(() => {
99
99
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
100
100
  <div>
101
101
  <div class="flex gap-2 items-center">
102
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">{{ title() }}</h1>
102
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">{{ title() }}</h1>
103
103
  <CloudStatusBadge :if="detail()" :status="status()" />
104
104
  </div>
105
105
  <p class="mt-1 text-neutral-500 text-sm dark:text-neutral-400">{{ detail() ? kindLabel() + ' from the current cloud snapshot.' : kindLabel() }}</p>
@@ -129,7 +129,7 @@ onMount(() => {
129
129
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
130
130
  <div>
131
131
  <div class="flex gap-2 items-center">
132
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Serverless infrastructure</h1>
132
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">Serverless infrastructure</h1>
133
133
  <CloudStatusBadge :status="services().length > 0 ? 'configured' : 'inactive'" />
134
134
  </div>
135
135
  <p class="mt-1 max-w-2xl text-neutral-500 text-sm dark:text-neutral-400">Services and relationships derived only from environment application manifests in config/cloud.ts.</p>
@@ -214,7 +214,7 @@ onMount(() => {
214
214
  <header class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
215
215
  <div>
216
216
  <div class="flex gap-2 items-center">
217
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Servers</h1>
217
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">Servers</h1>
218
218
  <CloudStatusBadge :status="project().mode === 'server' ? 'configured' : 'inactive'" />
219
219
  </div>
220
220
  <p class="mt-1 max-w-2xl text-neutral-500 text-sm dark:text-neutral-400">Compute declarations from config/cloud.ts and deployment state recorded by ts-cloud.</p>
@@ -98,7 +98,7 @@ onMount(() => {
98
98
  <span class="h-4 w-4 i-hugeicons-arrow-left-02"></span>
99
99
  Jobs
100
100
  </StxLink>
101
- <h1 class="font-semibold text-2xl text-neutral-900 tracking-tight dark:text-white">Job details</h1>
101
+ <h1 class="font-bold text-2xl text-neutral-900 tracking-tight dark:text-white">Job details</h1>
102
102
  <p class="mt-1 font-mono text-neutral-500 text-sm dark:text-neutral-400">{{ jobId() }}</p>
103
103
  </div>
104
104
  <Button :if="canRetry()" :disabled="isRetrying()" variant="primary" @click="handleRetry">
@@ -74,8 +74,8 @@ function attemptsLabel(job: DashboardJob): string {
74
74
  <td class="px-4 py-3 text-gray-500 text-right text-sm whitespace-nowrap dark:text-neutral-300">{{ formatDate(job.created_at) }}</td>
75
75
  <td class="px-4 py-3 text-right">
76
76
  <div class="inline-flex gap-3 items-center">
77
- <StxLink :to="'/jobs/' + encodeURIComponent(job.id)" class="font-medium text-neutral-600 text-sm dark:text-neutral-300 hover:text-blue-600 dark:hover:text-blue-400">
78
- View
77
+ <StxLink :to="'/jobs/' + encodeURIComponent(job.id)" :aria-label="'View job ' + job.name" :title="'View job ' + job.name" class="inline-flex items-center justify-center h-7 w-7 hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded-md">
78
+ <span aria-hidden="true" class="block h-4 w-4 text-neutral-500 dark:text-neutral-400 i-hugeicons-view"></span>
79
79
  </StxLink>
80
80
  <Button :if="job.status === 'failed'" size="sm" @click="emit('retry', job.id)">
81
81
  Retry
@@ -374,7 +374,7 @@
374
374
  <div :if="board && !loading">
375
375
  <header class="flex items-start justify-between mb-6">
376
376
  <div>
377
- <h1 class="font-semibold text-2xl text-zinc-900 dark:text-zinc-100" :text="board.name"></h1>
377
+ <h1 class="font-bold text-2xl text-zinc-900 dark:text-zinc-100" :text="board.name"></h1>
378
378
  <p :if="board.description" class="mt-1 text-sm text-zinc-500" :text="board.description"></p>
379
379
  <p class="mt-2 text-xs text-zinc-500 dark:text-zinc-400">
380
380
  <span :text="columns.length + ' columns'"></span>
@@ -162,7 +162,7 @@
162
162
  <div :if="canView">
163
163
  <header class="flex items-center justify-between mb-6">
164
164
  <div>
165
- <h1 class="font-semibold text-2xl text-zinc-900 dark:text-zinc-100">Boards</h1>
165
+ <h1 class="font-bold text-2xl text-zinc-900 dark:text-zinc-100">Boards</h1>
166
166
  <p class="mt-1 text-sm text-zinc-500">Internal project-management boards with native card and column reordering.</p>
167
167
  </div>
168
168
  <Button @click="openCreate()">