@commercetools-frontend/application-shell 24.11.0 → 24.13.0

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.
Files changed (79) hide show
  1. package/dist/{application-entry-point-c87294b0.cjs.dev.js → application-entry-point-18d8fba0.cjs.dev.js} +7 -4
  2. package/dist/{application-entry-point-10a5e1a5.esm.js → application-entry-point-1b23fb6b.esm.js} +6 -4
  3. package/dist/{application-entry-point-8c4b8e53.cjs.prod.js → application-entry-point-74a06151.cjs.prod.js} +4 -3
  4. package/dist/commercetools-frontend-application-shell.cjs.dev.js +12 -11
  5. package/dist/commercetools-frontend-application-shell.cjs.prod.js +12 -11
  6. package/dist/commercetools-frontend-application-shell.esm.js +12 -11
  7. package/dist/{custom-view-dev-host-6091b78a.esm.js → custom-view-dev-host-b4f856d8.esm.js} +20 -16
  8. package/dist/{custom-view-dev-host-3a171a01.cjs.prod.js → custom-view-dev-host-bf11de47.cjs.prod.js} +21 -16
  9. package/dist/{custom-view-dev-host-40b33836.cjs.dev.js → custom-view-dev-host-f688743e.cjs.dev.js} +21 -16
  10. package/dist/declarations/src/types/generated/mc.d.ts +9 -8
  11. package/dist/declarations-connectors/src/components/application-context/index.d.ts +2 -3
  12. package/dist/declarations-connectors/src/components/application-context/normalizers.d.ts +1 -5
  13. package/dist/declarations-connectors/src/export-types.d.ts +1 -2
  14. package/dist/declarations-connectors/src/index.d.ts +1 -1
  15. package/dist/declarations-connectors/src/types/generated/mc.d.ts +9 -8
  16. package/dist/{index-7bdde97c.cjs.prod.js → index-242af4d2.cjs.prod.js} +201 -344
  17. package/dist/{index-614accc4.cjs.dev.js → index-25183095.cjs.dev.js} +2 -2
  18. package/dist/{index-245e2980.cjs.prod.js → index-52c724ed.cjs.prod.js} +2 -2
  19. package/dist/{index-86039df7.esm.js → index-5aaa33bb.esm.js} +2 -2
  20. package/dist/{index-67a5d8e8.esm.js → index-d8c26ca0.esm.js} +214 -363
  21. package/dist/{index-a57c8458.cjs.dev.js → index-dcd3d8a3.cjs.dev.js} +213 -364
  22. package/dist/{navbar-844d350d.esm.js → navbar-0bad8bc8.esm.js} +106 -110
  23. package/dist/{navbar-acc2cd1b.cjs.prod.js → navbar-7653417f.cjs.prod.js} +108 -112
  24. package/dist/{navbar-022383bd.cjs.dev.js → navbar-d4189469.cjs.dev.js} +108 -112
  25. package/dist/oidc-258fc018.cjs.prod.js +115 -0
  26. package/dist/oidc-35e8e62a.esm.js +100 -0
  27. package/dist/oidc-87d116c1.cjs.dev.js +115 -0
  28. package/dist/{oidc-callback-e07f0c20.cjs.dev.js → oidc-callback-11dae6b7.cjs.dev.js} +16 -14
  29. package/dist/{oidc-callback-ce8cbdfe.cjs.prod.js → oidc-callback-300966ee.cjs.prod.js} +16 -14
  30. package/dist/{oidc-callback-5f3d5280.esm.js → oidc-callback-82aa6be5.esm.js} +16 -14
  31. package/dist/{project-container-2d3d027a.cjs.prod.js → project-container-2f98a9d6.cjs.prod.js} +53 -19
  32. package/dist/{project-container-a11a31ca.cjs.dev.js → project-container-991a64a8.cjs.dev.js} +53 -19
  33. package/dist/{project-container-fba09841.esm.js → project-container-ce0f6228.esm.js} +52 -19
  34. package/dist/{project-expired-ede4d485.esm.js → project-expired-49e78c8c.esm.js} +12 -11
  35. package/dist/{project-expired-f38a712a.cjs.prod.js → project-expired-f753ba58.cjs.prod.js} +12 -11
  36. package/dist/{project-expired-9620dee4.cjs.dev.js → project-expired-fa4a86df.cjs.dev.js} +12 -11
  37. package/dist/{project-not-found-05683f8e.cjs.dev.js → project-not-found-261f37e8.cjs.dev.js} +11 -10
  38. package/dist/{project-not-found-093ab795.esm.js → project-not-found-ac82676b.esm.js} +11 -10
  39. package/dist/{project-not-found-cfa934da.cjs.prod.js → project-not-found-d594db71.cjs.prod.js} +11 -10
  40. package/dist/{project-not-initialized-1d934ae7.esm.js → project-not-initialized-4c02d4b2.esm.js} +12 -11
  41. package/dist/{project-not-initialized-b5a1400f.cjs.prod.js → project-not-initialized-5a77d844.cjs.prod.js} +12 -11
  42. package/dist/{project-not-initialized-1ed56a00.cjs.dev.js → project-not-initialized-c3a87ba6.cjs.dev.js} +12 -11
  43. package/dist/{project-suspended-68e80299.cjs.dev.js → project-suspended-42a90ea6.cjs.dev.js} +11 -10
  44. package/dist/{project-suspended-e0722654.esm.js → project-suspended-cd66814e.esm.js} +11 -10
  45. package/dist/{project-suspended-8e15a452.cjs.prod.js → project-suspended-dccadfd7.cjs.prod.js} +11 -10
  46. package/dist/{redirect-to-login-12f467b8.cjs.prod.js → redirect-to-login-3e4a6434.cjs.prod.js} +13 -10
  47. package/dist/{redirect-to-login-3bee13ba.cjs.dev.js → redirect-to-login-66ea895a.cjs.dev.js} +13 -10
  48. package/dist/{redirect-to-login-2944c890.esm.js → redirect-to-login-edbfacbc.esm.js} +13 -10
  49. package/dist/{redirect-to-logout-2802852c.cjs.prod.js → redirect-to-logout-99db4db7.cjs.prod.js} +14 -12
  50. package/dist/{redirect-to-logout-74b72fe8.cjs.dev.js → redirect-to-logout-ab0c374b.cjs.dev.js} +14 -12
  51. package/dist/{redirect-to-logout-5db48f16.esm.js → redirect-to-logout-ba40d106.esm.js} +14 -12
  52. package/dist/{redirector-72ccfbc2.cjs.dev.js → redirector-0efdd994.cjs.dev.js} +4 -3
  53. package/dist/{redirector-d856975f.esm.js → redirector-656c6ee7.esm.js} +4 -3
  54. package/dist/{redirector-0c72d0a4.cjs.prod.js → redirector-c858d578.cjs.prod.js} +4 -3
  55. package/dist/{requests-in-flight-loader-e25f4c31.esm.js → requests-in-flight-loader-64a40481.esm.js} +11 -10
  56. package/dist/{requests-in-flight-loader-bc904171.cjs.dev.js → requests-in-flight-loader-878840c1.cjs.dev.js} +11 -10
  57. package/dist/{requests-in-flight-loader-877c1541.cjs.prod.js → requests-in-flight-loader-df9d1de3.cjs.prod.js} +11 -10
  58. package/dist/{service-page-project-switcher-af044ac6.cjs.dev.js → service-page-project-switcher-0f1c1d7f.cjs.dev.js} +1 -1
  59. package/dist/{service-page-project-switcher-1dad9871.cjs.prod.js → service-page-project-switcher-532df57f.cjs.prod.js} +1 -1
  60. package/dist/{service-page-project-switcher-f3eac18a.esm.js → service-page-project-switcher-aca41b09.esm.js} +1 -1
  61. package/dist/{use-applications-menu-14a5a1f4.cjs.prod.js → use-applications-menu-21c7420b.cjs.prod.js} +48 -40
  62. package/dist/{use-applications-menu-823a2492.cjs.dev.js → use-applications-menu-7a85c3ee.cjs.dev.js} +48 -40
  63. package/dist/{use-applications-menu-1514af11.esm.js → use-applications-menu-8ff2d130.esm.js} +45 -38
  64. package/dist/{user-settings-menu-d75f4958.cjs.prod.js → user-settings-menu-2d3bfa75.cjs.prod.js} +29 -22
  65. package/dist/{user-settings-menu-f98bea89.esm.js → user-settings-menu-31e6bb38.esm.js} +29 -22
  66. package/dist/{user-settings-menu-6113cdd3.cjs.dev.js → user-settings-menu-c37b343f.cjs.dev.js} +29 -22
  67. package/package.json +16 -16
  68. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +2 -1
  69. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +2 -1
  70. package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +2 -1
  71. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +26 -22
  72. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +26 -22
  73. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +20 -17
  74. package/dist/oidc-8827f9fe.cjs.dev.js +0 -98
  75. package/dist/oidc-b2520905.esm.js +0 -84
  76. package/dist/oidc-d74e6aa2.cjs.prod.js +0 -98
  77. package/dist/quick-access-9dd197bb.cjs.prod.js +0 -1875
  78. package/dist/quick-access-a665bbb7.cjs.dev.js +0 -1893
  79. package/dist/quick-access-dfc1f8a9.esm.js +0 -1865
