@jetshop/core 6.1.0-alpha.60f2f3f7 → 6.1.0-alpha.996f4762

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/analytics/trackerRegistry.js +11 -1
  2. package/analytics/trackerRegistry.js.map +1 -1
  3. package/boot/SharedTree.d.ts +1 -3
  4. package/boot/SharedTree.js +2 -4
  5. package/boot/SharedTree.js.map +1 -1
  6. package/boot/client/startClient.js +8 -11
  7. package/boot/client/startClient.js.map +1 -1
  8. package/boot/server/createRenderer.js +4 -2
  9. package/boot/server/createRenderer.js.map +1 -1
  10. package/boot/server/createServer.js +2 -2
  11. package/boot/server/createServer.js.map +1 -1
  12. package/boot/server/index.js +4 -2
  13. package/boot/server/index.js.map +1 -1
  14. package/components/Auth/signupSubmit.js +14 -8
  15. package/components/Auth/signupSubmit.js.map +1 -1
  16. package/components/AuthContext/AuthContext.d.ts +5 -1
  17. package/components/AuthContext/AuthContext.js +3 -1
  18. package/components/AuthContext/AuthContext.js.map +1 -1
  19. package/components/AuthContext/AuthProvider.js +8 -4
  20. package/components/AuthContext/AuthProvider.js.map +1 -1
  21. package/components/AuthContext/useAuth.d.ts +1 -1
  22. package/components/AuthContext/useAuth.js +3 -4
  23. package/components/AuthContext/useAuth.js.map +1 -1
  24. package/components/Cart/CartIdContext.js +1 -1
  25. package/components/Cart/CartIdContext.js.map +1 -1
  26. package/components/DynamicRoute/RouteResolver.js +3 -5
  27. package/components/DynamicRoute/RouteResolver.js.map +1 -1
  28. package/data/mutations/accountMutations.gql +3 -2
  29. package/data/mutations/signup.gql +1 -0
  30. package/data/queries/ProductLists.gql +1 -1
  31. package/errorReporting.browser.js +8 -3
  32. package/errorReporting.browser.js.map +1 -1
  33. package/errorReporting.d.ts +2 -1
  34. package/errorReporting.js +5 -1
  35. package/errorReporting.js.map +1 -1
  36. package/global.d.ts +1 -0
  37. package/helpers/throwErrorInDev.js +7 -2
  38. package/helpers/throwErrorInDev.js.map +1 -1
  39. package/hooks/ProductList/ProductListContext.d.ts +5 -0
  40. package/hooks/ProductList/ProductListContext.js +15 -3
  41. package/hooks/ProductList/ProductListContext.js.map +1 -1
  42. package/hooks/ProductList/action-creators.js +10 -12
  43. package/hooks/ProductList/action-creators.js.map +1 -1
  44. package/hooks/ProductList/index.d.ts +2 -1
  45. package/hooks/ProductList/index.js.map +1 -1
  46. package/hooks/ProductList/product-list-reducer.js +1 -1
  47. package/hooks/ProductList/product-list-reducer.js.map +1 -1
  48. package/hooks/useLoginMutation.d.ts +1 -0
  49. package/hooks/useLoginMutation.js +5 -1
  50. package/hooks/useLoginMutation.js.map +1 -1
  51. package/hooks/useRoutePreload.js +5 -0
  52. package/hooks/useRoutePreload.js.map +1 -1
  53. package/hooks/useThunkReducer.js +2 -2
  54. package/hooks/useThunkReducer.js.map +1 -1
  55. package/package.json +1 -3
  56. package/types.d.ts +2 -1
  57. package/analytics/webVitals.d.ts +0 -5
  58. package/analytics/webVitals.js +0 -39
  59. package/analytics/webVitals.js.map +0 -1
