@stacksjs/defaults 0.75.529 → 0.75.537

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 (248) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +1 -1
  2. package/ai/skills/stacks-build/SKILL.md +1 -1
  3. package/ai/skills/stacks-dashboard/SKILL.md +2 -2
  4. package/ai/skills/stacks-database/SKILL.md +1 -1
  5. package/ai/skills/stacks-migrations/SKILL.md +2 -2
  6. package/ai/skills/stacks-native/CATALOG.md +6 -6
  7. package/app/Actions/Dashboard/Commerce/CommerceCouponsAction.ts +27 -15
  8. package/app/Actions/Dashboard/Commerce/CommerceCouponsExportAction.ts +45 -0
  9. package/app/Actions/Dashboard/Commerce/CommerceCustomersAction.ts +22 -12
  10. package/app/Actions/Dashboard/Commerce/CommerceCustomersExportAction.ts +44 -0
  11. package/app/Actions/Dashboard/Commerce/CommercePosCheckoutAction.ts +9 -29
  12. package/app/Actions/Dashboard/Commerce/CommercePrintDevicesAction.ts +7 -9
  13. package/app/Actions/Dashboard/Commerce/CommerceProductDetailAction.ts +9 -8
  14. package/app/Actions/Dashboard/Commerce/CommerceTaxesAction.ts +7 -9
  15. package/app/Actions/Dashboard/Commerce/ManufacturerIndexAction.ts +8 -20
  16. package/app/Actions/Dashboard/Commerce/commerce-coupon-list.test.ts +203 -0
  17. package/app/Actions/Dashboard/Commerce/commerce-coupon-list.ts +248 -0
  18. package/app/Actions/Dashboard/Commerce/commerce-customer-list.test.ts +183 -0
  19. package/app/Actions/Dashboard/Commerce/commerce-customer-list.ts +186 -0
  20. package/app/Actions/Dashboard/Commerce/commerce-customer-records.test.ts +1 -34
  21. package/app/Actions/Dashboard/Commerce/commerce-customer-records.ts +0 -11
  22. package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.test.ts +118 -0
  23. package/app/Actions/Dashboard/Commerce/commerce-manufacturer-list.ts +41 -0
  24. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.test.ts +17 -5
  25. package/app/Actions/Dashboard/Commerce/commerce-pos-catalog.ts +17 -3
  26. package/app/Actions/Dashboard/Commerce/commerce-print-device-list.test.ts +99 -0
  27. package/app/Actions/Dashboard/Commerce/commerce-print-device-list.ts +18 -0
  28. package/app/Actions/Dashboard/Commerce/commerce-product-list.ts +5 -5
  29. package/app/Actions/Dashboard/Commerce/commerce-product-options.test.ts +81 -0
  30. package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.test.ts +99 -0
  31. package/app/Actions/Dashboard/Commerce/commerce-tax-rate-list.ts +18 -0
  32. package/app/Actions/Dashboard/Commerce/coupon-records.test.ts +1 -16
  33. package/app/Actions/Dashboard/Commerce/coupon-records.ts +6 -10
  34. package/app/Actions/Dashboard/Commerce/manufacturer-records.test.ts +5 -17
  35. package/app/Actions/Dashboard/Commerce/manufacturer-records.ts +0 -29
  36. package/app/Actions/Dashboard/Email/captured-mail.test.ts +16 -0
  37. package/app/Actions/Dashboard/Email/captured-mail.ts +9 -1
  38. package/app/Actions/Dashboard/Models/model-write.ts +36 -3
  39. package/app/Actions/Dashboard/Notifications/NotificationDeliveryHistoryAction.ts +13 -58
  40. package/app/Actions/Dashboard/Notifications/notification-delivery-history.ts +74 -0
  41. package/app/Actions/SitemapAction.ts +3 -1
  42. package/app/Models/Notification.ts +3 -1
  43. package/app/Models/NotificationDelivery.ts +4 -0
  44. package/app/Models/User.ts +10 -1
  45. package/bootstrap.ts +10 -2
  46. package/functions/commerce/tax-types.ts +21 -0
  47. package/functions/dashboard-list.test.ts +16 -0
  48. package/functions/dashboard-list.ts +14 -6
  49. package/functions/dashboard-model-record.test.ts +139 -0
  50. package/functions/dashboard-model-record.ts +353 -0
  51. package/functions/monitoring/errors.ts +22 -103
  52. package/functions/notifications/deliveries.ts +7 -38
  53. package/functions/queries.ts +7 -10
  54. package/ide/vscode/package.json +1 -1
  55. package/package.json +5 -5
  56. package/resources/components/Dashboard/Analytics/AnalyticsHub.stx +2 -2
  57. package/resources/components/Dashboard/Analytics/CampaignAnalytics.stx +22 -28
  58. package/resources/components/Dashboard/Analytics/EventAnalytics.stx +26 -34
  59. package/resources/components/Dashboard/Analytics/SalesAnalytics.stx +29 -37
  60. package/resources/components/Dashboard/Analytics/WebAnalyticsBreakdown.stx +12 -16
  61. package/resources/components/Dashboard/Analytics/WebAnalyticsDashboard.stx +43 -53
  62. package/resources/components/Dashboard/App/RequestsOverview.stx +2 -1
  63. package/resources/components/Dashboard/App/SourceInventory.stx +2 -1
  64. package/resources/components/Dashboard/Auth/AccessTokens.stx +3 -5
  65. package/resources/components/Dashboard/Billing/BillingPaymentMethodsPanel.stx +9 -11
  66. package/resources/components/Dashboard/Billing/BillingSettings.stx +1 -1
  67. package/resources/components/Dashboard/Buddy/BuddyAssistant.stx +4 -6
  68. package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +2 -2
  69. package/resources/components/Dashboard/Commerce/CommerceCategoriesTable.stx +3 -3
  70. package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +2 -2
  71. package/resources/components/Dashboard/Commerce/CommerceCategoryHierarchy.stx +3 -5
  72. package/resources/components/Dashboard/Commerce/CommerceCouponBreakdown.stx +17 -13
  73. package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +1 -1
  74. package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +57 -85
  75. package/resources/components/Dashboard/Commerce/CommerceCouponsTable.stx +32 -9
  76. package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +1 -1
  77. package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +49 -83
  78. package/resources/components/Dashboard/Commerce/CommerceCustomersTable.stx +32 -9
  79. package/resources/components/Dashboard/Commerce/CommerceGiftCardBreakdown.stx +9 -15
  80. package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +1 -1
  81. package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +35 -119
  82. package/resources/components/Dashboard/Commerce/CommerceGiftCardsTable.stx +3 -3
  83. package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +1 -1
  84. package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +3 -5
  85. package/resources/components/Dashboard/Commerce/CommerceManufacturersTable.stx +2 -2
  86. package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +4 -4
  87. package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +42 -129
  88. package/resources/components/Dashboard/Commerce/CommerceOrdersTable.stx +3 -3
  89. package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +1 -1
  90. package/resources/components/Dashboard/Commerce/CommerceOverviewOrdersTable.stx +9 -11
  91. package/resources/components/Dashboard/Commerce/CommerceOverviewProductsTable.stx +5 -7
  92. package/resources/components/Dashboard/Commerce/CommerceOverviewStats.stx +14 -16
  93. package/resources/components/Dashboard/Commerce/CommercePaymentsBreakdown.stx +12 -18
  94. package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +41 -120
  95. package/resources/components/Dashboard/Commerce/CommercePaymentsTable.stx +1 -1
  96. package/resources/components/Dashboard/Commerce/CommercePosCart.stx +13 -15
  97. package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +17 -19
  98. package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +2 -2
  99. package/resources/components/Dashboard/Commerce/CommercePosDashboard.stx +1 -1
  100. package/resources/components/Dashboard/Commerce/CommercePosReceiptDialog.stx +1 -1
  101. package/resources/components/Dashboard/Commerce/CommerceProductDetailDashboard.stx +5 -5
  102. package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +3 -3
  103. package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +41 -122
  104. package/resources/components/Dashboard/Commerce/CommerceProductsTable.stx +3 -3
  105. package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +1 -1
  106. package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +38 -122
  107. package/resources/components/Dashboard/Commerce/CommerceReviewsTable.stx +2 -2
  108. package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +3 -3
  109. package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -4
  110. package/resources/components/Dashboard/Commerce/CommerceTaxesTable.stx +4 -3
  111. package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +3 -7
  112. package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +3 -5
  113. package/resources/components/Dashboard/Commerce/CommerceUnitsTable.stx +2 -2
  114. package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +3 -3
  115. package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +4 -4
  116. package/resources/components/Dashboard/Commerce/CommerceVariantsTable.stx +3 -5
  117. package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +1 -1
  118. package/resources/components/Dashboard/Commerce/Delivery/CouriersDashboard.stx +1 -1
  119. package/resources/components/Dashboard/Commerce/Delivery/CouriersTable.stx +2 -2
  120. package/resources/components/Dashboard/Commerce/Delivery/DeliveryOverviewDashboard.stx +44 -52
  121. package/resources/components/Dashboard/Commerce/Delivery/DeliveryPagination.stx +2 -2
  122. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +1 -1
  123. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesDashboard.stx +1 -1
  124. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRoutesTable.stx +2 -2
  125. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveriesDashboard.stx +1 -1
  126. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryTable.stx +2 -2
  127. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +3 -3
  128. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysDashboard.stx +1 -1
  129. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeysTable.stx +2 -2
  130. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsDashboard.stx +1 -1
  131. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodsTable.stx +2 -2
  132. package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +2 -2
  133. package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesDashboard.stx +1 -1
  134. package/resources/components/Dashboard/Commerce/Delivery/ShippingRatesTable.stx +2 -2
  135. package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +1 -1
  136. package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesDashboard.stx +1 -1
  137. package/resources/components/Dashboard/Commerce/Delivery/ShippingZonesTable.stx +4 -8
  138. package/resources/components/Dashboard/Commerce/PaymentDetailsDialog.stx +1 -3
  139. package/resources/components/Dashboard/Commerce/PrintDeviceBreakdown.stx +9 -15
  140. package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +1 -1
  141. package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +3 -3
  142. package/resources/components/Dashboard/Commerce/PrintDevicesTable.stx +3 -3
  143. package/resources/components/Dashboard/Commerce/PrintLogBreakdown.stx +3 -9
  144. package/resources/components/Dashboard/Commerce/PrintLogDetailsDialog.stx +1 -1
  145. package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +4 -4
  146. package/resources/components/Dashboard/Commerce/PrintLogsTable.stx +8 -10
  147. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +37 -109
  148. package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +3 -3
  149. package/resources/components/Dashboard/Commerce/ProductWaitlistTable.stx +2 -2
  150. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +38 -112
  151. package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +2 -2
  152. package/resources/components/Dashboard/Commerce/RestaurantWaitlistTable.stx +2 -2
  153. package/resources/components/Dashboard/Content/AuthorsDashboard.stx +4 -4
  154. package/resources/components/Dashboard/Content/BlogDashboard.stx +4 -4
  155. package/resources/components/Dashboard/Content/CommentsDashboard.stx +36 -83
  156. package/resources/components/Dashboard/Content/ContentDashboard.stx +12 -14
  157. package/resources/components/Dashboard/Content/ContentTaxonomyDashboard.stx +2 -2
  158. package/resources/components/Dashboard/Content/FileManagerDashboard.stx +8 -12
  159. package/resources/components/Dashboard/Content/FileStoragePanel.stx +6 -10
  160. package/resources/components/Dashboard/Content/FileUploadDialog.stx +1 -3
  161. package/resources/components/Dashboard/Content/PagesDashboard.stx +39 -78
  162. package/resources/components/Dashboard/Content/PostEditorDialog.stx +4 -8
  163. package/resources/components/Dashboard/Content/PostsDashboard.stx +44 -85
  164. package/resources/components/Dashboard/Content/SeoDashboard.stx +5 -4
  165. package/resources/components/Dashboard/Data/DataRecords.stx +140 -12
  166. package/resources/components/Dashboard/Deployments/DeploymentList.stx +4 -4
  167. package/resources/components/Dashboard/Deployments/DeploymentTable.stx +3 -1
  168. package/resources/components/Dashboard/Elements/DropdownNavigation.stx +5 -7
  169. package/resources/components/Dashboard/Email/CapturedMailDashboard.stx +1 -3
  170. package/resources/components/Dashboard/Email/CapturedMailList.stx +18 -20
  171. package/resources/components/Dashboard/Email/EmailActivityDashboard.stx +24 -28
  172. package/resources/components/Dashboard/Email/EmailSettingsList.stx +6 -8
  173. package/resources/components/Dashboard/Email/EmailSettingsNavigation.stx +10 -12
  174. package/resources/components/Dashboard/Email/EmailSidebar.stx +33 -37
  175. package/resources/components/Dashboard/Email/InboxMessageDetail.stx +1 -1
  176. package/resources/components/Dashboard/Email/InboxMessageList.stx +16 -18
  177. package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +1 -1
  178. package/resources/components/Dashboard/Environment/EnvironmentDashboard.stx +2 -2
  179. package/resources/components/Dashboard/GlobalSearch.stx +19 -21
  180. package/resources/components/Dashboard/Home/DashboardHome.stx +8 -1
  181. package/resources/components/Dashboard/Infrastructure/CloudDashboard.stx +1 -1
  182. package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +27 -13
  183. package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +1 -1
  184. package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +46 -8
  185. package/resources/components/Dashboard/Infrastructure/ServerlessDashboard.stx +1 -1
  186. package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -1
  187. package/resources/components/Dashboard/Jobs/JobDetail.stx +1 -1
  188. package/resources/components/Dashboard/Jobs/JobHistory.stx +44 -57
  189. package/resources/components/Dashboard/Jobs/JobTable.stx +23 -25
  190. package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +1 -1
  191. package/resources/components/Dashboard/Library/ComponentsDashboard.stx +1 -1
  192. package/resources/components/Dashboard/Management/AssignmentDrawer.stx +5 -7
  193. package/resources/components/Dashboard/Management/PermissionsDashboard.stx +35 -43
  194. package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +11 -13
  195. package/resources/components/Dashboard/Marketing/CampaignDialog.stx +1 -3
  196. package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +2 -2
  197. package/resources/components/Dashboard/Marketing/CampaignsTable.stx +2 -2
  198. package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +1 -1
  199. package/resources/components/Dashboard/Marketing/MarketingListsTable.stx +2 -2
  200. package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +1 -3
  201. package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +2 -2
  202. package/resources/components/Dashboard/Marketing/SocialPostsTable.stx +2 -2
  203. package/resources/components/Dashboard/Models/ModelRecordActions.stx +11 -2
  204. package/resources/components/Dashboard/Models/ModelRecordCreate.stx +193 -0
  205. package/resources/components/Dashboard/Models/ModelRecordDetail.stx +144 -0
  206. package/resources/components/Dashboard/Models/ModelRecordEdit.stx +176 -0
  207. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +52 -186
  208. package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -4
  209. package/resources/components/Dashboard/Monitoring/ErrorDashboard.stx +47 -81
  210. package/resources/components/Dashboard/Monitoring/ErrorTable.stx +4 -2
  211. package/resources/components/Dashboard/NotFoundDashboard.stx +4 -4
  212. package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +43 -77
  213. package/resources/components/Dashboard/Notifications/NotificationDeliveryOverview.stx +15 -17
  214. package/resources/components/Dashboard/Notifications/NotificationDeliveryTable.stx +1 -1
  215. package/resources/components/Dashboard/Operations/AuditDashboard.stx +1 -1
  216. package/resources/components/Dashboard/Operations/ChangeDashboard.stx +1 -1
  217. package/resources/components/Dashboard/Operations/IncidentDashboard.stx +1 -1
  218. package/resources/components/Dashboard/Operations/MigrationDashboard.stx +2 -2
  219. package/resources/components/Dashboard/Operations/RecoveryDashboard.stx +1 -1
  220. package/resources/components/Dashboard/Operations/SchedulerDashboard.stx +1 -1
  221. package/resources/components/Dashboard/Queries/QueryDashboard.stx +60 -86
  222. package/resources/components/Dashboard/Queries/QueryDetail.stx +5 -9
  223. package/resources/components/Dashboard/Realtime/RealtimeDashboard.stx +6 -8
  224. package/resources/components/Dashboard/Remote/RemoteConsole.stx +14 -20
  225. package/resources/components/Dashboard/Settings/AppearanceSettingsDashboard.stx +48 -54
  226. package/resources/components/Dashboard/Settings/MailSettingsDashboard.stx +8 -8
  227. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +43 -47
  228. package/resources/components/Dashboard/Teams/TeamInvitationDashboard.stx +2 -2
  229. package/resources/components/Dashboard/UI/ActivityTable.stx +2 -1
  230. package/resources/components/Dashboard/UI/Button.stx +15 -0
  231. package/resources/components/Dashboard/UI/MetricCards.stx +5 -7
  232. package/resources/components/Dashboard/UI/Pagination.stx +3 -5
  233. package/resources/components/Dashboard/UI/QuickLinks.stx +2 -2
  234. package/resources/components/Dashboard/UI/Select.stx +1 -0
  235. package/resources/components/Dashboard/UI/Table.stx +139 -96
  236. package/resources/components/Dashboard/UI/Tabs.stx +18 -20
  237. package/routes/dashboard-api.ts +2 -0
  238. package/routes/dashboard.ts +246 -253
  239. package/routes/storefront.ts +31 -0
  240. package/stx-components-plugin.ts +12 -1
  241. package/views/dashboard/content/categories/index.stx +1 -1
  242. package/views/dashboard/content/tags/index.stx +1 -1
  243. package/views/dashboard/layouts/default.stx +27 -12
  244. package/views/dashboard/models/[model]/[id]/edit.stx +8 -0
  245. package/views/dashboard/models/[model]/[id].stx +8 -0
  246. package/views/dashboard/models/[model]/create.stx +8 -0
  247. package/resources/components/Dashboard/CreateRecordModal.stx +0 -138
  248. package/resources/components/Dashboard/Models/EditRecordModal.stx +0 -81
