@shopgate/pwa-common 7.28.0-beta.4 → 7.28.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-common",
3
- "version": "7.28.0-beta.4",
3
+ "version": "7.28.0-beta.6",
4
4
  "description": "Common library for the Shopgate Connect PWA.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Shopgate <support@shopgate.com>",
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@redux-devtools/extension": "^3.3.0",
19
19
  "@sentry/browser": "6.0.1",
20
- "@shopgate/pwa-benchmark": "7.28.0-beta.4",
20
+ "@shopgate/pwa-benchmark": "7.28.0-beta.6",
21
21
  "@virtuous/conductor": "~2.5.0",
22
22
  "@virtuous/react-conductor": "~2.5.0",
23
23
  "@virtuous/redux-persister": "1.1.0-beta.7",
@@ -43,7 +43,7 @@
43
43
  "url-search-params": "^0.10.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@shopgate/pwa-core": "7.28.0-beta.4",
46
+ "@shopgate/pwa-core": "7.28.0-beta.6",
47
47
  "@types/react-portal": "^3.0.9",
48
48
  "lodash": "^4.17.4",
49
49
  "prop-types": "~15.8.1",
@@ -18,7 +18,7 @@ if(location&&!handler.isExternalLink(location)){location=handler.sanitizeLink(lo
18
18
  if(location){_context.next=29;break;}return _context.abrupt("return");case 29:if(!(historyAction===ACTION_PUSH&&location===currentPathname)){_context.next=31;break;}return _context.abrupt("return");case 31:if(getIsConnected(state)){_context.next=34;break;}showConnectivityError();return _context.abrupt("return");case 34:if(isUserLoggedIn(state)){_context.next=39;break;}// Determine whether or not this location is protected.
19
19
  protector=authRoutes.getProtector(location);// If protected then navigate to the protector instead.
20
20
  if(!protector){_context.next=39;break;}dispatch(navigate({action:historyAction,pathname:protector,state:{redirect:{location:location,state:routeState}}}));return _context.abrupt("return");case 39:/* eslint-disable prefer-const */ // Check for a redirect and change location if one is found.
21
- _ref3=redirects.getRedirectExtended(location)||{},redirect=_ref3.handler,matcher=_ref3.matcher,pathParams=_ref3.pathParams,queryParams=_ref3.queryParams;/* eslint-enable prefer-const */if(!redirect){_context.next=65;break;}if(!(typeof redirect==='function'||redirect instanceof Promise)){_context.next=60;break;}_getCurrentRoute2=getCurrentRoute(state),pathname=_getCurrentRoute2.pathname;LoadingProvider.setLoading(pathname);pattern=router.findPattern(location.split('?')[0]);_ref5=router.patterns[pattern]||{},transform=_ref5.transform;route=new Route({pathname:location,pattern:pattern,routeState:routeState,transform:transform});_context.prev=47;_context.next=50;return redirect(_extends({},params,{action:_extends({},params.action,{params:_extends({},params.action.params,{// Merge the sanitized location into the redirect handler payload.
21
+ _ref3=redirects.getRedirectExtended(location)||{},redirect=_ref3.handler,matcher=_ref3.matcher,pathParams=_ref3.pathParams,queryParams=_ref3.queryParams;/* eslint-enable prefer-const */if(!redirect){_context.next=65;break;}if(!(typeof redirect==='function'||redirect instanceof Promise)){_context.next=60;break;}_getCurrentRoute2=getCurrentRoute(state),pathname=_getCurrentRoute2.pathname;LoadingProvider.setLoading(pathname);pattern=router.findPattern(location.split('?')[0]);_ref5=router.patterns[pattern]||{},transform=_ref5.transform;route=new Route({pathname:location,pattern:pattern,state:routeState,transform:transform});_context.prev=47;_context.next=50;return redirect(_extends({},params,{action:_extends({},params.action,{params:_extends({},params.action.params,{// Merge the sanitized location into the redirect handler payload.
22
22
  pathname:location}),route:route,redirectMeta:{location:location,matcher:matcher,pathParams:pathParams,queryParams:queryParams}})}));case 50:redirect=_context.sent;_context.next=57;break;case 53:_context.prev=53;_context.t1=_context["catch"](47);redirect=null;logger.error(_context.t1);case 57:LoadingProvider.unsetLoading(pathname);if(redirect){_context.next=60;break;}return _context.abrupt("return");case 60:// Add query parameters from the original location to the redirect
23
23
  parsedLocation=queryString.parseUrl(location);parsedRedirect=queryString.parseUrl(redirect);stringifiedQuery=queryString.stringify(_extends({},parsedLocation.query,{},parsedRedirect.query));finalRedirect=stringifiedQuery?"".concat(parsedRedirect.url,"?").concat(stringifiedQuery):parsedRedirect.url;location=finalRedirect;case 65:parsed=queryString.parseUrl(location);if(parsed.url){_context.next=69;break;}// The URL is not valid - show a toast message
24
24
  showConnectivityError();return _context.abrupt("return");case 69:// Override the location if is Shop link is found.