@@ -168,14 +168,24 @@ export function trackerRegistry({ config, inServer }) {
168
168
  const registry = {
169
169
  on(event, listeners, { name } = {}) {
170
170
  return events.on(event.toString(), (...args) => __awaiter(this, void 0, void 0, function* () {
171
+ var _a;
171
172
  try {
172
- return yield listeners.apply(this, args);
173
+ yield listeners.apply(this, args);
174
+ return;
173
175
  }
174
176
  catch (err) {
175
177
  console.error(`Error triggering ${event}:${name}`, {
176
178
  err
177
179
  });
178
180
  }
181
+ finally {
182
+ for (const arg of args) {
183
+ if (arg === null || arg === void 0 ? void 0 : arg.callback) {
184
+ yield ((_a = arg.callback) === null || _a === void 0 ? void 0 : _a.call(arg));
185
+ return;
186
+ }
187
+ }
188
+ }
179
189
  }));
180
190
  },
181
191
  emit(event, props, context, eventId) {
@@ -1 +1 @@
1
- {"version":3,"file":"trackerRegistry.js","sourceRoot":"","sources":["trackerRegistry.ts"],"names":[],"mappings":";;;;;;;;;AAEA,OAAO,aAAa,MAAM,eAAe,CAAC;AAmJ1C,MAAM,CAA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AAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;iBAC9D;YACH,CAAC,CAAC,CAAC;YAEH,IAAI,QAAQ,EAAE;gBACZ,OAAO;aACR;YAED,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE;gBACxB,OAAO;aACR;YAED,IAAI,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,eAAe,CAAA,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;gBACtE,OAAO;aACR;YAED,MAAM,IAAI,GAAG,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC;YAEnD,IAAI;gBACF,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aAC3B;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,CAAC,KAAK,CAAC,SAAS,OAAO,CAAC,IAAI,cAAc,EAAE;oBACjD,GAAG;oBACH,IAAI;iBACL,CAAC,CAAC;aACJ;QACH,CAAC;QACD,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KAChD,CAAC;IACF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -4,7 +4,6 @@ import React, { ReactElement } from 'react';
4
4
  import { Cookies } from 'react-cookie';
5
5
  import { StaticRouterProps } from 'react-router';
6
6
  import { BootOptions } from '../components/ConfigProvider';
7
- import { AuthHandler } from './AuthHandler';
8
7
  import { ChannelHandler } from '../ChannelHandler/ChannelHandler';
9
8
  import { PreviewHandler } from './PreviewHandler';
10
9
  interface SharedTreeProps {
@@ -17,9 +16,8 @@ interface SharedTreeProps {
17
16
  Router: React.ComponentClass<StaticRouterProps>;
18
17
  routerProps?: StaticRouterProps;
19
18
  children: React.ReactNode;
20
- authHandler: AuthHandler;
21
19
  channelHandler: ChannelHandler;
22
20
  previewHandler: PreviewHandler;
23
21
  }
24
- declare const SharedTree: ({ activeBreakpoint, cookies, helmetContext, releware, client, config, authHandler, Router, routerProps, children, channelHandler, previewHandler }: SharedTreeProps) => ReactElement;
22
+ declare const SharedTree: ({ activeBreakpoint, cookies, helmetContext, releware, client, config, Router, routerProps, children, channelHandler, previewHandler }: SharedTreeProps) => ReactElement;
25
23
  export default SharedTree;
@@ -5,14 +5,13 @@ import { ApolloProvider } from '@apollo/client';
5
5
  import { CookiesProvider } from 'react-cookie';
6
6
  // Metadata
7
7
  import { HelmetProvider } from 'react-helmet-async';
8
- import AuthProvider from '../components/AuthContext/AuthProvider';
9
8
  import { BreakpointProvider } from '../components/BreakpointProvider';
10
9
  // React Router DOM
11
10
  import { ChannelProvider } from '../components/ChannelContext/';
12
11
  import { ConfigProvider } from '../components/ConfigProvider';
13
12
  import { PreviewProvider } from '../components/PreviewContext';
14
13
  import { NotificationsProvider } from '../components/Notifications';
15
- const SharedTree = ({ activeBreakpoint, cookies, helmetContext, releware, client, config, authHandler, Router, routerProps, children, channelHandler, previewHandler }) => {
14
+ const SharedTree = ({ activeBreakpoint, cookies, helmetContext, releware, client, config, Router, routerProps, children, channelHandler, previewHandler }) => {
16
15
  return (React.createElement(ConfigProvider, { config: config },
17
16
  React.createElement(NotificationsProvider, null,
18
17
  React.createElement(CookiesProvider, { cookies: cookies },
@@ -22,8 +21,7 @@ const SharedTree = ({ activeBreakpoint, cookies, helmetContext, releware, client
22
21
  React.createElement(ChannelProvider, { config: config, channelHandler: channelHandler },
23
22
  React.createElement(AnalyticsProvider, { releware: releware, cookies: cookies },
24
23
  React.createElement(PreviewProvider, { previewHandler: previewHandler },
25
- React.createElement(Router, Object.assign({ basename: channelHandler.getChannelBasename() || undefined }, routerProps),
26
- React.createElement(AuthProvider, { auth: authHandler }, children))))))))))));
24
+ React.createElement(Router, Object.assign({ basename: channelHandler.getChannelBasename() || undefined }, routerProps), children)))))))))));
27
25
  };
