@stacksjs/defaults 0.75.612 → 0.75.613

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 (116) hide show
  1. package/ai/skills/stacks-actions/SKILL.md +208 -0
  2. package/ai/skills/stacks-api/SKILL.md +1 -1
  3. package/ai/skills/stacks-buddy/SKILL.md +1 -1
  4. package/ai/skills/stacks-dashboard/SKILL.md +79 -0
  5. package/ai/skills/stacks-middleware/SKILL.md +4 -1
  6. package/ai/skills/stacks-native/CATALOG.md +12 -12
  7. package/ai/skills/stacks-validation/SKILL.md +7 -0
  8. package/app/Actions/Storefront/AddToCartAction.ts +12 -15
  9. package/app/Actions/Storefront/CheckoutContactAction.ts +18 -10
  10. package/app/Actions/Storefront/CheckoutShippingAction.ts +20 -10
  11. package/app/Actions/Storefront/PlaceOrderAction.ts +9 -12
  12. package/app/Actions/Storefront/UpdateCartItemAction.ts +11 -9
  13. package/app/Middleware/Abilities.ts +4 -3
  14. package/app/Middleware/Csrf.ts +10 -1
  15. package/app/Middleware/Throttle.ts +4 -4
  16. package/ide/vscode/package.json +1 -1
  17. package/package.json +5 -5
  18. package/resources/components/Dashboard/Analytics/AnalyticsPageHeader.stx +3 -13
  19. package/resources/components/Dashboard/App/RequestsOverview.stx +3 -20
  20. package/resources/components/Dashboard/App/SourceInventory.stx +1 -5
  21. package/resources/components/Dashboard/Auth/AccessTokenCreateDialog.stx +11 -28
  22. package/resources/components/Dashboard/Commerce/CommerceCategoriesDashboard.stx +4 -8
  23. package/resources/components/Dashboard/Commerce/CommerceCategoryDialog.stx +9 -9
  24. package/resources/components/Dashboard/Commerce/CommerceCouponDialog.stx +14 -14
  25. package/resources/components/Dashboard/Commerce/CommerceCouponsDashboard.stx +5 -9
  26. package/resources/components/Dashboard/Commerce/CommerceCustomerDialog.stx +7 -7
  27. package/resources/components/Dashboard/Commerce/CommerceCustomersDashboard.stx +3 -7
  28. package/resources/components/Dashboard/Commerce/CommerceGiftCardDialog.stx +15 -15
  29. package/resources/components/Dashboard/Commerce/CommerceGiftCardsDashboard.stx +5 -9
  30. package/resources/components/Dashboard/Commerce/CommerceManufacturerDialog.stx +12 -15
  31. package/resources/components/Dashboard/Commerce/CommerceManufacturersDashboard.stx +4 -28
  32. package/resources/components/Dashboard/Commerce/CommerceOrderDialog.stx +15 -15
  33. package/resources/components/Dashboard/Commerce/CommerceOrdersDashboard.stx +4 -8
  34. package/resources/components/Dashboard/Commerce/CommerceOverviewDashboard.stx +3 -11
  35. package/resources/components/Dashboard/Commerce/CommercePaymentsDashboard.stx +8 -9
  36. package/resources/components/Dashboard/Commerce/CommercePosCatalog.stx +3 -20
  37. package/resources/components/Dashboard/Commerce/CommercePosCheckoutDialog.stx +4 -4
  38. package/resources/components/Dashboard/Commerce/CommerceProductDialog.stx +14 -14
  39. package/resources/components/Dashboard/Commerce/CommerceProductsDashboard.stx +4 -8
  40. package/resources/components/Dashboard/Commerce/CommerceReviewEditDialog.stx +14 -24
  41. package/resources/components/Dashboard/Commerce/CommerceReviewsDashboard.stx +5 -43
  42. package/resources/components/Dashboard/Commerce/CommerceTaxDialog.stx +22 -38
  43. package/resources/components/Dashboard/Commerce/CommerceTaxesDashboard.stx +5 -33
  44. package/resources/components/Dashboard/Commerce/CommerceUnitDialog.stx +16 -30
  45. package/resources/components/Dashboard/Commerce/CommerceUnitsDashboard.stx +4 -28
  46. package/resources/components/Dashboard/Commerce/CommerceVariantDialog.stx +15 -9
  47. package/resources/components/Dashboard/Commerce/CommerceVariantsDashboard.stx +8 -9
  48. package/resources/components/Dashboard/Commerce/Delivery/CourierDialog.stx +14 -12
  49. package/resources/components/Dashboard/Commerce/Delivery/DeliveryRouteDialog.stx +9 -11
  50. package/resources/components/Dashboard/Commerce/Delivery/DigitalDeliveryDialog.stx +15 -9
  51. package/resources/components/Dashboard/Commerce/Delivery/LicenseKeyDialog.stx +11 -7
  52. package/resources/components/Dashboard/Commerce/Delivery/ShippingMethodDialog.stx +14 -8
  53. package/resources/components/Dashboard/Commerce/Delivery/ShippingRateDialog.stx +11 -17
  54. package/resources/components/Dashboard/Commerce/Delivery/ShippingZoneDialog.stx +18 -12
  55. package/resources/components/Dashboard/Commerce/PaymentRefundDialog.stx +1 -1
  56. package/resources/components/Dashboard/Commerce/PrintDeviceDialog.stx +5 -5
  57. package/resources/components/Dashboard/Commerce/PrintDevicesDashboard.stx +4 -8
  58. package/resources/components/Dashboard/Commerce/PrintLogsDashboard.stx +5 -9
  59. package/resources/components/Dashboard/Commerce/ProductWaitlistDashboard.stx +2 -10
  60. package/resources/components/Dashboard/Commerce/ProductWaitlistEntryDialog.stx +14 -67
  61. package/resources/components/Dashboard/Commerce/RestaurantWaitlistDashboard.stx +3 -18
  62. package/resources/components/Dashboard/Commerce/RestaurantWaitlistEntryDialog.stx +23 -69
  63. package/resources/components/Dashboard/Content/AuthorEditorDialog.stx +4 -16
  64. package/resources/components/Dashboard/Content/BlogDashboard.stx +2 -19
  65. package/resources/components/Dashboard/Content/BlogPostEditorDialog.stx +31 -51
  66. package/resources/components/Dashboard/Content/CommentsDashboard.stx +1 -1
  67. package/resources/components/Dashboard/Content/ContentDashboard.stx +1 -11
  68. package/resources/components/Dashboard/Content/CreateFolderDialog.stx +1 -4
  69. package/resources/components/Dashboard/Content/FileManagerDashboard.stx +2 -2
  70. package/resources/components/Dashboard/Content/PageEditorDialog.stx +8 -17
  71. package/resources/components/Dashboard/Content/PostEditorDialog.stx +35 -45
  72. package/resources/components/Dashboard/Content/PostsDashboard.stx +1 -13
  73. package/resources/components/Dashboard/Content/SeoDashboard.stx +2 -20
  74. package/resources/components/Dashboard/Content/SeoEditorDialog.stx +4 -38
  75. package/resources/components/Dashboard/Content/TaxonomyEditorDialog.stx +8 -15
  76. package/resources/components/Dashboard/Data/ActivityLog.stx +1 -5
  77. package/resources/components/Dashboard/Deployments/DeploymentList.stx +2 -11
  78. package/resources/components/Dashboard/Email/InboxMessageList.stx +1 -5
  79. package/resources/components/Dashboard/Infrastructure/DnsDashboard.stx +2 -16
  80. package/resources/components/Dashboard/Infrastructure/LogsDashboard.stx +6 -10
  81. package/resources/components/Dashboard/Infrastructure/MailboxesDashboard.stx +1 -5
  82. package/resources/components/Dashboard/Infrastructure/ServersDashboard.stx +1 -5
  83. package/resources/components/Dashboard/Jobs/JobHistory.stx +3 -12
  84. package/resources/components/Dashboard/Kanban/KanbanCardDialog.stx +57 -51
  85. package/resources/components/Dashboard/Library/ComponentsDashboard.stx +4 -14
  86. package/resources/components/Dashboard/Library/DependenciesDashboard.stx +2 -15
  87. package/resources/components/Dashboard/Library/PackagesDashboard.stx +1 -8
  88. package/resources/components/Dashboard/Library/SourceScaffoldDialog.stx +1 -12
  89. package/resources/components/Dashboard/Management/PermissionsDashboard.stx +3 -3
  90. package/resources/components/Dashboard/Marketing/AbandonedCartsDashboard.stx +4 -4
  91. package/resources/components/Dashboard/Marketing/CampaignDeliveryDialog.stx +3 -5
  92. package/resources/components/Dashboard/Marketing/CampaignDialog.stx +59 -93
  93. package/resources/components/Dashboard/Marketing/CampaignsDashboard.stx +5 -5
  94. package/resources/components/Dashboard/Marketing/MarketingListDialog.stx +12 -26
  95. package/resources/components/Dashboard/Marketing/MarketingListsDashboard.stx +4 -4
  96. package/resources/components/Dashboard/Marketing/RecoveryCampaignDialog.stx +12 -43
  97. package/resources/components/Dashboard/Marketing/SocialPostDialog.stx +7 -41
  98. package/resources/components/Dashboard/Marketing/SocialPostsDashboard.stx +5 -5
  99. package/resources/components/Dashboard/Models/ModelRecordsDashboard.stx +7 -23
  100. package/resources/components/Dashboard/Models/ModelsOverview.stx +2 -12
  101. package/resources/components/Dashboard/Notifications/NotificationDeliveries.stx +4 -27
  102. package/resources/components/Dashboard/Notifications/NotificationDeliveryHistory.stx +4 -36
  103. package/resources/components/Dashboard/Operations/RecoveryDestinationDialog.stx +18 -47
  104. package/resources/components/Dashboard/Operations/RecoveryPolicyDialog.stx +24 -78
  105. package/resources/components/Dashboard/Operations/RecoveryRestoreDialog.stx +8 -19
  106. package/resources/components/Dashboard/Queries/QueryDashboard.stx +3 -21
  107. package/resources/components/Dashboard/Releases/ReleaseDashboard.stx +2 -9
  108. package/resources/components/Dashboard/Settings/SettingsDashboard.stx +1 -11
  109. package/resources/components/Dashboard/UI/Input.stx +50 -1
  110. package/resources/components/Dashboard/UI/SearchFilter.stx +27 -17
  111. package/resources/components/Dashboard/UI/Select.stx +4 -1
  112. package/resources/components/Dashboard/UI/Textarea.stx +16 -1
  113. package/resources/views/cart.stx +14 -0
  114. package/resources/views/checkout/contact.stx +15 -1
  115. package/resources/views/checkout/payment.stx +7 -0
  116. package/resources/views/checkout/shipping.stx +39 -5
