@mohasinac/appkit 2.7.36 → 2.7.38

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 (144) hide show
  1. package/dist/_internal/client/features/layout/DashboardLayoutClient.js +1 -1
  2. package/dist/_internal/client/features/seller/print-center/InventoryLabel.d.ts +12 -0
  3. package/dist/_internal/client/features/seller/print-center/InventoryLabel.js +49 -0
  4. package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.d.ts +7 -0
  5. package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.js +32 -0
  6. package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.d.ts +28 -0
  7. package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.js +33 -0
  8. package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.d.ts +12 -0
  9. package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.js +30 -0
  10. package/dist/_internal/client/features/seller/print-center/PrintCenterView.d.ts +12 -0
  11. package/dist/_internal/client/features/seller/print-center/PrintCenterView.js +102 -0
  12. package/dist/_internal/client/features/seller/print-center/PrintGrid.d.ts +12 -0
  13. package/dist/_internal/client/features/seller/print-center/PrintGrid.js +13 -0
  14. package/dist/_internal/client/features/seller/print-center/StoreCard.d.ts +19 -0
  15. package/dist/_internal/client/features/seller/print-center/StoreCard.js +30 -0
  16. package/dist/_internal/client/features/seller/print-center/WebsiteCard.d.ts +11 -0
  17. package/dist/_internal/client/features/seller/print-center/WebsiteCard.js +25 -0
  18. package/dist/_internal/client/features/seller/print-center/index.d.ts +11 -0
  19. package/dist/_internal/client/features/seller/print-center/index.js +10 -0
  20. package/dist/_internal/client/features/seller/print-center/types.d.ts +20 -0
  21. package/dist/_internal/client/features/seller/print-center/types.js +20 -0
  22. package/dist/_internal/client/features/seller/print-center/useInventoryPdf.d.ts +18 -0
  23. package/dist/_internal/client/features/seller/print-center/useInventoryPdf.js +76 -0
  24. package/dist/_internal/server/jobs/core/draftPrune.d.ts +2 -0
  25. package/dist/_internal/server/jobs/core/draftPrune.js +15 -0
  26. package/dist/_internal/server/jobs/core/onBidPlaced.js +1 -1
  27. package/dist/_internal/server/jobs/core/promotions.d.ts +1 -0
  28. package/dist/_internal/server/jobs/core/promotions.js +21 -6
  29. package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +18 -1
  30. package/dist/_internal/server/jobs/handlers/draftPrune.d.ts +2 -0
  31. package/dist/_internal/server/jobs/handlers/draftPrune.js +2 -0
  32. package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
  33. package/dist/_internal/server/jobs/handlers/index.js +2 -0
  34. package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +15 -1
  35. package/dist/_internal/shared/actions/action-registry.js +32 -0
  36. package/dist/_internal/shared/features/blog/schema.d.ts +8 -8
  37. package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +10 -10
  38. package/dist/_internal/shared/features/orders/schema.d.ts +8 -8
  39. package/dist/_internal/shared/features/products/schema.d.ts +8 -8
  40. package/dist/_internal/shared/features/promotions/schema.d.ts +6 -6
  41. package/dist/_internal/shared/features/reviews/schema.d.ts +2 -2
  42. package/dist/client.d.ts +13 -1
  43. package/dist/client.js +7 -1
  44. package/dist/configs/next.js +1 -0
  45. package/dist/constants/api-endpoints.d.ts +6 -0
  46. package/dist/constants/api-endpoints.js +2 -0
  47. package/dist/core/server-action.d.ts +4 -0
  48. package/dist/errors/error-codes.d.ts +18 -0
  49. package/dist/errors/error-codes.js +18 -0
  50. package/dist/errors/index.d.ts +1 -1
  51. package/dist/errors/index.js +1 -1
  52. package/dist/errors/messages.d.ts +1 -0
  53. package/dist/errors/messages.js +1 -0
  54. package/dist/features/account/components/UserSidebar.js +1 -1
  55. package/dist/features/account/schemas/index.d.ts +12 -12
  56. package/dist/features/admin/components/AdminSidebar.js +1 -1
  57. package/dist/features/auctions/actions/bid-actions.js +27 -11
  58. package/dist/features/auctions/components/PlaceBidFormClient.js +10 -2
  59. package/dist/features/auctions/repository/bid.repository.d.ts +7 -0
  60. package/dist/features/auctions/repository/bid.repository.js +16 -0
  61. package/dist/features/auctions/schemas/index.d.ts +18 -18
  62. package/dist/features/auth/schemas/index.d.ts +2 -2
  63. package/dist/features/before-after/schemas/index.d.ts +2 -2
  64. package/dist/features/blog/actions/blog-actions.d.ts +32 -32
  65. package/dist/features/blog/components/BlogPostForm.js +1 -1
  66. package/dist/features/blog/schemas/index.d.ts +38 -38
  67. package/dist/features/categories/schemas/index.d.ts +10 -10
  68. package/dist/features/collections/schemas/index.d.ts +4 -4
  69. package/dist/features/consultation/schemas/index.d.ts +9 -9
  70. package/dist/features/corporate/schemas/index.d.ts +4 -4
  71. package/dist/features/events/schemas/index.d.ts +50 -50
  72. package/dist/features/faq/actions/faq-actions.d.ts +6 -6
  73. package/dist/features/faq/schemas/index.d.ts +8 -8
  74. package/dist/features/homepage/actions/homepage-section-actions.d.ts +4 -4
  75. package/dist/features/layout/AppLayoutShell.js +1 -1
  76. package/dist/features/layout/AutoBreadcrumbs.js +1 -1
  77. package/dist/features/media/AvatarUpload.js +1 -1
  78. package/dist/features/media/types/index.d.ts +4 -4
  79. package/dist/features/media/upload/ImageUpload.js +18 -9
  80. package/dist/features/media/upload/MediaUploadList.js +2 -2
  81. package/dist/features/orders/schemas/firestore.d.ts +6 -0
  82. package/dist/features/orders/schemas/index.d.ts +10 -10
  83. package/dist/features/orders/types/index.d.ts +5 -0
  84. package/dist/features/payments/schemas/index.d.ts +4 -4
  85. package/dist/features/pre-orders/schemas/index.d.ts +8 -8
  86. package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -1
  87. package/dist/features/products/components/ProductDetailActions.d.ts +16 -0
  88. package/dist/features/products/components/ProductDetailActions.js +94 -0
  89. package/dist/features/products/components/ProductDetailPageView.d.ts +16 -1
  90. package/dist/features/products/components/ProductDetailPageView.js +22 -3
  91. package/dist/features/products/components/ProductForm.js +20 -2
  92. package/dist/features/products/repository/products.repository.d.ts +3 -1
  93. package/dist/features/products/repository/products.repository.js +12 -1
  94. package/dist/features/products/schemas/firestore.d.ts +7 -0
  95. package/dist/features/products/schemas/index.d.ts +34 -34
  96. package/dist/features/products/schemas/product-features.validators.d.ts +6 -6
  97. package/dist/features/products/types/index.d.ts +6 -0
  98. package/dist/features/promotions/schemas/index.d.ts +14 -14
  99. package/dist/features/reviews/schemas/index.d.ts +18 -18
  100. package/dist/features/seller/actions/offer-actions.js +10 -1
  101. package/dist/features/seller/components/PhysicalLocationModal.d.ts +12 -0
  102. package/dist/features/seller/components/PhysicalLocationModal.js +30 -0
  103. package/dist/features/seller/components/PrintCenterView.d.ts +40 -0
  104. package/dist/features/seller/components/PrintCenterView.js +6 -0
  105. package/dist/features/seller/components/SellerOrdersView.js +48 -3
  106. package/dist/features/seller/components/SellerProductShell.d.ts +1 -0
  107. package/dist/features/seller/components/SellerProductShell.js +26 -4
  108. package/dist/features/seller/components/SellerProductsView.js +54 -13
  109. package/dist/features/seller/components/SellerSidebar.js +1 -1
  110. package/dist/features/seller/components/index.d.ts +1 -0
  111. package/dist/features/seller/components/index.js +1 -0
  112. package/dist/features/seller/schemas/firestore.d.ts +2 -0
  113. package/dist/features/seller/schemas/firestore.js +1 -0
  114. package/dist/features/seller/schemas/index.d.ts +22 -22
  115. package/dist/features/shell/FormShell.js +1 -1
  116. package/dist/features/shell/StepForm.d.ts +3 -1
  117. package/dist/features/shell/StepForm.js +3 -3
  118. package/dist/features/stores/schemas/index.d.ts +4 -4
  119. package/dist/index.d.ts +9 -1
  120. package/dist/index.js +6 -1
  121. package/dist/next/routing/route-map.d.ts +8 -0
  122. package/dist/next/routing/route-map.js +3 -0
  123. package/dist/tailwind-utilities.css +1 -1
  124. package/dist/ui/components/RowActionMenu.js +45 -10
  125. package/dist/ui/components/SideDrawer.style.css +2 -2
  126. package/dist/ui/forms/FieldCheckbox.d.ts +13 -0
  127. package/dist/ui/forms/FieldCheckbox.js +25 -0
  128. package/dist/ui/forms/FieldInput.d.ts +11 -0
  129. package/dist/ui/forms/FieldInput.js +25 -0
  130. package/dist/ui/forms/FieldSelect.d.ts +17 -0
  131. package/dist/ui/forms/FieldSelect.js +25 -0
  132. package/dist/ui/forms/FormShell.d.ts +48 -0
  133. package/dist/ui/forms/FormShell.js +176 -0
  134. package/dist/ui/forms/FormShell.style.css +287 -0
  135. package/dist/ui/forms/index.d.ts +8 -0
  136. package/dist/ui/forms/index.js +4 -0
  137. package/dist/ui/index.d.ts +9 -0
  138. package/dist/ui/index.js +5 -0
  139. package/dist/utils/action-response.d.ts +6 -0
  140. package/dist/utils/action-response.js +22 -0
  141. package/dist/utils/index.d.ts +1 -0
  142. package/dist/utils/index.js +1 -0
  143. package/dist/validation/schemas.d.ts +10 -10
  144. package/package.json +2 -2
