@stacksjs/defaults 0.75.539 → 0.75.542
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/AGENTS.md +2 -0
- package/ai/skills/stacks-actions/SKILL.md +1 -1
- package/ai/skills/stacks-auth/SKILL.md +8 -1
- package/ai/skills/stacks-dashboard/SKILL.md +196 -3
- package/ai/skills/stacks-dependencies/SKILL.md +46 -0
- package/ai/skills/stacks-development/SKILL.md +1 -1
- package/ai/skills/stacks-flow/SKILL.md +7 -0
- package/ai/skills/stacks-hq/SKILL.md +146 -0
- package/ai/skills/stacks-models/SKILL.md +21 -3
- package/ai/skills/stacks-native/CATALOG.md +22 -9
- package/ai/skills/stacks-new-app/SKILL.md +175 -0
- package/ai/skills/stacks-repl/SKILL.md +76 -43
- package/ai/skills/stacks-stx/SKILL.md +6 -2
- package/ai/skills/stacks-upstream/SKILL.md +188 -0
- package/ai/skills/stacks-writing-for-agents/SKILL.md +1 -1
- package/app/Actions/Dashboard/Data/UserIndexAction.ts +20 -2
- package/app/Actions/Dashboard/Models/ModelDestroyAction.ts +48 -12
- package/app/Actions/Dashboard/Models/ModelOptionsAction.ts +103 -0
- package/app/Actions/Dashboard/Models/ModelRelatedAction.ts +42 -0
- package/app/Actions/Dashboard/Models/ModelShowAction.ts +75 -12
- package/app/Actions/Dashboard/Models/ModelStoreAction.ts +7 -1
- package/app/Actions/Dashboard/Models/ModelUpdateAction.ts +16 -2
- package/app/Actions/Dashboard/Models/model-destroy.ts +75 -0
- package/app/Actions/Dashboard/Models/model-options.ts +56 -0
- package/app/Actions/Dashboard/Models/model-related.ts +202 -0
- package/app/Actions/Dashboard/Models/model-relations.ts +172 -0
- package/app/Actions/Dashboard/Models/model-write.ts +240 -51
- package/app/Actions/Dashboard/Users/UserInviteAction.ts +50 -0
- package/app/Actions/Dashboard/Users/user-invitation.ts +110 -0
- package/app/Models/Activity.ts +4 -0
- package/app/Models/AnalyticsEvent.ts +4 -0
- package/app/Models/Automation.ts +4 -0
- package/app/Models/AutomationRun.ts +4 -0
- package/app/Models/Board.ts +4 -1
- package/app/Models/BoardColumn.ts +4 -1
- package/app/Models/Campaign.ts +4 -0
- package/app/Models/CampaignSend.ts +4 -0
- package/app/Models/CampaignVariant.ts +4 -0
- package/app/Models/Card.ts +4 -1
- package/app/Models/CardAttachment.ts +4 -0
- package/app/Models/CommunicationSuppression.ts +4 -0
- package/app/Models/ConsentEvent.ts +4 -0
- package/app/Models/Deployment.ts +1 -0
- package/app/Models/EmailList.ts +4 -0
- package/app/Models/EmailListSubscriber.ts +4 -0
- package/app/Models/Error.ts +4 -0
- package/app/Models/FailedJob.ts +4 -0
- package/app/Models/FeedbackToken.ts +4 -0
- package/app/Models/GdprRequest.ts +4 -0
- package/app/Models/Job.ts +4 -0
- package/app/Models/Log.ts +4 -0
- package/app/Models/MagicLinkToken.ts +4 -0
- package/app/Models/MailPreference.ts +4 -0
- package/app/Models/Notification.ts +4 -0
- package/app/Models/NotificationDelivery.ts +4 -0
- package/app/Models/PersonalAccessToken.ts +4 -0
- package/app/Models/QueryLog.ts +4 -0
- package/app/Models/Referral.ts +4 -0
- package/app/Models/Release.ts +1 -0
- package/app/Models/Request.ts +4 -0
- package/app/Models/SenderDomain.ts +4 -0
- package/app/Models/Site.ts +1 -0
- package/app/Models/SiteDomain.ts +4 -0
- package/app/Models/SocialPost.ts +4 -0
- package/app/Models/StorageItemTask.ts +4 -1
- package/app/Models/Subscriber.ts +4 -0
- package/app/Models/Subscription.ts +4 -0
- package/app/Models/Team.ts +1 -0
- package/app/Models/TeamInvitation.ts +1 -0
- package/app/Models/TeamMember.ts +1 -0
- package/app/Models/UsageEvent.ts +4 -0
- package/app/Models/User.ts +15 -3
- package/functions/dashboard-model-record.test.ts +276 -18
- package/functions/dashboard-model-record.ts +412 -55
- package/functions/data.ts +2 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +5 -5
- package/resources/components/Dashboard/Analytics/AnalyticsHub.stx +1 -1
- package/resources/components/Dashboard/Analytics/CampaignAnalytics.stx +1 -1
- package/resources/components/Dashboard/Analytics/EventAnalytics.stx +1 -1
- package/resources/components/Dashboard/Analytics/SalesAnalytics.stx +1 -1
- package/resources/components/Dashboard/Analytics/WebAnalyticsBreakdown.stx +1 -1
- package/resources/components/Dashboard/App/RequestsOverview.stx +1 -1
- package/resources/components/Dashboard/App/SourceInventory.stx +1 -1
- package/resources/components/Dashboard/Auth/AccessTokens.stx +1 -1
- package/resources/components/Dashboard/Buddy/BuddyAssistant.stx +1 -1
- package/resources/components/Dashboard/Ci/CiDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryPagination.stx +1 -1
- package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +1 -1
- package/resources/components/Dashboard/Content/BlogDashboard.stx +1 -1
- package/resources/components/Dashboard/DashboardLayout.stx +1 -1
- package/resources/components/Dashboard/Data/DataRecords.stx +43 -22
- package/resources/components/Dashboard/Data/UserInvite.stx +107 -0
- package/resources/components/Dashboard/Email/CapturedMailDashboard.stx +1 -1
- package/resources/components/Dashboard/Email/EmailActivityDashboard.stx +1 -1
- package/resources/components/Dashboard/Email/InboxDashboard.stx +1 -1
- package/resources/components/Dashboard/Email/InboxMessageDetail.stx +2 -2
- package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +1 -1
- package/resources/components/Dashboard/Home/DashboardHome.stx +6 -1
- package/resources/components/Dashboard/Infrastructure/CloudDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/HealthDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/InsightsDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/ServerDetailsDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/ServerlessDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -1
- package/resources/components/Dashboard/Jobs/JobDetail.stx +1 -1
- package/resources/components/Dashboard/Jobs/JobTable.stx +2 -2
- package/resources/components/Dashboard/Kanban/KanbanBoardDashboard.stx +1 -1
- package/resources/components/Dashboard/Kanban/KanbanBoardsDashboard.stx +1 -1
- package/resources/components/Dashboard/Management/PermissionsDashboard.stx +1 -1
- package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +1 -1
- package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +1 -1
- package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +1 -1
- package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +1 -1
- package/resources/components/Dashboard/Models/ModelFieldInputs.stx +125 -0
- package/resources/components/Dashboard/Models/ModelRecordCreate.stx +24 -66
- package/resources/components/Dashboard/Models/ModelRecordDetail.stx +36 -8
- package/resources/components/Dashboard/Models/ModelRecordEdit.stx +36 -32
- package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +72 -28
- package/resources/components/Dashboard/Models/ModelRelatedPanels.stx +99 -0
- package/resources/components/Dashboard/Models/ModelRelationPicker.stx +247 -0
- package/resources/components/Dashboard/Models/ModelsOverview.stx +1 -1
- package/resources/components/Dashboard/Notifications/NotificationDeliveries.stx +1 -1
- package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +1 -1
- package/resources/components/Dashboard/Notifications/NotificationDeliveryOverview.stx +1 -1
- package/resources/components/Dashboard/Queries/QueryDashboard.stx +1 -1
- package/resources/components/Dashboard/Queries/QueryDetail.stx +1 -1
- package/resources/components/Dashboard/Queue/QueueDashboard.stx +1 -1
- package/resources/components/Dashboard/Realtime/RealtimeDashboard.stx +1 -1
- package/resources/components/Dashboard/Releases/ReleaseDashboard.stx +1 -1
- package/resources/components/Dashboard/Search/SearchEngineDashboard.stx +1 -1
- package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +1 -1
- package/resources/components/Dashboard/Settings/SettingsDashboard.stx +1 -1
- package/resources/components/Dashboard/Teams/TeamPeopleDashboard.stx +1 -1
- package/resources/components/Dashboard/UI/Drawer.stx +1 -1
- package/resources/components/Dashboard/UI/Input.stx +3 -2
- package/resources/components/Dashboard/UI/Modal.stx +1 -1
- package/resources/components/Dashboard/UI/Select.stx +8 -4
- package/resources/components/Dashboard/UI/Textarea.stx +18 -12
- package/resources/emails/password-reset.stx +3 -1
- package/routes/dashboard-api.ts +9 -0
- package/scaffold/config/analytics.ts +5 -3
- package/scaffold/resources/components/NextStep.stx +13 -0
- package/scaffold/resources/partials/head.stx +31 -0
- package/scaffold/resources/views/index.stx +23 -47
- package/scaffold/resources/views/layouts/default.stx +23 -0
- package/views/dashboard/data/users/invite.stx +8 -0
- package/views/dashboard/layouts/default.stx +21 -2
|
@@ -98,7 +98,7 @@ onMount(() => {
|
|
|
98
98
|
})
|
|
99
99
|
</script>
|
|
100
100
|
|
|
101
|
-
<div class="
|
|
101
|
+
<div class="flex flex-col gap-6">
|
|
102
102
|
<PageHeader title="Releases" description="Release model records and recorded download totals.">
|
|
103
103
|
<Button variant="secondary" :loading="isLoading()" @click="loadReleases">
|
|
104
104
|
<span :if="!isLoading()" class="h-4 w-4 i-hugeicons-refresh"></span>
|
|
@@ -34,7 +34,7 @@ async function refresh() {
|
|
|
34
34
|
onMount(() => { void refresh() })
|
|
35
35
|
</script>
|
|
36
36
|
|
|
37
|
-
<div class="
|
|
37
|
+
<div class="flex flex-col gap-6">
|
|
38
38
|
<PageHeader title="Search Engine" description="Configured search service and model indexing conventions.">
|
|
39
39
|
<Button variant="secondary" :loading="loading" @click="refresh">Refresh</Button>
|
|
40
40
|
</PageHeader>
|
|
@@ -297,7 +297,7 @@ async function saveSettings(): Promise<void> {
|
|
|
297
297
|
onMount(() => void loadSettings())
|
|
298
298
|
</script>
|
|
299
299
|
|
|
300
|
-
<div class="
|
|
300
|
+
<div class="flex flex-col gap-6">
|
|
301
301
|
<PageHeader
|
|
302
302
|
title="Mail Settings"
|
|
303
303
|
description="Configure the framework mail driver and its environment-backed credentials."
|
|
@@ -250,7 +250,7 @@ void loadFiles()
|
|
|
250
250
|
</div>
|
|
251
251
|
<div class="flex gap-2 items-center">
|
|
252
252
|
<Badge :if="isDirty()" variant="warning" size="sm">Unsaved changes</Badge>
|
|
253
|
-
<Badge variant="default" size="sm">{{ editableCount() }}
|
|
253
|
+
<Badge variant="default" size="sm">{{ editableCount() + ' editable' }}</Badge>
|
|
254
254
|
<Button variant="primary" size="sm" :disabled="saving() || editableCount() === 0 || !isDirty()" @click="save()">
|
|
255
255
|
{{ saving() ? 'Saving...' : 'Save changes' }}
|
|
256
256
|
</Button>
|
|
@@ -290,7 +290,7 @@ onMount(() => {
|
|
|
290
290
|
})
|
|
291
291
|
</script>
|
|
292
292
|
|
|
293
|
-
<div class="
|
|
293
|
+
<div class="flex flex-col gap-6 p-6">
|
|
294
294
|
<PageHeader
|
|
295
295
|
title="Team members"
|
|
296
296
|
:description="team() ? `Manage members and invitations for ${team()?.name}` : 'Manage team members and invitations'"
|
|
@@ -77,7 +77,7 @@ effect(() => {
|
|
|
77
77
|
role="dialog"
|
|
78
78
|
aria-modal="true"
|
|
79
79
|
:aria-label="liveTitle() || 'Drawer'"
|
|
80
|
-
class="fixed inset-0 z-[55] m-0 p-0 h-dvh max-h-none max-w-none
|
|
80
|
+
class="fixed inset-0 z-[55] m-0 p-0 h-dvh max-h-none max-w-none bg-transparent dashboard-drawer-dialog dashboard-modal-layer"
|
|
81
81
|
@cancel="handleCancel"
|
|
82
82
|
>
|
|
83
83
|
<div class="flex justify-end min-h-full" @click="handleBackdropClick">
|
|
@@ -82,6 +82,7 @@ function handleBlur(event: Event): void {
|
|
|
82
82
|
x-model="liveValue"
|
|
83
83
|
:placeholder="livePlaceholder()"
|
|
84
84
|
:aria-label="liveAriaLabel() || liveLabel() || null"
|
|
85
|
+
:aria-invalid="liveError() ? 'true' : null"
|
|
85
86
|
:autocomplete="liveAutocomplete() || null"
|
|
86
87
|
:name="liveName() || null"
|
|
87
88
|
class="{{ $slots.iconLeft ? 'pl-8' : '' }}"
|
|
@@ -95,6 +96,6 @@ function handleBlur(event: Event): void {
|
|
|
95
96
|
>
|
|
96
97
|
</div>
|
|
97
98
|
|
|
98
|
-
<p :if="liveError()" class="mt-1.5 text-red-600
|
|
99
|
-
<p :if="!liveError() && liveHint()" class="mt-1.5 text-
|
|
99
|
+
<p :if="liveError()" class="mt-1.5 text-[12px] text-red-600 dark:text-red-400" :text="liveError()"></p>
|
|
100
|
+
<p :if="!liveError() && liveHint()" class="mt-1.5 text-[12px] text-stone-500 dark:text-neutral-400" :text="liveHint()"></p>
|
|
100
101
|
</div>
|
|
@@ -111,7 +111,7 @@ effect(() => {
|
|
|
111
111
|
:role="liveRole()"
|
|
112
112
|
aria-modal="true"
|
|
113
113
|
:aria-label="liveAriaLabel() || liveTitle() || 'Dialog'"
|
|
114
|
-
class="fixed inset-0 overflow-y-auto z-[55] m-0 p-0 h-dvh max-h-none max-w-none
|
|
114
|
+
class="fixed inset-0 overflow-y-auto z-[55] m-0 p-0 h-dvh max-h-none max-w-none bg-transparent dashboard-modal-dialog dashboard-modal-layer"
|
|
115
115
|
@cancel="handleCancel"
|
|
116
116
|
>
|
|
117
117
|
<!-- Modal container -->
|
|
@@ -33,7 +33,10 @@ const sizeClasses: Record<SelectSize, string> = {
|
|
|
33
33
|
|
|
34
34
|
const selectId = derived(() => liveId() || generatedId)
|
|
35
35
|
const selectClass = derived(() => [
|
|
36
|
-
'w-full flex items-center justify-between gap-2 rounded-
|
|
36
|
+
'w-full flex items-center justify-between gap-2 rounded-lg border transition-all duration-150',
|
|
37
|
+
// Its own text colour: without one the chosen value took the page's muted
|
|
38
|
+
// colour and read as disabled beside an Input.
|
|
39
|
+
'text-stone-900 dark:text-neutral-100',
|
|
37
40
|
'focus:outline-none focus:ring-2 appearance-none pr-8',
|
|
38
41
|
sizeClasses[liveSize()] || sizeClasses.md,
|
|
39
42
|
liveError()
|
|
@@ -69,9 +72,9 @@ function handleChange(event: Event): void {
|
|
|
69
72
|
|
|
70
73
|
<div class="relative">
|
|
71
74
|
<template :if="liveLabel()">
|
|
72
|
-
<label :for="selectId()" class="block mb-1.5 font-medium text-[13px] text-
|
|
75
|
+
<label :for="selectId()" class="block mb-1.5 font-medium text-[13px] tracking-tight" :class="liveError() ? 'text-red-600 dark:text-red-400' : 'text-stone-600 dark:text-neutral-400'">
|
|
73
76
|
<span :text="liveLabel()"></span>
|
|
74
|
-
<span :if="liveRequired()" class="text-red-500">*</span>
|
|
77
|
+
<span :if="liveRequired()" class="ml-0.5 text-red-500">*</span>
|
|
75
78
|
</label>
|
|
76
79
|
</template>
|
|
77
80
|
|
|
@@ -81,6 +84,7 @@ function handleChange(event: Event): void {
|
|
|
81
84
|
:id="selectId()"
|
|
82
85
|
:name="liveName() || null"
|
|
83
86
|
:aria-label="liveAriaLabel() || liveLabel() || null"
|
|
87
|
+
:aria-invalid="liveError() ? 'true' : null"
|
|
84
88
|
x-model="liveValue"
|
|
85
89
|
:class="selectClass()"
|
|
86
90
|
@change="handleChange"
|
|
@@ -102,5 +106,5 @@ function handleChange(event: Event): void {
|
|
|
102
106
|
</div>
|
|
103
107
|
|
|
104
108
|
<p :if="liveError()" class="mt-1.5 text-[12px] text-red-600 dark:text-red-400" :text="liveError()"></p>
|
|
105
|
-
<p :if="!liveError() && liveHint()" class="mt-1.5 text-[12px] text-
|
|
109
|
+
<p :if="!liveError() && liveHint()" class="mt-1.5 text-[12px] text-stone-500 dark:text-neutral-400" :text="liveHint()"></p>
|
|
106
110
|
</div>
|
|
@@ -17,6 +17,8 @@ const liveName = useReactiveProp('name', '')
|
|
|
17
17
|
const liveId = useReactiveProp('id', '')
|
|
18
18
|
const liveAriaLabel = useReactiveProp('ariaLabel', '')
|
|
19
19
|
const liveClass = useReactiveProp('class', '')
|
|
20
|
+
// Code and structured text (JSON) read better in a fixed-width face.
|
|
21
|
+
const liveMonospace = useReactiveProp('monospace', false)
|
|
20
22
|
const emit = defineEmits(['update:value', 'input', 'change', 'blur'])
|
|
21
23
|
const generatedId = useId('textarea')
|
|
22
24
|
|
|
@@ -30,17 +32,20 @@ const resizeClasses: Record<TextareaResize, string> = {
|
|
|
30
32
|
const textareaId = derived(() => liveId() || generatedId)
|
|
31
33
|
const valueLength = derived(() => String(liveValue() || '').length)
|
|
32
34
|
const headerVisible = derived(() => Boolean(liveLabel() || (liveShowCount() && liveMaxLength())))
|
|
35
|
+
// The same surface, border, text size and states as Input and Select, so a
|
|
36
|
+
// form's fields read as one set.
|
|
33
37
|
const textareaClass = derived(() => [
|
|
34
|
-
'block w-full rounded-lg border px-3 py-2
|
|
35
|
-
'
|
|
36
|
-
'
|
|
38
|
+
'block w-full rounded-lg border px-3 py-2 transition-all duration-150',
|
|
39
|
+
'bg-white dark:bg-white/10',
|
|
40
|
+
'text-stone-900 dark:text-neutral-100',
|
|
41
|
+
'placeholder:text-stone-400 dark:placeholder:text-neutral-500',
|
|
42
|
+
'focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:ring-offset-0',
|
|
43
|
+
liveMonospace() ? 'font-mono text-[12px]' : 'text-[13px]',
|
|
37
44
|
resizeClasses[liveResize()] || resizeClasses.vertical,
|
|
38
45
|
liveError()
|
|
39
|
-
? 'border-red-
|
|
40
|
-
: 'border-
|
|
41
|
-
liveDisabled()
|
|
42
|
-
? 'cursor-not-allowed border-neutral-200 bg-neutral-100 text-neutral-400 dark:border-neutral-700 dark:bg-neutral-800'
|
|
43
|
-
: 'bg-white dark:bg-neutral-900',
|
|
46
|
+
? 'border-red-400/60 dark:border-red-500/60 focus:border-red-500 focus:ring-red-500/30'
|
|
47
|
+
: 'border-stone-200/80 dark:border-white/15 focus:border-blue-400 hover:border-stone-300 dark:hover:border-white/25',
|
|
48
|
+
liveDisabled() ? 'opacity-40 cursor-not-allowed bg-stone-50 dark:bg-white/5' : '',
|
|
44
49
|
liveClass(),
|
|
45
50
|
].join(' '))
|
|
46
51
|
const limitedCountLabel = derived(() => `${valueLength()}/${liveMaxLength()}`)
|
|
@@ -70,10 +75,11 @@ function handleBlur(event: Event): void {
|
|
|
70
75
|
<label
|
|
71
76
|
:if="liveLabel()"
|
|
72
77
|
:for="textareaId()"
|
|
73
|
-
class="block font-medium text-
|
|
78
|
+
class="block font-medium text-[13px] tracking-tight"
|
|
79
|
+
:class="liveError() ? 'text-red-600 dark:text-red-400' : 'text-stone-600 dark:text-neutral-400'"
|
|
74
80
|
>
|
|
75
81
|
<span :text="liveLabel()"></span>
|
|
76
|
-
<span :if="liveRequired()" class="text-red-500">*</span>
|
|
82
|
+
<span :if="liveRequired()" class="ml-0.5 text-red-500">*</span>
|
|
77
83
|
</label>
|
|
78
84
|
<span
|
|
79
85
|
:if="liveShowCount() && liveMaxLength()"
|
|
@@ -108,6 +114,6 @@ function handleBlur(event: Event): void {
|
|
|
108
114
|
></span>
|
|
109
115
|
</div>
|
|
110
116
|
|
|
111
|
-
<p :if="liveError()" class="mt-1.5 text-red-600
|
|
112
|
-
<p :if="!liveError() && liveHint()" class="mt-1.5 text-
|
|
117
|
+
<p :if="liveError()" class="mt-1.5 text-[12px] text-red-600 dark:text-red-400" :text="liveError()"></p>
|
|
118
|
+
<p :if="!liveError() && liveHint()" class="mt-1.5 text-[12px] text-stone-500 dark:text-neutral-400" :text="liveHint()"></p>
|
|
113
119
|
</div>
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
const appName = props.appName || 'Stacks'
|
|
5
5
|
const resetUrl = props.resetUrl || '#'
|
|
6
6
|
const expireMinutes = props.expireMinutes || 60
|
|
7
|
+
// "7 days" for an invitation, where minutes would be a sum to do.
|
|
8
|
+
const expiresIn = props.expiresIn || `${expireMinutes} minutes`
|
|
7
9
|
const primaryColor = props.primaryColor || '#3451b2'
|
|
8
10
|
// `purpose: 'setup'` is a first password for an account someone else created.
|
|
9
11
|
const setup = props.purpose === 'setup'
|
|
@@ -33,7 +35,7 @@ const year = props.year || new Date().getFullYear()
|
|
|
33
35
|
|
|
34
36
|
<EmailButton href="{{ resetUrl }}" bg="{{ primaryColor }}">{{ action }}</EmailButton>
|
|
35
37
|
|
|
36
|
-
<EmailText size="sm" color="#6b7280">This link will expire in <strong>{{
|
|
38
|
+
<EmailText size="sm" color="#6b7280">This link will expire in <strong>{{ expiresIn }}</strong>.</EmailText>
|
|
37
39
|
<EmailText size="sm" color="#6b7280">{{ ignore }}</EmailText>
|
|
38
40
|
|
|
39
41
|
<EmailDivider />
|
package/routes/dashboard-api.ts
CHANGED
|
@@ -221,6 +221,9 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
|
|
|
221
221
|
guard(route.get('/operations/audit', 'Actions/Dashboard/Operations/AuditIndexAction'))
|
|
222
222
|
guard(route.get('/data/activity', 'Actions/Dashboard/Data/ActivityIndexAction'))
|
|
223
223
|
guard(route.get('/data/users', 'Actions/Dashboard/Data/UserIndexAction'))
|
|
224
|
+
// Adding a user: the account is created and its holder is mailed a link to
|
|
225
|
+
// choose their password, since no form can supply one.
|
|
226
|
+
guard(route.post('/users/invitations', 'Actions/Dashboard/Users/UserInviteAction'))
|
|
224
227
|
guard(route.get('/data/teams', 'Actions/Dashboard/Data/TeamIndexAction'))
|
|
225
228
|
guard(route.get('/data/subscribers', 'Actions/Dashboard/Data/SubscriberIndexAction'))
|
|
226
229
|
guard(route.get('/teams/{id}/people', 'Actions/Dashboard/Teams/TeamPeopleIndexAction'))
|
|
@@ -509,6 +512,12 @@ route.group({ prefix: '/api/dashboard', apiResponse: true }, () => {
|
|
|
509
512
|
// server-side. ORM path first, raw SQLite fallback if no model file
|
|
510
513
|
// matches the slug.
|
|
511
514
|
guard(route.get('/models/{slug}', 'Actions/Dashboard/Models/ModelShowAction'))
|
|
515
|
+
// A model's records by name, for choosing one in a form: the picker behind
|
|
516
|
+
// every `belongsTo` field. Light on purpose, since it answers each keystroke.
|
|
517
|
+
guard(route.get('/models/{slug}/options', 'Actions/Dashboard/Models/ModelOptionsAction'))
|
|
518
|
+
// The records that point at one record: a team's members, a user's teams.
|
|
519
|
+
// From the model's own `hasMany` and `hasOne`, for the panels of its page.
|
|
520
|
+
guard(route.get('/models/{slug}/{id}/related', 'Actions/Dashboard/Models/ModelRelatedAction'))
|
|
512
521
|
|
|
513
522
|
// Row writes from the same page. Guarded like every other mutating
|
|
514
523
|
// dashboard endpoint; models with no ORM file stay read-only, which the
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AnalyticsConfig } from '@stacksjs/types'
|
|
2
|
+
import { env } from '@stacksjs/env'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* AnalyticsHQ is Stacks' first-party analytics driver.
|
|
5
|
-
* your AnalyticsHQ app to enable it. An empty site id emits
|
|
5
|
+
* AnalyticsHQ is Stacks' first-party analytics driver. Set `ANALYTICSHQ_SITE_ID`
|
|
6
|
+
* to the site id from your AnalyticsHQ app to enable it. An empty site id emits
|
|
7
|
+
* no tracking tags.
|
|
6
8
|
*/
|
|
7
9
|
export default {
|
|
8
10
|
driver: 'analyticshq',
|
|
@@ -10,7 +12,7 @@ export default {
|
|
|
10
12
|
|
|
11
13
|
drivers: {
|
|
12
14
|
analyticshq: {
|
|
13
|
-
siteId: '',
|
|
15
|
+
siteId: env.ANALYTICSHQ_SITE_ID || '',
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
18
|
} satisfies AnalyticsConfig
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{{-- One row of the starter page's list. A component in this folder is used by
|
|
2
|
+
its tag name with no import, and reads what the tag passed from $props. --}}
|
|
3
|
+
<script server>
|
|
4
|
+
export const icon = $props.icon || ''
|
|
5
|
+
export const title = $props.title || ''
|
|
6
|
+
export const path = $props.path || ''
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<li class="flex gap-4 items-center py-4 border-b border-neutral-200 dark:border-neutral-800">
|
|
10
|
+
<span class="{{ icon }} size-5 text-neutral-500 dark:text-neutral-400" aria-hidden="true"></span>
|
|
11
|
+
<span class="font-medium">{{ title }}</span>
|
|
12
|
+
<code class="ml-auto text-neutral-500 text-sm dark:text-neutral-400">{{ path }}</code>
|
|
13
|
+
</li>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{{-- The head every page shares, included by layouts/default.stx.
|
|
2
|
+
|
|
3
|
+
Everything that names the site comes from the app's own config: the title
|
|
4
|
+
from APP_NAME and the canonical URL from APP_URL (via config/app.ts), so a
|
|
5
|
+
deploy of an untouched app describes itself rather than anyone else.
|
|
6
|
+
|
|
7
|
+
A page names itself by declaring `pageTitle`, `pageDescription` or
|
|
8
|
+
`canonicalPath` in its own server script. A page that declares none of
|
|
9
|
+
them describes the site. --}}
|
|
10
|
+
<script server>
|
|
11
|
+
import { config } from '@stacksjs/config'
|
|
12
|
+
|
|
13
|
+
const appName = config.app.name || 'My App'
|
|
14
|
+
|
|
15
|
+
// APP_URL is often a bare host (`my-app.localhost`), which is not a valid
|
|
16
|
+
// canonical href on its own.
|
|
17
|
+
const rawUrl = String(config.app.url || '').replace(/\/+$/, '')
|
|
18
|
+
const siteUrl = rawUrl && !/^https?:\/\//.test(rawUrl) ? `https://${rawUrl}` : rawUrl
|
|
19
|
+
|
|
20
|
+
const headTitle = typeof pageTitle !== 'undefined' && pageTitle ? `${pageTitle} - ${appName}` : appName
|
|
21
|
+
const headDescription = typeof pageDescription !== 'undefined' && pageDescription ? pageDescription : `${appName} is up and running.`
|
|
22
|
+
const headPath = typeof canonicalPath !== 'undefined' && canonicalPath ? canonicalPath : '/'
|
|
23
|
+
const canonicalUrl = siteUrl ? `${siteUrl}${headPath}` : ''
|
|
24
|
+
</script>
|
|
25
|
+
<meta charset="utf-8">
|
|
26
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
27
|
+
<title>{{ headTitle }}</title>
|
|
28
|
+
<meta name="description" content="{{ headDescription }}">
|
|
29
|
+
@if(canonicalUrl)
|
|
30
|
+
<link rel="canonical" href="{{ canonicalUrl }}">
|
|
31
|
+
@endif
|
|
@@ -1,65 +1,41 @@
|
|
|
1
|
+
@extends('default')
|
|
2
|
+
@section('content')
|
|
1
3
|
<script server>
|
|
2
4
|
/**
|
|
3
5
|
* The starter page `buddy new` gives every app, at `/`.
|
|
4
6
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* The document around it is `layouts/default.stx`, its <head> is
|
|
8
|
+
* `resources/partials/head.stx`, and each row of the list is the `NextStep`
|
|
9
|
+
* component from `resources/components`. Replace this file with your own
|
|
10
|
+
* homepage and keep the three beside it.
|
|
9
11
|
*/
|
|
10
12
|
import { config } from '@stacksjs/config'
|
|
11
13
|
|
|
12
14
|
const appName = config.app.name || 'My App'
|
|
13
15
|
|
|
14
|
-
// APP_URL is often a bare host (`my-app.localhost`), which is not a valid
|
|
15
|
-
// canonical href on its own.
|
|
16
|
-
const rawUrl = String(config.app.url || '').replace(/\/+$/, '')
|
|
17
|
-
const siteUrl = rawUrl && !/^https?:\/\//.test(rawUrl) ? `https://${rawUrl}` : rawUrl
|
|
18
|
-
const canonicalUrl = siteUrl ? `${siteUrl}/` : ''
|
|
19
|
-
|
|
20
|
-
const pageDescription = `${appName} is up and running.`
|
|
21
|
-
|
|
22
16
|
const nextSteps = [
|
|
23
17
|
{ icon: 'i-hugeicons-file-edit', title: 'Edit this page', path: 'resources/views/index.stx' },
|
|
18
|
+
{ icon: 'i-hugeicons-layout-01', title: 'Shape the document', path: 'resources/views/layouts/default.stx' },
|
|
24
19
|
{ icon: 'i-hugeicons-database-01', title: 'Define a model', path: 'app/Models' },
|
|
25
20
|
{ icon: 'i-hugeicons-route-01', title: 'Add an API route', path: 'routes/api.ts' },
|
|
26
21
|
{ icon: 'i-hugeicons-settings-02', title: 'Configure the app', path: 'config/app.ts' },
|
|
27
22
|
]
|
|
28
23
|
</script>
|
|
24
|
+
<div class="flex flex-col justify-center mx-auto px-6 py-16 max-w-2xl min-h-screen">
|
|
25
|
+
<p class="font-medium text-neutral-500 text-sm dark:text-neutral-400">Your app is running</p>
|
|
26
|
+
<h1 class="mt-2 font-semibold text-4xl tracking-tight">{{ appName }}</h1>
|
|
27
|
+
<p class="mt-4 text-neutral-600 dark:text-neutral-300">
|
|
28
|
+
Start with <code class="px-1.5 py-0.5 text-sm bg-neutral-200 dark:bg-neutral-800 rounded">./buddy dev</code>, then make it yours.
|
|
29
|
+
</p>
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
36
|
-
<title>{{ appName }}</title>
|
|
37
|
-
<meta name="description" content="{{ pageDescription }}">
|
|
38
|
-
@if(canonicalUrl)
|
|
39
|
-
<link rel="canonical" href="{{ canonicalUrl }}">
|
|
40
|
-
@endif
|
|
41
|
-
</head>
|
|
42
|
-
<body class="min-h-screen antialiased text-neutral-900 dark:text-neutral-100 bg-neutral-50 dark:bg-neutral-950">
|
|
43
|
-
<main class="flex flex-col justify-center mx-auto px-6 py-16 max-w-2xl min-h-screen">
|
|
44
|
-
<p class="font-medium text-neutral-500 text-sm dark:text-neutral-400">Your app is running</p>
|
|
45
|
-
<h1 class="mt-2 font-semibold text-4xl tracking-tight">{{ appName }}</h1>
|
|
46
|
-
<p class="mt-4 text-neutral-600 dark:text-neutral-300">
|
|
47
|
-
Start with <code class="px-1.5 py-0.5 text-sm bg-neutral-200 dark:bg-neutral-800 rounded">./buddy dev</code>, then make it yours.
|
|
48
|
-
</p>
|
|
49
|
-
|
|
50
|
-
<ul class="mt-10 border-neutral-200 border-y divide-neutral-200 divide-y dark:border-neutral-800 dark:divide-neutral-800">
|
|
51
|
-
@foreach(nextSteps as step)
|
|
52
|
-
<li class="flex gap-4 items-center py-4">
|
|
53
|
-
<span class="{{ step.icon }} size-5 text-neutral-500 dark:text-neutral-400" aria-hidden="true"></span>
|
|
54
|
-
<span class="font-medium">{{ step.title }}</span>
|
|
55
|
-
<code class="ml-auto text-neutral-500 text-sm dark:text-neutral-400">{{ step.path }}</code>
|
|
56
|
-
</li>
|
|
57
|
-
@endforeach
|
|
58
|
-
</ul>
|
|
31
|
+
<ul class="mt-10 border-neutral-200 border-t dark:border-neutral-800">
|
|
32
|
+
@foreach(nextSteps as step)
|
|
33
|
+
<NextStep :icon="step.icon" :title="step.title" :path="step.path" />
|
|
34
|
+
@endforeach
|
|
35
|
+
</ul>
|
|
59
36
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</html>
|
|
37
|
+
<p class="mt-10 text-neutral-500 text-sm dark:text-neutral-400">
|
|
38
|
+
<a class="underline underline-offset-4 hover:text-neutral-900 dark:hover:text-neutral-100" href="https://stacksjs.com/docs">Read the Stacks docs</a>
|
|
39
|
+
</p>
|
|
40
|
+
</div>
|
|
41
|
+
@endsection
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{{-- The document shell every page extends.
|
|
2
|
+
|
|
3
|
+
A page names this layout on its first line and puts its markup in a section
|
|
4
|
+
called content, the way views/index.stx does. Scripts a page pushes onto the
|
|
5
|
+
scripts stack land before the closing body tag. Add the navigation and footer
|
|
6
|
+
every page shares here, as components from resources/components.
|
|
7
|
+
|
|
8
|
+
Directive names are spelled without their at sign in this comment on
|
|
9
|
+
purpose: stx reads directives inside comments too, and a layout whose
|
|
10
|
+
comment names its own extends line extends itself forever. --}}
|
|
11
|
+
<!DOCTYPE html>
|
|
12
|
+
<html lang="en">
|
|
13
|
+
<head>
|
|
14
|
+
@include('head')
|
|
15
|
+
</head>
|
|
16
|
+
<body class="min-h-screen antialiased text-neutral-900 dark:text-neutral-100 bg-neutral-50 dark:bg-neutral-950">
|
|
17
|
+
<a href="#main" class="focus:fixed focus:left-4 focus:top-4 focus:z-50 focus:px-4 focus:py-2 focus:text-neutral-900 focus:bg-white focus:rounded sr-only focus:not-sr-only">Skip to content</a>
|
|
18
|
+
<main id="main" tabindex="-1">
|
|
19
|
+
@yield('content')
|
|
20
|
+
</main>
|
|
21
|
+
@stack('scripts')
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -134,8 +134,27 @@ select:not([multiple]):not([size]):not([data-ui-select]) {
|
|
|
134
134
|
background: #f4f4f5;
|
|
135
135
|
transition: margin-left 0.3s ease-out;
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
/*
|
|
138
|
+
* A dialog or drawer covers the content pane: from the sidebar's edge to the
|
|
139
|
+
* window's, so a dialog is centred over the page and a drawer ends where the
|
|
140
|
+
* window does.
|
|
141
|
+
*
|
|
142
|
+
* `html` is in the selector for its weight, not its meaning. The dialogs also
|
|
143
|
+
* carry `inset-0`, a utility of the same weight as a bare class, and the
|
|
144
|
+
* utilities' stylesheet lands after this one on a fresh load and before it
|
|
145
|
+
* after navigating between pages. So which `left` applied depended on how the
|
|
146
|
+
* visitor had arrived: centred on the whole window one time, 250px to the
|
|
147
|
+
* right the next.
|
|
148
|
+
*
|
|
149
|
+
* The width is set here for the same reason, and because a `dialog` is as
|
|
150
|
+
* wide as its content unless told otherwise. It was told `100vw`, which with
|
|
151
|
+
* this `left` ran the layer a sidebar's width past the window: a dialog sat
|
|
152
|
+
* half that far right of centre, and a drawer's edge was off the screen.
|
|
153
|
+
*/
|
|
154
|
+
html .dashboard-modal-layer {
|
|
155
|
+
right: 0;
|
|
138
156
|
left: var(--stx-sidebar-width, 250px);
|
|
157
|
+
width: auto;
|
|
139
158
|
transition: left 0.3s ease-out;
|
|
140
159
|
}
|
|
141
160
|
/*
|
|
@@ -159,7 +178,7 @@ select:not([multiple]):not([size]):not([data-ui-select]) {
|
|
|
159
178
|
[data-dashboard-web-sidebar] {
|
|
160
179
|
display: none;
|
|
161
180
|
}
|
|
162
|
-
.dashboard-modal-layer {
|
|
181
|
+
html .dashboard-modal-layer {
|
|
163
182
|
left: 0;
|
|
164
183
|
}
|
|
165
184
|
}
|