@atlaskit/navigation-system 11.8.3 → 11.8.4
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/CHANGELOG.md +12 -0
- package/constellation/layout/code.mdx +9 -0
- package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +1 -1
- package/dist/cjs/ui/page-layout/layout-area-sizing-runtime.js +2 -2
- package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +1 -1
- package/dist/es2019/ui/page-layout/layout-area-sizing-runtime.js +2 -2
- package/dist/esm/ui/page-layout/calculate-layout-area-states.js +1 -1
- package/dist/esm/ui/page-layout/layout-area-sizing-runtime.js +2 -2
- package/dist/types/ui/page-layout/layout-area-sizing-context.d.ts +1 -2
- package/dist/types/ui/page-layout/panel-layout.d.ts +6 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 11.8.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b900d18f5dd93`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b900d18f5dd93) -
|
|
8
|
+
Fix local panels to remember inline and overlay resize preferences separately when
|
|
9
|
+
platform-dst-chat-panel-layout is enabled. Preserve explicit controlled widths and prevent the
|
|
10
|
+
Panel System adapter from sharing uncontrolled resizes across modes.
|
|
11
|
+
|
|
12
|
+
Restore saved widths through the existing default-width API, matching ChatPanel. Restored widths
|
|
13
|
+
supply the starting defaults, including default-based overlay bounds.
|
|
14
|
+
|
|
3
15
|
## 11.8.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -129,6 +129,15 @@ space can still compress the panel. Chat retains its 400px desktop default. Use
|
|
|
129
129
|
captured on mount; controlled and user-resized widths take precedence. `LayoutWithPanel` also
|
|
130
130
|
accepts `xlDefaultPanelWidth`, with saved provider widths taking precedence.
|
|
131
131
|
|
|
132
|
+
With chat layout enabled, user-resized inline and overlay widths are remembered separately. Resizing
|
|
133
|
+
an overlay does not replace the inline preference, or vice versa. Automatic compression does not
|
|
134
|
+
replace either preference. A controlled `panelWidth` takes precedence in both modes; `onResizeEnd`
|
|
135
|
+
includes the resized `mode` for callers that manage their own persistence.
|
|
136
|
+
|
|
137
|
+
To restore a saved width on mount, pass it as `defaultPanelWidth`, like ChatPanel’s `defaultWidth`.
|
|
138
|
+
It becomes the starting default, including for default-based overlay bounds. `LayoutWithPanel`
|
|
139
|
+
restores its saved provider width this way. Subsequent resizes remain independent in each mode.
|
|
140
|
+
|
|
132
141
|
`PanelLayout` contains the layout and resizing responsibilities extracted from
|
|
133
142
|
`@atlassian/panel-system`. That package's `LayoutWithPanel` remains an adapter that connects panel
|
|
134
143
|
state and routed content to `PanelLayout`.
|
|
@@ -29,7 +29,7 @@ function getTargetWidth(area, isSideNavOverlay, isXlViewport) {
|
|
|
29
29
|
function getOverlayTargetWidth(area, isSideNavOverlay, isXlViewport, areaName) {
|
|
30
30
|
var _area$liveResize2, _ref3, _area$requestedWidth2;
|
|
31
31
|
var defaultWidth = getDefaultWidth(area, isSideNavOverlay, isXlViewport);
|
|
32
|
-
return ((_area$liveResize2 = area.liveResize) === null || _area$liveResize2 === void 0 ? void 0 : _area$liveResize2.mode) === 'overlay' ? area.liveResize.width : (_ref3 = (_area$requestedWidth2 = area.requestedWidth) !== null && _area$requestedWidth2 !== void 0 ? _area$requestedWidth2 : areaName === 'panel' ? area.preferredWidth : area.preferredOverlayWidth) !== null && _ref3 !== void 0 ? _ref3 : defaultWidth;
|
|
32
|
+
return ((_area$liveResize2 = area.liveResize) === null || _area$liveResize2 === void 0 ? void 0 : _area$liveResize2.mode) === 'overlay' ? area.liveResize.width : (_ref3 = (_area$requestedWidth2 = area.requestedWidth) !== null && _area$requestedWidth2 !== void 0 ? _area$requestedWidth2 : areaName === 'panel' && !(0, _fg.fg)('platform-dst-chat-panel-layout') ? area.preferredWidth : area.preferredOverlayWidth) !== null && _ref3 !== void 0 ? _ref3 : defaultWidth;
|
|
33
33
|
}
|
|
34
34
|
function calculateLayoutAreaStates(_ref4) {
|
|
35
35
|
var _ref5, _resizeSession$overla, _baselineWidths$chat, _panel$liveResize, _states$sideNav$widt, _states$sideNav, _states$chatPanel$wi, _states$chatPanel;
|
|
@@ -337,7 +337,7 @@ function LayoutAreaSizingRuntime(_ref2) {
|
|
|
337
337
|
if (!existing) {
|
|
338
338
|
return current;
|
|
339
339
|
}
|
|
340
|
-
if (mode === 'overlay' && area !== 'panel') {
|
|
340
|
+
if (mode === 'overlay' && (area !== 'panel' || (0, _fg.fg)('platform-dst-chat-panel-layout'))) {
|
|
341
341
|
return _objectSpread(_objectSpread({}, current), {}, (0, _defineProperty2.default)({}, area, _objectSpread(_objectSpread({}, existing), {}, {
|
|
342
342
|
liveResize: undefined,
|
|
343
343
|
preferredOverlayWidth: width
|
|
@@ -345,7 +345,7 @@ function LayoutAreaSizingRuntime(_ref2) {
|
|
|
345
345
|
}
|
|
346
346
|
return _objectSpread(_objectSpread({}, current), {}, (0, _defineProperty2.default)({}, area, _objectSpread(_objectSpread({}, existing), {}, {
|
|
347
347
|
liveResize: undefined,
|
|
348
|
-
//
|
|
348
|
+
// Gate-off local panels retain their shared preference.
|
|
349
349
|
preferredWidth: width
|
|
350
350
|
})));
|
|
351
351
|
});
|
|
@@ -19,7 +19,7 @@ function getTargetWidth(area, isSideNavOverlay, isXlViewport) {
|
|
|
19
19
|
function getOverlayTargetWidth(area, isSideNavOverlay, isXlViewport, areaName) {
|
|
20
20
|
var _area$liveResize2, _ref2, _area$requestedWidth2;
|
|
21
21
|
const defaultWidth = getDefaultWidth(area, isSideNavOverlay, isXlViewport);
|
|
22
|
-
return ((_area$liveResize2 = area.liveResize) === null || _area$liveResize2 === void 0 ? void 0 : _area$liveResize2.mode) === 'overlay' ? area.liveResize.width : (_ref2 = (_area$requestedWidth2 = area.requestedWidth) !== null && _area$requestedWidth2 !== void 0 ? _area$requestedWidth2 : areaName === 'panel' ? area.preferredWidth : area.preferredOverlayWidth) !== null && _ref2 !== void 0 ? _ref2 : defaultWidth;
|
|
22
|
+
return ((_area$liveResize2 = area.liveResize) === null || _area$liveResize2 === void 0 ? void 0 : _area$liveResize2.mode) === 'overlay' ? area.liveResize.width : (_ref2 = (_area$requestedWidth2 = area.requestedWidth) !== null && _area$requestedWidth2 !== void 0 ? _area$requestedWidth2 : areaName === 'panel' && !fg('platform-dst-chat-panel-layout') ? area.preferredWidth : area.preferredOverlayWidth) !== null && _ref2 !== void 0 ? _ref2 : defaultWidth;
|
|
23
23
|
}
|
|
24
24
|
export function calculateLayoutAreaStates({
|
|
25
25
|
viewportWidth,
|
|
@@ -300,7 +300,7 @@ export function LayoutAreaSizingRuntime({
|
|
|
300
300
|
if (!existing) {
|
|
301
301
|
return current;
|
|
302
302
|
}
|
|
303
|
-
if (mode === 'overlay' && area !== 'panel') {
|
|
303
|
+
if (mode === 'overlay' && (area !== 'panel' || fg('platform-dst-chat-panel-layout'))) {
|
|
304
304
|
return {
|
|
305
305
|
...current,
|
|
306
306
|
[area]: {
|
|
@@ -315,7 +315,7 @@ export function LayoutAreaSizingRuntime({
|
|
|
315
315
|
[area]: {
|
|
316
316
|
...existing,
|
|
317
317
|
liveResize: undefined,
|
|
318
|
-
//
|
|
318
|
+
// Gate-off local panels retain their shared preference.
|
|
319
319
|
preferredWidth: width
|
|
320
320
|
}
|
|
321
321
|
};
|
|
@@ -22,7 +22,7 @@ function getTargetWidth(area, isSideNavOverlay, isXlViewport) {
|
|
|
22
22
|
function getOverlayTargetWidth(area, isSideNavOverlay, isXlViewport, areaName) {
|
|
23
23
|
var _area$liveResize2, _ref3, _area$requestedWidth2;
|
|
24
24
|
var defaultWidth = getDefaultWidth(area, isSideNavOverlay, isXlViewport);
|
|
25
|
-
return ((_area$liveResize2 = area.liveResize) === null || _area$liveResize2 === void 0 ? void 0 : _area$liveResize2.mode) === 'overlay' ? area.liveResize.width : (_ref3 = (_area$requestedWidth2 = area.requestedWidth) !== null && _area$requestedWidth2 !== void 0 ? _area$requestedWidth2 : areaName === 'panel' ? area.preferredWidth : area.preferredOverlayWidth) !== null && _ref3 !== void 0 ? _ref3 : defaultWidth;
|
|
25
|
+
return ((_area$liveResize2 = area.liveResize) === null || _area$liveResize2 === void 0 ? void 0 : _area$liveResize2.mode) === 'overlay' ? area.liveResize.width : (_ref3 = (_area$requestedWidth2 = area.requestedWidth) !== null && _area$requestedWidth2 !== void 0 ? _area$requestedWidth2 : areaName === 'panel' && !fg('platform-dst-chat-panel-layout') ? area.preferredWidth : area.preferredOverlayWidth) !== null && _ref3 !== void 0 ? _ref3 : defaultWidth;
|
|
26
26
|
}
|
|
27
27
|
export function calculateLayoutAreaStates(_ref4) {
|
|
28
28
|
var _ref5, _resizeSession$overla, _baselineWidths$chat, _panel$liveResize, _states$sideNav$widt, _states$sideNav, _states$chatPanel$wi, _states$chatPanel;
|
|
@@ -328,7 +328,7 @@ export function LayoutAreaSizingRuntime(_ref2) {
|
|
|
328
328
|
if (!existing) {
|
|
329
329
|
return current;
|
|
330
330
|
}
|
|
331
|
-
if (mode === 'overlay' && area !== 'panel') {
|
|
331
|
+
if (mode === 'overlay' && (area !== 'panel' || fg('platform-dst-chat-panel-layout'))) {
|
|
332
332
|
return _objectSpread(_objectSpread({}, current), {}, _defineProperty({}, area, _objectSpread(_objectSpread({}, existing), {}, {
|
|
333
333
|
liveResize: undefined,
|
|
334
334
|
preferredOverlayWidth: width
|
|
@@ -336,7 +336,7 @@ export function LayoutAreaSizingRuntime(_ref2) {
|
|
|
336
336
|
}
|
|
337
337
|
return _objectSpread(_objectSpread({}, current), {}, _defineProperty({}, area, _objectSpread(_objectSpread({}, existing), {}, {
|
|
338
338
|
liveResize: undefined,
|
|
339
|
-
//
|
|
339
|
+
// Gate-off local panels retain their shared preference.
|
|
340
340
|
preferredWidth: width
|
|
341
341
|
})));
|
|
342
342
|
});
|
|
@@ -18,8 +18,7 @@ export type LayoutAreaConfig = {
|
|
|
18
18
|
};
|
|
19
19
|
export type StoredLayoutArea = LayoutAreaConfig & {
|
|
20
20
|
/**
|
|
21
|
-
* Local panels
|
|
22
|
-
* SideNav and ChatPanel retain separate overlay preferences.
|
|
21
|
+
* Preferred inline width. Local panels also use it for overlays when chat layout is disabled.
|
|
23
22
|
*/
|
|
24
23
|
preferredWidth?: number;
|
|
25
24
|
preferredOverlayWidth?: number;
|
|
@@ -20,20 +20,23 @@ export type PanelLayoutProps = {
|
|
|
20
20
|
*/
|
|
21
21
|
panelKey?: Key;
|
|
22
22
|
/**
|
|
23
|
-
* Controlled preferred width in pixels
|
|
23
|
+
* Controlled preferred width in pixels, applied in both inline and overlay modes.
|
|
24
|
+
* Allocation may constrain it without changing the request.
|
|
24
25
|
*/
|
|
25
26
|
panelWidth?: number;
|
|
26
27
|
/**
|
|
27
28
|
* Initial preferred width in pixels; subsequent changes are ignored.
|
|
28
29
|
* Defaults to 365, or 400 with chat layout enabled (500 at XL and above).
|
|
30
|
+
* Pass a saved width here to restore it as the starting default.
|
|
29
31
|
* An explicit value also supplies the compact and XL defaults unless separately overridden.
|
|
30
|
-
*
|
|
32
|
+
* With chat layout enabled, user-resized inline and overlay widths are remembered separately.
|
|
33
|
+
* Without it, both modes retain one shared preference.
|
|
31
34
|
* Available space can constrain the rendered width without overwriting that preference.
|
|
32
35
|
*/
|
|
33
36
|
defaultPanelWidth?: number;
|
|
34
37
|
/**
|
|
35
38
|
* Default at compact viewport sizes. Defaults to 320, or an explicitly supplied defaultPanelWidth.
|
|
36
|
-
* Used only until a controlled width or user resize supplies a preference.
|
|
39
|
+
* Used only until a controlled width or a user resize in the current mode supplies a preference.
|
|
37
40
|
*/
|
|
38
41
|
compactDefaultPanelWidth?: number;
|
|
39
42
|
/**
|
package/package.json
CHANGED