@@ -13,24 +13,6 @@ export interface GroupedError {
13
13
  last_seen: string
14
14
  }
15
15
 
16
- /** What a page of groups asks for; every field may be left out. */
17
- export interface ErrorGroupQuery {
18
- page?: number
19
- perPage?: number
20
- search?: string
21
- status?: string
22
- type?: string
23
- sort?: string
24
- direction?: 'asc' | 'desc'
25
- }
26
-
27
- /** The page the groups are, and what the pager and the type filter need. */
28
- export interface ErrorGroupPageInfo {
29
- total: number
30
- page: number
31
- types: string[]
32
- }
33
-
34
16
  export interface ErrorRecord {
35
17
  id: number
36
18
  type: string
@@ -56,12 +38,8 @@ export interface ErrorTimelinePoint {
56
38
  count: number
57
39
  }
58
40
 
59
- // Create persistent storage for errors data
60
- const groupedErrors = useStorage<GroupedError[]>('grouped-errors', [])
61
- // Only the newest page request may land: typing, paging and filtering can
62
- // each start one while another is still out.
63
- let groupRequestId = 0
64
- const groupedErrorsPage = useStorage<ErrorGroupPageInfo>('grouped-errors-page', { total: 0, page: 1, types: [] })
41
+ // The Errors page lists the groups itself, through useServerList
42
+ // (stacksjs/stacks#3195); these are the cards and the timeline.
65
43
  const errorStats = useStorage<ErrorStats | null>('error-stats', null)
66
44
  const errorTimeline = useStorage<ErrorTimelinePoint[]>('error-timeline', [])
67
45
 
@@ -71,60 +49,30 @@ export function errorGroupParams(type: string, message: string): URLSearchParams
71
49
  return new URLSearchParams({ type, message })
72
50
  }
