@jetshop/core 5.17.0-alpha.18426899 → 5.17.0-alpha.1fa8c1a3
Sign up to get free protection for your applications and to get access to all the features.
- package/boot/NetworkStatusNotifier.d.ts +2 -0
- package/boot/NetworkStatusNotifier.js +4 -0
- package/boot/NetworkStatusNotifier.js.map +1 -0
- package/boot/apollo.js +1 -1
- package/boot/apollo.js.map +1 -1
- package/boot/client/startClient.js +10 -3
- package/boot/client/startClient.js.map +1 -1
- package/cart/AddToCartFormik.d.ts +1 -1
- package/cart/AddToCartFormik.js +1 -1
- package/cart/AddToCartFormik.js.map +1 -1
- package/components/Auth/ForgotPasswordProvider.d.ts +2 -4
- package/components/Auth/ForgotPasswordProvider.js +17 -17
- package/components/Auth/ForgotPasswordProvider.js.map +1 -1
- package/components/Auth/ResetPasswordProvider.d.ts +1 -1
- package/components/Auth/SignupFormContainer.d.ts +2 -5
- package/components/Auth/SignupFormContainer.js.map +1 -1
- package/components/AuthContext/LogOut.d.ts +2 -2
- package/components/ChannelContext/ChannelProvider.d.ts +1 -1
- package/components/DynamicRoute/CategoryRoute.d.ts +2 -2
- 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/ProductByArticlenumber.d.ts +2 -2
- package/components/DynamicRoute/ProductRoute.d.ts +2 -2
- package/components/DynamicRoute/RouteResolver.d.ts +1 -1
- package/components/DynamicRoute/RouteResolver.js +1 -1
- package/components/DynamicRoute/RouteResolver.js.map +1 -1
- package/components/DynamicRoute/Status.d.ts +3 -2
- package/components/DynamicRoute/Status.js.map +1 -1
- package/components/DynamicRoute/index.d.ts +4 -4
- package/components/DynamicRoute/index.js +41 -37
- 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 +1 -1
- package/components/Mutation/AddToCartFormik.js.map +1 -1
- package/components/Mutation/DecrementQuantity.d.ts +2 -2
- package/components/Mutation/IncrementQuantity.d.ts +2 -2
- package/components/Mutation/RemoveFromCart.d.ts +2 -2
- package/components/Mutation/SetQuantity.d.ts +2 -2
- 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 +5 -5
- package/components/ProductConfigurationProvider/ProductConfigurationProvider.js.map +1 -1
- package/components/SortOrder/SortOrderContainer.d.ts +1 -1
- package/components/StructuredData/StructuredBreadcrumbData.d.ts +2 -2
- package/data/fragments/StockStatusFragment.gql +0 -1
- package/global.d.ts +49 -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 +16 -16
- package/hooks/PackageProducts/usePackageProducts.js.map +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/useStockStatus.d.ts +8 -0
- package/hooks/useStockStatus.js +26 -0
- package/hooks/useStockStatus.js.map +1 -0
- package/package.json +6 -6
- package/polyfills.js +0 -2
- package/polyfills.js.map +1 -1
- package/resolvers/filters/boolFilter.js +5 -4
- package/resolvers/filters/boolFilter.js.map +1 -1
- package/resolvers/filters/listFilter.js +5 -5
- package/resolvers/filters/listFilter.js.map +1 -1
- package/resolvers/filters/listFilterItem.js +11 -10
- package/resolvers/filters/listFilterItem.js.map +1 -1
- package/resolvers/filters/multiListFilter.js +20 -18
- package/resolvers/filters/multiListFilter.js.map +1 -1
- package/resolvers/filters/rangeFilter.js +9 -9
- package/resolvers/filters/rangeFilter.js.map +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"NetworkStatusNotifier.js","sourceRoot":"","sources":["NetworkStatusNotifier.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,GAAG,2BAA2B,EAAE,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC"}
|
package/boot/apollo.js
CHANGED
@@ -21,7 +21,7 @@ import report from '../errorReporting';
|
|
21
21
|
import { resolvers } from '../resolvers';
|
22
22
|
import typeDefs from './client-schema.gql';
|
23
23
|
import { logOperationTime } from './utils/queryLoggingMiddleware';
|
24
|
-
import { link as networkStatusLink } from '@jetshop/
|
24
|
+
import { link as networkStatusLink } from '@jetshop/core/boot/NetworkStatusNotifier';
|
25
25
|
export const createClient = ({ apolloConfig: { token, shopid, enableGateway, graphQLURI, useGraphQLProxyServer }, schema, authHandler, previewHandler, req, channelHandler }) => {
|
26
26
|
if (!token || !shopid) {
|
27
27
|
throw new Error(`Missing ${!token && `token`} ${!shopid && `shopid`}`);
|
package/boot/apollo.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"apollo.js","sourceRoot":"","sources":["apollo.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,w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,EAAE,aAAa;YAClB,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,KAAK,CAAC,OAAO,CAAE,MAAc,CAAC,gBAAgB,CAAC;QACnD,OAAO,EAAE,CAAC,CAAC,aAAa;QACxB,SAAS,EAAE,SAAS,CAClB,EAAE,CAAC,SAAS,CAAC,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CACnE;QACD,QAAQ;KACT,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC,CAAC"}
|
@@ -11,7 +11,7 @@ import { setupIntl } from '@jetshop/intl/config';
|
|
11
11
|
import * as Sentry from '../../sentry/client';
|
12
12
|
import React from 'react';
|
13
13
|
import { Cookies } from 'react-cookie';
|
14
|
-
import {
|
14
|
+
import { hydrateRoot } from 'react-dom/client';
|
15
15
|
import { loadableReady } from '@loadable/component';
|
16
16
|
import { BrowserRouter } from 'react-router-dom';
|
17
17
|
import { ChannelHandler } from '../../ChannelHandler/ChannelHandler';
|
@@ -37,6 +37,7 @@ function getInitialCacheData() {
|
|
37
37
|
}
|
38
38
|
};
|
39
39
|
}
|
40
|
+
let root;
|
40
41
|
const startClient = (tree, config) => {
|
41
42
|
if (!config.apolloConfig.channelsQuery) {
|
42
43
|
logWarningInDev(true, `No channelsQuery was provided in the apolloConfig, which is a
|
@@ -125,8 +126,14 @@ const startClient = (tree, config) => {
|
|
125
126
|
})
|
126
127
|
.then((tree) => {
|
127
128
|
return loadableReady(() => {
|
128
|
-
|
129
|
-
|
129
|
+
if (root) {
|
130
|
+
// If the root is already set,
|
131
|
+
// we know that we are in a hot reload and we want to render the new tree into the existing root.
|
132
|
+
root.render(tree);
|
133
|
+
}
|
134
|
+
else {
|
135
|
+
root = hydrateRoot(document.getElementById('root'), tree);
|
136
|
+
}
|
130
137
|
});
|
131
138
|
});
|
132
139
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"startClient.js","sourceRoot":"","sources":["startClient.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"startClient.js","sourceRoot":"","sources":["startClient.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,gCAAgC,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAErE,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,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,CAAC;IACL,CAAC,CAAC;SACD,IAAI,CAAC,CAAC,IAAkB,EAAE,EAAE;QAC3B,OAAO,aAAa,CAAC,GAAG,EAAE;YACxB,IAAI,IAAI,EAAE;gBACR,8BAA8B;gBAC9B,iGAAiG;gBACjG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;aACnB;iBAAM;gBACL,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;aAC3D;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,IAAI,GAAG,CAAC,IAAkB,EAAE,MAAmB,EAAE,EAAE;IACvD,2HAA2H;IAC3H,IAAK,MAAc,CAAC,eAAe,EAAE;QACnC,OAAO,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAClC;SAAM;QACL,2KAA2K;QAC1K,MAAc,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;KAC5D;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
@@ -38,5 +38,5 @@ interface AddToCartFormikProps {
|
|
38
38
|
}) => void;
|
39
39
|
children: (props: FormikProps<AddToCartFormikValues>) => React.ReactNode;
|
40
40
|
}
|
41
|
-
export declare function AddToCartFormik({ product, variant, commentValidators, getMissingOptions, initialValues, onAddToCartInit, onAddToCartError, onAddToCartSuccess, cartQuery, cartMutation, children }: AddToCartFormikProps): JSX.Element;
|
41
|
+
export declare function AddToCartFormik({ product, variant, commentValidators, getMissingOptions, initialValues, onAddToCartInit, onAddToCartError, onAddToCartSuccess, cartQuery, cartMutation, children }: AddToCartFormikProps): React.JSX.Element;
|
42
42
|
export default AddToCartFormik;
|
package/cart/AddToCartFormik.js
CHANGED
@@ -12,7 +12,7 @@ import { useAddToCart } from './useAddToCart';
|
|
12
12
|
import { FormikProvider } from 'formik';
|
13
13
|
import { useApolloClient, useMutation } from '@apollo/react-hooks';
|
14
14
|
import { addToCartError, addToCartSuccess, useTrackProductAdd } from '../components/Mutation/AddToCart/addToCartUtils';
|
15
|
-
import
|
15
|
+
import uniqueId from '@jetshop/core/helpers/uniqueId';
|
16
16
|
import { getAddToCartOptimisticResponse } from '../components/Mutation/cartMutationUtils';
|
17
17
|
import { useCartId } from '../components/Cart/CartIdContext';
|
18
18
|
export function AddToCartFormik({ product, variant, commentValidators = {}, getMissingOptions, initialValues,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AddToCartFormik.js","sourceRoot":"","sources":["AddToCartFormik.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAmB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAe,MAAM,QAAQ,CAAC;AAWrD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,iDAAiD,CAAC;AACzD,OAAO,
|
1
|
+
{"version":3,"file":"AddToCartFormik.js","sourceRoot":"","sources":["AddToCartFormik.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAmB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAe,MAAM,QAAQ,CAAC;AAWrD,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,iDAAiD,CAAC;AACzD,OAAO,QAAQ,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC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ACF;aACF,CAAC;iBACC,IAAI,CACH,gBAAgB,CAAC;gBACf,kBAAkB;gBAClB,eAAe;gBACf,MAAM;gBACN,SAAS;aACV,CAAC,CACH;iBACA,KAAK,CACJ,cAAc,CAAC;gBACb,gBAAgB;gBAChB,eAAe;aAChB,CAAC,CACH,CAAC;QACN,CAAC;KAAA;IAED,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,CAAC;QAC5B,OAAO;QACP,OAAO;QACP,iBAAiB;QACjB,iBAAiB;QACjB,aAAa;QACb,MAAM;KACP,CAAC,CAAC;IAEH,OAAO,oBAAC,cAAc,IAAC,KAAK,EAAE,IAAI,IAAG,QAAQ,CAAC,IAAI,CAAC,CAAkB,CAAC;AACxE,CAAC;AAED,eAAe,eAAe,CAAC"}
|
@@ -3,11 +3,8 @@ import { FormikProps } from 'formik';
|
|
3
3
|
import React from 'react';
|
4
4
|
type ForgotPasswordFormik = FormikProps<MutationRequestPasswordResetArgs>;
|
5
5
|
interface ForgotPasswordProps {
|
6
|
-
children
|
7
|
-
formik: ForgotPasswordFormik;
|
8
|
-
}): React.ReactChild;
|
6
|
+
children: any;
|
9
7
|
}
|
10
|
-
export declare function ForgotPasswordProvider(props: ForgotPasswordProps): JSX.Element;
|
11
8
|
export declare const ForgotPasswordContext: React.Context<{
|
12
9
|
formik: ForgotPasswordFormik;
|
13
10
|
}>;
|
@@ -68,4 +65,5 @@ export declare function useForgotPasswordData(): {
|
|
68
65
|
required: boolean;
|
69
66
|
};
|
70
67
|
};
|
68
|
+
export declare function ForgotPasswordProvider(props: ForgotPasswordProps): React.JSX.Element;
|
71
69
|
export {};
|
@@ -3,8 +3,23 @@ import t from '@jetshop/intl';
|
|
3
3
|
import { Form, Formik } from 'formik';
|
4
4
|
import React from 'react';
|
5
5
|
import { useMutation } from '@apollo/react-hooks';
|
6
|
+
export const ForgotPasswordContext = React.createContext(undefined);
|
7
|
+
export function useForgotPasswordData() {
|
8
|
+
var _a, _b;
|
9
|
+
const { formik } = React.useContext(ForgotPasswordContext);
|
10
|
+
const submitted = (_a = formik === null || formik === void 0 ? void 0 : formik.status) === null || _a === void 0 ? void 0 : _a.success;
|
11
|
+
const globalError = (_b = formik === null || formik === void 0 ? void 0 : formik.status) === null || _b === void 0 ? void 0 : _b.globalError;
|
12
|
+
const emailInputProps = {
|
13
|
+
type: 'email',
|
14
|
+
name: 'email',
|
15
|
+
required: true
|
16
|
+
};
|
17
|
+
return Object.assign({ submitted,
|
18
|
+
globalError,
|
19
|
+
emailInputProps }, formik);
|
20
|
+
}
|
6
21
|
function validate(values) {
|
7
|
-
|
22
|
+
const errors = {};
|
8
23
|
if (!values.email) {
|
9
24
|
errors['email'] = t('This field is required');
|
10
25
|
}
|
@@ -15,7 +30,7 @@ function validate(values) {
|
|
15
30
|
}
|
16
31
|
function handleMutationError(actions) {
|
17
32
|
actions.setStatus({
|
18
|
-
globalError: t('Something went wrong. Please check your input, or try again later.')
|
33
|
+
globalError: t('Something went wrong. Please check your input, or try again later.')
|
19
34
|
});
|
20
35
|
actions.setSubmitting(false);
|
21
36
|
}
|
@@ -39,19 +54,4 @@ export function ForgotPasswordProvider(props) {
|
|
39
54
|
} }, (formik) => (React.createElement(Form, null,
|
40
55
|
React.createElement(ForgotPasswordContext.Provider, Object.assign({ value: { formik } }, props))))));
|
41
56
|
}
|
42
|
-
export const ForgotPasswordContext = React.createContext(undefined);
|
43
|
-
export function useForgotPasswordData() {
|
44
|
-
var _a, _b;
|
45
|
-
const { formik } = React.useContext(ForgotPasswordContext);
|
46
|
-
const submitted = (_a = formik === null || formik === void 0 ? void 0 : formik.status) === null || _a === void 0 ? void 0 : _a.success;
|
47
|
-
const globalError = (_b = formik === null || formik === void 0 ? void 0 : formik.status) === null || _b === void 0 ? void 0 : _b.globalError;
|
48
|
-
const emailInputProps = {
|
49
|
-
type: 'email',
|
50
|
-
name: 'email',
|
51
|
-
required: true,
|
52
|
-
};
|
53
|
-
return Object.assign({ submitted,
|
54
|
-
globalError,
|
55
|
-
emailInputProps }, formik);
|
56
|
-
}
|
57
57
|
//# sourceMappingURL=ForgotPasswordProvider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ForgotPasswordProvider.js","sourceRoot":"","sources":["ForgotPasswordProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AAKjF,OAAO,CAAC,MAAM,eAAe,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,EAA8B,MAAM,QAAQ,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAQlD,SAAS,QAAQ,CAAC,MAAyB;IACzC,
|
1
|
+
{"version":3,"file":"ForgotPasswordProvider.js","sourceRoot":"","sources":["ForgotPasswordProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAC;AAKjF,OAAO,CAAC,MAAM,eAAe,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,EAA8B,MAAM,QAAQ,CAAC;AAClE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAQlD,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC,aAAa,CAErD,SAAS,CAAC,CAAC;AAEd,MAAM,UAAU,qBAAqB;;IACnC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAE3D,MAAM,SAAS,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,OAAO,CAAC;IAC1C,MAAM,WAAW,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,WAAW,CAAC;IAEhD,MAAM,eAAe,GAAG;QACtB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,OAA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I,EAAE,CAAC,CAAC;oBACrC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;iBAC9B;qBAAM;oBACL,mBAAmB,CAAC,OAAO,CAAC,CAAC;iBAC9B;YACH,CAAC,CAAC;iBACD,KAAK,CAAC,GAAG,EAAE;gBACV,mBAAmB,CAAC,OAAO,CAAC,CAAC;YAC/B,CAAC,CAAC,CAAC;QACP,CAAC,IAEA,CAAC,MAAM,EAAE,EAAE,CAAC,CACX,oBAAC,IAAI;QACH,oBAAC,qBAAqB,CAAC,QAAQ,kBAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAM,KAAK,EAAI,CAC3D,CACR,CACM,CACV,CAAC;AACJ,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
export declare const ResetPasswordProvider: React.ComponentClass<Pick<
|
2
|
+
export declare const ResetPasswordProvider: React.ComponentClass<Pick<any, string | number | symbol>, any> & import("react-router").WithRouterStatics<(props: any) => React.JSX.Element>;
|
3
3
|
export declare function useResetPasswordForm(): {
|
4
4
|
passwordInputProps: {
|
5
5
|
required: boolean;
|
@@ -1,19 +1,16 @@
|
|
1
1
|
import { SignUpInput, MaskedProperty } from '@jetshop/core/types';
|
2
|
-
import { FormikProps } from 'formik';
|
3
2
|
import React from 'react';
|
4
3
|
import { SignUpFormInput } from './formatSignupInput';
|
5
4
|
type LookupData = {
|
6
5
|
[key: string]: MaskedProperty;
|
7
6
|
};
|
8
7
|
interface SignupFormProps {
|
9
|
-
children
|
10
|
-
formik: FormikProps<SignUpInput>;
|
11
|
-
}): React.ReactChild;
|
8
|
+
children: any;
|
12
9
|
lookupData: LookupData;
|
13
10
|
additionalFormatter?: (values: SignUpFormInput) => SignUpInput;
|
14
11
|
additionalInitialValues?: Partial<SignUpFormInput>;
|
15
12
|
}
|
16
13
|
declare function SignupFormProvider({ LoadingComponent, ...props }: SignupFormProps & {
|
17
14
|
LoadingComponent?: JSX.Element;
|
18
|
-
}): JSX.Element;
|
15
|
+
}): React.JSX.Element;
|
19
16
|
export default SignupFormProvider;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SignupFormContainer.js","sourceRoot":"","sources":["SignupFormContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"SignupFormContainer.js","sourceRoot":"","sources":["SignupFormContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,cAAc,EAAE,EACrB,aAAa,EACb,mBAAmB,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAejD,uEAAuE;AACvE,4CAA4C;AAC5C,SAAS,qBAAqB,CAC5B,MAAuB,EACvB,UAAsB;IAEtB,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,IAAI,UAAU,EAAE;QACd,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;;YACvB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,KAAK,CAAC,IAAI,CAAC,0CAAE,MAAM,CAAC;QACxD,CAAC,CAAC,CAAC;KACJ;SAAM;QACL,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACvB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,gBAAgB,CACvB,YAA6B,EAC7B,UAAsB;IAEtB,IAAI,CAAC,UAAU,EAAE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uBAAL,KAAK,CAAE,uBAAuB;QAC9B,eAAe,CAAC,IAAI;KACrB,CAAC,CAAC;IAEH,OAAO,CACL,oBAAC,MAAM,IACL,kBAAkB,EAAE,IAAI,EACxB,gBAAgB,QAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE;YAC5B,YAAY,CAAC;gBACX,MAAM,EAAE,gBAAgB,CACtB,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,EAC1D,KAAK,CAAC,UAAU,CACjB;gBACD,OAAO;aACR,CAAC,CAAC;QACL,CAAC,EACD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,IAE3B,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,CAChC,CACV,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,SAAS,kBAAkB,CAAC,EAG2B;QAH3B,EAC1B,gBAAgB,OAEqC,EADlD,KAAK,cAFkB,oBAG3B,CADS;IAER,OAAO,CACL,oBAAC,cAAc,IAAC,gBAAgB,EAAE,gBAAgB;QAChD,oBAAC,UAAU,oBAAK,KAAK,GAClB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CACf,oBAAC,IAAI;YACH,oBAAC,mBAAmB,CAAC,QAAQ,kBAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAM,KAAK,EAAI,CACzD,CACR,CACU,CACE,CAClB,CAAC;AACJ,CAAC;AAED,eAAe,kBAAkB,CAAC"}
|
@@ -6,5 +6,5 @@ export interface ChannelProviderProps {
|
|
6
6
|
children?: React.ReactNode;
|
7
7
|
config: BootOptions;
|
8
8
|
}
|
9
|
-
declare const ChannelProvider: ({ channelHandler, children, config }: ChannelProviderProps) => JSX.Element;
|
9
|
+
declare const ChannelProvider: ({ channelHandler, children, config }: ChannelProviderProps) => React.JSX.Element;
|
10
10
|
export default ChannelProvider;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Category } from '@jetshop/core/types';
|
2
|
-
import { ComponentType } from 'react';
|
2
|
+
import React, { ComponentType } from 'react';
|
3
3
|
import { QueryResult } from 'react-apollo';
|
4
4
|
export interface CategoryProps {
|
5
5
|
result: QueryResult;
|
@@ -9,5 +9,5 @@ export interface CategoryRouteProps {
|
|
9
9
|
component: ComponentType<CategoryProps>;
|
10
10
|
result: QueryResult;
|
11
11
|
}
|
12
|
-
declare const CategoryRoute: (props: CategoryRouteProps) => JSX.Element;
|
12
|
+
declare const CategoryRoute: (props: CategoryRouteProps) => React.JSX.Element;
|
13
13
|
export default CategoryRoute;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
export interface BoundaryErrorState {
|
3
|
+
error?: Error;
|
4
|
+
info?: React.ErrorInfo;
|
5
|
+
}
|
6
|
+
export interface BoundaryErrorProps {
|
7
|
+
component?: React.FC<BoundaryErrorState>;
|
8
|
+
extraInfo?: any;
|
9
|
+
children: React.ReactNode;
|
10
|
+
}
|
11
|
+
export declare const DefaultError: ({ error, info }: BoundaryErrorState) => React.JSX.Element;
|
12
|
+
declare class ErrorBoundary extends React.Component<BoundaryErrorProps, BoundaryErrorState> {
|
13
|
+
state: BoundaryErrorState;
|
14
|
+
static defaultProps: Partial<BoundaryErrorProps>;
|
15
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
16
|
+
render(): string | number | boolean | React.JSX.Element | React.ReactFragment;
|
17
|
+
}
|
18
|
+
export default ErrorBoundary;
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import report from '@jetshop/core/errorReporting';
|
3
|
+
export const DefaultError = ({ error, info }) => (React.createElement("section", { style: {
|
4
|
+
width: '57ch',
|
5
|
+
maxWidth: '100%',
|
6
|
+
margin: '4rem auto',
|
7
|
+
padding: '1rem'
|
8
|
+
} },
|
9
|
+
React.createElement("h1", { style: {
|
10
|
+
fontSize: '1.5rem',
|
11
|
+
marginBottom: '2rem'
|
12
|
+
} }, "Something went wrong!"),
|
13
|
+
React.createElement("p", null, "Sorry! Our developers have been notified."),
|
14
|
+
React.createElement("div", null,
|
15
|
+
React.createElement("a", { href: "/", style: {
|
16
|
+
display: 'inline-block',
|
17
|
+
margin: '1rem 0 3rem 0',
|
18
|
+
borderRadius: '3px',
|
19
|
+
padding: '0.5rem',
|
20
|
+
textDecoration: 'none',
|
21
|
+
fontWeight: 600,
|
22
|
+
background: '#e2e2e2',
|
23
|
+
border: '1px solid #c3c3c3',
|
24
|
+
color: '#000'
|
25
|
+
} }, "Go back to the start page")),
|
26
|
+
process.env.NODE_ENV !== 'production' && (React.createElement("div", null,
|
27
|
+
error && React.createElement("p", null,
|
28
|
+
"Error: ",
|
29
|
+
error.message),
|
30
|
+
info && (React.createElement("pre", { style: {
|
31
|
+
fontSize: '0.875rem',
|
32
|
+
lineHeight: 1.5,
|
33
|
+
color: '#585858'
|
34
|
+
} }, info.componentStack))))));
|
35
|
+
class ErrorBoundary extends React.Component {
|
36
|
+
constructor() {
|
37
|
+
super(...arguments);
|
38
|
+
this.state = {
|
39
|
+
error: undefined,
|
40
|
+
info: undefined
|
41
|
+
};
|
42
|
+
}
|
43
|
+
componentDidCatch(error, info) {
|
44
|
+
const { extraInfo = {} } = this.props;
|
45
|
+
// Report to Sentry
|
46
|
+
report(error, Object.assign(Object.assign({}, extraInfo), { reactInfo: info }));
|
47
|
+
this.setState({ error, info });
|
48
|
+
}
|
49
|
+
render() {
|
50
|
+
const Comp = this.props.component;
|
51
|
+
if (!this.state.error) {
|
52
|
+
return this.props.children;
|
53
|
+
}
|
54
|
+
return React.createElement(Comp, Object.assign({}, this.state));
|
55
|
+
}
|
56
|
+
}
|
57
|
+
ErrorBoundary.defaultProps = {
|
58
|
+
component: DefaultError
|
59
|
+
};
|
60
|
+
export default ErrorBoundary;
|
61
|
+
//# sourceMappingURL=GenericError.js.map
|
@@ -0,0 +1 @@
|
|
1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,IAAqB;QACnD,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QACtC,mBAAmB;QACnB,MAAM,CAAC,KAAK,kCAAO,SAAS,KAAE,SAAS,EAAE,IAAI,IAAG,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,MAAM;QACJ,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,SAAyC,CAAC;QAElE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;YACrB,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;SAC5B;QAED,OAAO,oBAAC,IAAI,oBAAK,IAAI,CAAC,KAAK,EAAI,CAAC;IAClC,CAAC;;AAnBM,0BAAY,GAAgC;IACjD,SAAS,EAAE,YAAY;CACxB,CAAC;AAoBJ,eAAe,aAAa,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Product } from '@jetshop/core/types';
|
2
|
-
import { ComponentType } from 'react';
|
2
|
+
import React, { ComponentType } from 'react';
|
3
3
|
import { QueryResult } from 'react-apollo';
|
4
4
|
export interface ProductProps {
|
5
5
|
result: QueryResult;
|
@@ -11,5 +11,5 @@ export interface ProductRouteProps {
|
|
11
11
|
result: QueryResult;
|
12
12
|
partialProduct?: Partial<Product>;
|
13
13
|
}
|
14
|
-
declare const ProductRoute: (props: ProductRouteProps) => JSX.Element;
|
14
|
+
declare const ProductRoute: (props: ProductRouteProps) => React.JSX.Element;
|
15
15
|
export default ProductRoute;
|
@@ -5,7 +5,7 @@ import ContentRoute from './ContentRoute';
|
|
5
5
|
import Status from './Status';
|
6
6
|
import { Redirect } from 'react-router';
|
7
7
|
import { setPageType } from '../../analytics/webVitals';
|
8
|
-
import { DefaultError } from '@jetshop/
|
8
|
+
import { DefaultError } from '@jetshop/core/components/DynamicRoute/GenericError';
|
9
9
|
const isRouteType = (state, result, type) => {
|
10
10
|
var _a, _b, _c;
|
11
11
|
if (result.error) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RouteResolver.js","sourceRoot":"","sources":["RouteResolver.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,YAA8B,MAAM,gBAAgB,CAAC;AAC5D,OAAO,aAAgC,MAAM,iBAAiB,CAAC;AAC/D,OAAO,YAA8B,MAAM,gBAAgB,CAAC;AAE5D,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"RouteResolver.js","sourceRoot":"","sources":["RouteResolver.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,YAA8B,MAAM,gBAAgB,CAAC;AAC5D,OAAO,aAAgC,MAAM,iBAAiB,CAAC;AAC/D,OAAO,YAA8B,MAAM,gBAAgB,CAAC;AAE5D,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAC;AAElF,MAAM,WAAW,GAAG,CAAC,KAAU,EAAE,MAAmB,EAAE,IAAY,EAAE,EAAE;;IACpE,IAAI,MAAM,CAAC,KAAK,EAAE;QAChB,OAAO,KAAK,CAAC;KACd;IACD,MAAM,SAAS,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,CAAC;IAC9B,MAAM,SAAS,GAAG,MAAA,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,0CAAE,KAAK,0CAAE,MAAM,0C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;QAED,OAAO,CACL,oBAAC,MAAM,IAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IACnC,SAAS,CAAC,CAAC,CAAC,CACX,oBAAC,SAAS,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAI,CACnC,CAAC,CAAC,CAAC,CACF,oBAAC,YAAY,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAI,CACtC,CACM,CACV,CAAC;KACH;AACH,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
@@ -4,11 +4,12 @@ import { ApolloError } from 'apollo-client';
|
|
4
4
|
export interface StatusProps extends RouteComponentProps<{}> {
|
5
5
|
code: number;
|
6
6
|
error?: ApolloError;
|
7
|
+
children?: React.ReactNode;
|
7
8
|
}
|
8
9
|
declare class Status extends React.Component<StatusProps, any> {
|
9
|
-
render(): JSX.Element;
|
10
|
+
render(): React.JSX.Element;
|
10
11
|
}
|
11
|
-
declare const _default: React.ComponentClass<Pick<StatusProps, "code" | "error"> & {
|
12
|
+
declare const _default: React.ComponentClass<Pick<StatusProps, "children" | "code" | "error"> & {
|
12
13
|
wrappedComponentRef?: React.Ref<Status>;
|
13
14
|
}, any> & import("react-router").WithRouterStatics<typeof Status>;
|
14
15
|
export default _default;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Status.js","sourceRoot":"","sources":["Status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAuB,MAAM,kBAAkB,CAAC;AAEnE,OAAO,IAAI,MAAM,SAAS,CAAC;
|
1
|
+
{"version":3,"file":"Status.js","sourceRoot":"","sources":["Status.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAuB,MAAM,kBAAkB,CAAC;AAEnE,OAAO,IAAI,MAAM,SAAS,CAAC;AAQ3B,MAAM,MAAO,SAAQ,KAAK,CAAC,SAA2B;IAC7C,MAAM;QACX,MAAM,EACJ,IAAI,EACJ,OAAO,EAAE,EACP,QAAQ,EAAE,EAAE,QAAQ,EAAE,EACvB,EACD,QAAQ,EACR,aAAa,EACd,GAAG,IAAI,CAAC,KAAK,CAAC;QACf,IAAI,aAAa;YAAE,aAAa,CAAC,UAAU,GAAG,IAAI,CAAC;QACnD,OAAO,CACL;YACG,QAAQ,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,GAAG,IAAI,CACxC,oBAAC,IAAI,IACH,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,KAAK,EAAE,SAAS,IAAI,EAAE;qBACvB;oBACD,UAAU,EAAE,OAAO;iBACpB,GACD,CACH;YACA,QAAQ,CACR,CACJ,CAAC;IACJ,CAAC;CACF;AAED,eAAe,UAAU,CAAC,MAAM,CAAC,CAAC"}
|
@@ -8,10 +8,10 @@ export type DynamicRouteProps = {
|
|
8
8
|
productPage: ComponentType<ProductProps>;
|
9
9
|
categoryPage: ComponentType<CategoryProps>;
|
10
10
|
contentPage: ComponentType<ContentProps>;
|
11
|
-
notFoundPage: React.
|
12
|
-
LoadingPage?: React.
|
13
|
-
ErrorPage?: React.
|
11
|
+
notFoundPage: React.FC<any>;
|
12
|
+
LoadingPage?: React.FC<any>;
|
13
|
+
ErrorPage?: React.FC<any>;
|
14
14
|
routeQuery: DocumentNode;
|
15
15
|
} & RouteComponentProps<any>;
|
16
|
-
declare const DynamicRoute: (props: DynamicRouteProps) => JSX.Element;
|
16
|
+
declare const DynamicRoute: (props: DynamicRouteProps) => React.JSX.Element;
|
17
17
|
export default DynamicRoute;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import PaginationProvider, { usePagination } from '@jetshop/core/components/Pagination/PaginationProvider';
|
2
2
|
import SortOrderContainer from '@jetshop/core/components/SortOrder/SortOrderContainer';
|
3
|
-
import GenericError from '@jetshop/
|
3
|
+
import GenericError from '@jetshop/core/components/DynamicRoute/GenericError';
|
4
4
|
import { default as React, useEffect } from 'react';
|
5
5
|
import { useQuery, useApolloClient } from 'react-apollo';
|
6
6
|
import { useHistory, useLocation } from 'react-router';
|
@@ -16,6 +16,7 @@ function useFiltersOnRouteChange() {
|
|
16
16
|
const history = useHistory();
|
17
17
|
const client = useApolloClient();
|
18
18
|
useEffect(() => {
|
19
|
+
console.log('run effect');
|
19
20
|
client.writeData({
|
20
21
|
data: {
|
21
22
|
activeFilters: getActiveFiltersFromSearch(window.location.search)
|
@@ -23,6 +24,45 @@ function useFiltersOnRouteChange() {
|
|
23
24
|
});
|
24
25
|
}, [client, history]);
|
25
26
|
}
|
27
|
+
const RouteQuery = ({ pagination, sortOrder, direction, routeQuery, productPage, categoryPage, contentPage, notFoundPage, LoadingPage, ErrorPage }) => {
|
28
|
+
var _a, _b, _c, _d, _e;
|
29
|
+
const location = useLocation();
|
30
|
+
const { perPage, offset } = pagination;
|
31
|
+
useFiltersOnRouteChange();
|
32
|
+
const activeFilterQuery = useQuery(ActiveFiltersQuery, {
|
33
|
+
fetchPolicy: 'cache-only'
|
34
|
+
});
|
35
|
+
console.log((_a = activeFilterQuery.data) === null || _a === void 0 ? void 0 : _a.activeFilters);
|
36
|
+
const variables = {
|
37
|
+
path: location.pathname,
|
38
|
+
first: perPage,
|
39
|
+
offset,
|
40
|
+
orderBy: sortOrder,
|
41
|
+
orderByDirection: direction,
|
42
|
+
filters: ((_b = activeFilterQuery.data) === null || _b === void 0 ? void 0 : _b.activeFilters) || Object.assign({}, defaultActiveFilters)
|
43
|
+
};
|
44
|
+
// defaultActiveFilters includes a __typename key,
|
45
|
+
// but we don't want it for the variable input
|
46
|
+
delete variables.filters.__typename;
|
47
|
+
const result = useQuery(routeQuery, {
|
48
|
+
variables,
|
49
|
+
errorPolicy: 'all',
|
50
|
+
fetchPolicy: 'cache-and-network',
|
51
|
+
partialRefetch: true
|
52
|
+
});
|
53
|
+
const route = (_c = result.data) === null || _c === void 0 ? void 0 : _c.route;
|
54
|
+
const data = (_e = (_d = result.data) === null || _d === void 0 ? void 0 : _d.route) === null || _e === void 0 ? void 0 : _e.object;
|
55
|
+
return (React.createElement(GenericError
|
56
|
+
// Catch routing exceptions and log the graphql result
|
57
|
+
, {
|
58
|
+
// Catch routing exceptions and log the graphql result
|
59
|
+
extraInfo: {
|
60
|
+
variables: result.variables,
|
61
|
+
data: result.data
|
62
|
+
} },
|
63
|
+
data && React.createElement(Head, { data: data, route: route }),
|
64
|
+
React.createElement(RouteResolver, { productPage: productPage, categoryPage: categoryPage, contentPage: contentPage, notFoundPage: notFoundPage, LoadingPage: LoadingPage, ErrorPage: ErrorPage, result: result, pathname: location.pathname, state: location.state, search: location.search })));
|
65
|
+
};
|
26
66
|
const DynamicRoute = (props) => {
|
27
67
|
throwErrorInDev(!props.routeQuery, `You forgot to pass 'routeQuery' to DynamicRoute`);
|
28
68
|
const pagination = usePagination();
|
@@ -56,41 +96,5 @@ const DynamicRoute = (props) => {
|
|
56
96
|
})))));
|
57
97
|
}
|
58
98
|
};
|
59
|
-
const RouteQuery = ({ pagination, sortOrder, direction, routeQuery, productPage, categoryPage, contentPage, notFoundPage, LoadingPage, ErrorPage }) => {
|
60
|
-
var _a, _b, _c, _d;
|
61
|
-
const location = useLocation();
|
62
|
-
const { perPage, offset } = pagination;
|
63
|
-
useFiltersOnRouteChange();
|
64
|
-
const activeFilterQuery = useQuery(ActiveFiltersQuery);
|
65
|
-
const variables = {
|
66
|
-
path: location.pathname,
|
67
|
-
first: perPage,
|
68
|
-
offset,
|
69
|
-
orderBy: sortOrder,
|
70
|
-
orderByDirection: direction,
|
71
|
-
filters: ((_a = activeFilterQuery.data) === null || _a === void 0 ? void 0 : _a.activeFilters) || Object.assign({}, defaultActiveFilters)
|
72
|
-
};
|
73
|
-
// defaultActiveFilters includes a __typename key,
|
74
|
-
// but we don't want it for the variable input
|
75
|
-
delete variables.filters.__typename;
|
76
|
-
const result = useQuery(routeQuery, {
|
77
|
-
variables,
|
78
|
-
errorPolicy: 'all',
|
79
|
-
fetchPolicy: 'cache-and-network',
|
80
|
-
partialRefetch: true
|
81
|
-
});
|
82
|
-
const route = (_b = result.data) === null || _b === void 0 ? void 0 : _b.route;
|
83
|
-
const data = (_d = (_c = result.data) === null || _c === void 0 ? void 0 : _c.route) === null || _d === void 0 ? void 0 : _d.object;
|
84
|
-
return (React.createElement(GenericError
|
85
|
-
// Catch routing exceptions and log the graphql result
|
86
|
-
, {
|
87
|
-
// Catch routing exceptions and log the graphql result
|
88
|
-
extraInfo: {
|
89
|
-
variables: result.variables,
|
90
|
-
data: result.data
|
91
|
-
} },
|
92
|
-
data && React.createElement(Head, { data: data, route: route }),
|
93
|
-
React.createElement(RouteResolver, { productPage: productPage, categoryPage: categoryPage, contentPage: contentPage, notFoundPage: notFoundPage, LoadingPage: LoadingPage, ErrorPage: ErrorPage, result: result, pathname: location.pathname, state: location.state, search: location.search })));
|
94
|
-
};
|
95
99
|
export default DynamicRoute;
|
96
100
|
//# sourceMappingURL=index.js.map
|