@commercetools-frontend/application-shell 24.11.0 → 24.12.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 (73) 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-091163ea.esm.js} +20 -16
  8. package/dist/{custom-view-dev-host-40b33836.cjs.dev.js → custom-view-dev-host-17daf42a.cjs.dev.js} +21 -16
  9. package/dist/{custom-view-dev-host-3a171a01.cjs.prod.js → custom-view-dev-host-a682a499.cjs.prod.js} +21 -16
  10. package/dist/{index-a57c8458.cjs.dev.js → index-1d1cc31f.cjs.dev.js} +212 -363
  11. package/dist/{index-67a5d8e8.esm.js → index-1dadca21.esm.js} +213 -362
  12. package/dist/{index-614accc4.cjs.dev.js → index-25183095.cjs.dev.js} +2 -2
  13. package/dist/{index-7bdde97c.cjs.prod.js → index-3cfc1f1e.cjs.prod.js} +200 -343
  14. package/dist/{index-245e2980.cjs.prod.js → index-52c724ed.cjs.prod.js} +2 -2
  15. package/dist/{index-86039df7.esm.js → index-5aaa33bb.esm.js} +2 -2
  16. package/dist/{navbar-022383bd.cjs.dev.js → navbar-586f7774.cjs.dev.js} +111 -92
  17. package/dist/{navbar-844d350d.esm.js → navbar-88e0fd1f.esm.js} +110 -92
  18. package/dist/{navbar-acc2cd1b.cjs.prod.js → navbar-93183a2d.cjs.prod.js} +111 -92
  19. package/dist/oidc-258fc018.cjs.prod.js +115 -0
  20. package/dist/oidc-35e8e62a.esm.js +100 -0
  21. package/dist/oidc-87d116c1.cjs.dev.js +115 -0
  22. package/dist/{oidc-callback-5f3d5280.esm.js → oidc-callback-019d623d.esm.js} +16 -14
  23. package/dist/{oidc-callback-e07f0c20.cjs.dev.js → oidc-callback-47743232.cjs.dev.js} +16 -14
  24. package/dist/{oidc-callback-ce8cbdfe.cjs.prod.js → oidc-callback-6bdb3c6f.cjs.prod.js} +16 -14
  25. package/dist/{project-container-a11a31ca.cjs.dev.js → project-container-2245f020.cjs.dev.js} +53 -19
  26. package/dist/{project-container-fba09841.esm.js → project-container-7fce9e66.esm.js} +52 -19
  27. package/dist/{project-container-2d3d027a.cjs.prod.js → project-container-954dbf0f.cjs.prod.js} +53 -19
  28. package/dist/{project-expired-ede4d485.esm.js → project-expired-1b0845c5.esm.js} +12 -11
  29. package/dist/{project-expired-9620dee4.cjs.dev.js → project-expired-c941b592.cjs.dev.js} +12 -11
  30. package/dist/{project-expired-f38a712a.cjs.prod.js → project-expired-ee8b232c.cjs.prod.js} +12 -11
  31. package/dist/{project-not-found-093ab795.esm.js → project-not-found-340217f6.esm.js} +11 -10
  32. package/dist/{project-not-found-05683f8e.cjs.dev.js → project-not-found-9b7cfe88.cjs.dev.js} +11 -10
  33. package/dist/{project-not-found-cfa934da.cjs.prod.js → project-not-found-9cee9625.cjs.prod.js} +11 -10
  34. package/dist/{project-not-initialized-1d934ae7.esm.js → project-not-initialized-55fd8df4.esm.js} +12 -11
  35. package/dist/{project-not-initialized-b5a1400f.cjs.prod.js → project-not-initialized-7a058b68.cjs.prod.js} +12 -11
  36. package/dist/{project-not-initialized-1ed56a00.cjs.dev.js → project-not-initialized-7b3843a3.cjs.dev.js} +12 -11
  37. package/dist/{project-suspended-8e15a452.cjs.prod.js → project-suspended-12618898.cjs.prod.js} +11 -10
  38. package/dist/{project-suspended-e0722654.esm.js → project-suspended-529b09d6.esm.js} +11 -10
  39. package/dist/{project-suspended-68e80299.cjs.dev.js → project-suspended-78e94b85.cjs.dev.js} +11 -10
  40. package/dist/{redirect-to-login-12f467b8.cjs.prod.js → redirect-to-login-3e4a6434.cjs.prod.js} +13 -10
  41. package/dist/{redirect-to-login-3bee13ba.cjs.dev.js → redirect-to-login-66ea895a.cjs.dev.js} +13 -10
  42. package/dist/{redirect-to-login-2944c890.esm.js → redirect-to-login-edbfacbc.esm.js} +13 -10
  43. package/dist/{redirect-to-logout-2802852c.cjs.prod.js → redirect-to-logout-52a7810f.cjs.prod.js} +14 -12
  44. package/dist/{redirect-to-logout-5db48f16.esm.js → redirect-to-logout-5d5fc361.esm.js} +14 -12
  45. package/dist/{redirect-to-logout-74b72fe8.cjs.dev.js → redirect-to-logout-b331b037.cjs.dev.js} +14 -12
  46. package/dist/{redirector-72ccfbc2.cjs.dev.js → redirector-0efdd994.cjs.dev.js} +4 -3
  47. package/dist/{redirector-d856975f.esm.js → redirector-656c6ee7.esm.js} +4 -3
  48. package/dist/{redirector-0c72d0a4.cjs.prod.js → redirector-c858d578.cjs.prod.js} +4 -3
  49. package/dist/{requests-in-flight-loader-e25f4c31.esm.js → requests-in-flight-loader-20021ccc.esm.js} +11 -10
  50. package/dist/{requests-in-flight-loader-877c1541.cjs.prod.js → requests-in-flight-loader-64d2e12d.cjs.prod.js} +11 -10
  51. package/dist/{requests-in-flight-loader-bc904171.cjs.dev.js → requests-in-flight-loader-83cab813.cjs.dev.js} +11 -10
  52. package/dist/{service-page-project-switcher-af044ac6.cjs.dev.js → service-page-project-switcher-49dabe13.cjs.dev.js} +1 -1
  53. package/dist/{service-page-project-switcher-f3eac18a.esm.js → service-page-project-switcher-6cdd506b.esm.js} +1 -1
  54. package/dist/{service-page-project-switcher-1dad9871.cjs.prod.js → service-page-project-switcher-f1b43eb7.cjs.prod.js} +1 -1
  55. package/dist/{use-applications-menu-14a5a1f4.cjs.prod.js → use-applications-menu-48d924bd.cjs.prod.js} +47 -39
  56. package/dist/{use-applications-menu-823a2492.cjs.dev.js → use-applications-menu-7f548a7a.cjs.dev.js} +47 -39
  57. package/dist/{use-applications-menu-1514af11.esm.js → use-applications-menu-b871849c.esm.js} +44 -37
  58. package/dist/{user-settings-menu-d75f4958.cjs.prod.js → user-settings-menu-6660f508.cjs.prod.js} +29 -22
  59. package/dist/{user-settings-menu-f98bea89.esm.js → user-settings-menu-afa82f2a.esm.js} +29 -22
  60. package/dist/{user-settings-menu-6113cdd3.cjs.dev.js → user-settings-menu-f5c74042.cjs.dev.js} +29 -22
  61. package/package.json +16 -16
  62. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +2 -1
  63. package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +2 -1
  64. package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +2 -1
  65. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +26 -22
  66. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +26 -22
  67. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +20 -17
  68. package/dist/oidc-8827f9fe.cjs.dev.js +0 -98
  69. package/dist/oidc-b2520905.esm.js +0 -84
  70. package/dist/oidc-d74e6aa2.cjs.prod.js +0 -98
  71. package/dist/quick-access-9dd197bb.cjs.prod.js +0 -1875
  72. package/dist/quick-access-a665bbb7.cjs.dev.js +0 -1893
  73. package/dist/quick-access-dfc1f8a9.esm.js +0 -1865