@@ -0,0 +1,287 @@
1
+ /* ─── FormShell ─────────────────────────────────────────────────────────────── */
2
+
3
+ .appkit-formshell {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: var(--appkit-spacing-6, 1.5rem);
7
+ }
8
+
9
+ /* Header */
10
+ .appkit-formshell__header {
11
+ display: flex;
12
+ flex-direction: column;
13
+ gap: var(--appkit-spacing-4, 1rem);
14
+ }
15
+
16
+ .appkit-formshell__title {
17
+ font-size: var(--appkit-font-size-lg, 1.125rem);
18
+ font-weight: 600;
19
+ color: var(--appkit-color-text-primary);
20
+ }
21
+
22
+ /* ─── Step Indicator ──────────────────────────────────────────────────────── */
23
+
24
+ .appkit-formshell__step-indicator {
25
+ display: flex;
26
+ flex-wrap: wrap;
27
+ gap: var(--appkit-spacing-1, 0.25rem);
28
+ border-bottom: 1px solid var(--appkit-color-border);
29
+ padding-bottom: var(--appkit-spacing-3, 0.75rem);
30
+ }
31
+
32
+ .appkit-formshell__step-btn {
33
+ display: flex;
34
+ align-items: center;
35
+ gap: var(--appkit-spacing-2, 0.5rem);
36
+ padding: var(--appkit-spacing-1-5, 0.375rem) var(--appkit-spacing-3, 0.75rem);
37
+ border-radius: var(--appkit-radius-md, 0.375rem);
38
+ background: transparent;
39
+ border: 1px solid transparent;
40
+ color: var(--appkit-color-text-secondary);
41
+ cursor: pointer;
42
+ font-size: var(--appkit-font-size-sm, 0.875rem);
43
+ transition: background 0.15s, border-color 0.15s, color 0.15s;
44
+ }
45
+
46
+ .appkit-formshell__step-btn:hover {
47
+ background: var(--appkit-color-surface-hover);
48
+ border-color: var(--appkit-color-border);
49
+ }
50
+
51
+ .appkit-formshell__step-btn--active {
52
+ background: var(--appkit-color-primary-subtle, rgb(from var(--appkit-color-primary) r g b / 0.1));
53
+ border-color: var(--appkit-color-primary);
54
+ color: var(--appkit-color-primary);
55
+ font-weight: 500;
56
+ }
57
+
58
+ .appkit-formshell__step-btn--error {
59
+ color: var(--appkit-color-error, #dc2626);
60
+ border-color: var(--appkit-color-error, #dc2626);
61
+ }
62
+
63
+ .appkit-formshell__step-dot {
64
+ position: relative;
65
+ display: flex;
66
+ align-items: center;
67
+ justify-content: center;
68
+ width: 1.5rem;
69
+ height: 1.5rem;
70
+ border-radius: 9999px;
71
+ background: var(--appkit-color-surface-secondary);
72
+ font-size: var(--appkit-font-size-xs, 0.75rem);
73
+ font-weight: 600;
74
+ flex-shrink: 0;
75
+ }
76
+
77
+ .appkit-formshell__step-btn--active .appkit-formshell__step-dot {
78
+ background: var(--appkit-color-primary);
79
+ color: #fff;
80
+ }
81
+
82
+ .appkit-formshell__step-btn--error .appkit-formshell__step-dot {
83
+ background: var(--appkit-color-error, #dc2626);
84
+ color: #fff;
85
+ }
86
+
87
+ /* Red dot badge on step dot */
88
+ .appkit-formshell__step-error-badge {
89
+ position: absolute;
90
+ top: -3px;
91
+ right: -3px;
92
+ width: 8px;
93
+ height: 8px;
94
+ border-radius: 9999px;
95
+ background: var(--appkit-color-error, #dc2626);
96
+ border: 2px solid var(--appkit-color-surface);
97
+ }
98
+
99
+ /* Inline error count badge (accordion header) */
100
+ .appkit-formshell__step-error-badge--inline {
101
+ position: static;
102
+ width: auto;
103
+ height: auto;
104
+ border-radius: var(--appkit-radius-full, 9999px);
105
+ padding: 0 0.375rem;
106
+ font-size: var(--appkit-font-size-xs, 0.75rem);
107
+ font-weight: 600;
108
+ color: #fff;
109
+ line-height: 1.4;
110
+ border: none;
111
+ }
112
+
113
+ .appkit-formshell__step-label {
114
+ display: none;
115
+ }
116
+
117
+ @media (min-width: 640px) {
118
+ .appkit-formshell__step-label {
119
+ display: inline;
120
+ }
121
+ }
122
+
123
+ /* ─── Error Summary ───────────────────────────────────────────────────────── */
124
+
125
+ .appkit-formshell__error-summary {
126
+ border: 1px solid var(--appkit-color-error, #dc2626);
127
+ border-radius: var(--appkit-radius-md, 0.375rem);
128
+ padding: var(--appkit-spacing-3, 0.75rem);
129
+ background: rgb(from var(--appkit-color-error, #dc2626) r g b / 0.05);
130
+ }
131
+
132
+ .appkit-formshell__error-summary__title {
133
+ font-weight: 600;
134
+ margin-bottom: var(--appkit-spacing-2, 0.5rem);
135
+ }
136
+
137
+ .appkit-formshell__error-summary__list {
138
+ list-style: disc;
139
+ padding-left: 1.25rem;
140
+ display: flex;
141
+ flex-direction: column;
142
+ gap: var(--appkit-spacing-1, 0.25rem);
143
+ }
144
+
145
+ /* ─── Body + Steps ───────────────────────────────────────────────────────── */
146
+
147
+ .appkit-formshell__body {
148
+ flex: 1;
149
+ /* Ensure body content is not hidden under the sticky footer. The footer is
150
+ ~56px tall; add generous padding so the last field is always reachable. */
151
+ padding-bottom: 5rem;
152
+ }
153
+
154
+ .appkit-formshell__steps {
155
+ display: flex;
156
+ flex-direction: column;
157
+ gap: var(--appkit-spacing-1, 0.25rem);
158
+ }
159
+
160
+ .appkit-formshell__step {
161
+ border: 1px solid var(--appkit-color-border);
162
+ border-radius: var(--appkit-radius-md, 0.375rem);
163
+ overflow: hidden;
164
+ }
165
+
166
+ .appkit-formshell__step--active {
167
+ border-color: var(--appkit-color-primary);
168
+ }
169
+
170
+ .appkit-formshell__step--error {
171
+ border-color: var(--appkit-color-error, #dc2626);
172
+ }
173
+
174
+ /* Mobile accordion button — hidden on lg+ (step indicator handles navigation) */
175
+ .appkit-formshell__step-accordion-btn {
176
+ display: flex;
177
+ align-items: center;
178
+ justify-content: space-between;
179
+ width: 100%;
180
+ padding: var(--appkit-spacing-3, 0.75rem) var(--appkit-spacing-4, 1rem);
181
+ background: var(--appkit-color-surface-secondary);
182
+ border: none;
183
+ cursor: pointer;
184
+ font-size: var(--appkit-font-size-sm, 0.875rem);
185
+ font-weight: 500;
186
+ color: var(--appkit-color-text-primary);
187
+ text-align: left;
188
+ }
189
+
190
+ .appkit-formshell__step-accordion-label {
191
+ flex: 1;
192
+ }
193
+
194
+ /* On lg+ the accordion controls are purely decorative; the step indicator drives navigation */
195
+ @media (min-width: 1024px) {
196
+ .appkit-formshell--accordion-mobile .appkit-formshell__step-accordion-btn {
197
+ display: none;
198
+ }
199
+
200
+ .appkit-formshell--accordion-mobile .appkit-formshell__step [hidden] {
201
+ display: block !important;
202
+ }
203
+
204
+ .appkit-formshell--accordion-mobile .appkit-formshell__step-content {
205
+ display: block !important;
206
+ }
207
+ }
208
+
209
+ .appkit-formshell__step-content {
210
+ padding: 0.75rem 1.25rem;
211
+ }
212
+
213
+ /* ─── Footer ──────────────────────────────────────────────────────────────── */
214
+
215
+ /*
216
+ * Sticky footer — always visible regardless of scroll position.
217
+ * Uses var(--appkit-z-dropdown, 30) so it stays above card content but below
218
+ * the site header (which uses var(--appkit-z-modal, 50)).
219
+ *
220
+ * Bottom offset accounts for:
221
+ * - Mobile: bottom nav (--bottom-nav-height, 56px fallback) + iOS safe area
222
+ * - Desktop (lg+): no bottom nav, just standard padding
223
+ */
224
+ .appkit-formshell__footer {
225
+ position: sticky;
226
+ bottom: 0;
227
+ left: 0;
228
+ right: 0;
229
+ z-index: var(--appkit-z-dropdown, 30);
230
+ display: flex;
231
+ align-items: center;
232
+ justify-content: space-between;
233
+ gap: var(--appkit-spacing-3, 0.75rem);
234
+ padding: 0.75rem 1.25rem;
235
+ padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
236
+ border-top: 1px solid var(--appkit-color-border);
237
+ background: var(--appkit-color-surface);
238
+ flex-wrap: wrap;
239
+ /* Offset for mobile bottom nav (--bottom-nav-height set by AppLayoutShell) */
240
+ margin-bottom: 0;
241
+ }
242
+
243
+ /* On mobile, lift the footer above the bottom nav bar */
244
+ @media (max-width: 1023px) {
245
+ .appkit-formshell__footer {
246
+ bottom: var(--bottom-nav-height, 64px);
247
+ box-shadow: 0 -2px 8px 0 rgb(0 0 0 / 0.08);
248
+ }
249
+ }
250
+
251
+ /* On desktop the bottom nav is gone — reset to viewport bottom */
252
+ @media (min-width: 1024px) {
253
+ .appkit-formshell__footer {
254
+ bottom: 0;
255
+ box-shadow: 0 -1px 0 0 var(--appkit-color-border);
256
+ }
257
+ }
258
+
259
+ .appkit-formshell__step-nav {
260
+ display: flex;
261
+ gap: var(--appkit-spacing-2, 0.5rem);
262
+ }
263
+
264
+ .appkit-formshell__actions {
265
+ display: flex;
266
+ gap: var(--appkit-spacing-2, 0.5rem);
267
+ margin-left: auto;
268
+ }
269
+
270
+ /* ─── Dark mode ──────────────────────────────────────────────────────────── */
271
+
272
+ .dark .appkit-formshell__footer {
273
+ background: var(--appkit-color-surface-dark, var(--appkit-color-surface));
274
+ }
275
+
276
+ .dark .appkit-formshell__title {
277
+ color: var(--appkit-color-text-primary-dark, inherit);
278
+ }
279
+
280
+ .dark .appkit-formshell__step-accordion-btn {
281
+ background: var(--appkit-color-surface-secondary-dark, var(--appkit-color-surface-secondary));
282
+ color: var(--appkit-color-text-primary-dark, inherit);
283
+ }
284
+
285
+ .dark .appkit-formshell__error-summary {
286
+ background: rgb(from var(--appkit-color-error, #dc2626) r g b / 0.1);
287
+ }
@@ -0,0 +1,8 @@
1
+ export type { FormShellProps, FormShellStep, FormShellContextValue, } from "./FormShell";
2
+ export { FormShell, useFormShell } from "./FormShell";
3
+ export type { FieldInputProps } from "./FieldInput";
4
+ export { FieldInput } from "./FieldInput";
5
+ export type { FieldSelectProps } from "./FieldSelect";
6
+ export { FieldSelect } from "./FieldSelect";
7
+ export type { FieldCheckboxProps } from "./FieldCheckbox";
8
+ export { FieldCheckbox } from "./FieldCheckbox";
@@ -0,0 +1,4 @@
1
+ export { FormShell, useFormShell } from "./FormShell";
2
+ export { FieldInput } from "./FieldInput";
3
+ export { FieldSelect } from "./FieldSelect";
4
+ export { FieldCheckbox } from "./FieldCheckbox";
@@ -1,4 +1,13 @@
1
1
  import "./components/index.style.css";
2
+ import "./forms/FormShell.style.css";
3
+ export type { FormShellProps, FormShellStep, FormShellContextValue, } from "./forms";
4
+ export { FormShell, useFormShell } from "./forms";
5
+ export type { FieldInputProps } from "./forms";
6
+ export { FieldInput } from "./forms";
7
+ export type { FieldSelectProps } from "./forms";
8
+ export { FieldSelect } from "./forms";
9
+ export type { FieldCheckboxProps } from "./forms";
10
+ export { FieldCheckbox } from "./forms";
2
11
  export { buildColumns, createColumnBuilder, renderBoolean, renderCurrency, renderCurrencyCompact, renderCount, renderNullable, renderRating, } from "./columns";
3
12
  export type { BooleanRenderOpts, RatingMode, RatingRenderOpts, } from "./columns";
4
13
  export type { SectionProps, ArticleProps, MainProps, AsideProps, NavProps, BlockHeaderProps, BlockFooterProps, HeaderProps, FooterProps, UlProps, OlProps, LiProps, } from "./components/Semantic";
package/dist/ui/index.js CHANGED
@@ -1,4 +1,9 @@
1
1
  import "./components/index.style.css";
2
+ import "./forms/FormShell.style.css";
3
+ export { FormShell, useFormShell } from "./forms";
4
+ export { FieldInput } from "./forms";
5
+ export { FieldSelect } from "./forms";
6
+ export { FieldCheckbox } from "./forms";
2
7
  // --- Column utilities ---------------------------------------------------------
3
8
  export { buildColumns, createColumnBuilder, renderBoolean, renderCurrency, renderCurrencyCompact, renderCount, renderNullable, renderRating, } from "./columns";
4
9
  export { Section, Article, Main, Aside, Nav, BlockHeader, BlockFooter, Header, Footer, Ul, Ol, Li, } from "./components/Semantic";
@@ -0,0 +1,6 @@
1
+ import type { ActionResult } from "../core/server-action";
2
+ export type { ActionResult };
3
+ type ActionErrorResult = Extract<ActionResult<never>, {
4
+ ok: false;
5
+ }>;
6
+ export declare function handleActionError(err: unknown): ActionErrorResult;
@@ -0,0 +1,22 @@
1
+ import { serverLogger } from "../monitoring";
2
+ import { AuthorizationError, NotFoundError, ValidationError, } from "../errors";
3
+ export function handleActionError(err) {
4
+ const devDebug = process.env.NODE_ENV === "development"
5
+ ? { stack: err instanceof Error ? err.stack : String(err) }
6
+ : undefined;
7
+ if (err instanceof NotFoundError)
8
+ return { ok: false, error: err.message, code: "NOT_FOUND", ...(devDebug && { debug: devDebug }) };
9
+ if (err instanceof ValidationError) {
10
+ const code = err.data?.code ?? "VALIDATION";
11
+ return { ok: false, error: err.message, code, ...(devDebug && { debug: devDebug }) };
12
+ }
13
+ if (err instanceof AuthorizationError)
14
+ return { ok: false, error: err.message, code: "UNAUTHORIZED", ...(devDebug && { debug: devDebug }) };
15
+ serverLogger.error("Unexpected action error", { err });
16
+ return {
17
+ ok: false,
18
+ error: "Something went wrong. Please try again.",
19
+ code: "INTERNAL",
20
+ ...(devDebug && { debug: devDebug }),
21
+ };
22
+ }
@@ -16,4 +16,5 @@ export * from "./color.helper";
16
16
  export * from "./business-day";
17
17
  export * from "./schema-ui";
18
18
  export * from "./listing-params";
19
+ export * from "./action-response";
19
20
  export { splitCartIntoOrderGroups, type OrderType, type OrderGroup, } from "../features/orders/utils/order-splitter";
@@ -16,5 +16,6 @@ export * from "./color.helper";
16
16
  export * from "./business-day";
17
17
  export * from "./schema-ui";
18
18
  export * from "./listing-params";
19
+ export * from "./action-response";
19
20
  // Re-export order utilities for checkout flows
20
21
  export { splitCartIntoOrderGroups, } from "../features/orders/utils/order-splitter";
@@ -6,15 +6,15 @@ export declare const paginationQuerySchema: z.ZodObject<{
6
6
  sortOrder: z.ZodDefault<z.ZodEnum<["asc", "desc"]>>;
7
7
  search: z.ZodOptional<z.ZodString>;
8
8
  }, "strip", z.ZodTypeAny, {
9
- sortOrder: "asc" | "desc";
10
9
  page: number;
10
+ sortOrder: "desc" | "asc";
11
11
  limit: number;
12
12
  search?: string | undefined;
13
13
  sortBy?: string | undefined;
14
14
  }, {
15
- sortOrder?: "asc" | "desc" | undefined;
16
15
  search?: string | undefined;
17
16
  page?: number | undefined;
17
+ sortOrder?: "desc" | "asc" | undefined;
18
18
  limit?: number | undefined;
19
19
  sortBy?: string | undefined;
20
20
  }>;
@@ -117,8 +117,8 @@ export declare const cropDataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
117
117
  minWidth: z.ZodOptional<z.ZodNumber>;
118
118
  minHeight: z.ZodOptional<z.ZodNumber>;
119
119
  }, "strip", z.ZodTypeAny, {
120
- width: number;
121
120
  height: number;
121
+ width: number;
122
122
  x: number;
123
123
  y: number;
124
124
  sourceUrl: string;
@@ -130,8 +130,8 @@ export declare const cropDataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
130
130
  outputFolder?: string | undefined;
131
131
  outputFormat?: "webp" | "png" | "jpeg" | undefined;
132
132
  }, {
133
- width: number;
134
133
  height: number;
134
+ width: number;
135
135
  x: number;
136
136
  y: number;
137
137
  sourceUrl: string;
@@ -143,8 +143,8 @@ export declare const cropDataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
143
143
  outputFolder?: string | undefined;
144
144
  outputFormat?: "webp" | "png" | "jpeg" | undefined;
145
145
  }>, {
146
- width: number;
147
146
  height: number;
147
+ width: number;
148
148
  x: number;
149
149
  y: number;
150
150
  sourceUrl: string;
@@ -156,8 +156,8 @@ export declare const cropDataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
156
156
  outputFolder?: string | undefined;
157
157
  outputFormat?: "webp" | "png" | "jpeg" | undefined;
158
158
  }, {
159
- width: number;
160
159
  height: number;
160
+ width: number;
161
161
  x: number;
162
162
  y: number;
163
163
  sourceUrl: string;
@@ -169,8 +169,8 @@ export declare const cropDataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
169
169
  outputFolder?: string | undefined;
170
170
  outputFormat?: "webp" | "png" | "jpeg" | undefined;
171
171
  }>, {
172
- width: number;
173
172
  height: number;
173
+ width: number;
174
174
  x: number;
175
175
  y: number;
176
176
  sourceUrl: string;
@@ -182,8 +182,8 @@ export declare const cropDataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
182
182
  outputFolder?: string | undefined;
183
183
  outputFormat?: "webp" | "png" | "jpeg" | undefined;
184
184
  }, {
185
- width: number;
186
185
  height: number;
186
+ width: number;
187
187
  x: number;
188
188
  y: number;
189
189
  sourceUrl: string;
@@ -195,8 +195,8 @@ export declare const cropDataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
195
195
  outputFolder?: string | undefined;
196
196
  outputFormat?: "webp" | "png" | "jpeg" | undefined;
197
197
  }>, {
198
- width: number;
199
198
  height: number;
199
+ width: number;
200
200
  x: number;
201
201
  y: number;
202
202
  sourceUrl: string;
@@ -208,8 +208,8 @@ export declare const cropDataSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.Zo
208
208
  outputFolder?: string | undefined;
209
209
  outputFormat?: "webp" | "png" | "jpeg" | undefined;
210
210
  }, {
211
- width: number;
212
211
  height: number;
212
+ width: number;
213
213
  x: number;
214
214
  y: number;
215
215
  sourceUrl: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "2.7.36",
3
+ "version": "2.7.38",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -147,7 +147,7 @@
147
147
  "watch:css": "tailwindcss -i src/tailwind-input.css -o dist/tailwind-utilities.css --watch",
148
148
  "audit": "node scripts/audit-violations.mjs",
149
149
  "check:types": "tsc --noEmit",
150
- "check:audits": "node scripts/audit-violations.mjs && node scripts/verify-entries.mjs && node scripts/verify-css-build.mjs && node scripts/audit-use-client.mjs && node scripts/audit-double-navigation.mjs && node scripts/audit-repository-fields.mjs && node scripts/audit-query-provider.mjs",
150
+ "check:audits": "node scripts/audit-violations.mjs && node scripts/verify-entries.mjs && node scripts/verify-css-build.mjs && node scripts/audit-use-client.mjs && node scripts/audit-double-navigation.mjs && node scripts/audit-repository-fields.mjs && node scripts/audit-query-provider.mjs && node scripts/audit-export-paths.mjs",
151
151
  "check": "npm run check:types && npm run check:audits"
152
152
  },
153
153
  "dependencies": {