73
51
 
74
- /** The page query as URL parameters, leaving out what is empty. */
75
- export function errorGroupPageParams(query: ErrorGroupQuery): URLSearchParams {
76
- const params = new URLSearchParams()
77
- if (query.page)
78
- params.set('page', String(query.page))
79
- if (query.perPage)
80
- params.set('per_page', String(query.perPage))
81
- if (query.search)
82
- params.set('search', query.search)
83
- if (query.status)
84
- params.set('status', query.status)
85
- if (query.type)
86
- params.set('type', query.type)
87
- if (query.sort) {
88
- params.set('sort', query.sort)
89
- params.set('direction', query.direction ?? 'asc')
90
- }
91
- return params
52
+ /** One page of error groups, and what the pager and the type filter need. */
53
+ export interface ErrorGroupPage {
54
+ groups: GroupedError[]
55
+ total: number
56
+ page: number
57
+ /** Every recorded type, for the filter: a page alone would list only its own. */
58
+ types: string[]
92
59
  }
93
60
 
94
61
  /**
95
- * Fetch one page of grouped errors. The server searches, filters, sorts and
96
- * pages them (stacksjs/stacks#3195); this keeps the page and what the pager
97
- * and the type filter need.
62
+ * One page of grouped errors, searched, filtered, sorted and paged by the
63
+ * server (stacksjs/stacks#3195), for the page's useServerList. It throws
64
+ * when the groups cannot be read, so the page can say so: this used to log
65
+ * to the console and leave the last list cached in localStorage on screen.
98
66
  */
99
- async function fetchGroupedErrors(query: ErrorGroupQuery = {}): Promise<GroupedError[]> {
100
- const requestId = ++groupRequestId
101
- try {
102
- const params = errorGroupPageParams(query).toString()
103
- const response = await fetch(`${baseURL}/errors${params ? `?${params}` : ''}`)
104
- if (!response.ok) {
105
- throw new Error(`HTTP error! status: ${response.status}`)
106
- }
107
- const { data } = await response.json() as { data: { groups?: GroupedError[], total?: number, page?: number, types?: string[] } }
108
- if (requestId !== groupRequestId)
109
- return groupedErrors.value
110
-
111
- if (data && Array.isArray(data.groups)) {
112
- groupedErrors.value = data.groups
113
- groupedErrorsPage.value = {
114
- total: Number(data.total || 0),
115
- page: Number(data.page || 1),
116
- types: Array.isArray(data.types) ? data.types.map(String) : [],
117
- }
118
- return data.groups
119
- }
120
- else {
121
- console.error('Expected a page of error groups but received:', typeof data)
122
- return []
123
- }
124
- }
125
- catch (error) {
126
- console.error('Error fetching grouped errors:', error)
127
- return groupedErrors.value
67
+ export async function fetchErrorGroupPage(query: URLSearchParams): Promise<ErrorGroupPage> {
68
+ const { data } = await dashboardApi<{ data?: Partial<ErrorGroupPage> }>(`${baseURL}/errors?${query}`)
69
+ if (!data || !Array.isArray(data.groups))
70
+ throw new TypeError('Error groups were not returned in the expected shape.')
71
+ return {
72
+ groups: data.groups,
73
+ total: Number(data.total || 0),
74
+ page: Number(data.page || 1),
75
+ types: Array.isArray(data.types) ? data.types.map(String) : [],
128
76
  }
129
77
  }
130
78
 
@@ -212,13 +160,6 @@ async function resolveErrorGroup(type: string, message: string): Promise<boolean
212
160
  // (stacksjs/stacks#3194).
213
161
  await dashboardApi(`${baseURL}/errors/resolve`, { method: 'PATCH', body: { type, message } })
214
162
 
215
- // Update local state
216
- const group = groupedErrors.value.find(
217
- e => e.type === type && e.message === message,
218
- )
219
- if (group)
220
- group.status = 'resolved'
221
-
222
163
  return true
223
164
  }
224
165
  catch (error) {
@@ -237,13 +178,6 @@ async function ignoreErrorGroup(type: string, message: string): Promise<boolean>
237
178
  // (stacksjs/stacks#3194).
238
179
  await dashboardApi(`${baseURL}/errors/ignore`, { method: 'PATCH', body: { type, message } })
239
180
 
240
- // Update local state
241
- const group = groupedErrors.value.find(
242
- e => e.type === type && e.message === message,
243
- )
244
- if (group)
245
- group.status = 'ignored'
246
-
247
181
  return true
248
182
  }
249
183
  catch (error) {
@@ -262,13 +196,6 @@ async function unresolveErrorGroup(type: string, message: string): Promise<boole
262
196
  // (stacksjs/stacks#3194).
263
197
  await dashboardApi(`${baseURL}/errors/unresolve`, { method: 'PATCH', body: { type, message } })
264
198
 
265
- // Update local state
266
- const group = groupedErrors.value.find(
267
- e => e.type === type && e.message === message,
268
- )
269
- if (group)
270
- group.status = 'unresolved'
271
-
272
199
  return true
273
200
  }
274
201
  catch (error) {
@@ -285,11 +212,6 @@ async function deleteErrorGroup(type: string, message: string): Promise<boolean>
285
212
  // Through dashboardApi for the CSRF token, as the triage writes above.
286
213
  await dashboardApi(`${baseURL}/errors?${errorGroupParams(type, message)}`, { method: 'DELETE' })
287
214
 
288
- // Update local state
289
- groupedErrors.value = groupedErrors.value.filter(
290
- e => !(e.type === type && e.message === message),
291
- )
292
-
293
215
  return true
294
216
  }
295
217
  catch (error) {
@@ -300,11 +222,8 @@ async function deleteErrorGroup(type: string, message: string): Promise<boolean>
300
222
 
301
223
  export function useErrors() {
302
224
  return {
303
- groupedErrors,
304
- groupedErrorsPage,
305
225
  errorStats,
306
226
  errorTimeline,
307
- fetchGroupedErrors,
308
227
  fetchErrorById,
309
228
  fetchErrorGroup,
310
229
  fetchErrorStats,
@@ -53,17 +53,6 @@ export interface NotificationDeliveryHistory {
53
53
  }
54
54
  }
55
55
 
56
- export interface NotificationDeliveryHistoryQuery {
57
- page?: number
58
- perPage?: number
59
- channel?: NotificationDeliveryChannel | 'all'
60
- status?: NotificationDeliveryStatus | 'all'
61
- search?: string
62
- sort?: 'sent_at' | 'recipient' | 'channel' | 'status' | 'id'
63
- direction?: 'asc' | 'desc'
64
- signal?: AbortSignal
65
- }
66
-
67
56
  export async function fetchNotificationDeliveries(channel: DashboardDeliveryChannel): Promise<NotificationDelivery[]> {
68
57
  try {
69
58
  const deliveries = await dashboardApi<NotificationDelivery[]>(`/api/dashboard/notification-deliveries?channel=${channel}`)
@@ -87,33 +76,13 @@ export async function fetchNotificationDeliveryOverview(): Promise<NotificationD
87
76
  }
88
77
  }
89
78
 
90
- export async function fetchNotificationDeliveryHistory(
91
- query: NotificationDeliveryHistoryQuery = {},
92
- ): Promise<NotificationDeliveryHistory | null> {
93
- const params = new URLSearchParams()
94
- params.set('page', String(query.page || 1))
95
- params.set('per_page', String(query.perPage || 20))
96
- params.set('sort', query.sort || 'sent_at')
97
- params.set('direction', query.direction || 'desc')
98
- if (query.channel && query.channel !== 'all')
99
- params.set('channel', query.channel)
100
- if (query.status && query.status !== 'all')
101
- params.set('status', query.status)
102
- if (query.search)
103
- params.set('search', query.search)
104
-
105
- try {
106
- return await dashboardApi<NotificationDeliveryHistory>(
107
- `/api/dashboard/notification-deliveries/history?${params.toString()}`,
108
- { signal: query.signal },
109
- )
110
- }
111
- catch (error) {
112
- if (error instanceof DOMException && error.name === 'AbortError')
113
- return null
114
- pushToast('error', 'Could not load notification delivery history', { detail: String(error) })
115
- return null
116
- }
79
+ /**
80
+ * One page of the delivery history. `query` is what the History page's
81
+ * useServerList sends: the search, channel, status, sort, direction, page and
82
+ * per_page. Throws on a failed read so the list can say so.
83
+ */
84
+ export async function fetchNotificationDeliveryHistory(query: URLSearchParams): Promise<NotificationDeliveryHistory> {
85
+ return dashboardApi<NotificationDeliveryHistory>(`/api/dashboard/notification-deliveries/history?${query}`)
117
86
  }
118
87
 
119
88
  export async function retryNotificationDelivery(delivery: NotificationDelivery): Promise<boolean> {
@@ -56,16 +56,13 @@ export interface DashboardQueryShowResponse {
56
56
  query: DashboardQueryLog | null
57
57
  }
58
58
 
59
- export async function fetchDashboardQueries(filters: DashboardQueryFilters): Promise<DashboardQueryResponse> {
60
- const params = new URLSearchParams({
61
- range: filters.range,
62
- status: filters.status,
63
- type: filters.type,
64
- connection: filters.connection,
65
- page: String(filters.page),
66
- per_page: String(filters.perPage),
67
- })
68
- return dashboardApi<DashboardQueryResponse>(`/api/dashboard/queries?${params}`)
59
+ /**
60
+ * One page of the query log. `query` is what the Queries page's useServerList
61
+ * sends: the range, status, type and connection (each left out when it is
62
+ * "all", which the server reads the same), page and per_page.
63
+ */
64
+ export async function fetchDashboardQueries(query: URLSearchParams): Promise<DashboardQueryResponse> {
65
+ return dashboardApi<DashboardQueryResponse>(`/api/dashboard/queries?${query}`)
69
66
  }
70
67
 
71
68
  export async function fetchDashboardQuery(id: string): Promise<DashboardQueryLog | null> {
@@ -2,7 +2,7 @@
2
2
  "publisher": "Stacks",
3
3
  "name": "vscode-stacks",
4
4
  "displayName": "Stacks",
5
- "version": "0.75.529",
5
+ "version": "0.75.537",
6
6
  "description": "Stacks, built into VS Code: stx templates, pickier linting and formatting, encrypted env files, the dev server preview and every buddy command. No other extensions required.",
7
7
  "license": "MIT",
8
8
  "funding": "https://github.com/sponsors/chrisbbreuer",
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/defaults",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.75.529",
5
+ "version": "0.75.537",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "git+https://github.com/stacksjs/stacks.git",
@@ -45,10 +45,10 @@
45
45
  "dependencies": {
46
46
  "@iconify-json/f7": "^1.2.2",
47
47
  "@iconify-json/hugeicons": "^1.2.35",
48
- "@stacksjs/mobile": "0.75.529",
49
- "@stacksjs/sanitizer": "0.2.807",
50
- "@stacksjs/stx": "0.2.807",
51
- "@stacksjs/strings": "0.75.529",
48
+ "@stacksjs/mobile": "0.75.537",
49
+ "@stacksjs/sanitizer": "0.2.842",
50
+ "@stacksjs/stx": "0.2.842",
51
+ "@stacksjs/strings": "0.75.537",
52
52
  "@xterm/addon-fit": "^0.11.0",
53
53
  "@xterm/xterm": "^6.0.0",
54
54
  "ts-qr-codes": "^0.1.8"
@@ -81,7 +81,7 @@ onMount(() => {
81
81
  <section>
82
82
  <h2 class="font-semibold text-neutral-900 dark:text-white">Explore analytics</h2>
83
83
  <div class="grid gap-4 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 mt-4">
84
- <template :for="card in analyticsCards">
84
+ <div :for="card in analyticsCards" class="contents">
85
85
  <StxLink :to="card.to" class="block">
86
86
  <Card variant="default" padding="md" hoverable clickable>
87
87
  <div class="flex gap-4 items-start">
@@ -96,7 +96,7 @@ onMount(() => {
96
96
  </div>
97
97
  </Card>
98
98
  </StxLink>
99
- </template>
99
+ </div>
100
100
  </div>
101
101
  </section>
102
102
  </div>
@@ -177,18 +177,16 @@ onMount(() => {
177
177
  <h2 class="font-semibold text-gray-900 dark:text-white">Spend by currency</h2>
178
178
  </div>
179
179
  <div class="divide-gray-200 divide-y dark:divide-neutral-700">
180
- <template :for="spend in spendByCurrency()">
181
- <div class="flex gap-4 items-center justify-between px-4 py-3">
182
- <div>
183
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ spend.currency }}</p>
184
- <p class="text-gray-500 text-xs dark:text-neutral-400">{{ spend.campaigns }} campaigns</p>
185
- </div>
186
- <div class="text-right">
187
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ formatMoney(spend.spent, spend.currency) }}</p>
188
- <p class="text-gray-500 text-xs dark:text-neutral-400">of {{ formatMoney(spend.budget, spend.currency) }}</p>
189
- </div>
180
+ <div :for="spend in spendByCurrency()" class="flex gap-4 items-center justify-between px-4 py-3">
181
+ <div>
182
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ spend.currency }}</p>
183
+ <p class="text-gray-500 text-xs dark:text-neutral-400">{{ spend.campaigns }} campaigns</p>
190
184
  </div>
191
- </template>
185
+ <div class="text-right">
186
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ formatMoney(spend.spent, spend.currency) }}</p>
187
+ <p class="text-gray-500 text-xs dark:text-neutral-400">of {{ formatMoney(spend.budget, spend.currency) }}</p>
188
+ </div>
189
+ </div>
192
190
  </div>
193
191
  </div>
194
192
 
@@ -197,12 +195,10 @@ onMount(() => {
197
195
  <h2 class="font-semibold text-gray-900 dark:text-white">Campaign statuses</h2>
198
196
  </div>
199
197
  <div class="divide-gray-200 divide-y dark:divide-neutral-700">
200
- <template :for="status in statuses()">
201
- <div class="flex items-center justify-between px-4 py-3">
202
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ status.label }}</p>
203
- <p class="text-gray-500 text-sm dark:text-neutral-300">{{ status.count }}</p>
204
- </div>
205
- </template>
198
+ <div :for="status in statuses()" class="flex items-center justify-between px-4 py-3">
199
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ status.label }}</p>
200
+ <p class="text-gray-500 text-sm dark:text-neutral-300">{{ status.count }}</p>
201
+ </div>
206
202
  </div>
207
203
  </div>
208
204
  </section>
@@ -225,17 +221,15 @@ onMount(() => {
225
221
  </tr>
226
222
  </thead>
227
223
  <tbody class="divide-gray-200 divide-y dark:divide-neutral-700">
228
- <template :for="channel in channels()">
229
- <tr>
230
- <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ channel.name }}</td>
231
- <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ channel.currency }}</td>
232
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ channel.campaigns }}</td>
233
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(channel.sent) }}</td>
234
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatMoney(channel.spent, channel.currency) }}</td>
235
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatRate(channel.clickRate) }}</td>
236
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatRate(channel.conversionRate) }}</td>
237
- </tr>
238
- </template>
224
+ <tr :for="channel in channels()">
225
+ <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ channel.name }}</td>
226
+ <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ channel.currency }}</td>
227
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ channel.campaigns }}</td>
228
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(channel.sent) }}</td>
229
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatMoney(channel.spent, channel.currency) }}</td>
230
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatRate(channel.clickRate) }}</td>
231
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatRate(channel.conversionRate) }}</td>
232
+ </tr>
239
233
  </tbody>