@@ -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,9 +28,12 @@ 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; }
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; }
35
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: "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
38
  const defaultApiUrl = window.location.origin;
37
39
  const mapLabelAllLocalesWithDefaults = (labelAllLocales, defaultLabel) => {
@@ -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,9 +28,12 @@ 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; }
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; }
35
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: "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
38
  const defaultApiUrl = window.location.origin;
37
39
  const mapLabelAllLocalesWithDefaults = (labelAllLocales, defaultLabel) => {
@@ -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,7 +1,3 @@
1
- import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
2
- import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
3
- import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
4
- import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
5
1
  import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
6
2
  import _Object$getOwnPropertySymbols from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
7
3
  import _filterInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/filter';
@@ -10,13 +6,18 @@ import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/inst
10
6
  import _Object$getOwnPropertyDescriptors from '@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors';
11
7
  import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/object/define-properties';
12
8
  import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
9
+ import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
10
+ import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
11
+ import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
12
+ import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
13
+ import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
13
14
  import { useState, useEffect } from 'react';
14
15
  import { useApolloClient } from '@apollo/client';
15
16
  import { useApplicationContext, useMcQuery } from '@commercetools-frontend/application-shell-connectors';
16
17
  import { getSupportedLocales } from '@commercetools-frontend/l10n';
17
18
 
18
19
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
20
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(t), !0)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
20
21
  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 } } } };
