@mohasinac/appkit 2.8.3 → 2.8.4

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 (171) hide show
  1. package/dist/client.d.ts +2 -0
  2. package/dist/client.js +2 -0
  3. package/dist/core/hooks/useSiteSettings.d.ts +1 -1
  4. package/dist/features/account/hooks/useAccount.d.ts +2 -2
  5. package/dist/features/account/hooks/useAddressSelector.d.ts +1 -1
  6. package/dist/features/account/hooks/useAddresses.d.ts +2 -2
  7. package/dist/features/account/hooks/useNotifications.d.ts +1 -1
  8. package/dist/features/account/hooks/useProfile.d.ts +1 -1
  9. package/dist/features/account/hooks/usePublicProfile.d.ts +2 -2
  10. package/dist/features/admin/components/AdminAllEventEntriesView.js +5 -3
  11. package/dist/features/admin/components/AdminBidsView.js +6 -4
  12. package/dist/features/admin/components/AdminBlogView.js +6 -4
  13. package/dist/features/admin/components/AdminBrandsView.js +8 -6
  14. package/dist/features/admin/components/AdminBundlesView.js +10 -8
  15. package/dist/features/admin/components/AdminCartsView.js +6 -4
  16. package/dist/features/admin/components/AdminCategoriesView.js +7 -5
  17. package/dist/features/admin/components/AdminClassifiedView.js +4 -3
  18. package/dist/features/admin/components/AdminContactView.js +6 -4
  19. package/dist/features/admin/components/AdminCouponsView.js +6 -4
  20. package/dist/features/admin/components/AdminDigitalCodesView.js +4 -3
  21. package/dist/features/admin/components/AdminFaqsView.js +5 -3
  22. package/dist/features/admin/components/AdminFeaturesView.js +5 -4
  23. package/dist/features/admin/components/AdminGroupedListingsView.js +4 -3
  24. package/dist/features/admin/components/AdminHistoryView.js +4 -3
  25. package/dist/features/admin/components/AdminLiveView.js +4 -3
  26. package/dist/features/admin/components/AdminNewsletterView.js +5 -3
  27. package/dist/features/admin/components/AdminNotificationsView.js +6 -4
  28. package/dist/features/admin/components/AdminOrdersView.js +6 -4
  29. package/dist/features/admin/components/AdminPayoutsView.js +7 -5
  30. package/dist/features/admin/components/AdminPrizeDrawsView.js +6 -4
  31. package/dist/features/admin/components/AdminProductsView.js +7 -5
  32. package/dist/features/admin/components/AdminReturnRequestsView.js +4 -3
  33. package/dist/features/admin/components/AdminReviewsView.js +8 -6
  34. package/dist/features/admin/components/AdminScammersView.js +8 -6
  35. package/dist/features/admin/components/AdminSessionsView.js +6 -4
  36. package/dist/features/admin/components/AdminStoreAddressesView.js +2 -1
  37. package/dist/features/admin/components/AdminStoresView.js +6 -4
  38. package/dist/features/admin/components/AdminSublistingCategoriesView.js +6 -5
  39. package/dist/features/admin/components/AdminSupportTicketsView.js +8 -6
  40. package/dist/features/admin/components/AdminTeamView.js +6 -4
  41. package/dist/features/admin/components/AdminUsersView.js +6 -4
  42. package/dist/features/admin/components/AdminWishlistsView.js +4 -3
  43. package/dist/features/admin/constants/filter-tabs.d.ts +1 -1
  44. package/dist/features/admin/constants/filter-tabs.js +0 -11
  45. package/dist/features/admin/hooks/useAdmin.d.ts +1 -1
  46. package/dist/features/admin/hooks/useAdminSectionsListing.d.ts +1 -1
  47. package/dist/features/admin/hooks/useChat.d.ts +1 -1
  48. package/dist/features/admin/types/index.d.ts +1 -1
  49. package/dist/features/auctions/actions/bid-actions.js +4 -2
  50. package/dist/features/auctions/components/AuctionsListView.js +7 -6
  51. package/dist/features/auctions/hooks/useAuctions.d.ts +8 -8
  52. package/dist/features/auth/hooks/useAuth.d.ts +2 -2
  53. package/dist/features/blog/actions/blog-actions.js +3 -2
  54. package/dist/features/cart/hooks/useCart.d.ts +1 -1
  55. package/dist/features/cart/hooks/useCartQuery.d.ts +1 -1
  56. package/dist/features/cart/hooks/useCheckoutReadQueries.d.ts +2 -2
  57. package/dist/features/cart/hooks/useOrder.d.ts +2 -2
  58. package/dist/features/categories/components/BrandDetailPageView.js +10 -8
  59. package/dist/features/categories/components/CategoriesIndexListing.js +1 -1
  60. package/dist/features/categories/components/CategoriesIndexPageView.js +5 -4
  61. package/dist/features/categories/components/CategoryBundlesListing.js +5 -4
  62. package/dist/features/categories/components/CategoryDetailPageView.js +12 -10
  63. package/dist/features/categories/components/CategoryFilters.d.ts +12 -12
  64. package/dist/features/categories/components/CategoryFilters.js +13 -12
  65. package/dist/features/categories/components/CategoryTree.d.ts +1 -1
  66. package/dist/features/categories/components/CategoryTree.js +1 -1
  67. package/dist/features/categories/hooks/useCategories.d.ts +3 -3
  68. package/dist/features/categories/hooks/useCategorySelector.d.ts +3 -3
  69. package/dist/features/categories/hooks/useCategoryTree.d.ts +1 -1
  70. package/dist/features/categories/schemas/firestore.d.ts +2 -2
  71. package/dist/features/checkout/actions/checkout-actions.d.ts +1 -1
  72. package/dist/features/checkout/actions/checkout-actions.js +1 -1
  73. package/dist/features/checkout/hooks/useCheckoutApi.d.ts +2 -2
  74. package/dist/features/classified/components/ClassifiedListView.js +6 -5
  75. package/dist/features/collections/hooks/useCollections.d.ts +2 -2
  76. package/dist/features/cron/jobs/auction-expiry.job.d.ts +2 -2
  77. package/dist/features/cron/jobs/auction-expiry.job.js +2 -1
  78. package/dist/features/cron/jobs/preorder-reminder.job.d.ts +1 -1
  79. package/dist/features/cron/jobs/preorder-reminder.job.js +2 -1
  80. package/dist/features/digital-codes/components/DigitalCodesListView.js +4 -3
  81. package/dist/features/events/actions/event-actions.js +6 -4
  82. package/dist/features/events/components/AdminEventEditorView.js +1 -1
  83. package/dist/features/events/components/AdminEventsView.js +7 -5
  84. package/dist/features/events/components/EventFilters.d.ts +4 -4
  85. package/dist/features/events/components/EventFilters.js +2 -2
  86. package/dist/features/events/components/EventRafflesSection.js +4 -2
  87. package/dist/features/events/hooks/useEvent.d.ts +3 -3
  88. package/dist/features/events/hooks/useEvents.d.ts +1 -1
  89. package/dist/features/faq/actions/faq-actions.js +4 -2
  90. package/dist/features/faq/components/FAQPageContent.js +2 -1
  91. package/dist/features/faq/hooks/useFAQs.d.ts +1 -1
  92. package/dist/features/faq/hooks/useFaqList.d.ts +15 -15
  93. package/dist/features/homepage/components/MarketplaceHomepageView.js +4 -2
  94. package/dist/features/homepage/hooks/useBlogArticles.d.ts +1 -1
  95. package/dist/features/homepage/hooks/useFeaturedAuctions.d.ts +1 -1
  96. package/dist/features/homepage/hooks/useFeaturedPreOrders.d.ts +1 -1
  97. package/dist/features/homepage/hooks/useFeaturedProducts.d.ts +1 -1
  98. package/dist/features/homepage/hooks/useFeaturedStores.d.ts +1 -1
  99. package/dist/features/homepage/hooks/useHeroCarousel.d.ts +1 -1
  100. package/dist/features/homepage/hooks/useHomepageEvents.d.ts +1 -1
  101. package/dist/features/homepage/hooks/useHomepageReviews.d.ts +1 -1
  102. package/dist/features/homepage/hooks/useHomepageSections.d.ts +1 -1
  103. package/dist/features/homepage/hooks/useTopBrands.d.ts +1 -1
  104. package/dist/features/homepage/hooks/useTopCategories.d.ts +1 -1
  105. package/dist/features/layout/BottomActions.js +0 -27
  106. package/dist/features/layout/BottomActionsContext.d.ts +0 -36
  107. package/dist/features/layout/BottomActionsContext.js +0 -36
  108. package/dist/features/live/components/LiveItemsListView.js +6 -5
  109. package/dist/features/loyalty/hooks/useLoyaltyBalance.d.ts +1 -1
  110. package/dist/features/orders/hooks/useOrders.d.ts +2 -2
  111. package/dist/features/payments/hooks/usePayments.d.ts +1 -1
  112. package/dist/features/pre-orders/components/PreOrdersListView.js +5 -4
  113. package/dist/features/pre-orders/hooks/usePreOrders.d.ts +2 -2
  114. package/dist/features/products/actions/product-actions.js +17 -15
  115. package/dist/features/products/columns/index.d.ts +1 -1
  116. package/dist/features/products/columns/index.js +1 -1
  117. package/dist/features/products/components/PrizeDrawCollage.js +0 -14
  118. package/dist/features/products/components/PrizeDrawsListingView.js +5 -4
  119. package/dist/features/products/components/PrizeDrawsSection.js +4 -2
  120. package/dist/features/products/constants/sieve.d.ts +2 -2
  121. package/dist/features/products/constants/sieve.js +2 -2
  122. package/dist/features/products/hooks/useProductDetail.d.ts +1 -1
  123. package/dist/features/products/hooks/useRelatedProducts.d.ts +1 -1
  124. package/dist/features/products/hooks/useRelatedProducts.js +5 -4
  125. package/dist/features/promotions/hooks/usePromotions.d.ts +2 -2
  126. package/dist/features/reviews/actions/review-actions.js +2 -1
  127. package/dist/features/reviews/components/ReviewsIndexPageView.js +7 -6
  128. package/dist/features/reviews/hooks/useReviews.d.ts +2 -2
  129. package/dist/features/scams/actions/scam-actions.js +3 -2
  130. package/dist/features/scams/components/ScamRegistryView.js +5 -4
  131. package/dist/features/search/actions/search-actions.js +7 -6
  132. package/dist/features/search/hooks/useSearch.d.ts +2 -2
  133. package/dist/features/seller/components/CouponInlineSelect.js +2 -1
  134. package/dist/features/seller/components/SellerAuctionsView.js +7 -5
  135. package/dist/features/seller/components/SellerBidsView.js +5 -3
  136. package/dist/features/seller/components/SellerBundlesView.js +7 -6
  137. package/dist/features/seller/components/SellerClassifiedView.js +6 -5
  138. package/dist/features/seller/components/SellerCouponsView.js +6 -4
  139. package/dist/features/seller/components/SellerDigitalCodesView.js +5 -4
  140. package/dist/features/seller/components/SellerGroupedListingsView.js +5 -4
  141. package/dist/features/seller/components/SellerLiveView.js +6 -5
  142. package/dist/features/seller/components/SellerOffersView.js +6 -4
  143. package/dist/features/seller/components/SellerOrdersView.js +5 -3
  144. package/dist/features/seller/components/SellerPayoutMethodsView.js +3 -2
  145. package/dist/features/seller/components/SellerPayoutsView.js +6 -4
  146. package/dist/features/seller/components/SellerPreOrdersView.js +6 -4
  147. package/dist/features/seller/components/SellerPrizeDrawsView.js +6 -4
  148. package/dist/features/seller/components/SellerProductsView.js +9 -7
  149. package/dist/features/seller/components/SellerShippingConfigsView.js +3 -2
  150. package/dist/features/seller/components/SellerStoreCategoriesView.js +4 -3
  151. package/dist/features/seller/components/SellerTemplatesView.js +4 -3
  152. package/dist/features/seller/components/SublistingInlineSelect.js +2 -1
  153. package/dist/features/seller/hooks/useSellerPayouts.d.ts +3 -3
  154. package/dist/features/seller/hooks/useSellerStore.d.ts +6 -6
  155. package/dist/features/seller/hooks/useSellerStorefront.d.ts +2 -2
  156. package/dist/features/stores/actions/store-query-actions.js +3 -2
  157. package/dist/features/stores/components/StoreAuctionsPageView.js +4 -2
  158. package/dist/features/stores/components/StoreDetailLayoutView.d.ts +1 -1
  159. package/dist/features/stores/components/StoreDetailLayoutView.js +7 -6
  160. package/dist/features/stores/components/StorePreOrdersPageView.js +4 -2
  161. package/dist/features/stores/components/StorePrizeDrawsPageView.js +4 -2
  162. package/dist/features/stores/components/StoreProductsPageView.js +2 -1
  163. package/dist/features/stores/components/StoreProductsView.js +5 -4
  164. package/dist/features/stores/components/StoresIndexListing.js +4 -3
  165. package/dist/features/stores/hooks/useStoreAddressSelector.d.ts +1 -1
  166. package/dist/features/stores/hooks/useStores.d.ts +6 -6
  167. package/dist/features/wishlist/components/WishlistView.js +4 -3
  168. package/dist/features/wishlist/hooks/useUserWishlist.d.ts +15 -15
  169. package/dist/features/wishlist/hooks/useWishlist.d.ts +1 -1
  170. package/dist/features/wishlist/hooks/useWishlistWithGuest.d.ts +1 -1
  171. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { sieveFilter, sieveAnd, SIEVE_OP } from "@mohasinac/appkit";
