@mohasinac/appkit 2.7.36 → 2.7.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/client/features/layout/DashboardLayoutClient.js +1 -1
- package/dist/_internal/client/features/seller/print-center/InventoryLabel.d.ts +12 -0
- package/dist/_internal/client/features/seller/print-center/InventoryLabel.js +49 -0
- package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.d.ts +7 -0
- package/dist/_internal/client/features/seller/print-center/LabelDesignPicker.js +32 -0
- package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.d.ts +28 -0
- package/dist/_internal/client/features/seller/print-center/OrderPackingLabel.js +33 -0
- package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.d.ts +12 -0
- package/dist/_internal/client/features/seller/print-center/PhysicalLocationModal.js +30 -0
- package/dist/_internal/client/features/seller/print-center/PrintCenterView.d.ts +12 -0
- package/dist/_internal/client/features/seller/print-center/PrintCenterView.js +102 -0
- package/dist/_internal/client/features/seller/print-center/PrintGrid.d.ts +12 -0
- package/dist/_internal/client/features/seller/print-center/PrintGrid.js +13 -0
- package/dist/_internal/client/features/seller/print-center/StoreCard.d.ts +19 -0
- package/dist/_internal/client/features/seller/print-center/StoreCard.js +30 -0
- package/dist/_internal/client/features/seller/print-center/WebsiteCard.d.ts +11 -0
- package/dist/_internal/client/features/seller/print-center/WebsiteCard.js +25 -0
- package/dist/_internal/client/features/seller/print-center/index.d.ts +11 -0
- package/dist/_internal/client/features/seller/print-center/index.js +10 -0
- package/dist/_internal/client/features/seller/print-center/types.d.ts +20 -0
- package/dist/_internal/client/features/seller/print-center/types.js +20 -0
- package/dist/_internal/client/features/seller/print-center/useInventoryPdf.d.ts +18 -0
- package/dist/_internal/client/features/seller/print-center/useInventoryPdf.js +76 -0
- package/dist/_internal/server/jobs/core/draftPrune.d.ts +2 -0
- package/dist/_internal/server/jobs/core/draftPrune.js +15 -0
- package/dist/_internal/server/jobs/core/onBidPlaced.js +1 -1
- package/dist/_internal/server/jobs/core/promotions.d.ts +1 -0
- package/dist/_internal/server/jobs/core/promotions.js +21 -6
- package/dist/_internal/server/jobs/handlers/assignSpinPrize.js +18 -1
- package/dist/_internal/server/jobs/handlers/draftPrune.d.ts +2 -0
- package/dist/_internal/server/jobs/handlers/draftPrune.js +2 -0
- package/dist/_internal/server/jobs/handlers/index.d.ts +1 -0
- package/dist/_internal/server/jobs/handlers/index.js +2 -0
- package/dist/_internal/server/jobs/handlers/triggerEventRaffle.js +15 -1
- package/dist/_internal/shared/actions/action-registry.js +32 -0
- package/dist/_internal/shared/features/blog/schema.d.ts +8 -8
- package/dist/_internal/shared/features/categories/bundle-schemas.d.ts +10 -10
- package/dist/_internal/shared/features/orders/schema.d.ts +8 -8
- package/dist/_internal/shared/features/products/schema.d.ts +8 -8
- package/dist/_internal/shared/features/promotions/schema.d.ts +6 -6
- package/dist/_internal/shared/features/reviews/schema.d.ts +2 -2
- package/dist/client.d.ts +11 -1
- package/dist/client.js +6 -1
- package/dist/configs/next.js +1 -0
- package/dist/constants/api-endpoints.d.ts +6 -0
- package/dist/constants/api-endpoints.js +2 -0
- package/dist/core/server-action.d.ts +4 -0
- package/dist/errors/error-codes.d.ts +18 -0
- package/dist/errors/error-codes.js +18 -0
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/messages.d.ts +1 -0
- package/dist/errors/messages.js +1 -0
- package/dist/features/account/components/UserSidebar.js +1 -1
- package/dist/features/account/schemas/index.d.ts +12 -12
- package/dist/features/admin/components/AdminSidebar.js +1 -1
- package/dist/features/auctions/actions/bid-actions.js +13 -6
- package/dist/features/auctions/components/PlaceBidFormClient.js +10 -2
- package/dist/features/auctions/repository/bid.repository.d.ts +7 -0
- package/dist/features/auctions/repository/bid.repository.js +16 -0
- package/dist/features/auctions/schemas/index.d.ts +18 -18
- package/dist/features/auth/schemas/index.d.ts +2 -2
- package/dist/features/before-after/schemas/index.d.ts +2 -2
- package/dist/features/blog/actions/blog-actions.d.ts +32 -32
- package/dist/features/blog/components/BlogPostForm.js +1 -1
- package/dist/features/blog/schemas/index.d.ts +38 -38
- package/dist/features/categories/schemas/index.d.ts +10 -10
- package/dist/features/collections/schemas/index.d.ts +4 -4
- package/dist/features/consultation/schemas/index.d.ts +9 -9
- package/dist/features/corporate/schemas/index.d.ts +4 -4
- package/dist/features/events/schemas/index.d.ts +50 -50
- package/dist/features/faq/actions/faq-actions.d.ts +6 -6
- package/dist/features/faq/schemas/index.d.ts +8 -8
- package/dist/features/homepage/actions/homepage-section-actions.d.ts +4 -4
- package/dist/features/layout/AppLayoutShell.js +1 -1
- package/dist/features/layout/AutoBreadcrumbs.js +1 -1
- package/dist/features/media/AvatarUpload.js +1 -1
- package/dist/features/media/types/index.d.ts +4 -4
- package/dist/features/media/upload/ImageUpload.js +18 -9
- package/dist/features/media/upload/MediaUploadList.js +2 -2
- package/dist/features/orders/schemas/firestore.d.ts +6 -0
- package/dist/features/orders/schemas/index.d.ts +10 -10
- package/dist/features/orders/types/index.d.ts +5 -0
- package/dist/features/payments/schemas/index.d.ts +4 -4
- package/dist/features/pre-orders/schemas/index.d.ts +8 -8
- package/dist/features/products/components/PrizeDrawItemsEditor.js +1 -1
- package/dist/features/products/components/ProductForm.js +20 -2
- package/dist/features/products/repository/products.repository.d.ts +3 -1
- package/dist/features/products/repository/products.repository.js +12 -1
- package/dist/features/products/schemas/firestore.d.ts +7 -0
- package/dist/features/products/schemas/index.d.ts +34 -34
- package/dist/features/products/schemas/product-features.validators.d.ts +6 -6
- package/dist/features/products/types/index.d.ts +6 -0
- package/dist/features/promotions/schemas/index.d.ts +14 -14
- package/dist/features/reviews/schemas/index.d.ts +18 -18
- package/dist/features/seller/actions/offer-actions.js +10 -1
- package/dist/features/seller/components/PhysicalLocationModal.d.ts +12 -0
- package/dist/features/seller/components/PhysicalLocationModal.js +30 -0
- package/dist/features/seller/components/PrintCenterView.d.ts +40 -0
- package/dist/features/seller/components/PrintCenterView.js +6 -0
- package/dist/features/seller/components/SellerOrdersView.js +48 -3
- package/dist/features/seller/components/SellerProductShell.d.ts +1 -0
- package/dist/features/seller/components/SellerProductShell.js +26 -4
- package/dist/features/seller/components/SellerProductsView.js +54 -13
- package/dist/features/seller/components/SellerSidebar.js +1 -1
- package/dist/features/seller/components/index.d.ts +1 -0
- package/dist/features/seller/components/index.js +1 -0
- package/dist/features/seller/schemas/firestore.d.ts +2 -0
- package/dist/features/seller/schemas/firestore.js +1 -0
- package/dist/features/seller/schemas/index.d.ts +22 -22
- package/dist/features/shell/FormShell.js +1 -1
- package/dist/features/shell/StepForm.d.ts +3 -1
- package/dist/features/shell/StepForm.js +3 -3
- package/dist/features/stores/schemas/index.d.ts +4 -4
- package/dist/index.d.ts +9 -1
- package/dist/index.js +6 -1
- package/dist/next/routing/route-map.d.ts +8 -0
- package/dist/next/routing/route-map.js +3 -0
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/RowActionMenu.js +45 -10
- package/dist/ui/components/SideDrawer.style.css +2 -2
- package/dist/ui/forms/FieldCheckbox.d.ts +13 -0
- package/dist/ui/forms/FieldCheckbox.js +25 -0
- package/dist/ui/forms/FieldInput.d.ts +11 -0
- package/dist/ui/forms/FieldInput.js +25 -0
- package/dist/ui/forms/FieldSelect.d.ts +17 -0
- package/dist/ui/forms/FieldSelect.js +25 -0
- package/dist/ui/forms/FormShell.d.ts +48 -0
- package/dist/ui/forms/FormShell.js +176 -0
- package/dist/ui/forms/FormShell.style.css +287 -0
- package/dist/ui/forms/index.d.ts +8 -0
- package/dist/ui/forms/index.js +4 -0
- package/dist/ui/index.d.ts +9 -0
- package/dist/ui/index.js +5 -0
- package/dist/utils/action-response.d.ts +6 -0
- package/dist/utils/action-response.js +22 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/validation/schemas.d.ts +10 -10
- package/package.json +2 -2
|
@@ -56,7 +56,7 @@ export function StoreSidebar({ items, groups, activeHref, storeName, storeLogoUR
|
|
|
56
56
|
height: "calc(100vh - var(--header-height, 3.5rem))",
|
|
57
57
|
width: "18rem",
|
|
58
58
|
transform: desktopOpen ? "translateX(0)" : "translateX(calc(-100% + 1.25rem))",
|
|
59
|
-
}, children: [_jsxs("div", { className: "flex-1 bg-white dark:bg-slate-950 border-r border-zinc-200 dark:border-slate-700 flex flex-col overflow-hidden shadow-xl", children: [_jsx("div", { className: "px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": storeName, className: CLS_STORE_AVATAR, style: { backgroundImage: `url(${storeLogoURL})` } })) : (_jsx(Div, { className: CLS_STORE_FALLBACK, children: storeName?.[0]?.toUpperCase() })), _jsx(Text, { className: CLS_STORE_NAME, children: storeName || panelTitle })] }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: navContent })] }), _jsx("button", { type: "button", onClick: handleToggle, "aria-label": desktopOpen ? "Collapse sidebar" : "Expand sidebar", className: "w-
|
|
59
|
+
}, children: [_jsxs("div", { className: "flex-1 bg-white dark:bg-slate-950 border-r border-zinc-200 dark:border-slate-700 flex flex-col overflow-hidden shadow-xl", children: [_jsx("div", { className: "px-4 py-3.5 border-b border-zinc-100 dark:border-slate-800 shrink-0", children: _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [storeLogoURL ? (_jsx(Div, { role: "img", "aria-label": storeName, className: CLS_STORE_AVATAR, style: { backgroundImage: `url(${storeLogoURL})` } })) : (_jsx(Div, { className: CLS_STORE_FALLBACK, children: storeName?.[0]?.toUpperCase() })), _jsx(Text, { className: CLS_STORE_NAME, children: storeName || panelTitle })] }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: navContent })] }), _jsx("button", { type: "button", onClick: handleToggle, "aria-label": desktopOpen ? "Collapse sidebar" : "Expand sidebar", className: "w-9 shrink-0 flex items-center justify-center cursor-pointer rounded-r-[1.25rem] shadow-lg transition-all duration-200 hover:shadow-xl hover:brightness-110 active:scale-[0.96]", style: { background: "linear-gradient(to bottom, #c2410c, #ea580c)" }, children: _jsx("svg", { className: `w-4 h-4 text-white drop-shadow-sm transition-transform duration-300 ${desktopOpen ? "" : "rotate-180"}`, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", "aria-hidden": "true", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M15 19l-7-7 7-7" }) }) })] }), _jsx("div", { className: "md:hidden", children: _jsx(BottomSheet, { open: mobileOpen, onClose: close, title: panelTitle, children: groups ? (_jsx(GroupsContent, { groups: groups, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) : (_jsx(FlatContent, { items: items, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) }) })] }));
|
|
60
60
|
}
|
|
61
61
|
return (_jsxs(_Fragment, { children: [mounted && mobileOpen &&
|
|
62
62
|
createPortal(_jsx(DrawerPanel, { title: panelTitle, onClose: close, children: navContent }), document.body), _jsx("div", { className: "md:hidden", children: _jsx(BottomSheet, { open: mobileOpen, onClose: close, title: panelTitle, children: groups ? (_jsx(GroupsContent, { groups: groups, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) : (_jsx(FlatContent, { items: items, activeHref: activeHref, storeName: storeName, storeLogoURL: storeLogoURL, onItemClick: close })) }) })] }));
|
|
@@ -11,6 +11,7 @@ export { SellerPreOrdersView } from "./SellerPreOrdersView";
|
|
|
11
11
|
export type { SellerPreOrdersViewProps } from "./SellerPreOrdersView";
|
|
12
12
|
export { SellerPrizeDrawsView } from "./SellerPrizeDrawsView";
|
|
13
13
|
export type { SellerPrizeDrawsViewProps } from "./SellerPrizeDrawsView";
|
|
14
|
+
export { PrintCenterView } from "./PrintCenterView";
|
|
14
15
|
export { SellerOrdersView } from "./SellerOrdersView";
|
|
15
16
|
export type { SellerOrdersViewProps } from "./SellerOrdersView";
|
|
16
17
|
export { SellerOffersView } from "./SellerOffersView";
|
|
@@ -5,6 +5,7 @@ export { SellerProductsView } from "./SellerProductsView";
|
|
|
5
5
|
export { SellerAuctionsView } from "./SellerAuctionsView";
|
|
6
6
|
export { SellerPreOrdersView } from "./SellerPreOrdersView";
|
|
7
7
|
export { SellerPrizeDrawsView } from "./SellerPrizeDrawsView";
|
|
8
|
+
export { PrintCenterView } from "./PrintCenterView";
|
|
8
9
|
export { SellerOrdersView } from "./SellerOrdersView";
|
|
9
10
|
export { SellerOffersView } from "./SellerOffersView";
|
|
10
11
|
export { SellerOffersPanel } from "./SellerOffersPanel";
|
|
@@ -34,6 +34,7 @@ export interface OfferDocument {
|
|
|
34
34
|
sellerNote?: string;
|
|
35
35
|
expiresAt: Date;
|
|
36
36
|
acceptedAt?: Date;
|
|
37
|
+
checkoutDeadline?: Date;
|
|
37
38
|
respondedAt?: Date;
|
|
38
39
|
createdAt: Date;
|
|
39
40
|
updatedAt: Date;
|
|
@@ -59,6 +60,7 @@ export declare const OFFER_FIELDS: {
|
|
|
59
60
|
readonly SELLER_NOTE: "sellerNote";
|
|
60
61
|
readonly EXPIRES_AT: "expiresAt";
|
|
61
62
|
readonly ACCEPTED_AT: "acceptedAt";
|
|
63
|
+
readonly CHECKOUT_DEADLINE: "checkoutDeadline";
|
|
62
64
|
readonly RESPONDED_AT: "respondedAt";
|
|
63
65
|
readonly CREATED_AT: "createdAt";
|
|
64
66
|
readonly UPDATED_AT: "updatedAt";
|
|
@@ -85,11 +85,11 @@ export declare const sellerStoreSchema: z.ZodObject<{
|
|
|
85
85
|
createdAt: z.ZodString;
|
|
86
86
|
updatedAt: z.ZodString;
|
|
87
87
|
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
id: string;
|
|
89
|
-
createdAt: string;
|
|
90
|
-
updatedAt: string;
|
|
91
88
|
status: "pending" | "active" | "rejected" | "suspended";
|
|
89
|
+
createdAt: string;
|
|
90
|
+
id: string;
|
|
92
91
|
storeName: string;
|
|
92
|
+
updatedAt: string;
|
|
93
93
|
isPublic: boolean;
|
|
94
94
|
storeSlug: string;
|
|
95
95
|
ownerId: string;
|
|
@@ -117,11 +117,11 @@ export declare const sellerStoreSchema: z.ZodObject<{
|
|
|
117
117
|
isVacationMode?: boolean | undefined;
|
|
118
118
|
vacationMessage?: string | undefined;
|
|
119
119
|
}, {
|
|
120
|
-
id: string;
|
|
121
|
-
createdAt: string;
|
|
122
|
-
updatedAt: string;
|
|
123
120
|
status: "pending" | "active" | "rejected" | "suspended";
|
|
121
|
+
createdAt: string;
|
|
122
|
+
id: string;
|
|
124
123
|
storeName: string;
|
|
124
|
+
updatedAt: string;
|
|
125
125
|
isPublic: boolean;
|
|
126
126
|
storeSlug: string;
|
|
127
127
|
ownerId: string;
|
|
@@ -168,12 +168,12 @@ export declare const payoutRecordSchema: z.ZodObject<{
|
|
|
168
168
|
updatedAt: z.ZodString;
|
|
169
169
|
}, "strip", z.ZodTypeAny, {
|
|
170
170
|
currency: string;
|
|
171
|
-
|
|
171
|
+
status: "pending" | "failed" | "processing" | "completed";
|
|
172
172
|
createdAt: string;
|
|
173
|
+
id: string;
|
|
173
174
|
updatedAt: string;
|
|
174
|
-
status: "failed" | "pending" | "processing" | "completed";
|
|
175
|
-
requestedAt: string;
|
|
176
175
|
sellerName: string;
|
|
176
|
+
requestedAt: string;
|
|
177
177
|
sellerEmail: string;
|
|
178
178
|
amount: number;
|
|
179
179
|
grossAmount: number;
|
|
@@ -185,12 +185,12 @@ export declare const payoutRecordSchema: z.ZodObject<{
|
|
|
185
185
|
processedAt?: string | undefined;
|
|
186
186
|
}, {
|
|
187
187
|
currency: string;
|
|
188
|
-
|
|
188
|
+
status: "pending" | "failed" | "processing" | "completed";
|
|
189
189
|
createdAt: string;
|
|
190
|
+
id: string;
|
|
190
191
|
updatedAt: string;
|
|
191
|
-
status: "failed" | "pending" | "processing" | "completed";
|
|
192
|
-
requestedAt: string;
|
|
193
192
|
sellerName: string;
|
|
193
|
+
requestedAt: string;
|
|
194
194
|
sellerEmail: string;
|
|
195
195
|
amount: number;
|
|
196
196
|
grossAmount: number;
|
|
@@ -209,19 +209,19 @@ export declare const sellerListParamsSchema: z.ZodObject<{
|
|
|
209
209
|
perPage: z.ZodOptional<z.ZodNumber>;
|
|
210
210
|
sort: z.ZodOptional<z.ZodString>;
|
|
211
211
|
}, "strip", z.ZodTypeAny, {
|
|
212
|
-
sort?: string | undefined;
|
|
213
|
-
perPage?: number | undefined;
|
|
214
212
|
status?: "pending" | "active" | "rejected" | "suspended" | undefined;
|
|
215
|
-
|
|
213
|
+
sort?: string | undefined;
|
|
216
214
|
category?: string | undefined;
|
|
215
|
+
q?: string | undefined;
|
|
217
216
|
page?: number | undefined;
|
|
218
|
-
}, {
|
|
219
|
-
sort?: string | undefined;
|
|
220
217
|
perPage?: number | undefined;
|
|
218
|
+
}, {
|
|
221
219
|
status?: "pending" | "active" | "rejected" | "suspended" | undefined;
|
|
222
|
-
|
|
220
|
+
sort?: string | undefined;
|
|
223
221
|
category?: string | undefined;
|
|
222
|
+
q?: string | undefined;
|
|
224
223
|
page?: number | undefined;
|
|
224
|
+
perPage?: number | undefined;
|
|
225
225
|
}>;
|
|
226
226
|
export declare const payoutListParamsSchema: z.ZodObject<{
|
|
227
227
|
sellerId: z.ZodOptional<z.ZodString>;
|
|
@@ -230,15 +230,15 @@ export declare const payoutListParamsSchema: z.ZodObject<{
|
|
|
230
230
|
perPage: z.ZodOptional<z.ZodNumber>;
|
|
231
231
|
sort: z.ZodOptional<z.ZodString>;
|
|
232
232
|
}, "strip", z.ZodTypeAny, {
|
|
233
|
+
status?: "pending" | "failed" | "processing" | "completed" | undefined;
|
|
233
234
|
sort?: string | undefined;
|
|
234
|
-
perPage?: number | undefined;
|
|
235
|
-
status?: "failed" | "pending" | "processing" | "completed" | undefined;
|
|
236
235
|
page?: number | undefined;
|
|
236
|
+
perPage?: number | undefined;
|
|
237
237
|
sellerId?: string | undefined;
|
|
238
238
|
}, {
|
|
239
|
+
status?: "pending" | "failed" | "processing" | "completed" | undefined;
|
|
239
240
|
sort?: string | undefined;
|
|
240
|
-
perPage?: number | undefined;
|
|
241
|
-
status?: "failed" | "pending" | "processing" | "completed" | undefined;
|
|
242
241
|
page?: number | undefined;
|
|
242
|
+
perPage?: number | undefined;
|
|
243
243
|
sellerId?: string | undefined;
|
|
244
244
|
}>;
|
|
@@ -102,5 +102,5 @@ export function FormShell({ isOpen, onClose, title, breadcrumb, isDirty = false,
|
|
|
102
102
|
};
|
|
103
103
|
if (!isOpen)
|
|
104
104
|
return null;
|
|
105
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 bg-black/50 backdrop-blur-[2px]", style: { zIndex: "calc(var(--appkit-z-modal) - 1)" }, "aria-hidden": "true", onClick: attemptClose }), _jsxs("div", { ref: panelRef, role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed top-0 bottom-0 left-0 right-0 lg:left-[10%] lg:right-[10%] flex flex-col bg-[var(--appkit-color-surface)] shadow-2xl", style: { zIndex: "var(--appkit-z-modal)" }, children: [_jsxs("div", { className: "flex-shrink-0 sticky top-0 z-10 border-b border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] px-
|
|
105
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 bg-black/50 backdrop-blur-[2px]", style: { zIndex: "calc(var(--appkit-z-modal) - 1)" }, "aria-hidden": "true", onClick: attemptClose }), _jsxs("div", { ref: panelRef, role: "dialog", "aria-modal": "true", "aria-label": title, className: "fixed top-0 bottom-0 left-0 right-0 lg:left-[10%] lg:right-[10%] flex flex-col bg-[var(--appkit-color-surface)] shadow-2xl", style: { zIndex: "var(--appkit-z-modal)" }, children: [_jsxs("div", { className: "flex-shrink-0 sticky top-0 z-10 border-b border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] px-5 py-3 flex items-center gap-3", children: [previewMode ? (_jsxs("button", { type: "button", onClick: () => setPreviewMode(false), "aria-label": "Back to edit", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors flex-shrink-0 flex items-center gap-1.5 text-sm", children: [_jsx(ArrowLeft, { className: "w-4 h-4" }), _jsx("span", { className: "hidden sm:inline", children: "Back to Edit" })] })) : (_jsx("button", { type: "button", onClick: attemptClose, "aria-label": "Close", className: "rounded-lg p-1.5 text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors flex-shrink-0", children: _jsx(X, { className: "w-5 h-5" }) })), _jsxs("div", { className: "flex-1 min-w-0", children: [breadcrumb && (_jsx(Text, { className: "text-xs text-[var(--appkit-color-text-muted)] truncate mb-0.5", children: breadcrumb })), _jsx(Text, { className: "text-sm font-semibold text-[var(--appkit-color-text)] truncate", children: previewMode ? `Preview — ${title}` : title })] }), _jsx("div", { className: "flex items-center gap-2 flex-shrink-0", children: previewMode ? null : (_jsxs(_Fragment, { children: [previewSlot && (_jsxs("button", { type: "button", onClick: () => setPreviewMode(true), className: "flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-sm text-[var(--appkit-color-text-muted)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors border border-[var(--appkit-color-border)]", children: [_jsx(Eye, { className: "w-4 h-4" }), _jsx("span", { className: "hidden sm:inline", children: "Preview" })] })), onSaveDraft && (_jsx(Button, { variant: "outline", size: "sm", onClick: handleSaveDraft, disabled: isLoading || savingDraft || publishing, isLoading: savingDraft, children: saveLabel })), onPublish && (_jsx(Button, { variant: "primary", size: "sm", onClick: handlePublish, disabled: isLoading || savingDraft || publishing, isLoading: publishing, children: publishLabel }))] })) })] }), _jsxs("div", { className: "flex flex-1 overflow-hidden", children: [sections && sections.length > 0 && !previewMode && (_jsx("nav", { "aria-label": "Form sections", className: "hidden lg:flex flex-col flex-shrink-0 w-48 border-r border-[var(--appkit-color-border)] py-4 px-3 gap-1 overflow-y-auto", children: sections.map((sec) => (_jsx("button", { type: "button", onClick: () => scrollToSection(sec.id), className: "text-left text-sm px-3 py-2 rounded-lg text-[var(--appkit-color-text-muted)] hover:text-[var(--appkit-color-text)] hover:bg-[var(--appkit-color-border-subtle)] transition-colors", children: sec.label }, sec.id))) })), sections && sections.length > 0 && !previewMode && (_jsx("div", { className: "lg:hidden fixed top-[var(--form-shell-topbar-h,57px)] left-0 right-0 z-10 flex overflow-x-auto gap-1 px-5 py-2 bg-[var(--appkit-color-surface)] border-b border-[var(--appkit-color-border)]", children: sections.map((sec) => (_jsx("button", { type: "button", onClick: () => scrollToSection(sec.id), className: "flex-shrink-0 text-xs px-3 py-1.5 rounded-full border border-[var(--appkit-color-border)] text-[var(--appkit-color-text-muted)] hover:border-[var(--appkit-color-primary)] hover:text-[var(--appkit-color-primary)] transition-colors whitespace-nowrap", children: sec.label }, sec.id))) })), _jsx("div", { ref: bodyRef, className: classNames("flex-1 overflow-y-auto", sections && sections.length > 0 && !previewMode ? "pt-0 lg:pt-0" : ""), children: previewMode && previewSlot ? (_jsxs(_Fragment, { children: [_jsxs("div", { className: "sticky top-0 z-10 flex items-center gap-2 bg-[var(--appkit-color-warning-surface)] border-b border-[var(--appkit-color-warning)] px-4 py-2 text-sm text-[var(--appkit-color-warning-text,var(--appkit-color-warning))]", children: [_jsx(Eye, { className: "w-4 h-4 flex-shrink-0" }), _jsx("span", { children: "Preview \u2014 not visible to buyers until published" })] }), _jsx("div", { className: "py-4", children: previewSlot() })] })) : (_jsx("div", { className: "max-w-3xl mx-auto px-5 py-6 sm:px-6", children: children })) })] }), !previewMode && renderBottomBar ? (renderBottomBar()) : !previewMode && (onSaveDraft || onPublish) ? (_jsxs("div", { className: "flex-shrink-0 sticky bottom-0 z-10 border-t border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)] px-5 py-3 flex items-center justify-between", children: [_jsx(Button, { variant: "ghost", size: "sm", onClick: attemptClose, disabled: isLoading, children: FORM_ACTION_META[FORM_ACTION_ID.DISCARD].label }), _jsxs("div", { className: "flex items-center gap-2", children: [onSaveDraft && (_jsx(Button, { variant: "outline", size: "sm", onClick: handleSaveDraft, disabled: isLoading || savingDraft || publishing, isLoading: savingDraft, children: saveLabel })), onPublish && (_jsxs(Button, { variant: "primary", size: "sm", onClick: handlePublish, disabled: isLoading || savingDraft || publishing, isLoading: publishing, children: [publishLabel, " \u2192"] }))] })] })) : null] }), showUnsaved && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 bg-black/60", style: { zIndex: "calc(var(--appkit-z-modal) + 5)" }, onClick: () => setShowUnsaved(false) }), _jsxs("div", { className: "fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[90vw] max-w-sm bg-[var(--appkit-color-surface)] rounded-xl shadow-2xl p-6", style: { zIndex: "calc(var(--appkit-z-modal) + 5)" }, children: [_jsxs("div", { className: "flex gap-3 mb-4", children: [_jsx("span", { className: "flex-shrink-0 w-10 h-10 rounded-full bg-[var(--appkit-color-warning-surface)] flex items-center justify-center", children: _jsx(AlertTriangle, { className: "w-5 h-5 text-[var(--appkit-color-warning)]" }) }), _jsxs(_Fragment, { children: [_jsx(Text, { className: "font-semibold text-[var(--appkit-color-text)]", children: "Unsaved changes" }), _jsx(Text, { className: "text-sm text-[var(--appkit-color-text-muted)] mt-1", children: "You have unsaved changes. Leave without saving?" })] })] }), _jsxs("div", { className: "flex gap-2 justify-end", children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => setShowUnsaved(false), children: "Stay" }), _jsx(Button, { variant: "danger", size: "sm", onClick: () => { setShowUnsaved(false); onClose(); }, children: "Leave" })] })] })] }))] }));
|
|
106
106
|
}
|
|
@@ -21,6 +21,8 @@ export interface StepFormProps<T extends object = Record<string, unknown>> {
|
|
|
21
21
|
/** Current step index (0-based). Controlled from outside. */
|
|
22
22
|
currentStep: number;
|
|
23
23
|
onStepChange: (step: number) => void;
|
|
24
|
+
/** Suppress the built-in action bar. Use FormShell's renderBottomBar instead. */
|
|
25
|
+
hideActions?: boolean;
|
|
24
26
|
}
|
|
25
27
|
export interface StepFormActionsProps {
|
|
26
28
|
currentStep: number;
|
|
@@ -41,4 +43,4 @@ export declare function StepIndicator({ steps, currentStep, onStepClick, }: {
|
|
|
41
43
|
currentStep: number;
|
|
42
44
|
onStepClick?: (index: number) => void;
|
|
43
45
|
}): import("react/jsx-runtime").JSX.Element;
|
|
44
|
-
export declare function StepForm<T extends object = Record<string, unknown>>({ steps, values, onChange, onComplete, completeLabel, isLoading, formId, currentStep, onStepChange, }: StepFormProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function StepForm<T extends object = Record<string, unknown>>({ steps, values, onChange, onComplete, completeLabel, isLoading, formId, currentStep, onStepChange, hideActions, }: StepFormProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,7 @@ export function StepFormActions({ currentStep, totalSteps, onNext, onPrev, compl
|
|
|
10
10
|
const isFirst = currentStep === 0;
|
|
11
11
|
const isLast = currentStep === totalSteps - 1;
|
|
12
12
|
const nextStepLabel = `Next →`;
|
|
13
|
-
return (_jsxs("div", { className: "flex items-center justify-between gap-2 px-
|
|
13
|
+
return (_jsxs("div", { className: "flex items-center justify-between gap-2 px-5 py-3 border-t border-[var(--appkit-color-border)] bg-[var(--appkit-color-surface)]", children: [_jsx(_Fragment, { children: !isFirst && onPrev && (_jsx(Button, { variant: "outline", size: "sm", onClick: onPrev, disabled: disabled || isLoading, children: "\u2190 Back" })) }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("span", { className: "text-xs text-[var(--appkit-color-text-muted)]", children: [currentStep + 1, " / ", totalSteps] }), _jsx(Button, { variant: "primary", size: "sm", onClick: onNext, disabled: disabled || isLoading, isLoading: isLoading && isLast, children: isLast ? completeLabel : nextStepLabel })] })] }));
|
|
14
14
|
}
|
|
15
15
|
/** Step indicator bar shown above step content. */
|
|
16
16
|
export function StepIndicator({ steps, currentStep, onStepClick, }) {
|
|
@@ -30,7 +30,7 @@ export function StepIndicator({ steps, currentStep, onStepClick, }) {
|
|
|
30
30
|
: "bg-[var(--appkit-color-border)]") }))] }, i));
|
|
31
31
|
}) }));
|
|
32
32
|
}
|
|
33
|
-
export function StepForm({ steps, values, onChange, onComplete, completeLabel = "Publish Now", isLoading = false, formId, currentStep, onStepChange, }) {
|
|
33
|
+
export function StepForm({ steps, values, onChange, onComplete, completeLabel = "Publish Now", isLoading = false, formId, currentStep, onStepChange, hideActions = false, }) {
|
|
34
34
|
const [stepErrors, setStepErrors] = useState({});
|
|
35
35
|
const [stepError, setStepError] = useState(null);
|
|
36
36
|
// Persist step to localStorage if formId provided
|
|
@@ -78,5 +78,5 @@ export function StepForm({ steps, values, onChange, onComplete, completeLabel =
|
|
|
78
78
|
return (_jsxs("div", { className: "flex flex-col", children: [_jsx(StepIndicator, { steps: steps, currentStep: currentStep, onStepClick: (i) => { if (i < currentStep) {
|
|
79
79
|
setStepError(null);
|
|
80
80
|
onStepChange(i);
|
|
81
|
-
} } }), _jsx("div", { className: "flex-1", children: currentStepDef?.render({ values, onChange, errors: stepErrors }) }), stepError && (_jsx(Text, { className: "mt-3 text-sm text-[var(--appkit-color-error)]", children: stepError })), _jsx(StepFormActions, { currentStep: currentStep, totalSteps: steps.length, onNext: () => void goNext(), onPrev: currentStep > 0 ? goPrev : undefined, completeLabel: completeLabel, isLoading: isLoading && isLast, disabled: isLoading })] }));
|
|
81
|
+
} } }), _jsx("div", { className: "flex-1", children: currentStepDef?.render({ values, onChange, errors: stepErrors }) }), !hideActions && stepError && (_jsx(Text, { className: "mt-3 text-sm text-[var(--appkit-color-error)]", children: stepError })), !hideActions && (_jsx(StepFormActions, { currentStep: currentStep, totalSteps: steps.length, onNext: () => void goNext(), onPrev: currentStep > 0 ? goPrev : undefined, completeLabel: completeLabel, isLoading: isLoading && isLast, disabled: isLoading }))] }));
|
|
82
82
|
}
|
|
@@ -32,8 +32,8 @@ export declare const storeListItemSchema: z.ZodObject<{
|
|
|
32
32
|
averageRating: z.ZodOptional<z.ZodNumber>;
|
|
33
33
|
createdAt: z.ZodOptional<z.ZodString>;
|
|
34
34
|
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
id: string;
|
|
36
35
|
status: string;
|
|
36
|
+
id: string;
|
|
37
37
|
storeName: string;
|
|
38
38
|
isPublic: boolean;
|
|
39
39
|
storeSlug: string;
|
|
@@ -48,8 +48,8 @@ export declare const storeListItemSchema: z.ZodObject<{
|
|
|
48
48
|
totalReviews?: number | undefined;
|
|
49
49
|
averageRating?: number | undefined;
|
|
50
50
|
}, {
|
|
51
|
-
id: string;
|
|
52
51
|
status: string;
|
|
52
|
+
id: string;
|
|
53
53
|
storeName: string;
|
|
54
54
|
isPublic: boolean;
|
|
55
55
|
storeSlug: string;
|
|
@@ -72,14 +72,14 @@ export declare const storeListParamsSchema: z.ZodObject<{
|
|
|
72
72
|
filters: z.ZodOptional<z.ZodString>;
|
|
73
73
|
}, "strip", z.ZodTypeAny, {
|
|
74
74
|
sort?: string | undefined;
|
|
75
|
-
pageSize?: number | undefined;
|
|
76
75
|
category?: string | undefined;
|
|
77
76
|
page?: number | undefined;
|
|
77
|
+
pageSize?: number | undefined;
|
|
78
78
|
filters?: string | undefined;
|
|
79
79
|
}, {
|
|
80
80
|
sort?: string | undefined;
|
|
81
|
-
pageSize?: number | undefined;
|
|
82
81
|
category?: string | undefined;
|
|
83
82
|
page?: number | undefined;
|
|
83
|
+
pageSize?: number | undefined;
|
|
84
84
|
filters?: string | undefined;
|
|
85
85
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,13 @@ export { DropdownTrigger } from "./ui/index";
|
|
|
42
42
|
export { FormFieldSpan } from "./ui/index";
|
|
43
43
|
export { FormGrid } from "./ui/index";
|
|
44
44
|
export { FormGroup } from "./ui/index";
|
|
45
|
+
export type { FormShellStep, FormShellContextValue } from "./ui/index";
|
|
46
|
+
export type { FieldInputProps } from "./ui/index";
|
|
47
|
+
export { FieldInput } from "./ui/index";
|
|
48
|
+
export type { FieldSelectProps } from "./ui/index";
|
|
49
|
+
export { FieldSelect } from "./ui/index";
|
|
50
|
+
export type { FieldCheckboxProps } from "./ui/index";
|
|
51
|
+
export { FieldCheckbox } from "./ui/index";
|
|
45
52
|
export { GRID_MAP } from "./ui/index";
|
|
46
53
|
export { ImageGallery } from "./ui/index";
|
|
47
54
|
export { ImageLightbox } from "./ui/index";
|
|
@@ -286,7 +293,7 @@ export { AppError } from "./errors/index";
|
|
|
286
293
|
export { AuthenticationError } from "./errors/index";
|
|
287
294
|
export { AuthorizationError } from "./errors/index";
|
|
288
295
|
export { DatabaseError } from "./errors/index";
|
|
289
|
-
export { ERROR_CODES } from "./errors/index";
|
|
296
|
+
export { ERROR_CODES, BID_ERROR_CODES, OFFER_ERROR_CODES } from "./errors/index";
|
|
290
297
|
export { ERROR_MESSAGES } from "./errors/index";
|
|
291
298
|
export { NotFoundError } from "./errors/index";
|
|
292
299
|
export { ValidationError } from "./errors/index";
|
|
@@ -373,6 +380,7 @@ export { useSiteSettings } from "./core/index";
|
|
|
373
380
|
export type { ActionMiddleware } from "./core/index";
|
|
374
381
|
export type { ActionMiddlewareContext } from "./core/index";
|
|
375
382
|
export type { ActionResult } from "./core/index";
|
|
383
|
+
export { handleActionError } from "./utils/action-response";
|
|
376
384
|
export type { CacheEntry } from "./core/index";
|
|
377
385
|
export type { CacheOptions } from "./core/index";
|
|
378
386
|
export type { CopilotFeedback } from "./core/index";
|
package/dist/index.js
CHANGED
|
@@ -134,6 +134,9 @@ export { FormGrid } from "./ui/index";
|
|
|
134
134
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
135
135
|
// FormGroup - Shared export for form group.
|
|
136
136
|
export { FormGroup } from "./ui/index";
|
|
137
|
+
export { FieldInput } from "./ui/index";
|
|
138
|
+
export { FieldSelect } from "./ui/index";
|
|
139
|
+
export { FieldCheckbox } from "./ui/index";
|
|
137
140
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
138
141
|
// GRID_MAP - Constant used across modules.
|
|
139
142
|
export { GRID_MAP } from "./ui/index";
|
|
@@ -493,7 +496,7 @@ export { AuthorizationError } from "./errors/index";
|
|
|
493
496
|
export { DatabaseError } from "./errors/index";
|
|
494
497
|
// [UTIL]-Pure utility â€" no framework or runtime dependency; safe to import from any environment.
|
|
495
498
|
// ERROR_CODES - Constant used across modules.
|
|
496
|
-
export { ERROR_CODES } from "./errors/index";
|
|
499
|
+
export { ERROR_CODES, BID_ERROR_CODES, OFFER_ERROR_CODES } from "./errors/index";
|
|
497
500
|
// [UTIL]-Pure utility â€" no framework or runtime dependency; safe to import from any environment.
|
|
498
501
|
// ERROR_MESSAGES - Constant used across modules.
|
|
499
502
|
export { ERROR_MESSAGES } from "./errors/index";
|
|
@@ -706,6 +709,8 @@ export { unitOfWork } from "./core/index";
|
|
|
706
709
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
707
710
|
// useSiteSettings - React hook for use site settings.
|
|
708
711
|
export { useSiteSettings } from "./core/index";
|
|
712
|
+
// handleActionError - Maps domain errors to structured { ok: false, error, code } responses.
|
|
713
|
+
export { handleActionError } from "./utils/action-response";
|
|
709
714
|
// ./security/index
|
|
710
715
|
// [CLIENT-SSR]-Runs in both SSR and browser â€" React component or hook that does not depend on browser-only APIs.
|
|
711
716
|
// ADDRESS_PII_FIELDS - Constant used across modules.
|
|
@@ -183,6 +183,8 @@ export declare const DEFAULT_ROUTE_MAP: {
|
|
|
183
183
|
readonly LIVE_ITEMS: "/store/live";
|
|
184
184
|
readonly LIVE_ITEMS_NEW: "/store/live/new";
|
|
185
185
|
readonly LIVE_ITEMS_EDIT: (id: string) => string;
|
|
186
|
+
readonly PRINT_CENTER: "/store/print-center";
|
|
187
|
+
readonly INVENTORY_PRINT: "/store/inventory/print";
|
|
186
188
|
};
|
|
187
189
|
readonly ADMIN: {
|
|
188
190
|
readonly DASHBOARD: "/admin/dashboard";
|
|
@@ -263,6 +265,7 @@ export declare const DEFAULT_ROUTE_MAP: {
|
|
|
263
265
|
readonly SCAMMER_BY_ID: (id: string) => string;
|
|
264
266
|
readonly SETTINGS_ACTIONS: "/admin/settings/actions";
|
|
265
267
|
readonly SETTINGS_NAVIGATION: "/admin/settings/navigation";
|
|
268
|
+
readonly PRINT_CENTER: "/admin/print-center";
|
|
266
269
|
};
|
|
267
270
|
readonly DEMO: {
|
|
268
271
|
readonly SEED: "/demo/seed";
|
|
@@ -445,6 +448,8 @@ export declare const ROUTES: {
|
|
|
445
448
|
readonly LIVE_ITEMS: "/store/live";
|
|
446
449
|
readonly LIVE_ITEMS_NEW: "/store/live/new";
|
|
447
450
|
readonly LIVE_ITEMS_EDIT: (id: string) => string;
|
|
451
|
+
readonly PRINT_CENTER: "/store/print-center";
|
|
452
|
+
readonly INVENTORY_PRINT: "/store/inventory/print";
|
|
448
453
|
};
|
|
449
454
|
readonly ADMIN: {
|
|
450
455
|
readonly DASHBOARD: "/admin/dashboard";
|
|
@@ -525,6 +530,7 @@ export declare const ROUTES: {
|
|
|
525
530
|
readonly SCAMMER_BY_ID: (id: string) => string;
|
|
526
531
|
readonly SETTINGS_ACTIONS: "/admin/settings/actions";
|
|
527
532
|
readonly SETTINGS_NAVIGATION: "/admin/settings/navigation";
|
|
533
|
+
readonly PRINT_CENTER: "/admin/print-center";
|
|
528
534
|
};
|
|
529
535
|
readonly DEMO: {
|
|
530
536
|
readonly SEED: "/demo/seed";
|
|
@@ -587,6 +593,8 @@ export declare const SELLER_ROUTES: {
|
|
|
587
593
|
readonly LIVE_ITEMS: "/store/live";
|
|
588
594
|
readonly LIVE_ITEMS_NEW: "/store/live/new";
|
|
589
595
|
readonly LIVE_ITEMS_EDIT: (id: string) => string;
|
|
596
|
+
readonly PRINT_CENTER: "/store/print-center";
|
|
597
|
+
readonly INVENTORY_PRINT: "/store/inventory/print";
|
|
590
598
|
};
|
|
591
599
|
export declare const PUBLIC_ROUTES: readonly ["/", string, string, string, string, string, string, string, string, string, string, string, string, string, string, string, "/unauthorized", "/auth/login", "/auth/register", "/auth/forgot-password", "/auth/reset-password", "/auth/verify-email"];
|
|
592
600
|
export declare const PROTECTED_ROUTES: readonly [string, string, string, string, string, string, string];
|
|
@@ -173,6 +173,8 @@ export const DEFAULT_ROUTE_MAP = {
|
|
|
173
173
|
LIVE_ITEMS: "/store/live",
|
|
174
174
|
LIVE_ITEMS_NEW: "/store/live/new",
|
|
175
175
|
LIVE_ITEMS_EDIT: (id) => `/store/live/${id}/edit`,
|
|
176
|
+
PRINT_CENTER: "/store/print-center",
|
|
177
|
+
INVENTORY_PRINT: "/store/inventory/print",
|
|
176
178
|
},
|
|
177
179
|
ADMIN: {
|
|
178
180
|
DASHBOARD: "/admin/dashboard",
|
|
@@ -255,6 +257,7 @@ export const DEFAULT_ROUTE_MAP = {
|
|
|
255
257
|
SCAMMER_BY_ID: (id) => `/admin/scammers/${id}`,
|
|
256
258
|
SETTINGS_ACTIONS: "/admin/settings/actions",
|
|
257
259
|
SETTINGS_NAVIGATION: "/admin/settings/navigation",
|
|
260
|
+
PRINT_CENTER: "/admin/print-center",
|
|
258
261
|
},
|
|
259
262
|
DEMO: {
|
|
260
263
|
SEED: "/demo/seed",
|