21
22
  const defaultApiUrl = window.location.origin;
22
23
  const mapLabelAllLocalesWithDefaults = (labelAllLocales, defaultLabel) => {
@@ -46,11 +47,11 @@ const mapLabelAllLocalesWithDefaults = (labelAllLocales, defaultLabel) => {
46
47
  * This is only needed for development.
47
48
  */
48
49
  const mapApplicationMenuConfigToGraqhQLQueryResult = applicationConfig => {
49
- var _context2;
50
+ var _applicationConfig$__, _ref, _applicationConfig$__2, _menuLinks$featureTog, _menuLinks$menuVisibi, _menuLinks$actionRigh, _menuLinks$dataFences, _context2;
50
51
  const entryPointUriPath = applicationConfig.entryPointUriPath;
51
- const menuLinks = applicationConfig.__DEVELOPMENT__?.menuLinks;
52
+ const menuLinks = (_applicationConfig$__ = applicationConfig.__DEVELOPMENT__) === null || _applicationConfig$__ === void 0 ? void 0 : _applicationConfig$__.menuLinks;
52
53
  // @ts-expect-error: the `accountLinks` is not explicitly typed as it's only used by the account app.
53
- const accountLinks = applicationConfig.__DEVELOPMENT__?.accountLinks ?? [];
54
+ const accountLinks = (_ref = (_applicationConfig$__2 = applicationConfig.__DEVELOPMENT__) === null || _applicationConfig$__2 === void 0 ? void 0 : _applicationConfig$__2.accountLinks) !== null && _ref !== void 0 ? _ref : [];
54
55
  return {
55
56
  applicationsMenu: {
56
57
  __typename: 'ApplicationsMenu',
@@ -65,39 +66,45 @@ const mapApplicationMenuConfigToGraqhQLQueryResult = applicationConfig => {
65
66
  labelAllLocales: mapLabelAllLocalesWithDefaults(menuLinks.labelAllLocales, menuLinks.defaultLabel),
66
67
  permissions: menuLinks.permissions,
67
68
  // @ts-ignore: not defined in schema, as it's only used internally.
68
- featureToggle: menuLinks.featureToggle ?? null,
69
+ featureToggle: (_menuLinks$featureTog = menuLinks.featureToggle) !== null && _menuLinks$featureTog !== void 0 ? _menuLinks$featureTog : null,
69
70
  // @ts-ignore: not defined in schema, as it's only used internally.
70
- menuVisibility: menuLinks.menuVisibility ?? null,
71
+ menuVisibility: (_menuLinks$menuVisibi = menuLinks.menuVisibility) !== null && _menuLinks$menuVisibi !== void 0 ? _menuLinks$menuVisibi : null,
71
72
  // @ts-ignore: not defined in schema, as it's only used internally.
72
- actionRights: menuLinks.actionRights ?? null,
73
+ actionRights: (_menuLinks$actionRigh = menuLinks.actionRights) !== null && _menuLinks$actionRigh !== void 0 ? _menuLinks$actionRigh : null,
73
74
  // @ts-ignore: not defined in schema, as it's only used internally.
74
- dataFences: menuLinks.dataFences ?? null,
75
- submenu: _mapInstanceProperty(_context2 = menuLinks.submenuLinks).call(_context2, submenuLink => ({
76
- __typename: 'BaseMenu',
77
- key: `${entryPointUriPath}-${submenuLink.uriPath}`,
78
- uriPath: submenuLink.uriPath,
79
- labelAllLocales: mapLabelAllLocalesWithDefaults(submenuLink.labelAllLocales, submenuLink.defaultLabel),
80
- permissions: submenuLink.permissions,
81
- // @ts-ignore: not defined in schema, as it's only used internally.
82
- featureToggle: submenuLink.featureToggle ?? null,
83
- // @ts-ignore: not defined in schema, as it's only used internally.
84
- menuVisibility: submenuLink.menuVisibility ?? null,
85
- // @ts-ignore: not defined in schema, as it's only used internally.
86
- actionRights: submenuLink.actionRights ?? null,
87
- // @ts-ignore: not defined in schema, as it's only used internally.
88
- dataFences: submenuLink.dataFences ?? null
89
- }))
75
+ dataFences: (_menuLinks$dataFences = menuLinks.dataFences) !== null && _menuLinks$dataFences !== void 0 ? _menuLinks$dataFences : null,
76
+ submenu: _mapInstanceProperty(_context2 = menuLinks.submenuLinks).call(_context2, submenuLink => {
77
+ var _context3, _submenuLink$featureT, _submenuLink$menuVisi, _submenuLink$actionRi, _submenuLink$dataFenc;
78
+ return {
79
+ __typename: 'BaseMenu',
80
+ key: _concatInstanceProperty(_context3 = "".concat(entryPointUriPath, "-")).call(_context3, submenuLink.uriPath),
81
+ uriPath: submenuLink.uriPath,
82
+ labelAllLocales: mapLabelAllLocalesWithDefaults(submenuLink.labelAllLocales, submenuLink.defaultLabel),
83
+ permissions: submenuLink.permissions,
84
+ // @ts-ignore: not defined in schema, as it's only used internally.
85
+ featureToggle: (_submenuLink$featureT = submenuLink.featureToggle) !== null && _submenuLink$featureT !== void 0 ? _submenuLink$featureT : null,
86
+ // @ts-ignore: not defined in schema, as it's only used internally.
87
+ menuVisibility: (_submenuLink$menuVisi = submenuLink.menuVisibility) !== null && _submenuLink$menuVisi !== void 0 ? _submenuLink$menuVisi : null,
88
+ // @ts-ignore: not defined in schema, as it's only used internally.
89
+ actionRights: (_submenuLink$actionRi = submenuLink.actionRights) !== null && _submenuLink$actionRi !== void 0 ? _submenuLink$actionRi : null,
90
+ // @ts-ignore: not defined in schema, as it's only used internally.
91
+ dataFences: (_submenuLink$dataFenc = submenuLink.dataFences) !== null && _submenuLink$dataFenc !== void 0 ? _submenuLink$dataFenc : null
92
+ };
93
+ })
90
94
  }]
91
95
  }] : [],
92
- appBar: _mapInstanceProperty(accountLinks).call(accountLinks, menuLink => ({
93
- __typename: 'BaseMenu',
94
- key: menuLink.uriPath,
95
- uriPath: menuLink.uriPath,
96
- labelAllLocales: mapLabelAllLocalesWithDefaults(menuLink.labelAllLocales, menuLink.defaultLabel),
97
- permissions: menuLink.permissions,
98
- // @ts-ignore: not defined in schema, as it's only used internally.
99
- featureToggle: menuLink.featureToggle ?? null
100
- }))
96
+ appBar: _mapInstanceProperty(accountLinks).call(accountLinks, menuLink => {
97
+ var _menuLink$featureTogg;
98
+ return {
99
+ __typename: 'BaseMenu',
100
+ key: menuLink.uriPath,
101
+ uriPath: menuLink.uriPath,
102
+ labelAllLocales: mapLabelAllLocalesWithDefaults(menuLink.labelAllLocales, menuLink.defaultLabel),
103
+ permissions: menuLink.permissions,
104
+ // @ts-ignore: not defined in schema, as it's only used internally.
105
+ featureToggle: (_menuLink$featureTogg = menuLink.featureToggle) !== null && _menuLink$featureTogg !== void 0 ? _menuLink$featureTogg : null
106
+ };
107
+ })
101
108
  }
102
109
  };
