@atlaskit/navigation-system 11.6.0 → 11.7.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/CHANGELOG.md +16 -0
- package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +72 -23
- package/dist/cjs/ui/page-layout/chat-panel.js +8 -2
- package/dist/cjs/ui/page-layout/layout-overlay-clearance.js +61 -0
- package/dist/cjs/ui/page-layout/local-panel-surface.compiled.css +1 -0
- package/dist/cjs/ui/page-layout/local-panel-surface.js +2 -1
- package/dist/cjs/ui/page-layout/panel-layout-shell.compiled.css +2 -1
- package/dist/cjs/ui/page-layout/panel-layout-shell.js +10 -3
- package/dist/cjs/ui/page-layout/panel-layout.js +5 -3
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +12 -5
- package/dist/cjs/ui/page-layout/root.compiled.css +5 -1
- package/dist/cjs/ui/page-layout/root.js +8 -2
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +2 -1
- package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +60 -16
- package/dist/es2019/ui/page-layout/chat-panel.js +9 -2
- package/dist/es2019/ui/page-layout/layout-overlay-clearance.js +88 -0
- package/dist/es2019/ui/page-layout/local-panel-surface.compiled.css +1 -0
- package/dist/es2019/ui/page-layout/local-panel-surface.js +2 -1
- package/dist/es2019/ui/page-layout/panel-layout-shell.compiled.css +2 -1
- package/dist/es2019/ui/page-layout/panel-layout-shell.js +14 -3
- package/dist/es2019/ui/page-layout/panel-layout.js +5 -3
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +12 -5
- package/dist/es2019/ui/page-layout/root.compiled.css +5 -1
- package/dist/es2019/ui/page-layout/root.js +8 -2
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +6 -1
- package/dist/esm/ui/page-layout/calculate-layout-area-states.js +72 -23
- package/dist/esm/ui/page-layout/chat-panel.js +9 -3
- package/dist/esm/ui/page-layout/layout-overlay-clearance.js +55 -0
- package/dist/esm/ui/page-layout/local-panel-surface.compiled.css +1 -0
- package/dist/esm/ui/page-layout/local-panel-surface.js +2 -1
- package/dist/esm/ui/page-layout/panel-layout-shell.compiled.css +2 -1
- package/dist/esm/ui/page-layout/panel-layout-shell.js +10 -3
- package/dist/esm/ui/page-layout/panel-layout.js +5 -3
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +12 -5
- package/dist/esm/ui/page-layout/root.compiled.css +5 -1
- package/dist/esm/ui/page-layout/root.js +8 -2
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +3 -2
- package/dist/types/ui/page-layout/chat-panel.d.ts +9 -2
- package/dist/types/ui/page-layout/layout-overlay-clearance.d.ts +9 -0
- package/dist/types/ui/page-layout/panel-layout-shell.d.ts +6 -1
- package/dist/types/ui/page-layout/panel-layout.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
1
2
|
import { resolveLayoutWidth } from './resolve-layout-width';
|
|
2
3
|
function clampTargetWidth({
|
|
3
4
|
target,
|
|
@@ -27,8 +28,9 @@ export function calculateLayoutAreaStates({
|
|
|
27
28
|
resizeSession,
|
|
28
29
|
initialModes
|
|
29
30
|
}) {
|
|
30
|
-
var _ref3, _resizeSession$overla, _baselineWidths$chat, _panel$liveResize, _states$sideNav$widt, _states$sideNav, _states$chatPanel$wi, _states$chatPanel;
|
|
31
|
+
var _ref3, _resizeSession$overla, _resizeSession$overla2, _baselineWidths$chat, _panel$liveResize, _states$sideNav$widt, _states$sideNav, _states$chatPanel$wi, _states$chatPanel;
|
|
31
32
|
const mainMinWidth = resolveLayoutWidth(mainMinWidthBound, viewportWidth);
|
|
33
|
+
const isRefinedLayout = fg('platform-dst-chat-panel-layout');
|
|
32
34
|
const availableWidth = Math.max(0, layoutWidth - occupiedWidth);
|
|
33
35
|
const sideNav = areas['side-nav'];
|
|
34
36
|
const panel = areas.panel;
|
|
@@ -42,14 +44,35 @@ export function calculateLayoutAreaStates({
|
|
|
42
44
|
const layoutModes = (_resizeSession$overla = resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.overlayModes) !== null && _resizeSession$overla !== void 0 ? _resizeSession$overla : initialModes;
|
|
43
45
|
// A growing panel cascades towards inline-start. Chat is on the other side
|
|
44
46
|
// of the local rail, so local growth must reserve its full starting width.
|
|
45
|
-
const shouldCollapseSideNav = Boolean(resizeSession && resizeSession.area !== 'side-nav' && resizeSession.baselineWidths['side-nav'] !== undefined && resizeSession.baselineWidths[resizeSession.area] !== undefined && resizingArea && !isSideNavOverlay && clampTargetWidth({
|
|
47
|
+
const shouldCollapseSideNav = Boolean(resizeSession && resizeSession.area !== 'side-nav' && !(isRefinedLayout && ((_resizeSession$overla2 = resizeSession.overlayModes) === null || _resizeSession$overla2 === void 0 ? void 0 : _resizeSession$overla2.panel) === 'overlay' && resizeSession.area === 'panel') && resizeSession.baselineWidths['side-nav'] !== undefined && resizeSession.baselineWidths[resizeSession.area] !== undefined && resizingArea && !isSideNavOverlay && clampTargetWidth({
|
|
46
48
|
target: getTargetWidth(resizingArea, isSideNavOverlay),
|
|
47
49
|
min: resolveLayoutWidth(resizingArea.minWidth, viewportWidth),
|
|
48
50
|
max: resizingArea.maxWidth !== undefined ? resolveLayoutWidth(resizingArea.maxWidth, viewportWidth) : Number.POSITIVE_INFINITY
|
|
49
51
|
}) > 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));
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
52
|
+
let isSideNavOpenInline = Boolean((sideNav === null || sideNav === void 0 ? void 0 : sideNav.isOpen) && !shouldCollapseSideNav && (layoutModes ? layoutModes['side-nav'] === 'inline' : !isSideNavOverlay && availableWidth >= mainMinWidth + sideNavMinWidth));
|
|
53
|
+
const canInlineChat = () => 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)));
|
|
54
|
+
let isChatPanelOpenInline = canInlineChat();
|
|
55
|
+
const canInlinePanel = () => 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)));
|
|
56
|
+
let isPanelInline = canInlinePanel();
|
|
57
|
+
const overlayMainMinWidth = Math.max(mainMinWidth, panelMinWidth + 32);
|
|
58
|
+
if (isRefinedLayout && panel !== null && panel !== void 0 && panel.isOpen && !isPanelInline && isSideNavOpenInline && availableWidth < overlayMainMinWidth + sideNavMinWidth + (isChatPanelOpenInline ? chatPanelMinWidth : 0)) {
|
|
59
|
+
// Wider app minimums may leave no capacity for the clearance even after
|
|
60
|
+
// both siblings reach minimum. Move Chat to overlay, then recheck local.
|
|
61
|
+
isChatPanelOpenInline = false;
|
|
62
|
+
isPanelInline = canInlinePanel();
|
|
63
|
+
if (!isPanelInline && availableWidth < overlayMainMinWidth + sideNavMinWidth) {
|
|
64
|
+
// A constrained Root may not fit even navigation beside local's overlay.
|
|
65
|
+
isSideNavOpenInline = false;
|
|
66
|
+
isChatPanelOpenInline = canInlineChat();
|
|
67
|
+
isPanelInline = canInlinePanel();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// The clearance belongs to Main only while local overlays an inline SideNav.
|
|
72
|
+
// Decide placement using the ordinary minimum first, so the gap does not
|
|
73
|
+
// unnecessarily promote an otherwise-fitting inline panel to overlay.
|
|
74
|
+
const hasPanelClearance = isRefinedLayout && (panel === null || panel === void 0 ? void 0 : panel.isOpen) && !isPanelInline && isSideNavOpenInline;
|
|
75
|
+
const effectiveMainMinWidth = hasPanelClearance ? overlayMainMinWidth : mainMinWidth;
|
|
53
76
|
const inlineAreas = [isSideNavOpenInline && 'side-nav', isPanelInline && 'panel', isChatPanelOpenInline && 'chat-panel'].filter(area => Boolean(area));
|
|
54
77
|
const widths = new Map();
|
|
55
78
|
const minimums = new Map();
|
|
@@ -89,7 +112,7 @@ export function calculateLayoutAreaStates({
|
|
|
89
112
|
const chatWidth = (_widths$get3 = widths.get('chat-panel')) !== null && _widths$get3 !== void 0 ? _widths$get3 : 0;
|
|
90
113
|
widths.set('chat-panel', Math.max(chatPanelMinWidth, chatWidth - remainingDrag));
|
|
91
114
|
}
|
|
92
|
-
let overflow = Math.max(0, Array.from(widths.values()).reduce((total, width) => total + width, 0) - (availableWidth - mainMinWidth));
|
|
115
|
+
let overflow = Math.max(0, Array.from(widths.values()).reduce((total, width) => total + width, 0) - (availableWidth - (resizeSession ? effectiveMainMinWidth : mainMinWidth)));
|
|
93
116
|
const compressionOrder = ['panel', 'chat-panel', 'side-nav'];
|
|
94
117
|
// Main gives up spare space first. Only regions beyond the moving rail may
|
|
95
118
|
// then compress: local growth moves towards SideNav, never towards Chat.
|
|
@@ -106,11 +129,30 @@ export function calculateLayoutAreaStates({
|
|
|
106
129
|
widths.set(areaName, width - reduction);
|
|
107
130
|
overflow -= reduction;
|
|
108
131
|
}
|
|
132
|
+
if (hasPanelClearance && panel) {
|
|
133
|
+
var _panel$compactDefault, _widths$get5, _widths$get6;
|
|
134
|
+
// Opening/viewport fitting gives up SideNav width before Chat. During a
|
|
135
|
+
// panel drag only SideNav yields; Chat retains its starting width.
|
|
136
|
+
const isPanelResize = (resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.area) === 'panel';
|
|
137
|
+
const desiredPanelWidth = Math.max(panelMinWidth, Math.min(getOverlayTargetWidth(panel, isSideNavOverlay, 'panel'), panel.maxWidth === undefined ? Infinity : resolveLayoutWidth(panel.maxWidth, viewportWidth)));
|
|
138
|
+
const overlayDefault = isSideNavOverlay ? (_panel$compactDefault = panel.compactDefaultWidth) !== null && _panel$compactDefault !== void 0 ? _panel$compactDefault : panel.defaultWidth : panel.defaultWidth;
|
|
139
|
+
const reservedMainWidth = isPanelResize ? Math.max(effectiveMainMinWidth, desiredPanelWidth + 32,
|
|
140
|
+
// Above the default, Main must also fit the panel within its 90% cap.
|
|
141
|
+
desiredPanelWidth > overlayDefault ? desiredPanelWidth / 0.9 : 0) : effectiveMainMinWidth;
|
|
142
|
+
let deficit = Math.max(0, reservedMainWidth + ((_widths$get5 = widths.get('side-nav')) !== null && _widths$get5 !== void 0 ? _widths$get5 : 0) + ((_widths$get6 = widths.get('chat-panel')) !== null && _widths$get6 !== void 0 ? _widths$get6 : 0) - availableWidth);
|
|
143
|
+
for (const name of isPanelResize ? ['side-nav'] : ['side-nav', 'chat-panel']) {
|
|
144
|
+
var _widths$get7, _minimums$get2;
|
|
145
|
+
const width = (_widths$get7 = widths.get(name)) !== null && _widths$get7 !== void 0 ? _widths$get7 : 0;
|
|
146
|
+
const reduction = Math.min(deficit, Math.max(0, width - ((_minimums$get2 = minimums.get(name)) !== null && _minimums$get2 !== void 0 ? _minimums$get2 : 0)));
|
|
147
|
+
widths.set(name, width - reduction);
|
|
148
|
+
deficit -= reduction;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
109
151
|
const states = {};
|
|
110
152
|
for (const areaName of inlineAreas) {
|
|
111
|
-
var _widths$
|
|
112
|
-
const width = (_widths$
|
|
113
|
-
const min = (_minimums$
|
|
153
|
+
var _widths$get8, _minimums$get3, _areas$areaName;
|
|
154
|
+
const width = (_widths$get8 = widths.get(areaName)) !== null && _widths$get8 !== void 0 ? _widths$get8 : 0;
|
|
155
|
+
const min = (_minimums$get3 = minimums.get(areaName)) !== null && _minimums$get3 !== void 0 ? _minimums$get3 : 0;
|
|
114
156
|
const maxWidth = (_areas$areaName = areas[areaName]) === null || _areas$areaName === void 0 ? void 0 : _areas$areaName.maxWidth;
|
|
115
157
|
const configuredMax = maxWidth !== undefined ? resolveLayoutWidth(maxWidth, viewportWidth) : Number.POSITIVE_INFINITY;
|
|
116
158
|
states[areaName] = {
|
|
@@ -119,9 +161,9 @@ export function calculateLayoutAreaStates({
|
|
|
119
161
|
minWidth: min,
|
|
120
162
|
resizeBounds: {
|
|
121
163
|
min,
|
|
122
|
-
max: Math.max(min, Math.min(configuredMax, availableWidth -
|
|
123
|
-
var _widths$
|
|
124
|
-
return sibling === areaName || sibling === 'side-nav' && areaName !== 'side-nav' ? total : total + (areaName === 'panel' && sibling === 'chat-panel' ? (_widths$
|
|
164
|
+
max: Math.max(min, Math.min(configuredMax, availableWidth - effectiveMainMinWidth - inlineAreas.reduce((total, sibling) => {
|
|
165
|
+
var _widths$get9, _minimums$get4;
|
|
166
|
+
return sibling === areaName || sibling === 'side-nav' && areaName !== 'side-nav' ? total : total + (areaName === 'panel' && sibling === 'chat-panel' ? (_widths$get9 = widths.get(sibling)) !== null && _widths$get9 !== void 0 ? _widths$get9 : 0 : (_minimums$get4 = minimums.get(sibling)) !== null && _minimums$get4 !== void 0 ? _minimums$get4 : 0);
|
|
125
167
|
}, 0)))
|
|
126
168
|
}
|
|
127
169
|
};
|
|
@@ -130,7 +172,7 @@ export function calculateLayoutAreaStates({
|
|
|
130
172
|
const inlineChatPanelWidth = (_states$chatPanel$wi = (_states$chatPanel = states['chat-panel']) === null || _states$chatPanel === void 0 ? void 0 : _states$chatPanel.width) !== null && _states$chatPanel$wi !== void 0 ? _states$chatPanel$wi : 0;
|
|
131
173
|
const mainAreaWidth = Math.max(0, availableWidth - inlineSideNavWidth - inlineChatPanelWidth);
|
|
132
174
|
for (const areaName of ['side-nav', 'panel', 'chat-panel']) {
|
|
133
|
-
var _states$areaName;
|
|
175
|
+
var _states$areaName, _area$compactDefaultW3;
|
|
134
176
|
const area = areas[areaName];
|
|
135
177
|
if (!(area !== null && area !== void 0 && area.isOpen) || ((_states$areaName = states[areaName]) === null || _states$areaName === void 0 ? void 0 : _states$areaName.mode) === 'inline' || areaName === 'side-nav' && shouldCollapseSideNav) {
|
|
136
178
|
continue;
|
|
@@ -140,13 +182,15 @@ export function calculateLayoutAreaStates({
|
|
|
140
182
|
// Chat covers Root; SideNav and the local panel overlay Main's grid track.
|
|
141
183
|
// Occupied tracks and inline chat are not part of that covered region.
|
|
142
184
|
const layoutMax = (areaName === 'chat-panel' ? layoutWidth : mainAreaWidth) * 0.9;
|
|
143
|
-
const
|
|
144
|
-
const
|
|
185
|
+
const defaultWidth = isSideNavOverlay ? (_area$compactDefaultW3 = area.compactDefaultWidth) !== null && _area$compactDefaultW3 !== void 0 ? _area$compactDefaultW3 : area.defaultWidth : area.defaultWidth;
|
|
186
|
+
const overlayMax = isRefinedLayout && areaName === 'panel' ? hasPanelClearance ? Math.min(availableWidth - sideNavMinWidth - inlineChatPanelWidth - 32, Math.max(defaultWidth, (availableWidth - sideNavMinWidth - inlineChatPanelWidth) * 0.9)) : Math.min(mainAreaWidth, Math.max(defaultWidth, layoutMax)) : layoutMax;
|
|
187
|
+
const max = isRefinedLayout && areaName === 'panel' ? Math.max(min, Math.min(configuredMax, overlayMax)) : Math.max(0, Math.min(configuredMax, overlayMax));
|
|
188
|
+
const effectiveMin = isRefinedLayout && areaName === 'panel' ? min : Math.min(min, max);
|
|
145
189
|
const target = getOverlayTargetWidth(area, isSideNavOverlay, areaName);
|
|
146
190
|
const width = clampTargetWidth({
|
|
147
191
|
target,
|
|
148
192
|
min: effectiveMin,
|
|
149
|
-
max
|
|
193
|
+
max: hasPanelClearance && areaName === 'panel' ? Math.min(max, mainAreaWidth - 32, Math.max(defaultWidth, layoutMax)) : max
|
|
150
194
|
});
|
|
151
195
|
states[areaName] = {
|
|
152
196
|
mode: 'overlay',
|
|
@@ -10,7 +10,7 @@ import { chatPanelLiveWidthVar, chatPanelVar, defaultMainMinWidth, localSlotLaye
|
|
|
10
10
|
import { convertResizeBoundToPixels } from './panel-splitter/convert-resize-bound-to-pixels';
|
|
11
11
|
import { PanelSplitterProvider } from './panel-splitter/provider';
|
|
12
12
|
import { resolveLayoutWidth } from './resolve-layout-width';
|
|
13
|
-
import { gridRootId } from './root';
|
|
13
|
+
import { gridRootFitId, gridRootId } from './root';
|
|
14
14
|
import { useLayoutAreaSizing } from './use-layout-area-sizing';
|
|
15
15
|
import { useLayoutId } from './use-layout-id';
|
|
16
16
|
import { useResizingWidthCssVarOnRootElement } from './use-resizing-width-css-var-on-root-element';
|
|
@@ -48,6 +48,7 @@ const styles = {
|
|
|
48
48
|
export function ChatPanel({
|
|
49
49
|
children,
|
|
50
50
|
defaultWidth: defaultWidthProp,
|
|
51
|
+
compactDefaultWidth: compactDefaultWidthProp,
|
|
51
52
|
minWidth = fallbackMinWidth,
|
|
52
53
|
maxWidth,
|
|
53
54
|
label = 'Chat panel',
|
|
@@ -67,7 +68,12 @@ export function ChatPanel({
|
|
|
67
68
|
fallbackDefaultWidth,
|
|
68
69
|
slotName: 'ChatPanel'
|
|
69
70
|
});
|
|
70
|
-
const
|
|
71
|
+
const compactFallbackWidth = defaultWidthProp === undefined ? fallbackCompactDefaultWidth : defaultWidth;
|
|
72
|
+
const compactDefaultWidth = useSafeDefaultWidth({
|
|
73
|
+
defaultWidthProp: fg('platform-dst-chat-panel-layout') ? compactDefaultWidthProp !== null && compactDefaultWidthProp !== void 0 ? compactDefaultWidthProp : compactFallbackWidth : compactFallbackWidth,
|
|
74
|
+
fallbackDefaultWidth: compactFallbackWidth,
|
|
75
|
+
slotName: 'ChatPanel compactDefaultWidth'
|
|
76
|
+
});
|
|
71
77
|
useSkipLinkInternal({
|
|
72
78
|
id,
|
|
73
79
|
label: skipLinkLabel,
|
|
@@ -186,6 +192,7 @@ export function ChatPanel({
|
|
|
186
192
|
React.createElement("style", null, managedSizing ? `
|
|
187
193
|
#${gridRootId} { --n_chatTrack: ${mode === 'inline' ? `${renderedWidth}px` : '0px'}; ${chatPanelLiveWidthVar}: var(--n_chatTrack); }
|
|
188
194
|
` : `
|
|
195
|
+
#${gridRootFitId} { --n_clearanceChatMin: ${minWidth}; --n_clearanceChatTarget: ${chatPanelVariableWidth}; }
|
|
189
196
|
#${gridRootId} { --n_chatTrack: 0px; ${chatPanelLiveWidthVar}: 0px; }
|
|
190
197
|
#${gridRootId} [data-layout-chat-panel] {
|
|
191
198
|
grid-area: 2 / 1 / -1 / -1;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { gridRootChatFitId, gridRootId } from './root';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* CSS owns fitting before hydration and lazy resize activation. Each slot hoists
|
|
6
|
+
* its own minimum and target into Root's capacity containers during rendering;
|
|
7
|
+
* the local shell supplies its minimum without waiting for effect registration.
|
|
8
|
+
*/
|
|
9
|
+
export function LayoutOverlayClearance({
|
|
10
|
+
panelMinWidth,
|
|
11
|
+
mainMinWidth
|
|
12
|
+
}) {
|
|
13
|
+
const navMin = 'var(--n_clearanceNavMin, 0px)';
|
|
14
|
+
const navTarget = 'var(--n_clearanceNavTarget, 0px)';
|
|
15
|
+
const chatMinimum = 'var(--n_clearanceChatMin, 0px)';
|
|
16
|
+
const chatTarget = 'var(--n_clearanceChatTarget, 0px)';
|
|
17
|
+
const extra = Math.max(0, panelMinWidth + 32 - mainMinWidth);
|
|
18
|
+
const available = 'calc(var(--n_layoutW) - var(--n_fitAside, 0px) - var(--n_fitRibbon, 0px) - var(--n_fitPanel, 0px))';
|
|
19
|
+
const root = `#${gridRootId}:has(> nav[data-layout-side-nav-open])`;
|
|
20
|
+
const fit = `#${gridRootChatFitId}:has(> #${gridRootId} > nav[data-layout-side-nav-open])`;
|
|
21
|
+
const rule = (chatInline, selector) => {
|
|
22
|
+
const chatMin = chatInline ? chatMinimum : '0px';
|
|
23
|
+
const baselineNav = `min(${navTarget}, calc(${available} - ${mainMinWidth}px - ${chatMin}))`;
|
|
24
|
+
const baselineChat = chatInline ? `max(${chatMin}, min(${chatTarget}, calc(${available} - ${mainMinWidth}px - ${navTarget})))` : '0px';
|
|
25
|
+
const deficit = `max(0px, calc(${mainMinWidth + extra}px + ${baselineNav} + ${baselineChat} - ${available}))`;
|
|
26
|
+
const navWidth = `max(${navMin}, calc(${baselineNav} - ${deficit}))`;
|
|
27
|
+
const chatWidth = `max(${chatMin}, calc(${baselineChat} - max(0px, calc(${deficit} - (${baselineNav} - ${navMin})))))`;
|
|
28
|
+
const container = chatInline ? 'navigation-panel-chat-space' : 'navigation-panel-nav-space';
|
|
29
|
+
return `@container ${container} (width >= ${extra + 1}px) and (width < ${panelMinWidth + 1}px) {
|
|
30
|
+
${selector} { --n_localPanelOverlayMax: calc(100% - 32px); ${chatInline ? `--n_chatTrack: ${chatWidth};` : ''} }
|
|
31
|
+
${selector} > nav[data-layout-slot] { width: ${navWidth}; }
|
|
32
|
+
${chatInline ? `${selector} > [data-layout-chat-panel] { width: var(--n_chatTrack); }` : ''}
|
|
33
|
+
}`;
|
|
34
|
+
};
|
|
35
|
+
const inlineRule = (chatInline, selector) => {
|
|
36
|
+
const chatMin = chatInline ? chatMinimum : '0px';
|
|
37
|
+
const navWidth = `max(${navMin}, min(${navTarget}, calc(${available} - ${mainMinWidth + panelMinWidth}px - ${chatMin})))`;
|
|
38
|
+
const chatWidth = `max(${chatMin}, min(${chatTarget}, calc(${available} - ${mainMinWidth + panelMinWidth}px - ${navTarget})))`;
|
|
39
|
+
return `@container ${chatInline ? 'navigation-panel-chat-space' : 'navigation-panel-nav-space'} (width >= ${panelMinWidth + 1}px) {
|
|
40
|
+
${selector} > nav[data-layout-slot] { width: ${navWidth}; }
|
|
41
|
+
${chatInline ? `${selector} { --n_chatTrack: ${chatWidth}; }
|
|
42
|
+
${selector} > [data-layout-chat-panel] { width: var(--n_chatTrack); }` : ''}
|
|
43
|
+
}`;
|
|
44
|
+
};
|
|
45
|
+
// Without inline navigation, only Main and the two panels share the width.
|
|
46
|
+
// Reserve local's minimum before allowing Chat to consume spare capacity.
|
|
47
|
+
const inlineWithoutNav = selector => `
|
|
48
|
+
@container navigation-panel-chat-space (width >= ${panelMinWidth + 1}px) {
|
|
49
|
+
${selector} { --n_chatTrack: min(${chatTarget}, calc(${available} - ${mainMinWidth + panelMinWidth}px)); }
|
|
50
|
+
${selector} > [data-layout-chat-panel] { width: var(--n_chatTrack); }
|
|
51
|
+
}`;
|
|
52
|
+
const withoutChat = `${root}:not(:has(> [data-layout-chat-panel]))`;
|
|
53
|
+
const withChat = `${root}:has(> [data-layout-chat-panel])`;
|
|
54
|
+
// React 18 escapes comparison operators in style children during SSR. The
|
|
55
|
+
// stylesheet contains only internal selectors/tokens and numeric width props.
|
|
56
|
+
const css = `@media (min-width: 64rem) {
|
|
57
|
+
@container navigation-panel-nav-space (width < ${extra + 1}px) {
|
|
58
|
+
${fit} { --n_fitNav: 0px; }
|
|
59
|
+
${root} > nav[data-layout-slot] { grid-area: main; width: min(90%, ${navTarget}); background-color: ${"var(--ds-surface-overlay, #FFFFFF)"}; box-shadow: ${"var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px 0px 1px #1E1F214f)"}; border-inline-end: none; }
|
|
60
|
+
}
|
|
61
|
+
@container navigation-panel-nav-space (width >= ${extra + 1}px) {
|
|
62
|
+
@container navigation-panel-chat-space (width < ${panelMinWidth + 1}px) {
|
|
63
|
+
${fit} { --n_fitNav: calc(${navMin} + ${extra}px); }
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
${rule(false, withoutChat)}
|
|
67
|
+
${inlineRule(false, withoutChat)}
|
|
68
|
+
@container navigation-panel-chat-space (width < ${extra + 1}px) {
|
|
69
|
+
${rule(false, withChat)}
|
|
70
|
+
${inlineRule(false, withChat)}
|
|
71
|
+
}
|
|
72
|
+
${rule(true, withChat)}
|
|
73
|
+
${inlineRule(true, withChat)}
|
|
74
|
+
${inlineWithoutNav(`#${gridRootId}:not(:has(> nav[data-layout-side-nav-open]))`)}
|
|
75
|
+
}
|
|
76
|
+
@media (min-width: 40rem) and (width < 64rem) {
|
|
77
|
+
${inlineWithoutNav(`#${gridRootId}:has(> [data-layout-chat-panel])`)}
|
|
78
|
+
}`;
|
|
79
|
+
return (
|
|
80
|
+
/*#__PURE__*/
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, react/no-danger -- Root-scoped, internally generated CSS must retain query operators during SSR.
|
|
82
|
+
React.createElement("style", {
|
|
83
|
+
dangerouslySetInnerHTML: {
|
|
84
|
+
__html: css
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
._16qs1dhr{box-shadow:var(--p_lclPnlSsrShadow,var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f))}
|
|
12
12
|
._16qsglyw{box-shadow:none}
|
|
13
13
|
._18m91wug{overflow-y:auto}
|
|
14
|
+
._1bsb123g{width:var(--p_lclPnlSsrWidth,max(var(--p_lclPnlMinW),min(var(--p_lclPnlSsrPreferredW),100%,var(--n_localPanelOverlayMax,100%),max(var(--p_lclPnlSsrDefaultW),90%))))}
|
|
14
15
|
._1bsb13q4{width:min(90%,var(--p_lclPnlRsz,var(--p_lclPnlW)))}
|
|
15
16
|
._1bsb1c5w{width:var(--p_lclPnlRsz,var(--p_lclPnlW))}
|
|
16
17
|
._1bsb1cku{width:var(--p_lclPnlSsrWidth,min(90%,var(--p_lclPnlSsrPreferredW)))}
|
|
@@ -22,6 +22,7 @@ const localPanelSplitterId = Symbol('LocalPanel PanelSplitter');
|
|
|
22
22
|
const styles = {
|
|
23
23
|
panelWrapper: "_nd5l1gzg _kqsw1if8 _bfhk1bhr _vchhusvi _4t3ieqxy _152tidpf _10fph9n0 _1bsb13q4",
|
|
24
24
|
managedInline: "_nd5l1c6w _bfhkvuon _152tidpf _1bsb1c5w",
|
|
25
|
+
refinedUnmeasured: "_1bsb123g",
|
|
25
26
|
unmeasured: "_nd5l32aw _191wbqna _1bsb1cku _bfhk1g1j _16qs1dhr",
|
|
26
27
|
managedOverlay: "_nd5l1gzg _bfhk1bhr _1bsb1c5w",
|
|
27
28
|
panelScrollContainer: "_1reo1wug _18m91wug _4t3i1osq",
|
|
@@ -163,7 +164,7 @@ export function LocalPanelSurface({
|
|
|
163
164
|
[localPanelVar]: `${renderedWidth}px`
|
|
164
165
|
},
|
|
165
166
|
ref: mergedRef,
|
|
166
|
-
className: ax([isMotionUpliftEnabled && state === 'entering' && styles.entering, isMotionUpliftEnabled && state === 'exiting' && styles.exiting, styles.panelWrapper, styles.border, !managedSizing && styles.unmeasured, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'inline' && styles.managedInline, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'overlay' && styles.managedOverlay, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'inline' && styles.managedInlineBorder])
|
|
167
|
+
className: ax([isMotionUpliftEnabled && state === 'entering' && styles.entering, isMotionUpliftEnabled && state === 'exiting' && styles.exiting, styles.panelWrapper, styles.border, !managedSizing && styles.unmeasured, !managedSizing && fg('platform-dst-chat-panel-layout') && styles.refinedUnmeasured, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'inline' && styles.managedInline, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'overlay' && styles.managedOverlay, (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'inline' && styles.managedInlineBorder])
|
|
167
168
|
}, /*#__PURE__*/React.createElement(PanelSplitterProvider, {
|
|
168
169
|
panelId: localPanelSplitterId,
|
|
169
170
|
panelRef: ref,
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
._4t3i1osq{height:100%}
|
|
18
18
|
._7cca15wb{container-type:inline-size}
|
|
19
19
|
._82e815vq._82e815vq{overflow-y:hidden}
|
|
20
|
+
._cw8k1fc5{--p_lclPnlSsrDefaultW:var(--p_lclPnlCompactDefaultW)}
|
|
20
21
|
._evra4a59{--p_lclPnlSsrInlineAreas:"main panel"}
|
|
21
22
|
._f8371m6a._f8371m6a{grid-template-areas:"main"}
|
|
22
23
|
._f8374a59._f8374a59{grid-template-areas:"main panel"}
|
|
@@ -24,4 +25,4 @@
|
|
|
24
25
|
._vlegi47z._vlegi47z{grid-template-columns:minmax(0,1fr)}
|
|
25
26
|
._yv0eggl6{grid-template-columns:var(--p_lclPnlSsrColumns,minmax(0,1fr))}
|
|
26
27
|
._yv0ei47z{grid-template-columns:minmax(0,1fr)}
|
|
27
|
-
@media (min-width:64rem){._peezi77x{--p_lclPnlSsrPreferredW:var(--p_lclPnlTrackW)}}
|
|
28
|
+
@media (min-width:64rem){._peezi77x{--p_lclPnlSsrPreferredW:var(--p_lclPnlTrackW)}._1tg31owj{--p_lclPnlSsrDefaultW:var(--p_lclPnlDefaultW)}}
|
|
@@ -3,6 +3,8 @@ import "./panel-layout-shell.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useContext, useId } from 'react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
7
|
+
import { LayoutOverlayClearance } from './layout-overlay-clearance';
|
|
6
8
|
import { MainMinWidthContext } from './main-min-width-context';
|
|
7
9
|
|
|
8
10
|
// The grid uses runtime CSS variables and container sizing outside @atlaskit/css's bounded values.
|
|
@@ -14,7 +16,7 @@ const styles = {
|
|
|
14
16
|
layout: "_1reo1wug _18m91wug _1e0c11p5 _7cca15wb _1lmc1m6a _yv0ei47z _2z05hkll _4t3i1osq _1bsb1osq",
|
|
15
17
|
mainContent: "_nd5l1gzg _1reo1wug _18m91wug _1e0c1txw _4t3i1osq _19121cl4",
|
|
16
18
|
panelUplift: "_1reo15vq _18m915vq",
|
|
17
|
-
unmeasured: "_evra4a59 _1lmcc53r _yv0eggl6 _129o1uuk _peezi77x",
|
|
19
|
+
unmeasured: "_evra4a59 _1lmcc53r _yv0eggl6 _129o1uuk _cw8k1fc5 _peezi77x _1tg31owj",
|
|
18
20
|
managedInline: "_1uwq15vq _82e815vq _f8374a59 _1l7c1wug _vleg1orf",
|
|
19
21
|
managedOverlay: "_1uwq15vq _82e815vq _f8371m6a _vlegi47z _1l7chkll",
|
|
20
22
|
panelClosed: "_f8371m6a _vlegi47z _1l7chkll"
|
|
@@ -28,6 +30,8 @@ export function PanelLayoutShell({
|
|
|
28
30
|
isPanelOpen,
|
|
29
31
|
panelWidth,
|
|
30
32
|
compactPanelWidth,
|
|
33
|
+
defaultPanelWidth,
|
|
34
|
+
compactDefaultPanelWidth,
|
|
31
35
|
panelMinWidth = 320,
|
|
32
36
|
mode,
|
|
33
37
|
layoutRef,
|
|
@@ -42,7 +46,10 @@ export function PanelLayoutShell({
|
|
|
42
46
|
const inlineQuery = `@container local-panel-layout (min-width: ${mainMinWidth + panelMinWidth}px)`;
|
|
43
47
|
return /*#__PURE__*/React.createElement("div", {
|
|
44
48
|
className: ax([styles.container])
|
|
45
|
-
}, mode === undefined && isPanelOpen &&
|
|
49
|
+
}, mode === undefined && isPanelOpen && fg('platform-dst-chat-panel-layout') && /*#__PURE__*/React.createElement(LayoutOverlayClearance, {
|
|
50
|
+
panelMinWidth: panelMinWidth,
|
|
51
|
+
mainMinWidth: mainMinWidth
|
|
52
|
+
}), mode === undefined && isPanelOpen &&
|
|
46
53
|
/*#__PURE__*/
|
|
47
54
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped SSR query supports caller-defined minimums; CSS variables are not allowed in query conditions.
|
|
48
55
|
React.createElement("style", null, `${inlineQuery} {
|
|
@@ -65,7 +72,11 @@ export function PanelLayoutShell({
|
|
|
65
72
|
[localPanelTrackWidthVar]: `${panelWidth}px`,
|
|
66
73
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
67
74
|
[localPanelMinWidthVar]: `${panelMinWidth}px`,
|
|
68
|
-
'--p_lclPnlCompactW': `${compactPanelWidth}px
|
|
75
|
+
'--p_lclPnlCompactW': `${compactPanelWidth}px`,
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
77
|
+
'--p_lclPnlDefaultW': `${defaultPanelWidth}px`,
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/ui-styling-standard/no-unsafe-values
|
|
79
|
+
'--p_lclPnlCompactDefaultW': `${compactDefaultPanelWidth}px`
|
|
69
80
|
},
|
|
70
81
|
className: ax([styles.layout, mode === undefined && isPanelOpen && styles.unmeasured, shouldClipOverflow && styles.panelUplift, mode === 'inline' && styles.managedInline, mode === 'overlay' && styles.managedOverlay, !isPanelOpen && styles.panelClosed])
|
|
71
82
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -29,7 +29,7 @@ function CoordinatedPanelLayout({
|
|
|
29
29
|
testId,
|
|
30
30
|
layoutRef
|
|
31
31
|
}) {
|
|
32
|
-
var _ref,
|
|
32
|
+
var _ref, _state$width;
|
|
33
33
|
const [defaults] = useState(getPanelLayoutDefaults);
|
|
34
34
|
const panelMinWidth = suppliedMinWidth !== null && suppliedMinWidth !== void 0 ? suppliedMinWidth : defaults.panelMinWidth;
|
|
35
35
|
const coordinator = useContext(LayoutAreaSizingContext);
|
|
@@ -42,8 +42,8 @@ function CoordinatedPanelLayout({
|
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
}, [coordinator]);
|
|
45
|
-
const [defaultWidth] = useState(
|
|
46
|
-
const [compactWidth] = useState((
|
|
45
|
+
const [defaultWidth] = useState(defaultPanelWidth !== null && defaultPanelWidth !== void 0 ? defaultPanelWidth : fg('platform-dst-chat-panel-layout') ? defaults.panelWidth : panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaults.panelWidth);
|
|
46
|
+
const [compactWidth] = useState((_ref = compactDefaultPanelWidth !== null && compactDefaultPanelWidth !== void 0 ? compactDefaultPanelWidth : defaultPanelWidth) !== null && _ref !== void 0 ? _ref : fg('platform-dst-chat-panel-layout') ? defaults.compactPanelWidth : panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaults.compactPanelWidth);
|
|
47
47
|
// Use the controlled request before measurement too, without changing the mount-time default.
|
|
48
48
|
const fallbackWidth = Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaultWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity));
|
|
49
49
|
const {
|
|
@@ -99,6 +99,8 @@ function CoordinatedPanelLayout({
|
|
|
99
99
|
return /*#__PURE__*/React.createElement(PanelLayoutShell, {
|
|
100
100
|
isPanelOpen: isPanelOpen,
|
|
101
101
|
panelWidth: (_state$width = state === null || state === void 0 ? void 0 : state.width) !== null && _state$width !== void 0 ? _state$width : fallbackWidth,
|
|
102
|
+
defaultPanelWidth: defaultWidth,
|
|
103
|
+
compactDefaultPanelWidth: compactWidth,
|
|
102
104
|
compactPanelWidth: Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : compactWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity)),
|
|
103
105
|
panelMinWidth: panelMinWidth,
|
|
104
106
|
mode: state === null || state === void 0 ? void 0 : state.mode,
|
|
@@ -381,6 +381,13 @@ const PortaledPanelSplitter = ({
|
|
|
381
381
|
const focusSequence = useRef(0);
|
|
382
382
|
const keyboardBoundsReady = useRef(false);
|
|
383
383
|
const pendingKeyboardWidth = useRef(null);
|
|
384
|
+
useEffect(() => {
|
|
385
|
+
if (fg('platform-dst-chat-panel-layout') && onResizeInternal) {
|
|
386
|
+
// Reconcile queued keyboard intent when allocation changes the effective
|
|
387
|
+
// width, including viewport and sibling changes while focus is retained.
|
|
388
|
+
pendingKeyboardWidth.current = panelWidth;
|
|
389
|
+
}
|
|
390
|
+
}, [panelWidth, onResizeInternal]);
|
|
384
391
|
const handleSliderInputChange = useCallback(async (event, pendingKey) => {
|
|
385
392
|
const isManagedResize = onResizeInternal;
|
|
386
393
|
const sequence = focusSequence.current;
|
|
@@ -398,8 +405,8 @@ const PortaledPanelSplitter = ({
|
|
|
398
405
|
const max = convertResizeBoundToPixels(bounds.max);
|
|
399
406
|
if (pendingKey) {
|
|
400
407
|
var _pendingKeyboardWidth;
|
|
401
|
-
//
|
|
402
|
-
//
|
|
408
|
+
// Resolve keys against live bounds, including limits between 20px steps.
|
|
409
|
+
// Before activation, preserve the intent until the chunk is ready.
|
|
403
410
|
const current = (_pendingKeyboardWidth = pendingKeyboardWidth.current) !== null && _pendingKeyboardWidth !== void 0 ? _pendingKeyboardWidth : getPixelWidth(panel);
|
|
404
411
|
const doesArrowRightIncrease = panelGrowthSide ? panelGrowthSide === 'right' : getTextDirection(panel) === 'ltr';
|
|
405
412
|
const increase = pendingKey === 'ArrowUp' || pendingKey === (doesArrowRightIncrease ? 'ArrowRight' : 'ArrowLeft') || pendingKey === 'PageUp';
|
|
@@ -426,11 +433,11 @@ const PortaledPanelSplitter = ({
|
|
|
426
433
|
});
|
|
427
434
|
}, [getResizeBounds, onCompleteResize, onResizeInternal, panelWidth, keyboardResizeManager, panel, prepareResize, panelGrowthSide]);
|
|
428
435
|
const handleSliderKeyDown = useCallback(event => {
|
|
429
|
-
if (prepareResize && !keyboardBoundsReady.current && ['Home', 'End', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'PageUp', 'PageDown'].includes(event.key)) {
|
|
436
|
+
if (prepareResize && (!keyboardBoundsReady.current || onResizeInternal && fg('platform-dst-chat-panel-layout')) && ['Home', 'End', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'PageUp', 'PageDown'].includes(event.key)) {
|
|
430
437
|
event.preventDefault();
|
|
431
438
|
void handleSliderInputChange(event, event.key);
|
|
432
439
|
}
|
|
433
|
-
}, [handleSliderInputChange, prepareResize]);
|
|
440
|
+
}, [handleSliderInputChange, onResizeInternal, prepareResize]);
|
|
434
441
|
const resizeEventListenerCleanupFn = useRef(null);
|
|
435
442
|
const handleSliderFocus = useCallback(async () => {
|
|
436
443
|
var _resizeEventListenerC;
|
|
@@ -516,7 +523,7 @@ const PortaledPanelSplitter = ({
|
|
|
516
523
|
type: "range",
|
|
517
524
|
dir: panelGrowthSide ? rangeInputDirs[panelGrowthSide] : undefined,
|
|
518
525
|
value: rangeInputValue,
|
|
519
|
-
step: 20,
|
|
526
|
+
step: onResizeInternal && fg('platform-dst-chat-panel-layout') ? 'any' : 20,
|
|
520
527
|
min: rangeInputBounds.min,
|
|
521
528
|
max: rangeInputBounds.max,
|
|
522
529
|
"aria-valuetext": ariaValueText,
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
._1bsb1osq{width:100%}
|
|
3
3
|
._1bsb1raa{width:max(0px,calc(var(--n_layoutW) - var(--n_mainMinW) - var(--n_fitAside, 0px) - var(--n_fitRibbon, 0px) - var(--n_fitPanel, 0px)))}
|
|
4
4
|
._1bsb4nr3{width:var(--n_layoutW)}
|
|
5
|
-
.
|
|
5
|
+
._1bsbilm4{width:max(0px,calc(var(--n_layoutW) - var(--n_mainMinW) - var(--n_fitAside, 0px) - var(--n_fitRibbon, 0px) - var(--n_fitPanel, 0px) - var(--n_clearanceNavMin, 0px) - var(--n_clearanceChatMin, 0px) + 1px))}
|
|
6
|
+
._1bsbm6jk{width:max(0px,calc(var(--n_layoutW) - var(--n_mainMinW) - var(--n_fitAside, 0px) - var(--n_fitRibbon, 0px) - var(--n_fitPanel, 0px) - var(--n_fitNav)))}
|
|
7
|
+
._1bsbxys7{width:max(0px,calc(var(--n_layoutW) - var(--n_mainMinW) - var(--n_fitAside, 0px) - var(--n_fitRibbon, 0px) - var(--n_fitPanel, 0px) - var(--n_clearanceNavMin, 0px) + 1px))}
|
|
6
8
|
._1ciragmp >:not([data-layout-slot]){display:none!important}
|
|
7
9
|
._1cwmtye8{--n_mainMinW:20rem}
|
|
8
10
|
._1e0c11p5{display:grid}
|
|
9
11
|
._1f381mry{container-name:navigation-chat-space}
|
|
12
|
+
._1f381wm1{container-name:navigation-panel-nav-space}
|
|
13
|
+
._1f38bwx4{container-name:navigation-panel-chat-space}
|
|
10
14
|
._1f38hwoh{container-name:navigation-main-space}
|
|
11
15
|
._1f38hx13{container-name:navigation-layout-width}
|
|
12
16
|
._1lmcq9em{grid-template-areas:"banner" "top-bar" "main" "aside"}
|
|
@@ -20,7 +20,9 @@ export const gridRootChatFitId = `${gridRootId}-chat-fit`;
|
|
|
20
20
|
const styles = {
|
|
21
21
|
widthContainer: "_7cca15wb _1f38hx13 _1bsb1osq",
|
|
22
22
|
mainSpace: "_82d6okmw _1cwmtye8 _7cca15wb _1f38hwoh _vchh1ntv _1bsb1raa",
|
|
23
|
-
|
|
23
|
+
panelNavSpace: "_7cca15wb _1f381wm1 _1bsbxys7",
|
|
24
|
+
panelChatSpace: "_7cca15wb _1f38bwx4 _1bsbilm4",
|
|
25
|
+
chatSpace: "_5to3grho _7cca15wb _1f381mry _1bsbm6jk",
|
|
24
26
|
legacyRoot: "_1e0c11p5 _1tke1kxc _1lmcq9em _yv0ei47z _2z0516ab _12fk1aio _12qzrxre _1rqteala _xkmgks3h _jbc7rxre _tyve1nco",
|
|
25
27
|
root: "_1cwmtye8 _1e0c11p5 _1tke1kxc _1bsb4nr3 _1lmcq9em _yv0ei47z _2z0516ab _12ag50j2 _71dl19sb _12fkqmyk _12qzrxre _1rqttswr _xkmggc7l _tyve87m4",
|
|
26
28
|
safetyRail: "_1ciragmp",
|
|
@@ -43,10 +45,14 @@ function LayoutFitContainers({
|
|
|
43
45
|
}), /*#__PURE__*/React.createElement("div", {
|
|
44
46
|
id: gridRootFitId,
|
|
45
47
|
className: ax([styles.mainSpace])
|
|
48
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
49
|
+
className: ax([styles.panelNavSpace])
|
|
50
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
className: ax([styles.panelChatSpace])
|
|
46
52
|
}, /*#__PURE__*/React.createElement("div", {
|
|
47
53
|
id: gridRootChatFitId,
|
|
48
54
|
className: ax([styles.chatSpace])
|
|
49
|
-
}, children)));
|
|
55
|
+
}, children)))));
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
/**
|
|
@@ -23,7 +23,7 @@ import { DangerouslyHoistSlotSizes } from '../hoist-slot-sizes-context';
|
|
|
23
23
|
import { convertResizeBoundToPixels } from '../panel-splitter/convert-resize-bound-to-pixels';
|
|
24
24
|
import { PanelSplitterProvider } from '../panel-splitter/provider';
|
|
25
25
|
import { resolveLayoutWidth } from '../resolve-layout-width';
|
|
26
|
-
import { gridRootChatFitId, gridRootId } from '../root';
|
|
26
|
+
import { gridRootChatFitId, gridRootFitId, gridRootId } from '../root';
|
|
27
27
|
import { useLayoutAreaSizing } from '../use-layout-area-sizing';
|
|
28
28
|
import { useLayoutId } from '../use-layout-id';
|
|
29
29
|
import { useResizingWidthCssVarOnRootElement } from '../use-resizing-width-css-var-on-root-element';
|
|
@@ -979,6 +979,7 @@ function SideNavInternal({
|
|
|
979
979
|
id: id
|
|
980
980
|
}, devTimeOnlyAttributes, {
|
|
981
981
|
"data-layout-slot": true,
|
|
982
|
+
"data-layout-side-nav-open": isChatPanelLayoutEnabled && isExpandedOnDesktop ? '' : undefined,
|
|
982
983
|
"aria-label": label,
|
|
983
984
|
style: {
|
|
984
985
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/enforce-style-prop
|
|
@@ -992,7 +993,11 @@ function SideNavInternal({
|
|
|
992
993
|
// CSS reserves only the nav minimum for chat's fit decision, before effects or lazy loading.
|
|
993
994
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles
|
|
994
995
|
React.createElement("style", null, `
|
|
996
|
+
#${gridRootFitId} { --n_clearanceNavMin: 0px; --n_clearanceNavTarget: ${clampedWidth}; }
|
|
995
997
|
#${gridRootChatFitId} { --n_fitNav: 0px; }
|
|
998
|
+
@media (min-width: 64rem) {
|
|
999
|
+
#${gridRootFitId} { --n_clearanceNavMin: ${isExpandedOnDesktop ? minWidth : '0px'}; }
|
|
1000
|
+
}
|
|
996
1001
|
${shouldApplyUnmanagedSizing ? `#${gridRootId} nav[data-layout-slot] { grid-area: main / aside / aside / aside; width: min(90%, ${clampedWidth}); }` : ''}
|
|
997
1002
|
@media (min-width: 64rem) {
|
|
998
1003
|
@container navigation-main-space (min-width: ${minWidth}) {
|