2
3
  import { cache } from "react";
3
4
  import { storeRepository, productRepository, categoriesRepository, siteSettingsRepository, reviewRepository, couponsRepository } from "../../../repositories";
4
5
  import { ROUTES } from "../../../next";
@@ -30,19 +31,19 @@ export async function StoreDetailLayoutView({ storeSlug, activeTab, children, })
30
31
  const [productsCount, auctionsCount, preOrdersCount, prizeDrawsCount, bundlesCount, couponsCount, reviewsCount] = storeId
31
32
  ? await Promise.all([
32
33
  productRepository
33
- .list({ filters: `storeId==${storeId},status==published,listingType==standard`, page: 1, pageSize: 1 })
34
+ .list({ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("listingType", SIEVE_OP.EQ, "standard")), page: 1, pageSize: 1 })
34
35
  .then((r) => r.total)
35
36
  .catch(() => 0),
36
37
  productRepository
37
- .list({ filters: `storeId==${storeId},status==published,listingType==auction`, page: 1, pageSize: 1 })
38
+ .list({ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("listingType", SIEVE_OP.EQ, "auction")), page: 1, pageSize: 1 })
38
39
  .then((r) => r.total)
39
40
  .catch(() => 0),
40
41
  productRepository
41
- .list({ filters: `storeId==${storeId},status==published,listingType==pre-order`, page: 1, pageSize: 1 })
42
+ .list({ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("listingType", SIEVE_OP.EQ, "pre-order")), page: 1, pageSize: 1 })
42
43
  .then((r) => r.total)
