@jetshop/core 5.17.0-alpha.240a6034 → 5.17.0-alpha.240f9d97
Sign up to get free protection for your applications and to get access to all the features.
- package/ChannelHandler/ChannelHandler.js.map +1 -1
- package/ChannelHandler/PreserveRedirectRouteQuery.gql +4 -4
- package/ChannelHandler/redirectUtils.d.ts +1 -1
- package/ChannelHandler/redirectUtils.js +5 -3
- package/ChannelHandler/redirectUtils.js.map +1 -1
- package/ChannelHandler/redirectUtils.test.js +5 -5
- package/ChannelHandler/redirectUtilsGroupedChannels.test.js +5 -5
- package/boot/NetworkStatusNotifier.d.ts +2 -0
- package/boot/NetworkStatusNotifier.js +4 -0
- package/boot/NetworkStatusNotifier.js.map +1 -0
- package/boot/SharedTree.d.ts +1 -1
- package/boot/SharedTree.js +1 -1
- package/boot/SharedTree.js.map +1 -1
- package/boot/apollo.d.ts +1 -2
- package/boot/apollo.js +13 -8
- package/boot/apollo.js.map +1 -1
- package/boot/client/startClient.js +18 -5
- package/boot/client/startClient.js.map +1 -1
- package/boot/server/IntervalQuery.d.ts +1 -1
- package/boot/server/IntervalQuery.js +2 -2
- package/boot/server/IntervalQuery.js.map +1 -1
- package/boot/server/IntervalQuery.test.js +9 -13
- package/boot/server/PersistedApolloClient.test.js +8 -7
- package/boot/server/createApolloServer.d.ts +2 -1
- package/boot/server/createApolloServer.js +5 -5
- package/boot/server/createApolloServer.js.map +1 -1
- package/boot/server/createRenderer.js +4 -2
- package/boot/server/createRenderer.js.map +1 -1
- package/boot/server/entrypoint.js +7 -4
- package/boot/server/entrypoint.js.map +1 -1
- package/boot/server/persistedQueries/__tests__/getPersistedQueriesForRequest.test.js +1 -1
- package/boot/utils/queryLoggingMiddleware.d.ts +1 -1
- package/boot/utils/queryLoggingMiddleware.js +2 -2
- package/boot/utils/queryLoggingMiddleware.js.map +1 -1
- package/cart/AddToCartFormik.d.ts +2 -2
- package/cart/AddToCartFormik.js +2 -2
- package/cart/AddToCartFormik.js.map +1 -1
- package/cart/useAddToCart.d.ts +1 -1
- package/components/Auth/ForgotPasswordProvider.d.ts +4 -6
- package/components/Auth/ForgotPasswordProvider.js +18 -18
- package/components/Auth/ForgotPasswordProvider.js.map +1 -1
- package/components/Auth/ResetPasswordProvider.d.ts +5 -3
- package/components/Auth/ResetPasswordProvider.js +1 -1
- package/components/Auth/ResetPasswordProvider.js.map +1 -1
- package/components/Auth/SSN.js +4 -4
- package/components/Auth/SSN.js.map +1 -1
- package/components/Auth/SignupFormContainer.d.ts +2 -5
- package/components/Auth/SignupFormContainer.js.map +1 -1
- package/components/Auth/UpdatePasswordForm.js +6 -6
- package/components/Auth/UpdatePasswordForm.js.map +1 -1
- package/components/Auth/signup-context.d.ts +2 -2
- package/components/Auth/signup-context.js +2 -3
- package/components/Auth/signup-context.js.map +1 -1
- package/components/Auth/signupSubmit.js +4 -4
- package/components/Auth/signupSubmit.js.map +1 -1
- package/components/Auth/useAddressFields.js +3 -3
- package/components/Auth/useAddressFields.js.map +1 -1
- package/components/Auth/useAddressFields.test.js +10 -8
- package/components/Auth/useCustomer.d.ts +2 -2
- package/components/Auth/useCustomer.js +1 -1
- package/components/Auth/useCustomer.js.map +1 -1
- package/components/AuthContext/AuthProvider.js +2 -2
- package/components/AuthContext/AuthProvider.js.map +1 -1
- package/components/AuthContext/AuthProvider.test.js +1 -1
- package/components/AuthContext/LogOut.d.ts +2 -2
- package/components/ChannelContext/ChannelProvider.d.ts +1 -1
- package/components/ChannelContext/useCountrySettings.d.ts +1 -1
- package/components/ChannelContext/useCountrySettings.js +1 -1
- package/components/ChannelContext/useCountrySettings.js.map +1 -1
- package/components/DynamicRoute/ActiveFiltersQuery.gql +4 -4
- package/components/DynamicRoute/CategoryRoute.d.ts +3 -3
- package/components/DynamicRoute/CategoryRoute.js +6 -3
- package/components/DynamicRoute/CategoryRoute.js.map +1 -1
- package/components/DynamicRoute/ContentRoute.d.ts +1 -1
- package/components/DynamicRoute/GenericError.d.ts +18 -0
- package/components/DynamicRoute/GenericError.js +61 -0
- package/components/DynamicRoute/GenericError.js.map +1 -0
- package/components/DynamicRoute/PreviewRoute.d.ts +1 -1
- package/components/DynamicRoute/PreviewRoute.js +1 -1
- package/components/DynamicRoute/PreviewRoute.js.map +1 -1
- package/components/DynamicRoute/ProductByArticlenumber.d.ts +2 -2
- package/components/DynamicRoute/ProductByArticlenumber.js +2 -2
- package/components/DynamicRoute/ProductByArticlenumber.js.map +1 -1
- package/components/DynamicRoute/ProductRoute.d.ts +3 -3
- package/components/DynamicRoute/RouteResolver.d.ts +2 -2
- package/components/DynamicRoute/RouteResolver.js +1 -1
- package/components/DynamicRoute/RouteResolver.js.map +1 -1
- package/components/DynamicRoute/Status.d.ts +4 -3
- package/components/DynamicRoute/Status.js.map +1 -1
- package/components/DynamicRoute/index.d.ts +4 -4
- package/components/DynamicRoute/index.js +47 -42
- package/components/DynamicRoute/index.js.map +1 -1
- package/components/Filters/utils/replaceInSearch.d.ts +1 -1
- package/components/Filters/utils/replaceInSearch.js.map +1 -1
- package/components/Fonts/injectFont.js +2 -2
- package/components/Fonts/injectFont.js.map +1 -1
- package/components/Mutation/AddToCartFormik.d.ts +1 -1
- package/components/Mutation/AddToCartFormik.js +2 -2
- package/components/Mutation/AddToCartFormik.js.map +1 -1
- package/components/Mutation/DecrementQuantity.d.ts +2 -2
- package/components/Mutation/DecrementQuantity.js +1 -1
- package/components/Mutation/DecrementQuantity.js.map +1 -1
- package/components/Mutation/IncrementQuantity.d.ts +2 -2
- package/components/Mutation/IncrementQuantity.js +1 -1
- package/components/Mutation/IncrementQuantity.js.map +1 -1
- package/components/Mutation/RemoveFromCart.d.ts +2 -2
- package/components/Mutation/RemoveFromCart.js +1 -1
- package/components/Mutation/RemoveFromCart.js.map +1 -1
- package/components/Mutation/SetQuantity.d.ts +2 -2
- package/components/Mutation/SetQuantity.js +1 -1
- package/components/Mutation/SetQuantity.js.map +1 -1
- package/components/Mutation/SubscribeToNewsletter.d.ts +1 -1
- package/components/Mutation/SubscribeToNewsletter.js +1 -1
- package/components/Mutation/SubscribeToNewsletter.js.map +1 -1
- package/components/Mutation/SubscribeToStockNotifications.d.ts +1 -1
- package/components/Mutation/SubscribeToStockNotifications.js +6 -2
- package/components/Mutation/SubscribeToStockNotifications.js.map +1 -1
- package/components/Mutation/cartMutationUtils.d.ts +1 -2
- package/components/Mutation/cartMutationUtils.js.map +1 -1
- package/components/Mutation/useDecrementQuantity.d.ts +1 -1
- package/components/Mutation/useDecrementQuantity.js +1 -1
- package/components/Mutation/useDecrementQuantity.js.map +1 -1
- package/components/Mutation/useIncrementQuantity.d.ts +1 -1
- package/components/Mutation/useIncrementQuantity.js +1 -1
- package/components/Mutation/useIncrementQuantity.js.map +1 -1
- package/components/Mutation/useRemoveFromCart.d.ts +1 -1
- package/components/Mutation/useRemoveFromCart.js +1 -1
- package/components/Mutation/useRemoveFromCart.js.map +1 -1
- package/components/Mutation/useSetQuantity.d.ts +1 -1
- package/components/Mutation/useSetQuantity.js +1 -1
- package/components/Mutation/useSetQuantity.js.map +1 -1
- package/components/Notifications/Notifications.d.ts +3 -3
- package/components/Notifications/Notifications.js +2 -3
- package/components/Notifications/Notifications.js.map +1 -1
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js +6 -6
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js.map +1 -1
- package/components/Query/CartProvider.d.ts +1 -1
- package/components/Query/CartProvider.js +1 -1
- package/components/Query/CartProvider.js.map +1 -1
- package/components/SortOrder/SortOrderContainer.d.ts +1 -1
- package/components/StructuredData/StructuredBreadcrumbData.d.ts +2 -2
- package/data/cache.d.ts +1 -1
- package/data/cache.js +62 -12
- package/data/cache.js.map +1 -1
- package/global.d.ts +55 -1
- package/helpers/getErrorDetail.d.ts +1 -1
- package/helpers/getErrorDetail.js +2 -2
- package/helpers/getErrorDetail.js.map +1 -1
- package/hooks/Filters/useBooleanFilter.d.ts +1 -1
- package/hooks/Filters/useBooleanFilter.js +1 -2
- package/hooks/Filters/useBooleanFilter.js.map +1 -1
- package/hooks/Filters/useFilters.d.ts +1 -1
- package/hooks/Filters/useFilters.js +1 -2
- package/hooks/Filters/useFilters.js.map +1 -1
- package/hooks/Filters/useListFilter.d.ts +2 -2
- package/hooks/Filters/useListFilter.js +1 -2
- package/hooks/Filters/useListFilter.js.map +1 -1
- package/hooks/Filters/useMultiFilter.d.ts +3 -3
- package/hooks/Filters/useMultiFilter.js +1 -2
- package/hooks/Filters/useMultiFilter.js.map +1 -1
- package/hooks/Filters/useRangeFilter.d.ts +2 -2
- package/hooks/Filters/useRangeFilter.js +1 -2
- package/hooks/Filters/useRangeFilter.js.map +1 -1
- package/hooks/Filters/useSortOrder.d.ts +6 -1
- package/hooks/Filters/useSortOrder.js +4 -3
- package/hooks/Filters/useSortOrder.js.map +1 -1
- package/hooks/PackageProducts/usePackageProductItem.d.ts +1 -1
- package/hooks/PackageProducts/usePackageProductItem.js +1 -1
- package/hooks/PackageProducts/usePackageProductItem.js.map +1 -1
- package/hooks/PackageProducts/usePackageProducts.js +17 -17
- package/hooks/PackageProducts/usePackageProducts.js.map +1 -1
- package/hooks/PackageProducts/usePackageProducts.test.js +1 -1
- package/hooks/ProductList/ProductListContext.js +1 -1
- package/hooks/ProductList/ProductListContext.js.map +1 -1
- package/hooks/ProductList/action-creators.d.ts +1 -1
- package/hooks/ProductList/index.d.ts +1 -1
- package/hooks/ProductList/list-transforms.js +1 -1
- package/hooks/ProductList/list-transforms.js.map +1 -1
- package/hooks/ProductList/product-list-reducer.js +1 -1
- package/hooks/ProductList/product-list-reducer.js.map +1 -1
- package/hooks/ProductList/useProductList.js +1 -1
- package/hooks/ProductList/useProductList.js.map +1 -1
- package/hooks/ProductList/useProductListItems.js +1 -1
- package/hooks/ProductList/useProductListItems.js.map +1 -1
- package/hooks/Subscriptions/useNewsletterSubscription.js +3 -3
- package/hooks/Subscriptions/useNewsletterSubscription.js.map +1 -1
- package/hooks/Subscriptions/useStockNotifications.d.ts +1 -1
- package/hooks/Subscriptions/useStockNotifications.js +3 -3
- package/hooks/Subscriptions/useStockNotifications.js.map +1 -1
- package/hooks/Subscriptions/useStoreSubscriptions.d.ts +1 -1
- package/hooks/Subscriptions/useStoreSubscriptions.js +3 -6
- package/hooks/Subscriptions/useStoreSubscriptions.js.map +1 -1
- package/hooks/Subscriptions/useStoresubscriptions.test.js +5 -7
- package/hooks/useAddMultipleToCart.d.ts +1 -1
- package/hooks/useAddMultipleToCart.js +1 -1
- package/hooks/useAddMultipleToCart.js.map +1 -1
- package/hooks/useAddMultipleToCart.test.js +1 -1
- package/hooks/useCustomerOrders.test.js +7 -5
- package/hooks/useCustomerOrdersQuery.d.ts +2 -2
- package/hooks/useCustomerOrdersQuery.js +1 -1
- package/hooks/useCustomerOrdersQuery.js.map +1 -1
- package/hooks/useDeleteAccountMutation.js +3 -3
- package/hooks/useDeleteAccountMutation.js.map +1 -1
- package/hooks/useInfinitePagination.d.ts +1 -1
- package/hooks/useInfinitePagination.js +4 -1
- package/hooks/useInfinitePagination.js.map +1 -1
- package/hooks/useLoginMutation.d.ts +3 -3
- package/hooks/useLoginMutation.js +2 -2
- package/hooks/useLoginMutation.js.map +1 -1
- package/hooks/useLoginRedirect.js +2 -2
- package/hooks/useLoginRedirect.js.map +1 -1
- package/hooks/useOrderDetailQuery.d.ts +3 -3
- package/hooks/useOrderDetailQuery.js +1 -1
- package/hooks/useOrderDetailQuery.js.map +1 -1
- package/hooks/useRoutePreload.js +1 -1
- package/hooks/useRoutePreload.js.map +1 -1
- package/hooks/useStockStatus.d.ts +8 -0
- package/hooks/useStockStatus.js +26 -0
- package/hooks/useStockStatus.js.map +1 -0
- package/integrations/addwishSchemaExtension.js +3 -3
- package/integrations/addwishSchemaExtension.js.map +1 -1
- package/integrations/nostoSchemaExtension.js +2 -2
- package/integrations/nostoSchemaExtension.js.map +1 -1
- package/integrations/sluggishSchemaExtension.js +1 -1
- package/integrations/sluggishSchemaExtension.js.map +1 -1
- package/package.json +13 -29
- package/polyfills.js +0 -2
- package/polyfills.js.map +1 -1
- package/resolvers/filters/boolFilter.js +24 -27
- package/resolvers/filters/boolFilter.js.map +1 -1
- package/resolvers/filters/filterParams.js +8 -8
- package/resolvers/filters/filterParams.js.map +1 -1
- package/resolvers/filters/filters.js +5 -5
- package/resolvers/filters/filters.js.map +1 -1
- package/resolvers/filters/index.d.ts +0 -4
- package/resolvers/filters/listFilter.js +24 -29
- package/resolvers/filters/listFilter.js.map +1 -1
- package/resolvers/filters/listFilterItem.js +31 -36
- package/resolvers/filters/listFilterItem.js.map +1 -1
- package/resolvers/filters/multiListFilter.js +41 -42
- package/resolvers/filters/multiListFilter.js.map +1 -1
- package/resolvers/filters/multiListFilterList.js +1 -1
- package/resolvers/filters/multiListFilterList.js.map +1 -1
- package/resolvers/filters/rangeFilter.js +27 -43
- package/resolvers/filters/rangeFilter.js.map +1 -1
- package/test-utils/ProviderPyramid.js +1 -1
- package/types.d.ts +1820 -1955
- package/components/Fonts/GoogleFont.d.ts +0 -10
- package/components/Fonts/GoogleFont.js +0 -35
- package/components/Fonts/GoogleFont.js.map +0 -1
- package/components/Fonts/TypekitFont.d.ts +0 -16
- package/components/Fonts/TypekitFont.js +0 -25
- package/components/Fonts/TypekitFont.js.map +0 -1
@@ -1,25 +1,25 @@
|
|
1
1
|
import React, { useCallback, useState, useMemo } from 'react';
|
2
2
|
import ProductConfigurationContext from './ProductConfigurationContext';
|
3
|
-
import { useQuery } from '@apollo/
|
3
|
+
import { useQuery } from '@apollo/client';
|
4
4
|
import ConfigPrice from './ConfigPrice.gql';
|
5
|
-
import produce from 'immer';
|
5
|
+
import { produce } from 'immer';
|
6
6
|
const ProductConfigurationProvider = ({ product, children }) => {
|
7
7
|
const { configurations } = product;
|
8
|
-
const [ids, setIds] = useState(configurations.map(config => config.options[0].id));
|
8
|
+
const [ids, setIds] = useState(configurations.map((config) => config.options[0].id));
|
9
9
|
const selectOption = useCallback(function selectOption(option, config) {
|
10
10
|
const idx = configurations.indexOf(config);
|
11
|
-
setIds(curr => produce(curr, draft => {
|
11
|
+
setIds((curr) => produce(curr, (draft) => {
|
12
12
|
draft[idx] = option.id;
|
13
13
|
}));
|
14
14
|
}, [configurations]);
|
15
15
|
const getSelectedValue = useCallback(function getSelectedValue(config) {
|
16
16
|
const idx = configurations.indexOf(config);
|
17
17
|
const id = ids[idx];
|
18
|
-
return config.options.find(option => option.id === id).name;
|
18
|
+
return config.options.find((option) => option.id === id).name;
|
19
19
|
}, [configurations, ids]);
|
20
20
|
// Creating the variables for the product price query (with configs)
|
21
21
|
const priceQueryVars = useMemo(() => {
|
22
|
-
return { id: product.id, options: ids.map(id => ({ optionId: id })) };
|
22
|
+
return { id: product.id, options: ids.map((id) => ({ optionId: id })) };
|
23
23
|
}, [product.id, ids]);
|
24
24
|
const priceQuery = useQuery(ConfigPrice, {
|
25
25
|
variables: priceQueryVars,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ProductConfigurationProvider.js","sourceRoot":"","sources":["ProductConfigurationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AAQxE,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"ProductConfigurationProvider.js","sourceRoot":"","sources":["ProductConfigurationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,2BAA2B,MAAM,+BAA+B,CAAC;AAQxE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,WAAW,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,MAAM,4BAA4B,GAAG,CAAC,EACpC,OAAO,EACP,QAAQ,EAIT,EAAE,EAAE;IACH,MAAM,EAAE,cAAc,EAAE,G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CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;IAEtB,MAAM,UAAU,GAAG,QAAQ,CAGzB,WAAW,EAAE;QACb,SAAS,EAAE,cAAc;QACzB,cAAc,EAAE,IAAI;KACrB,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,OAAO,CACnB,GAAG,EAAE;;QAAC,OAAA,CAAC;YACL,cAAc;YACd,kBAAkB,EAAE,MAAA,UAAU,CAAC,IAAI,0CAAE,OAAO,CAAC,kBAAkB;YAC/D,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,YAAY;YACZ,gBAAgB;YAChB,GAAG;SACJ,CAAC,CAAA;KAAA,EACF;QACE,cAAc;QACd,UAAU,CAAC,IAAI;QACf,UAAU,CAAC,OAAO;QAClB,YAAY;QACZ,gBAAgB;QAChB,GAAG;KACJ,CACF,CAAC;IAEF,OAAO,CACL,oBAAC,2BAA2B,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAC/C,QAAQ,CAC4B,CACxC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAmC,CAAC,EAC3D,OAAO,EACP,QAAQ,EACT,EAAE,EAAE,CACH,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,EAAC,CAAC,CAAC,CAC3B,oBAAC,4BAA4B,IAAC,OAAO,EAAE,OAAO,IAC3C,QAAQ,CACoB,CAChC,CAAC,CAAC,CAAC,CACF,0CAAG,QAAQ,CAAI,CAChB,CAAC;AAEJ,eAAe,mBAAmB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CartProvider.js","sourceRoot":"","sources":["CartProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"CartProvider.js","sourceRoot":"","sources":["CartProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,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C,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEpC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC1B,CAAC"}
|
@@ -32,7 +32,7 @@ declare class SortOrderContainer extends React.Component<SortOrderContainerProps
|
|
32
32
|
constructor(props: SortOrderContainerProps);
|
33
33
|
componentDidMount(): void;
|
34
34
|
onSelect: (value: string, direction: Direction) => boolean;
|
35
|
-
render(): JSX.Element;
|
35
|
+
render(): React.JSX.Element;
|
36
36
|
}
|
37
37
|
declare const _default: React.ComponentClass<Pick<SortOrderContainerProps, "children"> & {
|
38
38
|
wrappedComponentRef?: React.Ref<SortOrderContainer>;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { Route } from '../../types';
|
2
|
+
import React from 'react';
|
3
3
|
interface Crumb {
|
4
4
|
text: string;
|
5
5
|
path: string | null;
|
@@ -8,5 +8,5 @@ declare function StructuredBreadcrumbData({ parents, breadcrumbText, breadcrumbs
|
|
8
8
|
breadcrumbs?: Crumb[];
|
9
9
|
parents?: Route[];
|
10
10
|
breadcrumbText?: string;
|
11
|
-
}): JSX.Element;
|
11
|
+
}): React.JSX.Element;
|
12
12
|
export { StructuredBreadcrumbData };
|
package/data/cache.d.ts
CHANGED
package/data/cache.js
CHANGED
@@ -1,19 +1,69 @@
|
|
1
|
-
import { InMemoryCache
|
2
|
-
import { toIdValue } from 'apollo-utilities';
|
1
|
+
import { InMemoryCache } from '@apollo/client';
|
3
2
|
import fragmentTypes from './fragmentTypes';
|
4
3
|
const createCache = () => new InMemoryCache({
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
__schema: {
|
9
|
-
types: fragmentTypes
|
10
|
-
}
|
4
|
+
possibleTypes: Object.assign({}, fragmentTypes.reduce((acc, type) => {
|
5
|
+
if (!acc[type.name]) {
|
6
|
+
acc[type.name] = type.possibleTypes.map((t) => t.name);
|
11
7
|
}
|
12
|
-
|
13
|
-
|
8
|
+
return acc;
|
9
|
+
}, {})),
|
10
|
+
typePolicies: {
|
11
|
+
Channel: {
|
12
|
+
fields: {
|
13
|
+
settings: {
|
14
|
+
merge(existing, incoming, { mergeObjects }) {
|
15
|
+
// custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects
|
16
|
+
// we do this to fix hydration mismatch on signup page
|
17
|
+
// where we query for more settings in the already queried settings (tracking)
|
18
|
+
return existing !== null && existing !== void 0 ? existing : mergeObjects(existing, incoming);
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
},
|
23
|
+
Product: {
|
24
|
+
fields: {
|
25
|
+
// Images don't have an id, so we need to merge them manually.
|
26
|
+
images: {
|
27
|
+
merge(existing, incoming, { readField, mergeObjects }) {
|
28
|
+
const merged = existing ? existing.slice(0) : [];
|
29
|
+
const imageToIndex = Object.create(null);
|
30
|
+
if (existing) {
|
31
|
+
existing.forEach((image, index) => {
|
32
|
+
imageToIndex[readField('url', image)] = index;
|
33
|
+
});
|
34
|
+
}
|
35
|
+
incoming.forEach((image) => {
|
36
|
+
const url = readField('url', image);
|
37
|
+
const index = imageToIndex[url];
|
38
|
+
if (typeof index === 'number') {
|
39
|
+
// Merge the new image data with the existing image data.
|
40
|
+
merged[index] = mergeObjects(merged[index], image);
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
// First time we've seen this image in this array.
|
44
|
+
imageToIndex[url] = merged.length;
|
45
|
+
merged.push(image);
|
46
|
+
}
|
47
|
+
});
|
48
|
+
return merged;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
}
|
52
|
+
},
|
53
|
+
// https://www.apollographql.com/docs/react/caching/advanced-topics/#cache-redirects
|
14
54
|
Query: {
|
15
|
-
|
16
|
-
|
55
|
+
fields: {
|
56
|
+
product: {
|
57
|
+
read(existing, { args, toReference }) {
|
58
|
+
return (existing !== null && existing !== void 0 ? existing : toReference({ __typename: 'Product', id: args === null || args === void 0 ? void 0 : args.id }));
|
59
|
+
}
|
60
|
+
},
|
61
|
+
category: {
|
62
|
+
read(existing, { args, toReference }) {
|
63
|
+
return (existing !== null && existing !== void 0 ? existing : toReference({ __typename: 'Category', id: args === null || args === void 0 ? void 0 : args.id }));
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
17
67
|
}
|
18
68
|
}
|
19
69
|
});
|
package/data/cache.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cache.js","sourceRoot":"","sources":["cache.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"cache.js","sourceRoot":"","sources":["cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,WAAW,GAAG,GAAG,EAAE,CACvB,IAAI,aAAa,CAAC;IAChB,aAAa,oBACR,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACpC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACnB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;SACxD;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CACP;IACD,YAAY,EAAE;QACZ,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,QAAQ,EAAE;oBACR,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,YAAY,EAAE;wBACxC,iFAAiF;wBACjF,sDAAsD;wBACtD,8EAA8E;wBAC9E,OAAO,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;oBACtD,CAAC;iBACF;aACF;SACF;QAED,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,8DAA8D;gBAC9D,MAA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AAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,EAAE,CAAC,CACjE,CAAC;oBACJ,CAAC;iBACF;gBACD,QAAQ,EAAE;oBACR,IAAI,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE;wBAClC,OAAO,CACL,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GACR,WAAW,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,EAAE,CAAC,CACtD,CAAC;oBACJ,CAAC;iBACF;aACF;SACF;KACF;CACF,CAAC,CAAC;AAEL,eAAe,WAAW,CAAC"}
|
package/global.d.ts
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
import * as ReactRouter from 'react-router';
|
2
2
|
import * as History from 'history';
|
3
|
-
|
3
|
+
import * as React from 'react';
|
4
|
+
import * as ChunkExtractor from '@loadable/server';
|
4
5
|
|
5
6
|
declare module 'format-message-generate-id';
|
6
7
|
|
8
|
+
declare module 'apollo-link' {
|
9
|
+
import { ApolloLink } from '@apollo/client';
|
10
|
+
// Fix usage of graphql-tools using older apollo-link
|
11
|
+
type ApolloLink = ApolloLink;
|
12
|
+
}
|
13
|
+
|
7
14
|
declare global {
|
8
15
|
let __IN_SERVER__: boolean;
|
9
16
|
}
|
@@ -16,7 +23,54 @@ declare module 'history' {
|
|
16
23
|
};
|
17
24
|
};
|
18
25
|
}
|
26
|
+
|
27
|
+
declare module 'react-router' {
|
28
|
+
export namespace History {
|
29
|
+
export type LocationState = {
|
30
|
+
list: any;
|
31
|
+
type: any;
|
32
|
+
};
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
declare module '@loadable/server' {
|
37
|
+
export interface ChunkExtractorManagerProps {
|
38
|
+
extractor: ChunkExtractor;
|
39
|
+
children: React.ReactNode;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
declare module 'react' {
|
44
|
+
type StatelessComponent<P = unknown> = FunctionComponent<P>;
|
45
|
+
type FC<P = unknown> = FunctionComponent<P>;
|
46
|
+
type SFC<P = unknown> = FunctionComponent<P>;
|
47
|
+
|
48
|
+
interface FunctionComponent<P = unknown> {
|
49
|
+
(props: PropsWithChildren<P>, context?: any): ReactElement<any, any> | null;
|
50
|
+
propTypes?: WeakValidationMap<P>;
|
51
|
+
contextTypes?: ValidationMap<any>;
|
52
|
+
defaultProps?: Partial<P>;
|
53
|
+
displayName?: string;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
declare module 'history' {
|
58
|
+
export type Location = {
|
59
|
+
state?: {
|
60
|
+
type: any;
|
61
|
+
list: any;
|
62
|
+
};
|
63
|
+
};
|
64
|
+
}
|
65
|
+
|
19
66
|
declare module 'react-router' {
|
67
|
+
export interface StaticRouterProps {
|
68
|
+
basename?: string | undefined;
|
69
|
+
children?: React.ReactNode;
|
70
|
+
location?: string | object | undefined;
|
71
|
+
context?: StaticRouterContext | undefined;
|
72
|
+
}
|
73
|
+
|
20
74
|
export namespace History {
|
21
75
|
export type LocationState = {
|
22
76
|
list: any;
|
@@ -2,10 +2,10 @@ export default function getErrorDetail(error) {
|
|
2
2
|
var _a;
|
3
3
|
const graphQLErrors = (_a = error === null || error === void 0 ? void 0 : error.graphQLErrors) !== null && _a !== void 0 ? _a : [];
|
4
4
|
const codes = graphQLErrors
|
5
|
-
.map(error => { var _a; return (_a = error === null || error === void 0 ? void 0 : error.extensions) === null || _a === void 0 ? void 0 : _a.code; })
|
5
|
+
.map((error) => { var _a; return (_a = error === null || error === void 0 ? void 0 : error.extensions) === null || _a === void 0 ? void 0 : _a.code; })
|
6
6
|
.filter(Boolean);
|
7
7
|
const data = graphQLErrors
|
8
|
-
.map(error => { var _a; return (_a = error === null || error === void 0 ? void 0 : error.extensions) === null || _a === void 0 ? void 0 : _a.data; })
|
8
|
+
.map((error) => { var _a; return (_a = error === null || error === void 0 ? void 0 : error.extensions) === null || _a === void 0 ? void 0 : _a.data; })
|
9
9
|
.filter(Boolean);
|
10
10
|
return { codes, data };
|
11
11
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getErrorDetail.js","sourceRoot":"","sources":["getErrorDetail.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAkB;;IACvD,MAAM,aAAa,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,mCAAI,EAAE,CAAC;IAEjD,MAAM,KAAK,GAAG,aAAa;SACxB,GAAG,CAAC,KAAK,
|
1
|
+
{"version":3,"file":"getErrorDetail.js","sourceRoot":"","sources":["getErrorDetail.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAkB;;IACvD,MAAM,aAAa,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,aAAa,mCAAI,EAAE,CAAC;IAEjD,MAAM,KAAK,GAAG,aAAa;SACxB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,WAAC,OAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,0CAAE,IAAI,CAAA,EAAA,CAAC;SACvC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEnB,MAAM,IAAI,GAAG,aAAa;SACvB,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,WAAC,OAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,0CAAE,IAAI,CAAA,EAAA,CAAC;SACvC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEnB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
@@ -4,5 +4,5 @@ export declare function useBooleanFilter(args: {
|
|
4
4
|
}): {
|
5
5
|
apply: ({ value }: {
|
6
6
|
value: boolean;
|
7
|
-
}) => Promise<import("
|
7
|
+
}) => Promise<import("@apollo/client").FetchResult<BooleanFilter, Record<string, any>, Record<string, any>>>;
|
8
8
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useBooleanFilter.js","sourceRoot":"","sources":["useBooleanFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"useBooleanFilter.js","sourceRoot":"","sources":["useBooleanFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,UAAU,gBAAgB,CAAC,IAA+B;IAC9D,MAAM,CAAC,qBAAqB,CAAC,GAAG,WAAW,CAGzC,GAAG,CAAA;;;;;;GAMJ,CAAC,CAAC;IAEH,SAAS,KAAK,CAAC,EAAE,KAAK,EAAsB;QAC1C,OAAO,qBAAqB,CAAC;YAC3B,SAAS,EAAE;gBACT,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;gBAClB,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useFilters.js","sourceRoot":"","sources":["useFilters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"useFilters.js","sourceRoot":"","sources":["useFilters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGlD,MAAM,UAAU,UAAU;IACxB,MAAM,CAAC,oBAAoB,CAAC,GAAG,WAAW,CAA8B,GAAG,CAAA;;;;GAI1E,CAAC,CAAC;IACH,SAAS,eAAe;QACtB,OAAO,oBAAoB,EAAE,CAAC;IAChC,CAAC;IAED,OAAO;QACL,eAAe;KAChB,CAAC;AACJ,CAAC"}
|
@@ -5,6 +5,6 @@ export declare function useListFilter(args: {
|
|
5
5
|
apply: ({ value, set }: {
|
6
6
|
value: string;
|
7
7
|
set?: boolean;
|
8
|
-
}) => Promise<import("
|
9
|
-
clear: () => Promise<import("
|
8
|
+
}) => Promise<import("@apollo/client").FetchResult<ListFilter, Record<string, any>, Record<string, any>>>;
|
9
|
+
clear: () => Promise<import("@apollo/client").FetchResult<any, Record<string, any>, Record<string, any>>>;
|
10
10
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useListFilter.js","sourceRoot":"","sources":["useListFilter.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useListFilter.js","sourceRoot":"","sources":["useListFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAOlD,MAAM,UAAU,aAAa,CAAC,IAA4B;IACxD,MAAM,CAAC,oBAAoB,CAAC,GAAG,WAAW,CAGxC,GAAG,CAAA;;;;;;;;;;;GAWJ,CAAC,CAAC;IAEH,MAAM,CAAC,mBAAmB,CAAC,GAAG,WAAW,CAAC,GAAG,CAAA;;;;GAI5C,CAAC,CAAC;IAEH,SAAS,KAAK;QACZ,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAE3B,OAAO,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,EAAoC;QAC7D,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,qCAAqC;QACrC,OAAO,oBAAoB,CAAC;YAC1B,SAAS,EAAE;gBACT,QAAQ,EAAE,MAAM,CAAC,EAAE;gBACnB,KAAK;gBACL,GAAG;aACJ;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC"}
|
@@ -5,9 +5,9 @@ export declare function useMultiFilter(args: {
|
|
5
5
|
apply: ({ value, listIndex }: {
|
6
6
|
value: string;
|
7
7
|
listIndex: number;
|
8
|
-
}) => Promise<import("
|
8
|
+
}) => Promise<import("@apollo/client").FetchResult<MultiListFilter, Record<string, any>, Record<string, any>>>;
|
9
9
|
clearList: ({ listIndex }: {
|
10
10
|
listIndex: number;
|
11
|
-
}) => Promise<import("
|
12
|
-
clearFilter: () => Promise<import("
|
11
|
+
}) => Promise<import("@apollo/client").FetchResult<MultiListFilter, Record<string, any>, Record<string, any>>>;
|
12
|
+
clearFilter: () => Promise<import("@apollo/client").FetchResult<MultiListFilter, Record<string, any>, Record<string, any>>>;
|
13
13
|
};
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { useMutation } from '@apollo/
|
2
|
-
import gql from 'graphql-tag';
|
1
|
+
import { useMutation, gql } from '@apollo/client';
|
3
2
|
export function useMultiFilter(args) {
|
4
3
|
const [toggleMultiListFilterItemMutation] = useMutation(gql `
|
5
4
|
mutation toggleMultiListItem {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useMultiFilter.js","sourceRoot":"","sources":["useMultiFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,
|
1
|
+
{"version":3,"file":"useMultiFilter.js","sourceRoot":"","sources":["useMultiFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AASlD,MAAM,UAAU,cAAc,CAAC,IAAiC;IAC9D,MAAM,CAAC,iCAAiC,CAAC,GAAG,WAAW,CAGrD,GAAG,CAAA;;;;;;;;;;GAUJ,CAAC,CAAC;IAEH,6CAA6C;IAC7C,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,SAAS,EAAwC;QACvE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAyB,CAAC;QAC9C,OAAO,iCAAiC,CAAC;YACvC,SAAS,EAAE;gBACT,MAAM;gBACN,SAAS;gBACT,KAAK;aACN;SACF,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,gCAAgC,CAAC,GAAG,WAAW,CAGpD,GAAG,CAAA;;;;GAIJ,CAAC,CAAC;IAEH,2CAA2C;IAC3C,SAAS,SAAS,CAAC,EAAE,SAAS,EAAyB;QACrD,OAAO,gCAAgC,CAAC;YACtC,SAAS,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;SAC9C,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,4BAA4B,CAAC,GAAG,WAAW,CAGhD,GAAG,CAAA;;;;GAIJ,CAAC,CAAC;IAEH,kDAAkD;IAClD,SAAS,WAAW;QAClB,OAAO,4BAA4B,CAAC;YAClC,SAAS,EAAE,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;SAClC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AAC3C,CAAC"}
|
@@ -5,6 +5,6 @@ export declare function useRangeFilter(args: {
|
|
5
5
|
apply: ({ min, max }: {
|
6
6
|
min: number;
|
7
7
|
max: number;
|
8
|
-
}) => Promise<import("
|
9
|
-
clear: () => Promise<import("
|
8
|
+
}) => Promise<import("@apollo/client").FetchResult<NumericRangeFilter, Record<string, any>, Record<string, any>>>;
|
9
|
+
clear: () => Promise<import("@apollo/client").FetchResult<NumericRangeFilter, Record<string, any>, Record<string, any>>>;
|
10
10
|
};
|
@@ -1,5 +1,4 @@
|
|
1
|
-
import { useMutation } from '
|
2
|
-
import gql from 'graphql-tag';
|
1
|
+
import { useMutation, gql } from '@apollo/client';
|
3
2
|
import throwErrorInDev from '../../helpers/throwErrorInDev';
|
4
3
|
export function useRangeFilter(args) {
|
5
4
|
const [applyRangeFilterMutation] = useMutation(gql `
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useRangeFilter.js","sourceRoot":"","sources":["useRangeFilter.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useRangeFilter.js","sourceRoot":"","sources":["useRangeFilter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAMlD,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAE5D,MAAM,UAAU,cAAc,CAAC,IAAoC;IACjE,MAAM,CAAC,wBAAwB,CAAC,GAAG,WAAW,CAG5C,GAAG,CAAA;;;;;;GAMJ,CAAC,CAAC;IAEH,MAAM,CAAC,wBAAwB,CAAC,GAAG,WAAW,CAG5C,GAAG,CAAA;;;;GAIJ,CAAC,CAAC;IAEH,SAAS,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,EAAgC;QACvD,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG;YACd,eAAe,CACb,IAAI,EACJ,oDAAoD,CACrD,CAAC;QACJ,OAAO,wBAAwB,CAAC;YAC9B,SAAS,EAAE;gBACT,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;gBAClB,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;aAClB;SACF,CAAC,CAAC;IACL,CAAC;IAED,SAAS,KAAK;QACZ,OAAO,wBAAwB,CAAC;YAC9B,SAAS,EAAE;gBACT,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;aACnB;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC1B,CAAC"}
|
@@ -1,5 +1,9 @@
|
|
1
1
|
import { ProductSortOrder } from '@jetshop/core/types';
|
2
|
-
|
2
|
+
interface MappedSortOrder {
|
3
|
+
direction: 'ASCENDING' | 'DESCENDING';
|
4
|
+
value: string;
|
5
|
+
text: string;
|
6
|
+
}
|
3
7
|
export declare function useSortOrder({ sortOrders }: {
|
4
8
|
sortOrders: ProductSortOrder[];
|
5
9
|
}): {
|
@@ -9,3 +13,4 @@ export declare function useSortOrder({ sortOrders }: {
|
|
9
13
|
mappedSortOrder: MappedSortOrder[];
|
10
14
|
};
|
11
15
|
export declare function getMappedSortOrder(sortOrders: ProductSortOrder[]): MappedSortOrder[];
|
16
|
+
export {};
|
@@ -12,9 +12,10 @@ export function getMappedSortOrder(sortOrders) {
|
|
12
12
|
return sortOrders.reduce((sorts, curr) => {
|
13
13
|
const mutatedSorts = sortValues[sortTypes[curr.value]].map((type) => {
|
14
14
|
return Object.assign(Object.assign({}, curr), { text: (React.createElement("span", null,
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
React.createElement(React.Fragment, null,
|
16
|
+
curr['text'],
|
17
|
+
" ",
|
18
|
+
type.text))), direction: type.direction });
|
18
19
|
});
|
19
20
|
return [...sorts, ...mutatedSorts];
|
20
21
|
}, []);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useSortOrder.js","sourceRoot":"","sources":["useSortOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACX,MAAM,uDAAuD,CAAC;AAC/D,OAAO,gBAAgB,MAAM,qDAAqD,CAAC;AAEnF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"useSortOrder.js","sourceRoot":"","sources":["useSortOrder.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACX,MAAM,uDAAuD,CAAC;AAC/D,OAAO,gBAAgB,MAAM,qDAAqD,CAAC;AAEnF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,UAAU,YAAY,CAAC,EAC3B,UAAU,EAGX;IACC,+DAA+D;IAC/D,2DAA2D;IAC3D,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,GAC7C,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACrC,MAAM,eAAe,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACvD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,UAA8B;IAE9B,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACvC,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAClE,uCACK,IAAI,KACP,IAAI,EAAE,CACJ;oBACE;wBACG,IAAI,CAAC,MAAM,CAAC;;wBAAG,IAAI,CAAC,IAAI,CACxB,CACE,CACR,EACD,SAAS,EAAE,IAAI,CAAC,SAAS,IACzB;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,YAAY,CAAC,CAAC;IACrC,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
@@ -3,7 +3,7 @@ export type UpdateItem = (articleNumber: string, variantArticleNumber: string, v
|
|
3
3
|
export declare function usePackageProductItem(item: PackageItem, updateItem: UpdateItem, { preselectCheapest }?: {
|
4
4
|
preselectCheapest?: boolean;
|
5
5
|
}): {
|
6
|
-
stockStatus: import("@jetshop/
|
6
|
+
stockStatus: import("@jetshop/core/hooks/useStockStatus").StockStatusContainerRender;
|
7
7
|
variantHandler: {
|
8
8
|
selectedVariant: import("../../types").ProductVariant;
|
9
9
|
validation: import("../useProductVariants/useProductVariants").VariantValidation;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { useProductVariants } from '../useProductVariants';
|
2
|
-
import { useStockStatus } from '@jetshop/
|
2
|
+
import { useStockStatus } from '@jetshop/core/hooks/useStockStatus';
|
3
3
|
import { useEffect } from 'react';
|
4
4
|
export function usePackageProductItem(item, updateItem, { preselectCheapest } = {}) {
|
5
5
|
var _a;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"usePackageProductItem.js","sourceRoot":"","sources":["usePackageProductItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"usePackageProductItem.js","sourceRoot":"","sources":["usePackageProductItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASlC,MAAM,UAAU,qBAAqB,CACnC,IAAiB,EACjB,UAAsB,EACtB,EACE,iBAAiB,KAGf,EAAE;;IAEN,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,cAAc,GAAG,kBAAkB,CAAC,OAAO,EAAE;QACjD,iBAAiB,EAAE,iBAAiB;KACrC,CAAC,CAAC;IACH,MAAM,iBAAiB,GAAG,cAAc,CAAC,UAAU,CAAC;IACpD,MAAM,4BAA4B,GAChC,MAAA,cAAc,CAAC,eAAe,0CAAE,aAAa,CAAC;IAChD,MAAM,WAAW,GAAG,cAAc,CAAC,cAAc,CAAC,eAAe,IAAI,OAAO,CAAC,CAAC;IAE9E,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CACR,OAAO,CAAC,aAAa,EACrB,4BAA4B,EAC5B,iBAAiB,KAAK,OAAO,CAC9B,CAAC;IACJ,CAAC,EAAE;QACD,OAAO,CAAC,aAAa;QACrB,4BAA4B;QAC5B,UAAU;QACV,cAAc,CAAC,eAAe;QAC9B,iBAAiB;KAClB,CAAC,CAAC;IAEH,OAAO;QACL,WAAW;QACX,cAAc;KACf,CAAC;AACJ,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { useApolloClient, useQuery } from '@apollo/react-hooks';
|
2
1
|
import { useMachine } from '@xstate/react';
|
3
|
-
import
|
2
|
+
import { useApolloClient, useQuery } from '@apollo/client';
|
3
|
+
import { produce } from 'immer';
|
4
4
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
5
5
|
import { assign, Machine } from 'xstate';
|
6
6
|
import { useAddMultipleToCart } from '../useAddMultipleToCart';
|
@@ -27,7 +27,7 @@ const stateMachine = Machine({
|
|
27
27
|
UPDATE_ITEM: {
|
28
28
|
actions: 'updateItems',
|
29
29
|
target: 'validating',
|
30
|
-
cond: context => Object.keys(context.items).length > 0
|
30
|
+
cond: (context) => Object.keys(context.items).length > 0
|
31
31
|
}
|
32
32
|
},
|
33
33
|
states: {
|
@@ -38,14 +38,14 @@ const stateMachine = Machine({
|
|
38
38
|
{
|
39
39
|
target: 'validating',
|
40
40
|
actions: assign({
|
41
|
-
items: context => {
|
41
|
+
items: (context) => {
|
42
42
|
return getInitialState(context.packageProduct).items;
|
43
43
|
},
|
44
|
-
price: context => {
|
44
|
+
price: (context) => {
|
45
45
|
return getInitialState(context.packageProduct).price;
|
46
46
|
}
|
47
47
|
}),
|
48
|
-
cond: context => {
|
48
|
+
cond: (context) => {
|
49
49
|
return !!context.packageProduct.package;
|
50
50
|
}
|
51
51
|
}
|
@@ -74,13 +74,13 @@ const stateMachine = Machine({
|
|
74
74
|
always: [
|
75
75
|
{
|
76
76
|
target: 'valid',
|
77
|
-
cond: context => {
|
77
|
+
cond: (context) => {
|
78
78
|
return deriveStatus(context.items) === 'valid';
|
79
79
|
}
|
80
80
|
},
|
81
81
|
{
|
82
82
|
target: 'invalid',
|
83
|
-
cond: context => {
|
83
|
+
cond: (context) => {
|
84
84
|
return deriveStatus(context.items) !== 'valid';
|
85
85
|
}
|
86
86
|
}
|
@@ -148,7 +148,7 @@ const stateMachine = Machine({
|
|
148
148
|
invoke: {
|
149
149
|
id: 'added-refetch',
|
150
150
|
src: () => {
|
151
|
-
return new Promise(resolve => {
|
151
|
+
return new Promise((resolve) => {
|
152
152
|
setTimeout(() => {
|
153
153
|
resolve(400);
|
154
154
|
}, 800);
|
@@ -183,7 +183,7 @@ const stateMachine = Machine({
|
|
183
183
|
}
|
184
184
|
}
|
185
185
|
const { articleNumber, valid, variantArticleNumber } = event;
|
186
|
-
const items = produce(context.items, draft => {
|
186
|
+
const items = produce(context.items, (draft) => {
|
187
187
|
draft[articleNumber] = Object.assign(Object.assign({}, draft[articleNumber]), { valid,
|
188
188
|
variantArticleNumber });
|
189
189
|
});
|
@@ -203,7 +203,7 @@ function getInitialState(packageProduct) {
|
|
203
203
|
hasVariants: item.product.hasVariants,
|
204
204
|
variantArticleNumber: null,
|
205
205
|
variants: item.product.hasVariants
|
206
|
-
? (_a = item.product.variants) === null || _a === void 0 ? void 0 : _a.values.map(variant => variant.articleNumber)
|
206
|
+
? (_a = item.product.variants) === null || _a === void 0 ? void 0 : _a.values.map((variant) => variant.articleNumber)
|
207
207
|
: null,
|
208
208
|
valid: !itemHasVariants(item) && !itemIsOutOfStock(item),
|
209
209
|
quantity: item.minQuantity
|
@@ -216,13 +216,13 @@ function getInitialState(packageProduct) {
|
|
216
216
|
function flattenItems(items) {
|
217
217
|
// perhaps we need the rest of the product detail?
|
218
218
|
// Or otherwise the types need to be changed
|
219
|
-
return Object.entries(items).map(entry => {
|
219
|
+
return Object.entries(items).map((entry) => {
|
220
220
|
const { articleNumber, variantArticleNumber, quantity, product } = entry[1];
|
221
221
|
return Object.assign(Object.assign({}, product), { articleNumber: variantArticleNumber || articleNumber, quantity });
|
222
222
|
});
|
223
223
|
}
|
224
224
|
function deriveStatus(packageItems) {
|
225
|
-
const packageIsValid = Object.values(packageItems).every(item => item.valid);
|
225
|
+
const packageIsValid = Object.values(packageItems).every((item) => item.valid);
|
226
226
|
if (packageIsValid) {
|
227
227
|
return 'valid';
|
228
228
|
}
|
@@ -234,7 +234,7 @@ function fetchPrice(packageArticleNumber, items, opts) {
|
|
234
234
|
query: opts.query || packagePriceQuery,
|
235
235
|
variables: {
|
236
236
|
articleNumber: packageArticleNumber,
|
237
|
-
products: Object.entries(items).map(entry => {
|
237
|
+
products: Object.entries(items).map((entry) => {
|
238
238
|
// This should be cleaned up - we have to transform to the structure
|
239
239
|
// that the API expects
|
240
240
|
const { articleNumber, variantArticleNumber } = entry[1];
|
@@ -249,7 +249,7 @@ function fetchPrice(packageArticleNumber, items, opts) {
|
|
249
249
|
})
|
250
250
|
.then(({ data }) => {
|
251
251
|
return data.product.package;
|
252
|
-
}, err => {
|
252
|
+
}, (err) => {
|
253
253
|
return Promise.reject(err.graphQLErrors);
|
254
254
|
});
|
255
255
|
}
|
@@ -267,7 +267,7 @@ export function usePackageProduct({ product, packageProductQuery, priceQuery })
|
|
267
267
|
// it. Otherwise, use the product passed in
|
268
268
|
context: { packageProduct: (data === null || data === void 0 ? void 0 : data.product) || product },
|
269
269
|
services: {
|
270
|
-
fetchPrice: context => {
|
270
|
+
fetchPrice: (context) => {
|
271
271
|
return fetchPrice(product.articleNumber, context.items, {
|
272
272
|
apolloClient: client,
|
273
273
|
query: priceQuery
|
@@ -275,7 +275,7 @@ export function usePackageProduct({ product, packageProductQuery, priceQuery })
|
|
275
275
|
},
|
276
276
|
addToCart: (_, event) => {
|
277
277
|
// eslint-disable-next-line
|
278
|
-
return addToCartMutation(event.queries).then(result => {
|
278
|
+
return addToCartMutation(event.queries).then((result) => {
|
279
279
|
if (result.errors) {
|
280
280
|
return Promise.reject(result.errors);
|
281
281
|
}
|