@@ -79,12 +79,31 @@ const ship = {
79
79
  state: cart?.shipping_state || '',
80
80
  zip: cart?.shipping_zip || '',
81
81
  }
82
+
83
+ // After a refused submission: each field's message and what was typed, so
84
+ // the form is drawn as it was left. The saved address on a first visit.
85
+ const shipField = (field: string, saved: string): { value: string, error: string } => ({
86
+ value: requestContext.old(field, saved),
87
+ error: requestContext.error(field),
88
+ })
89
+ const shipName = shipField('shipping_name', ship.name)
90
+ const shipAddress = shipField('shipping_address', ship.address)
91
+ const shipCity = shipField('shipping_city', ship.city)
92
+ const shipState = shipField('shipping_state', ship.state)
93
+ const shipZip = shipField('shipping_zip', ship.zip)
94
+ // Why the form this page posted was refused, when it was not about one field
95
+ // ("Your cart is empty."). Shown once (stacksjs/stacks#3311).
96
+ const formError = requestContext.formError()
82
97
  </script>
83
98
 
84
99
  @section('content')
85
100
  <div class="mx-auto px-6 py-12 max-w-5xl">
86
101
  <CheckoutSteps current="shipping" />
87
102
 
103
+ @if (formError)
104
+ <p role="alert" class="mb-6 px-4 py-3 font-medium text-red-800 text-sm bg-red-50 border border-red-200 rounded-xl">{{ formError }}</p>
105
+ @endif
106
+
88
107
  @if (items.length === 0 || !cart?.email)
