@shopify/shop-minis-react 0.3.2 → 0.4.0

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 (205) hide show
  1. package/dist/components/MinisContainer.js +11 -10
  2. package/dist/components/MinisContainer.js.map +1 -1
  3. package/dist/components/atoms/content-wrapper.js.map +1 -1
  4. package/dist/components/atoms/video-player.js +28 -26
  5. package/dist/components/atoms/video-player.js.map +1 -1
  6. package/dist/components/commerce/product-card.js +106 -79
  7. package/dist/components/commerce/product-card.js.map +1 -1
  8. package/dist/components/commerce/product-link.js +124 -137
  9. package/dist/components/commerce/product-link.js.map +1 -1
  10. package/dist/components/commerce/search.js +20 -20
  11. package/dist/components/commerce/search.js.map +1 -1
  12. package/dist/components/ui/sonner.js +3 -1
  13. package/dist/components/ui/sonner.js.map +1 -1
  14. package/dist/hooks/content/useContent.js +12 -18
  15. package/dist/hooks/content/useContent.js.map +1 -1
  16. package/dist/hooks/navigation/useNavigateWithTransition.js +10 -11
  17. package/dist/hooks/navigation/useNavigateWithTransition.js.map +1 -1
  18. package/dist/hooks/product/useCuratedProducts.js +9 -11
  19. package/dist/hooks/product/useCuratedProducts.js.map +1 -1
  20. package/dist/hooks/product/usePopularProducts.js +9 -11
  21. package/dist/hooks/product/usePopularProducts.js.map +1 -1
  22. package/dist/hooks/product/useProduct.js +11 -17
  23. package/dist/hooks/product/useProduct.js.map +1 -1
  24. package/dist/hooks/product/useProductList.js +10 -21
  25. package/dist/hooks/product/useProductList.js.map +1 -1
  26. package/dist/hooks/product/useProductLists.js +11 -13
  27. package/dist/hooks/product/useProductLists.js.map +1 -1
  28. package/dist/hooks/product/useProductMedia.js +12 -18
  29. package/dist/hooks/product/useProductMedia.js.map +1 -1
  30. package/dist/hooks/product/useProductSearch.js +34 -27
  31. package/dist/hooks/product/useProductSearch.js.map +1 -1
  32. package/dist/hooks/product/useProductVariants.js +11 -14
  33. package/dist/hooks/product/useProductVariants.js.map +1 -1
  34. package/dist/hooks/product/useProducts.js +12 -11
  35. package/dist/hooks/product/useProducts.js.map +1 -1
  36. package/dist/hooks/product/useRecommendedProducts.js +11 -13
  37. package/dist/hooks/product/useRecommendedProducts.js.map +1 -1
  38. package/dist/hooks/shop/useRecommendedShops.js +11 -13
  39. package/dist/hooks/shop/useRecommendedShops.js.map +1 -1
  40. package/dist/hooks/shop/useShop.js +12 -11
  41. package/dist/hooks/shop/useShop.js.map +1 -1
  42. package/dist/hooks/user/useBuyerAttributes.js +8 -10
  43. package/dist/hooks/user/useBuyerAttributes.js.map +1 -1
  44. package/dist/hooks/user/useCurrentUser.js +7 -9
  45. package/dist/hooks/user/useCurrentUser.js.map +1 -1
  46. package/dist/hooks/user/useFollowedShops.js +11 -14
  47. package/dist/hooks/user/useFollowedShops.js.map +1 -1
  48. package/dist/hooks/user/useOrders.js +7 -9
  49. package/dist/hooks/user/useOrders.js.map +1 -1
  50. package/dist/hooks/user/useRecentProducts.js +11 -13
  51. package/dist/hooks/user/useRecentProducts.js.map +1 -1
  52. package/dist/hooks/user/useRecentShops.js +10 -13
  53. package/dist/hooks/user/useRecentShops.js.map +1 -1
  54. package/dist/hooks/user/useSavedProducts.js +10 -13
  55. package/dist/hooks/user/useSavedProducts.js.map +1 -1
  56. package/dist/index.js +269 -264
  57. package/dist/index.js.map +1 -1
  58. package/dist/internal/components/product-review-stars.js +78 -0
  59. package/dist/internal/components/product-review-stars.js.map +1 -0
  60. package/dist/internal/reactQuery/MinisQueryProvider.js +11 -0
  61. package/dist/internal/reactQuery/MinisQueryProvider.js.map +1 -0
  62. package/dist/internal/reactQuery/queryClient.js +33 -0
  63. package/dist/internal/reactQuery/queryClient.js.map +1 -0
  64. package/dist/internal/reactQuery/useShopActionInfiniteQuery.js +52 -0
  65. package/dist/internal/reactQuery/useShopActionInfiniteQuery.js.map +1 -0
  66. package/dist/internal/reactQuery/useShopActionQuery.js +37 -0
  67. package/dist/internal/reactQuery/useShopActionQuery.js.map +1 -0
  68. package/dist/mocks.js +178 -107
  69. package/dist/mocks.js.map +1 -1
  70. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/focusManager.js +45 -0
  71. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/focusManager.js.map +1 -0
  72. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js +89 -0
  73. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryBehavior.js.map +1 -0
  74. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js +55 -0
  75. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.js.map +1 -0
  76. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/mutation.js +198 -0
  77. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/mutation.js.map +1 -0
  78. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js +99 -0
  79. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/mutationCache.js.map +1 -0
  80. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js +67 -0
  81. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/notifyManager.js.map +1 -0
  82. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js +39 -0
  83. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/onlineManager.js.map +1 -0
  84. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/query.js +299 -0
  85. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/query.js.map +1 -0
  86. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryCache.js +80 -0
  87. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryCache.js.map +1 -0
  88. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryClient.js +215 -0
  89. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryClient.js.map +1 -0
  90. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryObserver.js +300 -0
  91. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryObserver.js.map +1 -0
  92. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/removable.js +25 -0
  93. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/removable.js.map +1 -0
  94. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/retryer.js +76 -0
  95. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/retryer.js.map +1 -0
  96. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/subscribable.js +21 -0
  97. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/subscribable.js.map +1 -0
  98. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/thenable.js +26 -0
  99. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/thenable.js.map +1 -0
  100. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/utils.js +176 -0
  101. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/utils.js.map +1 -0
  102. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js +7 -0
  103. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.js.map +1 -0
  104. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js +17 -0
  105. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js.map +1 -0
  106. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js +19 -0
  107. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.js.map +1 -0
  108. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js +21 -0
  109. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/errorBoundaryUtils.js.map +1 -0
  110. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/suspense.js +18 -0
  111. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/suspense.js.map +1 -0
  112. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js +64 -0
  113. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useBaseQuery.js.map +1 -0
  114. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js +13 -0
  115. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.js.map +1 -0
  116. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useQuery.js +9 -0
  117. package/dist/shop-minis-react/node_modules/.pnpm/@tanstack_react-query@5.86.0_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useQuery.js.map +1 -0
  118. package/dist/shop-minis-react/node_modules/.pnpm/lucide-react@0.513.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/star-half.js +21 -0
  119. package/dist/shop-minis-react/node_modules/.pnpm/lucide-react@0.513.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/star-half.js.map +1 -0
  120. package/dist/shop-minis-react/node_modules/.pnpm/sonner@2.0.5_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/sonner/dist/index.js +4 -4
  121. package/dist/shop-minis-react/node_modules/.pnpm/sonner@2.0.5_react-dom@19.1.0_react@19.1.0__react@19.1.0/node_modules/sonner/dist/index.js.map +1 -1
  122. package/package.json +2 -7
  123. package/src/components/MinisContainer.tsx +6 -3
  124. package/src/components/atoms/content-wrapper.tsx +1 -1
  125. package/src/components/atoms/video-player.tsx +7 -0
  126. package/src/components/commerce/product-card.test.tsx +135 -0
  127. package/src/components/commerce/product-card.tsx +39 -5
  128. package/src/components/commerce/product-link.test.tsx +15 -3
  129. package/src/components/commerce/product-link.tsx +9 -25
  130. package/src/components/commerce/search.tsx +2 -2
  131. package/src/components/index.ts +1 -0
  132. package/src/components/ui/sonner.tsx +2 -2
  133. package/src/hooks/content/useContent.ts +6 -17
  134. package/src/hooks/navigation/useNavigateWithTransition.test.ts +46 -7
  135. package/src/hooks/navigation/useNavigateWithTransition.ts +4 -1
  136. package/src/hooks/product/useCuratedProducts.ts +4 -6
  137. package/src/hooks/product/usePopularProducts.ts +4 -6
  138. package/src/hooks/product/useProduct.ts +6 -17
  139. package/src/hooks/product/useProductList.ts +4 -19
  140. package/src/hooks/product/useProductLists.ts +4 -6
  141. package/src/hooks/product/useProductMedia.ts +6 -17
  142. package/src/hooks/product/useProductSearch.ts +19 -15
  143. package/src/hooks/product/useProductVariants.ts +5 -13
  144. package/src/hooks/product/useProducts.ts +8 -12
  145. package/src/hooks/product/useRecommendedProducts.ts +4 -6
  146. package/src/hooks/shop/useRecommendedShops.ts +4 -6
  147. package/src/hooks/shop/useShop.ts +8 -12
  148. package/src/hooks/user/useBuyerAttributes.ts +4 -6
  149. package/src/hooks/user/useCurrentUser.ts +4 -6
  150. package/src/hooks/user/useFollowedShops.ts +5 -13
  151. package/src/hooks/user/useOrders.ts +4 -6
  152. package/src/hooks/user/useRecentProducts.ts +4 -6
  153. package/src/hooks/user/useRecentShops.ts +5 -13
  154. package/src/hooks/user/useSavedProducts.ts +5 -13
  155. package/src/internal/components/product-review-stars.test.tsx +90 -0
  156. package/src/internal/components/product-review-stars.tsx +113 -0
  157. package/src/internal/reactQuery/MinisQueryProvider.test.tsx +38 -0
  158. package/src/internal/reactQuery/MinisQueryProvider.tsx +16 -0
  159. package/src/internal/reactQuery/index.ts +8 -0
  160. package/src/internal/reactQuery/queryClient.test.tsx +91 -0
  161. package/src/internal/reactQuery/queryClient.ts +43 -0
  162. package/src/internal/reactQuery/useShopActionInfiniteQuery.test.tsx +357 -0
  163. package/src/internal/reactQuery/useShopActionInfiniteQuery.ts +129 -0
  164. package/src/internal/reactQuery/useShopActionQuery.test.tsx +184 -0
  165. package/src/internal/reactQuery/useShopActionQuery.ts +74 -0
  166. package/src/mocks.ts +10 -2
  167. package/src/providers/ImagePickerProvider.test.tsx +3 -9
  168. package/dist/internal/useShopActionsDataFetching.js +0 -79
  169. package/dist/internal/useShopActionsDataFetching.js.map +0 -1
  170. package/dist/internal/useShopActionsPaginatedDataFetching.js +0 -96
  171. package/dist/internal/useShopActionsPaginatedDataFetching.js.map +0 -1
  172. package/src/hooks/product/useProductSearch.test.ts +0 -470
  173. package/src/internal/useShopActionsDataFetching.test.ts +0 -465
  174. package/src/internal/useShopActionsDataFetching.ts +0 -150
  175. package/src/internal/useShopActionsPaginatedDataFetching.ts +0 -188
  176. package/src/stories/Accordion.stories.tsx +0 -124
  177. package/src/stories/AddToCart.stories.tsx +0 -251
  178. package/src/stories/Alert.stories.tsx +0 -38
  179. package/src/stories/AlertDialog.stories.tsx +0 -48
  180. package/src/stories/Avatar.stories.tsx +0 -29
  181. package/src/stories/Badge.stories.tsx +0 -46
  182. package/src/stories/Button.stories.tsx +0 -81
  183. package/src/stories/Card.stories.tsx +0 -40
  184. package/src/stories/Checkbox.stories.tsx +0 -44
  185. package/src/stories/FavoriteButton.stories.tsx +0 -58
  186. package/src/stories/IconButton.stories.tsx +0 -68
  187. package/src/stories/ImageContentWrapper.stories.tsx +0 -65
  188. package/src/stories/Input.stories.tsx +0 -44
  189. package/src/stories/Label.stories.tsx +0 -19
  190. package/src/stories/List.stories.tsx +0 -64
  191. package/src/stories/MerchantCard.stories.tsx +0 -127
  192. package/src/stories/ProductCard.stories.tsx +0 -92
  193. package/src/stories/ProductLink.stories.tsx +0 -46
  194. package/src/stories/ProductVariantPrice.stories.tsx +0 -70
  195. package/src/stories/Progress.stories.tsx +0 -30
  196. package/src/stories/PullToRefreshList.stories.tsx +0 -122
  197. package/src/stories/QuantitySelector.stories.tsx +0 -78
  198. package/src/stories/RadioGroup.stories.tsx +0 -51
  199. package/src/stories/Search.stories.tsx +0 -37
  200. package/src/stories/Select.stories.tsx +0 -85
  201. package/src/stories/Skeleton.stories.tsx +0 -19
  202. package/src/stories/TextInput.stories.tsx +0 -26
  203. package/src/stories/Toaster.stories.tsx +0 -46
  204. package/src/stories/Touchable.stories.tsx +0 -40
  205. package/src/stories/VideoPlayer.stories.tsx +0 -129