240
234
  </table>
241
235
  </div>
@@ -171,15 +171,13 @@ onMount(() => {
171
171
  </tr>
172
172
  </thead>
173
173
  <tbody class="divide-gray-200 divide-y dark:divide-neutral-700">
174
- <template :for="row in events()">
175
- <tr>
176
- <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ row.name }}</td>
177
- <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ row.category }}</td>
178
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(row.count) }}</td>
179
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(row.value, row.currency) }}</td>
180
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatDate(row.lastSeen) }}</td>
181
- </tr>
182
- </template>
174
+ <tr :for="row in events()">
175
+ <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ row.name }}</td>
176
+ <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ row.category }}</td>
177
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(row.count) }}</td>
178
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(row.value, row.currency) }}</td>
179
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatDate(row.lastSeen) }}</td>
180
+ </tr>
183
181
  </tbody>
184
182
  </table>
185
183
  </div>
@@ -188,7 +186,7 @@ onMount(() => {
188
186
  <form class="self-start p-5 bg-white dark:bg-neutral-800 border border-gray-200 rounded-lg dark:border-neutral-700" @submit.prevent="submitEvent">
189
187
  <h2 class="font-semibold text-gray-900 dark:text-white">Record an event</h2>
190
188
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">Use this for verification or operational events. Production code can call AnalyticsEvent.create.</p>
191
- <div class="mt-4 space-y-4">
189
+ <div class="flex flex-col gap-4 mt-4">
192
190
  <div>
193
191
  <label for="event-name" class="block mb-1 font-medium text-gray-700 text-sm dark:text-neutral-300">Name</label>
194
192
  <input id="event-name" x-model="eventName" maxlength="100" required type="text" placeholder="newsletter_signup" class="block px-3 py-2 w-full text-gray-900 text-sm dark:text-white dark:bg-neutral-700 border border-gray-300 rounded-md dark:border-neutral-600" />
@@ -234,15 +232,13 @@ onMount(() => {
234
232
  </div>
235
233
  <div :if="categories().length === 0" class="px-4 py-10 text-center text-gray-500 text-sm dark:text-neutral-400">No categories for this period.</div>
236
234
  <div :if="categories().length > 0" class="divide-gray-200 divide-y dark:divide-neutral-700">
237
- <template :for="category in categories()">
238
- <div class="flex gap-4 items-center justify-between px-4 py-3">
239
- <div>
240
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ category.label }}</p>
241
- <p class="text-gray-500 text-xs dark:text-neutral-400">{{ category.name }}</p>
242
- </div>
243
- <p class="text-gray-500 text-sm dark:text-neutral-300">{{ category.count }} · {{ category.percentage }}%</p>
235
+ <div :for="category in categories()" class="flex gap-4 items-center justify-between px-4 py-3">
236
+ <div>
237
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ category.label }}</p>
238
+ <p class="text-gray-500 text-xs dark:text-neutral-400">{{ category.name }}</p>
244
239
  </div>
