@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.
- package/dist/components/MinisContainer.js +11 -10
- package/dist/components/MinisContainer.js.map +1 -1
- package/dist/components/atoms/content-wrapper.js.map +1 -1
- package/dist/components/atoms/video-player.js +28 -26
- package/dist/components/atoms/video-player.js.map +1 -1
- package/dist/components/commerce/product-card.js +106 -79
- package/dist/components/commerce/product-card.js.map +1 -1
- package/dist/components/commerce/product-link.js +124 -137
- package/dist/components/commerce/product-link.js.map +1 -1
- package/dist/components/commerce/search.js +20 -20
- package/dist/components/commerce/search.js.map +1 -1
- package/dist/components/ui/sonner.js +3 -1
- package/dist/components/ui/sonner.js.map +1 -1
- package/dist/hooks/content/useContent.js +12 -18
- package/dist/hooks/content/useContent.js.map +1 -1
- package/dist/hooks/navigation/useNavigateWithTransition.js +10 -11
- package/dist/hooks/navigation/useNavigateWithTransition.js.map +1 -1
- package/dist/hooks/product/useCuratedProducts.js +9 -11
- package/dist/hooks/product/useCuratedProducts.js.map +1 -1
- package/dist/hooks/product/usePopularProducts.js +9 -11
- package/dist/hooks/product/usePopularProducts.js.map +1 -1
- package/dist/hooks/product/useProduct.js +11 -17
- package/dist/hooks/product/useProduct.js.map +1 -1
- package/dist/hooks/product/useProductList.js +10 -21
- package/dist/hooks/product/useProductList.js.map +1 -1
- package/dist/hooks/product/useProductLists.js +11 -13
- package/dist/hooks/product/useProductLists.js.map +1 -1
- package/dist/hooks/product/useProductMedia.js +12 -18
- package/dist/hooks/product/useProductMedia.js.map +1 -1
- package/dist/hooks/product/useProductSearch.js +34 -27
- package/dist/hooks/product/useProductSearch.js.map +1 -1
- package/dist/hooks/product/useProductVariants.js +11 -14
- package/dist/hooks/product/useProductVariants.js.map +1 -1
- package/dist/hooks/product/useProducts.js +12 -11
- package/dist/hooks/product/useProducts.js.map +1 -1
- package/dist/hooks/product/useRecommendedProducts.js +11 -13
- package/dist/hooks/product/useRecommendedProducts.js.map +1 -1
- package/dist/hooks/shop/useRecommendedShops.js +11 -13
- package/dist/hooks/shop/useRecommendedShops.js.map +1 -1
- package/dist/hooks/shop/useShop.js +12 -11
- package/dist/hooks/shop/useShop.js.map +1 -1
- package/dist/hooks/user/useBuyerAttributes.js +8 -10
- package/dist/hooks/user/useBuyerAttributes.js.map +1 -1
- package/dist/hooks/user/useCurrentUser.js +7 -9
- package/dist/hooks/user/useCurrentUser.js.map +1 -1
- package/dist/hooks/user/useFollowedShops.js +11 -14
- package/dist/hooks/user/useFollowedShops.js.map +1 -1
- package/dist/hooks/user/useOrders.js +7 -9
- package/dist/hooks/user/useOrders.js.map +1 -1
- package/dist/hooks/user/useRecentProducts.js +11 -13
- package/dist/hooks/user/useRecentProducts.js.map +1 -1
- package/dist/hooks/user/useRecentShops.js +10 -13
- package/dist/hooks/user/useRecentShops.js.map +1 -1
- package/dist/hooks/user/useSavedProducts.js +10 -13
- package/dist/hooks/user/useSavedProducts.js.map +1 -1
- package/dist/index.js +269 -264
- package/dist/index.js.map +1 -1
- package/dist/internal/components/product-review-stars.js +78 -0
- package/dist/internal/components/product-review-stars.js.map +1 -0
- package/dist/internal/reactQuery/MinisQueryProvider.js +11 -0
- package/dist/internal/reactQuery/MinisQueryProvider.js.map +1 -0
- package/dist/internal/reactQuery/queryClient.js +33 -0
- package/dist/internal/reactQuery/queryClient.js.map +1 -0
- package/dist/internal/reactQuery/useShopActionInfiniteQuery.js +52 -0
- package/dist/internal/reactQuery/useShopActionInfiniteQuery.js.map +1 -0
- package/dist/internal/reactQuery/useShopActionQuery.js +37 -0
- package/dist/internal/reactQuery/useShopActionQuery.js.map +1 -0
- package/dist/mocks.js +178 -107
- package/dist/mocks.js.map +1 -1
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/package.json +2 -7
- package/src/components/MinisContainer.tsx +6 -3
- package/src/components/atoms/content-wrapper.tsx +1 -1
- package/src/components/atoms/video-player.tsx +7 -0
- package/src/components/commerce/product-card.test.tsx +135 -0
- package/src/components/commerce/product-card.tsx +39 -5
- package/src/components/commerce/product-link.test.tsx +15 -3
- package/src/components/commerce/product-link.tsx +9 -25
- package/src/components/commerce/search.tsx +2 -2
- package/src/components/index.ts +1 -0
- package/src/components/ui/sonner.tsx +2 -2
- package/src/hooks/content/useContent.ts +6 -17
- package/src/hooks/navigation/useNavigateWithTransition.test.ts +46 -7
- package/src/hooks/navigation/useNavigateWithTransition.ts +4 -1
- package/src/hooks/product/useCuratedProducts.ts +4 -6
- package/src/hooks/product/usePopularProducts.ts +4 -6
- package/src/hooks/product/useProduct.ts +6 -17
- package/src/hooks/product/useProductList.ts +4 -19
- package/src/hooks/product/useProductLists.ts +4 -6
- package/src/hooks/product/useProductMedia.ts +6 -17
- package/src/hooks/product/useProductSearch.ts +19 -15
- package/src/hooks/product/useProductVariants.ts +5 -13
- package/src/hooks/product/useProducts.ts +8 -12
- package/src/hooks/product/useRecommendedProducts.ts +4 -6
- package/src/hooks/shop/useRecommendedShops.ts +4 -6
- package/src/hooks/shop/useShop.ts +8 -12
- package/src/hooks/user/useBuyerAttributes.ts +4 -6
- package/src/hooks/user/useCurrentUser.ts +4 -6
- package/src/hooks/user/useFollowedShops.ts +5 -13
- package/src/hooks/user/useOrders.ts +4 -6
- package/src/hooks/user/useRecentProducts.ts +4 -6
- package/src/hooks/user/useRecentShops.ts +5 -13
- package/src/hooks/user/useSavedProducts.ts +5 -13
- package/src/internal/components/product-review-stars.test.tsx +90 -0
- package/src/internal/components/product-review-stars.tsx +113 -0
- package/src/internal/reactQuery/MinisQueryProvider.test.tsx +38 -0
- package/src/internal/reactQuery/MinisQueryProvider.tsx +16 -0
- package/src/internal/reactQuery/index.ts +8 -0
- package/src/internal/reactQuery/queryClient.test.tsx +91 -0
- package/src/internal/reactQuery/queryClient.ts +43 -0
- package/src/internal/reactQuery/useShopActionInfiniteQuery.test.tsx +357 -0
- package/src/internal/reactQuery/useShopActionInfiniteQuery.ts +129 -0
- package/src/internal/reactQuery/useShopActionQuery.test.tsx +184 -0
- package/src/internal/reactQuery/useShopActionQuery.ts +74 -0
- package/src/mocks.ts +10 -2
- package/src/providers/ImagePickerProvider.test.tsx +3 -9
- package/dist/internal/useShopActionsDataFetching.js +0 -79
- package/dist/internal/useShopActionsDataFetching.js.map +0 -1
- package/dist/internal/useShopActionsPaginatedDataFetching.js +0 -96
- package/dist/internal/useShopActionsPaginatedDataFetching.js.map +0 -1
- package/src/hooks/product/useProductSearch.test.ts +0 -470
- package/src/internal/useShopActionsDataFetching.test.ts +0 -465
- package/src/internal/useShopActionsDataFetching.ts +0 -150
- package/src/internal/useShopActionsPaginatedDataFetching.ts +0 -188
- package/src/stories/Accordion.stories.tsx +0 -124
- package/src/stories/AddToCart.stories.tsx +0 -251
- package/src/stories/Alert.stories.tsx +0 -38
- package/src/stories/AlertDialog.stories.tsx +0 -48
- package/src/stories/Avatar.stories.tsx +0 -29
- package/src/stories/Badge.stories.tsx +0 -46
- package/src/stories/Button.stories.tsx +0 -81
- package/src/stories/Card.stories.tsx +0 -40
- package/src/stories/Checkbox.stories.tsx +0 -44
- package/src/stories/FavoriteButton.stories.tsx +0 -58
- package/src/stories/IconButton.stories.tsx +0 -68
- package/src/stories/ImageContentWrapper.stories.tsx +0 -65
- package/src/stories/Input.stories.tsx +0 -44
- package/src/stories/Label.stories.tsx +0 -19
- package/src/stories/List.stories.tsx +0 -64
- package/src/stories/MerchantCard.stories.tsx +0 -127
- package/src/stories/ProductCard.stories.tsx +0 -92
- package/src/stories/ProductLink.stories.tsx +0 -46
- package/src/stories/ProductVariantPrice.stories.tsx +0 -70
- package/src/stories/Progress.stories.tsx +0 -30
- package/src/stories/PullToRefreshList.stories.tsx +0 -122
- package/src/stories/QuantitySelector.stories.tsx +0 -78
- package/src/stories/RadioGroup.stories.tsx +0 -51
- package/src/stories/Search.stories.tsx +0 -37
- package/src/stories/Select.stories.tsx +0 -85
- package/src/stories/Skeleton.stories.tsx +0 -19
- package/src/stories/TextInput.stories.tsx +0 -26
- package/src/stories/Toaster.stories.tsx +0 -46
- package/src/stories/Touchable.stories.tsx +0 -40
- package/src/stories/VideoPlayer.stories.tsx +0 -129
|
@@ -1,45 +1,52 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import
|
|
3
|
-
import { useShopActions as
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
6
|
-
const { getProductSearch:
|
|
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:
|
|
9
|
-
sortBy:
|
|
10
|
-
includeSensitive:
|
|
11
|
-
skip:
|
|
12
|
-
...
|
|
13
|
-
} =
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
19
|
+
h(() => (r(e), () => {
|
|
20
20
|
r.cancel();
|
|
21
21
|
}), [e, r]);
|
|
22
|
-
const { data:
|
|
23
|
-
|
|
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:
|
|
27
|
-
sortBy:
|
|
28
|
-
includeSensitive:
|
|
29
|
-
...
|
|
34
|
+
filters: o,
|
|
35
|
+
sortBy: s,
|
|
36
|
+
includeSensitive: c,
|
|
37
|
+
...u
|
|
30
38
|
},
|
|
31
39
|
{
|
|
32
|
-
skip:
|
|
33
|
-
hook: "useProductSearch"
|
|
40
|
+
skip: f || t.trim().length === 0
|
|
34
41
|
}
|
|
35
|
-
)
|
|
42
|
+
);
|
|
36
43
|
return {
|
|
37
|
-
...
|
|
38
|
-
products:
|
|
44
|
+
...l,
|
|
45
|
+
products: m,
|
|
39
46
|
isTyping: t !== e
|
|
40
47
|
};
|
|
41
48
|
};
|
|
42
49
|
export {
|
|
43
|
-
|
|
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,
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
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:
|
|
12
|
+
variants: a
|
|
16
13
|
};
|
|
17
14
|
};
|
|
18
15
|
export {
|
|
19
|
-
|
|
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 {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
...
|
|
11
|
-
products:
|
|
11
|
+
...e,
|
|
12
|
+
products: c
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
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 {
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const { getRecommendedProducts:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
...
|
|
14
|
-
products:
|
|
11
|
+
...c,
|
|
12
|
+
products: r
|
|
15
13
|
};
|
|
16
14
|
};
|
|
17
15
|
export {
|
|
18
|
-
|
|
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 {
|
|
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
|
|
2
|
-
import { useShopActions as
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
5
|
-
const { getRecommendedShops: t } =
|
|
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
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
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:
|
|
13
|
+
shops: p
|
|
16
14
|
};
|
|
17
15
|
};
|
|
18
16
|
export {
|
|
19
|
-
|
|
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 {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
...
|
|
11
|
-
shop:
|
|
11
|
+
...p,
|
|
12
|
+
shop: e
|
|
12
13
|
};
|
|
13
14
|
};
|
|
14
15
|
export {
|
|
15
|
-
|
|
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 {
|
|
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 {
|
|
3
|
-
const A = (
|
|
4
|
-
const { skip:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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:
|
|
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 {
|
|
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 {
|
|
3
|
-
const
|
|
4
|
-
const { skip:
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
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
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
hook: "useFollowedShops"
|
|
11
|
-
}
|
|
12
|
-
), p = a(() => o ?? null, [o]);
|
|
7
|
+
o,
|
|
8
|
+
{ skip: e }
|
|
9
|
+
);
|
|
13
10
|
return {
|
|
14
|
-
...
|
|
15
|
-
shops:
|
|
11
|
+
...p,
|
|
12
|
+
shops: r
|
|
16
13
|
};
|
|
17
14
|
};
|
|
18
15
|
export {
|
|
19
|
-
|
|
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 {
|
|
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
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const { skip: s, ...r } = o || {}, { getOrders: t } =
|
|
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
|
-
|
|
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 {
|
|
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 {
|
|
4
|
-
const
|
|
5
|
-
const { getRecentProducts:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
...
|
|
15
|
-
products:
|
|
12
|
+
...n,
|
|
13
|
+
products: c
|
|
16
14
|
};
|
|
17
15
|
};
|
|
18
16
|
export {
|
|
19
|
-
|
|
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 {
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
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
|
-
|
|
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:
|
|
12
|
+
shops: n
|
|
16
13
|
};
|
|
17
14
|
};
|
|
18
15
|
export {
|
|
19
|
-
|
|
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 {
|
|
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;"}
|