@commercetools-frontend/application-shell 22.30.3 → 22.32.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.
- package/dist/{application-entry-point-2365588d.esm.js → application-entry-point-44f059a0.esm.js} +3 -3
- package/dist/{application-entry-point-257a1cbc.cjs.prod.js → application-entry-point-654951a6.cjs.prod.js} +2 -2
- package/dist/{application-entry-point-a403a123.cjs.dev.js → application-entry-point-c2f77f23.cjs.dev.js} +3 -3
- package/dist/commercetools-frontend-application-shell.cjs.dev.js +11 -5
- package/dist/commercetools-frontend-application-shell.cjs.prod.js +11 -5
- package/dist/commercetools-frontend-application-shell.esm.js +5 -5
- package/dist/{custom-view-dev-host-4e28e0f9.cjs.prod.js → custom-view-dev-host-50d585ab.cjs.prod.js} +12 -16
- package/dist/{custom-view-dev-host-e57a61c2.esm.js → custom-view-dev-host-8c058d60.esm.js} +12 -15
- package/dist/{custom-view-dev-host-2cc66e5d.cjs.dev.js → custom-view-dev-host-d7d6a676.cjs.dev.js} +12 -16
- package/dist/declarations/src/components/application-page-title/application-page-title.d.ts +16 -0
- package/dist/declarations/src/components/application-shell/application-shell.d.ts +17 -0
- package/dist/declarations/src/components/application-shell-authenticated/application-shell-authenticated.d.ts +4 -0
- package/dist/declarations/src/components/navbar/menu-items.d.ts +1 -0
- package/dist/declarations/src/components/navbar/menu-items.styles.d.ts +5 -1
- package/dist/declarations/src/components/navbar/navbar.d.ts +4 -0
- package/dist/declarations/src/components/navbar/use-navbar-state-manager.d.ts +6 -0
- package/dist/declarations/src/components/workspaces-navigation-button/index.d.ts +1 -0
- package/dist/declarations/src/components/workspaces-navigation-button/messages.d.ts +8 -0
- package/dist/declarations/src/components/workspaces-navigation-button/workspaces-navigation-button.d.ts +3 -0
- package/dist/declarations/src/configure-store.d.ts +3 -0
- package/dist/declarations/src/hooks/use-routes-creator/use-routes-creator.d.ts +3 -0
- package/dist/declarations/src/index.d.ts +16 -1
- package/dist/declarations/src/types/generated/ctp.d.ts +562 -0
- package/dist/declarations/src/types/generated/mc.d.ts +5 -0
- package/dist/declarations/src/types/generated/proxy.d.ts +3 -0
- package/dist/declarations/src/types/generated/settings.d.ts +22 -0
- package/dist/declarations/src/utils/get-mc-origin/get-mc-origin.d.ts +16 -0
- package/dist/{index-01054d41.esm.js → index-30d34b7f.esm.js} +185 -154
- package/dist/{index-986cb2e3.cjs.prod.js → index-312ee159.cjs.prod.js} +175 -144
- package/dist/{index-9ad54c23.cjs.dev.js → index-89389085.cjs.dev.js} +190 -153
- package/dist/{index-055ebc13.cjs.prod.js → index-91985d64.cjs.prod.js} +2 -2
- package/dist/{index-ca730730.cjs.dev.js → index-b1476d46.cjs.dev.js} +2 -2
- package/dist/{index-4e5248df.esm.js → index-b6081c20.esm.js} +2 -2
- package/dist/navbar-3b9c6b6b.esm.js +1394 -0
- package/dist/{navbar-ced649a9.cjs.prod.js → navbar-9da45ea7.cjs.prod.js} +172 -111
- package/dist/navbar-b18bb556.cjs.dev.js +1426 -0
- package/dist/oidc-6c6599a2.cjs.dev.js +98 -0
- package/dist/oidc-8275c04f.esm.js +84 -0
- package/dist/{oidc-callback-64f9a790.cjs.prod.js → oidc-callback-0e597d85.cjs.prod.js} +11 -12
- package/dist/{oidc-callback-bc478925.esm.js → oidc-callback-427bb1fe.esm.js} +11 -12
- package/dist/{oidc-callback-651f63e0.cjs.dev.js → oidc-callback-cb22ccb9.cjs.dev.js} +11 -12
- package/dist/oidc-d02d4ab8.cjs.prod.js +98 -0
- package/dist/{project-container-7b970853.cjs.prod.js → project-container-8ea3157d.cjs.prod.js} +14 -16
- package/dist/{project-container-7f10329f.cjs.dev.js → project-container-a3583d97.cjs.dev.js} +14 -16
- package/dist/{project-container-e9061cf4.esm.js → project-container-e40ef9d5.esm.js} +14 -16
- package/dist/{project-expired-7b154842.cjs.dev.js → project-expired-5fcc5f07.cjs.dev.js} +8 -8
- package/dist/{project-expired-1cb50976.esm.js → project-expired-d577ae18.esm.js} +8 -8
- package/dist/{project-expired-08aee9c1.cjs.prod.js → project-expired-dfccc21f.cjs.prod.js} +8 -8
- package/dist/{project-not-found-d1bc7cf2.cjs.prod.js → project-not-found-2278758f.cjs.prod.js} +7 -7
- package/dist/{project-not-found-1b3a3444.cjs.dev.js → project-not-found-4604d59d.cjs.dev.js} +7 -7
- package/dist/{project-not-found-3dc52680.esm.js → project-not-found-fd3a1f58.esm.js} +7 -7
- package/dist/{project-not-initialized-3ca17563.esm.js → project-not-initialized-b34c95c9.esm.js} +8 -8
- package/dist/{project-not-initialized-f314f99a.cjs.prod.js → project-not-initialized-cb1d4d19.cjs.prod.js} +8 -8
- package/dist/{project-not-initialized-72ca9efb.cjs.dev.js → project-not-initialized-d85c316d.cjs.dev.js} +8 -8
- package/dist/{project-suspended-944c20e8.esm.js → project-suspended-56e0ee3b.esm.js} +7 -7
- package/dist/{project-suspended-f767d4f0.cjs.dev.js → project-suspended-5e490e56.cjs.dev.js} +7 -7
- package/dist/{project-suspended-c5ae709a.cjs.prod.js → project-suspended-ec44d7fc.cjs.prod.js} +7 -7
- package/dist/{quick-access-ee9ef366.cjs.dev.js → quick-access-809ff4ff.cjs.dev.js} +204 -133
- package/dist/{quick-access-30cee256.esm.js → quick-access-a19e4dc0.esm.js} +204 -132
- package/dist/{quick-access-c4f74cba.cjs.prod.js → quick-access-cbb7a118.cjs.prod.js} +204 -133
- package/dist/{redirect-to-login-3ebce35d.cjs.dev.js → redirect-to-login-32ebe009.cjs.dev.js} +10 -13
- package/dist/{redirect-to-login-3c5a3f4a.cjs.prod.js → redirect-to-login-60a00442.cjs.prod.js} +10 -13
- package/dist/{redirect-to-login-af9860c8.esm.js → redirect-to-login-b69fb5ce.esm.js} +10 -13
- package/dist/{redirect-to-logout-e365ba72.cjs.prod.js → redirect-to-logout-1ffebbfe.cjs.prod.js} +9 -10
- package/dist/{redirect-to-logout-fff4cb7c.cjs.dev.js → redirect-to-logout-371cc9b1.cjs.dev.js} +9 -10
- package/dist/{redirect-to-logout-f3172701.esm.js → redirect-to-logout-7b502bb5.esm.js} +9 -10
- package/dist/{redirector-0a16c1d1.cjs.prod.js → redirector-01f35da8.cjs.prod.js} +3 -4
- package/dist/{redirector-d2fd2b5e.esm.js → redirector-76670a54.esm.js} +3 -4
- package/dist/{redirector-e58b9bc3.cjs.dev.js → redirector-98dfc5f0.cjs.dev.js} +3 -4
- package/dist/{requests-in-flight-loader-171a2177.cjs.prod.js → requests-in-flight-loader-49463178.cjs.prod.js} +7 -7
- package/dist/{requests-in-flight-loader-dd3f8cbb.cjs.dev.js → requests-in-flight-loader-7d5f946c.cjs.dev.js} +7 -7
- package/dist/{requests-in-flight-loader-acb4dbaa.esm.js → requests-in-flight-loader-e45b9001.esm.js} +7 -7
- package/dist/{service-page-project-switcher-6c523761.cjs.dev.js → service-page-project-switcher-679fa3be.cjs.dev.js} +1 -1
- package/dist/{service-page-project-switcher-65755fa9.esm.js → service-page-project-switcher-9bebaaa0.esm.js} +1 -1
- package/dist/{service-page-project-switcher-2b3f4d1d.cjs.prod.js → service-page-project-switcher-d3bc9ef6.cjs.prod.js} +1 -1
- package/dist/{use-applications-menu-2fe3d465.cjs.dev.js → use-applications-menu-222b9106.cjs.prod.js} +40 -49
- package/dist/{use-applications-menu-0d3f4ffc.cjs.prod.js → use-applications-menu-302a0ac8.cjs.dev.js} +40 -49
- package/dist/{use-applications-menu-03759eab.esm.js → use-applications-menu-b583e9c3.esm.js} +38 -46
- package/dist/{user-settings-menu-bbc43c88.cjs.dev.js → user-settings-menu-7c17f227.cjs.dev.js} +22 -29
- package/dist/{user-settings-menu-3f86267c.cjs.prod.js → user-settings-menu-8bba9f50.cjs.prod.js} +22 -29
- package/dist/{user-settings-menu-36bea559.esm.js → user-settings-menu-ff4a6c63.esm.js} +22 -29
- package/dist/{version-tracker-2ce61357.esm.js → version-tracker-58df65c0.esm.js} +6 -6
- package/dist/{version-tracker-ab883166.cjs.dev.js → version-tracker-66d5d210.cjs.dev.js} +6 -6
- package/dist/{version-tracker-b049fca7.cjs.prod.js → version-tracker-a984dbbe.cjs.prod.js} +6 -6
- package/package.json +17 -16
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.dev.js +1 -2
- package/ssr/dist/commercetools-frontend-application-shell-ssr.cjs.prod.js +1 -2
- package/ssr/dist/commercetools-frontend-application-shell-ssr.esm.js +1 -2
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +21 -26
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +21 -26
- package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +16 -20
- package/dist/navbar-e3ee2a76.esm.js +0 -1325
- package/dist/navbar-f981de75.cjs.dev.js +0 -1358
- package/dist/oidc-63e926e1.cjs.dev.js +0 -115
- package/dist/oidc-cfa56c46.cjs.prod.js +0 -115
- package/dist/oidc-ff53dfd3.esm.js +0 -100
package/dist/{user-settings-menu-bbc43c88.cjs.dev.js → user-settings-menu-7c17f227.cjs.dev.js}
RENAMED
|
@@ -30,10 +30,9 @@ var Avatar = require('@commercetools-uikit/avatar');
|
|
|
30
30
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
31
31
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
32
32
|
var Text = require('@commercetools-uikit/text');
|
|
33
|
-
var oidc = require('./oidc-
|
|
34
|
-
var useApplicationsMenu = require('./use-applications-menu-
|
|
33
|
+
var oidc = require('./oidc-6c6599a2.cjs.dev.js');
|
|
34
|
+
var useApplicationsMenu = require('./use-applications-menu-302a0ac8.cjs.dev.js');
|
|
35
35
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
36
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
37
36
|
require('@apollo/client');
|
|
38
37
|
require('@commercetools-frontend/l10n');
|
|
39
38
|
|
|
@@ -125,17 +124,15 @@ const UserAvatar = props => {
|
|
|
125
124
|
};
|
|
126
125
|
UserAvatar.displayName = 'UserAvatar';
|
|
127
126
|
function getIsFocusedElementInMenu() {
|
|
128
|
-
|
|
129
|
-
return Boolean((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.getAttribute('data-user-settings-menu'));
|
|
127
|
+
return Boolean(document.activeElement?.getAttribute('data-user-settings-menu'));
|
|
130
128
|
}
|
|
131
129
|
const stateReducer = (state, changes) => {
|
|
132
|
-
var _ref3;
|
|
133
130
|
switch (changes.type) {
|
|
134
131
|
// So in case the user wants to navigate with the tab button
|
|
135
132
|
// we need to make sure that the menu does not close
|
|
136
133
|
case Downshift__default["default"].stateChangeTypes.blurButton:
|
|
137
134
|
return _objectSpread(_objectSpread({}, changes), {}, {
|
|
138
|
-
isOpen: (
|
|
135
|
+
isOpen: (state.isOpen && getIsFocusedElementInMenu()) ?? false
|
|
139
136
|
});
|
|
140
137
|
default:
|
|
141
138
|
return changes;
|
|
@@ -200,8 +197,7 @@ const UserSettingsMenuBody = props => {
|
|
|
200
197
|
// Focus on a menu item when it's opened through keyboard
|
|
201
198
|
const menuElementRef = react.useRef(null);
|
|
202
199
|
react.useEffect(() => {
|
|
203
|
-
|
|
204
|
-
(_menuElementRef$curre = menuElementRef.current) === null || _menuElementRef$curre === void 0 || _menuElementRef$curre.focus();
|
|
200
|
+
menuElementRef.current?.focus();
|
|
205
201
|
}, []);
|
|
206
202
|
const environment = applicationShellConnectors.useApplicationContext(context => context.environment);
|
|
207
203
|
const applicationsAppBarMenu = useApplicationsMenu.useApplicationsMenu('appBar', {
|
|
@@ -210,7 +206,7 @@ const UserSettingsMenuBody = props => {
|
|
|
210
206
|
},
|
|
211
207
|
environment
|
|
212
208
|
});
|
|
213
|
-
const accountMenuItems = applicationsAppBarMenu
|
|
209
|
+
const accountMenuItems = applicationsAppBarMenu ?? [];
|
|
214
210
|
return jsxRuntime.jsx("div", {
|
|
215
211
|
onKeyDown: event => {
|
|
216
212
|
if (event.key === 'Esc' || event.key === 'Tab' && !getIsFocusedElementInMenu()) {
|
|
@@ -242,30 +238,27 @@ const UserSettingsMenuBody = props => {
|
|
|
242
238
|
})
|
|
243
239
|
}), accountMenuItems.length > 0 ? jsxRuntime.jsx(MenuItem, {
|
|
244
240
|
hasDivider: true
|
|
245
|
-
}) : null, _mapInstanceProperty__default["default"](accountMenuItems).call(accountMenuItems, menu => {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
children: jsxRuntime.jsx(Text__default["default"].Body, {
|
|
258
|
-
children: renderLabel(menu, props.language)
|
|
259
|
-
})
|
|
241
|
+
}) : null, _mapInstanceProperty__default["default"](accountMenuItems).call(accountMenuItems, menu => jsxRuntime.jsx(OptionalFeatureToggle, {
|
|
242
|
+
featureToggle: menu.featureToggle ?? undefined,
|
|
243
|
+
children: jsxRuntime.jsx(reactRouterDom.Link, {
|
|
244
|
+
css: getUserSettingsMenuItemLinkStyles(),
|
|
245
|
+
to: `/account/${menu.uriPath}`,
|
|
246
|
+
onClick: () => props.downshiftProps.toggleMenu(),
|
|
247
|
+
"data-user-settings-menu": true,
|
|
248
|
+
ref: menuElementRef,
|
|
249
|
+
children: jsxRuntime.jsx(MenuItem, {
|
|
250
|
+
children: jsxRuntime.jsx(MenuItemLabel, {
|
|
251
|
+
children: jsxRuntime.jsx(Text__default["default"].Body, {
|
|
252
|
+
children: renderLabel(menu, props.language)
|
|
260
253
|
})
|
|
261
254
|
})
|
|
262
255
|
})
|
|
263
|
-
}
|
|
264
|
-
}), jsxRuntime.jsx(MenuItem, {
|
|
256
|
+
})
|
|
257
|
+
}, menu.key)), jsxRuntime.jsx(MenuItem, {
|
|
265
258
|
hasDivider: true
|
|
266
259
|
}), jsxRuntime.jsx("a", {
|
|
267
260
|
css: getUserSettingsMenuItemLinkStyles(),
|
|
268
|
-
href:
|
|
261
|
+
href: `https://commercetools.com/privacy#suppliers`,
|
|
269
262
|
target: "_blank",
|
|
270
263
|
rel: "noopener noreferrer",
|
|
271
264
|
onClick: () => props.downshiftProps.toggleMenu(),
|
|
@@ -299,7 +292,7 @@ const UserSettingsMenuBody = props => {
|
|
|
299
292
|
// NOTE: we want to redirect to a new page so that the
|
|
300
293
|
// server can remove things like cookie for access token.
|
|
301
294
|
,
|
|
302
|
-
href:
|
|
295
|
+
href: `/logout?reason=${constants.LOGOUT_REASONS.USER}`,
|
|
303
296
|
"data-test": "logout-button",
|
|
304
297
|
"data-user-settings-menu": true,
|
|
305
298
|
children: [jsxRuntime.jsx(MenuItem, {
|
package/dist/{user-settings-menu-3f86267c.cjs.prod.js → user-settings-menu-8bba9f50.cjs.prod.js}
RENAMED
|
@@ -30,10 +30,9 @@ var Avatar = require('@commercetools-uikit/avatar');
|
|
|
30
30
|
var designSystem = require('@commercetools-uikit/design-system');
|
|
31
31
|
var Spacings = require('@commercetools-uikit/spacings');
|
|
32
32
|
var Text = require('@commercetools-uikit/text');
|
|
33
|
-
var oidc = require('./oidc-
|
|
34
|
-
var useApplicationsMenu = require('./use-applications-menu-
|
|
33
|
+
var oidc = require('./oidc-d02d4ab8.cjs.prod.js');
|
|
34
|
+
var useApplicationsMenu = require('./use-applications-menu-222b9106.cjs.prod.js');
|
|
35
35
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
36
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
37
36
|
require('@apollo/client');
|
|
38
37
|
require('@commercetools-frontend/l10n');
|
|
39
38
|
|
|
@@ -123,17 +122,15 @@ const UserAvatar = props => {
|
|
|
123
122
|
};
|
|
124
123
|
UserAvatar.displayName = 'UserAvatar';
|
|
125
124
|
function getIsFocusedElementInMenu() {
|
|
126
|
-
|
|
127
|
-
return Boolean((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.getAttribute('data-user-settings-menu'));
|
|
125
|
+
return Boolean(document.activeElement?.getAttribute('data-user-settings-menu'));
|
|
128
126
|
}
|
|
129
127
|
const stateReducer = (state, changes) => {
|
|
130
|
-
var _ref3;
|
|
131
128
|
switch (changes.type) {
|
|
132
129
|
// So in case the user wants to navigate with the tab button
|
|
133
130
|
// we need to make sure that the menu does not close
|
|
134
131
|
case Downshift__default["default"].stateChangeTypes.blurButton:
|
|
135
132
|
return _objectSpread(_objectSpread({}, changes), {}, {
|
|
136
|
-
isOpen: (
|
|
133
|
+
isOpen: (state.isOpen && getIsFocusedElementInMenu()) ?? false
|
|
137
134
|
});
|
|
138
135
|
default:
|
|
139
136
|
return changes;
|
|
@@ -183,8 +180,7 @@ const UserSettingsMenuBody = props => {
|
|
|
183
180
|
// Focus on a menu item when it's opened through keyboard
|
|
184
181
|
const menuElementRef = react.useRef(null);
|
|
185
182
|
react.useEffect(() => {
|
|
186
|
-
|
|
187
|
-
(_menuElementRef$curre = menuElementRef.current) === null || _menuElementRef$curre === void 0 || _menuElementRef$curre.focus();
|
|
183
|
+
menuElementRef.current?.focus();
|
|
188
184
|
}, []);
|
|
189
185
|
const environment = applicationShellConnectors.useApplicationContext(context => context.environment);
|
|
190
186
|
const applicationsAppBarMenu = useApplicationsMenu.useApplicationsMenu('appBar', {
|
|
@@ -193,7 +189,7 @@ const UserSettingsMenuBody = props => {
|
|
|
193
189
|
},
|
|
194
190
|
environment
|
|
195
191
|
});
|
|
196
|
-
const accountMenuItems = applicationsAppBarMenu
|
|
192
|
+
const accountMenuItems = applicationsAppBarMenu ?? [];
|
|
197
193
|
return jsxRuntime.jsx("div", {
|
|
198
194
|
onKeyDown: event => {
|
|
199
195
|
if (event.key === 'Esc' || event.key === 'Tab' && !getIsFocusedElementInMenu()) {
|
|
@@ -225,30 +221,27 @@ const UserSettingsMenuBody = props => {
|
|
|
225
221
|
})
|
|
226
222
|
}), accountMenuItems.length > 0 ? jsxRuntime.jsx(MenuItem, {
|
|
227
223
|
hasDivider: true
|
|
228
|
-
}) : null, _mapInstanceProperty__default["default"](accountMenuItems).call(accountMenuItems, menu => {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
children: jsxRuntime.jsx(Text__default["default"].Body, {
|
|
241
|
-
children: renderLabel(menu, props.language)
|
|
242
|
-
})
|
|
224
|
+
}) : null, _mapInstanceProperty__default["default"](accountMenuItems).call(accountMenuItems, menu => jsxRuntime.jsx(OptionalFeatureToggle, {
|
|
225
|
+
featureToggle: menu.featureToggle ?? undefined,
|
|
226
|
+
children: jsxRuntime.jsx(reactRouterDom.Link, {
|
|
227
|
+
css: getUserSettingsMenuItemLinkStyles(),
|
|
228
|
+
to: `/account/${menu.uriPath}`,
|
|
229
|
+
onClick: () => props.downshiftProps.toggleMenu(),
|
|
230
|
+
"data-user-settings-menu": true,
|
|
231
|
+
ref: menuElementRef,
|
|
232
|
+
children: jsxRuntime.jsx(MenuItem, {
|
|
233
|
+
children: jsxRuntime.jsx(MenuItemLabel, {
|
|
234
|
+
children: jsxRuntime.jsx(Text__default["default"].Body, {
|
|
235
|
+
children: renderLabel(menu, props.language)
|
|
243
236
|
})
|
|
244
237
|
})
|
|
245
238
|
})
|
|
246
|
-
}
|
|
247
|
-
}), jsxRuntime.jsx(MenuItem, {
|
|
239
|
+
})
|
|
240
|
+
}, menu.key)), jsxRuntime.jsx(MenuItem, {
|
|
248
241
|
hasDivider: true
|
|
249
242
|
}), jsxRuntime.jsx("a", {
|
|
250
243
|
css: getUserSettingsMenuItemLinkStyles(),
|
|
251
|
-
href:
|
|
244
|
+
href: `https://commercetools.com/privacy#suppliers`,
|
|
252
245
|
target: "_blank",
|
|
253
246
|
rel: "noopener noreferrer",
|
|
254
247
|
onClick: () => props.downshiftProps.toggleMenu(),
|
|
@@ -282,7 +275,7 @@ const UserSettingsMenuBody = props => {
|
|
|
282
275
|
// NOTE: we want to redirect to a new page so that the
|
|
283
276
|
// server can remove things like cookie for access token.
|
|
284
277
|
,
|
|
285
|
-
href:
|
|
278
|
+
href: `/logout?reason=${constants.LOGOUT_REASONS.USER}`,
|
|
286
279
|
"data-test": "logout-button",
|
|
287
280
|
"data-user-settings-menu": true,
|
|
288
281
|
children: [jsxRuntime.jsx(MenuItem, {
|
|
@@ -28,10 +28,9 @@ import Avatar from '@commercetools-uikit/avatar';
|
|
|
28
28
|
import { designTokens } from '@commercetools-uikit/design-system';
|
|
29
29
|
import Spacings from '@commercetools-uikit/spacings';
|
|
30
30
|
import Text from '@commercetools-uikit/text';
|
|
31
|
-
import { D as DIMENSIONS } from './oidc-
|
|
32
|
-
import { u as useApplicationsMenu } from './use-applications-menu-
|
|
31
|
+
import { D as DIMENSIONS } from './oidc-8275c04f.esm.js';
|
|
32
|
+
import { u as useApplicationsMenu } from './use-applications-menu-b583e9c3.esm.js';
|
|
33
33
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
34
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
35
34
|
import '@apollo/client';
|
|
36
35
|
import '@commercetools-frontend/l10n';
|
|
37
36
|
|
|
@@ -101,17 +100,15 @@ const UserAvatar = props => {
|
|
|
101
100
|
};
|
|
102
101
|
UserAvatar.displayName = 'UserAvatar';
|
|
103
102
|
function getIsFocusedElementInMenu() {
|
|
104
|
-
|
|
105
|
-
return Boolean((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.getAttribute('data-user-settings-menu'));
|
|
103
|
+
return Boolean(document.activeElement?.getAttribute('data-user-settings-menu'));
|
|
106
104
|
}
|
|
107
105
|
const stateReducer = (state, changes) => {
|
|
108
|
-
var _ref3;
|
|
109
106
|
switch (changes.type) {
|
|
110
107
|
// So in case the user wants to navigate with the tab button
|
|
111
108
|
// we need to make sure that the menu does not close
|
|
112
109
|
case Downshift.stateChangeTypes.blurButton:
|
|
113
110
|
return _objectSpread(_objectSpread({}, changes), {}, {
|
|
114
|
-
isOpen: (
|
|
111
|
+
isOpen: (state.isOpen && getIsFocusedElementInMenu()) ?? false
|
|
115
112
|
});
|
|
116
113
|
default:
|
|
117
114
|
return changes;
|
|
@@ -176,8 +173,7 @@ const UserSettingsMenuBody = props => {
|
|
|
176
173
|
// Focus on a menu item when it's opened through keyboard
|
|
177
174
|
const menuElementRef = useRef(null);
|
|
178
175
|
useEffect(() => {
|
|
179
|
-
|
|
180
|
-
(_menuElementRef$curre = menuElementRef.current) === null || _menuElementRef$curre === void 0 || _menuElementRef$curre.focus();
|
|
176
|
+
menuElementRef.current?.focus();
|
|
181
177
|
}, []);
|
|
182
178
|
const environment = useApplicationContext(context => context.environment);
|
|
183
179
|
const applicationsAppBarMenu = useApplicationsMenu('appBar', {
|
|
@@ -186,7 +182,7 @@ const UserSettingsMenuBody = props => {
|
|
|
186
182
|
},
|
|
187
183
|
environment
|
|
188
184
|
});
|
|
189
|
-
const accountMenuItems = applicationsAppBarMenu
|
|
185
|
+
const accountMenuItems = applicationsAppBarMenu ?? [];
|
|
190
186
|
return jsx("div", {
|
|
191
187
|
onKeyDown: event => {
|
|
192
188
|
if (event.key === 'Esc' || event.key === 'Tab' && !getIsFocusedElementInMenu()) {
|
|
@@ -218,30 +214,27 @@ const UserSettingsMenuBody = props => {
|
|
|
218
214
|
})
|
|
219
215
|
}), accountMenuItems.length > 0 ? jsx(MenuItem, {
|
|
220
216
|
hasDivider: true
|
|
221
|
-
}) : null, _mapInstanceProperty(accountMenuItems).call(accountMenuItems, menu => {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
children: jsx(Text.Body, {
|
|
234
|
-
children: renderLabel(menu, props.language)
|
|
235
|
-
})
|
|
217
|
+
}) : null, _mapInstanceProperty(accountMenuItems).call(accountMenuItems, menu => jsx(OptionalFeatureToggle, {
|
|
218
|
+
featureToggle: menu.featureToggle ?? undefined,
|
|
219
|
+
children: jsx(Link, {
|
|
220
|
+
css: getUserSettingsMenuItemLinkStyles(),
|
|
221
|
+
to: `/account/${menu.uriPath}`,
|
|
222
|
+
onClick: () => props.downshiftProps.toggleMenu(),
|
|
223
|
+
"data-user-settings-menu": true,
|
|
224
|
+
ref: menuElementRef,
|
|
225
|
+
children: jsx(MenuItem, {
|
|
226
|
+
children: jsx(MenuItemLabel, {
|
|
227
|
+
children: jsx(Text.Body, {
|
|
228
|
+
children: renderLabel(menu, props.language)
|
|
236
229
|
})
|
|
237
230
|
})
|
|
238
231
|
})
|
|
239
|
-
}
|
|
240
|
-
}), jsx(MenuItem, {
|
|
232
|
+
})
|
|
233
|
+
}, menu.key)), jsx(MenuItem, {
|
|
241
234
|
hasDivider: true
|
|
242
235
|
}), jsx("a", {
|
|
243
236
|
css: getUserSettingsMenuItemLinkStyles(),
|
|
244
|
-
href:
|
|
237
|
+
href: `https://commercetools.com/privacy#suppliers`,
|
|
245
238
|
target: "_blank",
|
|
246
239
|
rel: "noopener noreferrer",
|
|
247
240
|
onClick: () => props.downshiftProps.toggleMenu(),
|
|
@@ -275,7 +268,7 @@ const UserSettingsMenuBody = props => {
|
|
|
275
268
|
// NOTE: we want to redirect to a new page so that the
|
|
276
269
|
// server can remove things like cookie for access token.
|
|
277
270
|
,
|
|
278
|
-
href:
|
|
271
|
+
href: `/logout?reason=${LOGOUT_REASONS.USER}`,
|
|
279
272
|
"data-test": "logout-button",
|
|
280
273
|
"data-user-settings-menu": true,
|
|
281
274
|
children: [jsx(MenuItem, {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useEffect, version } from 'react';
|
|
2
2
|
import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
3
3
|
import { actions, useAsyncDispatch } from '@commercetools-frontend/sdk';
|
|
4
|
-
import { d as applicationShellVersion } from './index-
|
|
4
|
+
import { d as applicationShellVersion } from './index-30d34b7f.esm.js';
|
|
5
5
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
6
6
|
import { MC_API_PROXY_TARGETS } from '@commercetools-frontend/constants';
|
|
7
7
|
import 'prop-types';
|
|
8
8
|
import 'react-router-dom';
|
|
9
|
-
import './index-
|
|
9
|
+
import './index-b6081c20.esm.js';
|
|
10
10
|
import '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
11
11
|
import '@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols';
|
|
12
12
|
import '@babel/runtime-corejs3/core-js-stable/instance/filter';
|
|
@@ -38,8 +38,7 @@ import '@babel/runtime-corejs3/core-js-stable/array/is-array';
|
|
|
38
38
|
import '@emotion/react';
|
|
39
39
|
import '@commercetools-frontend/application-components';
|
|
40
40
|
import '@commercetools-frontend/i18n';
|
|
41
|
-
import './oidc-
|
|
42
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
41
|
+
import './oidc-8275c04f.esm.js';
|
|
43
42
|
import '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
44
43
|
import '@babel/runtime-corejs3/core-js-stable/url';
|
|
45
44
|
import '@commercetools-uikit/design-system';
|
|
@@ -49,13 +48,15 @@ import '@commercetools-uikit/flat-button';
|
|
|
49
48
|
import '@commercetools-uikit/icons';
|
|
50
49
|
import './location-f21dbc25.esm.js';
|
|
51
50
|
import '@emotion/react/jsx-runtime';
|
|
52
|
-
import '@babel/runtime-corejs3/helpers/taggedTemplateLiteral';
|
|
53
51
|
import '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
54
52
|
import 'memoize-one';
|
|
55
53
|
import 'react-select';
|
|
56
54
|
import '@commercetools-uikit/accessible-hidden';
|
|
57
55
|
import '@commercetools-uikit/select-input';
|
|
58
56
|
import '@commercetools-uikit/text';
|
|
57
|
+
import '@flopflip/react-broadcast';
|
|
58
|
+
import '@commercetools-uikit/secondary-button';
|
|
59
|
+
import '@commercetools-uikit/tooltip';
|
|
59
60
|
import '@commercetools-frontend/assets/images/ct-logo.svg';
|
|
60
61
|
import '@commercetools-uikit/loading-spinner';
|
|
61
62
|
import '@commercetools-frontend/browser-history';
|
|
@@ -72,7 +73,6 @@ import '@apollo/client/react';
|
|
|
72
73
|
import '@flopflip/combine-adapters';
|
|
73
74
|
import '@flopflip/http-adapter';
|
|
74
75
|
import '@flopflip/launchdarkly-adapter';
|
|
75
|
-
import '@flopflip/react-broadcast';
|
|
76
76
|
import '@flopflip/types';
|
|
77
77
|
import 'react-redux';
|
|
78
78
|
import 'lodash/upperFirst';
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
var react = require('react');
|
|
4
4
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
5
5
|
var sdk = require('@commercetools-frontend/sdk');
|
|
6
|
-
var dist_commercetoolsFrontendApplicationShell = require('./index-
|
|
6
|
+
var dist_commercetoolsFrontendApplicationShell = require('./index-89389085.cjs.dev.js');
|
|
7
7
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
8
8
|
var constants = require('@commercetools-frontend/constants');
|
|
9
9
|
require('prop-types');
|
|
10
10
|
require('react-router-dom');
|
|
11
|
-
require('./index-
|
|
11
|
+
require('./index-b1476d46.cjs.dev.js');
|
|
12
12
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
13
13
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -40,8 +40,7 @@ require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
|
40
40
|
require('@emotion/react');
|
|
41
41
|
require('@commercetools-frontend/application-components');
|
|
42
42
|
require('@commercetools-frontend/i18n');
|
|
43
|
-
require('./oidc-
|
|
44
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
43
|
+
require('./oidc-6c6599a2.cjs.dev.js');
|
|
45
44
|
require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
46
45
|
require('@babel/runtime-corejs3/core-js-stable/url');
|
|
47
46
|
require('@commercetools-uikit/design-system');
|
|
@@ -51,13 +50,15 @@ require('@commercetools-uikit/flat-button');
|
|
|
51
50
|
require('@commercetools-uikit/icons');
|
|
52
51
|
require('./location-c835b8df.cjs.dev.js');
|
|
53
52
|
require('@emotion/react/jsx-runtime');
|
|
54
|
-
require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
|
|
55
53
|
require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
56
54
|
require('memoize-one');
|
|
57
55
|
require('react-select');
|
|
58
56
|
require('@commercetools-uikit/accessible-hidden');
|
|
59
57
|
require('@commercetools-uikit/select-input');
|
|
60
58
|
require('@commercetools-uikit/text');
|
|
59
|
+
require('@flopflip/react-broadcast');
|
|
60
|
+
require('@commercetools-uikit/secondary-button');
|
|
61
|
+
require('@commercetools-uikit/tooltip');
|
|
61
62
|
require('@commercetools-frontend/assets/images/ct-logo.svg');
|
|
62
63
|
require('@commercetools-uikit/loading-spinner');
|
|
63
64
|
require('@commercetools-frontend/browser-history');
|
|
@@ -74,7 +75,6 @@ require('@apollo/client/react');
|
|
|
74
75
|
require('@flopflip/combine-adapters');
|
|
75
76
|
require('@flopflip/http-adapter');
|
|
76
77
|
require('@flopflip/launchdarkly-adapter');
|
|
77
|
-
require('@flopflip/react-broadcast');
|
|
78
78
|
require('@flopflip/types');
|
|
79
79
|
require('react-redux');
|
|
80
80
|
require('lodash/upperFirst');
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
var react = require('react');
|
|
4
4
|
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
5
5
|
var sdk = require('@commercetools-frontend/sdk');
|
|
6
|
-
var dist_commercetoolsFrontendApplicationShell = require('./index-
|
|
6
|
+
var dist_commercetoolsFrontendApplicationShell = require('./index-312ee159.cjs.prod.js');
|
|
7
7
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
8
8
|
var constants = require('@commercetools-frontend/constants');
|
|
9
9
|
require('prop-types');
|
|
10
10
|
require('react-router-dom');
|
|
11
|
-
require('./index-
|
|
11
|
+
require('./index-91985d64.cjs.prod.js');
|
|
12
12
|
require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
13
13
|
require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
14
14
|
require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
@@ -40,8 +40,7 @@ require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
|
40
40
|
require('@emotion/react');
|
|
41
41
|
require('@commercetools-frontend/application-components');
|
|
42
42
|
require('@commercetools-frontend/i18n');
|
|
43
|
-
require('./oidc-
|
|
44
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
43
|
+
require('./oidc-d02d4ab8.cjs.prod.js');
|
|
45
44
|
require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
46
45
|
require('@babel/runtime-corejs3/core-js-stable/url');
|
|
47
46
|
require('@commercetools-uikit/design-system');
|
|
@@ -51,13 +50,15 @@ require('@commercetools-uikit/flat-button');
|
|
|
51
50
|
require('@commercetools-uikit/icons');
|
|
52
51
|
require('./location-537e0660.cjs.prod.js');
|
|
53
52
|
require('@emotion/react/jsx-runtime');
|
|
54
|
-
require('@babel/runtime-corejs3/helpers/taggedTemplateLiteral');
|
|
55
53
|
require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
56
54
|
require('memoize-one');
|
|
57
55
|
require('react-select');
|
|
58
56
|
require('@commercetools-uikit/accessible-hidden');
|
|
59
57
|
require('@commercetools-uikit/select-input');
|
|
60
58
|
require('@commercetools-uikit/text');
|
|
59
|
+
require('@flopflip/react-broadcast');
|
|
60
|
+
require('@commercetools-uikit/secondary-button');
|
|
61
|
+
require('@commercetools-uikit/tooltip');
|
|
61
62
|
require('@commercetools-frontend/assets/images/ct-logo.svg');
|
|
62
63
|
require('@commercetools-uikit/loading-spinner');
|
|
63
64
|
require('@commercetools-frontend/browser-history');
|
|
@@ -74,7 +75,6 @@ require('@apollo/client/react');
|
|
|
74
75
|
require('@flopflip/combine-adapters');
|
|
75
76
|
require('@flopflip/http-adapter');
|
|
76
77
|
require('@flopflip/launchdarkly-adapter');
|
|
77
|
-
require('@flopflip/react-broadcast');
|
|
78
78
|
require('@flopflip/types');
|
|
79
79
|
require('react-redux');
|
|
80
80
|
require('lodash/upperFirst');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/application-shell",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.32.0",
|
|
4
4
|
"description": "React component to bootstrap the general MC application logic",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -39,21 +39,21 @@
|
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@babel/runtime": "^7.22.15",
|
|
41
41
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
42
|
-
"@commercetools-frontend/actions-global": "22.
|
|
43
|
-
"@commercetools-frontend/application-components": "22.
|
|
44
|
-
"@commercetools-frontend/application-config": "22.
|
|
45
|
-
"@commercetools-frontend/application-shell-connectors": "22.
|
|
46
|
-
"@commercetools-frontend/assets": "22.
|
|
47
|
-
"@commercetools-frontend/browser-history": "22.
|
|
48
|
-
"@commercetools-frontend/constants": "22.
|
|
49
|
-
"@commercetools-frontend/i18n": "22.
|
|
50
|
-
"@commercetools-frontend/l10n": "22.
|
|
51
|
-
"@commercetools-frontend/notifications": "22.
|
|
52
|
-
"@commercetools-frontend/permissions": "22.
|
|
53
|
-
"@commercetools-frontend/react-notifications": "22.
|
|
54
|
-
"@commercetools-frontend/sdk": "22.
|
|
55
|
-
"@commercetools-frontend/sentry": "22.
|
|
56
|
-
"@commercetools-frontend/url-utils": "22.
|
|
42
|
+
"@commercetools-frontend/actions-global": "22.32.0",
|
|
43
|
+
"@commercetools-frontend/application-components": "22.32.0",
|
|
44
|
+
"@commercetools-frontend/application-config": "22.32.0",
|
|
45
|
+
"@commercetools-frontend/application-shell-connectors": "22.32.0",
|
|
46
|
+
"@commercetools-frontend/assets": "22.32.0",
|
|
47
|
+
"@commercetools-frontend/browser-history": "22.32.0",
|
|
48
|
+
"@commercetools-frontend/constants": "22.32.0",
|
|
49
|
+
"@commercetools-frontend/i18n": "22.32.0",
|
|
50
|
+
"@commercetools-frontend/l10n": "22.32.0",
|
|
51
|
+
"@commercetools-frontend/notifications": "22.32.0",
|
|
52
|
+
"@commercetools-frontend/permissions": "22.32.0",
|
|
53
|
+
"@commercetools-frontend/react-notifications": "22.32.0",
|
|
54
|
+
"@commercetools-frontend/sdk": "22.32.0",
|
|
55
|
+
"@commercetools-frontend/sentry": "22.32.0",
|
|
56
|
+
"@commercetools-frontend/url-utils": "22.32.0",
|
|
57
57
|
"@commercetools-uikit/accessible-hidden": "^19.9.0",
|
|
58
58
|
"@commercetools-uikit/avatar": "^19.9.0",
|
|
59
59
|
"@commercetools-uikit/card": "^19.9.0",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"@commercetools-uikit/select-input": "^19.9.0",
|
|
70
70
|
"@commercetools-uikit/spacings": "^19.9.0",
|
|
71
71
|
"@commercetools-uikit/text": "^19.9.0",
|
|
72
|
+
"@commercetools-uikit/tooltip": "^19.9.0",
|
|
72
73
|
"@emotion/react": "^11.11.4",
|
|
73
74
|
"@emotion/styled": "^11.11.0",
|
|
74
75
|
"@flopflip/combine-adapters": "14.0.2",
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var ssr = require('@commercetools-frontend/application-config/ssr');
|
|
6
|
-
var oidc = require('../../dist/oidc-
|
|
7
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
6
|
+
var oidc = require('../../dist/oidc-6c6599a2.cjs.dev.js');
|
|
8
7
|
require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
9
8
|
require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
10
9
|
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var ssr = require('@commercetools-frontend/application-config/ssr');
|
|
6
|
-
var oidc = require('../../dist/oidc-
|
|
7
|
-
require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
6
|
+
var oidc = require('../../dist/oidc-d02d4ab8.cjs.prod.js');
|
|
8
7
|
require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
9
8
|
require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
10
9
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { entryPointUriPathToPermissionKeys, entryPointUriPathToResourceAccesses } from '@commercetools-frontend/application-config/ssr';
|
|
2
|
-
export { b as buildOidcScope } from '../../dist/oidc-
|
|
3
|
-
import '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
2
|
+
export { b as buildOidcScope } from '../../dist/oidc-8275c04f.esm.js';
|
|
4
3
|
import '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
5
4
|
import '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|