103
110
  };
@@ -126,7 +133,7 @@ function useApplicationsMenu(menuKey, config) {
126
133
  fetchPolicy: config.environment.servedByProxy ? 'cache-first' : 'cache-only',
127
134
  context: {
128
135
  // Allow to overwrite the API url from application config
129
- uri: `${mcProxyApiUrl || defaultApiUrl}/api/graphql`,
136
+ uri: "".concat(mcProxyApiUrl || defaultApiUrl, "/api/graphql"),
130
137
  skipGraphQlTargetCheck: true
131
138
  }
132
139
  }),
@@ -28,9 +28,10 @@ var Avatar = require('@commercetools-uikit/avatar');
28
28
  var designSystem = require('@commercetools-uikit/design-system');
29
29
  var Spacings = require('@commercetools-uikit/spacings');
30
30
  var Text = require('@commercetools-uikit/text');
31
- var oidc = require('./oidc-d74e6aa2.cjs.prod.js');
32
- var useApplicationsMenu = require('./use-applications-menu-14a5a1f4.cjs.prod.js');
31
+ var oidc = require('./oidc-258fc018.cjs.prod.js');
32
+ var useApplicationsMenu = require('./use-applications-menu-48d924bd.cjs.prod.js');
33
33
  var jsxRuntime = require('@emotion/react/jsx-runtime');
