@stacksjs/defaults 0.75.618 → 0.75.622

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 (94) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +1 -1
  2. package/ai/skills/stacks-auth/SKILL.md +12 -1
  3. package/ai/skills/stacks-auto-imports/SKILL.md +1 -1
  4. package/ai/skills/stacks-buddy/SKILL.md +70 -7
  5. package/ai/skills/stacks-commerce/SKILL.md +78 -4
  6. package/ai/skills/stacks-dashboard/SKILL.md +32 -2
  7. package/ai/skills/stacks-database/SKILL.md +1 -1
  8. package/ai/skills/stacks-development/SKILL.md +3 -0
  9. package/ai/skills/stacks-migrations/SKILL.md +10 -2
  10. package/ai/skills/stacks-mobile/SKILL.md +21 -2
  11. package/ai/skills/stacks-models/SKILL.md +2 -2
  12. package/ai/skills/stacks-native/CATALOG.md +21 -21
  13. package/ai/skills/stacks-orm/SKILL.md +2 -2
  14. package/ai/skills/stacks-utils/SKILL.md +8 -3
  15. package/app/Actions/Dashboard/Commerce/CommerceDiscountDestroyAction.ts +27 -0
  16. package/app/Actions/Dashboard/Commerce/CommerceDiscountStoreAction.ts +28 -0
  17. package/app/Actions/Dashboard/Commerce/CommerceDiscountUpdateAction.ts +30 -0
  18. package/app/Actions/Dashboard/Commerce/CommerceDiscountsAction.ts +42 -0
  19. package/app/Actions/Dashboard/Commerce/CommerceUpsellDestroyAction.ts +31 -0
  20. package/app/Actions/Dashboard/Commerce/CommerceUpsellDetailAction.ts +28 -0
  21. package/app/Actions/Dashboard/Commerce/CommerceUpsellStoreAction.ts +26 -0
  22. package/app/Actions/Dashboard/Commerce/CommerceUpsellUpdateAction.ts +29 -0
  23. package/app/Actions/Dashboard/Commerce/CommerceUpsellsAction.ts +40 -0
  24. package/app/Actions/Dashboard/Commerce/commerce-discount-list.ts +204 -0
  25. package/app/Actions/Dashboard/Commerce/commerce-discount-write.ts +53 -0
  26. package/app/Actions/Dashboard/Commerce/commerce-discounts-upsells.test.ts +228 -0
  27. package/app/Actions/Dashboard/Commerce/commerce-upsell-list.ts +289 -0
  28. package/app/Actions/Dashboard/Commerce/discount-records.ts +392 -0
  29. package/app/Actions/Dashboard/Commerce/upsell-offer-records.ts +307 -0
  30. package/app/Actions/Dashboard/Models/ModelSaveAction.ts +6 -1
  31. package/app/Actions/Dashboard/Models/model-relations.ts +17 -7
  32. package/app/Actions/Dashboard/Models/model-row-writes.ts +9 -8
  33. package/app/Actions/Dashboard/Models/model-write.ts +51 -2
  34. package/app/Actions/Dashboard/Remote/RemoteCommandRunAction.ts +1 -2
  35. package/app/Actions/Dashboard/Remote/RemoteTerminalCloseAction.ts +1 -2
  36. package/app/Actions/Dashboard/Remote/RemoteTerminalInputAction.ts +1 -2
  37. package/app/Actions/Dashboard/Remote/RemoteTerminalOpenAction.ts +1 -2
  38. package/app/Actions/Dashboard/Remote/RemoteTerminalResizeAction.ts +1 -2
  39. package/app/Actions/Dashboard/Remote/RemoteTerminalStreamAction.ts +1 -2
  40. package/app/Actions/Dashboard/Remote/remote-commands.test.ts +2 -2
  41. package/app/Actions/Dashboard/Remote/remote-commands.ts +4 -4
  42. package/app/Actions/Dashboard/Remote/remote-terminal.test.ts +45 -25
  43. package/app/Actions/Dashboard/Remote/remote-terminal.ts +9 -9
  44. package/app/Actions/Storefront/AcceptOrderOfferAction.ts +68 -0
  45. package/app/Actions/Storefront/ApplyDiscountCodeAction.ts +83 -0
  46. package/app/Actions/Storefront/DeclineOrderOfferAction.ts +25 -0
  47. package/app/Actions/Storefront/PlaceOrderAction.ts +135 -72
  48. package/app/Gates.ts +4 -4
  49. package/app/Mail/OrderConfirmation.ts +7 -1
  50. package/app/Models/commerce/Cart.ts +14 -0
  51. package/app/Models/commerce/Discount.ts +255 -0
  52. package/app/Models/commerce/PostPurchaseOffer.ts +175 -0
  53. package/app/Models/commerce/PostPurchaseOfferResponse.ts +145 -0
  54. package/app/Policies/PostPolicy.ts +11 -11
  55. package/app/Storefront/DiscountCodeMessages.ts +12 -0
  56. package/app/Storefront/OrderKey.ts +29 -0
  57. package/app/Storefront/StorefrontPricing.ts +211 -0
  58. package/app/Storefront/UpsellCharge.ts +43 -0
  59. package/functions/projects.test.ts +38 -0
  60. package/functions/projects.ts +99 -0
  61. package/ide/vscode/package.json +1 -1
  62. package/package.json +7 -7
  63. package/resources/components/Dashboard/Commerce/CommerceDiscountBreakdown.stx +72 -0
  64. package/resources/components/Dashboard/Commerce/CommerceDiscountDeleteDialog.stx +19 -0
  65. package/resources/components/Dashboard/Commerce/CommerceDiscountDetailsDialog.stx +110 -0
  66. package/resources/components/Dashboard/Commerce/CommerceDiscountDialog.stx +353 -0
  67. package/resources/components/Dashboard/Commerce/CommerceDiscountsDashboard.stx +211 -0
  68. package/resources/components/Dashboard/Commerce/CommerceDiscountsTable.stx +105 -0
  69. package/resources/components/Dashboard/Commerce/CommerceProductPicker.stx +115 -0
  70. package/resources/components/Dashboard/Commerce/CommerceUpsellDeleteDialog.stx +21 -0
  71. package/resources/components/Dashboard/Commerce/CommerceUpsellDetailsDialog.stx +153 -0
  72. package/resources/components/Dashboard/Commerce/CommerceUpsellDialog.stx +191 -0
  73. package/resources/components/Dashboard/Commerce/CommerceUpsellsDashboard.stx +214 -0
  74. package/resources/components/Dashboard/Commerce/CommerceUpsellsTable.stx +91 -0
  75. package/resources/components/Dashboard/Email/InboxSettingsDashboard.stx +4 -19
  76. package/resources/components/Dashboard/ProjectSwitcher.stx +302 -0
  77. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +5 -3
  78. package/resources/components/Dashboard/UI/SearchFilter.stx +7 -4
  79. package/resources/components/Storefront/OrderSummary.stx +17 -0
  80. package/resources/functions/dashboard/project-switcher.test.ts +14 -0
  81. package/resources/functions/dashboard/project-switcher.ts +28 -0
  82. package/resources/functions/dashboard/sidebar.ts +4 -1
  83. package/resources/plugins/preloader.ts +33 -2
  84. package/resources/views/cart.stx +50 -16
  85. package/resources/views/checkout/contact.stx +11 -5
  86. package/resources/views/checkout/payment.stx +11 -5
  87. package/resources/views/checkout/shipping.stx +11 -5
  88. package/resources/views/orders/[id].stx +227 -50
  89. package/routes/dashboard-api.ts +12 -0
  90. package/routes/dashboard.ts +2 -0
  91. package/routes/storefront.ts +8 -0
  92. package/views/dashboard/commerce/discounts/index.stx +10 -0
  93. package/views/dashboard/commerce/upsells/index.stx +10 -0
  94. package/views/dashboard/layouts/default.stx +17 -0
