@mohasinac/appkit 2.7.46 → 2.7.48

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 (71) hide show
  1. package/dist/constants/field-names.d.ts +1 -0
  2. package/dist/constants/field-names.js +1 -0
  3. package/dist/core/unit-of-work.js +3 -4
  4. package/dist/features/admin/components/DashboardStats.js +1 -1
  5. package/dist/features/auth/actions/profile-actions.js +4 -1
  6. package/dist/features/auth/repository/user.repository.d.ts +1 -0
  7. package/dist/features/auth/repository/user.repository.js +3 -0
  8. package/dist/features/blog/api/route.js +3 -0
  9. package/dist/features/blog/components/BlogIndexListing.js +2 -0
  10. package/dist/features/blog/components/BlogPostView.js +2 -1
  11. package/dist/features/categories/api/route.js +1 -1
  12. package/dist/features/categories/components/BundleDetailView.js +5 -3
  13. package/dist/features/categories/components/CategoryBundlesListing.js +77 -41
  14. package/dist/features/categories/components/CategoryDetailPageView.js +12 -9
  15. package/dist/features/categories/components/CategoryProductsListing.js +3 -5
  16. package/dist/features/classified/components/ClassifiedIndexListing.js +3 -4
  17. package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +3 -4
  18. package/dist/features/events/actions/event-actions.d.ts +2 -3
  19. package/dist/features/events/actions/event-actions.js +3 -5
  20. package/dist/features/events/api/route.js +7 -7
  21. package/dist/features/events/components/AdminEventEditorView.js +80 -6
  22. package/dist/features/events/components/AdminEventEntriesView.js +33 -4
  23. package/dist/features/events/components/EventFilters.d.ts +3 -0
  24. package/dist/features/events/components/EventFilters.js +1 -0
  25. package/dist/features/events/components/EventLeaderboard.js +1 -1
  26. package/dist/features/events/components/EventsIndexListing.js +10 -7
  27. package/dist/features/events/repository/event-entry.repository.d.ts +2 -2
  28. package/dist/features/events/repository/event-entry.repository.js +32 -7
  29. package/dist/features/events/types/index.d.ts +3 -1
  30. package/dist/features/filters/SwitchFilter.js +2 -4
  31. package/dist/features/homepage/components/BrandsSection.js +2 -2
  32. package/dist/features/homepage/components/CustomCardsSection.js +1 -1
  33. package/dist/features/homepage/components/CustomerReviewsSection.js +1 -1
  34. package/dist/features/homepage/components/FeaturedResultsSection.js +1 -1
  35. package/dist/features/homepage/components/SectionCarousel.js +1 -1
  36. package/dist/features/homepage/components/ShopByCategorySection.js +1 -1
  37. package/dist/features/live/components/LiveItemsIndexListing.js +3 -4
  38. package/dist/features/pre-orders/components/PreOrdersIndexListing.js +3 -4
  39. package/dist/features/products/components/AuctionsIndexListing.js +3 -4
  40. package/dist/features/products/components/PrizeDrawsIndexListing.js +3 -8
  41. package/dist/features/products/components/ProductDetailPageView.js +17 -2
  42. package/dist/features/products/components/ProductsIndexListing.js +10 -6
  43. package/dist/features/products/schemas/firestore.d.ts +2 -0
  44. package/dist/features/reviews/actions/review-actions.js +2 -0
  45. package/dist/features/reviews/components/ReviewDetailShell.js +3 -2
  46. package/dist/features/reviews/components/ReviewFilters.js +1 -1
  47. package/dist/features/reviews/components/ReviewsIndexListing.js +9 -2
  48. package/dist/features/reviews/hooks/useReviews.js +2 -0
  49. package/dist/features/reviews/schemas/firestore.d.ts +4 -0
  50. package/dist/features/reviews/types/index.d.ts +3 -0
  51. package/dist/features/scams/components/ScamRegistryView.js +41 -8
  52. package/dist/features/stores/components/InteractiveStoreCard.js +1 -1
  53. package/dist/features/stores/components/StoreAuctionsListing.js +3 -4
  54. package/dist/features/stores/components/StoreDetailLayoutView.js +13 -5
  55. package/dist/features/stores/components/StorePreOrdersListing.js +3 -4
  56. package/dist/features/stores/components/StoreProductsListing.js +3 -4
  57. package/dist/index.d.ts +1 -0
  58. package/dist/providers/db-firebase/helpers.d.ts +4 -6
  59. package/dist/providers/db-firebase/helpers.js +18 -5
  60. package/dist/providers/db-firebase/sieve.js +26 -1
  61. package/dist/react/hooks/usePendingFilters.d.ts +2 -0
  62. package/dist/react/hooks/usePendingFilters.js +9 -0
  63. package/dist/react/hooks/usePendingTable.d.ts +5 -0
  64. package/dist/react/hooks/usePendingTable.js +1 -0
  65. package/dist/seed/homepage-sections-seed-data.js +2 -2
  66. package/dist/seed/products-standard-seed-data.js +1 -0
  67. package/dist/tailwind-utilities.css +1 -1
  68. package/dist/ui/components/Drawer.style.css +13 -0
  69. package/dist/ui/components/FilterDrawer.d.ts +4 -2
  70. package/dist/ui/components/FilterDrawer.js +2 -2
  71. package/package.json +1 -1
@@ -19,6 +19,31 @@
19
19
  */
20
20
  import { SieveProcessorBase } from "@mohasinac/sievejs/services";
