@mohasinac/appkit 2.4.3 → 2.4.5

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 (49) hide show
  1. package/dist/constants/api-endpoints.d.ts +6 -0
  2. package/dist/constants/api-endpoints.js +2 -0
  3. package/dist/features/admin/components/AdminSublistingCategoriesView.d.ts +1 -0
  4. package/dist/features/admin/components/AdminSublistingCategoriesView.js +56 -0
  5. package/dist/features/admin/components/AdminSublistingCategoryEditorView.d.ts +7 -0
  6. package/dist/features/admin/components/AdminSublistingCategoryEditorView.js +83 -0
  7. package/dist/features/admin/components/index.d.ts +3 -0
  8. package/dist/features/admin/components/index.js +2 -0
  9. package/dist/features/auctions/components/AuctionDetailPageView.js +9 -1
  10. package/dist/features/auctions/schemas/index.d.ts +2 -2
  11. package/dist/features/pre-orders/components/PreOrderDetailPageView.js +9 -1
  12. package/dist/features/products/components/CustomFieldsEditor.d.ts +8 -0
  13. package/dist/features/products/components/CustomFieldsEditor.js +33 -0
  14. package/dist/features/products/components/CustomSectionTabContent.d.ts +4 -0
  15. package/dist/features/products/components/CustomSectionTabContent.js +13 -0
  16. package/dist/features/products/components/CustomSectionsEditor.d.ts +6 -0
  17. package/dist/features/products/components/CustomSectionsEditor.js +27 -0
  18. package/dist/features/products/components/ProductDetailPageView.js +9 -1
  19. package/dist/features/products/components/ProductForm.js +4 -2
  20. package/dist/features/products/components/ProductTabsShell.d.ts +8 -1
  21. package/dist/features/products/components/ProductTabsShell.js +19 -9
  22. package/dist/features/products/components/SublistingCarouselSection.d.ts +6 -0
  23. package/dist/features/products/components/SublistingCarouselSection.js +53 -0
  24. package/dist/features/products/components/SublistingCategorySelect.d.ts +7 -0
  25. package/dist/features/products/components/SublistingCategorySelect.js +40 -0
  26. package/dist/features/products/components/index.d.ts +6 -1
  27. package/dist/features/products/components/index.js +3 -0
  28. package/dist/features/products/repository/sublisting-categories.repository.d.ts +16 -0
  29. package/dist/features/products/repository/sublisting-categories.repository.js +126 -0
  30. package/dist/features/products/schemas/firestore.d.ts +20 -2
  31. package/dist/features/products/schemas/firestore.js +8 -0
  32. package/dist/features/products/schemas/index.d.ts +147 -56
  33. package/dist/features/products/schemas/index.js +24 -0
  34. package/dist/features/products/schemas/sublisting-categories.d.ts +45 -0
  35. package/dist/features/products/schemas/sublisting-categories.js +16 -0
  36. package/dist/features/products/types/index.d.ts +5 -0
  37. package/dist/features/search/schemas/index.d.ts +2 -2
  38. package/dist/index.d.ts +7 -2
  39. package/dist/index.js +8 -1
  40. package/dist/next/routing/route-map.d.ts +6 -0
  41. package/dist/next/routing/route-map.js +3 -0
  42. package/dist/repositories/index.d.ts +2 -0
  43. package/dist/repositories/index.js +1 -0
  44. package/dist/seed/sublisting-categories-seed-data.d.ts +5 -5
  45. package/dist/seed/sublisting-categories-seed-data.js +81 -237
  46. package/dist/styles.css +1 -0
  47. package/dist/tailwind-input.css +4 -0
  48. package/dist/tailwind-utilities.css +1 -0
  49. package/package.json +5 -4