89
108
  <div class="p-12 text-center border border-dashed border-stone-300 rounded-3xl">
90
109
  <p class="text-stone-500">Start at the contact step.</p>
@@ -99,28 +118,43 @@ const ship = {
99
118
  <form action="/api/checkout/shipping" method="POST" class="mt-8 space-y-5">
100
119
  <div>
101
120
  <label class="font-semibold text-stone-500 text-xs tracking-wider uppercase">Full name</label>
102
- <input type="text" name="shipping_name" required autocomplete="name" value="{{ ship.name }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
121
+ <input type="text" name="shipping_name" required autocomplete="name" value="{{ shipName.value }}" aria-invalid="{{ shipName.error ? 'true' : 'false' }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
122
+ @if (shipName.error)
123
+ <p role="alert" class="mt-2 text-red-700 text-sm">{{ shipName.error }}</p>
124
+ @endif
103
125
  </div>
104
126
 
105
127
  <div>
106
128
  <label class="font-semibold text-stone-500 text-xs tracking-wider uppercase">Street address</label>
107
- <input type="text" name="shipping_address" required autocomplete="street-address" value="{{ ship.address }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
129
+ <input type="text" name="shipping_address" required autocomplete="street-address" value="{{ shipAddress.value }}" aria-invalid="{{ shipAddress.error ? 'true' : 'false' }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
130
+ @if (shipAddress.error)
131
+ <p role="alert" class="mt-2 text-red-700 text-sm">{{ shipAddress.error }}</p>
132
+ @endif
108
133
  </div>
109
134
 
110
135
  <div class="grid gap-4 grid-cols-2">
111
136
  <div>
112
137
  <label class="font-semibold text-stone-500 text-xs tracking-wider uppercase">City</label>
113
- <input type="text" name="shipping_city" required autocomplete="address-level2" value="{{ ship.city }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
138
+ <input type="text" name="shipping_city" required autocomplete="address-level2" value="{{ shipCity.value }}" aria-invalid="{{ shipCity.error ? 'true' : 'false' }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
139
+ @if (shipCity.error)
140
+ <p role="alert" class="mt-2 text-red-700 text-sm">{{ shipCity.error }}</p>
141
+ @endif
114
142
  </div>
115
143
  <div>
116
144
  <label class="font-semibold text-stone-500 text-xs tracking-wider uppercase">State</label>
117
- <input type="text" name="shipping_state" required autocomplete="address-level1" value="{{ ship.state }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
145
+ <input type="text" name="shipping_state" required autocomplete="address-level1" value="{{ shipState.value }}" aria-invalid="{{ shipState.error ? 'true' : 'false' }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
146
+ @if (shipState.error)
147
+ <p role="alert" class="mt-2 text-red-700 text-sm">{{ shipState.error }}</p>
148
+ @endif
118
149
  </div>
119
150
  </div>
120
151
 
121
152
  <div class="max-w-[200px]">
122
153
  <label class="font-semibold text-stone-500 text-xs tracking-wider uppercase">ZIP / Postal</label>
123
- <input type="text" name="shipping_zip" required autocomplete="postal-code" value="{{ ship.zip }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
154
+ <input type="text" name="shipping_zip" required autocomplete="postal-code" value="{{ shipZip.value }}" aria-invalid="{{ shipZip.error ? 'true' : 'false' }}" class="mt-1 px-4 py-3 w-full text-sm border border-stone-300 rounded-2xl focus:border-stone-900 focus:outline-none">
155
+ @if (shipZip.error)
156
+ <p role="alert" class="mt-2 text-red-700 text-sm">{{ shipZip.error }}</p>
157
+ @endif
124
158
  </div>
125
159
 
126
160
  <div class="flex gap-4 items-center justify-between pt-2">