28
26
  export default SharedTree;
29
27
  //# sourceMappingURL=SharedTree.js.map
@@ -1 +1 @@
1
- {"version":3,"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kBAAkB,IAAC,KAAK,EAAE,gBAAgB;wBACzC,oBAAC,cAAc,IAAC,MAAM,EAAE,MAAM;4BAC5B,oBAAC,eAAe,IACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc;gCAE9B,oBAAC,iBAAiB,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO;oCACrD,oBAAC,eAAe,IAAC,cAAc,EAAE,cAAc;wCAC7C,oBAAC,MAAM,kBACL,QAAQ,EACN,cAAc,CAAC,kBAAkB,EAAE,IAAI,SAAS,IAE9C,WAAW,GAEd,QAAQ,CACF,CACO,CACA,CACJ,CACH,CACE,CACN,CACD,CACI,CACT,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -26,9 +26,9 @@ import { PreviewHandler } from '../PreviewHandler';
26
26
  import SharedTree from '../SharedTree';
27
27
  import createIntlOptions from '../utils/createIntOptions';
28
28
  import { setUID } from '../utils/uid';
29
- import { webVitals } from '../../analytics/webVitals';
30
29
  import { primaryRouteForPathFetcher } from '../../../core/ChannelHandler/redirectUtils';
31
30
  import ActiveFiltersQuery from '@jetshop/core/components/DynamicRoute/ActiveFiltersQuery.gql';
31
+ import AuthProvider from '@jetshop/core/components/AuthContext/AuthProvider';
32
32
  // Instantiate this here, since we need to read cookies outside of React.
33
33
  const cookies = new Cookies();
34
34
  function getInitialCacheData() {
@@ -50,14 +50,10 @@ const startClient = (tree, config) => {
50
50
  }
51
51
  // This is used by cypress to get the shopid when running universal cypress test
52
52
  window.shopid = config.apolloConfig.shopid;
53
- if (process.env.REACT_APP_REPORT_WEB_VITALS) {
54
- webVitals({
55
- shopId: config.apolloConfig.shopid,
56
- apiUrl: config.apolloConfig.graphQLURI
57
- });
58
- }
59
- if (config.sentry && config.sentry.clientDSN) {
60
- Sentry.init(config.sentry.clientDSN);
53
+ if (__USE_SENTRY__) {
54
+ if (config.sentry && config.sentry.clientDSN) {
55
+ Sentry.init(config.sentry.clientDSN);
56
+ }
61
57
  }
62
58
  const { apolloConfig } = config;
63
59
  const authHandler = new AuthHandler({
@@ -121,8 +117,9 @@ const startClient = (tree, config) => {
121
117
  // hydration. This prevents `cache-and-network` routes from re-fetching
122
118
  // immediately after hydration
123
119
  client.disableNetworkFetches = true;
124
- const wrappedTree = (React.createElement(SharedTree, { activeBreakpoint: activeBreakpoint, config: config, cookies: cookies, releware: releware, client: client, Router: BrowserRouter, authHandler: authHandler, channelHandler: channelHandler, previewHandler: previewHandler },
125
- React.createElement(CartIdProvider, null, tree)));
120
+ const wrappedTree = (React.createElement(SharedTree, { activeBreakpoint: activeBreakpoint, config: config, cookies: cookies, releware: releware, client: client, Router: BrowserRouter, channelHandler: channelHandler, previewHandler: previewHandler },
121
+ React.createElement(CartIdProvider, null,
122
+ React.createElement(AuthProvider, { auth: authHandler }, tree))));
126
123
  return wrappedTree;
127
124
  });
128
125
  })
@@ -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,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;A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qBAAqB,GAAG,KAAK,CAAC;IACvC,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"}
@@ -31,6 +31,7 @@ import { salesSourceMiddleware } from './salesSource';
31
31
  import { getPreloadLinkHeaderString } from './getPreloadAssets';
32
32
  import { primaryRouteForPathFetcher } from '../../../core/ChannelHandler/redirectUtils';
33
33
  import ActiveFiltersQuery from '@jetshop/core/components/DynamicRoute/ActiveFiltersQuery.gql';
34
+ import AuthProvider from '@jetshop/core/components/AuthContext/AuthProvider';
34
35
  const injectDataIntoSlots = (template, data) => Object.keys(data).reduce((output, key) => key !== 'htmlAttributes'
35
36
  ? output.replace(`<slot name="${key}"/>`, data[key])
36
37
  : output.replace('<html lang="en">', `<html ${data[key]}>`), template);
@@ -41,10 +42,11 @@ const wrapTree = (tree, req, renderOptions, client, channelHandler, authHandler,
41
42
  const helmetContext = { helmet: null };
42
43
  const wrappedTree = (React.createElement(ChunkExtractorManager, { extractor: extractor },
43
44
  React.createElement(IntlContext.Provider, { value: translator },
44
- React.createElement(SharedTree, { activeBreakpoint: req.breakpoint, config: renderOptions, cookies: req.universalCookies, helmetContext: helmetContext, client: client, channelHandler: channelHandler, authHandler: authHandler, previewHandler: previewHandler, Router: StaticRouter, routerProps: {
45
+ React.createElement(SharedTree, { activeBreakpoint: req.breakpoint, config: renderOptions, cookies: req.universalCookies, helmetContext: helmetContext, client: client, channelHandler: channelHandler, previewHandler: previewHandler, Router: StaticRouter, routerProps: {
45
46
  location: req.originalUrl,
46
47
  context: routerContext
47
- } }, tree))));
48
+ } },
49
+ React.createElement(AuthProvider, { auth: authHandler }, tree)))));
48
50
  try {
49
51
  // This getDataFromTree is used to get all of the data from the Query components
50
52
  yield getDataFromTree(wrappedTree);
@@ -1 +1 @@
1
- {"version":3,"file":"createRenderer.js","sourceRoot":"","sources":["createRenderer.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAIhD,OAAO,KAAuB,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAE1D,OAAO,uBAAuB,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,MAAM,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE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AAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACjD,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAEvD,aAAa,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACzC,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;QACvC,WAAW,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7B,CAAC,CAAA,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -14,7 +14,7 @@ process.on('unhandledRejection', (err) => {
14
14
  const createServer = ({ apolloServer, middlewares }) => {
15
15
  const app = express();
16
16
  // The Sentry.io request handler must be the first middleware on the app
17
- if (process.env.USE_SENTRY === '1') {
17
+ if (__USE_SENTRY__) {
18
18
  app.use(Sentry.Handlers.requestHandler());
19
19
  }
20
20
  app.set('trust proxy', true);
@@ -33,7 +33,7 @@ const createServer = ({ apolloServer, middlewares }) => {
33
33
  maxAge: '365d'
34
34
  }));
35
35
  // The error handler must be before any other error middleware
36
- if (process.env.USE_SENTRY === '1') {
36
+ if (__USE_SENTRY__) {
37
37
  app.use(Sentry.Handlers.errorHandler());
38
38
  }
39
39
  return app;
@@ -1 +1 @@
1
- {"version":3,"file":"createServer.js","sourceRoot":"","sources":["createServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAC;AAEvC,OAAO,OAAqD,MAAM,SAAS,CAAC;AAC5E,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,OAAO,oBAAoB,MAAM,gDAAgD,CAAC;AAClF,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAE1C,qEAAqE;AACrE,6EAA6E;AAC7E,2DAA2D;AAC3D,OAAO,CAAC,EAAE,CAAC,oBAAoB,EA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U;SACjB,CAAC,CAAC;KACJ;IACD,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACxB,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IAEnE,GAAG,CAAC,GAAG,CACL,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE;QAC5C,MAAM,EAAE,MAAM;KACf,CAAC,CACH,CAAC;IAEF,8DAA8D;IAC9D,IAAI,cAAc,EAAE;QAClB,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;KACzC;IAED,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -67,8 +67,10 @@ export const createApp = (Component, userConfig) => __awaiter(void 0, void 0, vo
67
67
  console.error('checkRequiredFiles failed!');
68
68
  process.exit(1);
69
69
  }
70
- if (sentry) {
71
- Sentry.init(sentry.serverDSN);
70
+ if (__USE_SENTRY__) {
71
+ if (sentry) {
72
+ Sentry.init(sentry.serverDSN);
73
+ }
72
74
  }
73
75
  const template = fs.readFileSync(templatePath, 'utf8');
74
76
  const middlewares = [];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,qCAAqC,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,8EAA8E;AAC9E,iGAAiG;AACjG,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAEpE,OAAO,eAAe,MAAM,+BAA+B,CAAC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@@
1
1
  import { formatSignupInput } from '@jetshop/core/components/Auth/formatSignupInput';
2
- import useAuth from '@jetshop/core/components/AuthContext/useAuth';
3
2
  import SignupMutation from '@jetshop/core/data/mutations/signup.gql';
4
3
  import getErrorDetail from '@jetshop/core/helpers/getErrorDetail';
5
4
  import { useApolloClient, useMutation } from '@apollo/client';
@@ -7,10 +6,13 @@ import { useContext } from 'react';
7
6
  import { SignupContext } from './signup-context';
8
7
  import { trackRegisterEvent } from '../../analytics/tracking';
9
8
  import { useTracker } from '../../analytics/Analytics';
9
+ import { useLoginMutation } from '@jetshop/core/hooks/useLoginMutation';
10
+ import { useCartId } from '@jetshop/core/components/Cart/CartIdContext';
10
11
  export function useSignupSubmit() {
11
12
  const [mutate] = useMutation(SignupMutation);
12
13
  const client = useApolloClient();
13
- const { logIn } = useAuth();
14
+ const { loginMutation } = useLoginMutation();
15
+ const { cartId } = useCartId();
14
16
  const { isUserTypeBusiness } = useContext(SignupContext);
15
17
  const track = useTracker();
16
18
  return function signup({ values, actions }) {
@@ -23,16 +25,20 @@ export function useSignupSubmit() {
23
25
  })
24
26
  }
25
27
  })
26
- .then((resp) => {
28
+ .then(() => {
27
29
  // Submitting is done
28
30
  actions.setSubmitting(false);
29
31
  // Track user register in GTAG
30
32
  track(trackRegisterEvent());
31
- // Reset the Apollo store
32
- client.resetStore().then(() => {
33
- // Log the user in with the token from signup
34
- logIn(resp.data.signUp.token.value);
35
- });
33
+ // Use login mutation to enable the cart to be merged
34
+ loginMutation({
35
+ variables: {
36
+ email: values.emailAddress,
37
+ password: values.password,
38
+ cartId
39
+ }
40
+ // Reset the Apollo store
41
+ }).then(client.resetStore);
36
42
  }, (error) => {
37
43
  const errorDetail = getErrorDetail(error);
38
44
  const validationDetails = getvalidationDetails(errorDetail);
@@ -1 +1 @@
1
- {"version":3,"file":"signupSubmit.js","sourceRoot":"","sources":["signupSubmit.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAElB,MAAM,iDAAiD,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AAQ;oBACzB,MAAM;iBACP;gBACD,yBAAyB;aAC1B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC7B,CAAC,EACD,CAAC,KAAK,EAAE,EAAE;YACR,MAAM,WAAW,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;YAC1C,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC;YAE5D,qBAAqB;YACrB,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAE7B,OAAO,CAAC,SAAS,CAAC;gBAChB,iBAAiB;gBACjB,aAAa,EAAE,IAAI;aACpB,CAAC,CAAC;QACL,CAAC,CACF;aACA,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,WAAwB;IACpD,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,MAAM,CAAC,MAAM,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAE5C,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACzB,CAAC"}
@@ -2,7 +2,11 @@
2
2
  export interface AuthState {
3
3
  requiresAuth: boolean;
4
4
  loggedIn: boolean;
5
- updateLoggedIn: (loggedIn: boolean, token?: string) => void;
5
+ updateLoggedIn: ({ loggedIn, customerId, token }: {
6
+ loggedIn: boolean;
7
+ customerId?: number;
8
+ token?: string;
9
+ }) => void;
6
10
  }
7
11
  declare const AuthContext: import("react").Context<AuthState>;
8
12
  export default AuthContext;
@@ -2,7 +2,9 @@ import { createContext } from 'react';
2
2
  const initialAuthState = {
3
3
  requiresAuth: false,
4
4
  loggedIn: false,
5
- updateLoggedIn: () => { }
5
+ updateLoggedIn: () => {
6
+ return;
7
+ }
6
8
  };
7
9
  const AuthContext = createContext(initialAuthState);
8
10
  export default AuthContext;
@@ -1 +1 @@
1
- {"version":3,"file":"AuthContext.js","sourceRoot":"","sources":["AuthContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQtC,MAAM,gBAAgB,GAAc;IAClC,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,KAAK;IACf,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,GAAG,aAAa,CAAY,gBAAgB,CAAC,CAAC;AAC/D,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"AuthContext.js","sourceRoot":"","sources":["AuthContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAgBtC,MAAM,gBAAgB,GAAc;IAClC,YAAY,EAAE,KAAK;IACnB,QAAQ,EAAE,KAAK;IACf,cAAc,EAAE,GAAG,EAAE;QACnB,OAAO;IACT,CAAC;CACF,CAAC;AAEF,MAAM,WAAW,GAAG,aAAa,CAAY,gBAAgB,CAAC,CAAC;AAC/D,eAAe,WAAW,CAAC"}
@@ -9,11 +9,13 @@ import { trackUserEvent } from '../../analytics/tracking';
9
9
  import { useTracker } from '../../analytics/Analytics';
10
10
  import { useQuery } from '@apollo/client';
11
11
  import googleUserIdQuery from './googleUserIdQuery.gql';
12
+ import { useCartId } from '@jetshop/core/components/Cart/CartIdContext';
12
13
  const AuthProvider = function AuthProvider(props) {
13
14
  var _a, _b;
14
15
  const token = (_b = (_a = props === null || props === void 0 ? void 0 : props.cookies) === null || _a === void 0 ? void 0 : _a.cookies) === null || _b === void 0 ? void 0 : _b.authToken;
15
16
  const [loggedIn, setLoggedIn] = React.useState(!!token);
16
17
  const client = useApolloClient();
18
+ const { setCartId } = useCartId();
17
19
  const { selectedChannel } = useContext(ChannelContext);
18
20
  const { pathsWithNoAuthRequired, loginPath } = useShopConfig();
19
21
  const location = useLocation();
@@ -47,27 +49,29 @@ const AuthProvider = function AuthProvider(props) {
47
49
  const value = React.useMemo(() => ({
48
50
  requiresAuth: selectedChannel.requiresAuth,
49
51
  loggedIn,
50
- updateLoggedIn: (loggedIn, token) => {
52
+ updateLoggedIn: ({ loggedIn, token, customerId }) => {
51
53
  if (loggedIn) {
52
54
  if (!token) {
53
55
  throw new Error('No log in token provided');
54
56
  }
55
57
  props.auth.setAuthToken(token);
56
58
  localStorage.setItem('loggedIn', '1');
59
+ customerId && setCartId(String(customerId));
57
60
  }
58
61
  else {
59
62
  props.auth.clearAuthToken();
60
63
  localStorage.removeItem('loggedIn');
64
+ setCartId(null);
61
65
  }
62
66
  client
63
67
  .resetStore()
64
68
  .then(() => setLoggedIn(loggedIn))
65
69
  .catch(() => setLoggedIn(loggedIn));
66
70
  }
67
- }), [client, loggedIn, props.auth, selectedChannel.requiresAuth]);
71
+ }), [client, loggedIn, props.auth, selectedChannel.requiresAuth, setCartId]);
68
72
  return React.createElement(AuthContext.Provider, Object.assign({ value: value }, props));
69
73
  };
70
- const useLocalStorageLoggedIn = (setLoggedIn) => {
74
+ function useLocalStorageLoggedIn(setLoggedIn) {
71
75
  useEffect(() => {
72
76
  const listener = (e) => {
73
77
  const localStorageLoggedIn = localStorage.getItem('loggedIn');
@@ -80,6 +84,6 @@ const useLocalStorageLoggedIn = (setLoggedIn) => {
80
84
  window.removeEventListener('storage', listener);
81
85
  };
82
86
  });
83
- };
87
+ }
84
88
  export default withCookies(AuthProvider);
85
89
  //# sourceMappingURL=AuthProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AuthProvider.js","sourceRoot":"","sources":["AuthProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,EAAE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AC;AAED,eAAe,WAAW,CAAC,YAAY,CAAC,CAAC"}
@@ -2,5 +2,5 @@ export default function useAuth(): {
2
2
  requiresAuth: boolean;
3
3
  loggedIn: boolean;
4
4
  logOut: () => void;
5
- logIn: (token: string) => void;
5
+ logIn: (token: string, customerId?: number) => void;
6
6
  };
@@ -5,11 +5,10 @@ export default function useAuth() {
5
5
  const logOut = useCallback(() => {
6
6
  fetch('/signout', {
7
7
  method: 'GET'
8
- });
9
- updateLoggedIn(false);
8
+ }).then(() => updateLoggedIn({ loggedIn: false }));
10
9
  }, [updateLoggedIn]);
11
- const logIn = useCallback((token) => {
12
- updateLoggedIn(true, token);
10
+ const logIn = useCallback((token, customerId) => {
11
+ updateLoggedIn({ loggedIn: true, token, customerId });
13
12
  }, [updateLoggedIn]);
14
13
  return {
15
14
  requiresAuth,
@@ -1 +1 @@
1
- {"version":3,"file":"useAuth.js","sourceRoot":"","sources":["useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAE3E,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,KAAK,CAAC,UAAU,EAAE;YAChB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;QACH,cAAc,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,MAAM,KAAK,GAAG,WAAW,CACvB,CAAC,KAAa,EAAE,EAAE;QAChB,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC9B,CAAC,EACD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,QAAQ;QACR,MAAM;QACN,KAAK;KACN,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"useAuth.js","sourceRoot":"","sources":["useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,OAAO,UAAU,OAAO;IAC7B,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAE3E,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,KAAK,CAAC,UAAU,EAAE;YAChB,MAAM,EAAE,KAAK;SACd,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IACrD,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IAErB,MAAM,KAAK,GAAG,WAAW,CACvB,CAAC,KAAa,EAAE,UAAmB,EAAE,EAAE;QACrC,cAAc,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;IACxD,CAAC,EACD,CAAC,cAAc,CAAC,CACjB,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,QAAQ;QACR,MAAM;QACN,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -17,7 +17,7 @@ const usePersistedCartId = (cartId, setCartId) => {
17
17
  return () => {
18
18
  window.removeEventListener('storage', listener);
19
19
  };
20
- }, [cartId]);
20
+ }, [cartId, setCartId]);
21
21
  };
22
22
  const CartIdProvider = function CartIdProvider(props) {
23
23
  let persistedCartId = null;
@@ -1 +1 @@
1
- {"version":3,"file":"CartIdContext.js","sourceRoot":"","sources":["CartIdContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OA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AC;IAE9B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACzB,OAAO;YACL,MAAM;YACN,SAAS;SACV,CAAC;IACJ,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEb,OAAO,oBAAC,aAAa,CAAC,QAAQ,kBAAC,KAAK,EAAE,KAAK,IAAM,KAAK,EAAI,CAAC;AAC7D,CAAC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC;AAEzC,MAAM,UAAU,SAAS;IACvB,OAAO,UAAU,CAAC,aAAa,CAAC,CAAC;AACnC,CAAC"}
@@ -4,7 +4,6 @@ import CategoryRoute from './CategoryRoute';
4
4
  import ContentRoute from './ContentRoute';
5
5
  import Status from './Status';
6
6
  import { Redirect } from 'react-router';
7
- import { setPageType } from '../../analytics/webVitals';
8
7
  import { DefaultError } from '@jetshop/core/components/DynamicRoute/GenericError';
9
8
  const isRouteType = (state, result, type) => {
10
9
  var _a, _b, _c;
@@ -31,14 +30,13 @@ const isEmptyRoute = (result) => {
31
30
  };
32
31
  const Loading = (LoadingPage) => LoadingPage ? React.createElement(LoadingPage, null) : React.createElement("div", null, "Loading...");
33
32
  const RouteResolver = ({ productPage, categoryPage, contentPage, notFoundPage: NotFoundPage, ErrorPage, LoadingPage, result, pathname, state, search }) => {
34
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
35
- setPageType((_c = (_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.route) === null || _b === void 0 ? void 0 : _b.object) === null || _c === void 0 ? void 0 : _c.__typename);
33
+ var _a, _b, _c, _d, _e, _f;
36
34
  result.error && console.error(result.error);
37
- if (((_f = (_e = (_d = result === null || result === void 0 ? void 0 : result.data) === null || _d === void 0 ? void 0 : _d.route) === null || _e === void 0 ? void 0 : _e.path) !== null && _f !== void 0 ? _f : pathname) !== pathname) {
35
+ if (((_c = (_b = (_a = result === null || result === void 0 ? void 0 : result.data) === null || _a === void 0 ? void 0 : _a.route) === null || _b === void 0 ? void 0 : _b.path) !== null && _c !== void 0 ? _c : pathname) !== pathname) {
38
36
  return (React.createElement(Status, { code: 301 },
39
37
  React.createElement(Redirect, { to: {
40
38
  pathname: result.data.route.path,
41
- state: Object.assign(Object.assign({}, state), { type: (_j = (_h = (_g = result === null || result === void 0 ? void 0 : result.data) === null || _g === void 0 ? void 0 : _g.route) === null || _h === void 0 ? void 0 : _h.object) === null || _j === void 0 ? void 0 : _j.__typename }),
39
+ state: Object.assign(Object.assign({}, state), { type: (_f = (_e = (_d = result === null || result === void 0 ? void 0 : result.data) === null || _d === void 0 ? void 0 : _d.route) === null || _e === void 0 ? void 0 : _e.object) === null || _f === void 0 ? void 0 : _f.__typename }),
42
40
  search
43
41
  } })));
44
42
  }
@@ -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,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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AAK,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"}
@@ -1,8 +1,9 @@
1
- mutation login($email: String!, $password: String!) {
2
- login(email: $email, password: $password) {
1
+ mutation login($email: String!, $password: String!, $cartId: String) {
2
+ login(email: $email, password: $password, cartId: $cartId) {
3
3
  token {
4
4
  value
5
5
  }
6
+ customerId
6
7
  }
7
8
  }
8
9
 
@@ -3,5 +3,6 @@ mutation SignUp($input: SignUpInput!) {
3
3
  token {
4
4
  value
5
5
  }
6
+ customerId
6
7
  }
7
8
  }