@@ -131,6 +131,30 @@ export const productItemSchema = z.object({
131
131
  pickupAddressId: z.string().optional(),
132
132
  insurance: z.boolean().optional(),
133
133
  insuranceCost: z.number().optional(),
134
+ // Custom fields & sections
135
+ customFields: z
136
+ .array(z.object({
137
+ key: z.string(),
138
+ type: z.enum(["text", "number", "boolean", "url"]),
139
+ value: z.string(),
140
+ unit: z.string().optional(),
141
+ }))
142
+ .optional(),
143
+ customSections: z
144
+ .array(z.object({
145
+ id: z.string(),
146
+ title: z.string(),
147
+ text: z.string().optional(),
148
+ fields: z
149
+ .array(z.object({
150
+ key: z.string(),
151
+ type: z.enum(["text", "number", "boolean", "url"]),
152
+ value: z.string(),
153
+ unit: z.string().optional(),
154
+ }))
155
+ .optional(),
156
+ }))
157
+ .optional(),
134
158
  });
135
159
  /** Base Zod schema for list-query parameters. */
136
160
  export const productListParamsSchema = z.object({
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Sub-listing Categories — Firestore schema
3
+ *
4
+ * A sub-listing category is a named bucket that groups independent listings of the
5
+ * same real-world collectible across conditions, grades, prices, and sellers.
6
+ * Each listing stays a full product/auction/pre-order — the category is just the
7
+ * thread linking them (e.g. "Base Set Charizard 108/120").
8
+ */
9
+ export declare const SUBLISTING_CATEGORIES_COLLECTION: "sublistingCategories";
10
+ export declare const SUBLISTING_CATEGORY_PREFIX: "sublisting-";
11
+ export interface SublistingCategoryDocument {
12
+ id: string;
13
+ slug: string;
14
+ name: string;
15
+ /** Card set code or grade label, e.g. "108/120", "PSA 10" */
16
+ itemCode?: string;
17
+ description?: string;
18
+ /** /media/<slug> proxy URL */
19
+ coverImage?: string;
20
+ /** Denormalised count — updated on member add/remove */
21
+ productCount: number;
22
+ createdAt: Date;
23
+ updatedAt: Date;
24
+ createdBy: string;
25
+ }
26
+ export type SublistingCategoryCreateInput = Omit<SublistingCategoryDocument, "id" | "productCount" | "createdAt" | "updatedAt">;
27
+ export type SublistingCategoryUpdateInput = Partial<Pick<SublistingCategoryDocument, "name" | "itemCode" | "description" | "coverImage">>;
28
+ export declare const SUBLISTING_CATEGORY_SIEVE_FIELDS: {
29
+ readonly name: {
30
+ readonly canFilter: true;
31
+ readonly canSort: true;
32
+ };
33
+ readonly slug: {
34
+ readonly canFilter: true;
35
+ readonly canSort: false;
36
+ };
37
+ readonly productCount: {
38
+ readonly canFilter: false;
39
+ readonly canSort: true;
40
+ };
41
+ readonly createdAt: {
42
+ readonly canFilter: false;
43
+ readonly canSort: true;
44
+ };
45
+ };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Sub-listing Categories — Firestore schema
3
+ *
4
+ * A sub-listing category is a named bucket that groups independent listings of the
5
+ * same real-world collectible across conditions, grades, prices, and sellers.
6
+ * Each listing stays a full product/auction/pre-order — the category is just the
7
+ * thread linking them (e.g. "Base Set Charizard 108/120").
8
+ */
9
+ export const SUBLISTING_CATEGORIES_COLLECTION = "sublistingCategories";
10
+ export const SUBLISTING_CATEGORY_PREFIX = "sublisting-";
11
+ export const SUBLISTING_CATEGORY_SIEVE_FIELDS = {
12
+ name: { canFilter: true, canSort: true },
13
+ slug: { canFilter: true, canSort: false },
14
+ productCount: { canFilter: false, canSort: true },
15
+ createdAt: { canFilter: false, canSort: true },
16
+ };
@@ -1,4 +1,6 @@
1
1
  import type { MediaField } from "../../media/types/index";
2
+ import type { CustomField, CustomSection } from "../schemas/firestore";
3
+ export type { CustomField, CustomSection } from "../schemas/firestore";
2
4
  export type ProductStatus = "draft" | "published" | "archived" | "sold" | "out_of_stock" | "discontinued";
3
5
  export type ProductCondition = "new" | "like_new" | "good" | "fair" | "poor" | "used" | "refurbished" | "broken";
4
6
  export type ListingType = "fixed" | "standard" | "auction" | "pre-order";
@@ -41,6 +43,7 @@ export interface ProductItem {
41
43
  listingType?: ListingType;
42
44
  isAuction?: boolean;
43
45
  isPreOrder?: boolean;
46
+ sublistingCategoryId?: string;
44
47
  isOnSale?: boolean;
45
48
  isSold?: boolean;
46
49
  inStock?: boolean;
@@ -103,6 +106,8 @@ export interface ProductItem {
103
106
  pickupAddressId?: string;
104
107
  insurance?: boolean;
105
108
  insuranceCost?: number;
109
+ customFields?: CustomField[];
110
+ customSections?: CustomSection[];
106
111
  }
107
112
  export interface ProductListResponse {
108
113
  items: ProductItem[];
@@ -29,8 +29,8 @@ export declare const searchProductItemSchema: z.ZodObject<{
29
29
  currency?: string | undefined;
30
30
  featured?: boolean | undefined;
31
31
  isPromoted?: boolean | undefined;
32
- mainImage?: string | undefined;
33
32
  isAuction?: boolean | undefined;
33
+ mainImage?: string | undefined;
34
34
  }, {
35
35
  id: string;
36
36
  title: string;
@@ -40,8 +40,8 @@ export declare const searchProductItemSchema: z.ZodObject<{
40
40
  currency?: string | undefined;
41
41
  featured?: boolean | undefined;
42
42
  isPromoted?: boolean | undefined;
43
- mainImage?: string | undefined;
44
43
  isAuction?: boolean | undefined;
44
+ mainImage?: string | undefined;
45
45
  }>;
46
46
  /**
47
47
  * Form/query schema for a search request.
package/dist/index.d.ts CHANGED
@@ -529,6 +529,8 @@ export { smsCounterRepository } from "./repositories/index";
529
529
  export { storeAddressRepository } from "./repositories/index";
530
530
  export { storeRepository } from "./repositories/index";
531
531
  export { scammerRepository } from "./repositories/index";
532
+ export { sublistingCategoriesRepository } from "./repositories/index";
533
+ export type { SublistingCategoryCreateInput, SublistingCategoryUpdateInput, } from "./repositories/index";
532
534
  export { tokenRepository } from "./repositories/index";
533
535
  export { userRepository } from "./repositories/index";
534
536
  export { wishlistRepository } from "./repositories/index";
@@ -1086,6 +1088,9 @@ export { AdminSectionsView } from "./features/admin/index";
1086
1088
  export { AdminSessionsManager } from "./features/admin/index";
1087
1089
  export { AdminSidebar } from "./features/admin/index";
1088
1090
  export { AdminSiteView } from "./features/admin/index";
1091
+ export { AdminSublistingCategoriesView } from "./features/admin/index";
1092
+ export { AdminSublistingCategoryEditorView } from "./features/admin/index";
1093
+ export type { AdminSublistingCategoryEditorViewProps } from "./features/admin/index";
1089
1094
  export { AdminSiteSettingsView } from "./features/admin/index";
1090
1095
  export { AdminStatCard } from "./features/admin/index";
1091
1096
  export { AdminStoresView } from "./features/admin/index";
@@ -2887,8 +2892,8 @@ export type { GenerateFAQIdInput } from "./utils/id-generators";
2887
2892
  export { generateCroppedImageFilename } from "./utils/id-generators";
2888
2893
  export { CONVERSATIONS_COLLECTION } from "./features/messages/schemas/firestore";
2889
2894
  export type { ConversationDocument, ConversationMessage } from "./features/messages/schemas/firestore";
2890
- export { SUBLISTING_CATEGORIES_COLLECTION } from "./features/sublisting/schemas/firestore";
2891
- export type { SublistingCategoryDocument } from "./features/sublisting/schemas/firestore";
2895
+ export { SUBLISTING_CATEGORIES_COLLECTION } from "./features/products/schemas/sublisting-categories";
2896
+ export type { SublistingCategoryDocument } from "./features/products/schemas/sublisting-categories";
2892
2897
  export { GROUPED_LISTINGS_COLLECTION } from "./features/grouped/schemas/firestore";
2893
2898
  export type { GroupedListingDocument } from "./features/grouped/schemas/firestore";
2894
2899
  export { scammersSeedData } from "./seed/index";
package/dist/index.js CHANGED
@@ -1082,6 +1082,9 @@ export { storeRepository } from "./repositories/index";
1082
1082
  // scammerRepository - Shared export for scammer profiles repository.
1083
1083
  export { scammerRepository } from "./repositories/index";
1084
1084
  // [DB]-Database layer — uses firebase-admin or another server-side DB SDK; can only run in a trusted server environment.
1085
+ // sublistingCategoriesRepository - Server-only repository for sublisting categories.
1086
+ export { sublistingCategoriesRepository } from "./repositories/index";
1087
+ // [DB]-Database layer — uses firebase-admin or another server-side DB SDK; can only run in a trusted server environment.
1085
1088
  // tokenRepository - Shared export for token repository.
1086
1089
  export { tokenRepository } from "./repositories/index";
1087
1090
  // [DB]-Database layer — uses firebase-admin or another server-side DB SDK; can only run in a trusted server environment.
@@ -2134,6 +2137,10 @@ export { AdminSidebar } from "./features/admin/index";
2134
2137
  // [CLIENT-SSR]-Runs in both SSR and browser — React component or hook that does not depend on browser-only APIs.
2135
2138
  // AdminSiteView - Component for admin site view.
2136
2139
  export { AdminSiteView } from "./features/admin/index";
2140
+ // AdminSublistingCategoriesView - Admin list view for sublisting categories (SC1).
2141
+ export { AdminSublistingCategoriesView } from "./features/admin/index";
2142
+ // AdminSublistingCategoryEditorView - Admin create/edit form for sublisting categories (SC1).
2143
+ export { AdminSublistingCategoryEditorView } from "./features/admin/index";
2137
2144
  // AdminSiteSettingsView - 12-tab site settings form for admin (VA8).
2138
2145
  export { AdminSiteSettingsView } from "./features/admin/index";
2139
2146
  // [CLIENT-SSR]-Runs in both SSR and browser — React component or hook that does not depend on browser-only APIs.
@@ -5321,7 +5328,7 @@ export { generateCroppedImageFilename } from "./utils/id-generators";
5321
5328
  // Messages / Conversations feature schemas
5322
5329
  export { CONVERSATIONS_COLLECTION } from "./features/messages/schemas/firestore";
5323
5330
  // Sublisting categories feature schemas
5324
- export { SUBLISTING_CATEGORIES_COLLECTION } from "./features/sublisting/schemas/firestore";
5331
+ export { SUBLISTING_CATEGORIES_COLLECTION } from "./features/products/schemas/sublisting-categories";
5325
5332
  // Grouped listings feature schemas
5326
5333
  export { GROUPED_LISTINGS_COLLECTION } from "./features/grouped/schemas/firestore";
5327
5334
  // Scam registry — seed data
@@ -190,6 +190,9 @@ export declare const DEFAULT_ROUTE_MAP: {
190
190
  readonly WISHLISTS: "/admin/wishlists";
191
191
  readonly RETURN_REQUESTS: "/admin/return-requests";
192
192
  readonly STORE_ADDRESSES: "/admin/store-addresses";
193
+ readonly SUBLISTING_CATEGORIES: "/admin/sublisting-categories";
194
+ readonly SUBLISTING_CATEGORIES_NEW: "/admin/sublisting-categories/new";
195
+ readonly SUBLISTING_CATEGORIES_EDIT: (id: string) => string;
193
196
  };
194
197
  readonly DEMO: {
195
198
  readonly SEED: "/demo/seed";
@@ -379,6 +382,9 @@ export declare const ROUTES: {
379
382
  readonly WISHLISTS: "/admin/wishlists";
380
383
  readonly RETURN_REQUESTS: "/admin/return-requests";
381
384
  readonly STORE_ADDRESSES: "/admin/store-addresses";
385
+ readonly SUBLISTING_CATEGORIES: "/admin/sublisting-categories";
386
+ readonly SUBLISTING_CATEGORIES_NEW: "/admin/sublisting-categories/new";
387
+ readonly SUBLISTING_CATEGORIES_EDIT: (id: string) => string;
382
388
  };
383
389
  readonly DEMO: {
384
390
  readonly SEED: "/demo/seed";
@@ -177,6 +177,9 @@ export const DEFAULT_ROUTE_MAP = {
177
177
  WISHLISTS: "/admin/wishlists",
178
178
  RETURN_REQUESTS: "/admin/return-requests",
179
179
  STORE_ADDRESSES: "/admin/store-addresses",
180
+ SUBLISTING_CATEGORIES: "/admin/sublisting-categories",
181
+ SUBLISTING_CATEGORIES_NEW: "/admin/sublisting-categories/new",
182
+ SUBLISTING_CATEGORIES_EDIT: (id) => `/admin/sublisting-categories/${id}/edit`,
180
183
  },
181
184
  DEMO: {
182
185
  SEED: "/demo/seed",
@@ -38,3 +38,5 @@ export { BrandsRepository, brandsRepository, } from "../features/brands/reposito
38
38
  export type { BrandDocument, BrandCreateInput, BrandUpdateInput, } from "../features/brands/schemas";
39
39
  export type { CopilotFeedback, CopilotLogDocument, CopilotLogCreateInput, } from "../core";
40
40
  export { ScammerRepository, scammerRepository, } from "../features/scams/repository/scammer.repository";
41
+ export { SublistingCategoriesRepository, sublistingCategoriesRepository, } from "../features/products/repository/sublisting-categories.repository";
42
+ export type { SublistingCategoryDocument, SublistingCategoryCreateInput, SublistingCategoryUpdateInput, } from "../features/products/schemas/sublisting-categories";
@@ -39,3 +39,4 @@ export { NewsletterRepository, newsletterRepository, } from "../core/newsletter.
39
39
  export { CopilotLogRepository, copilotLogRepository } from "../core";
40
40
  export { BrandsRepository, brandsRepository, } from "../features/brands/repository/brands.repository";
41
41
  export { ScammerRepository, scammerRepository, } from "../features/scams/repository/scammer.repository";
42
+ export { SublistingCategoriesRepository, sublistingCategoriesRepository, } from "../features/products/repository/sublisting-categories.repository";
@@ -1,7 +1,7 @@
1
1
  /**
2
- * Sublisting Categories Seed Data — Curated sub-collections within root categories.
3
- * 20 sublisting categories across all collectibles verticals.
4
- * id === slug convention. sublisting- prefix.
2
+ * Sublisting Categories Seed Data
3
+ * 12 curated sub-listing buckets across all LetItRip collectible verticals.
4
+ * id === slug, prefix: sublisting-
5
5
  */
6
- import type { SublistingCategoryDocument } from "../features/sublisting/schemas/firestore";
7
- export declare const sublistingCategoriesSeedData: Partial<SublistingCategoryDocument>[];
6
+ import type { SublistingCategoryDocument } from "../features/products/schemas/sublisting-categories";
7
+ export declare const sublistingCategoriesSeedData: SublistingCategoryDocument[];