245
- </template>
240
+ <p class="text-gray-500 text-sm dark:text-neutral-300">{{ category.count }} · {{ category.percentage }}%</p>
241
+ </div>
246
242
  </div>
247
243
  </div>
248
244
 
@@ -253,15 +249,13 @@ onMount(() => {
253
249
  </div>
254
250
  <div :if="values().length === 0" class="px-4 py-10 text-center text-gray-500 text-sm dark:text-neutral-400">No valued events for this period.</div>
255
251
  <div :if="values().length > 0" class="divide-gray-200 divide-y dark:divide-neutral-700">
256
- <template :for="entry in values()">
257
- <div class="flex gap-4 items-center justify-between px-4 py-3">
258
- <div>
259
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ entry.currency }}</p>
260
- <p class="text-gray-500 text-xs dark:text-neutral-400">{{ entry.events }} valued events</p>
261
- </div>
262
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ formatCurrency(entry.value, entry.currency) }}</p>
252
+ <div :for="entry in values()" class="flex gap-4 items-center justify-between px-4 py-3">
253
+ <div>
254
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ entry.currency }}</p>
255
+ <p class="text-gray-500 text-xs dark:text-neutral-400">{{ entry.events }} valued events</p>
263
256
  </div>
264
- </template>
257
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ formatCurrency(entry.value, entry.currency) }}</p>
258
+ </div>
265
259
  </div>
