@stacksjs/defaults 0.75.230 → 0.75.233
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 +15 -0
- package/ai/skills/stacks-models/SKILL.md +6 -1
- package/ai/skills/stacks-native/CATALOG.md +6 -6
- package/ai/skills/stacks-storage/SKILL.md +43 -0
- package/ai/skills/stacks-testing/SKILL.md +38 -10
- package/app/Actions/Dashboard/Models/GetModels.ts +19 -14
- package/app/Actions/Dashboard/Models/GetSubscriberCount.ts +5 -2
- package/app/Actions/Dashboard/Models/GetUserCount.ts +5 -2
- package/app/Actions/Dashboard/Models/ModelShowAction.ts +3 -11
- package/app/Actions/Dashboard/Models/ModelsIndexAction.ts +6 -3
- package/app/Actions/Dashboard/Models/model-write.ts +2 -3
- package/app/Actions/Dashboard/Search/GlobalSearchAction.ts +6 -2
- package/functions/dashboard-form.test.ts +41 -0
- package/functions/dashboard-form.ts +30 -0
- package/functions/dashboard-list.test.ts +228 -0
- package/functions/dashboard-list.ts +257 -0
- package/ide/vscode/package.json +1 -1
- package/package.json +2 -2
- package/project/storage/framework/types/browser-composables.d.ts +56 -0
- package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +2 -7
- package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +2 -7
- package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +2 -7
- package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +2 -7
- package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +2 -7
- package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +2 -7
- package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/Delivery/CouriersDashboard.stx +45 -92
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +46 -92
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +46 -92
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesDashboard.stx +44 -90
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesDashboard.stx +45 -91
- package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +2 -7
- package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +2 -4
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +2 -4
- package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +2 -9
- package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +2 -9
- package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +2 -9
- package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +2 -9
- package/resources/functions/dashboard/model-access.ts +15 -0
- package/resources/plugins/preloader.ts +9 -1
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
import type { CampaignDeliveryOperation } from '../../../../app/Actions/Dashboard/Marketing/campaign-delivery'
|
|
8
8
|
import { dashboardApi } from '../../../../functions/dashboard-api'
|
|
9
9
|
import { pushToast } from '../../../../functions/toasts'
|
|
10
|
+
import { pageControls } from '../../../../functions/dashboard-list'
|
|
10
11
|
|
|
11
12
|
interface CampaignIndexResponse {
|
|
12
13
|
records: CampaignRecord[]
|
|
@@ -271,15 +272,7 @@ async function confirmDelivery(payload: { scheduledAt?: string }): Promise<void>
|
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
274
|
|
|
274
|
-
|
|
275
|
-
if (page() > 1)
|
|
276
|
-
page.set(page() - 1)
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
function nextPage(): void {
|
|
280
|
-
if (page() < totalPages())
|
|
281
|
-
page.set(page() + 1)
|
|
282
|
-
}
|
|
275
|
+
const { previousPage, nextPage } = pageControls(page, totalPages)
|
|
283
276
|
|
|
284
277
|
onMount(() => {
|
|
285
278
|
void loadCampaigns()
|
|
@@ -5,6 +5,7 @@ import type {
|
|
|
5
5
|
} from '../../../../app/Actions/Dashboard/Marketing/marketing-list-records'
|
|
6
6
|
import { dashboardApi } from '../../../../functions/dashboard-api'
|
|
7
7
|
import { pushToast } from '../../../../functions/toasts'
|
|
8
|
+
import { pageControls } from '../../../../functions/dashboard-list'
|
|
8
9
|
|
|
9
10
|
interface MarketingListIndexResponse {
|
|
10
11
|
records: MarketingListRecord[]
|
|
@@ -193,15 +194,7 @@ async function deleteList(): Promise<void> {
|
|
|
193
194
|
}
|
|
194
195
|
}
|
|
195
196
|
|
|
196
|
-
|
|
197
|
-
if (page() > 1)
|
|
198
|
-
page.set(page() - 1)
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function nextPage(): void {
|
|
202
|
-
if (page() < totalPages())
|
|
203
|
-
page.set(page() + 1)
|
|
204
|
-
}
|
|
197
|
+
const { previousPage, nextPage } = pageControls(page, totalPages)
|
|
205
198
|
|
|
206
199
|
onMount(() => {
|
|
207
200
|
void loadLists()
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
} from '../../../../app/Actions/Dashboard/Marketing/social-post-records'
|
|
7
7
|
import { dashboardApi } from '../../../../functions/dashboard-api'
|
|
8
8
|
import { pushToast } from '../../../../functions/toasts'
|
|
9
|
+
import { pageControls } from '../../../../functions/dashboard-list'
|
|
9
10
|
|
|
10
11
|
interface SocialPostIndexResponse {
|
|
11
12
|
records: SocialPostRecord[]
|
|
@@ -186,15 +187,7 @@ async function deletePost(): Promise<void> {
|
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
|
|
189
|
-
|
|
190
|
-
if (page() > 1)
|
|
191
|
-
page.set(page() - 1)
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function nextPage(): void {
|
|
195
|
-
if (page() < totalPages())
|
|
196
|
-
page.set(page() + 1)
|
|
197
|
-
}
|
|
190
|
+
const { previousPage, nextPage } = pageControls(page, totalPages)
|
|
198
191
|
|
|
199
192
|
onMount(() => {
|
|
200
193
|
void loadPosts()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Server-side exposure boundary for the generic dashboard model surfaces. */
|
|
2
|
+
import type { DashboardModelOptions } from '@stacksjs/types'
|
|
3
|
+
import { loadModelIfExists } from './data'
|
|
4
|
+
|
|
5
|
+
/** Omission preserves the existing dashboard exposure. `enabled` only controls navigation. */
|
|
6
|
+
export function hasDashboardModelAccess(Model: { dashboard?: DashboardModelOptions } | null | undefined): boolean {
|
|
7
|
+
return Model?.dashboard?.access !== false
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Resolve the native model, then exclude it before callers inspect metadata or query rows. */
|
|
11
|
+
export async function resolveDashboardModel(name: string, candidate?: any): Promise<any | null> {
|
|
12
|
+
const injected = (globalThis as Record<string, any>)[name]
|
|
13
|
+
const Model = (injected && typeof injected.where === 'function') ? injected : (candidate ?? await loadModelIfExists(name))
|
|
14
|
+
return Model && hasDashboardModelAccess(Model) ? Model : null
|
|
15
|
+
}
|
|
@@ -88,7 +88,15 @@ const isRepl = !process.argv[1]
|
|
|
88
88
|
// otherwise valid. Postinstall scripts are bootstrap work and must stay independent
|
|
89
89
|
// of the application runtime preloader.
|
|
90
90
|
const isPostinstall = process.env.npm_lifecycle_event === 'postinstall'
|
|
91
|
-
|
|
91
|
+
// runAction starts these framework files directly, with flags rather than a
|
|
92
|
+
// Buddy command in argv[2]. They only inspect/release repository metadata.
|
|
93
|
+
// Match the framework's source and published layouts, never an app action
|
|
94
|
+
// which happens to have the same basename and needs its application globals.
|
|
95
|
+
const entrypoint = (process.argv[1] ?? '').replaceAll('\\', '/')
|
|
96
|
+
const repositoryAction = '(?:release|bump|generate/lib-entries)\\.[jt]s'
|
|
97
|
+
const isRepositoryAction = new RegExp(`(?:^|/)storage/framework/core/actions/src/${repositoryAction}$`).test(entrypoint)
|
|
98
|
+
|| new RegExp(`(?:^|/)(?:node_modules|pantry)/@stacksjs/actions/(?:src|dist(?:/src)?)/${repositoryAction}$`).test(entrypoint)
|
|
99
|
+
const skipPreloader = isRepl || isPostinstall || isRepositoryAction || (args.length > 0 && fastCommands.some(cmd => args[0] === cmd || args[0].startsWith(`${cmd}:`)))
|
|
92
100
|
|
|
93
101
|
if (!skipPreloader) {
|
|
94
102
|
// Detect production/deployment commands and set environment accordingly BEFORE loading env files
|