@shopify/shop-minis-react 0.3.4 → 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 (167) hide show
  1. package/dist/components/MinisContainer.js +11 -10
  2. package/dist/components/MinisContainer.js.map +1 -1
  3. package/dist/hooks/content/useContent.js +12 -18
  4. package/dist/hooks/content/useContent.js.map +1 -1
  5. package/dist/hooks/product/useCuratedProducts.js +9 -11
  6. package/dist/hooks/product/useCuratedProducts.js.map +1 -1
  7. package/dist/hooks/product/usePopularProducts.js +9 -11
  8. package/dist/hooks/product/usePopularProducts.js.map +1 -1
  9. package/dist/hooks/product/useProduct.js +11 -17
  10. package/dist/hooks/product/useProduct.js.map +1 -1
  11. package/dist/hooks/product/useProductList.js +10 -21
  12. package/dist/hooks/product/useProductList.js.map +1 -1
  13. package/dist/hooks/product/useProductLists.js +11 -13
  14. package/dist/hooks/product/useProductLists.js.map +1 -1
  15. package/dist/hooks/product/useProductMedia.js +12 -18
  16. package/dist/hooks/product/useProductMedia.js.map +1 -1
  17. package/dist/hooks/product/useProductSearch.js +34 -27
  18. package/dist/hooks/product/useProductSearch.js.map +1 -1
  19. package/dist/hooks/product/useProductVariants.js +11 -14
  20. package/dist/hooks/product/useProductVariants.js.map +1 -1
  21. package/dist/hooks/product/useProducts.js +12 -11
  22. package/dist/hooks/product/useProducts.js.map +1 -1
  23. package/dist/hooks/product/useRecommendedProducts.js +11 -13
  24. package/dist/hooks/product/useRecommendedProducts.js.map +1 -1
  25. package/dist/hooks/shop/useRecommendedShops.js +11 -13
  26. package/dist/hooks/shop/useRecommendedShops.js.map +1 -1
  27. package/dist/hooks/shop/useShop.js +12 -11
  28. package/dist/hooks/shop/useShop.js.map +1 -1
  29. package/dist/hooks/user/useBuyerAttributes.js +8 -10
  30. package/dist/hooks/user/useBuyerAttributes.js.map +1 -1
  31. package/dist/hooks/user/useCurrentUser.js +7 -9
  32. package/dist/hooks/user/useCurrentUser.js.map +1 -1
  33. package/dist/hooks/user/useFollowedShops.js +11 -14
  34. package/dist/hooks/user/useFollowedShops.js.map +1 -1
  35. package/dist/hooks/user/useOrders.js +7 -9
  36. package/dist/hooks/user/useOrders.js.map +1 -1
  37. package/dist/hooks/user/useRecentProducts.js +11 -13
  38. package/dist/hooks/user/useRecentProducts.js.map +1 -1
  39. package/dist/hooks/user/useRecentShops.js +10 -13
  40. package/dist/hooks/user/useRecentShops.js.map +1 -1
  41. package/dist/hooks/user/useSavedProducts.js +10 -13
  42. package/dist/hooks/user/useSavedProducts.js.map +1 -1
  43. package/dist/internal/reactQuery/MinisQueryProvider.js +11 -0
  44. package/dist/internal/reactQuery/MinisQueryProvider.js.map +1 -0
  45. package/dist/internal/reactQuery/queryClient.js +33 -0
  46. package/dist/internal/reactQuery/queryClient.js.map +1 -0
  47. package/dist/internal/reactQuery/useShopActionInfiniteQuery.js +52 -0
  48. package/dist/internal/reactQuery/useShopActionInfiniteQuery.js.map +1 -0
  49. package/dist/internal/reactQuery/useShopActionQuery.js +37 -0
  50. package/dist/internal/reactQuery/useShopActionQuery.js.map +1 -0
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. 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
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. 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
  79. 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
  80. 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
  81. 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
  82. 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
  83. 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
  84. 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
  85. 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
  86. 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
  87. 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
  88. 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
  89. 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
  90. 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
  91. 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
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. package/package.json +2 -7
  100. package/src/components/MinisContainer.tsx +6 -3
  101. package/src/hooks/content/useContent.ts +6 -17
  102. package/src/hooks/product/useCuratedProducts.ts +4 -6
  103. package/src/hooks/product/usePopularProducts.ts +4 -6
  104. package/src/hooks/product/useProduct.ts +6 -17
  105. package/src/hooks/product/useProductList.ts +4 -19
  106. package/src/hooks/product/useProductLists.ts +4 -6
  107. package/src/hooks/product/useProductMedia.ts +6 -17
  108. package/src/hooks/product/useProductSearch.ts +19 -15
  109. package/src/hooks/product/useProductVariants.ts +5 -13
  110. package/src/hooks/product/useProducts.ts +8 -12
  111. package/src/hooks/product/useRecommendedProducts.ts +4 -6
  112. package/src/hooks/shop/useRecommendedShops.ts +4 -6
  113. package/src/hooks/shop/useShop.ts +8 -12
  114. package/src/hooks/user/useBuyerAttributes.ts +4 -6
  115. package/src/hooks/user/useCurrentUser.ts +4 -6
  116. package/src/hooks/user/useFollowedShops.ts +5 -13
  117. package/src/hooks/user/useOrders.ts +4 -6
  118. package/src/hooks/user/useRecentProducts.ts +4 -6
  119. package/src/hooks/user/useRecentShops.ts +5 -13
  120. package/src/hooks/user/useSavedProducts.ts +5 -13
  121. package/src/internal/reactQuery/MinisQueryProvider.test.tsx +38 -0
  122. package/src/internal/reactQuery/MinisQueryProvider.tsx +16 -0
  123. package/src/internal/reactQuery/index.ts +8 -0
  124. package/src/internal/reactQuery/queryClient.test.tsx +91 -0
  125. package/src/internal/reactQuery/queryClient.ts +43 -0
  126. package/src/internal/reactQuery/useShopActionInfiniteQuery.test.tsx +357 -0
  127. package/src/internal/reactQuery/useShopActionInfiniteQuery.ts +129 -0
  128. package/src/internal/reactQuery/useShopActionQuery.test.tsx +184 -0
  129. package/src/internal/reactQuery/useShopActionQuery.ts +74 -0
  130. package/dist/internal/useShopActionsDataFetching.js +0 -79
  131. package/dist/internal/useShopActionsDataFetching.js.map +0 -1
  132. package/dist/internal/useShopActionsPaginatedDataFetching.js +0 -96
  133. package/dist/internal/useShopActionsPaginatedDataFetching.js.map +0 -1
  134. package/src/hooks/product/useProductSearch.test.ts +0 -470
  135. package/src/internal/useShopActionsDataFetching.test.ts +0 -465
  136. package/src/internal/useShopActionsDataFetching.ts +0 -150
  137. package/src/internal/useShopActionsPaginatedDataFetching.ts +0 -188
  138. package/src/stories/Accordion.stories.tsx +0 -124
  139. package/src/stories/AddToCart.stories.tsx +0 -251
  140. package/src/stories/Alert.stories.tsx +0 -38
  141. package/src/stories/AlertDialog.stories.tsx +0 -48
  142. package/src/stories/Avatar.stories.tsx +0 -29
  143. package/src/stories/Badge.stories.tsx +0 -46
  144. package/src/stories/Button.stories.tsx +0 -81
  145. package/src/stories/Card.stories.tsx +0 -40
  146. package/src/stories/Checkbox.stories.tsx +0 -44
  147. package/src/stories/FavoriteButton.stories.tsx +0 -58
  148. package/src/stories/IconButton.stories.tsx +0 -68
  149. package/src/stories/ImageContentWrapper.stories.tsx +0 -65
  150. package/src/stories/Input.stories.tsx +0 -44
  151. package/src/stories/Label.stories.tsx +0 -19
  152. package/src/stories/List.stories.tsx +0 -64
  153. package/src/stories/MerchantCard.stories.tsx +0 -127
  154. package/src/stories/ProductCard.stories.tsx +0 -92
  155. package/src/stories/ProductLink.stories.tsx +0 -46
  156. package/src/stories/ProductVariantPrice.stories.tsx +0 -70
  157. package/src/stories/Progress.stories.tsx +0 -30
  158. package/src/stories/PullToRefreshList.stories.tsx +0 -122
  159. package/src/stories/QuantitySelector.stories.tsx +0 -78
  160. package/src/stories/RadioGroup.stories.tsx +0 -51
  161. package/src/stories/Search.stories.tsx +0 -37
  162. package/src/stories/Select.stories.tsx +0 -85
  163. package/src/stories/Skeleton.stories.tsx +0 -19
  164. package/src/stories/TextInput.stories.tsx +0 -26
  165. package/src/stories/Toaster.stories.tsx +0 -46
  166. package/src/stories/Touchable.stories.tsx +0 -40
  167. package/src/stories/VideoPlayer.stories.tsx +0 -129