266
260
  </div>
267
261
  </section>
@@ -283,14 +277,12 @@ onMount(() => {
283
277
  </tr>
284
278
  </thead>
285
279
  <tbody class="divide-gray-200 divide-y dark:divide-neutral-700">
286
- <template :for="occurrence in recentEvents()">
287
- <tr>
288
- <td class="px-4 py-3 text-gray-500 text-sm whitespace-nowrap dark:text-neutral-300">{{ formatDate(occurrence.createdAt) }}</td>
289
- <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ occurrence.name }}</td>
290
- <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ occurrence.category }}</td>
291
- <td class="px-4 py-3 font-mono text-gray-500 text-xs dark:text-neutral-300">{{ occurrence.path || 'Not set' }}</td>
292
- </tr>
293
- </template>
280
+ <tr :for="occurrence in recentEvents()">
281
+ <td class="px-4 py-3 text-gray-500 text-sm whitespace-nowrap dark:text-neutral-300">{{ formatDate(occurrence.createdAt) }}</td>
282
+ <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ occurrence.name }}</td>
283
+ <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ occurrence.category }}</td>
284
+ <td class="px-4 py-3 font-mono text-gray-500 text-xs dark:text-neutral-300">{{ occurrence.path || 'Not set' }}</td>
285
+ </tr>
294
286
  </tbody>