43
44
  .catch(() => 0),
44
45
  productRepository
45
- .list({ filters: `storeId==${storeId},status==published,listingType==prize-draw`, page: 1, pageSize: 1 })
46
+ .list({ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("listingType", SIEVE_OP.EQ, "prize-draw")), page: 1, pageSize: 1 })
46
47
  .then((r) => r.total)
47
48
  .catch(() => 0),
48
49
  // SB-UNI-D — bundles live on categories with categoryType:"bundle"
@@ -52,11 +53,11 @@ export async function StoreDetailLayoutView({ storeSlug, activeTab, children, })
52
53
  .then((rows) => rows.filter((c) => c.createdByStoreId === storeId).length)
53
54
  .catch(() => 0),
54
55
  couponsRepository
55
- .list({ filters: `sellerId==${storeId},validity.isActive==true`, page: 1, pageSize: 1 })
56
+ .list({ filters: sieveAnd(sieveFilter("sellerId", SIEVE_OP.EQ, storeId), sieveFilter("validity.isActive", SIEVE_OP.EQ, "true")), page: 1, pageSize: 1 })
56
57
  .then((r) => r.total)
57
58
  .catch(() => 0),
58
59
  reviewRepository
59
- .listAll({ filters: `storeId==${storeId},status==approved`, page: 1, pageSize: 1 })
60
+ .listAll({ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "approved")), page: 1, pageSize: 1 })
60
61
  .then((r) => r.total)
