@stacksjs/defaults 0.70.356 → 0.70.358
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-browse/SKILL.md +5 -1
- package/ai/skills/stacks-browse/scripts/browse.ts +61 -6
- package/ai/skills/stacks-orm/SKILL.md +6 -0
- package/app/Actions/Dashboard/Actions/GetActions.ts +15 -9
- package/app/Actions/Dashboard/Analytics/EventStoreAction.ts +21 -9
- package/app/Actions/Dashboard/Commerce/ProductUnitDefaultAction.ts +12 -3
- package/app/Actions/Dashboard/Commerce/TaxRateDefaultAction.ts +12 -3
- package/app/Actions/Dashboard/Content/AuthorDestroyAction.ts +23 -9
- package/app/Actions/Dashboard/Content/AuthorIndexAction.ts +32 -26
- package/app/Actions/Dashboard/Content/AuthorStoreAction.ts +44 -24
- package/app/Actions/Dashboard/Content/AuthorUpdateAction.ts +48 -26
- package/app/Actions/Dashboard/Content/CategoryDestroyAction.ts +27 -8
- package/app/Actions/Dashboard/Content/CategoryIndexAction.ts +21 -15
- package/app/Actions/Dashboard/Content/CategoryStoreAction.ts +47 -29
- package/app/Actions/Dashboard/Content/CommentDestroyAction.ts +17 -4
- package/app/Actions/Dashboard/Content/CommentIndexAction.ts +23 -17
- package/app/Actions/Dashboard/Content/CommentUpdateAction.ts +30 -12
- package/app/Actions/Dashboard/Content/ContentDashboardAction.ts +43 -37
- package/app/Actions/Dashboard/Content/PageDestroyAction.ts +17 -4
- package/app/Actions/Dashboard/Content/PageIndexAction.ts +23 -17
- package/app/Actions/Dashboard/Content/PageStoreAction.ts +33 -18
- package/app/Actions/Dashboard/Content/PageUpdateAction.ts +40 -22
- package/app/Actions/Dashboard/Content/PostDestroyAction.ts +24 -11
- package/app/Actions/Dashboard/Content/PostIndexAction.ts +55 -49
- package/app/Actions/Dashboard/Content/PostStoreAction.ts +43 -33
- package/app/Actions/Dashboard/Content/PostUpdateAction.ts +46 -34
- package/app/Actions/Dashboard/Content/TagDestroyAction.ts +27 -8
- package/app/Actions/Dashboard/Content/TagIndexAction.ts +31 -25
- package/app/Actions/Dashboard/Content/TagStoreAction.ts +44 -23
- package/app/Actions/Dashboard/Content/content-input.ts +4 -4
- package/app/Actions/Dashboard/Content/post-input.ts +60 -8
- package/app/Actions/Dashboard/DashboardHealthAction.ts +34 -14
- package/app/Actions/Dashboard/DashboardHomeAction.test.ts +1 -1
- package/app/Actions/Dashboard/DashboardHomeAction.ts +31 -4
- package/app/Actions/Dashboard/DashboardStatsAction.ts +6 -1
- package/app/Actions/Dashboard/Email/InboxSendAction.ts +14 -7
- package/app/Actions/Dashboard/Infrastructure/CommandIndexAction.ts +33 -27
- package/app/Actions/Dashboard/Infrastructure/EnvironmentIndexAction.ts +10 -4
- package/app/Actions/Dashboard/Infrastructure/EnvironmentUpdateAction.ts +8 -1
- package/app/Actions/Dashboard/Infrastructure/RequestIndexAction.ts +24 -18
- package/app/Actions/Dashboard/Infrastructure/ServerIndexAction.ts +15 -9
- package/app/Actions/Dashboard/Infrastructure/ServerShowAction.ts +9 -2
- package/app/Actions/Dashboard/Marketing/CampaignCancelAction.ts +23 -5
- package/app/Actions/Dashboard/Marketing/CampaignDestroyAction.ts +26 -17
- package/app/Actions/Dashboard/Marketing/CampaignIndexAction.ts +49 -43
- package/app/Actions/Dashboard/Marketing/CampaignScheduleAction.ts +31 -25
- package/app/Actions/Dashboard/Marketing/CampaignSendAction.ts +28 -22
- package/app/Actions/Dashboard/Marketing/CampaignStoreAction.ts +15 -10
- package/app/Actions/Dashboard/Marketing/CampaignUpdateAction.ts +19 -12
- package/app/Actions/Dashboard/Marketing/ListDestroyAction.ts +34 -25
- package/app/Actions/Dashboard/Marketing/ListIndexAction.ts +32 -26
- package/app/Actions/Dashboard/Marketing/ListStoreAction.ts +31 -18
- package/app/Actions/Dashboard/Marketing/ListUpdateAction.ts +35 -19
- package/app/Actions/Dashboard/Marketing/SocialPostDestroyAction.ts +15 -5
- package/app/Actions/Dashboard/Marketing/SocialPostIndexAction.ts +11 -5
- package/app/Actions/Dashboard/Marketing/SocialPostStoreAction.ts +19 -13
- package/app/Actions/Dashboard/Marketing/SocialPostUpdateAction.ts +22 -12
- package/app/Actions/Dashboard/Marketing/campaign-delivery.ts +34 -0
- package/app/Actions/Dashboard/Marketing/marketing-list-records.test.ts +10 -0
- package/app/Actions/Dashboard/Marketing/marketing-list-records.ts +10 -0
- package/app/Actions/Dashboard/Marketing/marketing-response.ts +28 -0
- package/app/Actions/Dashboard/Marketing/social-post-records.test.ts +13 -0
- package/app/Actions/Dashboard/Marketing/social-post-records.ts +22 -4
- package/app/Actions/Dashboard/Models/GetModels.ts +14 -7
- package/app/Actions/Dashboard/Models/GetSubscriberCount.ts +8 -1
- package/app/Actions/Dashboard/Models/GetUserCount.ts +8 -1
- package/app/Actions/Dashboard/Releases/ReleaseIndexAction.ts +11 -5
- package/app/Actions/Dashboard/Settings/MailSettingsGetAction.ts +10 -4
- package/app/Actions/Dashboard/Settings/MailSettingsUpdateAction.ts +8 -1
- package/ide/vscode/package.json +1 -1
- package/package.json +1 -1
- package/resources/components/Dashboard/UI/Modal.stx +60 -10
- package/views/dashboard/stores/auth.ts +18 -2
|
@@ -19,25 +19,68 @@ const sizeClasses = {
|
|
|
19
19
|
</script>
|
|
20
20
|
<script client>
|
|
21
21
|
const open = useReactiveProp('isOpen', false)
|
|
22
|
+
const liveClosable = useReactiveProp('closable', true)
|
|
22
23
|
const liveTitle = useReactiveProp('title', '')
|
|
23
24
|
const liveDescription = useReactiveProp('description', '')
|
|
25
|
+
const dialog = useRef<HTMLDialogElement>('dashboardModalDialog')
|
|
26
|
+
const activeElement = useActiveElement()
|
|
27
|
+
const scrollLocked = useScrollLock()
|
|
24
28
|
const emit = defineEmits()
|
|
29
|
+
let restoreFocus: HTMLElement | null = null
|
|
25
30
|
|
|
26
31
|
function closeModal(): void {
|
|
32
|
+
if (!liveClosable()) return
|
|
27
33
|
emit('close')
|
|
28
34
|
}
|
|
29
|
-
</script>
|
|
30
|
-
<div :if="open()" class="fixed inset-y-0 overflow-y-auto right-0 z-[55] dashboard-modal-layer">
|
|
31
|
-
<!-- Overlay -->
|
|
32
|
-
<button type="button" class="absolute inset-0 w-full bg-black/50 backdrop-blur-sm" aria-label="Close modal" @click="closeModal"></button>
|
|
33
35
|
|
|
36
|
+
function handleCancel(event: Event): void {
|
|
37
|
+
event.preventDefault()
|
|
38
|
+
closeModal()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function handleBackdropClick(event: MouseEvent): void {
|
|
42
|
+
if (event.target === event.currentTarget)
|
|
43
|
+
closeModal()
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
effect(() => {
|
|
47
|
+
const isOpen = open()
|
|
48
|
+
scrollLocked.value = isOpen
|
|
49
|
+
|
|
50
|
+
if (isOpen) {
|
|
51
|
+
const focused = peek(() => activeElement.value)
|
|
52
|
+
if (focused instanceof HTMLElement)
|
|
53
|
+
restoreFocus = focused
|
|
54
|
+
void nextTick(() => {
|
|
55
|
+
const element = dialog.current
|
|
56
|
+
if (!element) return
|
|
57
|
+
if (!element.open)
|
|
58
|
+
element.showModal()
|
|
59
|
+
element.focus()
|
|
60
|
+
})
|
|
61
|
+
return
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (dialog.current?.open)
|
|
65
|
+
dialog.current.close()
|
|
66
|
+
const target = restoreFocus
|
|
67
|
+
restoreFocus = null
|
|
68
|
+
if (target)
|
|
69
|
+
void nextTick(() => target.focus())
|
|
70
|
+
})
|
|
71
|
+
</script>
|
|
72
|
+
<dialog
|
|
73
|
+
:if="open()"
|
|
74
|
+
ref="dashboardModalDialog"
|
|
75
|
+
role="dialog"
|
|
76
|
+
aria-modal="true"
|
|
77
|
+
:aria-label="liveTitle() || 'Dialog'"
|
|
78
|
+
class="fixed inset-0 m-0 p-0 h-dvh max-h-none w-screen max-w-none overflow-y-auto z-[55] bg-transparent dashboard-modal-layer dashboard-modal-dialog"
|
|
79
|
+
@cancel="handleCancel"
|
|
80
|
+
>
|
|
34
81
|
<!-- Modal container -->
|
|
35
|
-
<div class="flex items-center justify-center p-4 min-h-full">
|
|
82
|
+
<div class="flex items-center justify-center p-4 min-h-full" @click="handleBackdropClick">
|
|
36
83
|
<div
|
|
37
|
-
role="dialog"
|
|
38
|
-
aria-modal="true"
|
|
39
|
-
:aria-label="liveTitle() || 'Dialog'"
|
|
40
|
-
tabindex="-1"
|
|
41
84
|
class="relative w-full rounded-xl bg-white dark:bg-neutral-900 shadow-2xl {{ sizeClasses[size] }}"
|
|
42
85
|
>
|
|
43
86
|
<!-- Header -->
|
|
@@ -78,4 +121,11 @@ function closeModal(): void {
|
|
|
78
121
|
@endif
|
|
79
122
|
</div>
|
|
80
123
|
</div>
|
|
81
|
-
</
|
|
124
|
+
</dialog>
|
|
125
|
+
|
|
126
|
+
<style>
|
|
127
|
+
.dashboard-modal-dialog::backdrop {
|
|
128
|
+
background: rgb(0 0 0 / 50%);
|
|
129
|
+
backdrop-filter: blur(4px);
|
|
130
|
+
}
|
|
131
|
+
</style>
|
|
@@ -33,6 +33,7 @@ export const authStore = defineStore('auth', () => {
|
|
|
33
33
|
const loading = state(false)
|
|
34
34
|
const error = state<string | null>(null)
|
|
35
35
|
const loaded = state(false)
|
|
36
|
+
let pendingLoad: Promise<void> | null = null
|
|
36
37
|
|
|
37
38
|
const isAdmin = derived(() => {
|
|
38
39
|
if (!loaded()) return false
|
|
@@ -50,8 +51,7 @@ export const authStore = defineStore('auth', () => {
|
|
|
50
51
|
return roles().includes('client')
|
|
51
52
|
})
|
|
52
53
|
|
|
53
|
-
async function
|
|
54
|
-
if (loading() || loaded()) return
|
|
54
|
+
async function resolveIdentity(): Promise<void> {
|
|
55
55
|
loading.set(true)
|
|
56
56
|
error.set(null)
|
|
57
57
|
try {
|
|
@@ -88,7 +88,23 @@ export const authStore = defineStore('auth', () => {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
function load(): Promise<void> {
|
|
92
|
+
if (loaded())
|
|
93
|
+
return Promise.resolve()
|
|
94
|
+
|
|
95
|
+
if (pendingLoad)
|
|
96
|
+
return pendingLoad
|
|
97
|
+
|
|
98
|
+
pendingLoad = resolveIdentity().finally(() => {
|
|
99
|
+
pendingLoad = null
|
|
100
|
+
})
|
|
101
|
+
return pendingLoad
|
|
102
|
+
}
|
|
103
|
+
|
|
91
104
|
async function refresh(): Promise<void> {
|
|
105
|
+
if (pendingLoad)
|
|
106
|
+
await pendingLoad
|
|
107
|
+
|
|
92
108
|
loaded.set(false)
|
|
93
109
|
await load()
|
|
94
110
|
}
|