@@ -13,11 +13,11 @@ var ReactDOM = require('react-dom');
13
13
  var reactIntl = require('react-intl');
14
14
  var reactRedux = require('react-redux');
15
15
  var LoadingSpinner = require('@commercetools-uikit/loading-spinner');
16
- var dist_commercetoolsFrontendApplicationShell = require('./index-a57c8458.cjs.dev.js');
16
+ var dist_commercetoolsFrontendApplicationShell = require('./index-dcd3d8a3.cjs.dev.js');
17
17
  var jsxRuntime = require('@emotion/react/jsx-runtime');
18
18
  require('react');
19
19
  require('react-router-dom');
20
- require('./index-614accc4.cjs.dev.js');
20
+ require('./index-25183095.cjs.dev.js');
21
21
  require('@babel/runtime-corejs3/helpers/slicedToArray');
22
22
  require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
23
23
  require('@babel/runtime-corejs3/core-js-stable/object/entries');
@@ -45,7 +45,7 @@ require('@babel/runtime-corejs3/core-js-stable/array/is-array');
45
45
  require('@emotion/react');
46
46
  require('@commercetools-frontend/application-components');
47
47
  require('@commercetools-frontend/i18n');
48
- require('./oidc-8827f9fe.cjs.dev.js');
48
+ require('./oidc-87d116c1.cjs.dev.js');
49
49
  require('@babel/runtime-corejs3/core-js-stable/instance/map');