21
21
  import { createFirebaseAdapter } from "@mohasinac/sievejs/adapters/firebase";
22
+ /**
23
+ * Wraps the stock Firebase adapter and upgrades OR groups where all conditions
24
+ * are equality checks on the same field into a Firestore `in` query.
25
+ *
26
+ * Background: Sieve parses `field==v1|v2` as a single term with two values
27
+ * (OR semantics). The stock adapter tries `whereOr` which Firestore Admin SDK
28
+ * doesn't support. Firestore's `.where(field, "in", [v1, v2])` is the correct
29
+ * equivalent and supports up to 30 values.
30
+ */
31
+ function createEnhancedFirebaseAdapter() {
32
+ const base = createFirebaseAdapter();
33
+ return {
34
+ ...base,
35
+ applyFilterGroup(query, group) {
36
+ if (group.length > 1 &&
37
+ group.every((c) => c.parsedOperator === "equals" &&
38
+ !c.operatorIsNegated &&
39
+ !c.operatorIsCaseInsensitive &&
40
+ c.field === group[0].field)) {
41
+ return query.where(group[0].field, "in", group.map((c) => c.value));
42
+ }
43
+ return base.applyFilterGroup(query, group);
44
+ },
45
+ };
46
+ }
22
47
  import { FirebaseRepository } from "./base";
23
48
  import { deserializeTimestamps, getFirestoreCount } from "./helpers";
24
49
  import { expandFilterAliases as _expandFilterAliases, } from "./filter-aliases";
@@ -90,7 +115,7 @@ export class FirebaseSieveRepository extends FirebaseRepository {
90
115
  const base = baseQuery ?? this.getCollection();
91
116
  const effective = withAliasesExpanded(model, aliases);
92
117
  const processor = new SieveProcessorBase({
93
- adapter: createFirebaseAdapter(),
118
+ adapter: createEnhancedFirebaseAdapter(),
94
119
  autoLoadConfig: false,
95
120
  options: merged,
96
121
  fields,
@@ -25,6 +25,8 @@ export interface UsePendingFiltersReturn {
25
25
  reset: () => void;
26
26
  /** Clear all keys in both pending state and the URL */
27
27
  clear: () => void;
28
+ /** Clear filter keys + extra URL keys in a single router.replace — avoids the double-replace race */
29
+ clearAll: (extras?: Record<string, string>) => void;
28
30
  }
29
31
  /**
30
32
  * usePendingFilters
@@ -65,6 +65,14 @@ export function usePendingFilters({ table, keys, }) {
65
65
  updates[k] = "";
66
66
  table.setMany(updates);
67
67
  }, [keys, table]);
68
+ const clearAll = useCallback((extras) => {
69
+ const empty = Object.fromEntries(keys.map((k) => [k, []]));
70
+ setPending(empty);
71
+ const updates = { page: "1", ...extras };
72
+ for (const k of keys)
73
+ updates[k] = "";
74
+ table.setMany(updates);
75
+ }, [keys, table]);
68
76
  return {
69
77
  pending,
70
78
  applied,
@@ -75,5 +83,6 @@ export function usePendingFilters({ table, keys, }) {
75
83
  apply,
76
84
  reset,
77
85
  clear,
86
+ clearAll,
78
87
  };
79
88
  }
@@ -17,6 +17,11 @@ export interface UsePendingTableReturn {
17
17
  onFilterApply: () => void;
18
18
  /** Clear all filter keys from pending state and URL */
19
19
  onFilterClear: () => void;
20
+ /**
21
+ * Clear filter keys + extra URL keys in a SINGLE router.replace.
22
+ * Use this in resetAll handlers to avoid the double-replace race condition.
23
+ */
24
+ onResetAll: (extras?: Record<string, string>) => void;
20
25
  /**
21
26
  * Revert pending state to the current URL values without clearing them.
22
27
  * Call this when opening a filter drawer to ensure it shows the last
@@ -40,6 +40,7 @@ export function usePendingTable(table, keys) {
40
40
  filterActiveCount: filters.appliedCount,
41
41
  onFilterApply: filters.apply,
42
42
  onFilterClear: filters.clear,
43
+ onResetAll: filters.clearAll,
43
44
  onFilterReset: filters.reset,
44
45
  };
45
46
  }
@@ -327,9 +327,9 @@ export const homepageSectionsSeedData = [
327
327
  /** Which tabs to surface in display order (leave empty [] to auto-derive from categories) */
328
328
  visibleTabs: ["general", "orders_payment", "shipping_delivery", "returns_refunds"],
329
329
  /** Allow multiple accordion panels open at once */
330
- allowMultipleOpen: false,
330
+ allowMultipleOpen: true,
331
331
  /** Number of items expanded on first render (0 = all closed) */
332
- defaultOpenCount: 1,
332
+ defaultOpenCount: 100,
333
333
  categories: ["general", "orders_payment", "shipping_delivery", "returns_refunds", "product_information"],
334
334
  },
335
335
  createdAt: daysAgo(90),
@@ -4134,6 +4134,7 @@ export const productsStandardSeedData = [
4134
4134
  ..._rawProductsStandardSeedData.map((p) => ({
4135
4135
  ...p,
4136
4136
  listingType: "standard",
4137
+ isPartOfBundle: Array.isArray(p.partOfBundleIds) && p.partOfBundleIds.length > 0,
4137
4138
  })),
4138
4139
  // ── SB-UNI-M classified seed (OLX-style meetup) ──────────────────────────
4139
4140
  {