295
287
  </table>
296
288
  </div>
@@ -122,16 +122,14 @@ onMount(() => {
122
122
  </tr>
123
123
  </thead>
124
124
  <tbody class="divide-gray-200 divide-y dark:divide-neutral-700">
125
- <template :for="total in currencyTotals()">
126
- <tr>
127
- <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ total.currency }}</td>
128
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(total.orders) }}</td>
129
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(total.gross, total.currency) }}</td>
130
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(total.cancelled, total.currency) }}</td>
131
- <td class="px-4 py-3 font-medium text-gray-900 text-right text-sm dark:text-white">{{ formatCurrency(total.net, total.currency) }}</td>
132
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(total.average, total.currency) }}</td>
133
- </tr>
134
- </template>
125
+ <tr :for="total in currencyTotals()">
126
+ <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ total.currency }}</td>
127
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(total.orders) }}</td>
128
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(total.gross, total.currency) }}</td>
129
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(total.cancelled, total.currency) }}</td>
130
+ <td class="px-4 py-3 font-medium text-gray-900 text-right text-sm dark:text-white">{{ formatCurrency(total.net, total.currency) }}</td>
131
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(total.average, total.currency) }}</td>
132
+ </tr>
135
133
  </tbody>
136
134
  </table>
137
135
  </div>