50
50
  require('@babel/runtime-corejs3/core-js-stable/url');
51
51
  require('@commercetools-uikit/design-system');
@@ -53,6 +53,7 @@ require('@commercetools-uikit/spacings');
53
53
  require('@commercetools-uikit/flat-button');
54
54
  require('@commercetools-uikit/icons');
55
55
  require('./location-c835b8df.cjs.dev.js');
56
+ require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
56
57
  require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
57
58
  require('memoize-one');
58
59
  require('react-select');
@@ -62,12 +63,6 @@ require('@commercetools-uikit/text');
62
63
  require('@commercetools-frontend/assets/images/ct-logo.svg');
63
64
  require('@commercetools-frontend/browser-history');
64
65
  require('@commercetools-frontend/l10n');
65
- require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
66
- require('@babel/runtime-corejs3/helpers/classCallCheck');
67
- require('@babel/runtime-corejs3/helpers/createClass');
68
- require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
69
- require('@babel/runtime-corejs3/helpers/getPrototypeOf');
70
- require('@babel/runtime-corejs3/helpers/inherits');
71
66
  require('@babel/runtime-corejs3/core-js-stable/object/from-entries');
72
67
  require('@babel/runtime-corejs3/core-js-stable/instance/flags');
73
68
  require('@apollo/client/react');
@@ -76,6 +71,12 @@ require('@flopflip/http-adapter');
76
71
  require('@flopflip/launchdarkly-adapter');
77
72
  require('@flopflip/react-broadcast');
78
73
  require('@flopflip/types');
74
+ require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
75
+ require('@babel/runtime-corejs3/helpers/classCallCheck');
76
+ require('@babel/runtime-corejs3/helpers/createClass');
77
+ require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
78
+ require('@babel/runtime-corejs3/helpers/getPrototypeOf');
79
+ require('@babel/runtime-corejs3/helpers/inherits');
79
80
  require('@commercetools-uikit/design-system/materials/resets.css');
80
81
  require('@commercetools-frontend/application-config/ssr');
81
82
  require('@commercetools-frontend/permissions');
