@stacksjs/defaults 0.75.528 → 0.75.535
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-actions/SKILL.md +1 -1
- package/ai/skills/stacks-build/SKILL.md +1 -1
- package/ai/skills/stacks-dashboard/SKILL.md +2 -2
- package/ai/skills/stacks-database/SKILL.md +1 -1
- package/ai/skills/stacks-migrations/SKILL.md +2 -2
- package/ai/skills/stacks-native/CATALOG.md +4 -4
- package/app/Actions/Dashboard/Commerce/CommerceCouponsAction.ts +27 -15
- package/app/Actions/Dashboard/Commerce/CommerceCouponsExportAction.ts +45 -0
- package/app/Actions/Dashboard/Commerce/CommerceCustomersAction.ts +22 -12
- package/app/Actions/Dashboard/Commerce/CommerceCustomersExportAction.ts +44 -0
- package/app/Actions/Dashboard/Commerce/CommercePosCheckoutAction.ts +9 -29
- package/app/Actions/Dashboard/Commerce/CommercePrintDevicesAction.ts +7 -9
- package/app/Actions/Dashboard/Commerce/CommerceProductDetailAction.ts +9 -8
- package/app/Actions/Dashboard/Commerce/CommerceTaxesAction.ts +7 -9
- package/app/Actions/Dashboard/Commerce/ManufacturerIndexAction.ts +8 -20
- package/app/Actions/Dashboard/Commerce/commerce-coupon-list.test.ts +203 -0
- package/app/Actions/Dashboard/Commerce/commerce-coupon-list.ts +248 -0
- package/app/Actions/Dashboard/Commerce/commerce-customer-list.test.ts +183 -0
- package/app/Actions/Dashboard/Commerce/commerce-customer-list.ts +186 -0
- package/app/Actions/Dashboard/Commerce/commerce-customer-records.test.ts +1 -34
- package/app/Actions/Dashboard/Commerce/commerce-customer-records.ts +0 -11
- package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.test.ts +118 -0
- package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.ts +41 -0
- package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.test.ts +17 -5
- package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.ts +17 -3
- package/app/Actions/Dashboard/Commerce/commerce-print-device-list.test.ts +99 -0
- package/app/Actions/Dashboard/Commerce/commerce-print-device-list.ts +18 -0
- package/app/Actions/Dashboard/Commerce/commerce-product-list.ts +5 -5
- package/app/Actions/Dashboard/Commerce/commerce-product-options.test.ts +81 -0
- package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.test.ts +99 -0
- package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.ts +18 -0
- package/app/Actions/Dashboard/Commerce/coupon-records.test.ts +1 -16
- package/app/Actions/Dashboard/Commerce/coupon-records.ts +6 -10
- package/app/Actions/Dashboard/Commerce/manufacturer-records.test.ts +5 -17
- package/app/Actions/Dashboard/Commerce/manufacturer-records.ts +0 -29
- package/app/Actions/Dashboard/Email/captured-mail.test.ts +16 -0
- package/app/Actions/Dashboard/Email/captured-mail.ts +9 -1
- package/app/Actions/Dashboard/Models/model-write.ts +36 -3
- package/app/Actions/Dashboard/Notifications/NotificationDeliveryHistoryAction.ts +13 -58
- package/app/Actions/Dashboard/Notifications/notification-delivery-history.ts +74 -0
- package/app/Actions/SitemapAction.ts +3 -1
- package/app/Models/Notification.ts +3 -1
- package/app/Models/NotificationDelivery.ts +4 -0
- package/app/Models/User.ts +10 -1
- package/bootstrap.ts +10 -2
- package/functions/commerce/tax-types.ts +21 -0
- package/functions/dashboard-list.test.ts +16 -0
- package/functions/dashboard-list.ts +14 -6
- package/functions/dashboard-model-record.test.ts +139 -0
- package/functions/dashboard-model-record.ts +353 -0
- package/functions/monitoring/errors.ts +22 -103
- package/functions/notifications/deliveries.ts +7 -38
- package/functions/queries.ts +7 -10
- package/ide/vscode/package.json +1 -1
- package/package.json +5 -5
- package/resources/components/Dashboard/Analytics/AnalyticsHub.stx +2 -2
- package/resources/components/Dashboard/Analytics/CampaignAnalytics.stx +22 -28
- package/resources/components/Dashboard/Analytics/EventAnalytics.stx +26 -34
- package/resources/components/Dashboard/Analytics/SalesAnalytics.stx +29 -37
- package/resources/components/Dashboard/Analytics/WebAnalyticsBreakdown.stx +12 -16
- package/resources/components/Dashboard/Analytics/WebAnalyticsDashboard.stx +43 -53
- package/resources/components/Dashboard/App/RequestsOverview.stx +2 -1
- package/resources/components/Dashboard/App/SourceInventory.stx +2 -1
- package/resources/components/Dashboard/Auth/AccessTokens.stx +3 -5
- package/resources/components/Dashboard/Billing/BillingPaymentMethodsPanel.stx +9 -11
- package/resources/components/Dashboard/Billing/BillingSettings.stx +1 -1
- package/resources/components/Dashboard/Buddy/BuddyAssistant.stx +4 -6
- package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceCategoriesTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceCategoryHierarchy.stx +3 -5
- package/resources/components/Dashboard/Commerce/CommerceCouponBreakdown.stx +17 -13
- package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +57 -85
- package/resources/components/Dashboard/Commerce/CommerceCouponsTable.stx +32 -9
- package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +49 -83
- package/resources/components/Dashboard/Commerce/CommerceCustomersTable.stx +32 -9
- package/resources/components/Dashboard/Commerce/CommerceGiftCardBreakdown.stx +9 -15
- package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +35 -119
- package/resources/components/Dashboard/Commerce/CommerceGiftCardsTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +3 -5
- package/resources/components/Dashboard/Commerce/CommerceManufacturersTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +4 -4
- package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +42 -129
- package/resources/components/Dashboard/Commerce/CommerceOrdersTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceOverviewOrdersTable.stx +9 -11
- package/resources/components/Dashboard/Commerce/CommerceOverviewProductsTable.stx +5 -7
- package/resources/components/Dashboard/Commerce/CommerceOverviewStats.stx +14 -16
- package/resources/components/Dashboard/Commerce/CommercePaymentsBreakdown.stx +12 -18
- package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +41 -120
- package/resources/components/Dashboard/Commerce/CommercePaymentsTable.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommercePosCart.stx +13 -15
- package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +17 -19
- package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommercePosDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommercePosReceiptDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceProductDetailDashboard.stx +5 -5
- package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +41 -122
- package/resources/components/Dashboard/Commerce/CommerceProductsTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +38 -122
- package/resources/components/Dashboard/Commerce/CommerceReviewsTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -4
- package/resources/components/Dashboard/Commerce/CommerceTaxesTable.stx +4 -3
- package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +3 -7
- package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +3 -5
- package/resources/components/Dashboard/Commerce/CommerceUnitsTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +4 -4
- package/resources/components/Dashboard/Commerce/CommerceVariantsTable.stx +3 -5
- package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/CouriersDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/CouriersTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryOverviewDashboard.stx +44 -52
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryPagination.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveriesDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesDashboard.stx +1 -1
- package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +4 -8
- package/resources/components/Dashboard/Commerce/PaymentDetailsDialog.stx +1 -3
- package/resources/components/Dashboard/Commerce/PrintDeviceBreakdown.stx +9 -15
- package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +3 -3
- package/resources/components/Dashboard/Commerce/PrintDevicesTable.stx +3 -3
- package/resources/components/Dashboard/Commerce/PrintLogBreakdown.stx +3 -9
- package/resources/components/Dashboard/Commerce/PrintLogDetailsDialog.stx +1 -1
- package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +4 -4
- package/resources/components/Dashboard/Commerce/PrintLogsTable.stx +8 -10
- package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +37 -109
- package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +3 -3
- package/resources/components/Dashboard/Commerce/ProductWaitlistTable.stx +2 -2
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +38 -112
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +2 -2
- package/resources/components/Dashboard/Commerce/RestaurantWaitlistTable.stx +2 -2
- package/resources/components/Dashboard/Content/AuthorsDashboard.stx +4 -4
- package/resources/components/Dashboard/Content/BlogDashboard.stx +4 -4
- package/resources/components/Dashboard/Content/CommentsDashboard.stx +36 -83
- package/resources/components/Dashboard/Content/ContentDashboard.stx +12 -14
- package/resources/components/Dashboard/Content/ContentTaxonomyDashboard.stx +2 -2
- package/resources/components/Dashboard/Content/FileManagerDashboard.stx +8 -12
- package/resources/components/Dashboard/Content/FileStoragePanel.stx +6 -10
- package/resources/components/Dashboard/Content/FileUploadDialog.stx +1 -3
- package/resources/components/Dashboard/Content/PagesDashboard.stx +39 -78
- package/resources/components/Dashboard/Content/PostEditorDialog.stx +4 -8
- package/resources/components/Dashboard/Content/PostsDashboard.stx +44 -85
- package/resources/components/Dashboard/Content/SeoDashboard.stx +5 -4
- package/resources/components/Dashboard/Data/DataRecords.stx +140 -12
- package/resources/components/Dashboard/Deployments/DeploymentList.stx +4 -4
- package/resources/components/Dashboard/Deployments/DeploymentTable.stx +3 -1
- package/resources/components/Dashboard/Elements/DropdownNavigation.stx +5 -7
- package/resources/components/Dashboard/Email/CapturedMailDashboard.stx +1 -3
- package/resources/components/Dashboard/Email/CapturedMailList.stx +18 -20
- package/resources/components/Dashboard/Email/EmailActivityDashboard.stx +24 -28
- package/resources/components/Dashboard/Email/EmailSettingsList.stx +6 -8
- package/resources/components/Dashboard/Email/EmailSettingsNavigation.stx +10 -12
- package/resources/components/Dashboard/Email/EmailSidebar.stx +33 -37
- package/resources/components/Dashboard/Email/InboxMessageDetail.stx +1 -1
- package/resources/components/Dashboard/Email/InboxMessageList.stx +16 -18
- package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +1 -1
- package/resources/components/Dashboard/Environment/EnvironmentDashboard.stx +2 -2
- package/resources/components/Dashboard/GlobalSearch.stx +19 -21
- package/resources/components/Dashboard/Home/DashboardHome.stx +8 -1
- package/resources/components/Dashboard/Infrastructure/CloudDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +27 -13
- package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +1 -1
- package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +46 -8
- 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/JobHistory.stx +44 -57
- package/resources/components/Dashboard/Jobs/JobTable.stx +23 -25
- package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +1 -1
- package/resources/components/Dashboard/Library/ComponentsDashboard.stx +1 -1
- package/resources/components/Dashboard/Management/AssignmentDrawer.stx +5 -7
- package/resources/components/Dashboard/Management/PermissionsDashboard.stx +35 -43
- package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +11 -13
- package/resources/components/Dashboard/Marketing/CampaignDialog.stx +1 -3
- package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +2 -2
- package/resources/components/Dashboard/Marketing/CampaignsTable.stx +2 -2
- package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +1 -1
- package/resources/components/Dashboard/Marketing/MarketingListsTable.stx +2 -2
- package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +1 -3
- package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +2 -2
- package/resources/components/Dashboard/Marketing/SocialPostsTable.stx +2 -2
- package/resources/components/Dashboard/Models/ModelRecordActions.stx +11 -2
- package/resources/components/Dashboard/Models/ModelRecordCreate.stx +193 -0
- package/resources/components/Dashboard/Models/ModelRecordDetail.stx +144 -0
- package/resources/components/Dashboard/Models/ModelRecordEdit.stx +176 -0
- package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +52 -186
- package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -4
- package/resources/components/Dashboard/Monitoring/ErrorDashboard.stx +47 -81
- package/resources/components/Dashboard/Monitoring/ErrorTable.stx +4 -2
- package/resources/components/Dashboard/NotFoundDashboard.stx +4 -4
- package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +43 -77
- package/resources/components/Dashboard/Notifications/NotificationDeliveryOverview.stx +15 -17
- package/resources/components/Dashboard/Notifications/NotificationDeliveryTable.stx +1 -1
- package/resources/components/Dashboard/Operations/AuditDashboard.stx +1 -1
- package/resources/components/Dashboard/Operations/ChangeDashboard.stx +1 -1
- package/resources/components/Dashboard/Operations/IncidentDashboard.stx +1 -1
- package/resources/components/Dashboard/Operations/MigrationDashboard.stx +2 -2
- package/resources/components/Dashboard/Operations/RecoveryDashboard.stx +1 -1
- package/resources/components/Dashboard/Operations/SchedulerDashboard.stx +1 -1
- package/resources/components/Dashboard/Queries/QueryDashboard.stx +60 -86
- package/resources/components/Dashboard/Queries/QueryDetail.stx +5 -9
- package/resources/components/Dashboard/Realtime/RealtimeDashboard.stx +6 -8
- package/resources/components/Dashboard/Remote/RemoteConsole.stx +14 -20
- package/resources/components/Dashboard/Settings/AppearanceSettingsDashboard.stx +48 -54
- package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +8 -8
- package/resources/components/Dashboard/Settings/SettingsDashboard.stx +43 -47
- package/resources/components/Dashboard/Teams/TeamInvitationDashboard.stx +2 -2
- package/resources/components/Dashboard/UI/ActivityTable.stx +2 -1
- package/resources/components/Dashboard/UI/Button.stx +15 -0
- package/resources/components/Dashboard/UI/MetricCards.stx +5 -7
- package/resources/components/Dashboard/UI/Pagination.stx +3 -5
- package/resources/components/Dashboard/UI/QuickLinks.stx +2 -2
- package/resources/components/Dashboard/UI/Select.stx +1 -0
- package/resources/components/Dashboard/UI/Table.stx +139 -96
- package/resources/components/Dashboard/UI/Tabs.stx +18 -20
- package/routes/dashboard-api.ts +2 -0
- package/routes/dashboard.ts +246 -253
- package/routes/storefront.ts +31 -0
- package/stx-components-plugin.ts +12 -1
- package/views/dashboard/content/categories/index.stx +1 -1
- package/views/dashboard/content/tags/index.stx +1 -1
- package/views/dashboard/layouts/default.stx +27 -12
- package/views/dashboard/models/[model]/[id]/edit.stx +8 -0
- package/views/dashboard/models/[model]/[id].stx +8 -0
- package/views/dashboard/models/[model]/create.stx +8 -0
- package/resources/components/Dashboard/CreateRecordModal.stx +0 -138
- package/resources/components/Dashboard/Models/EditRecordModal.stx +0 -81
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { route } from '@stacksjs/router'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The storefront: an anonymous cart, the multi-step checkout and buyer
|
|
5
|
+
* reviews, which the default `cart`, `checkout` and `orders` pages post to.
|
|
6
|
+
*
|
|
7
|
+
* Its own bundle, riding on the `commerce` feature like `delivery` and
|
|
8
|
+
* `payments`, so an app that has not run `./buddy commerce:install` neither
|
|
9
|
+
* mounts these routes nor serves the pages behind them. It lived in
|
|
10
|
+
* `dashboard.ts`, where it was mounted, and its pages served, in every app
|
|
11
|
+
* with a dashboard.
|
|
12
|
+
*
|
|
13
|
+
* CSRF is skipped because the storefront uses progressive-enhancement HTML
|
|
14
|
+
* forms (there is no JS to mint a token) and each cart is already gated by an
|
|
15
|
+
* opaque, HttpOnly session cookie that cannot be guessed. Apps that want
|
|
16
|
+
* classic CSRF on top can re-register the same routes in their `routes/api.ts`
|
|
17
|
+
* without `.skipCsrf()`.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
route.get('/api/cart', 'Actions/Storefront/GetCartAction').skipCsrf()
|
|
21
|
+
route.post('/api/cart/add', 'Actions/Storefront/AddToCartAction').skipCsrf()
|
|
22
|
+
route.post('/api/cart/update', 'Actions/Storefront/UpdateCartItemAction').skipCsrf()
|
|
23
|
+
route.post('/api/checkout/contact', 'Actions/Storefront/CheckoutContactAction').skipCsrf()
|
|
24
|
+
route.post('/api/checkout/shipping', 'Actions/Storefront/CheckoutShippingAction').skipCsrf()
|
|
25
|
+
route.post('/api/checkout/place', 'Actions/Storefront/PlaceOrderAction').skipCsrf()
|
|
26
|
+
|
|
27
|
+
// Buyer-submitted product review. Tied to a shipped order via order_id + email
|
|
28
|
+
// match (the SubmitReviewAction verifies ownership and stamps
|
|
29
|
+
// is_verified_purchase=1). Stored as is_approved=0 for admin moderation through
|
|
30
|
+
// `/dashboard/commerce/reviews`.
|
|
31
|
+
route.post('/api/reviews/submit', 'Actions/Storefront/SubmitReviewAction').skipCsrf()
|
package/stx-components-plugin.ts
CHANGED
|
@@ -42,7 +42,18 @@ function packageDirs(): string[] {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
export default {
|
|
45
|
-
|
|
45
|
+
/*
|
|
46
|
+
* Not `@stacksjs/components`, which is the library's own plugin name. stx
|
|
47
|
+
* treats a plugin with that name as the component package itself, so every
|
|
48
|
+
* directory listed below - the framework's first - became a "package"
|
|
49
|
+
* directory, and on a native screen the shared names (`Button`, `Checkbox`,
|
|
50
|
+
* `Switch`, `TextInput`, `Image`, `Video`) resolved to the framework's web
|
|
51
|
+
* components instead of the library's native-safe ones: four unrenderable
|
|
52
|
+
* diagnostics per `<Button>` (stacksjs/stacks#3213). Under its own name the
|
|
53
|
+
* list below is precedence and nothing more, and the library's own plugin,
|
|
54
|
+
* which stx loads by itself, is the one that answers for the shared names.
|
|
55
|
+
*/
|
|
56
|
+
name: '@stacksjs/defaults/components',
|
|
46
57
|
/*
|
|
47
58
|
* Order is the precedence, because stx searches this list and takes the
|
|
48
59
|
* first match.
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<ContentTaxonomyDashboard
|
|
8
8
|
resource="categories"
|
|
9
9
|
title="Categories"
|
|
10
|
-
description="
|
|
10
|
+
description="Group posts and products into categories. One set of categories serves both."
|
|
11
11
|
/>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
@@ -100,6 +100,23 @@ canvas[id$="_chart"] {
|
|
|
100
100
|
body {
|
|
101
101
|
background: transparent;
|
|
102
102
|
}
|
|
103
|
+
/*
|
|
104
|
+
* Every native single select draws the same chevron as the shared UI Select:
|
|
105
|
+
* the browser's own arrow sat flush against the right border, with no room.
|
|
106
|
+
* The glyph is hugeicons arrow-down-01 (the one UI Select renders), in
|
|
107
|
+
* neutral-400 so it reads in both color modes, 8px from the edge, with the
|
|
108
|
+
* text kept clear of it. UI Select marks its own element, which already has
|
|
109
|
+
* an icon, and multi-row lists keep the native look.
|
|
110
|
+
*/
|
|
111
|
+
select:not([multiple]):not([size]):not([data-ui-select]) {
|
|
112
|
+
-webkit-appearance: none;
|
|
113
|
+
appearance: none;
|
|
114
|
+
background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' stroke='%23a3a3a3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M18 9s-4.419 6-6 6s-6-6-6-6'/%3E%3C/svg%3E");
|
|
115
|
+
background-repeat: no-repeat;
|
|
116
|
+
background-position: right 0.5rem center;
|
|
117
|
+
background-size: 0.875rem 0.875rem;
|
|
118
|
+
padding-right: 2rem;
|
|
119
|
+
}
|
|
103
120
|
/*
|
|
104
121
|
* The pane offset follows the sidebar's own width variable, which the Sidebar
|
|
105
122
|
* writes onto this element via `shell-selector`. The literal fallback keeps
|
|
@@ -750,18 +767,16 @@ onDestroy(() => {
|
|
|
750
767
|
Pointer-events-none on the wrapper + auto on individual toasts so
|
|
751
768
|
surrounding UI stays clickable while a toast is up. -->
|
|
752
769
|
<div class="flex fixed right-4 top-4 z-[60] flex-col gap-2 max-w-sm w-full pointer-events-none">
|
|
753
|
-
<
|
|
754
|
-
<div
|
|
755
|
-
<div class="
|
|
756
|
-
|
|
757
|
-
<
|
|
758
|
-
|
|
759
|
-
<p :if="toast.detail" class="mt-1 break-words text-gray-500 text-xs dark:text-neutral-400">{{ toast.detail }}</p>
|
|
760
|
-
</div>
|
|
761
|
-
<Button variant="ghost" size="xs" iconOnly ariaLabel="Dismiss notification" @click="dismissToast(toast.id)">
|
|
762
|
-
<span aria-hidden="true" class="h-4 w-4 i-hugeicons-cancel-01"></span>
|
|
763
|
-
</Button>
|
|
770
|
+
<div :for="toast in toasts" role="alert" aria-live="assertive" :class="toastWrapperClass(toast.type)">
|
|
771
|
+
<div class="flex gap-3 items-start p-4">
|
|
772
|
+
<div :class="toastIconClass(toast.type)"></div>
|
|
773
|
+
<div class="flex-1 min-w-0">
|
|
774
|
+
<p class="font-medium text-gray-900 text-sm dark:text-neutral-100">{{ toast.title }}</p>
|
|
775
|
+
<p :if="toast.detail" class="mt-1 break-words text-gray-500 text-xs dark:text-neutral-400">{{ toast.detail }}</p>
|
|
764
776
|
</div>
|
|
777
|
+
<Button variant="ghost" size="xs" iconOnly ariaLabel="Dismiss notification" @click="dismissToast(toast.id)">
|
|
778
|
+
<span aria-hidden="true" class="h-4 w-4 i-hugeicons-cancel-01"></span>
|
|
779
|
+
</Button>
|
|
765
780
|
</div>
|
|
766
|
-
</
|
|
781
|
+
</div>
|
|
767
782
|
</div>
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
@import('./UI/Button')
|
|
2
|
-
|
|
3
|
-
<script client>
|
|
4
|
-
interface CreateField {
|
|
5
|
-
name: string
|
|
6
|
-
label: string
|
|
7
|
-
type: 'boolean' | 'date' | 'datetime' | 'email' | 'enum' | 'number' | 'text'
|
|
8
|
-
required: boolean
|
|
9
|
-
defaultValue: unknown
|
|
10
|
-
options: string[]
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const open = useReactiveProp('open', false)
|
|
14
|
-
const modelName = useReactiveProp('modelName', 'Record')
|
|
15
|
-
const fields = useReactiveProp('fields', [] as CreateField[])
|
|
16
|
-
const busy = useReactiveProp('busy', false)
|
|
17
|
-
const error = useReactiveProp('error', '')
|
|
18
|
-
const errors = useReactiveProp('errors', {} as Record<string, string[]>)
|
|
19
|
-
const values = state<Record<string, unknown>>({})
|
|
20
|
-
const emit = defineEmits(['submit', 'close'])
|
|
21
|
-
let hydrationKey = ''
|
|
22
|
-
|
|
23
|
-
effect(() => {
|
|
24
|
-
if (!open()) {
|
|
25
|
-
hydrationKey = ''
|
|
26
|
-
return
|
|
27
|
-
}
|
|
28
|
-
const key = `${modelName()}:${fields().map(field => field.name).join(',')}`
|
|
29
|
-
if (hydrationKey === key)
|
|
30
|
-
return
|
|
31
|
-
hydrationKey = key
|
|
32
|
-
values.set(Object.fromEntries(fields().map(field => [field.name, field.defaultValue])))
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
function setValue(field: string, value: unknown): void {
|
|
36
|
-
values.set({ ...values(), [field]: value })
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function fieldValue(field: string): string {
|
|
40
|
-
const value = values()[field]
|
|
41
|
-
return value === null || value === undefined ? '' : String(value)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function fieldError(field: string): string {
|
|
45
|
-
return errors()[field]?.[0] || ''
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function inputType(field: CreateField): 'date' | 'datetime-local' | 'email' | 'number' | 'text' {
|
|
49
|
-
if (field.type === 'datetime')
|
|
50
|
-
return 'datetime-local'
|
|
51
|
-
if (field.type === 'date' || field.type === 'email' || field.type === 'number')
|
|
52
|
-
return field.type
|
|
53
|
-
return 'text'
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function submit(): void {
|
|
57
|
-
emit('submit', { ...values() })
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function close(): void {
|
|
61
|
-
if (!busy())
|
|
62
|
-
emit('close')
|
|
63
|
-
}
|
|
64
|
-
</script>
|
|
65
|
-
|
|
66
|
-
<Modal
|
|
67
|
-
:isOpen="open()"
|
|
68
|
-
:title="'Create ' + modelName()"
|
|
69
|
-
description="Fields come from the model's fillable attributes and useApi store contract."
|
|
70
|
-
:closable="!busy()"
|
|
71
|
-
@close="close"
|
|
72
|
-
>
|
|
73
|
-
<form id="create-record-form" @submit.prevent="submit">
|
|
74
|
-
<div class="overflow-y-auto space-y-4 max-h-[65vh]">
|
|
75
|
-
<div :if="error()" role="alert" class="p-3 text-red-700 text-sm dark:text-red-300 bg-red-50 dark:bg-red-950/30 border border-red-200 rounded-lg dark:border-red-900">
|
|
76
|
-
{{ error() }}
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
|
-
<template :for="field in fields()">
|
|
80
|
-
<label :if="field.type === 'boolean'" class="flex gap-3 items-start p-3 border border-neutral-200 rounded-lg dark:border-neutral-700">
|
|
81
|
-
<input
|
|
82
|
-
:name="field.name"
|
|
83
|
-
type="checkbox"
|
|
84
|
-
:checked="Boolean(values()[field.name])"
|
|
85
|
-
:disabled="busy()"
|
|
86
|
-
class="mt-0.5 h-4 w-4 text-blue-600 border-neutral-300 rounded"
|
|
87
|
-
@change="setValue(field.name, $event.target.checked)"
|
|
88
|
-
/>
|
|
89
|
-
<span>
|
|
90
|
-
<span class="block font-medium text-neutral-700 text-sm dark:text-neutral-200">{{ field.label }}</span>
|
|
91
|
-
<span :if="fieldError(field.name)" class="block mt-0.5 text-red-600 text-xs dark:text-red-400">{{ fieldError(field.name) }}</span>
|
|
92
|
-
</span>
|
|
93
|
-
</label>
|
|
94
|
-
|
|
95
|
-
<Select
|
|
96
|
-
:if="field.type === 'enum'"
|
|
97
|
-
:name="field.name"
|
|
98
|
-
:value="fieldValue(field.name)"
|
|
99
|
-
:options="field.options"
|
|
100
|
-
:label="field.label"
|
|
101
|
-
:ariaLabel="field.label"
|
|
102
|
-
:required="field.required"
|
|
103
|
-
:disabled="busy()"
|
|
104
|
-
:error="fieldError(field.name)"
|
|
105
|
-
@update:value="setValue(field.name, $event)"
|
|
106
|
-
/>
|
|
107
|
-
|
|
108
|
-
<Input
|
|
109
|
-
:if="field.type !== 'boolean' && field.type !== 'enum'"
|
|
110
|
-
:name="field.name"
|
|
111
|
-
:value="fieldValue(field.name)"
|
|
112
|
-
:type="inputType(field)"
|
|
113
|
-
:label="field.label"
|
|
114
|
-
:ariaLabel="field.label"
|
|
115
|
-
:required="field.required"
|
|
116
|
-
:disabled="busy()"
|
|
117
|
-
:error="fieldError(field.name)"
|
|
118
|
-
@update:value="setValue(field.name, $event)"
|
|
119
|
-
/>
|
|
120
|
-
</template>
|
|
121
|
-
|
|
122
|
-
<p :if="fields().length === 0" class="py-8 text-center text-neutral-500 text-sm dark:text-neutral-400">
|
|
123
|
-
This model exposes no safe fillable fields.
|
|
124
|
-
</p>
|
|
125
|
-
</div>
|
|
126
|
-
</form>
|
|
127
|
-
|
|
128
|
-
<template #footer>
|
|
129
|
-
<div class="flex gap-2 items-center justify-end w-full">
|
|
130
|
-
<Button :disabled="busy()" variant="secondary" @click="close">
|
|
131
|
-
Cancel
|
|
132
|
-
</Button>
|
|
133
|
-
<Button type="submit" form="create-record-form" :disabled="busy() || fields().length === 0" :loading="busy()">
|
|
134
|
-
{{ busy() ? 'Creating' : `Create ${modelName()}` }}
|
|
135
|
-
</Button>
|
|
136
|
-
</div>
|
|
137
|
-
</template>
|
|
138
|
-
</Modal>
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
<script client>
|
|
2
|
-
interface EditField {
|
|
3
|
-
name: string
|
|
4
|
-
label: string
|
|
5
|
-
value: string
|
|
6
|
-
readonly: boolean
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const open = useReactiveProp('open', false)
|
|
10
|
-
const modelName = useReactiveProp('modelName', 'Record')
|
|
11
|
-
const fields = useReactiveProp('fields', [] as EditField[])
|
|
12
|
-
const busy = useReactiveProp('busy', false)
|
|
13
|
-
const values = state<Record<string, string>>({})
|
|
14
|
-
const emit = defineEmits(['submit', 'close'])
|
|
15
|
-
let hydrationKey = ''
|
|
16
|
-
|
|
17
|
-
effect(() => {
|
|
18
|
-
if (!open()) {
|
|
19
|
-
hydrationKey = ''
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const key = fields().map(field => `${field.name}:${field.value}`).join('|')
|
|
24
|
-
if (key === hydrationKey)
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
hydrationKey = key
|
|
28
|
-
values.set(Object.fromEntries(fields().map(field => [field.name, field.value])))
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
function updateValue(field: string, event: Event): void {
|
|
32
|
-
values.set({ ...values(), [field]: (event.target as HTMLInputElement).value })
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function submit(): void {
|
|
36
|
-
emit('submit', Object.fromEntries(
|
|
37
|
-
fields()
|
|
38
|
-
.filter(field => !field.readonly)
|
|
39
|
-
.map(field => [field.name, values()[field.name]]),
|
|
40
|
-
))
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function close(): void {
|
|
44
|
-
if (!busy())
|
|
45
|
-
emit('close')
|
|
46
|
-
}
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<Modal
|
|
50
|
-
:isOpen="open()"
|
|
51
|
-
:title="'Edit ' + modelName()"
|
|
52
|
-
description="Only changed writable fields will be sent through the model API."
|
|
53
|
-
:closable="!busy()"
|
|
54
|
-
@close="close"
|
|
55
|
-
>
|
|
56
|
-
<form id="model-edit-form" class="overflow-y-auto space-y-3 max-h-[65vh]" @submit.prevent="submit">
|
|
57
|
-
<template :for="field in fields()">
|
|
58
|
-
<div class="flex flex-col gap-1.5">
|
|
59
|
-
<label :for="'model-edit-' + field.name" class="font-medium text-[12px] text-neutral-600 dark:text-neutral-300">{{ field.label }}</label>
|
|
60
|
-
<input
|
|
61
|
-
:id="'model-edit-' + field.name"
|
|
62
|
-
:name="field.readonly ? undefined : field.name"
|
|
63
|
-
type="text"
|
|
64
|
-
:value="values()[field.name] ?? field.value"
|
|
65
|
-
:readonly="field.readonly"
|
|
66
|
-
class="px-2.5 py-1.5 text-[13px] text-neutral-900 dark:text-neutral-100 read-only:text-neutral-500 dark:read-only:text-neutral-400 bg-white dark:bg-white/10 read-only:bg-neutral-50 dark:read-only:bg-white/5 border border-black/10 rounded-lg dark:border-white/15 focus:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
|
|
67
|
-
@input="updateValue(field.name, $event)"
|
|
68
|
-
>
|
|
69
|
-
</div>
|
|
70
|
-
</template>
|
|
71
|
-
</form>
|
|
72
|
-
|
|
73
|
-
<template #footer>
|
|
74
|
-
<div class="flex gap-2 items-center justify-end w-full">
|
|
75
|
-
<Button :disabled="busy()" variant="secondary" @click="close">Cancel</Button>
|
|
76
|
-
<Button type="submit" form="model-edit-form" :loading="busy()">
|
|
77
|
-
{{ busy() ? 'Saving' : 'Save changes' }}
|
|
78
|
-
</Button>
|
|
79
|
-
</div>
|
|
80
|
-
</template>
|
|
81
|
-
</Modal>
|