@@ -159,17 +157,15 @@ onMount(() => {
159
157
  </tr>
160
158
  </thead>
161
159
  <tbody class="divide-gray-200 divide-y dark:divide-neutral-700">
162
- <template :for="method in paymentMethods()">
163
- <tr>
164
- <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ method.method }}</td>
165
- <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ method.currency }}</td>
166
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(method.transactions) }}</td>
167
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(method.amount, method.currency) }}</td>
168
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(method.refunds, method.currency) }}</td>
169
- <td class="px-4 py-3 font-medium text-gray-900 text-right text-sm dark:text-white">{{ formatCurrency(method.net, method.currency) }}</td>
170
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ method.percentage }}%</td>
171
- </tr>
172
- </template>
160
+ <tr :for="method in paymentMethods()">
161
+ <td class="px-4 py-3 font-medium text-gray-900 text-sm dark:text-white">{{ method.method }}</td>
162
+ <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ method.currency }}</td>
163
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatNumber(method.transactions) }}</td>
164
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(method.amount, method.currency) }}</td>
165
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(method.refunds, method.currency) }}</td>
166
+ <td class="px-4 py-3 font-medium text-gray-900 text-right text-sm dark:text-white">{{ formatCurrency(method.net, method.currency) }}</td>
167
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ method.percentage }}%</td>
168
+ </tr>
173
169
  </tbody>
174
170
  </table>
175
171
  </div>
@@ -192,14 +188,12 @@ onMount(() => {
192
188
  </tr>
193
189
  </thead>
194
190
  <tbody class="divide-gray-200 divide-y dark:divide-neutral-700">
195
- <template :for="day in dailyOrders()">
196
- <tr>
197
- <td class="px-4 py-3 text-gray-900 text-sm dark:text-white">{{ day.date }}</td>
198
- <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ day.currency }}</td>
199
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ day.orders }}</td>
200
- <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(day.value, day.currency) }}</td>
201
- </tr>
202
- </template>
191
+ <tr :for="day in dailyOrders()">
192
+ <td class="px-4 py-3 text-gray-900 text-sm dark:text-white">{{ day.date }}</td>
193
+ <td class="px-4 py-3 text-gray-500 text-sm dark:text-neutral-300">{{ day.currency }}</td>
194
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ day.orders }}</td>
195
+ <td class="px-4 py-3 text-gray-500 text-right text-sm dark:text-neutral-300">{{ formatCurrency(day.value, day.currency) }}</td>
196
+ </tr>
203
197
  </tbody>
204
198
  </table>
205
199
  </div>
@@ -214,15 +208,13 @@ onMount(() => {
214
208
  <p class="mt-1 text-gray-500 text-sm dark:text-neutral-400">Product performance appears after orders contain OrderItem records.</p>
215
209
  </div>
216
210
  <div :if="topProducts().length > 0" class="divide-gray-200 divide-y dark:divide-neutral-700">
217
- <template :for="product in topProducts()">
218
- <div class="flex gap-4 items-center justify-between px-4 py-3">
219
- <div>
220
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ product.name }}</p>
221
- <p class="text-gray-500 text-xs dark:text-neutral-400">{{ formatNumber(product.quantity) }} units</p>
222
- </div>
223
- <p class="font-medium text-gray-900 text-sm dark:text-white">{{ formatCurrency(product.revenue, product.currency) }}</p>
211
+ <div :for="product in topProducts()" class="flex gap-4 items-center justify-between px-4 py-3">
212
+ <div>
213
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ product.name }}</p>
214
+ <p class="text-gray-500 text-xs dark:text-neutral-400">{{ formatNumber(product.quantity) }} units</p>
224
215
  </div>
225
- </template>
216
+ <p class="font-medium text-gray-900 text-sm dark:text-white">{{ formatCurrency(product.revenue, product.currency) }}</p>
217
+ </div>
226
218
  </div>
227
219
  </div>
228
220
  </section>