@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.
- package/dist/constants/field-names.d.ts +1 -0
- package/dist/constants/field-names.js +1 -0
- package/dist/core/unit-of-work.js +3 -4
- package/dist/features/admin/components/DashboardStats.js +1 -1
- package/dist/features/auth/actions/profile-actions.js +4 -1
- package/dist/features/auth/repository/user.repository.d.ts +1 -0
- package/dist/features/auth/repository/user.repository.js +3 -0
- package/dist/features/blog/api/route.js +3 -0
- package/dist/features/blog/components/BlogIndexListing.js +2 -0
- package/dist/features/blog/components/BlogPostView.js +2 -1
- package/dist/features/categories/api/route.js +1 -1
- package/dist/features/categories/components/BundleDetailView.js +5 -3
- package/dist/features/categories/components/CategoryBundlesListing.js +77 -41
- package/dist/features/categories/components/CategoryDetailPageView.js +12 -9
- package/dist/features/categories/components/CategoryProductsListing.js +3 -5
- package/dist/features/classified/components/ClassifiedIndexListing.js +3 -4
- package/dist/features/digital-codes/components/DigitalCodesIndexListing.js +3 -4
- package/dist/features/events/actions/event-actions.d.ts +2 -3
- package/dist/features/events/actions/event-actions.js +3 -5
- package/dist/features/events/api/route.js +7 -7
- package/dist/features/events/components/AdminEventEditorView.js +80 -6
- package/dist/features/events/components/AdminEventEntriesView.js +33 -4
- package/dist/features/events/components/EventFilters.d.ts +3 -0
- package/dist/features/events/components/EventFilters.js +1 -0
- package/dist/features/events/components/EventLeaderboard.js +1 -1
- package/dist/features/events/components/EventsIndexListing.js +10 -7
- package/dist/features/events/repository/event-entry.repository.d.ts +2 -2
- package/dist/features/events/repository/event-entry.repository.js +32 -7
- package/dist/features/events/types/index.d.ts +3 -1
- package/dist/features/filters/SwitchFilter.js +2 -4
- package/dist/features/homepage/components/BrandsSection.js +2 -2
- package/dist/features/homepage/components/CustomCardsSection.js +1 -1
- package/dist/features/homepage/components/CustomerReviewsSection.js +1 -1
- package/dist/features/homepage/components/FeaturedResultsSection.js +1 -1
- package/dist/features/homepage/components/SectionCarousel.js +1 -1
- package/dist/features/homepage/components/ShopByCategorySection.js +1 -1
- package/dist/features/live/components/LiveItemsIndexListing.js +3 -4
- package/dist/features/pre-orders/components/PreOrdersIndexListing.js +3 -4
- package/dist/features/products/components/AuctionsIndexListing.js +3 -4
- package/dist/features/products/components/PrizeDrawsIndexListing.js +3 -8
- package/dist/features/products/components/ProductDetailPageView.js +17 -2
- package/dist/features/products/components/ProductsIndexListing.js +10 -6
- package/dist/features/products/schemas/firestore.d.ts +2 -0
- package/dist/features/reviews/actions/review-actions.js +2 -0
- package/dist/features/reviews/components/ReviewDetailShell.js +3 -2
- package/dist/features/reviews/components/ReviewFilters.js +1 -1
- package/dist/features/reviews/components/ReviewsIndexListing.js +9 -2
- package/dist/features/reviews/hooks/useReviews.js +2 -0
- package/dist/features/reviews/schemas/firestore.d.ts +4 -0
- package/dist/features/reviews/types/index.d.ts +3 -0
- package/dist/features/scams/components/ScamRegistryView.js +41 -8
- package/dist/features/stores/components/InteractiveStoreCard.js +1 -1
- package/dist/features/stores/components/StoreAuctionsListing.js +3 -4
- package/dist/features/stores/components/StoreDetailLayoutView.js +13 -5
- package/dist/features/stores/components/StorePreOrdersListing.js +3 -4
- package/dist/features/stores/components/StoreProductsListing.js +3 -4
- package/dist/index.d.ts +1 -0
- package/dist/providers/db-firebase/helpers.d.ts +4 -6
- package/dist/providers/db-firebase/helpers.js +18 -5
- package/dist/providers/db-firebase/sieve.js +26 -1
- package/dist/react/hooks/usePendingFilters.d.ts +2 -0
- package/dist/react/hooks/usePendingFilters.js +9 -0
- package/dist/react/hooks/usePendingTable.d.ts +5 -0
- package/dist/react/hooks/usePendingTable.js +1 -0
- package/dist/seed/homepage-sections-seed-data.js +2 -2
- package/dist/seed/products-standard-seed-data.js +1 -0
- package/dist/tailwind-utilities.css +1 -1
- package/dist/ui/components/Drawer.style.css +13 -0
- package/dist/ui/components/FilterDrawer.d.ts +4 -2
- package/dist/ui/components/FilterDrawer.js +2 -2
- 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:
|
|
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
|
|
@@ -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:
|
|
330
|
+
allowMultipleOpen: true,
|
|
331
331
|
/** Number of items expanded on first render (0 = all closed) */
|
|
332
|
-
defaultOpenCount:
|
|
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
|
{
|