@@ -1,45 +1,52 @@
1
- import { useState as h, useCallback as S, useEffect as y, useMemo as b } from "react";
2
- import g from "../../_virtual/debounce.js";
3
- import { useShopActions as P } from "../../internal/useShopActions.js";
4
- import { useShopActionsPaginatedDataFetching as k } from "../../internal/useShopActionsPaginatedDataFetching.js";
5
- const v = (s) => {
6
- const { getProductSearch: u } = P(), {
1
+ import { useState as S, useCallback as y, useEffect as h } from "react";
2
+ import b from "../../_virtual/debounce.js";
3
+ import { useShopActions as g } from "../../internal/useShopActions.js";
4
+ import { useShopActionInfiniteQuery as k } from "../../internal/reactQuery/useShopActionInfiniteQuery.js";
5
+ const x = (a) => {
6
+ const { getProductSearch: d } = g(), {
7
7
  query: e,
8
- filters: c,
9
- sortBy: n,
10
- includeSensitive: a = !1,
11
- skip: i = !1,
12
- ...d
13
- } = s ?? {}, [t, l] = h(e), r = S(
14
- g((p) => {
15
- l(p);
8
+ filters: o,
9
+ sortBy: s,
10
+ includeSensitive: c = !1,
11
+ skip: f = !1,
12
+ ...u
13
+ } = a ?? {}, [t, p] = S(e), r = y(
14
+ b((n) => {
15
+ p((i) => i === n ? i : n);
16
16
  }, 300),
17
17
  []
18
18
  );
19
- y(() => (r(e), () => {
19
+ h(() => (r(e), () => {
20
20
  r.cancel();
21
21
  }), [e, r]);
22
- const { data: o, ...m } = k(
23
- u,
22
+ const { data: m, ...l } = k(
23
+ [
24
+ "productSearch",
25
+ t,
26
+ o,
27
+ s,
28
+ c,
29
+ u
30
+ ],
31
+ d,
24
32
  {
25
33
  query: t,
26
- filters: c,
27
- sortBy: n,
28
- includeSensitive: a,
29
- ...d
34
+ filters: o,
35
+ sortBy: s,
36
+ includeSensitive: c,
37
+ ...u
30
38
  },
31
39
  {
32
- skip: i,
33
- hook: "useProductSearch"
40
+ skip: f || t.trim().length === 0
34
41
  }
35
- ), f = b(() => t.trim().length === 0 ? null : o ?? null, [o, t]);
42
+ );
36
43
  return {
37
- ...m,
38
- products: f,
44
+ ...l,
45
+ products: m,
39
46
  isTyping: t !== e
40
47
  };
41
48
  };
42
49
  export {
43
- v as useProductSearch
50
+ x as useProductSearch
44
51
  };
45
52
  //# sourceMappingURL=useProductSearch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProductSearch.js","sources":["../../../src/hooks/product/useProductSearch.ts"],"sourcesContent":["import {useCallback, useEffect, useMemo, useState} from 'react'\n\nimport debounce from 'lodash/debounce'\n\nimport {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsPaginatedDataFetching} from '../../internal/useShopActionsPaginatedDataFetching'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Product,\n ProductFilters,\n ProductSearchSortBy,\n} from '../../types'\n\nexport interface UseProductSearchParams extends PaginatedDataHookOptionsBase {\n /**\n * The search query.\n */\n query: string\n /**\n * The filters to apply to the search.\n */\n filters?: ProductFilters\n /**\n * The sort order of the results.\n */\n sortBy?: ProductSearchSortBy\n /**\n * Whether to include sensitive products.\n */\n includeSensitive?: boolean\n}\n\ninterface UseProductSearchReturns extends PaginatedDataHookReturnsBase {\n /**\n * The products returned from the query.\n */\n products: Product[] | null\n /**\n * Whether the user is typing.\n */\n isTyping: boolean\n}\n\nexport const useProductSearch = (\n params: UseProductSearchParams\n): UseProductSearchReturns => {\n const {getProductSearch} = useShopActions()\n const {\n query,\n filters,\n sortBy,\n includeSensitive = false,\n skip = false,\n ...restParams\n } = params ?? {}\n\n const [debouncedQuery, setDebouncedQuery] = useState<string>(query)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const debouncedSetQuery = useCallback(\n debounce((newQuery: string) => {\n setDebouncedQuery(newQuery)\n }, 300),\n []\n )\n\n useEffect(() => {\n debouncedSetQuery(query)\n\n return () => {\n debouncedSetQuery.cancel()\n }\n }, [query, debouncedSetQuery])\n\n const {data, ...rest} = useShopActionsPaginatedDataFetching(\n getProductSearch,\n {\n query: debouncedQuery,\n filters,\n sortBy,\n includeSensitive,\n ...restParams,\n },\n {\n skip,\n hook: 'useProductSearch',\n }\n )\n\n const products = useMemo(() => {\n if (debouncedQuery.trim().length === 0) {\n return null\n }\n\n return data ?? null\n }, [data, debouncedQuery])\n\n return {\n ...rest,\n products,\n isTyping: debouncedQuery !== query,\n }\n}\n"],"names":["useProductSearch","params","getProductSearch","useShopActions","query","filters","sortBy","includeSensitive","skip","restParams","debouncedQuery","setDebouncedQuery","useState","debouncedSetQuery","useCallback","debounce","newQuery","useEffect","data","rest","useShopActionsPaginatedDataFetching","products","useMemo"],"mappings":";;;;AA4Ca,MAAAA,IAAmB,CAC9BC,MAC4B;AACtB,QAAA,EAAC,kBAAAC,EAAgB,IAAIC,EAAe,GACpC;AAAA,IACJ,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,MAAAC,IAAO;AAAA,IACP,GAAGC;AAAA,EACL,IAAIR,KAAU,CAAC,GAET,CAACS,GAAgBC,CAAiB,IAAIC,EAAiBR,CAAK,GAG5DS,IAAoBC;AAAA,IACxBC,EAAS,CAACC,MAAqB;AAC7B,MAAAL,EAAkBK,CAAQ;AAAA,OACzB,GAAG;AAAA,IACN,CAAA;AAAA,EACF;AAEA,EAAAC,EAAU,OACRJ,EAAkBT,CAAK,GAEhB,MAAM;AACX,IAAAS,EAAkB,OAAO;AAAA,EAC3B,IACC,CAACT,GAAOS,CAAiB,CAAC;AAE7B,QAAM,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBlB;AAAA,IACA;AAAA,MACE,OAAOQ;AAAA,MACP,SAAAL;AAAA,MACA,QAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,GAAGE;AAAA,IACL;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV,GAEMa,IAAWC,EAAQ,MACnBZ,EAAe,OAAO,WAAW,IAC5B,OAGFQ,KAAQ,MACd,CAACA,GAAMR,CAAc,CAAC;AAElB,SAAA;AAAA,IACL,GAAGS;AAAA,IACH,UAAAE;AAAA,IACA,UAAUX,MAAmBN;AAAA,EAC/B;AACF;"}
1
+ {"version":3,"file":"useProductSearch.js","sources":["../../../src/hooks/product/useProductSearch.ts"],"sourcesContent":["import {useCallback, useEffect, useState} from 'react'\n\nimport debounce from 'lodash/debounce'\n\nimport {useShopActionInfiniteQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Product,\n ProductFilters,\n ProductSearchSortBy,\n} from '../../types'\n\nexport interface UseProductSearchParams extends PaginatedDataHookOptionsBase {\n /**\n * The search query.\n */\n query: string\n /**\n * The filters to apply to the search.\n */\n filters?: ProductFilters\n /**\n * The sort order of the results.\n */\n sortBy?: ProductSearchSortBy\n /**\n * Whether to include sensitive products.\n */\n includeSensitive?: boolean\n}\n\ninterface UseProductSearchReturns extends PaginatedDataHookReturnsBase {\n /**\n * The products returned from the query.\n */\n products: Product[] | null\n /**\n * Whether the user is typing.\n */\n isTyping: boolean\n}\n\nexport const useProductSearch = (\n params: UseProductSearchParams\n): UseProductSearchReturns => {\n const {getProductSearch} = useShopActions()\n const {\n query,\n filters,\n sortBy,\n includeSensitive = false,\n skip = false,\n ...restParams\n } = params ?? {}\n\n const [debouncedQuery, setDebouncedQuery] = useState<string>(query)\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const debouncedSetQuery = useCallback(\n debounce((newQuery: string) => {\n setDebouncedQuery(prev => {\n // Only update if the query actually changed\n if (prev === newQuery) return prev\n return newQuery\n })\n }, 300),\n []\n )\n\n useEffect(() => {\n debouncedSetQuery(query)\n\n return () => {\n debouncedSetQuery.cancel()\n }\n }, [query, debouncedSetQuery])\n\n // Use our Shop Action infinite query helper\n const {data, ...rest} = useShopActionInfiniteQuery(\n [\n 'productSearch',\n debouncedQuery,\n filters,\n sortBy,\n includeSensitive,\n restParams,\n ],\n getProductSearch,\n {\n query: debouncedQuery,\n filters,\n sortBy,\n includeSensitive,\n ...restParams,\n },\n {\n skip: skip || debouncedQuery.trim().length === 0,\n }\n )\n\n return {\n ...rest,\n products: data,\n isTyping: debouncedQuery !== query,\n }\n}\n"],"names":["useProductSearch","params","getProductSearch","useShopActions","query","filters","sortBy","includeSensitive","skip","restParams","debouncedQuery","setDebouncedQuery","useState","debouncedSetQuery","useCallback","debounce","newQuery","prev","useEffect","data","rest","useShopActionInfiniteQuery"],"mappings":";;;;AA4Ca,MAAAA,IAAmB,CAC9BC,MAC4B;AACtB,QAAA,EAAC,kBAAAC,EAAgB,IAAIC,EAAe,GACpC;AAAA,IACJ,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,QAAAC;AAAA,IACA,kBAAAC,IAAmB;AAAA,IACnB,MAAAC,IAAO;AAAA,IACP,GAAGC;AAAA,EACL,IAAIR,KAAU,CAAC,GAET,CAACS,GAAgBC,CAAiB,IAAIC,EAAiBR,CAAK,GAG5DS,IAAoBC;AAAA,IACxBC,EAAS,CAACC,MAAqB;AAC7B,MAAAL,EAAkB,CAAQM,MAEpBA,MAASD,IAAiBC,IACvBD,CACR;AAAA,OACA,GAAG;AAAA,IACN,CAAA;AAAA,EACF;AAEA,EAAAE,EAAU,OACRL,EAAkBT,CAAK,GAEhB,MAAM;AACX,IAAAS,EAAkB,OAAO;AAAA,EAC3B,IACC,CAACT,GAAOS,CAAiB,CAAC;AAG7B,QAAM,EAAC,MAAAM,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB;AAAA,MACE;AAAA,MACAX;AAAA,MACAL;AAAA,MACAC;AAAA,MACAC;AAAA,MACAE;AAAA,IACF;AAAA,IACAP;AAAA,IACA;AAAA,MACE,OAAOQ;AAAA,MACP,SAAAL;AAAA,MACA,QAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,GAAGE;AAAA,IACL;AAAA,IACA;AAAA,MACE,MAAMD,KAAQE,EAAe,KAAA,EAAO,WAAW;AAAA,IAAA;AAAA,EAEnD;AAEO,SAAA;AAAA,IACL,GAAGU;AAAA,IACH,UAAUD;AAAA,IACV,UAAUT,MAAmBN;AAAA,EAC/B;AACF;"}
@@ -1,21 +1,18 @@
1
- import { useMemo as i } from "react";
2
- import { useShopActions as c } from "../../internal/useShopActions.js";
3
- import { useShopActionsPaginatedDataFetching as u } from "../../internal/useShopActionsPaginatedDataFetching.js";
4
- const P = (o) => {
5
- const { getProductVariants: r } = c(), { skip: s = !1, ...a } = o, { data: t, ...n } = u(
6
- r,
7
- a,
8
- {
9
- skip: s,
10
- hook: "useProductVariants"
11
- }
12
- ), e = i(() => t ?? null, [t]);
1
+ import { useShopActions as e } from "../../internal/useShopActions.js";
2
+ import { useShopActionInfiniteQuery as i } from "../../internal/reactQuery/useShopActionInfiniteQuery.js";
3
+ const p = (r) => {
4
+ const { getProductVariants: s } = e(), { skip: o = !1, ...t } = r, { data: a, ...n } = i(
5
+ ["productVariants", t],
6
+ s,
7
+ t,
8
+ { skip: o }
9
+ );
13
10
  return {
14
11
  ...n,
15
- variants: e
12
+ variants: a
16
13
  };
17
14
  };
18
15
  export {
19
- P as useProductVariants
16
+ p as useProductVariants
20
17
  };
21
18
  //# sourceMappingURL=useProductVariants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProductVariants.js","sources":["../../../src/hooks/product/useProductVariants.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsPaginatedDataFetching} from '../../internal/useShopActionsPaginatedDataFetching'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n ProductVariant,\n} from '../../types'\n\nexport interface UseProductVariantsParams extends PaginatedDataHookOptionsBase {\n /**\n * The product ID to fetch variants for.\n */\n id: string\n}\n\ninterface UseProductVariantsReturns extends PaginatedDataHookReturnsBase {\n /**\n * The product variants returned from the query.\n */\n variants: ProductVariant[] | null\n}\n\nexport const useProductVariants = (\n params: UseProductVariantsParams\n): UseProductVariantsReturns => {\n const {getProductVariants} = useShopActions()\n const {skip = false, ...restParams} = params\n\n const {data, ...rest} = useShopActionsPaginatedDataFetching(\n getProductVariants,\n restParams,\n {\n skip,\n hook: 'useProductVariants',\n }\n )\n\n const variants = useMemo(() => {\n return data ?? null\n }, [data])\n\n return {\n ...rest,\n variants,\n }\n}\n"],"names":["useProductVariants","params","getProductVariants","useShopActions","skip","restParams","data","rest","useShopActionsPaginatedDataFetching","variants","useMemo"],"mappings":";;;AAwBa,MAAAA,IAAqB,CAChCC,MAC8B;AACxB,QAAA,EAAC,oBAAAC,EAAkB,IAAIC,EAAe,GACtC,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAc,IAAAJ,GAEhC,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBN;AAAA,IACAG;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV,GAEMK,IAAWC,EAAQ,MAChBJ,KAAQ,MACd,CAACA,CAAI,CAAC;AAEF,SAAA;AAAA,IACL,GAAGC;AAAA,IACH,UAAAE;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"useProductVariants.js","sources":["../../../src/hooks/product/useProductVariants.ts"],"sourcesContent":["import {useShopActionInfiniteQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n ProductVariant,\n} from '../../types'\n\nexport interface UseProductVariantsParams extends PaginatedDataHookOptionsBase {\n /**\n * The product ID to fetch variants for.\n */\n id: string\n}\n\ninterface UseProductVariantsReturns extends PaginatedDataHookReturnsBase {\n /**\n * The product variants returned from the query.\n */\n variants: ProductVariant[] | null\n}\n\nexport const useProductVariants = (\n params: UseProductVariantsParams\n): UseProductVariantsReturns => {\n const {getProductVariants} = useShopActions()\n const {skip = false, ...restParams} = params\n\n const {data, ...rest} = useShopActionInfiniteQuery(\n ['productVariants', restParams],\n getProductVariants,\n restParams,\n {skip}\n )\n\n return {\n ...rest,\n variants: data,\n }\n}\n"],"names":["useProductVariants","params","getProductVariants","useShopActions","skip","restParams","data","rest","useShopActionInfiniteQuery"],"mappings":";;AAsBa,MAAAA,IAAqB,CAChCC,MAC8B;AACxB,QAAA,EAAC,oBAAAC,EAAkB,IAAIC,EAAe,GACtC,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAc,IAAAJ,GAEhC,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,mBAAmBH,CAAU;AAAA,IAC9BH;AAAA,IACAG;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGG;AAAA,IACH,UAAUD;AAAA,EACZ;AACF;"}
@@ -1,17 +1,18 @@
1
- import { useMemo as n } from "react";
2
- import { useShopActions as m } from "../../internal/useShopActions.js";
3
- import { useShopActionsDataFetching as p } from "../../internal/useShopActionsDataFetching.js";
4
- const f = (t) => {
5
- const { getProducts: s } = m(), { skip: r = !1, ...e } = t, { data: o, ...c } = p(s, e, {
6
- skip: r,
7
- hook: "useProducts"
8
- }), u = n(() => o ?? null, [o]);
1
+ import { useShopActions as u } from "../../internal/useShopActions.js";
2
+ import { useShopActionQuery as p } from "../../internal/reactQuery/useShopActionQuery.js";
3
+ const d = (o) => {
4
+ const { getProducts: s } = u(), { skip: r = !1, ...t } = o, { data: c, ...e } = p(
5
+ ["products", t],
6
+ s,
7
+ t,
8
+ { skip: r }
9
+ );
9
10
  return {
10
- ...c,
11
- products: u
11
+ ...e,
12
+ products: c
12
13
  };
13
14
  };
14
15
  export {
15
- f as useProducts
16
+ d as useProducts
16
17
  };
17
18
  //# sourceMappingURL=useProducts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useProducts.js","sources":["../../../src/hooks/product/useProducts.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsDataFetching} from '../../internal/useShopActionsDataFetching'\nimport {DataHookOptionsBase, DataHookReturnsBase, Product} from '../../types'\n\nexport interface UseProductsParams extends DataHookOptionsBase {\n /**\n * The product IDs to fetch.\n */\n ids: string[]\n}\n\ninterface UseProductsReturns extends DataHookReturnsBase {\n /**\n * The products returned from the query.\n */\n products: Product[] | null\n}\n\nexport const useProducts = (params: UseProductsParams): UseProductsReturns => {\n const {getProducts} = useShopActions()\n const {skip = false, ...restParams} = params\n\n const {data, ...rest} = useShopActionsDataFetching(getProducts, restParams, {\n skip,\n hook: 'useProducts',\n })\n\n const products = useMemo(() => {\n return data ?? null\n }, [data])\n\n return {\n ...rest,\n products,\n }\n}\n"],"names":["useProducts","params","getProducts","useShopActions","skip","restParams","data","rest","useShopActionsDataFetching","products","useMemo"],"mappings":";;;AAoBa,MAAAA,IAAc,CAACC,MAAkD;AACtE,QAAA,EAAC,aAAAC,EAAW,IAAIC,EAAe,GAC/B,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAc,IAAAJ,GAEhC,EAAC,MAAAK,GAAM,GAAGC,EAAQ,IAAAC,EAA2BN,GAAaG,GAAY;AAAA,IAC1E,MAAAD;AAAA,IACA,MAAM;AAAA,EAAA,CACP,GAEKK,IAAWC,EAAQ,MAChBJ,KAAQ,MACd,CAACA,CAAI,CAAC;AAEF,SAAA;AAAA,IACL,GAAGC;AAAA,IACH,UAAAE;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"useProducts.js","sources":["../../../src/hooks/product/useProducts.ts"],"sourcesContent":["import {useShopActionQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {DataHookOptionsBase, DataHookReturnsBase, Product} from '../../types'\n\nexport interface UseProductsParams extends DataHookOptionsBase {\n /**\n * The product IDs to fetch.\n */\n ids: string[]\n}\n\ninterface UseProductsReturns extends DataHookReturnsBase {\n /**\n * The products returned from the query.\n */\n products: Product[] | null\n}\n\nexport const useProducts = (params: UseProductsParams): UseProductsReturns => {\n const {getProducts} = useShopActions()\n const {skip = false, ...restParams} = params\n\n const {data, ...rest} = useShopActionQuery(\n ['products', restParams],\n getProducts,\n restParams,\n {skip}\n )\n\n return {\n ...rest,\n products: data,\n }\n}\n"],"names":["useProducts","params","getProducts","useShopActions","skip","restParams","data","rest","useShopActionQuery"],"mappings":";;AAkBa,MAAAA,IAAc,CAACC,MAAkD;AACtE,QAAA,EAAC,aAAAC,EAAW,IAAIC,EAAe,GAC/B,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAc,IAAAJ,GAEhC,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,YAAYH,CAAU;AAAA,IACvBH;AAAA,IACAG;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGG;AAAA,IACH,UAAUD;AAAA,EACZ;AACF;"}
@@ -1,20 +1,18 @@
1
- import { useShopActions as r } from "../../internal/useShopActions.js";
2
- import { useShopActionsPaginatedDataFetching as d } from "../../internal/useShopActionsPaginatedDataFetching.js";
3
- const a = (o) => {
4
- const { getRecommendedProducts: t } = r(), { skip: e, ...s } = o ?? {}, { data: c, ...n } = d(
5
- t,
6
- s,
7
- {
8
- skip: e,
9
- hook: "useRecommendedProducts"
10
- }
1
+ import { useShopActions as n } from "../../internal/useShopActions.js";
2
+ import { useShopActionInfiniteQuery as d } from "../../internal/reactQuery/useShopActionInfiniteQuery.js";
3
+ const i = (t) => {
4
+ const { getRecommendedProducts: e } = n(), { skip: s, ...o } = t ?? {}, { data: r, ...c } = d(
5
+ ["recommendedProducts", o],
6
+ e,
7
+ o,
8
+ { skip: s }
11
9
  );
12
10
  return {
13
- ...n,
14
- products: c
11
+ ...c,
12
+ products: r
15
13
  };
16
14
  };
17
15
  export {
18
- a as useRecommendedProducts
16
+ i as useRecommendedProducts
19
17
  };
20
18
  //# sourceMappingURL=useRecommendedProducts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRecommendedProducts.js","sources":["../../../src/hooks/product/useRecommendedProducts.ts"],"sourcesContent":["import {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsPaginatedDataFetching} from '../../internal/useShopActionsPaginatedDataFetching'\nimport {\n Product,\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n} from '../../types'\n\ninterface UseRecommendedProductsParams extends PaginatedDataHookOptionsBase {}\n\ninterface UseRecommendedProductsReturns extends PaginatedDataHookReturnsBase {\n products: Product[] | null\n}\n\n/**\n * @param options - The options for the query\n */\nexport const useRecommendedProducts = (\n params?: UseRecommendedProductsParams\n): UseRecommendedProductsReturns => {\n const {getRecommendedProducts} = useShopActions()\n const {skip, ...shopActionParams} = params ?? {}\n\n const {data, ...rest} = useShopActionsPaginatedDataFetching(\n getRecommendedProducts,\n shopActionParams,\n {\n skip,\n hook: 'useRecommendedProducts',\n }\n )\n\n return {\n ...rest,\n products: data,\n }\n}\n"],"names":["useRecommendedProducts","params","getRecommendedProducts","useShopActions","skip","shopActionParams","data","rest","useShopActionsPaginatedDataFetching"],"mappings":";;AAiBa,MAAAA,IAAyB,CACpCC,MACkC;AAC5B,QAAA,EAAC,wBAAAC,EAAsB,IAAIC,EAAe,GAC1C,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIJ,KAAU,CAAC,GAEzC,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBN;AAAA,IACAG;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV;AAEO,SAAA;AAAA,IACL,GAAGG;AAAA,IACH,UAAUD;AAAA,EACZ;AACF;"}
1
+ {"version":3,"file":"useRecommendedProducts.js","sources":["../../../src/hooks/product/useRecommendedProducts.ts"],"sourcesContent":["import {useShopActionInfiniteQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n Product,\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n} from '../../types'\n\ninterface UseRecommendedProductsParams extends PaginatedDataHookOptionsBase {}\n\ninterface UseRecommendedProductsReturns extends PaginatedDataHookReturnsBase {\n products: Product[] | null\n}\n\n/**\n * @param options - The options for the query\n */\nexport const useRecommendedProducts = (\n params?: UseRecommendedProductsParams\n): UseRecommendedProductsReturns => {\n const {getRecommendedProducts} = useShopActions()\n const {skip, ...shopActionParams} = params ?? {}\n\n const {data, ...rest} = useShopActionInfiniteQuery(\n ['recommendedProducts', shopActionParams],\n getRecommendedProducts,\n shopActionParams,\n {skip}\n )\n\n return {\n ...rest,\n products: data,\n }\n}\n"],"names":["useRecommendedProducts","params","getRecommendedProducts","useShopActions","skip","shopActionParams","data","rest","useShopActionInfiniteQuery"],"mappings":";;AAiBa,MAAAA,IAAyB,CACpCC,MACkC;AAC5B,QAAA,EAAC,wBAAAC,EAAsB,IAAIC,EAAe,GAC1C,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIJ,KAAU,CAAC,GAEzC,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,uBAAuBH,CAAgB;AAAA,IACxCH;AAAA,IACAG;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGG;AAAA,IACH,UAAUD;AAAA,EACZ;AACF;"}
@@ -1,21 +1,19 @@
1
- import { useMemo as p } from "react";
2
- import { useShopActions as c } from "../../internal/useShopActions.js";
3
- import { useShopActionsPaginatedDataFetching as i } from "../../internal/useShopActionsPaginatedDataFetching.js";
4
- const f = (s) => {
5
- const { getRecommendedShops: t } = c(), { skip: n, ...r } = s || {}, { data: o, ...m } = i(
1
+ import { useMemo as c } from "react";
2
+ import { useShopActions as i } from "../../internal/useShopActions.js";
3
+ import { useShopActionInfiniteQuery as u } from "../../internal/reactQuery/useShopActionInfiniteQuery.js";
4
+ const h = (r) => {
5
+ const { getRecommendedShops: t } = i(), { skip: n, ...e } = r || {}, { data: o, ...m } = u(
6
+ ["recommendedShops", e],
6
7
  t,
7
- r,
8
- {
9
- skip: n,
10
- hook: "useRecommendedShops"
11
- }
12
- ), a = p(() => o ? Array.from(new Map(o.map((e) => [e.id, e])).values()) : null, [o]);
8
+ e,
9
+ { skip: n }
10
+ ), p = c(() => o ? Array.from(new Map(o.map((s) => [s.id, s])).values()) : null, [o]);
13
11
  return {
14
12
  ...m,
15
- shops: a
13
+ shops: p
16
14
  };
17
15
  };
18
16
  export {
19
- f as useRecommendedShops
17
+ h as useRecommendedShops
20
18
  };
21
19
  //# sourceMappingURL=useRecommendedShops.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRecommendedShops.js","sources":["../../../src/hooks/shop/useRecommendedShops.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsPaginatedDataFetching} from '../../internal/useShopActionsPaginatedDataFetching'\nimport {\n Shop,\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n} from '../../types'\n\ninterface UseRecommendedShopsParams extends PaginatedDataHookOptionsBase {}\n\ninterface UseRecommendedShopsReturns extends PaginatedDataHookReturnsBase {\n shops: Shop[] | null\n}\n\nexport const useRecommendedShops = (\n params?: UseRecommendedShopsParams\n): UseRecommendedShopsReturns => {\n const {getRecommendedShops} = useShopActions()\n\n const {skip, ...shopActionParamsToPass} = params || {}\n\n const {data, ...rest} = useShopActionsPaginatedDataFetching(\n getRecommendedShops,\n shopActionParamsToPass,\n {\n skip,\n hook: 'useRecommendedShops',\n }\n )\n\n const shops = useMemo(() => {\n if (!data) return null\n\n return Array.from(new Map(data.map(shop => [shop.id, shop])).values())\n }, [data])\n\n return {\n ...rest,\n shops,\n }\n}\n"],"names":["useRecommendedShops","params","getRecommendedShops","useShopActions","skip","shopActionParamsToPass","data","rest","useShopActionsPaginatedDataFetching","shops","useMemo","shop"],"mappings":";;;AAgBa,MAAAA,IAAsB,CACjCC,MAC+B;AACzB,QAAA,EAAC,qBAAAC,EAAmB,IAAIC,EAAe,GAEvC,EAAC,MAAAC,GAAM,GAAGC,EAAsB,IAAIJ,KAAU,CAAC,GAE/C,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBN;AAAA,IACAG;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV,GAEMK,IAAQC,EAAQ,MACfJ,IAEE,MAAM,KAAK,IAAI,IAAIA,EAAK,IAAI,CAAAK,MAAQ,CAACA,EAAK,IAAIA,CAAI,CAAC,CAAC,EAAE,QAAQ,IAFnD,MAGjB,CAACL,CAAI,CAAC;AAEF,SAAA;AAAA,IACL,GAAGC;AAAA,IACH,OAAAE;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"useRecommendedShops.js","sources":["../../../src/hooks/shop/useRecommendedShops.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useShopActionInfiniteQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n Shop,\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n} from '../../types'\n\ninterface UseRecommendedShopsParams extends PaginatedDataHookOptionsBase {}\n\ninterface UseRecommendedShopsReturns extends PaginatedDataHookReturnsBase {\n shops: Shop[] | null\n}\n\nexport const useRecommendedShops = (\n params?: UseRecommendedShopsParams\n): UseRecommendedShopsReturns => {\n const {getRecommendedShops} = useShopActions()\n\n const {skip, ...shopActionParamsToPass} = params || {}\n\n const {data, ...rest} = useShopActionInfiniteQuery(\n ['recommendedShops', shopActionParamsToPass],\n getRecommendedShops,\n shopActionParamsToPass,\n {skip}\n )\n\n const shops = useMemo(() => {\n if (!data) return null\n\n return Array.from(new Map(data.map(shop => [shop.id, shop])).values())\n }, [data])\n\n return {\n ...rest,\n shops,\n }\n}\n"],"names":["useRecommendedShops","params","getRecommendedShops","useShopActions","skip","shopActionParamsToPass","data","rest","useShopActionInfiniteQuery","shops","useMemo","shop"],"mappings":";;;AAgBa,MAAAA,IAAsB,CACjCC,MAC+B;AACzB,QAAA,EAAC,qBAAAC,EAAmB,IAAIC,EAAe,GAEvC,EAAC,MAAAC,GAAM,GAAGC,EAAsB,IAAIJ,KAAU,CAAC,GAE/C,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,oBAAoBH,CAAsB;AAAA,IAC3CH;AAAA,IACAG;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP,GAEMK,IAAQC,EAAQ,MACfJ,IAEE,MAAM,KAAK,IAAI,IAAIA,EAAK,IAAI,CAAAK,MAAQ,CAACA,EAAK,IAAIA,CAAI,CAAC,CAAC,EAAE,QAAQ,IAFnD,MAGjB,CAACL,CAAI,CAAC;AAEF,SAAA;AAAA,IACL,GAAGC;AAAA,IACH,OAAAE;AAAA,EACF;AACF;"}
@@ -1,17 +1,18 @@
1
- import { useMemo as c } from "react";
2
- import { useShopActions as h } from "../../internal/useShopActions.js";
3
- import { useShopActionsDataFetching as m } from "../../internal/useShopActionsDataFetching.js";
4
- const S = (t) => {
5
- const { getShop: s } = h(), { skip: e = !1, ...r } = t, { data: o, ...n } = m(s, r, {
6
- skip: e,
7
- hook: "useShop"
8
- }), p = c(() => o ?? null, [o]);
1
+ import { useShopActions as n } from "../../internal/useShopActions.js";
2
+ import { useShopActionQuery as c } from "../../internal/reactQuery/useShopActionQuery.js";
3
+ const i = (s) => {
4
+ const { getShop: t } = n(), { skip: r = !1, ...o } = s, { data: e, ...p } = c(
5
+ ["shop", o],
6
+ t,
7
+ o,
8
+ { skip: r }
9
+ );
9
10
  return {
10
- ...n,
11
- shop: p
11
+ ...p,
12
+ shop: e
12
13
  };
13
14
  };
14
15
  export {
15
- S as useShop
16
+ i as useShop
16
17
  };
17
18
  //# sourceMappingURL=useShop.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useShop.js","sources":["../../../src/hooks/shop/useShop.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsDataFetching} from '../../internal/useShopActionsDataFetching'\nimport {DataHookOptionsBase, DataHookReturnsBase, Shop} from '../../types'\n\nexport interface UseShopParams extends DataHookOptionsBase {\n /**\n * The shop ID to fetch.\n */\n id: string\n}\n\ninterface UseShopReturns extends DataHookReturnsBase {\n /**\n * The shop returned from the query.\n */\n shop: Shop | null\n}\n\nexport const useShop = (params: UseShopParams): UseShopReturns => {\n const {getShop} = useShopActions()\n const {skip = false, ...restParams} = params\n\n const {data, ...rest} = useShopActionsDataFetching(getShop, restParams, {\n skip,\n hook: 'useShop',\n })\n\n const shop = useMemo(() => {\n return data ?? null\n }, [data])\n\n return {\n ...rest,\n shop,\n }\n}\n"],"names":["useShop","params","getShop","useShopActions","skip","restParams","data","rest","useShopActionsDataFetching","shop","useMemo"],"mappings":";;;AAoBa,MAAAA,IAAU,CAACC,MAA0C;AAC1D,QAAA,EAAC,SAAAC,EAAO,IAAIC,EAAe,GAC3B,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAc,IAAAJ,GAEhC,EAAC,MAAAK,GAAM,GAAGC,EAAQ,IAAAC,EAA2BN,GAASG,GAAY;AAAA,IACtE,MAAAD;AAAA,IACA,MAAM;AAAA,EAAA,CACP,GAEKK,IAAOC,EAAQ,MACZJ,KAAQ,MACd,CAACA,CAAI,CAAC;AAEF,SAAA;AAAA,IACL,GAAGC;AAAA,IACH,MAAAE;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"useShop.js","sources":["../../../src/hooks/shop/useShop.ts"],"sourcesContent":["import {useShopActionQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {DataHookOptionsBase, DataHookReturnsBase, Shop} from '../../types'\n\nexport interface UseShopParams extends DataHookOptionsBase {\n /**\n * The shop ID to fetch.\n */\n id: string\n}\n\ninterface UseShopReturns extends DataHookReturnsBase {\n /**\n * The shop returned from the query.\n */\n shop: Shop | null\n}\n\nexport const useShop = (params: UseShopParams): UseShopReturns => {\n const {getShop} = useShopActions()\n const {skip = false, ...restParams} = params\n\n const {data, ...rest} = useShopActionQuery(\n ['shop', restParams],\n getShop,\n restParams,\n {skip}\n )\n\n return {\n ...rest,\n shop: data,\n }\n}\n"],"names":["useShop","params","getShop","useShopActions","skip","restParams","data","rest","useShopActionQuery"],"mappings":";;AAkBa,MAAAA,IAAU,CAACC,MAA0C;AAC1D,QAAA,EAAC,SAAAC,EAAO,IAAIC,EAAe,GAC3B,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAc,IAAAJ,GAEhC,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,QAAQH,CAAU;AAAA,IACnBH;AAAA,IACAG;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGG;AAAA,IACH,MAAMD;AAAA,EACR;AACF;"}
@@ -1,17 +1,15 @@
1
1
  import { useShopActions as i } from "../../internal/useShopActions.js";
2
- import { useShopActionsDataFetching as n } from "../../internal/useShopActionsDataFetching.js";
3
- const A = (t) => {
4
- const { skip: s, ...e } = t || {}, { getBuyerAttributes: o } = i(), { data: r, ...u } = n(
5
- o,
6
- e,
7
- {
8
- skip: s,
9
- hook: "useBuyerAttributes"
10
- }
2
+ import { useShopActionQuery as n } from "../../internal/reactQuery/useShopActionQuery.js";
3
+ const A = (r) => {
4
+ const { skip: e, ...t } = r || {}, { getBuyerAttributes: s } = i(), { data: o, ...u } = n(
5
+ ["buyerAttributes", t],
6
+ s,
7
+ t,
8
+ { skip: e }
11
9
  );
12
10
  return {
13
11
  ...u,
14
- buyerAttributes: r
12
+ buyerAttributes: o
15
13
  };
16
14
  };
17
15
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"useBuyerAttributes.js","sources":["../../../src/hooks/user/useBuyerAttributes.ts"],"sourcesContent":["import {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsDataFetching} from '../../internal/useShopActionsDataFetching'\nimport {\n DataHookOptionsBase,\n DataHookReturnsBase,\n BuyerAttributes,\n} from '../../types'\n\nexport interface UseBuyerAttributesParams extends DataHookOptionsBase {}\n\nexport interface UseBuyerAttributesReturns extends DataHookReturnsBase {\n buyerAttributes: BuyerAttributes | null\n}\n\nexport const useBuyerAttributes = (\n params?: UseBuyerAttributesParams\n): UseBuyerAttributesReturns => {\n const {skip, ...shopActionParams} = params || {}\n const {getBuyerAttributes} = useShopActions()\n\n const {data, ...rest} = useShopActionsDataFetching(\n getBuyerAttributes,\n shopActionParams,\n {\n skip,\n hook: 'useBuyerAttributes',\n }\n )\n\n return {\n ...rest,\n buyerAttributes: data,\n }\n}\n"],"names":["useBuyerAttributes","params","skip","shopActionParams","getBuyerAttributes","useShopActions","data","rest","useShopActionsDataFetching"],"mappings":";;AAca,MAAAA,IAAqB,CAChCC,MAC8B;AAC9B,QAAM,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIF,KAAU,CAAC,GACzC,EAAC,oBAAAG,EAAkB,IAAIC,EAAe,GAEtC,EAAC,MAAAC,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBJ;AAAA,IACAD;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV;AAEO,SAAA;AAAA,IACL,GAAGK;AAAA,IACH,iBAAiBD;AAAA,EACnB;AACF;"}
1
+ {"version":3,"file":"useBuyerAttributes.js","sources":["../../../src/hooks/user/useBuyerAttributes.ts"],"sourcesContent":["import {useShopActionQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n DataHookOptionsBase,\n DataHookReturnsBase,\n BuyerAttributes,\n} from '../../types'\n\nexport interface UseBuyerAttributesParams extends DataHookOptionsBase {}\n\nexport interface UseBuyerAttributesReturns extends DataHookReturnsBase {\n buyerAttributes: BuyerAttributes | null\n}\n\nexport const useBuyerAttributes = (\n params?: UseBuyerAttributesParams\n): UseBuyerAttributesReturns => {\n const {skip, ...shopActionParams} = params || {}\n const {getBuyerAttributes} = useShopActions()\n\n const {data, ...rest} = useShopActionQuery(\n ['buyerAttributes', shopActionParams],\n getBuyerAttributes,\n shopActionParams,\n {skip}\n )\n\n return {\n ...rest,\n buyerAttributes: data,\n }\n}\n"],"names":["useBuyerAttributes","params","skip","shopActionParams","getBuyerAttributes","useShopActions","data","rest","useShopActionQuery"],"mappings":";;AAca,MAAAA,IAAqB,CAChCC,MAC8B;AAC9B,QAAM,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIF,KAAU,CAAC,GACzC,EAAC,oBAAAG,EAAkB,IAAIC,EAAe,GAEtC,EAAC,MAAAC,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,mBAAmBL,CAAgB;AAAA,IACpCC;AAAA,IACAD;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGK;AAAA,IACH,iBAAiBD;AAAA,EACnB;AACF;"}
@@ -1,13 +1,11 @@
1
1
  import { useShopActions as c } from "../../internal/useShopActions.js";
2
- import { useShopActionsDataFetching as u } from "../../internal/useShopActionsDataFetching.js";
3
- const a = (r) => {
4
- const { skip: t, ...s } = r || {}, { getCurrentUser: e } = c(), { data: o, ...n } = u(
5
- e,
2
+ import { useShopActionQuery as u } from "../../internal/reactQuery/useShopActionQuery.js";
3
+ const m = (t) => {
4
+ const { skip: e, ...r } = t || {}, { getCurrentUser: s } = c(), { data: o, ...n } = u(
5
+ ["currentUser", r],
6
6
  s,
7
- {
8
- skip: t,
9
- hook: "useCurrentUser"
10
- }
7
+ r,
8
+ { skip: e }
11
9
  );
12
10
  return {
13
11
  ...n,
@@ -15,6 +13,6 @@ const a = (r) => {
15
13
  };
16
14
  };
17
15
  export {
18
- a as useCurrentUser
16
+ m as useCurrentUser
19
17
  };
20
18
  //# sourceMappingURL=useCurrentUser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentUser.js","sources":["../../../src/hooks/user/useCurrentUser.ts"],"sourcesContent":["import {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsDataFetching} from '../../internal/useShopActionsDataFetching'\nimport {\n DataHookOptionsBase,\n DataHookReturnsBase,\n UserProfile,\n} from '../../types'\n\nexport interface UseCurrentUserParams extends DataHookOptionsBase {}\n\nexport interface UseCurrentUserReturns extends DataHookReturnsBase {\n /**\n * The current user logged into Shop.\n */\n currentUser: UserProfile | null\n}\n\n/**\n * Hook to fetch the current user's profile.\n */\nexport const useCurrentUser = (\n params?: UseCurrentUserParams\n): UseCurrentUserReturns => {\n const {skip, ...shopActionParams} = params || {}\n const {getCurrentUser} = useShopActions()\n\n const {data, ...rest} = useShopActionsDataFetching(\n getCurrentUser,\n shopActionParams,\n {\n skip,\n hook: 'useCurrentUser',\n }\n )\n\n return {\n ...rest,\n currentUser: data,\n }\n}\n"],"names":["useCurrentUser","params","skip","shopActionParams","getCurrentUser","useShopActions","data","rest","useShopActionsDataFetching"],"mappings":";;AAoBa,MAAAA,IAAiB,CAC5BC,MAC0B;AAC1B,QAAM,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIF,KAAU,CAAC,GACzC,EAAC,gBAAAG,EAAc,IAAIC,EAAe,GAElC,EAAC,MAAAC,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBJ;AAAA,IACAD;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV;AAEO,SAAA;AAAA,IACL,GAAGK;AAAA,IACH,aAAaD;AAAA,EACf;AACF;"}
1
+ {"version":3,"file":"useCurrentUser.js","sources":["../../../src/hooks/user/useCurrentUser.ts"],"sourcesContent":["import {useShopActionQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n DataHookOptionsBase,\n DataHookReturnsBase,\n UserProfile,\n} from '../../types'\n\nexport interface UseCurrentUserParams extends DataHookOptionsBase {}\n\nexport interface UseCurrentUserReturns extends DataHookReturnsBase {\n /**\n * The current user logged into Shop.\n */\n currentUser: UserProfile | null\n}\n\n/**\n * Hook to fetch the current user's profile.\n */\nexport const useCurrentUser = (\n params?: UseCurrentUserParams\n): UseCurrentUserReturns => {\n const {skip, ...shopActionParams} = params || {}\n const {getCurrentUser} = useShopActions()\n\n const {data, ...rest} = useShopActionQuery(\n ['currentUser', shopActionParams],\n getCurrentUser,\n shopActionParams,\n {skip}\n )\n\n return {\n ...rest,\n currentUser: data,\n }\n}\n"],"names":["useCurrentUser","params","skip","shopActionParams","getCurrentUser","useShopActions","data","rest","useShopActionQuery"],"mappings":";;AAoBa,MAAAA,IAAiB,CAC5BC,MAC0B;AAC1B,QAAM,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIF,KAAU,CAAC,GACzC,EAAC,gBAAAG,EAAc,IAAIC,EAAe,GAElC,EAAC,MAAAC,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,eAAeL,CAAgB;AAAA,IAChCC;AAAA,IACAD;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGK;AAAA,IACH,aAAaD;AAAA,EACf;AACF;"}
@@ -1,21 +1,18 @@
1
- import { useMemo as a } from "react";
2
- import { useShopActions as l } from "../../internal/useShopActions.js";
3
- import { useShopActionsPaginatedDataFetching as c } from "../../internal/useShopActionsPaginatedDataFetching.js";
4
- const u = (s) => {
5
- const { getFollowedShops: t } = l(), { skip: e = !1, ...r } = s ?? {}, { data: o, ...n } = c(
1
+ import { useShopActions as n } from "../../internal/useShopActions.js";
2
+ import { useShopActionInfiniteQuery as i } from "../../internal/reactQuery/useShopActionInfiniteQuery.js";
3
+ const h = (s) => {
4
+ const { getFollowedShops: t } = n(), { skip: e = !1, ...o } = s ?? {}, { data: r, ...p } = i(
5
+ ["followedShops", o],
6
6
  t,
7
- r,
8
- {
9
- skip: e,
10
- hook: "useFollowedShops"
11
- }
12
- ), p = a(() => o ?? null, [o]);
7
+ o,
8
+ { skip: e }
9
+ );
13
10
  return {
14
- ...n,
15
- shops: p
11
+ ...p,
12
+ shops: r
16
13
  };
17
14
  };
18
15
  export {
19
- u as useFollowedShops
16
+ h as useFollowedShops
20
17
  };
21
18
  //# sourceMappingURL=useFollowedShops.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFollowedShops.js","sources":["../../../src/hooks/user/useFollowedShops.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsPaginatedDataFetching} from '../../internal/useShopActionsPaginatedDataFetching'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Shop,\n} from '../../types'\n\nexport interface UseFollowedShopsParams extends PaginatedDataHookOptionsBase {}\n\ninterface UseFollowedShopsReturns extends PaginatedDataHookReturnsBase {\n /**\n * The followed shops returned from the query.\n */\n shops: Shop[] | null\n}\n\nexport const useFollowedShops = (\n params?: UseFollowedShopsParams\n): UseFollowedShopsReturns => {\n const {getFollowedShops} = useShopActions()\n const {skip = false, ...restParams} = params ?? {}\n\n const {data, ...rest} = useShopActionsPaginatedDataFetching(\n getFollowedShops,\n restParams,\n {\n skip,\n hook: 'useFollowedShops',\n }\n )\n\n const shops = useMemo(() => {\n return data ?? null\n }, [data])\n\n return {\n ...rest,\n shops,\n }\n}\n"],"names":["useFollowedShops","params","getFollowedShops","useShopActions","skip","restParams","data","rest","useShopActionsPaginatedDataFetching","shops","useMemo"],"mappings":";;;AAmBa,MAAAA,IAAmB,CAC9BC,MAC4B;AACtB,QAAA,EAAC,kBAAAC,EAAgB,IAAIC,EAAe,GACpC,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAU,IAAIJ,KAAU,CAAC,GAE3C,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBN;AAAA,IACAG;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV,GAEMK,IAAQC,EAAQ,MACbJ,KAAQ,MACd,CAACA,CAAI,CAAC;AAEF,SAAA;AAAA,IACL,GAAGC;AAAA,IACH,OAAAE;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"useFollowedShops.js","sources":["../../../src/hooks/user/useFollowedShops.ts"],"sourcesContent":["import {useShopActionInfiniteQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Shop,\n} from '../../types'\n\nexport interface UseFollowedShopsParams extends PaginatedDataHookOptionsBase {}\n\ninterface UseFollowedShopsReturns extends PaginatedDataHookReturnsBase {\n /**\n * The followed shops returned from the query.\n */\n shops: Shop[] | null\n}\n\nexport const useFollowedShops = (\n params?: UseFollowedShopsParams\n): UseFollowedShopsReturns => {\n const {getFollowedShops} = useShopActions()\n const {skip = false, ...restParams} = params ?? {}\n\n const {data, ...rest} = useShopActionInfiniteQuery(\n ['followedShops', restParams],\n getFollowedShops,\n restParams,\n {skip}\n )\n\n return {\n ...rest,\n shops: data,\n }\n}\n"],"names":["useFollowedShops","params","getFollowedShops","useShopActions","skip","restParams","data","rest","useShopActionInfiniteQuery"],"mappings":";;AAiBa,MAAAA,IAAmB,CAC9BC,MAC4B;AACtB,QAAA,EAAC,kBAAAC,EAAgB,IAAIC,EAAe,GACpC,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAU,IAAIJ,KAAU,CAAC,GAE3C,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,iBAAiBH,CAAU;AAAA,IAC5BH;AAAA,IACAG;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGG;AAAA,IACH,OAAOD;AAAA,EACT;AACF;"}
@@ -1,13 +1,11 @@
1
- import { useShopActions as a } from "../../internal/useShopActions.js";
2
- import { useShopActionsPaginatedDataFetching as c } from "../../internal/useShopActionsPaginatedDataFetching.js";
3
- const d = (o) => {
4
- const { skip: s, ...r } = o || {}, { getOrders: t } = a(), { data: e, ...n } = c(
1
+ import { useShopActions as i } from "../../internal/useShopActions.js";
2
+ import { useShopActionInfiniteQuery as c } from "../../internal/reactQuery/useShopActionInfiniteQuery.js";
3
+ const m = (o) => {
4
+ const { skip: s, ...r } = o || {}, { getOrders: t } = i(), { data: e, ...n } = c(
5
+ ["orders", r],
5
6
  t,
6
7
  r,
7
- {
8
- skip: s,
9
- hook: "useOrders"
10
- }
8
+ { skip: s }
11
9
  );
12
10
  return {
13
11
  ...n,
@@ -15,6 +13,6 @@ const d = (o) => {
15
13
  };
16
14
  };
17
15
  export {
18
- d as useOrders
16
+ m as useOrders
19
17
  };
20
18
  //# sourceMappingURL=useOrders.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useOrders.js","sources":["../../../src/hooks/user/useOrders.ts"],"sourcesContent":["import {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsPaginatedDataFetching} from '../../internal/useShopActionsPaginatedDataFetching'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Order,\n} from '../../types'\n\nexport interface UseOrdersParams extends PaginatedDataHookOptionsBase {}\n\nexport interface UseOrdersReturns extends PaginatedDataHookReturnsBase {\n orders: Order[] | null\n}\n\nexport const useOrders = (params?: UseOrdersParams): UseOrdersReturns => {\n const {skip, ...shopActionParams} = params || {}\n const {getOrders} = useShopActions()\n\n const {data, ...rest} = useShopActionsPaginatedDataFetching(\n getOrders,\n shopActionParams,\n {\n skip,\n hook: 'useOrders',\n }\n )\n\n return {\n ...rest,\n orders: data,\n }\n}\n"],"names":["useOrders","params","skip","shopActionParams","getOrders","useShopActions","data","rest","useShopActionsPaginatedDataFetching"],"mappings":";;AAca,MAAAA,IAAY,CAACC,MAA+C;AACvE,QAAM,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIF,KAAU,CAAC,GACzC,EAAC,WAAAG,EAAS,IAAIC,EAAe,GAE7B,EAAC,MAAAC,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBJ;AAAA,IACAD;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV;AAEO,SAAA;AAAA,IACL,GAAGK;AAAA,IACH,QAAQD;AAAA,EACV;AACF;"}
1
+ {"version":3,"file":"useOrders.js","sources":["../../../src/hooks/user/useOrders.ts"],"sourcesContent":["import {useShopActionInfiniteQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Order,\n} from '../../types'\n\nexport interface UseOrdersParams extends PaginatedDataHookOptionsBase {}\n\nexport interface UseOrdersReturns extends PaginatedDataHookReturnsBase {\n orders: Order[] | null\n}\n\nexport const useOrders = (params?: UseOrdersParams): UseOrdersReturns => {\n const {skip, ...shopActionParams} = params || {}\n const {getOrders} = useShopActions()\n\n const {data, ...rest} = useShopActionInfiniteQuery(\n ['orders', shopActionParams],\n getOrders,\n shopActionParams,\n {skip}\n )\n\n return {\n ...rest,\n orders: data,\n }\n}\n"],"names":["useOrders","params","skip","shopActionParams","getOrders","useShopActions","data","rest","useShopActionInfiniteQuery"],"mappings":";;AAca,MAAAA,IAAY,CAACC,MAA+C;AACvE,QAAM,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIF,KAAU,CAAC,GACzC,EAAC,WAAAG,EAAS,IAAIC,EAAe,GAE7B,EAAC,MAAAC,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,UAAUL,CAAgB;AAAA,IAC3BC;AAAA,IACAD;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGK;AAAA,IACH,QAAQD;AAAA,EACV;AACF;"}
@@ -1,21 +1,19 @@
1
1
  import { useMemo as u } from "react";
2
2
  import { useShopActions as i } from "../../internal/useShopActions.js";
3
- import { useShopActionsPaginatedDataFetching as p } from "../../internal/useShopActionsPaginatedDataFetching.js";
4
- const h = (o) => {
5
- const { getRecentProducts: s } = i(), { skip: e, ...r } = o ?? {}, { data: t, ...c } = p(
6
- s,
7
- r,
8
- {
9
- skip: e,
10
- hook: "useRecentProducts"
11
- }
12
- ), n = u(() => t ?? null, [t]);
3
+ import { useShopActionInfiniteQuery as p } from "../../internal/reactQuery/useShopActionInfiniteQuery.js";
4
+ const f = (r) => {
5
+ const { getRecentProducts: e } = i(), { skip: s, ...t } = r ?? {}, { data: o, ...n } = p(
6
+ ["recentProducts", t],
7
+ e,
8
+ t,
9
+ { skip: s }
10
+ ), c = u(() => o ?? null, [o]);
13
11
  return {
14
- ...c,
15
- products: n
12
+ ...n,
13
+ products: c
16
14
  };
17
15
  };
18
16
  export {
19
- h as useRecentProducts
17
+ f as useRecentProducts
20
18
  };
21
19
  //# sourceMappingURL=useRecentProducts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRecentProducts.js","sources":["../../../src/hooks/user/useRecentProducts.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsPaginatedDataFetching} from '../../internal/useShopActionsPaginatedDataFetching'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Product,\n} from '../../types'\n\nexport interface UseRecentProductsParams extends PaginatedDataHookOptionsBase {\n includeSensitive?: boolean\n}\n\nexport interface UseRecentProductsReturns extends PaginatedDataHookReturnsBase {\n products: Product[] | null\n}\n\n/**\n * Hook to fetch recently viewed products.\n * @param params - Options for the hook.\n */\nexport const useRecentProducts = (\n params?: UseRecentProductsParams\n): UseRecentProductsReturns => {\n const {getRecentProducts} = useShopActions()\n const {skip, ...shopActionParams} = params ?? {}\n\n const {data, ...rest} = useShopActionsPaginatedDataFetching(\n getRecentProducts,\n shopActionParams,\n {\n skip,\n hook: 'useRecentProducts',\n }\n )\n\n const products = useMemo(() => {\n return data ?? null\n }, [data])\n\n return {\n ...rest,\n products,\n }\n}\n"],"names":["useRecentProducts","params","getRecentProducts","useShopActions","skip","shopActionParams","data","rest","useShopActionsPaginatedDataFetching","products","useMemo"],"mappings":";;;AAsBa,MAAAA,IAAoB,CAC/BC,MAC6B;AACvB,QAAA,EAAC,mBAAAC,EAAiB,IAAIC,EAAe,GACrC,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIJ,KAAU,CAAC,GAEzC,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBN;AAAA,IACAG;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV,GAEMK,IAAWC,EAAQ,MAChBJ,KAAQ,MACd,CAACA,CAAI,CAAC;AAEF,SAAA;AAAA,IACL,GAAGC;AAAA,IACH,UAAAE;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"useRecentProducts.js","sources":["../../../src/hooks/user/useRecentProducts.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useShopActionInfiniteQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Product,\n} from '../../types'\n\nexport interface UseRecentProductsParams extends PaginatedDataHookOptionsBase {\n includeSensitive?: boolean\n}\n\nexport interface UseRecentProductsReturns extends PaginatedDataHookReturnsBase {\n products: Product[] | null\n}\n\n/**\n * Hook to fetch recently viewed products.\n * @param params - Options for the hook.\n */\nexport const useRecentProducts = (\n params?: UseRecentProductsParams\n): UseRecentProductsReturns => {\n const {getRecentProducts} = useShopActions()\n const {skip, ...shopActionParams} = params ?? {}\n\n const {data, ...rest} = useShopActionInfiniteQuery(\n ['recentProducts', shopActionParams],\n getRecentProducts,\n shopActionParams,\n {skip}\n )\n\n const products = useMemo(() => {\n return data ?? null\n }, [data])\n\n return {\n ...rest,\n products,\n }\n}\n"],"names":["useRecentProducts","params","getRecentProducts","useShopActions","skip","shopActionParams","data","rest","useShopActionInfiniteQuery","products","useMemo"],"mappings":";;;AAsBa,MAAAA,IAAoB,CAC/BC,MAC6B;AACvB,QAAA,EAAC,mBAAAC,EAAiB,IAAIC,EAAe,GACrC,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIJ,KAAU,CAAC,GAEzC,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,kBAAkBH,CAAgB;AAAA,IACnCH;AAAA,IACAG;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP,GAEMK,IAAWC,EAAQ,MAChBJ,KAAQ,MACd,CAACA,CAAI,CAAC;AAEF,SAAA;AAAA,IACL,GAAGC;AAAA,IACH,UAAAE;AAAA,EACF;AACF;"}
@@ -1,21 +1,18 @@
1
- import { useMemo as p } from "react";
2
- import { useShopActions as a } from "../../internal/useShopActions.js";
3
- import { useShopActionsPaginatedDataFetching as h } from "../../internal/useShopActionsPaginatedDataFetching.js";
4
- const S = (t) => {
5
- const { getRecentShops: s } = a(), { skip: e = !1, ...n } = t ?? {}, { data: o, ...r } = h(
1
+ import { useShopActions as p } from "../../internal/useShopActions.js";
2
+ import { useShopActionInfiniteQuery as c } from "../../internal/reactQuery/useShopActionInfiniteQuery.js";
3
+ const a = (t) => {
4
+ const { getRecentShops: e } = p(), { skip: o = !1, ...s } = t ?? {}, { data: n, ...r } = c(
5
+ ["recentShops", s],
6
+ e,
6
7
  s,
7
- n,
8
- {
9
- skip: e,
10
- hook: "useRecentShops"
11
- }
12
- ), c = p(() => o ?? null, [o]);
8
+ { skip: o }
9
+ );
13
10
  return {
14
11
  ...r,
15
- shops: c
12
+ shops: n
16
13
  };
17
14
  };
18
15
  export {
19
- S as useRecentShops
16
+ a as useRecentShops
20
17
  };
21
18
  //# sourceMappingURL=useRecentShops.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useRecentShops.js","sources":["../../../src/hooks/user/useRecentShops.ts"],"sourcesContent":["import {useMemo} from 'react'\n\nimport {useShopActions} from '../../internal/useShopActions'\nimport {useShopActionsPaginatedDataFetching} from '../../internal/useShopActionsPaginatedDataFetching'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Shop,\n} from '../../types'\n\nexport interface UseRecentShopsParams extends PaginatedDataHookOptionsBase {}\n\ninterface UseRecentShopsReturns extends PaginatedDataHookReturnsBase {\n /**\n * The recent shops returned from the query.\n */\n shops: Shop[] | null\n}\n\nexport const useRecentShops = (\n params?: UseRecentShopsParams\n): UseRecentShopsReturns => {\n const {getRecentShops} = useShopActions()\n const {skip = false, ...restParams} = params ?? {}\n\n const {data, ...rest} = useShopActionsPaginatedDataFetching(\n getRecentShops,\n restParams,\n {\n skip,\n hook: 'useRecentShops',\n }\n )\n\n const shops = useMemo(() => {\n return data ?? null\n }, [data])\n\n return {\n ...rest,\n shops,\n }\n}\n"],"names":["useRecentShops","params","getRecentShops","useShopActions","skip","restParams","data","rest","useShopActionsPaginatedDataFetching","shops","useMemo"],"mappings":";;;AAmBa,MAAAA,IAAiB,CAC5BC,MAC0B;AACpB,QAAA,EAAC,gBAAAC,EAAc,IAAIC,EAAe,GAClC,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAU,IAAIJ,KAAU,CAAC,GAE3C,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtBN;AAAA,IACAG;AAAA,IACA;AAAA,MACE,MAAAD;AAAA,MACA,MAAM;AAAA,IAAA;AAAA,EAEV,GAEMK,IAAQC,EAAQ,MACbJ,KAAQ,MACd,CAACA,CAAI,CAAC;AAEF,SAAA;AAAA,IACL,GAAGC;AAAA,IACH,OAAAE;AAAA,EACF;AACF;"}
1
+ {"version":3,"file":"useRecentShops.js","sources":["../../../src/hooks/user/useRecentShops.ts"],"sourcesContent":["import {useShopActionInfiniteQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Shop,\n} from '../../types'\n\nexport interface UseRecentShopsParams extends PaginatedDataHookOptionsBase {}\n\ninterface UseRecentShopsReturns extends PaginatedDataHookReturnsBase {\n /**\n * The recent shops returned from the query.\n */\n shops: Shop[] | null\n}\n\nexport const useRecentShops = (\n params?: UseRecentShopsParams\n): UseRecentShopsReturns => {\n const {getRecentShops} = useShopActions()\n const {skip = false, ...restParams} = params ?? {}\n\n const {data, ...rest} = useShopActionInfiniteQuery(\n ['recentShops', restParams],\n getRecentShops,\n restParams,\n {skip}\n )\n\n return {\n ...rest,\n shops: data,\n }\n}\n"],"names":["useRecentShops","params","getRecentShops","useShopActions","skip","restParams","data","rest","useShopActionInfiniteQuery"],"mappings":";;AAiBa,MAAAA,IAAiB,CAC5BC,MAC0B;AACpB,QAAA,EAAC,gBAAAC,EAAc,IAAIC,EAAe,GAClC,EAAC,MAAAC,IAAO,IAAO,GAAGC,EAAU,IAAIJ,KAAU,CAAC,GAE3C,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,eAAeH,CAAU;AAAA,IAC1BH;AAAA,IACAG;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGG;AAAA,IACH,OAAOD;AAAA,EACT;AACF;"}