61
62
  .catch(() => 0),
62
63
  ])
@@ -1,4 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { sieveFilter, sieveAnd, SIEVE_OP } from "@mohasinac/appkit";
3
+ import { sortBy } from "@mohasinac/appkit";
2
4
  import { productRepository } from "../../../repositories";
3
5
  import { getStoreBySlug } from "./StoreDetailLayoutView";
4
6
  import { StorePreOrdersListing } from "./StorePreOrdersListing";
@@ -8,8 +10,8 @@ export async function StorePreOrdersPageView({ storeSlug }) {
8
10
  const result = storeId
9
11
  ? await productRepository
10
12
  .list({
11
- filters: `storeId==${storeId},status==published,listingType==pre-order`,
12
- sorts: "-createdAt",
13
+ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("listingType", SIEVE_OP.EQ, "pre-order")),
14
+ sorts: sortBy("createdAt", "DESC"),
13
15
  page: 1,
14
16
  pageSize: 24,
15
17
  })
@@ -1,4 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { sieveFilter, sieveAnd, SIEVE_OP } from "@mohasinac/appkit";
3
+ import { sortBy } from "@mohasinac/appkit";
2
4
  import { productRepository } from "../../../repositories";
3
5
  import { getStoreBySlug } from "./StoreDetailLayoutView";
