@atlaskit/navigation-system 11.3.1 → 11.3.2
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 +8 -0
- package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +76 -37
- package/dist/cjs/ui/page-layout/chat-panel.js +6 -3
- package/dist/cjs/ui/page-layout/layout-area-sizing-context.js +2 -2
- package/dist/cjs/ui/page-layout/layout-area-sizing-provider.js +243 -247
- package/dist/cjs/ui/page-layout/layout-area-sizing-runtime.js +468 -0
- package/dist/cjs/ui/page-layout/main/main.js +1 -1
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +239 -99
- package/dist/cjs/ui/page-layout/panel-splitter/provider.js +3 -1
- package/dist/cjs/ui/page-layout/root.compiled.css +14 -3
- package/dist/cjs/ui/page-layout/root.js +43 -17
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +14 -3
- package/dist/cjs/ui/page-layout/use-css-layout-area-states.js +117 -0
- package/dist/cjs/ui/page-layout/use-layout-area-sizing.js +3 -1
- package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +51 -17
- package/dist/es2019/ui/page-layout/chat-panel.js +29 -5
- package/dist/es2019/ui/page-layout/layout-area-sizing-context.js +2 -2
- package/dist/es2019/ui/page-layout/layout-area-sizing-provider.js +171 -241
- package/dist/es2019/ui/page-layout/layout-area-sizing-runtime.js +419 -0
- package/dist/es2019/ui/page-layout/main/main.js +2 -2
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +60 -10
- package/dist/es2019/ui/page-layout/panel-splitter/provider.js +3 -1
- package/dist/es2019/ui/page-layout/root.compiled.css +14 -3
- package/dist/es2019/ui/page-layout/root.js +30 -3
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +23 -3
- package/dist/es2019/ui/page-layout/use-css-layout-area-states.js +73 -0
- package/dist/es2019/ui/page-layout/use-layout-area-sizing.js +3 -1
- package/dist/esm/ui/page-layout/calculate-layout-area-states.js +75 -37
- package/dist/esm/ui/page-layout/chat-panel.js +7 -4
- package/dist/esm/ui/page-layout/layout-area-sizing-context.js +2 -2
- package/dist/esm/ui/page-layout/layout-area-sizing-provider.js +243 -248
- package/dist/esm/ui/page-layout/layout-area-sizing-runtime.js +459 -0
- package/dist/esm/ui/page-layout/main/main.js +2 -2
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +238 -98
- package/dist/esm/ui/page-layout/panel-splitter/provider.js +3 -1
- package/dist/esm/ui/page-layout/root.compiled.css +14 -3
- package/dist/esm/ui/page-layout/root.js +42 -16
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +14 -3
- package/dist/esm/ui/page-layout/use-css-layout-area-states.js +110 -0
- package/dist/esm/ui/page-layout/use-layout-area-sizing.js +3 -1
- package/dist/types/ui/page-layout/calculate-layout-area-states.d.ts +7 -2
- package/dist/types/ui/page-layout/layout-area-sizing-context.d.ts +10 -3
- package/dist/types/ui/page-layout/layout-area-sizing-provider.d.ts +6 -0
- package/dist/types/ui/page-layout/layout-area-sizing-runtime.d.ts +8 -0
- package/dist/types/ui/page-layout/panel-splitter/panel-splitter-context.d.ts +4 -0
- package/dist/types/ui/page-layout/panel-splitter/provider.d.ts +1 -1
- package/dist/types/ui/page-layout/root.d.ts +2 -0
- package/dist/types/ui/page-layout/use-css-layout-area-states.d.ts +8 -0
- package/dist/types/ui/page-layout/use-layout-area-sizing.d.ts +2 -0
- package/package.json +7 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 11.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`bd8355ce4adc8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd8355ce4adc8) -
|
|
8
|
+
Refine chat and local panel resizing with directional cascading and responsive overlay behaviour.
|
|
9
|
+
Lazy-load resize logic while preserving the initial layout during hydration.
|
|
10
|
+
|
|
3
11
|
## 11.3.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.calculateLayoutAreaStates = calculateLayoutAreaStates;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
7
9
|
var _resolveLayoutWidth = require("./resolve-layout-width");
|
|
8
10
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
9
11
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -25,7 +27,7 @@ function getOverlayTargetWidth(area, isSideNavOverlay) {
|
|
|
25
27
|
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 : area.preferredOverlayWidth) !== null && _ref3 !== void 0 ? _ref3 : defaultWidth;
|
|
26
28
|
}
|
|
27
29
|
function calculateLayoutAreaStates(_ref4) {
|
|
28
|
-
var _states$sideNav$widt, _states$sideNav, _states$chatPanel$wi, _states$chatPanel;
|
|
30
|
+
var _ref5, _resizeSession$overla, _baselineWidths$chat, _panel$liveResize, _states$sideNav$widt, _states$sideNav, _states$chatPanel$wi, _states$chatPanel;
|
|
29
31
|
var viewportWidth = _ref4.viewportWidth,
|
|
30
32
|
_ref4$layoutWidth = _ref4.layoutWidth,
|
|
31
33
|
layoutWidth = _ref4$layoutWidth === void 0 ? viewportWidth : _ref4$layoutWidth,
|
|
@@ -35,7 +37,8 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
35
37
|
occupiedWidth = _ref4$occupiedWidth === void 0 ? 0 : _ref4$occupiedWidth,
|
|
36
38
|
mainMinWidthBound = _ref4.mainMinWidth,
|
|
37
39
|
areas = _ref4.areas,
|
|
38
|
-
resizeSession = _ref4.resizeSession
|
|
40
|
+
resizeSession = _ref4.resizeSession,
|
|
41
|
+
initialModes = _ref4.initialModes;
|
|
39
42
|
var mainMinWidth = (0, _resolveLayoutWidth.resolveLayoutWidth)(mainMinWidthBound, viewportWidth);
|
|
40
43
|
var availableWidth = Math.max(0, layoutWidth - occupiedWidth);
|
|
41
44
|
var sideNav = areas['side-nav'];
|
|
@@ -44,9 +47,20 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
44
47
|
var sideNavMinWidth = sideNav ? (0, _resolveLayoutWidth.resolveLayoutWidth)(sideNav.minWidth, viewportWidth) : 0;
|
|
45
48
|
var panelMinWidth = panel ? (0, _resolveLayoutWidth.resolveLayoutWidth)(panel.minWidth, viewportWidth) : 0;
|
|
46
49
|
var chatPanelMinWidth = chatPanel ? (0, _resolveLayoutWidth.resolveLayoutWidth)(chatPanel.minWidth, viewportWidth) : 0;
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
+
var resizingArea = resizeSession && areas[resizeSession.area];
|
|
51
|
+
var isAcknowledged = (resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.completedWidth) !== undefined && ((resizingArea === null || resizingArea === void 0 ? void 0 : resizingArea.requestedWidth) === undefined || resizingArea.requestedWidth === resizeSession.completedWidth);
|
|
52
|
+
var baselineWidths = (_ref5 = isAcknowledged ? resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.completedWidths : undefined) !== null && _ref5 !== void 0 ? _ref5 : resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.baselineWidths;
|
|
53
|
+
var layoutModes = (_resizeSession$overla = resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.overlayModes) !== null && _resizeSession$overla !== void 0 ? _resizeSession$overla : initialModes;
|
|
54
|
+
// A growing panel cascades towards inline-start. Chat is on the other side
|
|
55
|
+
// of the local rail, so local growth must reserve its full starting width.
|
|
56
|
+
var shouldCollapseSideNav = Boolean(resizeSession && resizeSession.area !== 'side-nav' && resizeSession.baselineWidths['side-nav'] !== undefined && resizeSession.baselineWidths[resizeSession.area] !== undefined && resizingArea && !isSideNavOverlay && clampTargetWidth({
|
|
57
|
+
target: getTargetWidth(resizingArea, isSideNavOverlay),
|
|
58
|
+
min: (0, _resolveLayoutWidth.resolveLayoutWidth)(resizingArea.minWidth, viewportWidth),
|
|
59
|
+
max: resizingArea.maxWidth !== undefined ? (0, _resolveLayoutWidth.resolveLayoutWidth)(resizingArea.maxWidth, viewportWidth) : Number.POSITIVE_INFINITY
|
|
60
|
+
}) > availableWidth - mainMinWidth - sideNavMinWidth - (resizeSession.area === 'panel' ? resizeSession.baselineWidths['chat-panel'] !== undefined ? (_baselineWidths$chat = baselineWidths === null || baselineWidths === void 0 ? void 0 : baselineWidths['chat-panel']) !== null && _baselineWidths$chat !== void 0 ? _baselineWidths$chat : chatPanelMinWidth : 0 : resizeSession.baselineWidths.panel !== undefined ? panelMinWidth : 0));
|
|
61
|
+
var isSideNavOpenInline = Boolean((sideNav === null || sideNav === void 0 ? void 0 : sideNav.isOpen) && !shouldCollapseSideNav && (layoutModes ? layoutModes['side-nav'] === 'inline' : !isSideNavOverlay && availableWidth >= mainMinWidth + sideNavMinWidth));
|
|
62
|
+
var isChatPanelOpenInline = Boolean((chatPanel === null || chatPanel === void 0 ? void 0 : chatPanel.isOpen) && (!resizeSession || resizeSession.baselineWidths['chat-panel'] !== undefined) && (layoutModes ? layoutModes['chat-panel'] === 'inline' : !isChatPanelOverlay && availableWidth >= mainMinWidth + chatPanelMinWidth + (isSideNavOpenInline ? sideNavMinWidth : 0)));
|
|
63
|
+
var isPanelInline = Boolean((panel === null || panel === void 0 ? void 0 : panel.isOpen) && (!resizeSession || resizeSession.baselineWidths.panel !== undefined) && (layoutModes ? layoutModes.panel === 'inline' : availableWidth >= mainMinWidth + panelMinWidth + (isChatPanelOpenInline ? chatPanelMinWidth : 0) + (isSideNavOpenInline ? sideNavMinWidth : 0)));
|
|
50
64
|
var inlineAreas = [isSideNavOpenInline && 'side-nav', isPanelInline && 'panel', isChatPanelOpenInline && 'chat-panel'].filter(function (area) {
|
|
51
65
|
return Boolean(area);
|
|
52
66
|
});
|
|
@@ -63,8 +77,8 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
63
77
|
}
|
|
64
78
|
var min = (0, _resolveLayoutWidth.resolveLayoutWidth)(area.minWidth, viewportWidth);
|
|
65
79
|
var max = area.maxWidth ? (0, _resolveLayoutWidth.resolveLayoutWidth)(area.maxWidth, viewportWidth) : Number.POSITIVE_INFINITY;
|
|
66
|
-
var baselineWidth =
|
|
67
|
-
var requestedTarget = resizeSession && areaName !== resizeSession.area && baselineWidth !==
|
|
80
|
+
var baselineWidth = baselineWidths === null || baselineWidths === void 0 ? void 0 : baselineWidths[areaName];
|
|
81
|
+
var requestedTarget = resizeSession && areaName !== resizeSession.area ? shouldCollapseSideNav && resizeSession.area === 'chat-panel' ? min : baselineWidth !== null && baselineWidth !== void 0 ? baselineWidth : getTargetWidth(area, isSideNavOverlay) : getTargetWidth(area, isSideNavOverlay);
|
|
68
82
|
var target = clampTargetWidth({
|
|
69
83
|
target: requestedTarget,
|
|
70
84
|
min: min,
|
|
@@ -73,28 +87,50 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
73
87
|
minimums.set(areaName, min);
|
|
74
88
|
widths.set(areaName, target);
|
|
75
89
|
}
|
|
90
|
+
// Narrowing Chat moves the shared rail towards inline-end. Give the released
|
|
91
|
+
// space to its inline neighbour so local grows instead of sliding across Main.
|
|
92
|
+
// Use effective (clamped) widths and the session baseline, not each drag frame,
|
|
93
|
+
// so reversing direction and completing a controlled resize do not add it twice.
|
|
76
94
|
} catch (err) {
|
|
77
95
|
_iterator.e(err);
|
|
78
96
|
} finally {
|
|
79
97
|
_iterator.f();
|
|
80
98
|
}
|
|
99
|
+
if ((resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.area) === 'chat-panel' && isChatPanelOpenInline && isPanelInline && panel) {
|
|
100
|
+
var _widths$get, _baselineWidths$chat2, _widths$get2;
|
|
101
|
+
var chatWidth = (_widths$get = widths.get('chat-panel')) !== null && _widths$get !== void 0 ? _widths$get : 0;
|
|
102
|
+
var releasedWidth = Math.max(0, ((_baselineWidths$chat2 = baselineWidths === null || baselineWidths === void 0 ? void 0 : baselineWidths['chat-panel']) !== null && _baselineWidths$chat2 !== void 0 ? _baselineWidths$chat2 : chatWidth) - chatWidth);
|
|
103
|
+
var panelMaxWidth = panel.maxWidth !== undefined ? Math.max(panelMinWidth, (0, _resolveLayoutWidth.resolveLayoutWidth)(panel.maxWidth, viewportWidth)) : Number.POSITIVE_INFINITY;
|
|
104
|
+
widths.set('panel', Math.min(panelMaxWidth, ((_widths$get2 = widths.get('panel')) !== null && _widths$get2 !== void 0 ? _widths$get2 : 0) + releasedWidth));
|
|
105
|
+
}
|
|
106
|
+
// Continuing to pull the local rail towards Chat after local reaches its
|
|
107
|
+
// minimum gives Main the remaining space available in inline Chat.
|
|
108
|
+
if ((resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.area) === 'panel' && (panel === null || panel === void 0 || (_panel$liveResize = panel.liveResize) === null || _panel$liveResize === void 0 ? void 0 : _panel$liveResize.mode) === 'inline' && isChatPanelOpenInline) {
|
|
109
|
+
var _widths$get3;
|
|
110
|
+
var remainingDrag = Math.max(0, panelMinWidth - panel.liveResize.width);
|
|
111
|
+
var _chatWidth = (_widths$get3 = widths.get('chat-panel')) !== null && _widths$get3 !== void 0 ? _widths$get3 : 0;
|
|
112
|
+
widths.set('chat-panel', Math.max(chatPanelMinWidth, _chatWidth - remainingDrag));
|
|
113
|
+
}
|
|
81
114
|
var overflow = Math.max(0, Array.from(widths.values()).reduce(function (total, width) {
|
|
82
115
|
return total + width;
|
|
83
116
|
}, 0) - (availableWidth - mainMinWidth));
|
|
84
117
|
var compressionOrder = ['panel', 'chat-panel', 'side-nav'];
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
|
|
118
|
+
// Main gives up spare space first. Only regions beyond the moving rail may
|
|
119
|
+
// then compress: local growth moves towards SideNav, never towards Chat.
|
|
120
|
+
// SideNav and Chat growth can reach both other regions in their direction.
|
|
121
|
+
var shrinkOrder = resizeSession ? resizeSession.area === 'panel' ? ['side-nav', 'panel'] : [].concat((0, _toConsumableArray2.default)(compressionOrder.filter(function (area) {
|
|
122
|
+
return area !== resizeSession.area;
|
|
123
|
+
})), [resizeSession.area]) : compressionOrder;
|
|
88
124
|
var _iterator2 = _createForOfIteratorHelper(shrinkOrder),
|
|
89
125
|
_step2;
|
|
90
126
|
try {
|
|
91
127
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
92
|
-
var _widths$
|
|
128
|
+
var _widths$get4, _minimums$get;
|
|
93
129
|
var _areaName = _step2.value;
|
|
94
130
|
if (overflow <= 0) {
|
|
95
131
|
break;
|
|
96
132
|
}
|
|
97
|
-
var width = (_widths$
|
|
133
|
+
var width = (_widths$get4 = widths.get(_areaName)) !== null && _widths$get4 !== void 0 ? _widths$get4 : 0;
|
|
98
134
|
var _min = (_minimums$get = minimums.get(_areaName)) !== null && _minimums$get !== void 0 ? _minimums$get : 0;
|
|
99
135
|
var reduction = Math.min(overflow, Math.max(0, width - _min));
|
|
100
136
|
widths.set(_areaName, width - reduction);
|
|
@@ -105,29 +141,32 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
105
141
|
} finally {
|
|
106
142
|
_iterator2.f();
|
|
107
143
|
}
|
|
108
|
-
var totalInlineWidth = Array.from(widths.values()).reduce(function (total, width) {
|
|
109
|
-
return total + width;
|
|
110
|
-
}, 0);
|
|
111
144
|
var states = {};
|
|
112
145
|
var _iterator3 = _createForOfIteratorHelper(inlineAreas),
|
|
113
146
|
_step3;
|
|
114
147
|
try {
|
|
115
|
-
|
|
116
|
-
var _widths$
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
var maxWidth = (_areas$
|
|
148
|
+
var _loop = function _loop() {
|
|
149
|
+
var _widths$get5, _minimums$get2, _areas$areaName;
|
|
150
|
+
var areaName = _step3.value;
|
|
151
|
+
var width = (_widths$get5 = widths.get(areaName)) !== null && _widths$get5 !== void 0 ? _widths$get5 : 0;
|
|
152
|
+
var min = (_minimums$get2 = minimums.get(areaName)) !== null && _minimums$get2 !== void 0 ? _minimums$get2 : 0;
|
|
153
|
+
var maxWidth = (_areas$areaName = areas[areaName]) === null || _areas$areaName === void 0 ? void 0 : _areas$areaName.maxWidth;
|
|
121
154
|
var configuredMax = maxWidth !== undefined ? (0, _resolveLayoutWidth.resolveLayoutWidth)(maxWidth, viewportWidth) : Number.POSITIVE_INFINITY;
|
|
122
|
-
states[
|
|
155
|
+
states[areaName] = {
|
|
123
156
|
mode: 'inline',
|
|
124
|
-
width:
|
|
125
|
-
minWidth:
|
|
157
|
+
width: width,
|
|
158
|
+
minWidth: min,
|
|
126
159
|
resizeBounds: {
|
|
127
|
-
min:
|
|
128
|
-
max: Math.max(
|
|
160
|
+
min: min,
|
|
161
|
+
max: Math.max(min, Math.min(configuredMax, availableWidth - mainMinWidth - inlineAreas.reduce(function (total, sibling) {
|
|
162
|
+
var _widths$get6, _minimums$get3;
|
|
163
|
+
return sibling === areaName || sibling === 'side-nav' && areaName !== 'side-nav' ? total : total + (areaName === 'panel' && sibling === 'chat-panel' ? (_widths$get6 = widths.get(sibling)) !== null && _widths$get6 !== void 0 ? _widths$get6 : 0 : (_minimums$get3 = minimums.get(sibling)) !== null && _minimums$get3 !== void 0 ? _minimums$get3 : 0);
|
|
164
|
+
}, 0)))
|
|
129
165
|
}
|
|
130
166
|
};
|
|
167
|
+
};
|
|
168
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
169
|
+
_loop();
|
|
131
170
|
}
|
|
132
171
|
} catch (err) {
|
|
133
172
|
_iterator3.e(err);
|
|
@@ -142,27 +181,27 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
142
181
|
try {
|
|
143
182
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
144
183
|
var _states$_areaName;
|
|
145
|
-
var
|
|
146
|
-
var _area = areas[
|
|
147
|
-
if (!(_area !== null && _area !== void 0 && _area.isOpen) || ((_states$_areaName = states[
|
|
184
|
+
var _areaName2 = _step4.value;
|
|
185
|
+
var _area = areas[_areaName2];
|
|
186
|
+
if (!(_area !== null && _area !== void 0 && _area.isOpen) || ((_states$_areaName = states[_areaName2]) === null || _states$_areaName === void 0 ? void 0 : _states$_areaName.mode) === 'inline' || _areaName2 === 'side-nav' && shouldCollapseSideNav) {
|
|
148
187
|
continue;
|
|
149
188
|
}
|
|
150
|
-
var
|
|
151
|
-
var
|
|
189
|
+
var _min2 = (0, _resolveLayoutWidth.resolveLayoutWidth)(_area.minWidth, viewportWidth);
|
|
190
|
+
var configuredMax = _area.maxWidth ? (0, _resolveLayoutWidth.resolveLayoutWidth)(_area.maxWidth, viewportWidth) : Number.POSITIVE_INFINITY;
|
|
152
191
|
// Chat covers Root; SideNav and the local panel overlay Main's grid track.
|
|
153
192
|
// Occupied tracks and inline chat are not part of that covered region.
|
|
154
|
-
var layoutMax = (
|
|
155
|
-
var _max = Math.max(0, Math.min(
|
|
156
|
-
var effectiveMin = Math.min(
|
|
193
|
+
var layoutMax = (_areaName2 === 'chat-panel' ? layoutWidth : mainAreaWidth) * 0.9;
|
|
194
|
+
var _max = Math.max(0, Math.min(configuredMax, layoutMax));
|
|
195
|
+
var effectiveMin = Math.min(_min2, _max);
|
|
157
196
|
var _target = getOverlayTargetWidth(_area, isSideNavOverlay);
|
|
158
|
-
var
|
|
197
|
+
var _width = clampTargetWidth({
|
|
159
198
|
target: _target,
|
|
160
199
|
min: effectiveMin,
|
|
161
200
|
max: _max
|
|
162
201
|
});
|
|
163
|
-
states[
|
|
202
|
+
states[_areaName2] = {
|
|
164
203
|
mode: 'overlay',
|
|
165
|
-
width:
|
|
204
|
+
width: _width,
|
|
166
205
|
minWidth: effectiveMin,
|
|
167
206
|
resizeBounds: {
|
|
168
207
|
min: effectiveMin,
|
|
@@ -111,6 +111,8 @@ function ChatPanel(_ref) {
|
|
|
111
111
|
onRequestClose: onClose
|
|
112
112
|
}
|
|
113
113
|
}),
|
|
114
|
+
isManaged = _useLayoutAreaSizing.isManaged,
|
|
115
|
+
prepareResize = _useLayoutAreaSizing.prepareResize,
|
|
114
116
|
managedSizing = _useLayoutAreaSizing.state,
|
|
115
117
|
getManagedResizeBounds = _useLayoutAreaSizing.getResizeBounds,
|
|
116
118
|
startResize = _useLayoutAreaSizing.startResize,
|
|
@@ -200,13 +202,14 @@ function ChatPanel(_ref) {
|
|
|
200
202
|
// Hoist the committed or actively resizing inline width so SideNav can yield
|
|
201
203
|
// space to ChatPanel without allowing the page layout to overflow.
|
|
202
204
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles
|
|
203
|
-
React.createElement("style", null, "\n#".concat(_root.gridRootId, " { ").concat(_constants.chatPanelLiveWidthVar, ": var(").concat(panelSplitterResizingVar, ", ").concat(chatPanelVariableWidth, "); }\n")), /*#__PURE__*/React.createElement(_provider.PanelSplitterProvider, {
|
|
205
|
+
React.createElement("style", null, managedSizing ? "\n#".concat(_root.gridRootId, " { --n_chatTrack: ").concat(mode === 'inline' ? "".concat(renderedWidth, "px") : '0px', "; ").concat(_constants.chatPanelLiveWidthVar, ": var(--n_chatTrack); }\n") : "\n#".concat(_root.gridRootId, " { --n_chatTrack: 0px; ").concat(_constants.chatPanelLiveWidthVar, ": 0px; }\n#").concat(_root.gridRootId, " [data-layout-chat-panel] {\n grid-area: 2 / 1 / -1 / -1;\n width: min(calc(var(--n_layoutW) * 0.9), ").concat(chatPanelOverlayVariableWidth, ");\n z-index: ").concat(_constants.localSlotLayers.chatPanelOverlay, ";\n background-color: ", "var(--ds-surface-overlay, #FFFFFF)", ";\n ").concat(hasBorder ? "box-shadow: ".concat("var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)", "; border-inline-start: none;") : '', "\n}\n@media (min-width: 40rem) {\n @container navigation-chat-space (min-width: ").concat(minWidth, ") {\n #").concat(_root.gridRootId, " { --n_chatTrack: min(100cqw, var(").concat(panelSplitterResizingVar, ", ").concat(chatPanelVariableWidth, ")); ").concat(_constants.chatPanelLiveWidthVar, ": var(--n_chatTrack); }\n #").concat(_root.gridRootId, " [data-layout-chat-panel] {\n grid-area: chat-panel;\n width: min(100cqw, var(").concat(panelSplitterResizingVar, ", ").concat(chatPanelVariableWidth, "));\n z-index: auto;\n background-color: ", "var(--ds-surface, #FFFFFF)", ";\n ").concat(hasBorder ? "box-shadow: initial; border-inline-start: ".concat("var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #0B120E24)", ";") : '', "\n }\n }\n}\n")), /*#__PURE__*/React.createElement(_provider.PanelSplitterProvider, {
|
|
204
206
|
panelId: chatPanelPanelSplitterId,
|
|
205
207
|
panelRef: ref,
|
|
206
208
|
panelWidth: renderedWidth,
|
|
207
209
|
onCompleteResize: onCompleteResize,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
prepareResize: prepareResize,
|
|
211
|
+
onResizeStartInternal: isManaged ? onResizeStartInternal : undefined,
|
|
212
|
+
onResizeInternal: isManaged ? onResizeInternal : undefined,
|
|
210
213
|
getResizeBounds: getResizeBounds,
|
|
211
214
|
resizingCssVar: panelSplitterResizingVar,
|
|
212
215
|
position: "start"
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.LayoutAreaSizingContext = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* One resize transaction. Keep its starting widths for controlled rejection,
|
|
10
|
+
* and its resulting widths for synchronous or delayed acknowledgement.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
var LayoutAreaSizingContext = exports.LayoutAreaSizingContext = /*#__PURE__*/(0, _react.createContext)(null);
|