@@ -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;"}
@@ -1,21 +1,18 @@
1
- import { useMemo as u } from "react";
2
- import { useShopActions as a } from "../../internal/useShopActions.js";
3
- import { useShopActionsPaginatedDataFetching as d } from "../../internal/useShopActionsPaginatedDataFetching.js";
4
- const h = (t) => {
5
- const { getSavedProducts: s } = a(), { skip: r, ...e } = t ?? {}, { data: o, ...c } = d(
1
+ import { useShopActions as n } from "../../internal/useShopActions.js";
2
+ import { useShopActionInfiniteQuery as u } from "../../internal/reactQuery/useShopActionInfiniteQuery.js";
3
+ const p = (t) => {
4
+ const { getSavedProducts: s } = n(), { skip: r, ...o } = t ?? {}, { data: e, ...c } = u(
5
+ ["savedProducts", o],
6
6
  s,
7
- e,
8
- {
9
- skip: r,
10
- hook: "useSavedProducts"
11
- }
12
- ), n = u(() => o ?? null, [o]);
7
+ o,
8
+ { skip: r }
9
+ );
13
10
  return {
14
11
  ...c,
15
- products: n
12
+ products: e
16
13
  };
17
14
  };
18
15
  export {
19
- h as useSavedProducts
16
+ p as useSavedProducts
20
17
  };
21
18
  //# sourceMappingURL=useSavedProducts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSavedProducts.js","sources":["../../../src/hooks/user/useSavedProducts.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 UseSavedProductsParams extends PaginatedDataHookOptionsBase {\n includeSensitive?: boolean\n}\n\nexport interface UseSavedProductsReturns extends PaginatedDataHookReturnsBase {\n products: Product[] | null\n}\n\n/**\n * Hook to fetch saved (favorited) products.\n * @param params - Options for the hook.\n */\nexport const useSavedProducts = (\n params?: UseSavedProductsParams\n): UseSavedProductsReturns => {\n const {getSavedProducts} = useShopActions()\n const {skip, ...shopActionParams} = params ?? {}\n\n const {data, ...rest} = useShopActionsPaginatedDataFetching(\n getSavedProducts,\n shopActionParams,\n {\n skip,\n hook: 'useSavedProducts',\n }\n )\n\n const products = useMemo(() => {\n return data ?? null\n }, [data])\n\n return {\n ...rest,\n products,\n }\n}\n"],"names":["useSavedProducts","params","getSavedProducts","useShopActions","skip","shopActionParams","data","rest","useShopActionsPaginatedDataFetching","products","useMemo"],"mappings":";;;AAsBa,MAAAA,IAAmB,CAC9BC,MAC4B;AACtB,QAAA,EAAC,kBAAAC,EAAgB,IAAIC,EAAe,GACpC,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":"useSavedProducts.js","sources":["../../../src/hooks/user/useSavedProducts.ts"],"sourcesContent":["import {useShopActionInfiniteQuery} from '../../internal/reactQuery'\nimport {useShopActions} from '../../internal/useShopActions'\nimport {\n PaginatedDataHookOptionsBase,\n PaginatedDataHookReturnsBase,\n Product,\n} from '../../types'\n\nexport interface UseSavedProductsParams extends PaginatedDataHookOptionsBase {\n includeSensitive?: boolean\n}\n\nexport interface UseSavedProductsReturns extends PaginatedDataHookReturnsBase {\n products: Product[] | null\n}\n\n/**\n * Hook to fetch saved (favorited) products.\n * @param params - Options for the hook.\n */\nexport const useSavedProducts = (\n params?: UseSavedProductsParams\n): UseSavedProductsReturns => {\n const {getSavedProducts} = useShopActions()\n const {skip, ...shopActionParams} = params ?? {}\n\n const {data, ...rest} = useShopActionInfiniteQuery(\n ['savedProducts', shopActionParams],\n getSavedProducts,\n shopActionParams,\n {skip}\n )\n\n return {\n ...rest,\n products: data,\n }\n}\n"],"names":["useSavedProducts","params","getSavedProducts","useShopActions","skip","shopActionParams","data","rest","useShopActionInfiniteQuery"],"mappings":";;AAoBa,MAAAA,IAAmB,CAC9BC,MAC4B;AACtB,QAAA,EAAC,kBAAAC,EAAgB,IAAIC,EAAe,GACpC,EAAC,MAAAC,GAAM,GAAGC,EAAgB,IAAIJ,KAAU,CAAC,GAEzC,EAAC,MAAAK,GAAM,GAAGC,EAAA,IAAQC;AAAA,IACtB,CAAC,iBAAiBH,CAAgB;AAAA,IAClCH;AAAA,IACAG;AAAA,IACA,EAAC,MAAAD,EAAI;AAAA,EACP;AAEO,SAAA;AAAA,IACL,GAAGG;AAAA,IACH,UAAUD;AAAA,EACZ;AACF;"}
@@ -0,0 +1,11 @@
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { useMemo as o } from "react";
3
+ import { createShopMinisQueryClient as t, ShopMinisQueryClientContext as n } from "./queryClient.js";
4
+ function s({ children: r }) {
5
+ const e = o(() => t(), []);
6
+ return /* @__PURE__ */ i(n.Provider, { value: e, children: r });
7
+ }
8
+ export {
9
+ s as MinisQueryProvider
10
+ };
11
+ //# sourceMappingURL=MinisQueryProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MinisQueryProvider.js","sources":["../../../src/internal/reactQuery/MinisQueryProvider.tsx"],"sourcesContent":["import React, {useMemo} from 'react'\n\nimport {\n createShopMinisQueryClient,\n ShopMinisQueryClientContext,\n} from './queryClient'\n\nexport function MinisQueryProvider({children}: {children: React.ReactNode}) {\n const queryClient = useMemo(() => createShopMinisQueryClient(), [])\n\n return (\n <ShopMinisQueryClientContext.Provider value={queryClient}>\n {children}\n </ShopMinisQueryClientContext.Provider>\n )\n}\n"],"names":["MinisQueryProvider","children","queryClient","useMemo","createShopMinisQueryClient","ShopMinisQueryClientContext"],"mappings":";;;AAOgB,SAAAA,EAAmB,EAAC,UAAAC,KAAwC;AAC1E,QAAMC,IAAcC,EAAQ,MAAMC,EAA2B,GAAG,CAAA,CAAE;AAElE,2BACGC,EAA4B,UAA5B,EAAqC,OAAOH,GAC1C,UAAAD,GACH;AAEJ;"}
@@ -0,0 +1,33 @@
1
+ import { createContext as t, useContext as n } from "react";
2
+ import { QueryClient as i } from "../../shop-minis-react/node_modules/.pnpm/@tanstack_query-core@5.86.0/node_modules/@tanstack/query-core/build/modern/queryClient.js";
3
+ const r = t(
4
+ null
5
+ );
6
+ function u() {
7
+ const e = n(r);
8
+ if (!e)
9
+ throw new Error(
10
+ "Shop Minis hooks must be used within <MinisContainer> or <MinisQueryProvider>. Wrap your component tree with one of these providers."
11
+ );
12
+ return e;
13
+ }
14
+ function c() {
15
+ return new i({
16
+ defaultOptions: {
17
+ queries: {
18
+ staleTime: 0,
19
+ // Data is immediately stale
20
+ gcTime: 0,
21
+ // Don't keep in cache after component unmounts
22
+ retry: 1,
23
+ refetchOnWindowFocus: !1
24
+ }
25
+ }
26
+ });
27
+ }
28
+ export {
29
+ r as ShopMinisQueryClientContext,
30
+ c as createShopMinisQueryClient,
31
+ u as useShopMinisQueryClient
32
+ };
33
+ //# sourceMappingURL=queryClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queryClient.js","sources":["../../../src/internal/reactQuery/queryClient.ts"],"sourcesContent":["import {createContext, useContext} from 'react'\n\nimport {QueryClient} from '@tanstack/react-query'\n\n/**\n * Custom QueryClient context for Shop Minis SDK\n * This ensures our SDK always uses its own QueryClient,\n * even if the parent app has their own QueryClientProvider\n */\nexport const ShopMinisQueryClientContext = createContext<QueryClient | null>(\n null\n)\n\nexport function useShopMinisQueryClient(): QueryClient {\n const client = useContext(ShopMinisQueryClientContext)\n if (!client) {\n throw new Error(\n 'Shop Minis hooks must be used within <MinisContainer> or <MinisQueryProvider>. ' +\n 'Wrap your component tree with one of these providers.'\n )\n }\n return client\n}\n\n/**\n * Create a QueryClient instance for Shop Minis SDK\n * Isolated from any parent app's QueryClient\n *\n * Caching is disabled by default since Apollo provides the cache layer.\n * React Query only provides request deduplication and state management.\n */\nexport function createShopMinisQueryClient() {\n return new QueryClient({\n defaultOptions: {\n queries: {\n staleTime: 0, // Data is immediately stale\n gcTime: 0, // Don't keep in cache after component unmounts\n retry: 1,\n refetchOnWindowFocus: false,\n },\n },\n })\n}\n"],"names":["ShopMinisQueryClientContext","createContext","useShopMinisQueryClient","client","useContext","createShopMinisQueryClient","QueryClient"],"mappings":";;AASO,MAAMA,IAA8BC;AAAA,EACzC;AACF;AAEO,SAASC,IAAuC;AAC/C,QAAAC,IAASC,EAAWJ,CAA2B;AACrD,MAAI,CAACG;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAEF;AAEK,SAAAA;AACT;AASO,SAASE,IAA6B;AAC3C,SAAO,IAAIC,EAAY;AAAA,IACrB,gBAAgB;AAAA,MACd,SAAS;AAAA,QACP,WAAW;AAAA;AAAA,QACX,QAAQ;AAAA;AAAA,QACR,OAAO;AAAA,QACP,sBAAsB;AAAA,MAAA;AAAA,IACxB;AAAA,EACF,CACD;AACH;"}
@@ -0,0 +1,52 @@
1
+ import { useMemo as P, useCallback as o } from "react";
2
+ import { useInfiniteQuery as x } from "../../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";
3
+ import { useShopMinisQueryClient as N } from "./queryClient.js";
4
+ function M(i, s, f, u) {
5
+ const { skip: c = !1 } = u ?? {}, l = N(), {
6
+ data: a,
7
+ fetchNextPage: r,
8
+ hasNextPage: g,
9
+ isLoading: p,
10
+ error: d,
11
+ refetch: n
12
+ } = x(
13
+ {
14
+ queryKey: i,
15
+ queryFn: async ({ pageParam: e }) => {
16
+ const t = await s({
17
+ ...f,
18
+ after: e
19
+ });
20
+ if (!t.ok)
21
+ throw t.error;
22
+ return t.data;
23
+ },
24
+ getNextPageParam: (e) => e.pageInfo.hasNextPage ? e.pageInfo.endCursor : void 0,
25
+ initialPageParam: void 0,
26
+ enabled: !c
27
+ // Caching disabled by default (handled by Apollo)
28
+ // fetchPolicy param is passed through to the action (Apollo layer)
29
+ },
30
+ l
31
+ ), h = P(() => {
32
+ if (!a?.pages || a.pages.length === 0) return null;
33
+ const e = a.pages[0].data;
34
+ return e == null ? null : Array.isArray(e) ? a.pages.flatMap((t) => t.data) : e;
35
+ }, [a?.pages]), y = o(async () => {
36
+ await r();
37
+ }, [r]), m = o(async () => {
38
+ await n();
39
+ }, [n]);
40
+ return {
41
+ data: h,
42
+ loading: p,
43
+ error: d,
44
+ hasNextPage: g ?? !1,
45
+ fetchMore: y,
46
+ refetch: m
47
+ };
48
+ }
49
+ export {
50
+ M as useShopActionInfiniteQuery
51
+ };
52
+ //# sourceMappingURL=useShopActionInfiniteQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useShopActionInfiniteQuery.js","sources":["../../../src/internal/reactQuery/useShopActionInfiniteQuery.ts"],"sourcesContent":["import {useCallback, useMemo} from 'react'\n\nimport {ShopActionResult} from '@shopify/shop-minis-platform/actions'\nimport {useInfiniteQuery} from '@tanstack/react-query'\n\nimport {DataHookFetchPolicy} from '../../types'\n\nimport {useShopMinisQueryClient} from './queryClient'\n\n/**\n * Helper to use React Query with Shop Actions (paginated)\n * Replaces useShopActionsPaginatedDataFetching\n *\n * @example\n * ```ts\n * // Example: Fetching saved products\n * const { getSavedProducts } = useShopActions()\n * const { data, loading, error, hasNextPage, fetchMore, refetch } =\n * useShopActionInfiniteQuery(\n * ['savedProducts', { includeSensitive }], // Query key\n * getSavedProducts, // Shop Action\n * { includeSensitive }, // Params (excludes 'after')\n * { skip: false } // Options\n * )\n * // data will be flattened array of products from all pages\n * ```\n */\nexport function useShopActionInfiniteQuery<\n TData,\n TParams extends {after?: string; fetchPolicy?: DataHookFetchPolicy},\n>(\n queryKey: unknown[],\n action: (params: TParams) => Promise<\n ShopActionResult<{\n data: TData\n pageInfo: {hasNextPage: boolean; endCursor: string | null}\n }>\n >,\n params: Omit<TParams, 'after'>,\n options?: {\n skip?: boolean\n }\n) {\n const {skip = false} = options ?? {}\n\n // Always use our SDK's QueryClient for isolation\n const queryClient = useShopMinisQueryClient()\n\n interface PageData {\n data: TData\n pageInfo: {hasNextPage: boolean; endCursor: string | null}\n }\n\n const {\n data,\n fetchNextPage,\n hasNextPage,\n isLoading,\n error,\n refetch: reactQueryRefetch,\n } = useInfiniteQuery<\n PageData,\n Error,\n {pages: PageData[]},\n unknown[],\n string | undefined\n >(\n {\n queryKey,\n queryFn: async ({pageParam}: {pageParam: string | undefined}) => {\n const result = await action({\n ...params,\n after: pageParam,\n } as TParams)\n\n if (!result.ok) {\n throw result.error\n }\n\n return result.data\n },\n getNextPageParam: (lastPage: PageData) =>\n lastPage.pageInfo.hasNextPage ? lastPage.pageInfo.endCursor : undefined,\n initialPageParam: undefined as string | undefined,\n enabled: !skip,\n // Caching disabled by default (handled by Apollo)\n // fetchPolicy param is passed through to the action (Apollo layer)\n },\n queryClient\n )\n\n // Flatten paginated data\n // For paginated queries, we expect TData to be an array type\n // Each page.data is an array that we concatenate together\n const flattenedData = useMemo(() => {\n if (!data?.pages || data.pages.length === 0) return null\n\n // If first page data is null/undefined, return null\n const firstPageData = data.pages[0].data\n if (firstPageData === null || firstPageData === undefined) return null\n\n // If data is array type, flatten all pages\n if (Array.isArray(firstPageData)) {\n return data.pages.flatMap((page: PageData) => page.data as any) as TData\n }\n\n // If data is not an array, just return the first page's data\n // (Though in practice, all Shop Minis paginated queries return arrays)\n return firstPageData as TData\n }, [data?.pages])\n\n // Wrap React Query functions to match expected API\n const fetchMore = useCallback(async () => {\n await fetchNextPage()\n }, [fetchNextPage])\n\n const refetch = useCallback(async () => {\n await reactQueryRefetch()\n }, [reactQueryRefetch])\n\n return {\n data: flattenedData,\n loading: isLoading,\n error: error as Error | null,\n hasNextPage: hasNextPage ?? false,\n fetchMore,\n refetch,\n }\n}\n"],"names":["useShopActionInfiniteQuery","queryKey","action","params","options","skip","queryClient","useShopMinisQueryClient","data","fetchNextPage","hasNextPage","isLoading","error","reactQueryRefetch","useInfiniteQuery","pageParam","result","lastPage","flattenedData","useMemo","firstPageData","page","fetchMore","useCallback","refetch"],"mappings":";;;AA2BO,SAASA,EAIdC,GACAC,GAMAC,GACAC,GAGA;AACA,QAAM,EAAC,MAAAC,IAAO,GAAK,IAAID,KAAW,CAAC,GAG7BE,IAAcC,EAAwB,GAOtC;AAAA,IACJ,MAAAC;AAAA,IACA,eAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAASC;AAAA,EAAA,IACPC;AAAA,IAOF;AAAA,MACE,UAAAb;AAAA,MACA,SAAS,OAAO,EAAC,WAAAc,QAAgD;AACzD,cAAAC,IAAS,MAAMd,EAAO;AAAA,UAC1B,GAAGC;AAAA,UACH,OAAOY;AAAA,QAAA,CACG;AAER,YAAA,CAACC,EAAO;AACV,gBAAMA,EAAO;AAGf,eAAOA,EAAO;AAAA,MAChB;AAAA,MACA,kBAAkB,CAACC,MACjBA,EAAS,SAAS,cAAcA,EAAS,SAAS,YAAY;AAAA,MAChE,kBAAkB;AAAA,MAClB,SAAS,CAACZ;AAAA;AAAA;AAAA,IAGZ;AAAA,IACAC;AAAA,EACF,GAKMY,IAAgBC,EAAQ,MAAM;AAClC,QAAI,CAACX,GAAM,SAASA,EAAK,MAAM,WAAW,EAAU,QAAA;AAGpD,UAAMY,IAAgBZ,EAAK,MAAM,CAAC,EAAE;AACpC,WAAIY,KAAkB,OAA4C,OAG9D,MAAM,QAAQA,CAAa,IACtBZ,EAAK,MAAM,QAAQ,CAACa,MAAmBA,EAAK,IAAW,IAKzDD;AAAA,EAAA,GACN,CAACZ,GAAM,KAAK,CAAC,GAGVc,IAAYC,EAAY,YAAY;AACxC,UAAMd,EAAc;AAAA,EAAA,GACnB,CAACA,CAAa,CAAC,GAEZe,IAAUD,EAAY,YAAY;AACtC,UAAMV,EAAkB;AAAA,EAAA,GACvB,CAACA,CAAiB,CAAC;AAEf,SAAA;AAAA,IACL,MAAMK;AAAA,IACN,SAASP;AAAA,IACT,OAAAC;AAAA,IACA,aAAaF,KAAe;AAAA,IAC5B,WAAAY;AAAA,IACA,SAAAE;AAAA,EACF;AACF;"}
@@ -0,0 +1,37 @@
1
+ import { useCallback as y } from "react";
2
+ import { useQuery as d } from "../../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";
3
+ import { useShopMinisQueryClient as p } from "./queryClient.js";
4
+ function k(t, o, a, n) {
5
+ const { skip: i = !1 } = n ?? {}, s = p(), {
6
+ data: u,
7
+ error: c,
8
+ isLoading: l,
9
+ refetch: r
10
+ } = d(
11
+ {
12
+ queryKey: t,
13
+ queryFn: async () => {
14
+ const e = await o(a);
15
+ if (!e.ok)
16
+ throw e.error;
17
+ return e.data.data;
18
+ },
19
+ enabled: !i
20
+ // Caching disabled by default (handled by Apollo)
21
+ // fetchPolicy param is passed through to the action (Apollo layer)
22
+ },
23
+ s
24
+ ), f = y(async () => {
25
+ await r();
26
+ }, [r]);
27
+ return {
28
+ data: u ?? null,
29
+ loading: l,
30
+ error: c,
31
+ refetch: f
32
+ };
33
+ }
34
+ export {
35
+ k as useShopActionQuery
36
+ };
37
+ //# sourceMappingURL=useShopActionQuery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useShopActionQuery.js","sources":["../../../src/internal/reactQuery/useShopActionQuery.ts"],"sourcesContent":["import {useCallback} from 'react'\n\nimport {ShopActionResult} from '@shopify/shop-minis-platform/actions'\nimport {useQuery} from '@tanstack/react-query'\n\nimport {DataHookFetchPolicy} from '../../types'\n\nimport {useShopMinisQueryClient} from './queryClient'\n\n/**\n * Helper to use React Query with Shop Actions (non-paginated)\n * Replaces useShopActionsDataFetching\n *\n * @example\n * ```ts\n * const { data, loading, error, refetch } = useShopActionQuery(\n * ['product', id],\n * getProduct,\n * { id },\n * { skip: false }\n * )\n * ```\n */\nexport function useShopActionQuery<\n TData,\n TParams extends {fetchPolicy?: DataHookFetchPolicy},\n>(\n queryKey: unknown[],\n action: (params: TParams) => Promise<ShopActionResult<{data: TData}>>,\n params: TParams,\n options?: {\n skip?: boolean\n }\n) {\n const {skip = false} = options ?? {}\n\n // Always use our SDK's QueryClient for isolation\n const queryClient = useShopMinisQueryClient()\n\n const {\n data,\n error,\n isLoading,\n refetch: reactQueryRefetch,\n } = useQuery(\n {\n queryKey,\n queryFn: async () => {\n const result = await action(params)\n\n if (!result.ok) {\n throw result.error\n }\n\n return result.data.data\n },\n enabled: !skip,\n // Caching disabled by default (handled by Apollo)\n // fetchPolicy param is passed through to the action (Apollo layer)\n },\n queryClient\n )\n\n const refetch = useCallback(async () => {\n await reactQueryRefetch()\n }, [reactQueryRefetch])\n\n return {\n data: data ?? null,\n loading: isLoading,\n error: error as Error | null,\n refetch,\n }\n}\n"],"names":["useShopActionQuery","queryKey","action","params","options","skip","queryClient","useShopMinisQueryClient","data","error","isLoading","reactQueryRefetch","useQuery","result","refetch","useCallback"],"mappings":";;;AAuBO,SAASA,EAIdC,GACAC,GACAC,GACAC,GAGA;AACA,QAAM,EAAC,MAAAC,IAAO,GAAK,IAAID,KAAW,CAAC,GAG7BE,IAAcC,EAAwB,GAEtC;AAAA,IACJ,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAASC;AAAA,EAAA,IACPC;AAAA,IACF;AAAA,MACE,UAAAX;AAAA,MACA,SAAS,YAAY;AACb,cAAAY,IAAS,MAAMX,EAAOC,CAAM;AAE9B,YAAA,CAACU,EAAO;AACV,gBAAMA,EAAO;AAGf,eAAOA,EAAO,KAAK;AAAA,MACrB;AAAA,MACA,SAAS,CAACR;AAAA;AAAA;AAAA,IAGZ;AAAA,IACAC;AAAA,EACF,GAEMQ,IAAUC,EAAY,YAAY;AACtC,UAAMJ,EAAkB;AAAA,EAAA,GACvB,CAACA,CAAiB,CAAC;AAEf,SAAA;AAAA,IACL,MAAMH,KAAQ;AAAA,IACd,SAASE;AAAA,IACT,OAAAD;AAAA,IACA,SAAAK;AAAA,EACF;AACF;"}