4
6
  import { PrizeDrawsIndexListing } from "../../products/components/PrizeDrawsIndexListing";
@@ -17,8 +19,8 @@ export async function StorePrizeDrawsPageView({ storeSlug, }) {
17
19
  }
18
20
  const result = await productRepository
19
21
  .list({
20
- filters: `storeId==${storeId},status==published,listingType==prize-draw`,
21
- sorts: "-createdAt",
22
+ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("listingType", SIEVE_OP.EQ, "prize-draw")),
23
+ sorts: sortBy("createdAt", "DESC"),
22
24
  page: 1,
23
25
  pageSize: 24,
24
26
  })
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { sieveFilter, sieveAnd, SIEVE_OP } from "@mohasinac/appkit";
2
3
  import { productRepository } from "../../../repositories";
3
4
  import { parseListingSearchParams } from "../../../utils/listing-params";
4
5
  import { getStoreBySlug } from "./StoreDetailLayoutView";
@@ -18,7 +19,7 @@ export async function StoreProductsPageView({ storeSlug, searchParams, }) {
18
19
  const pageSize = std.pageSize ?? DEFAULT_PAGE_SIZE;
19
20
  const result = await productRepository
20
21
  .list({
21
- filters: `storeId==${storeId},status==published,listingType==standard`,
22
+ filters: sieveAnd(sieveFilter("storeId", SIEVE_OP.EQ, storeId), sieveFilter("status", SIEVE_OP.EQ, "published"), sieveFilter("listingType", SIEVE_OP.EQ, "standard")),
22
23
  sorts,
23
24
  page,
24
25
  pageSize,
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { sortBy } from "@mohasinac/appkit";
3
4
  import { useState } from "react";
4
5
  import { Div, Heading, Input, Select, SlottedListingView } from "../../../ui";
5
6
  export function StoreProductsView({ storeSlug, labels = {}, renderProducts, renderSearch, renderSort, renderFilters, renderActiveFilters, renderViewToggle, renderPagination, items = [], total = 0, isLoading = false, className = "", }) {
@@ -8,9 +9,9 @@ export function StoreProductsView({ storeSlug, labels = {}, renderProducts, rend
8
9
  const [viewMode, setViewMode] = useState("grid");
9
10
  void storeSlug;
10
11
  return (_jsx(Div, { className: `py-4 ${className}`, children: _jsx(SlottedListingView, { portal: "public", inlineToolbar: true, className: "space-y-4", renderHeader: () => labels.title ? (_jsx(Heading, { level: 2, className: "mb-1 text-xl font-semibold", children: labels.title })) : null, renderSearch: () => renderSearch?.(search, setSearch) ?? (_jsx(Input, { value: search, onChange: (event) => setSearch(event.target.value), placeholder: "Search store products", className: "max-w-sm" })), renderSort: () => renderSort?.(sort, setSort) ?? (_jsx(Select, { value: sort, onValueChange: setSort, options: [
11
- { value: "-createdAt", label: "Newest" },
12
- { value: "createdAt", label: "Oldest" },
13
- { value: "price", label: "Price: Low to High" },
14
- { value: "-price", label: "Price: High to Low" },
12
+ { value: sortBy("createdAt", "DESC"), label: "Newest" },
13
+ { value: sortBy("createdAt", "ASC"), label: "Oldest" },
14
+ { value: sortBy("price", "ASC"), label: "Price: Low to High" },
15
+ { value: sortBy("price", "DESC"), label: "Price: High to Low" },
15
16
  ], className: "min-w-44" })), renderFilters: renderFilters, renderActiveFilters: renderActiveFilters, renderBulkActions: () => renderViewToggle?.(viewMode, setViewMode) ?? null, renderTable: () => renderProducts(items, isLoading), renderPagination: () => renderPagination?.(total) ?? null, total: total, isLoading: isLoading }) }));
16
17
  }
@@ -1,5 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { sieveFilter, SIEVE_OP } from "@mohasinac/appkit";
3
4
  import { useState, useCallback, useMemo } from "react";
4
5
  import { useUrlTable } from "../../../react/hooks/useUrlTable";
5
6
  import { useStores } from "../hooks/useStores";
@@ -103,12 +104,12 @@ export function StoresIndexListing({ initialData }) {
103
104
  if (ratingRaw) {
104
105
  const ratings = ratingRaw.split("|").filter(Boolean);
105
106
  if (ratings.length === 1)
106
- filterParts.push(`averageRating>=${ratings[0]}`);
107
+ filterParts.push(sieveFilter("averageRating", SIEVE_OP.GTE, ratings[0]));
107
108
  }
108
109
  if (minProductCount)
109
- filterParts.push(`stats.totalProducts>=${minProductCount}`);
110
+ filterParts.push(sieveFilter("stats.totalProducts", SIEVE_OP.GTE, minProductCount));
110
111
  if (maxProductCount)
111
- filterParts.push(`stats.totalProducts<=${maxProductCount}`);
112
+ filterParts.push(sieveFilter("stats.totalProducts", SIEVE_OP.LTE, maxProductCount));
112
113
  if (featured === "true")
113
114
  filterParts.push("isFeatured==true");
114
115
  const { stores, totalPages, isLoading } = useStores({
@@ -16,7 +16,7 @@ export declare function useStoreAddressSelector(options?: {
16
16
  }): {
17
17
  addresses: SavedAddress[];
18
18
  isLoading: boolean;
19
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<SavedAddress[]>, Error>>;
19
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<SavedAddress[], Error>>;
20
20
  createAddress: import("@tanstack/react-query").UseMutateFunction<CreateAddressApiResponse, Error, AddressFormData, unknown>;
21
21
  isSaving: boolean;
22
22
  };
@@ -12,16 +12,16 @@ export declare function useStores(params?: StoreListParams, opts?: UseStoresOpti
12
12
  hasMore: boolean;
13
13
  isLoading: false;
14
14
  error: string | null;
15
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<StoreListResponse>, Error>>;
15
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<StoreListResponse, Error>>;
16
16
  };
17
17
  export declare function useStoreBySlug(storeSlug: string, opts?: {
18
18
  enabled?: boolean;
19
19
  endpoint?: string;
20
20
  }): {
21
- store: NonNullable<NoInfer<StoreDetail | null>> | null;
21
+ store: StoreDetail | null;
22
22
  isLoading: boolean;
23
23
  error: string | null;
24
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<StoreDetail | null>, Error>>;
24
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<StoreDetail | null, Error>>;
25
25
  };
26
26
  export declare function useStoreProducts(storeSlug: string, params?: string, opts?: {
27
27
  enabled?: boolean;
@@ -32,7 +32,7 @@ export declare function useStoreProducts(storeSlug: string, params?: string, opt
32
32
  totalPages: number;
33
33
  isLoading: boolean;
34
34
  error: string | null;
35
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<StoreProductsResponse>, Error>>;
35
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<StoreProductsResponse, Error>>;
36
36
  };
37
37
  export declare function useStoreAuctions(storeSlug: string, params?: string, opts?: {
38
38
  enabled?: boolean;
@@ -43,7 +43,7 @@ export declare function useStoreAuctions(storeSlug: string, params?: string, opt
43
43
  totalPages: number;
44
44
  isLoading: boolean;
45
45
  error: string | null;
46
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<StoreAuctionsResponse>, Error>>;
46
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<StoreAuctionsResponse, Error>>;
47
47
  };
48
48
  export declare function useStoreReviews(storeSlug: string, params?: {
49
49
  rating?: number;
@@ -66,6 +66,6 @@ export declare function useStoreReviews(storeSlug: string, params?: {
66
66
  ratingDistribution: Record<number, number>;
67
67
  isLoading: boolean;
68
68
  error: string | null;
69
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<StoreReviewsData>, Error>>;
69
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<StoreReviewsData, Error>>;
70
70
  };
71
71
  export {};
@@ -1,14 +1,15 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { sortBy } from "@mohasinac/appkit";
3
4
  import React from "react";
4
5
  import { Div, Heading, Row, Text } from "../../../ui";
5
6
  import { useUrlTable } from "../../../react/hooks/useUrlTable";
6
7
  import { useWishlist } from "../hooks/useWishlist";
7
8
  const WISHLIST_SORT_OPTIONS = [
8
- { value: "-addedAt", label: "Newest first" },
9
+ { value: sortBy("addedAt", "DESC"), label: "Newest first" },
9
10
  { value: "addedAt", label: "Oldest first" },
10
- { value: "-price", label: "Price: high → low" },
11
- { value: "price", label: "Price: low → high" },
11
+ { value: sortBy("price", "DESC"), label: "Price: high → low" },
12
+ { value: sortBy("price", "ASC"), label: "Price: low → high" },
12
13
  ];
13
14
  export function WishlistView({ userId, initialData, labels = {}, renderTabs, renderSearch, renderSort, renderViewToggle, renderProducts, renderTabPlaceholder, renderBulkActions, renderPagination, className = "", }) {
14
15
  const table = useUrlTable({ defaults: { sort: "-addedAt", view: "card" } });
@@ -17,7 +17,7 @@ interface UseUserWishlistOptions<TProduct> {
17
17
  }
18
18
  export declare function useUserWishlist<TProduct = unknown>(options?: UseUserWishlistOptions<TProduct>): {
19
19
  total: number;
20
- data: NoInfer<UserWishlistResponse<TProduct>>;
20
+ data: UserWishlistResponse<TProduct>;
21
21
  error: Error;
22
22
  isError: true;
23
23
  isPending: false;
@@ -40,12 +40,12 @@ export declare function useUserWishlist<TProduct = unknown>(options?: UseUserWis
40
40
  isRefetching: boolean;
41
41
  isStale: boolean;
42
42
  isEnabled: boolean;
43
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<UserWishlistResponse<TProduct>>, Error>>;
43
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<UserWishlistResponse<TProduct>, Error>>;
44
44
  fetchStatus: import("@tanstack/query-core").FetchStatus;
45
- promise: Promise<NoInfer<UserWishlistResponse<TProduct>>>;
45
+ promise: Promise<UserWishlistResponse<TProduct>>;
46
46
  } | {
47
47
  total: number;
48
- data: NoInfer<UserWishlistResponse<TProduct>>;
48
+ data: UserWishlistResponse<TProduct>;
49
49
  error: null;
50
50
  isError: false;
51
51
  isPending: false;
@@ -68,9 +68,9 @@ export declare function useUserWishlist<TProduct = unknown>(options?: UseUserWis
68
68
  isRefetching: boolean;
69
69
  isStale: boolean;
70
70
  isEnabled: boolean;
71
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<UserWishlistResponse<TProduct>>, Error>>;
71
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<UserWishlistResponse<TProduct>, Error>>;
72
72
  fetchStatus: import("@tanstack/query-core").FetchStatus;
73
- promise: Promise<NoInfer<UserWishlistResponse<TProduct>>>;
73
+ promise: Promise<UserWishlistResponse<TProduct>>;
74
74
  } | {
75
75
  total: number;
76
76
  data: undefined;
@@ -96,9 +96,9 @@ export declare function useUserWishlist<TProduct = unknown>(options?: UseUserWis
96
96
  isRefetching: boolean;
97
97
  isStale: boolean;
98
98
  isEnabled: boolean;
99
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<UserWishlistResponse<TProduct>>, Error>>;
99
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<UserWishlistResponse<TProduct>, Error>>;
100
100
  fetchStatus: import("@tanstack/query-core").FetchStatus;
101
- promise: Promise<NoInfer<UserWishlistResponse<TProduct>>>;
101
+ promise: Promise<UserWishlistResponse<TProduct>>;
102
102
  } | {
103
103
  total: number;
104
104
  data: undefined;
@@ -124,9 +124,9 @@ export declare function useUserWishlist<TProduct = unknown>(options?: UseUserWis
124
124
  isRefetching: boolean;
125
125
  isStale: boolean;
126
126
  isEnabled: boolean;
127
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<UserWishlistResponse<TProduct>>, Error>>;
127
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<UserWishlistResponse<TProduct>, Error>>;
128
128
  fetchStatus: import("@tanstack/query-core").FetchStatus;
129
- promise: Promise<NoInfer<UserWishlistResponse<TProduct>>>;
129
+ promise: Promise<UserWishlistResponse<TProduct>>;
130
130
  } | {
131
131
  total: number;
132
132
  data: undefined;
@@ -152,12 +152,12 @@ export declare function useUserWishlist<TProduct = unknown>(options?: UseUserWis
152
152
  isRefetching: boolean;
153
153
  isStale: boolean;
154
154
  isEnabled: boolean;
155
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<UserWishlistResponse<TProduct>>, Error>>;
155
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<UserWishlistResponse<TProduct>, Error>>;
156
156
  fetchStatus: import("@tanstack/query-core").FetchStatus;
157
- promise: Promise<NoInfer<UserWishlistResponse<TProduct>>>;
157
+ promise: Promise<UserWishlistResponse<TProduct>>;
158
158
  } | {
159
159
  total: number;
160
- data: NoInfer<UserWishlistResponse<TProduct>>;
160
+ data: UserWishlistResponse<TProduct>;
161
161
  isError: false;
162
162
  error: null;
163
163
  isPending: false;
@@ -180,8 +180,8 @@ export declare function useUserWishlist<TProduct = unknown>(options?: UseUserWis
180
180
  isRefetching: boolean;
181
181
  isStale: boolean;
182
182
  isEnabled: boolean;
183
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<UserWishlistResponse<TProduct>>, Error>>;
183
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<UserWishlistResponse<TProduct>, Error>>;
184
184
  fetchStatus: import("@tanstack/query-core").FetchStatus;
185
- promise: Promise<NoInfer<UserWishlistResponse<TProduct>>>;
185
+ promise: Promise<UserWishlistResponse<TProduct>>;
186
186
  };
187
187
  export {};
@@ -11,6 +11,6 @@ export declare function useWishlist(userId: string, opts?: UseWishlistOptions):
11
11
  isWishlisted: (productId: string) => boolean;
12
12
  isLoading: boolean;
13
13
  error: Error | null;
14
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<WishlistResponse>, Error>>;
14
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WishlistResponse, Error>>;
15
15
  };
16
16
  export {};
@@ -17,7 +17,7 @@ export declare function useWishlistWithGuest(userId: string | null | undefined,
17
17
  isWishlisted: (productId: string) => boolean;
18
18
  isLoading: boolean;
19
19
  error: Error | null;
20
- refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<WishlistResponse>, Error>>;
20
+ refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<WishlistResponse, Error>>;
21
21
  isGuest: boolean;
22
22
  guestWishlist?: undefined;
23
23
  } | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mohasinac/appkit",
3
- "version": "2.8.3",
3
+ "version": "2.8.4",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"