@@ -16,10 +16,16 @@
16
16
  // vendored or linked. `@stacksjs/defaults/*` is mapped onto the vendored tree in
17
17
  // `storage/framework/tsconfig.app.json` and falls back to the installed
18
18
  // package when there is none, so it resolves in both layouts.
19
+ import { dashboardProjectIdentity } from '@stacksjs/defaults/resources/functions/dashboard/project-switcher'
19
20
  import { buildWebSidebarSections, webSidebarRoleMap } from '@stacksjs/defaults/resources/functions/dashboard/sidebar'
20
21
 
21
22
  export const sidebarSections = buildWebSidebarSections()
22
23
 
24
+ // The project this dashboard serves, for the switcher at the top of the
25
+ // sidebar. Only its name: the list of other projects is fetched by the
26
+ // switcher itself, because this layout is rendered once and kept.
27
+ export const dashboardProject = dashboardProjectIdentity()
28
+
23
29
  // Role gating (stacksjs/stacks#1843). Models can declare
24
30
  // `dashboard.roles: ['admin', 'dev']`; rows for those models are hidden from
25
31
  // viewers who hold none of them. Emitted as an id-keyed map rather than a
@@ -429,6 +435,14 @@ html[data-appearance="arc"] [data-sidebar-section] > div:first-child {
429
435
  opacity: 0.55;
430
436
  }
431
437
 
438
+ /* The project switcher's menu hangs below the sidebar header, over the rows.
439
+ The header and the scroll area are stacked at the same level and the scroll
440
+ area comes later, so it would paint over the menu: the header is lifted
441
+ while the menu is open. */
442
+ [data-stx-sidebar] > div:has([data-project-switcher][data-open="true"]) {
443
+ z-index: 30;
444
+ }
445
+
432
446
  /* A viewer can hide navigation sections they never use. Kept as CSS on an
433
447
  attribute rather than a DOM removal so the rows stay hydrated and a later
434
448
  change re-shows them without a re-render - the same approach the role
@@ -758,6 +772,9 @@ onDestroy(() => {
758
772
  region, and in a browser it is the same empty strip macOS sidebars
759
773
  carry above their first row. -->
760
774
  <SidebarHeader windowControls="native" />
775
+ @if(dashboardProject.enabled)
776
+ <ProjectSwitcher :name="dashboardProject.name" />
777
+ @endif
761
778
  </template>
762
779
  <template #footer>
763
780
  <div class="px-3 py-2 text-neutral-600 text-xs dark:text-neutral-300" data-sidebar-order-controls>