@shopify/shop-minis-react 0.3.4 → 0.4.1
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/_virtual/index3.js +2 -5
- package/dist/_virtual/index3.js.map +1 -1
- package/dist/_virtual/index4.js +5 -2
- package/dist/_virtual/index4.js.map +1 -1
- package/dist/components/MinisContainer.js +11 -10
- package/dist/components/MinisContainer.js.map +1 -1
- package/dist/hooks/content/useContent.js +12 -18
- package/dist/hooks/content/useContent.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/hooks/util/useImagePicker.js +13 -6
- package/dist/hooks/util/useImagePicker.js.map +1 -1
- 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/internal/utils/resizeImage.js +61 -0
- package/dist/internal/utils/resizeImage.js.map +1 -0
- package/dist/providers/ImagePickerProvider.js +123 -102
- package/dist/providers/ImagePickerProvider.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/querystringify@2.2.0/node_modules/querystringify/index.js +1 -1
- package/dist/shop-minis-react/node_modules/.pnpm/video.js@8.23.3/node_modules/video.js/dist/video.es.js +1 -1
- package/package.json +2 -7
- package/src/components/MinisContainer.tsx +6 -3
- package/src/hooks/content/useContent.ts +6 -17
- 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/hooks/util/useImagePicker.test.tsx +193 -0
- package/src/hooks/util/useImagePicker.ts +24 -5
- 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/internal/utils/resizeImage.test.ts +314 -0
- package/src/internal/utils/resizeImage.ts +108 -0
- package/src/providers/ImagePickerProvider.test.tsx +32 -1
- package/src/providers/ImagePickerProvider.tsx +108 -65
- 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,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;"}
|
|
@@ -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 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
|
-
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
hook: "useSavedProducts"
|
|
11
|
-
}
|
|
12
|
-
), n = u(() => o ?? null, [o]);
|
|
7
|
+
o,
|
|
8
|
+
{ skip: r }
|
|
9
|
+
);
|
|
13
10
|
return {
|
|
14
11
|
...c,
|
|
15
|
-
products:
|
|
12
|
+
products: e
|
|
16
13
|
};
|
|
17
14
|
};
|
|
18
15
|
export {
|
|
19
|
-
|
|
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 {
|
|
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;"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useCallback as o } from "react";
|
|
2
|
+
import { useImagePickerContext as c } from "../../providers/ImagePickerProvider.js";
|
|
3
|
+
function u() {
|
|
4
|
+
const { openCamera: t, openGallery: n } = c(), i = o(
|
|
5
|
+
async ({ cameraFacing: e, quality: a, customQuality: r } = {}) => await t({ cameraFacing: e, quality: a, customQuality: r }),
|
|
6
|
+
[t]
|
|
7
|
+
), l = o(
|
|
8
|
+
async ({ quality: e, customQuality: a } = {}) => await n({ quality: e, customQuality: a }),
|
|
9
|
+
[n]
|
|
10
|
+
);
|
|
4
11
|
return {
|
|
5
|
-
openCamera:
|
|
6
|
-
openGallery:
|
|
12
|
+
openCamera: i,
|
|
13
|
+
openGallery: l
|
|
7
14
|
};
|
|
8
15
|
}
|
|
9
16
|
export {
|
|
10
|
-
|
|
17
|
+
u as useImagePicker
|
|
11
18
|
};
|
|
12
19
|
//# sourceMappingURL=useImagePicker.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useImagePicker.js","sources":["../../../src/hooks/util/useImagePicker.ts"],"sourcesContent":["import {\n
|
|
1
|
+
{"version":3,"file":"useImagePicker.js","sources":["../../../src/hooks/util/useImagePicker.ts"],"sourcesContent":["import {useCallback} from 'react'\n\nimport {\n useImagePickerContext,\n OpenCameraParams,\n OpenGalleryParams,\n} from '../../providers/ImagePickerProvider'\n\ninterface UseImagePickerReturns {\n /**\n * Opens the camera to take a photo.\n */\n openCamera: (params?: OpenCameraParams) => Promise<File>\n /**\n * Opens the gallery to select an image.\n */\n openGallery: (params?: OpenGalleryParams) => Promise<File>\n}\n\nexport function useImagePicker(): UseImagePickerReturns {\n const {openCamera, openGallery} = useImagePickerContext()\n\n const openCameraWithQuality = useCallback(\n async ({cameraFacing, quality, customQuality}: OpenCameraParams = {}) => {\n const file = await openCamera({cameraFacing, quality, customQuality})\n return file\n },\n [openCamera]\n )\n\n const openGalleryWithQuality = useCallback(\n async ({quality, customQuality}: OpenGalleryParams = {}) => {\n const file = await openGallery({quality, customQuality})\n return file\n },\n [openGallery]\n )\n\n return {\n openCamera: openCameraWithQuality,\n openGallery: openGalleryWithQuality,\n }\n}\n"],"names":["useImagePicker","openCamera","openGallery","useImagePickerContext","openCameraWithQuality","useCallback","cameraFacing","quality","customQuality","openGalleryWithQuality"],"mappings":";;AAmBO,SAASA,IAAwC;AACtD,QAAM,EAAC,YAAAC,GAAY,aAAAC,EAAW,IAAIC,EAAsB,GAElDC,IAAwBC;AAAA,IAC5B,OAAO,EAAC,cAAAC,GAAc,SAAAC,GAAS,eAAAC,EAAa,IAAsB,CAAA,MACnD,MAAMP,EAAW,EAAC,cAAAK,GAAc,SAAAC,GAAS,eAAAC,GAAc;AAAA,IAGtE,CAACP,CAAU;AAAA,EACb,GAEMQ,IAAyBJ;AAAA,IAC7B,OAAO,EAAC,SAAAE,GAAS,eAAAC,EAAa,IAAuB,OACtC,MAAMN,EAAY,EAAC,SAAAK,GAAS,eAAAC,GAAc;AAAA,IAGzD,CAACN,CAAW;AAAA,EACd;AAEO,SAAA;AAAA,IACL,YAAYE;AAAA,IACZ,aAAaK;AAAA,EACf;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;"}
|