@@ -109,7 +110,7 @@ var messages = reactIntl.defineMessages({
109
110
 
110
111
  function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
111
112
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
112
- const getPortalContainer = () => process.env.NODE_ENV === 'test' ? document.body : document.querySelector(`#${dist_commercetoolsFrontendApplicationShell.REQUESTS_IN_FLIGHT_LOADER_DOM_ID}`);
113
+ const getPortalContainer = () => process.env.NODE_ENV === 'test' ? document.body : document.querySelector("#".concat(dist_commercetoolsFrontendApplicationShell.REQUESTS_IN_FLIGHT_LOADER_DOM_ID));
113
114
  const RequestsInFlightLoader = () => {
114
115
  const hasRequestsInFlight = reactRedux.useSelector(state => Boolean(state.requestsInFlight && state.requestsInFlight.length > 0));
115
116
  if (!hasRequestsInFlight) return null;
@@ -13,11 +13,11 @@ var ReactDOM = require('react-dom');
13
13
  var reactIntl = require('react-intl');
14
14
  var reactRedux = require('react-redux');
15
15
  var LoadingSpinner = require('@commercetools-uikit/loading-spinner');
16
- var dist_commercetoolsFrontendApplicationShell = require('./index-7bdde97c.cjs.prod.js');
16
+ var dist_commercetoolsFrontendApplicationShell = require('./index-242af4d2.cjs.prod.js');
17
17
  var jsxRuntime = require('@emotion/react/jsx-runtime');
18
18
  require('react');
19
19
  require('react-router-dom');
20
- require('./index-245e2980.cjs.prod.js');
20
+ require('./index-52c724ed.cjs.prod.js');
21
21
  require('@babel/runtime-corejs3/helpers/slicedToArray');
22
22
  require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
23
23
  require('@babel/runtime-corejs3/core-js-stable/object/entries');
@@ -45,7 +45,7 @@ require('@babel/runtime-corejs3/core-js-stable/array/is-array');
45
45
  require('@emotion/react');
46
46
  require('@commercetools-frontend/application-components');
47
47
  require('@commercetools-frontend/i18n');
48
- require('./oidc-d74e6aa2.cjs.prod.js');
48
+ require('./oidc-258fc018.cjs.prod.js');
49
49
  require('@babel/runtime-corejs3/core-js-stable/instance/map');
50
50
  require('@babel/runtime-corejs3/core-js-stable/url');
51
51
  require('@commercetools-uikit/design-system');
@@ -53,6 +53,7 @@ require('@commercetools-uikit/spacings');
53
53
  require('@commercetools-uikit/flat-button');
54
54
  require('@commercetools-uikit/icons');
55
55
  require('./location-537e0660.cjs.prod.js');
56
+ require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
56
57
  require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
57
58
  require('memoize-one');
58
59
  require('react-select');
@@ -62,12 +63,6 @@ require('@commercetools-uikit/text');
62
63
  require('@commercetools-frontend/assets/images/ct-logo.svg');
63
64
  require('@commercetools-frontend/browser-history');
64
65
  require('@commercetools-frontend/l10n');
65
- require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
66
- require('@babel/runtime-corejs3/helpers/classCallCheck');
67
- require('@babel/runtime-corejs3/helpers/createClass');
68
- require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
69
- require('@babel/runtime-corejs3/helpers/getPrototypeOf');
70
- require('@babel/runtime-corejs3/helpers/inherits');
71
66
  require('@babel/runtime-corejs3/core-js-stable/object/from-entries');
72
67
  require('@babel/runtime-corejs3/core-js-stable/instance/flags');
73
68
  require('@apollo/client/react');
@@ -76,6 +71,12 @@ require('@flopflip/http-adapter');
76
71
  require('@flopflip/launchdarkly-adapter');
77
72
  require('@flopflip/react-broadcast');
78
73
  require('@flopflip/types');
74
+ require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
75
+ require('@babel/runtime-corejs3/helpers/classCallCheck');
76
+ require('@babel/runtime-corejs3/helpers/createClass');
77
+ require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
78
+ require('@babel/runtime-corejs3/helpers/getPrototypeOf');
79
+ require('@babel/runtime-corejs3/helpers/inherits');
79
80
  require('@commercetools-uikit/design-system/materials/resets.css');
80
81
  require('@commercetools-frontend/application-config/ssr');
81
82
  require('@commercetools-frontend/permissions');
@@ -109,7 +110,7 @@ var messages = reactIntl.defineMessages({
109
110
 
110
111
  function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
111
112
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
112
- const getPortalContainer = () => document.querySelector(`#${dist_commercetoolsFrontendApplicationShell.REQUESTS_IN_FLIGHT_LOADER_DOM_ID}`);
113
+ const getPortalContainer = () => document.querySelector("#".concat(dist_commercetoolsFrontendApplicationShell.REQUESTS_IN_FLIGHT_LOADER_DOM_ID));
113
114
  const RequestsInFlightLoader = () => {
114
115
  const hasRequestsInFlight = reactRedux.useSelector(state => Boolean(state.requestsInFlight && state.requestsInFlight.length > 0));
115
116
  if (!hasRequestsInFlight) return null;
@@ -3,7 +3,7 @@
3
3
  var _styled = require('@emotion/styled/base');
4
4
  var reactRouterDom = require('react-router-dom');
5
5
  var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
6
- var dist_commercetoolsFrontendApplicationShell = require('./index-a57c8458.cjs.dev.js');
6
+ var dist_commercetoolsFrontendApplicationShell = require('./index-dcd3d8a3.cjs.dev.js');
7
7
  var jsxRuntime = require('@emotion/react/jsx-runtime');
8
8
 
9
9
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -3,7 +3,7 @@
3
3
  var _styled = require('@emotion/styled/base');
4
4
  var reactRouterDom = require('react-router-dom');
5
5
  var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
6
- var dist_commercetoolsFrontendApplicationShell = require('./index-7bdde97c.cjs.prod.js');
6
+ var dist_commercetoolsFrontendApplicationShell = require('./index-242af4d2.cjs.prod.js');
7
7
  var jsxRuntime = require('@emotion/react/jsx-runtime');
8
8
 
9
9
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -1,7 +1,7 @@
1
1
  import _styled from '@emotion/styled/base';
2
2
  import { useParams } from 'react-router-dom';
3
3
  import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
4
- import { d as ProjectSwitcher } from './index-67a5d8e8.esm.js';
4
+ import { P as ProjectSwitcher } from './index-d8c26ca0.esm.js';
5
5
  import { jsx } from '@emotion/react/jsx-runtime';
6
6
 
7
7
  function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
@@ -1,9 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
4
- var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
5
- var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
6
- var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
7
3
  var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
8
4
  var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
9
5
  var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
@@ -12,6 +8,11 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
12
8
  var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
13
9
  var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
14
10
  var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
11
+ var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
12
+ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
13
+ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
14
+ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
15
+ var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
15
16
  var react = require('react');
16
17
  var client = require('@apollo/client');
17
18
  var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
@@ -19,8 +20,6 @@ var l10n = require('@commercetools-frontend/l10n');
19
20
 
20
21
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
21
22
 
22
- var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
23
- var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
24
23
  var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
25
24
  var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
26
25
  var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
@@ -29,10 +28,13 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
29
28
  var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
30
29
  var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
31
30
  var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
31
+ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
32
+ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
33
+ var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
32
34
 
33
35
  function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
34
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
35
- var FetchApplicationsMenu = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchApplicationsMenu" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "applicationsMenu" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "appBar" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "navBarGroups" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "items" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "icon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "menuVisibility" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "actionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "dataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "submenu" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "menuVisibility" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "actionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "dataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 939, source: { body: "query FetchApplicationsMenu {\n applicationsMenu {\n appBar {\n key\n uriPath\n labelAllLocales {\n locale\n value\n }\n featureToggle\n permissions\n }\n navBarGroups {\n key\n items {\n key\n uriPath\n icon\n labelAllLocales {\n locale\n value\n }\n featureToggle\n menuVisibility\n permissions\n actionRights {\n group\n name\n }\n dataFences {\n group\n name\n type\n }\n submenu {\n key\n uriPath\n labelAllLocales {\n locale\n value\n }\n featureToggle\n menuVisibility\n permissions\n actionRights {\n group\n name\n }\n dataFences {\n group\n name\n type\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
36
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
37
+ var FetchApplicationsMenu = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchApplicationsMenu" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "applicationsMenu" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "appBar" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "navBarGroups" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "items" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "icon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "actionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "dataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "submenu" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "actionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "dataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 891, source: { body: "query FetchApplicationsMenu {\n applicationsMenu {\n appBar {\n key\n uriPath\n labelAllLocales {\n locale\n value\n }\n featureToggle\n permissions\n }\n navBarGroups {\n key\n items {\n key\n uriPath\n icon\n labelAllLocales {\n locale\n value\n }\n featureToggle\n permissions\n actionRights {\n group\n name\n }\n dataFences {\n group\n name\n type\n }\n submenu {\n key\n uriPath\n labelAllLocales {\n locale\n value\n }\n featureToggle\n permissions\n actionRights {\n group\n name\n }\n dataFences {\n group\n name\n type\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
36
38
  const defaultApiUrl = window.location.origin;
37
39
  const mapLabelAllLocalesWithDefaults = (labelAllLocales, defaultLabel) => {
38
40
  let mappedLabelAllLocales = labelAllLocales;
@@ -61,11 +63,11 @@ const mapLabelAllLocalesWithDefaults = (labelAllLocales, defaultLabel) => {
61
63
  * This is only needed for development.
62
64
  */
63
65
  const mapApplicationMenuConfigToGraqhQLQueryResult = applicationConfig => {
64
- var _context2;
66
+ var _applicationConfig$__, _ref, _applicationConfig$__2, _menuLinks$featureTog, _menuLinks$menuVisibi, _menuLinks$actionRigh, _menuLinks$dataFences, _context2;
65
67
  const entryPointUriPath = applicationConfig.entryPointUriPath;
66
- const menuLinks = applicationConfig.__DEVELOPMENT__?.menuLinks;
68
+ const menuLinks = (_applicationConfig$__ = applicationConfig.__DEVELOPMENT__) === null || _applicationConfig$__ === void 0 ? void 0 : _applicationConfig$__.menuLinks;
67
69
  // @ts-expect-error: the `accountLinks` is not explicitly typed as it's only used by the account app.
68
- const accountLinks = applicationConfig.__DEVELOPMENT__?.accountLinks ?? [];
70
+ const accountLinks = (_ref = (_applicationConfig$__2 = applicationConfig.__DEVELOPMENT__) === null || _applicationConfig$__2 === void 0 ? void 0 : _applicationConfig$__2.accountLinks) !== null && _ref !== void 0 ? _ref : [];
69
71
  return {
70
72
  applicationsMenu: {
71
73
  __typename: 'ApplicationsMenu',
@@ -80,39 +82,45 @@ const mapApplicationMenuConfigToGraqhQLQueryResult = applicationConfig => {
80
82
  labelAllLocales: mapLabelAllLocalesWithDefaults(menuLinks.labelAllLocales, menuLinks.defaultLabel),
81
83
  permissions: menuLinks.permissions,
82
84
  // @ts-ignore: not defined in schema, as it's only used internally.
83
- featureToggle: menuLinks.featureToggle ?? null,
85
+ featureToggle: (_menuLinks$featureTog = menuLinks.featureToggle) !== null && _menuLinks$featureTog !== void 0 ? _menuLinks$featureTog : null,
84
86
  // @ts-ignore: not defined in schema, as it's only used internally.
85
- menuVisibility: menuLinks.menuVisibility ?? null,
87
+ menuVisibility: (_menuLinks$menuVisibi = menuLinks.menuVisibility) !== null && _menuLinks$menuVisibi !== void 0 ? _menuLinks$menuVisibi : null,
86
88
  // @ts-ignore: not defined in schema, as it's only used internally.
87
- actionRights: menuLinks.actionRights ?? null,
89
+ actionRights: (_menuLinks$actionRigh = menuLinks.actionRights) !== null && _menuLinks$actionRigh !== void 0 ? _menuLinks$actionRigh : null,
88
90
  // @ts-ignore: not defined in schema, as it's only used internally.
89
- dataFences: menuLinks.dataFences ?? null,
90
- submenu: _mapInstanceProperty__default["default"](_context2 = menuLinks.submenuLinks).call(_context2, submenuLink => ({
91
- __typename: 'BaseMenu',
92
- key: `${entryPointUriPath}-${submenuLink.uriPath}`,
93
- uriPath: submenuLink.uriPath,
94
- labelAllLocales: mapLabelAllLocalesWithDefaults(submenuLink.labelAllLocales, submenuLink.defaultLabel),
95
- permissions: submenuLink.permissions,
96
- // @ts-ignore: not defined in schema, as it's only used internally.
97
- featureToggle: submenuLink.featureToggle ?? null,
98
- // @ts-ignore: not defined in schema, as it's only used internally.
99
- menuVisibility: submenuLink.menuVisibility ?? null,
100
- // @ts-ignore: not defined in schema, as it's only used internally.
101
- actionRights: submenuLink.actionRights ?? null,
102
- // @ts-ignore: not defined in schema, as it's only used internally.
103
- dataFences: submenuLink.dataFences ?? null
104
- }))
91
+ dataFences: (_menuLinks$dataFences = menuLinks.dataFences) !== null && _menuLinks$dataFences !== void 0 ? _menuLinks$dataFences : null,
92
+ submenu: _mapInstanceProperty__default["default"](_context2 = menuLinks.submenuLinks).call(_context2, submenuLink => {
93
+ var _context3, _submenuLink$featureT, _submenuLink$menuVisi, _submenuLink$actionRi, _submenuLink$dataFenc;
94
+ return {
95
+ __typename: 'BaseMenu',
96
+ key: _concatInstanceProperty__default["default"](_context3 = "".concat(entryPointUriPath, "-")).call(_context3, submenuLink.uriPath),
97
+ uriPath: submenuLink.uriPath,
98
+ labelAllLocales: mapLabelAllLocalesWithDefaults(submenuLink.labelAllLocales, submenuLink.defaultLabel),
99
+ permissions: submenuLink.permissions,
100
+ // @ts-ignore: not defined in schema, as it's only used internally.
101
+ featureToggle: (_submenuLink$featureT = submenuLink.featureToggle) !== null && _submenuLink$featureT !== void 0 ? _submenuLink$featureT : null,
102
+ // @ts-ignore: not defined in schema, as it's only used internally.
103
+ menuVisibility: (_submenuLink$menuVisi = submenuLink.menuVisibility) !== null && _submenuLink$menuVisi !== void 0 ? _submenuLink$menuVisi : null,
104
+ // @ts-ignore: not defined in schema, as it's only used internally.
105
+ actionRights: (_submenuLink$actionRi = submenuLink.actionRights) !== null && _submenuLink$actionRi !== void 0 ? _submenuLink$actionRi : null,
106
+ // @ts-ignore: not defined in schema, as it's only used internally.
107
+ dataFences: (_submenuLink$dataFenc = submenuLink.dataFences) !== null && _submenuLink$dataFenc !== void 0 ? _submenuLink$dataFenc : null
108
+ };
109
+ })
105
110
  }]
106
111
  }] : [],
107
- appBar: _mapInstanceProperty__default["default"](accountLinks).call(accountLinks, menuLink => ({
108
- __typename: 'BaseMenu',
109
- key: menuLink.uriPath,
110
- uriPath: menuLink.uriPath,
111
- labelAllLocales: mapLabelAllLocalesWithDefaults(menuLink.labelAllLocales, menuLink.defaultLabel),
112
- permissions: menuLink.permissions,
113
- // @ts-ignore: not defined in schema, as it's only used internally.
114
- featureToggle: menuLink.featureToggle ?? null
115
- }))
112
+ appBar: _mapInstanceProperty__default["default"](accountLinks).call(accountLinks, menuLink => {
113
+ var _menuLink$featureTogg;
114
+ return {
115
+ __typename: 'BaseMenu',
116
+ key: menuLink.uriPath,
117
+ uriPath: menuLink.uriPath,
118
+ labelAllLocales: mapLabelAllLocalesWithDefaults(menuLink.labelAllLocales, menuLink.defaultLabel),
119
+ permissions: menuLink.permissions,
120
+ // @ts-ignore: not defined in schema, as it's only used internally.
121
+ featureToggle: (_menuLink$featureTogg = menuLink.featureToggle) !== null && _menuLink$featureTogg !== void 0 ? _menuLink$featureTogg : null
122
+ };
123
+ })
116
124
  }
117
125
  };
118
126
  };
@@ -141,7 +149,7 @@ function useApplicationsMenu(menuKey, config) {
141
149
  fetchPolicy: config.environment.servedByProxy ? 'cache-first' : 'cache-only',
142
150
  context: {
143
151
  // Allow to overwrite the API url from application config
144
- uri: `${mcProxyApiUrl || defaultApiUrl}/api/graphql`,
152
+ uri: "".concat(mcProxyApiUrl || defaultApiUrl, "/api/graphql"),
145
153
  skipGraphQlTargetCheck: true
146
154
  }
147
155
  }),
@@ -1,9 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
4
- var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
5
- var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
6
- var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
7
3
  var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
8
4
  var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
9
5
  var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
@@ -12,6 +8,11 @@ var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/in
12
8
  var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
13
9
  var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
14
10
  var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
11
+ var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
12
+ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
13
+ var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
14
+ var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
15
+ var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
15
16
  var react = require('react');
16
17
  var client = require('@apollo/client');
17
18
  var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
@@ -19,8 +20,6 @@ var l10n = require('@commercetools-frontend/l10n');
19
20
 
20
21
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
21
22
 
22
- var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
23
- var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
24
23
  var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
25
24
  var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
26
25
  var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
@@ -29,10 +28,13 @@ var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachIns
29
28
  var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
30
29
  var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
31
30
  var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
31
+ var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
32
+ var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
33
+ var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
32
34
 
33
35
  function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
34
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
35
- var FetchApplicationsMenu = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchApplicationsMenu" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "applicationsMenu" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "appBar" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "navBarGroups" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "items" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "icon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "menuVisibility" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "actionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "dataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "submenu" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "menuVisibility" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "actionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "dataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 939, source: { body: "query FetchApplicationsMenu {\n applicationsMenu {\n appBar {\n key\n uriPath\n labelAllLocales {\n locale\n value\n }\n featureToggle\n permissions\n }\n navBarGroups {\n key\n items {\n key\n uriPath\n icon\n labelAllLocales {\n locale\n value\n }\n featureToggle\n menuVisibility\n permissions\n actionRights {\n group\n name\n }\n dataFences {\n group\n name\n type\n }\n submenu {\n key\n uriPath\n labelAllLocales {\n locale\n value\n }\n featureToggle\n menuVisibility\n permissions\n actionRights {\n group\n name\n }\n dataFences {\n group\n name\n type\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
36
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
37
+ var FetchApplicationsMenu = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FetchApplicationsMenu" }, variableDefinitions: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "applicationsMenu" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "appBar" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "navBarGroups" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "items" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "icon" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "actionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "dataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "submenu" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "key" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "uriPath" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "labelAllLocales" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "locale" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "value" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "featureToggle" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "permissions" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "actionRights" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }] } }, { kind: "Field", name: { kind: "Name", value: "dataFences" }, arguments: [], directives: [], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "group" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "name" }, arguments: [], directives: [] }, { kind: "Field", name: { kind: "Name", value: "type" }, arguments: [], directives: [] }] } }] } }] } }] } }] } }] } }], loc: { start: 0, end: 891, source: { body: "query FetchApplicationsMenu {\n applicationsMenu {\n appBar {\n key\n uriPath\n labelAllLocales {\n locale\n value\n }\n featureToggle\n permissions\n }\n navBarGroups {\n key\n items {\n key\n uriPath\n icon\n labelAllLocales {\n locale\n value\n }\n featureToggle\n permissions\n actionRights {\n group\n name\n }\n dataFences {\n group\n name\n type\n }\n submenu {\n key\n uriPath\n labelAllLocales {\n locale\n value\n }\n featureToggle\n permissions\n actionRights {\n group\n name\n }\n dataFences {\n group\n name\n type\n }\n }\n }\n }\n }\n}\n", name: "GraphQL request", locationOffset: { line: 1, column: 1 } } } };
36
38
  const defaultApiUrl = window.location.origin;
37
39
  const mapLabelAllLocalesWithDefaults = (labelAllLocales, defaultLabel) => {
38
40
  let mappedLabelAllLocales = labelAllLocales;
@@ -61,11 +63,11 @@ const mapLabelAllLocalesWithDefaults = (labelAllLocales, defaultLabel) => {
61
63
  * This is only needed for development.
62
64
  */
63
65
  const mapApplicationMenuConfigToGraqhQLQueryResult = applicationConfig => {
64
- var _context2;
66
+ var _applicationConfig$__, _ref, _applicationConfig$__2, _menuLinks$featureTog, _menuLinks$menuVisibi, _menuLinks$actionRigh, _menuLinks$dataFences, _context2;
65
67
  const entryPointUriPath = applicationConfig.entryPointUriPath;
66
- const menuLinks = applicationConfig.__DEVELOPMENT__?.menuLinks;
68
+ const menuLinks = (_applicationConfig$__ = applicationConfig.__DEVELOPMENT__) === null || _applicationConfig$__ === void 0 ? void 0 : _applicationConfig$__.menuLinks;
67
69
  // @ts-expect-error: the `accountLinks` is not explicitly typed as it's only used by the account app.
68
- const accountLinks = applicationConfig.__DEVELOPMENT__?.accountLinks ?? [];
70
+ const accountLinks = (_ref = (_applicationConfig$__2 = applicationConfig.__DEVELOPMENT__) === null || _applicationConfig$__2 === void 0 ? void 0 : _applicationConfig$__2.accountLinks) !== null && _ref !== void 0 ? _ref : [];
69
71
  return {
70
72
  applicationsMenu: {
71
73
  __typename: 'ApplicationsMenu',
@@ -80,39 +82,45 @@ const mapApplicationMenuConfigToGraqhQLQueryResult = applicationConfig => {
80
82
  labelAllLocales: mapLabelAllLocalesWithDefaults(menuLinks.labelAllLocales, menuLinks.defaultLabel),
81
83
  permissions: menuLinks.permissions,
82
84
  // @ts-ignore: not defined in schema, as it's only used internally.
83
- featureToggle: menuLinks.featureToggle ?? null,
85
+ featureToggle: (_menuLinks$featureTog = menuLinks.featureToggle) !== null && _menuLinks$featureTog !== void 0 ? _menuLinks$featureTog : null,
84
86
  // @ts-ignore: not defined in schema, as it's only used internally.
85
- menuVisibility: menuLinks.menuVisibility ?? null,
87
+ menuVisibility: (_menuLinks$menuVisibi = menuLinks.menuVisibility) !== null && _menuLinks$menuVisibi !== void 0 ? _menuLinks$menuVisibi : null,
86
88
  // @ts-ignore: not defined in schema, as it's only used internally.
87
- actionRights: menuLinks.actionRights ?? null,
89
+ actionRights: (_menuLinks$actionRigh = menuLinks.actionRights) !== null && _menuLinks$actionRigh !== void 0 ? _menuLinks$actionRigh : null,
88
90
  // @ts-ignore: not defined in schema, as it's only used internally.
89
- dataFences: menuLinks.dataFences ?? null,
90
- submenu: _mapInstanceProperty__default["default"](_context2 = menuLinks.submenuLinks).call(_context2, submenuLink => ({
91
- __typename: 'BaseMenu',
92
- key: `${entryPointUriPath}-${submenuLink.uriPath}`,
93
- uriPath: submenuLink.uriPath,
94
- labelAllLocales: mapLabelAllLocalesWithDefaults(submenuLink.labelAllLocales, submenuLink.defaultLabel),
95
- permissions: submenuLink.permissions,
96
- // @ts-ignore: not defined in schema, as it's only used internally.
97
- featureToggle: submenuLink.featureToggle ?? null,
98
- // @ts-ignore: not defined in schema, as it's only used internally.
99
- menuVisibility: submenuLink.menuVisibility ?? null,
100
- // @ts-ignore: not defined in schema, as it's only used internally.
101
- actionRights: submenuLink.actionRights ?? null,
102
- // @ts-ignore: not defined in schema, as it's only used internally.
103
- dataFences: submenuLink.dataFences ?? null
104
- }))
91
+ dataFences: (_menuLinks$dataFences = menuLinks.dataFences) !== null && _menuLinks$dataFences !== void 0 ? _menuLinks$dataFences : null,
92
+ submenu: _mapInstanceProperty__default["default"](_context2 = menuLinks.submenuLinks).call(_context2, submenuLink => {
93
+ var _context3, _submenuLink$featureT, _submenuLink$menuVisi, _submenuLink$actionRi, _submenuLink$dataFenc;
94
+ return {
95
+ __typename: 'BaseMenu',
96
+ key: _concatInstanceProperty__default["default"](_context3 = "".concat(entryPointUriPath, "-")).call(_context3, submenuLink.uriPath),
97
+ uriPath: submenuLink.uriPath,
98
+ labelAllLocales: mapLabelAllLocalesWithDefaults(submenuLink.labelAllLocales, submenuLink.defaultLabel),
99
+ permissions: submenuLink.permissions,
100
+ // @ts-ignore: not defined in schema, as it's only used internally.
101
+ featureToggle: (_submenuLink$featureT = submenuLink.featureToggle) !== null && _submenuLink$featureT !== void 0 ? _submenuLink$featureT : null,
102
+ // @ts-ignore: not defined in schema, as it's only used internally.
103
+ menuVisibility: (_submenuLink$menuVisi = submenuLink.menuVisibility) !== null && _submenuLink$menuVisi !== void 0 ? _submenuLink$menuVisi : null,
104
+ // @ts-ignore: not defined in schema, as it's only used internally.
105
+ actionRights: (_submenuLink$actionRi = submenuLink.actionRights) !== null && _submenuLink$actionRi !== void 0 ? _submenuLink$actionRi : null,
106
+ // @ts-ignore: not defined in schema, as it's only used internally.
107
+ dataFences: (_submenuLink$dataFenc = submenuLink.dataFences) !== null && _submenuLink$dataFenc !== void 0 ? _submenuLink$dataFenc : null
108
+ };
109
+ })
105
110
  }]
106
111
  }] : [],
107
- appBar: _mapInstanceProperty__default["default"](accountLinks).call(accountLinks, menuLink => ({
108
- __typename: 'BaseMenu',
109
- key: menuLink.uriPath,
110
- uriPath: menuLink.uriPath,
111
- labelAllLocales: mapLabelAllLocalesWithDefaults(menuLink.labelAllLocales, menuLink.defaultLabel),
112
- permissions: menuLink.permissions,
113
- // @ts-ignore: not defined in schema, as it's only used internally.
114
- featureToggle: menuLink.featureToggle ?? null
115
- }))
112
+ appBar: _mapInstanceProperty__default["default"](accountLinks).call(accountLinks, menuLink => {
113
+ var _menuLink$featureTogg;
114
+ return {
115
+ __typename: 'BaseMenu',
116
+ key: menuLink.uriPath,
117
+ uriPath: menuLink.uriPath,
118
+ labelAllLocales: mapLabelAllLocalesWithDefaults(menuLink.labelAllLocales, menuLink.defaultLabel),
119
+ permissions: menuLink.permissions,
120
+ // @ts-ignore: not defined in schema, as it's only used internally.
121
+ featureToggle: (_menuLink$featureTogg = menuLink.featureToggle) !== null && _menuLink$featureTogg !== void 0 ? _menuLink$featureTogg : null
122
+ };
123
+ })
116
124
  }
117
125
  };
118
126
  };
@@ -141,7 +149,7 @@ function useApplicationsMenu(menuKey, config) {
141
149
  fetchPolicy: config.environment.servedByProxy ? 'cache-first' : 'cache-only',
142
150
  context: {
143
151
  // Allow to overwrite the API url from application config
144
- uri: `${mcProxyApiUrl || defaultApiUrl}/api/graphql`,
152
+ uri: "".concat(mcProxyApiUrl || defaultApiUrl, "/api/graphql"),
145
153
  skipGraphQlTargetCheck: true
146
154
  }
147
155
  }),