34
+ require('@babel/runtime-corejs3/core-js-stable/instance/concat');
34
35
  require('@apollo/client');
35
36
  require('@commercetools-frontend/l10n');
36
37
 
@@ -120,15 +121,17 @@ const UserAvatar = props => {
120
121
  };
121
122
  UserAvatar.displayName = 'UserAvatar';
122
123
  function getIsFocusedElementInMenu() {
123
- return Boolean(document.activeElement?.getAttribute('data-user-settings-menu'));
124
+ var _document$activeEleme;
125
+ return Boolean((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.getAttribute('data-user-settings-menu'));
124
126
  }
125
127
  const stateReducer = (state, changes) => {
128
+ var _ref3;
126
129
  switch (changes.type) {
127
130
  // So in case the user wants to navigate with the tab button
128
131
  // we need to make sure that the menu does not close
129
132
  case Downshift__default["default"].stateChangeTypes.blurButton:
130
133
  return _objectSpread(_objectSpread({}, changes), {}, {
131
- isOpen: (state.isOpen && getIsFocusedElementInMenu()) ?? false
134
+ isOpen: (_ref3 = state.isOpen && getIsFocusedElementInMenu()) !== null && _ref3 !== void 0 ? _ref3 : false
132
135
  });
133
136
  default:
134
137
  return changes;
@@ -175,13 +178,14 @@ const UserSettingsMenuBody = props => {
175
178
  // Focus on a menu item when it's opened through keyboard
176
179
  const menuElementRef = react.useRef(null);
177
180
  react.useEffect(() => {
178
- menuElementRef.current?.focus();
181
+ var _menuElementRef$curre;
182
+ (_menuElementRef$curre = menuElementRef.current) === null || _menuElementRef$curre === void 0 || _menuElementRef$curre.focus();
179
183
  }, []);
180
184
  const environment = applicationShellConnectors.useApplicationContext(context => context.environment);
181
185
  const applicationsAppBarMenu = useApplicationsMenu.useApplicationsMenu('appBar', {
182
186
  environment
183
187
  });
184
- const accountMenuItems = applicationsAppBarMenu ?? [];
188
+ const accountMenuItems = applicationsAppBarMenu !== null && applicationsAppBarMenu !== void 0 ? applicationsAppBarMenu : [];
185
189
  return jsxRuntime.jsx("div", {
186
190
  onKeyDown: event => {
187
191
  if (event.key === 'Esc' || event.key === 'Tab' && !getIsFocusedElementInMenu()) {
@@ -213,27 +217,30 @@ const UserSettingsMenuBody = props => {
213
217
  })
214
218
  }), accountMenuItems.length > 0 ? jsxRuntime.jsx(MenuItem, {
215
219
  hasDivider: true
216
- }) : null, _mapInstanceProperty__default["default"](accountMenuItems).call(accountMenuItems, menu => jsxRuntime.jsx(OptionalFeatureToggle, {
217
- featureToggle: menu.featureToggle ?? undefined,
218
- children: jsxRuntime.jsx(reactRouterDom.Link, {
219
- css: getUserSettingsMenuItemLinkStyles(),
220
- to: `/account/${menu.uriPath}`,
221
- onClick: () => props.downshiftProps.toggleMenu(),
222
- "data-user-settings-menu": true,
223
- ref: menuElementRef,
224
- children: jsxRuntime.jsx(MenuItem, {
225
- children: jsxRuntime.jsx(MenuItemLabel, {
226
- children: jsxRuntime.jsx(Text__default["default"].Body, {
227
- children: renderLabel(menu, props.language)
220
+ }) : null, _mapInstanceProperty__default["default"](accountMenuItems).call(accountMenuItems, menu => {
221
+ var _menu$featureToggle;
222
+ return jsxRuntime.jsx(OptionalFeatureToggle, {
223
+ featureToggle: (_menu$featureToggle = menu.featureToggle) !== null && _menu$featureToggle !== void 0 ? _menu$featureToggle : undefined,
224
+ children: jsxRuntime.jsx(reactRouterDom.Link, {
225
+ css: getUserSettingsMenuItemLinkStyles(),
226
+ to: "/account/".concat(menu.uriPath),
227
+ onClick: () => props.downshiftProps.toggleMenu(),
228
+ "data-user-settings-menu": true,
229
+ ref: menuElementRef,
230
+ children: jsxRuntime.jsx(MenuItem, {
231
+ children: jsxRuntime.jsx(MenuItemLabel, {
232
+ children: jsxRuntime.jsx(Text__default["default"].Body, {
233
+ children: renderLabel(menu, props.language)
234
+ })
228
235
  })
229
236
  })
230
237
  })
231
- })
232
- }, menu.key)), jsxRuntime.jsx(MenuItem, {
238
+ }, menu.key);
239
+ }), jsxRuntime.jsx(MenuItem, {
233
240
  hasDivider: true
234
241
  }), jsxRuntime.jsx("a", {
235
242
  css: getUserSettingsMenuItemLinkStyles(),
236
- href: `https://commercetools.com/privacy#suppliers`,
243
+ href: "https://commercetools.com/privacy#suppliers",
237
244
  target: "_blank",
238
245
  rel: "noopener noreferrer",
239
246
  onClick: () => props.downshiftProps.toggleMenu(),
@@ -267,7 +274,7 @@ const UserSettingsMenuBody = props => {
267
274
  // NOTE: we want to redirect to a new page so that the
268
275
  // server can remove things like cookie for access token.
269
276
  ,
270
- href: `/logout?reason=${constants.LOGOUT_REASONS.USER}`,
277
+ href: "/logout?reason=".concat(constants.LOGOUT_REASONS.USER),
271
278
  "data-test": "logout-button",
272
279
  "data-user-settings-menu": true,
273
280
  children: [jsxRuntime.jsx(MenuItem, {