@atlaskit/navigation-system 11.7.9 → 11.8.1
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 +37 -0
- package/constellation/layout/code.mdx +8 -0
- package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +20 -14
- package/dist/cjs/ui/page-layout/layout-area-sizing-provider.js +4 -1
- package/dist/cjs/ui/page-layout/layout-area-sizing-runtime.js +19 -6
- package/dist/cjs/ui/page-layout/layout-overlay-clearance.js +11 -2
- package/dist/cjs/ui/page-layout/local-panel-surface.compiled.css +3 -6
- package/dist/cjs/ui/page-layout/local-panel-surface.js +21 -14
- package/dist/cjs/ui/page-layout/panel-layout-shell.compiled.css +4 -2
- package/dist/cjs/ui/page-layout/panel-layout-shell.js +18 -16
- package/dist/cjs/ui/page-layout/panel-layout.js +10 -2
- package/dist/cjs/ui/page-layout/panel.compiled.css +1 -1
- package/dist/cjs/ui/page-layout/panel.js +6 -3
- package/dist/cjs/ui/page-layout/side-nav/side-nav.compiled.css +7 -6
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +8 -7
- package/dist/cjs/ui/page-layout/use-layout-area-sizing.js +3 -1
- package/dist/cjs/ui/page-layout/use-panel-content-enter.js +27 -0
- package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +19 -14
- package/dist/es2019/ui/page-layout/layout-area-sizing-provider.js +4 -1
- package/dist/es2019/ui/page-layout/layout-area-sizing-runtime.js +17 -6
- package/dist/es2019/ui/page-layout/layout-overlay-clearance.js +9 -1
- package/dist/es2019/ui/page-layout/local-panel-surface.compiled.css +3 -6
- package/dist/es2019/ui/page-layout/local-panel-surface.js +21 -14
- package/dist/es2019/ui/page-layout/panel-layout-shell.compiled.css +4 -2
- package/dist/es2019/ui/page-layout/panel-layout-shell.js +20 -14
- package/dist/es2019/ui/page-layout/panel-layout.js +8 -2
- package/dist/es2019/ui/page-layout/panel.compiled.css +1 -1
- package/dist/es2019/ui/page-layout/panel.js +6 -3
- package/dist/es2019/ui/page-layout/side-nav/side-nav.compiled.css +7 -6
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +9 -8
- package/dist/es2019/ui/page-layout/use-layout-area-sizing.js +3 -1
- package/dist/es2019/ui/page-layout/use-panel-content-enter.js +16 -0
- package/dist/esm/ui/page-layout/calculate-layout-area-states.js +20 -14
- package/dist/esm/ui/page-layout/layout-area-sizing-provider.js +4 -1
- package/dist/esm/ui/page-layout/layout-area-sizing-runtime.js +19 -6
- package/dist/esm/ui/page-layout/layout-overlay-clearance.js +9 -1
- package/dist/esm/ui/page-layout/local-panel-surface.compiled.css +3 -6
- package/dist/esm/ui/page-layout/local-panel-surface.js +21 -14
- package/dist/esm/ui/page-layout/panel-layout-shell.compiled.css +4 -2
- package/dist/esm/ui/page-layout/panel-layout-shell.js +18 -16
- package/dist/esm/ui/page-layout/panel-layout.js +10 -2
- package/dist/esm/ui/page-layout/panel.compiled.css +1 -1
- package/dist/esm/ui/page-layout/panel.js +6 -3
- package/dist/esm/ui/page-layout/side-nav/side-nav.compiled.css +7 -6
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +8 -7
- package/dist/esm/ui/page-layout/use-layout-area-sizing.js +3 -1
- package/dist/esm/ui/page-layout/use-panel-content-enter.js +20 -0
- package/dist/types/ui/page-layout/calculate-layout-area-states.d.ts +5 -1
- package/dist/types/ui/page-layout/layout-area-sizing-context.d.ts +1 -0
- package/dist/types/ui/page-layout/layout-area-sizing-runtime.d.ts +2 -1
- package/dist/types/ui/page-layout/layout-overlay-clearance.d.ts +1 -1
- package/dist/types/ui/page-layout/panel-layout-shell.d.ts +5 -3
- package/dist/types/ui/page-layout/panel-layout.d.ts +8 -1
- package/dist/types/ui/page-layout/use-panel-content-enter.d.ts +5 -0
- package/package.json +11 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 11.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2bc99f7ee7d7c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2bc99f7ee7d7c) -
|
|
8
|
+
Refine panel and side-nav motion with a 200ms ExpoOut entrance, 200ms QuartOut exit, a 60ms
|
|
9
|
+
entrance layout snap and immediate exit layout snap. Preserve reduced motion and RTL behavior
|
|
10
|
+
behind platform-dst-motion-uplift-panel and platform-dst-motion-uplift-sidenav.
|
|
11
|
+
|
|
12
|
+
Add motion.panel.content.open for the complete opening fade: 100ms delay and 150ms ExpoOut. Let
|
|
13
|
+
the 150ms fade finish independently of the panel slide, while preserving the existing
|
|
14
|
+
content-replacement animation. Release the side-nav grid track immediately on collapse. Keep the
|
|
15
|
+
local panel layout snap in component-owned CSS, using 30% of motion.duration.medium instead of a
|
|
16
|
+
JavaScript timer or a separate layout animation token.
|
|
17
|
+
|
|
18
|
+
Add `motion.easing.out.expo` and `motion.easing.out.quart` easing tokens.
|
|
19
|
+
|
|
20
|
+
Keep mobile side-nav motion below the desktop breakpoint so stylesheet load order cannot leave an
|
|
21
|
+
expanded desktop sidebar over main content.
|
|
22
|
+
|
|
23
|
+
Keep fallback local-panel sizing from overriding siblings already managed by the resize
|
|
24
|
+
coordinator, preventing an open chat panel from briefly collapsing when the local panel opens.
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
|
|
28
|
+
## 11.8.0
|
|
29
|
+
|
|
30
|
+
### Minor Changes
|
|
31
|
+
|
|
32
|
+
- [`fe869b1ecb8e1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fe869b1ecb8e1) -
|
|
33
|
+
Add an XL local-panel default of 500px at 1768px and above with chat layout enabled, and an
|
|
34
|
+
xlDefaultPanelWidth override that preserves controlled and saved widths.
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Updated dependencies
|
|
39
|
+
|
|
3
40
|
## 11.7.9
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
|
@@ -121,6 +121,14 @@ Use `defaultPanelWidth` for an initial width, or pair `panelWidth` with `onPanel
|
|
|
121
121
|
control it. Available space can constrain the rendered width. Use `onResizeEnd` for persistence or
|
|
122
122
|
analytics after a completed resize, and provide localized `panelLabel` and `resizeLabel` values.
|
|
123
123
|
|
|
124
|
+
With chat layout enabled, the local panel defaults to 320px below 64rem (1024px), 400px below
|
|
125
|
+
110.5rem (1768px), and 500px at 110.5rem and above. These are viewport breakpoints; available layout
|
|
126
|
+
space can still compress the panel. Chat retains its 400px desktop default. Use
|
|
127
|
+
`compactDefaultPanelWidth` or `xlDefaultPanelWidth` to override a breakpoint's default. An explicit
|
|
128
|
+
`defaultPanelWidth` supplies all breakpoint defaults unless separately overridden. Defaults are
|
|
129
|
+
captured on mount; controlled and user-resized widths take precedence. `LayoutWithPanel` also
|
|
130
|
+
accepts `xlDefaultPanelWidth`, with saved provider widths taking precedence.
|
|
131
|
+
|
|
124
132
|
`PanelLayout` contains the layout and resizing responsibilities extracted from
|
|
125
133
|
`@atlassian/panel-system`. That package's `LayoutWithPanel` remains an adapter that connects panel
|
|
126
134
|
state and routed content to `PanelLayout`.
|
|
@@ -17,14 +17,18 @@ function clampTargetWidth(_ref) {
|
|
|
17
17
|
max = _ref.max;
|
|
18
18
|
return Math.max(min, Math.min(target, max));
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
var _area$compactDefaultW, _area$
|
|
22
|
-
|
|
20
|
+
function getDefaultWidth(area, isCompact, isXlViewport) {
|
|
21
|
+
var _area$compactDefaultW, _area$xlDefaultWidth;
|
|
22
|
+
return isCompact ? (_area$compactDefaultW = area.compactDefaultWidth) !== null && _area$compactDefaultW !== void 0 ? _area$compactDefaultW : area.defaultWidth : isXlViewport ? (_area$xlDefaultWidth = area.xlDefaultWidth) !== null && _area$xlDefaultWidth !== void 0 ? _area$xlDefaultWidth : area.defaultWidth : area.defaultWidth;
|
|
23
|
+
}
|
|
24
|
+
function getTargetWidth(area, isSideNavOverlay, isXlViewport) {
|
|
25
|
+
var _area$liveResize, _ref2, _area$requestedWidth;
|
|
26
|
+
var defaultWidth = getDefaultWidth(area, isSideNavOverlay, isXlViewport);
|
|
23
27
|
return ((_area$liveResize = area.liveResize) === null || _area$liveResize === void 0 ? void 0 : _area$liveResize.mode) === 'inline' ? area.liveResize.width : (_ref2 = (_area$requestedWidth = area.requestedWidth) !== null && _area$requestedWidth !== void 0 ? _area$requestedWidth : area.preferredWidth) !== null && _ref2 !== void 0 ? _ref2 : defaultWidth;
|
|
24
28
|
}
|
|
25
|
-
function getOverlayTargetWidth(area, isSideNavOverlay, areaName) {
|
|
26
|
-
var _area$
|
|
27
|
-
var defaultWidth =
|
|
29
|
+
function getOverlayTargetWidth(area, isSideNavOverlay, isXlViewport, areaName) {
|
|
30
|
+
var _area$liveResize2, _ref3, _area$requestedWidth2;
|
|
31
|
+
var defaultWidth = getDefaultWidth(area, isSideNavOverlay, isXlViewport);
|
|
28
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;
|
|
29
33
|
}
|
|
30
34
|
function calculateLayoutAreaStates(_ref4) {
|
|
@@ -34,6 +38,8 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
34
38
|
layoutWidth = _ref4$layoutWidth === void 0 ? viewportWidth : _ref4$layoutWidth,
|
|
35
39
|
isChatPanelOverlay = _ref4.isChatPanelOverlay,
|
|
36
40
|
isSideNavOverlay = _ref4.isSideNavOverlay,
|
|
41
|
+
_ref4$isXlViewport = _ref4.isXlViewport,
|
|
42
|
+
isXlViewport = _ref4$isXlViewport === void 0 ? false : _ref4$isXlViewport,
|
|
37
43
|
_ref4$occupiedWidth = _ref4.occupiedWidth,
|
|
38
44
|
occupiedWidth = _ref4$occupiedWidth === void 0 ? 0 : _ref4$occupiedWidth,
|
|
39
45
|
mainMinWidthBound = _ref4.mainMinWidth,
|
|
@@ -56,7 +62,7 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
56
62
|
// A growing panel cascades towards inline-start. Chat is on the other side
|
|
57
63
|
// of the local rail, so local growth must reserve its full starting width.
|
|
58
64
|
var shouldCollapseSideNav = Boolean(!isRefinedLayout && resizeSession && resizeSession.area !== 'side-nav' && resizeSession.baselineWidths['side-nav'] !== undefined && resizeSession.baselineWidths[resizeSession.area] !== undefined && resizingArea && !isSideNavOverlay && clampTargetWidth({
|
|
59
|
-
target: getTargetWidth(resizingArea, isSideNavOverlay),
|
|
65
|
+
target: getTargetWidth(resizingArea, isSideNavOverlay, isXlViewport),
|
|
60
66
|
min: (0, _resolveLayoutWidth.resolveLayoutWidth)(resizingArea.minWidth, viewportWidth),
|
|
61
67
|
max: resizingArea.maxWidth !== undefined ? (0, _resolveLayoutWidth.resolveLayoutWidth)(resizingArea.maxWidth, viewportWidth) : Number.POSITIVE_INFINITY
|
|
62
68
|
}) > 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));
|
|
@@ -99,7 +105,7 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
99
105
|
var min = (0, _resolveLayoutWidth.resolveLayoutWidth)(area.minWidth, viewportWidth);
|
|
100
106
|
var max = area.maxWidth ? (0, _resolveLayoutWidth.resolveLayoutWidth)(area.maxWidth, viewportWidth) : Number.POSITIVE_INFINITY;
|
|
101
107
|
var baselineWidth = baselineWidths === null || baselineWidths === void 0 ? void 0 : baselineWidths[areaName];
|
|
102
|
-
var requestedTarget = resizeSession && areaName !== resizeSession.area ? shouldCollapseSideNav && resizeSession.area === 'chat-panel' ? min : baselineWidth !== null && baselineWidth !== void 0 ? baselineWidth : getTargetWidth(area, isSideNavOverlay) : getTargetWidth(area, isSideNavOverlay);
|
|
108
|
+
var requestedTarget = resizeSession && areaName !== resizeSession.area ? shouldCollapseSideNav && resizeSession.area === 'chat-panel' ? min : baselineWidth !== null && baselineWidth !== void 0 ? baselineWidth : getTargetWidth(area, isSideNavOverlay, isXlViewport) : getTargetWidth(area, isSideNavOverlay, isXlViewport);
|
|
103
109
|
var target = clampTargetWidth({
|
|
104
110
|
target: requestedTarget,
|
|
105
111
|
min: min,
|
|
@@ -163,12 +169,12 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
163
169
|
_iterator2.f();
|
|
164
170
|
}
|
|
165
171
|
if (hasPanelClearance && panel) {
|
|
166
|
-
var
|
|
172
|
+
var _widths$get4, _widths$get5;
|
|
167
173
|
// Opening/viewport fitting gives up SideNav width before Chat. During a
|
|
168
174
|
// panel drag only SideNav yields; Chat retains its starting width.
|
|
169
175
|
var isPanelResize = (resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.area) === 'panel';
|
|
170
|
-
var desiredPanelWidth = Math.max(panelMinWidth, Math.min(getOverlayTargetWidth(panel, isSideNavOverlay, 'panel'), panel.maxWidth === undefined ? Infinity : (0, _resolveLayoutWidth.resolveLayoutWidth)(panel.maxWidth, viewportWidth)));
|
|
171
|
-
var overlayDefault =
|
|
176
|
+
var desiredPanelWidth = Math.max(panelMinWidth, Math.min(getOverlayTargetWidth(panel, isSideNavOverlay, isXlViewport, 'panel'), panel.maxWidth === undefined ? Infinity : (0, _resolveLayoutWidth.resolveLayoutWidth)(panel.maxWidth, viewportWidth)));
|
|
177
|
+
var overlayDefault = getDefaultWidth(panel, isSideNavOverlay, isXlViewport);
|
|
172
178
|
var reservedMainWidth = isPanelResize ? Math.max(effectiveMainMinWidth, desiredPanelWidth + 32,
|
|
173
179
|
// Above the default, Main must also fit the panel within its 90% cap.
|
|
174
180
|
desiredPanelWidth > overlayDefault ? desiredPanelWidth / 0.9 : 0) : effectiveMainMinWidth;
|
|
@@ -221,7 +227,7 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
221
227
|
_step4;
|
|
222
228
|
try {
|
|
223
229
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
224
|
-
var _states$_areaName
|
|
230
|
+
var _states$_areaName;
|
|
225
231
|
var _areaName2 = _step4.value;
|
|
226
232
|
var _area = areas[_areaName2];
|
|
227
233
|
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) {
|
|
@@ -232,11 +238,11 @@ function calculateLayoutAreaStates(_ref4) {
|
|
|
232
238
|
// Chat covers Root; SideNav and the local panel overlay Main's grid track.
|
|
233
239
|
// Occupied tracks and inline chat are not part of that covered region.
|
|
234
240
|
var layoutMax = (_areaName2 === 'chat-panel' ? layoutWidth : mainAreaWidth) * 0.9;
|
|
235
|
-
var defaultWidth =
|
|
241
|
+
var defaultWidth = getDefaultWidth(_area, isSideNavOverlay, isXlViewport);
|
|
236
242
|
var overlayMax = isRefinedLayout && _areaName2 === 'panel' ? hasPanelClearance ? Math.min(availableWidth - sideNavMinWidth - inlineChatPanelWidth - 32, Math.max(defaultWidth, (availableWidth - sideNavMinWidth - inlineChatPanelWidth) * 0.9)) : Math.min(mainAreaWidth, Math.max(defaultWidth, layoutMax)) : isRefinedLayout && _areaName2 === 'chat-panel' ? Math.min(layoutWidth, Math.max(defaultWidth, layoutMax)) : layoutMax;
|
|
237
243
|
var _max = isRefinedLayout && (_areaName2 === 'panel' || _areaName2 === 'chat-panel') ? Math.max(_min2, Math.min(configuredMax, overlayMax)) : Math.max(0, Math.min(configuredMax, overlayMax));
|
|
238
244
|
var effectiveMin = isRefinedLayout && (_areaName2 === 'panel' || _areaName2 === 'chat-panel') ? _min2 : Math.min(_min2, _max);
|
|
239
|
-
var _target = getOverlayTargetWidth(_area, isSideNavOverlay, _areaName2);
|
|
245
|
+
var _target = getOverlayTargetWidth(_area, isSideNavOverlay, isXlViewport, _areaName2);
|
|
240
246
|
var _width2 = clampTargetWidth({
|
|
241
247
|
target: _target,
|
|
242
248
|
min: effectiveMin,
|
|
@@ -82,6 +82,7 @@ function LayoutAreaSizingProvider(_ref) {
|
|
|
82
82
|
}, []);
|
|
83
83
|
var mainMinWidth = (0, _react.useRef)(_constants.defaultMainMinWidth);
|
|
84
84
|
var loadRef = (0, _react.useRef)(function () {});
|
|
85
|
+
var viewportWidthAtLoad = (0, _react.useRef)();
|
|
85
86
|
var ready = (0, _react.useRef)(false);
|
|
86
87
|
var waiting = (0, _react.useRef)([]);
|
|
87
88
|
var pending = (0, _react.useRef)([]);
|
|
@@ -107,6 +108,7 @@ function LayoutAreaSizingProvider(_ref) {
|
|
|
107
108
|
return;
|
|
108
109
|
}
|
|
109
110
|
loading = true;
|
|
111
|
+
viewportWidthAtLoad.current = window.innerWidth;
|
|
110
112
|
void Promise.resolve().then(function () {
|
|
111
113
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_navigation-layout-sizing" */'./layout-area-sizing-runtime'));
|
|
112
114
|
}).then(function (_ref2) {
|
|
@@ -318,6 +320,7 @@ function LayoutAreaSizingProvider(_ref) {
|
|
|
318
320
|
}, children))), Runtime && /*#__PURE__*/_react.default.createElement(Runtime, {
|
|
319
321
|
layoutRef: layoutRef,
|
|
320
322
|
onReady: onReady,
|
|
321
|
-
onUpdate: onUpdate
|
|
323
|
+
onUpdate: onUpdate,
|
|
324
|
+
viewportWidthAtLoad: viewportWidthAtLoad.current
|
|
322
325
|
}));
|
|
323
326
|
}
|
|
@@ -41,7 +41,8 @@ function LayoutAreaSizingRuntime(_ref2) {
|
|
|
41
41
|
var children = _ref2.children,
|
|
42
42
|
layoutRef = _ref2.layoutRef,
|
|
43
43
|
onReady = _ref2.onReady,
|
|
44
|
-
onUpdate = _ref2.onUpdate
|
|
44
|
+
onUpdate = _ref2.onUpdate,
|
|
45
|
+
viewportWidthAtLoad = _ref2.viewportWidthAtLoad;
|
|
45
46
|
var occupiedWidth = (0, _useOccupiedLayoutWidth.useOccupiedLayoutWidth)(layoutRef);
|
|
46
47
|
var _useState = (0, _react.useState)(null),
|
|
47
48
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -61,7 +62,10 @@ function LayoutAreaSizingRuntime(_ref2) {
|
|
|
61
62
|
setResizeSession = _useState8[1];
|
|
62
63
|
var areaStatesRef = _react.default.useRef({});
|
|
63
64
|
var configsRef = _react.default.useRef({});
|
|
64
|
-
|
|
65
|
+
// A viewport change while the chunk loads is already a layout event. Reallocate
|
|
66
|
+
// instead of adopting CSS geometry from the preceding breakpoint (which WebKit
|
|
67
|
+
// can still report during that handoff).
|
|
68
|
+
var _useState9 = (0, _react.useState)(viewportWidthAtLoad !== undefined && viewportWidthAtLoad !== window.innerWidth),
|
|
65
69
|
_useState0 = (0, _slicedToArray2.default)(_useState9, 2),
|
|
66
70
|
hasInteraction = _useState0[0],
|
|
67
71
|
setHasInteraction = _useState0[1];
|
|
@@ -100,6 +104,7 @@ function LayoutAreaSizingRuntime(_ref2) {
|
|
|
100
104
|
// Match the actual rem-based grid breakpoint, including browser font settings.
|
|
101
105
|
var inlineChatQuery = window.matchMedia('(min-width: 40rem)');
|
|
102
106
|
var inlineSideNavQuery = window.matchMedia('(min-width: 64rem)');
|
|
107
|
+
var xlQuery = window.matchMedia('(min-width: 110.5rem)');
|
|
103
108
|
var updateDimensions = function updateDimensions(contentWidth) {
|
|
104
109
|
var _style$width, _style$paddingLeft, _style$paddingRight, _style$borderLeftWidt, _style$borderRightWid, _previous;
|
|
105
110
|
var style = root && contentWidth === undefined ? getComputedStyle(root) : null;
|
|
@@ -114,9 +119,10 @@ function LayoutAreaSizingRuntime(_ref2) {
|
|
|
114
119
|
viewportWidth: window.innerWidth,
|
|
115
120
|
layoutWidth: layoutWidth,
|
|
116
121
|
isChatPanelOverlay: !inlineChatQuery.matches,
|
|
117
|
-
isSideNavOverlay: !inlineSideNavQuery.matches
|
|
122
|
+
isSideNavOverlay: !inlineSideNavQuery.matches,
|
|
123
|
+
isXlViewport: xlQuery.matches
|
|
118
124
|
};
|
|
119
|
-
if (((_previous = previous) === null || _previous === void 0 ? void 0 : _previous.viewportWidth) === next.viewportWidth && previous.layoutWidth === next.layoutWidth && previous.isChatPanelOverlay === next.isChatPanelOverlay && previous.isSideNavOverlay === next.isSideNavOverlay) {
|
|
125
|
+
if (((_previous = previous) === null || _previous === void 0 ? void 0 : _previous.viewportWidth) === next.viewportWidth && previous.layoutWidth === next.layoutWidth && previous.isChatPanelOverlay === next.isChatPanelOverlay && previous.isSideNavOverlay === next.isSideNavOverlay && previous.isXlViewport === next.isXlViewport) {
|
|
120
126
|
return;
|
|
121
127
|
}
|
|
122
128
|
if (previous) {
|
|
@@ -156,7 +162,14 @@ function LayoutAreaSizingRuntime(_ref2) {
|
|
|
156
162
|
return updateDimensions();
|
|
157
163
|
}
|
|
158
164
|
});
|
|
165
|
+
var unbindXlQuery = (0, _bindEventListener.bind)(xlQuery, {
|
|
166
|
+
type: 'change',
|
|
167
|
+
listener: function listener() {
|
|
168
|
+
return updateDimensions();
|
|
169
|
+
}
|
|
170
|
+
});
|
|
159
171
|
return function () {
|
|
172
|
+
unbindXlQuery();
|
|
160
173
|
observer.disconnect();
|
|
161
174
|
unbindResize();
|
|
162
175
|
unbindQuery();
|
|
@@ -165,14 +178,14 @@ function LayoutAreaSizingRuntime(_ref2) {
|
|
|
165
178
|
}, [layoutRef]);
|
|
166
179
|
var registerArea = (0, _react.useCallback)(function (area, config) {
|
|
167
180
|
var previous = configsRef.current[area];
|
|
168
|
-
if (adoptedConstraints.current && (!previous || previous.isOpen !== config.isOpen || previous.requestedWidth !== config.requestedWidth || previous.minWidth !== config.minWidth || previous.maxWidth !== config.maxWidth || previous.defaultWidth !== config.defaultWidth || previous.compactDefaultWidth !== config.compactDefaultWidth)) {
|
|
181
|
+
if (adoptedConstraints.current && (!previous || previous.isOpen !== config.isOpen || previous.requestedWidth !== config.requestedWidth || previous.minWidth !== config.minWidth || previous.maxWidth !== config.maxWidth || previous.defaultWidth !== config.defaultWidth || previous.compactDefaultWidth !== config.compactDefaultWidth || previous.xlDefaultWidth !== config.xlDefaultWidth)) {
|
|
169
182
|
setHasInteraction(true);
|
|
170
183
|
}
|
|
171
184
|
configsRef.current[area] = config;
|
|
172
185
|
setResizeSession(function (current) {
|
|
173
186
|
// A changed layout/configuration needs a fresh allocation. A controlled
|
|
174
187
|
// acknowledgement for the resized area keeps its siblings fixed.
|
|
175
|
-
return previous && (previous.isOpen === config.isOpen || area === 'side-nav' && !config.isOpen && (current === null || current === void 0 ? void 0 : current.area) !== 'side-nav') && previous.minWidth === config.minWidth && previous.maxWidth === config.maxWidth && previous.defaultWidth === config.defaultWidth && previous.compactDefaultWidth === config.compactDefaultWidth && (previous.requestedWidth === config.requestedWidth || (current === null || current === void 0 ? void 0 : current.area) === area && current.completedWidth === config.requestedWidth || area === 'side-nav' && !config.isOpen && (current === null || current === void 0 ? void 0 : current.area) !== 'side-nav') ? current : null;
|
|
188
|
+
return previous && (previous.isOpen === config.isOpen || area === 'side-nav' && !config.isOpen && (current === null || current === void 0 ? void 0 : current.area) !== 'side-nav') && previous.minWidth === config.minWidth && previous.maxWidth === config.maxWidth && previous.defaultWidth === config.defaultWidth && previous.compactDefaultWidth === config.compactDefaultWidth && previous.xlDefaultWidth === config.xlDefaultWidth && (previous.requestedWidth === config.requestedWidth || (current === null || current === void 0 ? void 0 : current.area) === area && current.completedWidth === config.requestedWidth || area === 'side-nav' && !config.isOpen && (current === null || current === void 0 ? void 0 : current.area) !== 'side-nav') ? current : null;
|
|
176
189
|
});
|
|
177
190
|
setAreas(function (current) {
|
|
178
191
|
var existing = current[area];
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.LayoutOverlayClearance = LayoutOverlayClearance;
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _layoutAreaStateContexts = require("./layout-area-state-contexts");
|
|
9
10
|
var _root = require("./root");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
10
12
|
/**
|
|
11
13
|
* CSS owns fitting before hydration and lazy resize activation. Each slot hoists
|
|
12
14
|
* its own minimum and target into Root's capacity containers during rendering;
|
|
@@ -15,6 +17,13 @@ var _root = require("./root");
|
|
|
15
17
|
function LayoutOverlayClearance(_ref) {
|
|
16
18
|
var panelMinWidth = _ref.panelMinWidth,
|
|
17
19
|
mainMinWidth = _ref.mainMinWidth;
|
|
20
|
+
var sideNavSizing = (0, _react.useContext)(_layoutAreaStateContexts.layoutAreaStateContexts['side-nav']);
|
|
21
|
+
var chatSizing = (0, _react.useContext)(_layoutAreaStateContexts.layoutAreaStateContexts['chat-panel']);
|
|
22
|
+
// A newly opened local panel can be unmeasured for one render after its siblings have
|
|
23
|
+
// joined the resize coordinator. Its CSS fallback must not overwrite their managed widths.
|
|
24
|
+
if (sideNavSizing || chatSizing) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
18
27
|
var navMin = 'var(--n_clearanceNavMin, 0px)';
|
|
19
28
|
var navTarget = 'var(--n_clearanceNavTarget, 0px)';
|
|
20
29
|
var chatMinimum = 'var(--n_clearanceChatMin, 0px)';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.
|
|
1
|
+
._nd5l108g{grid-area:var(--p_lclPnlEnterArea,var(--p_lclPnlSsrArea,main))}
|
|
2
|
+
._nd5l12pz{grid-area:var(--p_lclPnlEnterArea,panel)}
|
|
2
3
|
._nd5l1gzg{grid-area:main}
|
|
3
|
-
._nd5l32aw{grid-area:var(--p_lclPnlSsrArea,main)}
|
|
4
4
|
._y44v1mph{animation:var(--ds-panel-content-enter,.15s cubic-bezier(.4,1,.6,1) FadeIn0to100)}
|
|
5
5
|
._y44vf1qi{animation:var(--ds-panel-content-exit,50ms cubic-bezier(.6,0,.8,.6) FadeOut100to0)}
|
|
6
6
|
._191wbqna{border-inline-start:var(--p_lclPnlSsrBorder,none)}
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
22
22
|
._bfhk1g1j{background-color:var(--p_lclPnlSsrBackground,var(--ds-surface-overlay,#fff))}
|
|
23
23
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
24
|
-
._ifwb1uuk{--p_lclPnlMotionW:var(--p_lclPnlCompactW)}
|
|
25
|
-
._ju25dn4k{animation-delay:var(--ds-duration-xshort,.1s)}
|
|
26
24
|
._kqsw1if8{position:sticky}
|
|
27
25
|
._vchhusvi{box-sizing:border-box}
|
|
28
|
-
@media (prefers-reduced-motion:no-preference){.
|
|
29
|
-
@media (min-width:64rem){._1c23i77x{--p_lclPnlMotionW:var(--p_lclPnlTrackW)}}
|
|
26
|
+
@media (prefers-reduced-motion:no-preference){._15et3aws{width:min(90cqw,var(--p_lclPnlSsrPreferredW))}._15etq93i{width:max(var(--p_lclPnlMinW),min(var(--p_lclPnlSsrPreferredW),var(--p_lclPnlMotionMaxW,min(100cqw,var(--n_localPanelOverlayMax,100cqw),max(var(--p_lclPnlSsrDefaultW),90cqw)))))}._k1afi8w4{animation:var(--ds-panel-content-open,.15s cubic-bezier(.16,1,.3,1) FadeIn0to100 .1s)}._k1afry0p{animation:var(--ds-panel-exit-right,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentRight)}._1lh81gzg{grid-area:main}[dir=rtl] ._105a97o5{animation:var(--ds-panel-exit-left,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentLeft)}._15et1c5w{width:var(--p_lclPnlRsz,var(--p_lclPnlW))}._k1afx3bs{animation:var(--ds-panel-enter-right,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentRight)}[dir=rtl] ._105az3zp{animation:var(--ds-panel-enter-left,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentLeft)}}
|
|
@@ -21,8 +21,11 @@ var _exitingPersistence = _interopRequireDefault(require("@atlaskit/motion/exiti
|
|
|
21
21
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
22
22
|
var _constants = require("./constants");
|
|
23
23
|
var _hoistSlotSizesContext = require("./hoist-slot-sizes-context");
|
|
24
|
+
var _layoutOverlayClearance = require("./layout-overlay-clearance");
|
|
25
|
+
var _mainMinWidthContext = require("./main-min-width-context");
|
|
24
26
|
var _panelSplitter = require("./panel-splitter/panel-splitter");
|
|
25
27
|
var _provider = require("./panel-splitter/provider");
|
|
28
|
+
var _usePanelContentEnter = require("./use-panel-content-enter");
|
|
26
29
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
27
30
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28
31
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -31,28 +34,24 @@ var panelSplitterResizingVar = '--p_lclPnlRsz';
|
|
|
31
34
|
var localPanelSplitterId = Symbol('LocalPanel PanelSplitter');
|
|
32
35
|
|
|
33
36
|
// Compiled preserves the existing container-relative widths and discrete motion styles.
|
|
34
|
-
/* eslint-disable @compiled/shorthand-property-sorting -- Content motion overrides only the animation delay. */
|
|
35
37
|
var styles = {
|
|
36
38
|
panelWrapper: "_nd5l1gzg _kqsw1if8 _bfhk1bhr _vchhusvi _4t3ieqxy _152tidpf _10fph9n0 _1bsb13q4",
|
|
37
|
-
managedInline: "
|
|
39
|
+
managedInline: "_nd5l12pz _bfhkvuon _152tidpf _1bsb1c5w",
|
|
38
40
|
refinedUnmeasured: "_1bsb123g",
|
|
39
|
-
unmeasured: "
|
|
41
|
+
unmeasured: "_nd5l108g _191wbqna _1bsb1cku _bfhk1g1j _16qs1dhr",
|
|
40
42
|
managedOverlay: "_nd5l1gzg _bfhk1bhr _1bsb1c5w",
|
|
41
43
|
panelScrollContainer: "_1reo1wug _18m91wug _4t3i1osq",
|
|
42
44
|
border: "_191wglyw _16qs130s",
|
|
43
45
|
managedInlineBorder: "_191wia51 _16qsglyw",
|
|
44
|
-
entering: "
|
|
45
|
-
motionUnmeasured: "
|
|
46
|
-
|
|
46
|
+
entering: "_k1afx3bs _15et1c5w _105az3zp",
|
|
47
|
+
motionUnmeasured: "_15et3aws",
|
|
48
|
+
refinedMotionUnmeasured: "_15etq93i",
|
|
49
|
+
exiting: "_k1afry0p _1lh81gzg _15et1c5w _105a97o5",
|
|
47
50
|
contentEntering: "_y44v1mph",
|
|
51
|
+
contentEnteringOnOpen: "_k1afi8w4",
|
|
48
52
|
contentExiting: "_y44vf1qi",
|
|
49
53
|
contentChangeContainer: "_4t3i1osq"
|
|
50
54
|
};
|
|
51
|
-
var contentEnteringDelayStyles = {
|
|
52
|
-
root: "_ju25dn4k"
|
|
53
|
-
};
|
|
54
|
-
/* eslint-enable @compiled/shorthand-property-sorting */
|
|
55
|
-
|
|
56
55
|
var PanelContentMotion = function PanelContentMotion(_ref) {
|
|
57
56
|
var children = _ref.children;
|
|
58
57
|
var _useMotion = (0, _useMotion3.useMotion)(),
|
|
@@ -85,6 +84,7 @@ function LocalPanelSurface(_ref2) {
|
|
|
85
84
|
onManagedResizeEnd = _ref2.onManagedResizeEnd,
|
|
86
85
|
onWidthChange = _ref2.onWidthChange,
|
|
87
86
|
onResizeEnd = _ref2.onResizeEnd;
|
|
87
|
+
var mainMinWidth = (0, _react.useContext)(_mainMinWidthContext.MainMinWidthContext);
|
|
88
88
|
var ref = (0, _react.useRef)(null);
|
|
89
89
|
var dangerouslyHoistSlotSizes = (0, _react.useContext)(_hoistSlotSizesContext.DangerouslyHoistSlotSizes);
|
|
90
90
|
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
@@ -125,6 +125,7 @@ function LocalPanelSurface(_ref2) {
|
|
|
125
125
|
var _useMotion2 = (0, _useMotion3.useMotion)(),
|
|
126
126
|
state = _useMotion2.state,
|
|
127
127
|
motionRef = _useMotion2.ref;
|
|
128
|
+
var shouldAnimateContentEnter = (0, _usePanelContentEnter.usePanelContentEnter)(state);
|
|
128
129
|
var isMotionUpliftEnabled = (0, _fg.fg)('platform-dst-motion-uplift-panel');
|
|
129
130
|
var isContentMotionEnabled = (0, _fg.fg)('platform-dst-motion-uplift-panel-content');
|
|
130
131
|
var mergedRef = (0, _react.useMemo)(function () {
|
|
@@ -178,8 +179,14 @@ function LocalPanelSurface(_ref2) {
|
|
|
178
179
|
"data-layout-with-panel-slot": "",
|
|
179
180
|
style: (0, _defineProperty2.default)({}, localPanelVar, "".concat(renderedWidth, "px")),
|
|
180
181
|
ref: mergedRef,
|
|
181
|
-
className: (0, _runtime.ax)([
|
|
182
|
-
},
|
|
182
|
+
className: (0, _runtime.ax)([styles.panelWrapper, styles.border, !managedSizing && styles.unmeasured, !managedSizing && (0, _fg.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, isMotionUpliftEnabled && state === 'entering' && styles.entering, isMotionUpliftEnabled && state === 'exiting' && styles.exiting, isMotionUpliftEnabled && (state === 'entering' || state === 'exiting') && !managedSizing && styles.motionUnmeasured, isMotionUpliftEnabled && (state === 'entering' || state === 'exiting') && !managedSizing && (0, _fg.fg)('platform-dst-chat-panel-layout') && styles.refinedMotionUnmeasured])
|
|
183
|
+
}, !managedSizing && (0, _fg.fg)('platform-dst-chat-panel-layout') &&
|
|
184
|
+
/*#__PURE__*/
|
|
185
|
+
// Keep sibling allocation stable until the exiting surface actually unmounts.
|
|
186
|
+
React.createElement(_layoutOverlayClearance.LayoutOverlayClearance, {
|
|
187
|
+
panelMinWidth: minWidth,
|
|
188
|
+
mainMinWidth: mainMinWidth
|
|
189
|
+
}), /*#__PURE__*/React.createElement(_provider.PanelSplitterProvider, {
|
|
183
190
|
panelId: localPanelSplitterId,
|
|
184
191
|
panelRef: ref,
|
|
185
192
|
resizingElementRef: layoutRef,
|
|
@@ -195,7 +202,7 @@ function LocalPanelSurface(_ref2) {
|
|
|
195
202
|
}, /*#__PURE__*/React.createElement("div", {
|
|
196
203
|
ref: scrollRef,
|
|
197
204
|
"data-testid": testId && "".concat(testId, "--scroll-container"),
|
|
198
|
-
className: (0, _runtime.ax)([styles.panelScrollContainer, state === 'entering' && styles.contentEntering, isMotionUpliftEnabled &&
|
|
205
|
+
className: (0, _runtime.ax)([styles.panelScrollContainer, !isMotionUpliftEnabled && state === 'entering' && styles.contentEntering, isMotionUpliftEnabled && shouldAnimateContentEnter && styles.contentEnteringOnOpen, state === 'exiting' && styles.contentExiting])
|
|
199
206
|
}, isContentMotionEnabled && contentKey !== undefined ? /*#__PURE__*/React.createElement(_exitingPersistence.default, {
|
|
200
207
|
exitThenEnter: true
|
|
201
208
|
}, /*#__PURE__*/React.createElement(PanelContentMotion, {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
._4t3i1osq{height:100%}
|
|
18
18
|
._7cca15wb{container-type:inline-size}
|
|
19
19
|
._82e815vq._82e815vq{overflow-y:hidden}
|
|
20
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
20
21
|
._cw8k1fc5{--p_lclPnlSsrDefaultW:var(--p_lclPnlCompactDefaultW)}
|
|
21
22
|
._evra4a59{--p_lclPnlSsrInlineAreas:"main panel"}
|
|
22
23
|
._f8371m6a._f8371m6a{grid-template-areas:"main"}
|
|
@@ -25,5 +26,6 @@
|
|
|
25
26
|
._vlegi47z._vlegi47z{grid-template-columns:minmax(0,1fr)}
|
|
26
27
|
._yv0eggl6{grid-template-columns:var(--p_lclPnlSsrColumns,minmax(0,1fr))}
|
|
27
28
|
._yv0ei47z{grid-template-columns:minmax(0,1fr)}
|
|
28
|
-
@media (prefers-reduced-motion:no-preference){.
|
|
29
|
-
@media (min-width:64rem){._peezi77x{--p_lclPnlSsrPreferredW:var(--p_lclPnlTrackW)}._1tg31owj{--p_lclPnlSsrDefaultW:var(--p_lclPnlDefaultW)}}
|
|
29
|
+
@media (prefers-reduced-motion:no-preference){._1cro60m4{animation-name:k1jtk5cx}._wqfno73m{animation-duration:calc(var(--ds-duration-medium, .2s)*.3)}@keyframes k1jtk5cx{0%{grid-template-areas:"main";grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;--p_lclPnlEnterArea:main}to{grid-template-areas:"main";grid-template-columns:minmax(0,1fr);grid-template-rows:1fr;--p_lclPnlEnterArea:main}}}
|
|
30
|
+
@media (min-width:64rem){._peezi77x{--p_lclPnlSsrPreferredW:var(--p_lclPnlTrackW)}._1tg31owj{--p_lclPnlSsrDefaultW:var(--p_lclPnlDefaultW)}}
|
|
31
|
+
@media (min-width:110.5rem){._1qxn1ykh{--p_lclPnlSsrPreferredW:var(--p_lclPnlXlW)}._13bt1t8m{--p_lclPnlSsrDefaultW:var(--p_lclPnlXlDefaultW)}}
|
|
@@ -13,7 +13,6 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
16
|
-
var _layoutOverlayClearance = require("./layout-overlay-clearance");
|
|
17
16
|
var _mainMinWidthContext = require("./main-min-width-context");
|
|
18
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
18
|
// The grid uses runtime CSS variables and container sizing outside @atlaskit/css's bounded values.
|
|
@@ -21,19 +20,19 @@ var localPanelTrackWidthVar = '--p_lclPnlTrackW';
|
|
|
21
20
|
var localPanelResizingVar = '--p_lclPnlRsz';
|
|
22
21
|
var localPanelMinWidthVar = '--p_lclPnlMinW';
|
|
23
22
|
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
|
|
27
|
-
var holdClosedGrid = null;
|
|
23
|
+
// One CSS animation holds both the grid and its surface placement until the layout snap.
|
|
24
|
+
// Identical keyframes keep the layout static; normal styles take over at 60ms.
|
|
25
|
+
var holdPanelTrack = null;
|
|
28
26
|
var styles = {
|
|
29
|
-
panelEntering: "_1croukkr _wqfn147i _sl5p1ign _dqw8eoah",
|
|
30
27
|
container: "_1f38177r _7cca15wb _4t3i1osq _1bsb1osq",
|
|
31
28
|
layout: "_1reo1wug _18m91wug _1e0c11p5 _7cca15wb _1lmc1m6a _yv0ei47z _2z05hkll _4t3i1osq _1bsb1osq",
|
|
32
29
|
mainContent: "_nd5l1gzg _1reo1wug _18m91wug _1e0c1txw _4t3i1osq _19121cl4",
|
|
33
|
-
panelUplift: "_1reo15vq _18m915vq",
|
|
34
|
-
unmeasured: "_evra4a59 _1lmcc53r _yv0eggl6
|
|
30
|
+
panelUplift: "_1reo15vq _18m915vq _bfhkvuon",
|
|
31
|
+
unmeasured: "_evra4a59 _1lmcc53r _yv0eggl6",
|
|
32
|
+
unmeasuredWidths: "_129o1uuk _cw8k1fc5 _peezi77x _1tg31owj _1qxn1ykh _13bt1t8m",
|
|
35
33
|
managedInline: "_1uwq15vq _82e815vq _f8374a59 _1l7c1wug _vleg1orf",
|
|
36
34
|
managedOverlay: "_1uwq15vq _82e815vq _f8371m6a _vlegi47z _1l7chkll",
|
|
35
|
+
entering: "_1cro60m4 _wqfno73m",
|
|
37
36
|
panelClosed: "_f8371m6a _vlegi47z _1l7chkll"
|
|
38
37
|
};
|
|
39
38
|
/**
|
|
@@ -45,14 +44,16 @@ function PanelLayoutShell(_ref) {
|
|
|
45
44
|
isPanelOpen = _ref.isPanelOpen,
|
|
46
45
|
panelWidth = _ref.panelWidth,
|
|
47
46
|
compactPanelWidth = _ref.compactPanelWidth,
|
|
47
|
+
xlPanelWidth = _ref.xlPanelWidth,
|
|
48
|
+
xlDefaultPanelWidth = _ref.xlDefaultPanelWidth,
|
|
48
49
|
defaultPanelWidth = _ref.defaultPanelWidth,
|
|
49
50
|
compactDefaultPanelWidth = _ref.compactDefaultPanelWidth,
|
|
50
51
|
_ref$panelMinWidth = _ref.panelMinWidth,
|
|
51
52
|
panelMinWidth = _ref$panelMinWidth === void 0 ? 320 : _ref$panelMinWidth,
|
|
52
53
|
mode = _ref.mode,
|
|
53
54
|
layoutRef = _ref.layoutRef,
|
|
54
|
-
_ref$
|
|
55
|
-
|
|
55
|
+
_ref$isMotionEnabled = _ref.isMotionEnabled,
|
|
56
|
+
isMotionEnabled = _ref$isMotionEnabled === void 0 ? false : _ref$isMotionEnabled,
|
|
56
57
|
testId = _ref.testId;
|
|
57
58
|
var mainMinWidth = (0, _react.useContext)(_mainMinWidthContext.MainMinWidthContext);
|
|
58
59
|
var id = "local-panel-".concat((0, _react.useId)().replace(/[^a-zA-Z0-9_-]/g, '_'));
|
|
@@ -62,18 +63,19 @@ function PanelLayoutShell(_ref) {
|
|
|
62
63
|
var inlineQuery = "@container local-panel-layout (min-width: ".concat(mainMinWidth + panelMinWidth, "px)");
|
|
63
64
|
return /*#__PURE__*/React.createElement("div", {
|
|
64
65
|
className: (0, _runtime.ax)([styles.container])
|
|
65
|
-
}, mode === undefined &&
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
}, mode === undefined && isMotionEnabled && (0, _fg.fg)('platform-dst-chat-panel-layout') &&
|
|
67
|
+
/*#__PURE__*/
|
|
68
|
+
// Keep the inline motion cap available during exit, after the open-only track rule is removed.
|
|
69
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles -- Instance-scoped query matches the SSR inline allocation, including caller-defined minimums.
|
|
70
|
+
React.createElement("style", null, "".concat(inlineQuery, " {\n\t\t\t\t\t#").concat(id, " { --p_lclPnlMotionMaxW: calc(100cqw - ").concat(mainMinWidth, "px); }\n\t\t\t\t}")), mode === undefined && isPanelOpen &&
|
|
69
71
|
/*#__PURE__*/
|
|
70
72
|
// 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.
|
|
71
73
|
React.createElement("style", null, "".concat(inlineQuery, " {\n\t\t\t\t\t#").concat(id, " {\n\t\t\t\t\t\t--p_lclPnlSsrAreas: var(--p_lclPnlSsrInlineAreas);\n\t\t\t\t\t\t--p_lclPnlSsrColumns: minmax(0, 1fr) min(var(--p_lclPnlSsrPreferredW), calc(100% - ").concat(mainMinWidth, "px));\n\t\t\t\t\t\t--p_lclPnlSsrArea: panel;\n\t\t\t\t\t\t--p_lclPnlSsrWidth: 100%;\n\t\t\t\t\t\t--p_lclPnlSsrBackground: ", "var(--ds-surface, #FFFFFF)", ";\n\t\t\t\t\t\t--p_lclPnlSsrShadow: none;\n\t\t\t\t\t\t--p_lclPnlSsrBorder: ", "var(--ds-border-width, 1px)", " solid ", "var(--ds-border, #0B120E24)", ";\n\t\t\t\t\t}\n\t\t\t\t}")), /*#__PURE__*/React.createElement("div", {
|
|
72
74
|
id: id,
|
|
73
75
|
"data-testid": testId,
|
|
74
76
|
ref: layoutRef,
|
|
75
|
-
style: (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, localPanelTrackWidthVar, "".concat(panelWidth, "px")), localPanelMinWidthVar, "".concat(panelMinWidth, "px")), '--p_lclPnlCompactW', "".concat(compactPanelWidth, "px")), '--p_lclPnlDefaultW', "".concat(defaultPanelWidth, "px")), '--p_lclPnlCompactDefaultW', "".concat(compactDefaultPanelWidth, "px")),
|
|
76
|
-
className: (0, _runtime.ax)([styles.layout, mode === undefined && isPanelOpen && styles.unmeasured,
|
|
77
|
+
style: (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, localPanelTrackWidthVar, "".concat(panelWidth, "px")), localPanelMinWidthVar, "".concat(panelMinWidth, "px")), '--p_lclPnlCompactW', "".concat(compactPanelWidth, "px")), '--p_lclPnlXlW', "".concat(xlPanelWidth, "px")), '--p_lclPnlXlDefaultW', "".concat(xlDefaultPanelWidth, "px")), '--p_lclPnlDefaultW', "".concat(defaultPanelWidth, "px")), '--p_lclPnlCompactDefaultW', "".concat(compactDefaultPanelWidth, "px")),
|
|
78
|
+
className: (0, _runtime.ax)([styles.layout, mode === undefined && styles.unmeasuredWidths, mode === undefined && isPanelOpen && styles.unmeasured, isMotionEnabled && styles.panelUplift, mode === 'inline' && styles.managedInline, mode === 'overlay' && styles.managedOverlay, !isPanelOpen && styles.panelClosed, isPanelOpen && isMotionEnabled && styles.entering])
|
|
77
79
|
}, /*#__PURE__*/React.createElement("div", {
|
|
78
80
|
className: (0, _runtime.ax)([styles.mainContent])
|
|
79
81
|
}, children), panel));
|
|
@@ -22,7 +22,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
22
22
|
// Development-only ownership checks are scoped to each coordinator, not the whole page.
|
|
23
23
|
var mountedPanelLayouts = new WeakSet();
|
|
24
24
|
function CoordinatedPanelLayout(_ref) {
|
|
25
|
-
var _ref2, _state$width;
|
|
25
|
+
var _ref2, _ref3, _state$width;
|
|
26
26
|
var children = _ref.children,
|
|
27
27
|
panel = _ref.panel,
|
|
28
28
|
isPanelOpen = _ref.isPanelOpen,
|
|
@@ -30,6 +30,7 @@ function CoordinatedPanelLayout(_ref) {
|
|
|
30
30
|
panelWidth = _ref.panelWidth,
|
|
31
31
|
defaultPanelWidth = _ref.defaultPanelWidth,
|
|
32
32
|
compactDefaultPanelWidth = _ref.compactDefaultPanelWidth,
|
|
33
|
+
xlDefaultPanelWidth = _ref.xlDefaultPanelWidth,
|
|
33
34
|
suppliedMinWidth = _ref.panelMinWidth,
|
|
34
35
|
panelMaxWidth = _ref.panelMaxWidth,
|
|
35
36
|
onPanelWidthChange = _ref.onPanelWidthChange,
|
|
@@ -60,6 +61,9 @@ function CoordinatedPanelLayout(_ref) {
|
|
|
60
61
|
var _useState5 = (0, _react.useState)((_ref2 = compactDefaultPanelWidth !== null && compactDefaultPanelWidth !== void 0 ? compactDefaultPanelWidth : defaultPanelWidth) !== null && _ref2 !== void 0 ? _ref2 : (0, _fg.fg)('platform-dst-chat-panel-layout') ? defaults.compactPanelWidth : panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaults.compactPanelWidth),
|
|
61
62
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 1),
|
|
62
63
|
compactWidth = _useState6[0];
|
|
64
|
+
var _useState7 = (0, _react.useState)((0, _fg.fg)('platform-dst-chat-panel-layout') ? (_ref3 = xlDefaultPanelWidth !== null && xlDefaultPanelWidth !== void 0 ? xlDefaultPanelWidth : defaultPanelWidth) !== null && _ref3 !== void 0 ? _ref3 : 500 : defaultWidth),
|
|
65
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 1),
|
|
66
|
+
xlWidth = _useState8[0];
|
|
63
67
|
// Use the controlled request before measurement too, without changing the mount-time default.
|
|
64
68
|
var fallbackWidth = Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaultWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity));
|
|
65
69
|
var _useLayoutAreaSizing = (0, _useLayoutAreaSizing2.useLayoutAreaSizing)({
|
|
@@ -69,6 +73,7 @@ function CoordinatedPanelLayout(_ref) {
|
|
|
69
73
|
requestedWidth: panelWidth,
|
|
70
74
|
defaultWidth: defaultWidth,
|
|
71
75
|
compactDefaultWidth: compactWidth,
|
|
76
|
+
xlDefaultWidth: xlWidth,
|
|
72
77
|
minWidth: panelMinWidth,
|
|
73
78
|
maxWidth: panelMaxWidth
|
|
74
79
|
}
|
|
@@ -115,12 +120,14 @@ function CoordinatedPanelLayout(_ref) {
|
|
|
115
120
|
isPanelOpen: isPanelOpen,
|
|
116
121
|
panelWidth: (_state$width = state === null || state === void 0 ? void 0 : state.width) !== null && _state$width !== void 0 ? _state$width : fallbackWidth,
|
|
117
122
|
defaultPanelWidth: defaultWidth,
|
|
123
|
+
xlDefaultPanelWidth: xlWidth,
|
|
124
|
+
xlPanelWidth: Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : xlWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity)),
|
|
118
125
|
compactDefaultPanelWidth: compactWidth,
|
|
119
126
|
compactPanelWidth: Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : compactWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity)),
|
|
120
127
|
panelMinWidth: panelMinWidth,
|
|
121
128
|
mode: state === null || state === void 0 ? void 0 : state.mode,
|
|
122
129
|
layoutRef: layoutRef,
|
|
123
|
-
|
|
130
|
+
isMotionEnabled: isMotionEnabled,
|
|
124
131
|
testId: testId,
|
|
125
132
|
panel: isMotionEnabled ? /*#__PURE__*/_react.default.createElement(_exitingPersistence.default, null, surface) : surface
|
|
126
133
|
}, children);
|
|
@@ -150,6 +157,7 @@ function PanelLayout(props) {
|
|
|
150
157
|
panelWidth: props.panelWidth,
|
|
151
158
|
defaultPanelWidth: props.defaultPanelWidth,
|
|
152
159
|
compactDefaultPanelWidth: props.compactDefaultPanelWidth,
|
|
160
|
+
xlDefaultPanelWidth: props.xlDefaultPanelWidth,
|
|
153
161
|
panelMinWidth: props.panelMinWidth,
|
|
154
162
|
panelMaxWidth: props.panelMaxWidth,
|
|
155
163
|
onPanelWidthChange: props.onPanelWidthChange,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
15
15
|
._kqsw1if8{position:sticky}
|
|
16
16
|
._vchhusvi{box-sizing:border-box}
|
|
17
|
-
@media (prefers-reduced-motion:no-preference){.
|
|
17
|
+
@media (prefers-reduced-motion:no-preference){._k1afi8w4{animation:var(--ds-panel-content-open,.15s cubic-bezier(.16,1,.3,1) FadeIn0to100 .1s)}._k1afry0p{animation:var(--ds-panel-exit-right,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentRight)}[dir=rtl] ._105a97o5{animation:var(--ds-panel-exit-left,.2s cubic-bezier(.25,1,.5,1) SlideOut100PercentLeft)}._bq641n9t{position:fixed}@starting-style{._1kmh1n9t{position:fixed}}._k1afx3bs{animation:var(--ds-panel-enter-right,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentRight)}._10t81ia4{transition-property:position}._xrrp147i{transition-duration:var(--ds-duration-instant,0ms)}._1wsa1ja5{transition-delay:60ms}._1vrh1a5r{transition-behavior:allow-discrete}[dir=rtl] ._105az3zp{animation:var(--ds-panel-enter-left,.2s cubic-bezier(.16,1,.3,1) SlideIn100PercentLeft)}}
|
|
18
18
|
@media (min-width:48rem){._14b54rrg{width:var(--n_pnlRsz,var(--n_pnlW))}}
|
|
19
19
|
@media (min-width:64rem){._1w6eia51{border-inline-start:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._scbpglyw{box-shadow:none}._4ap3vuon{background-color:var(--ds-surface,#fff)}}
|
|
20
20
|
@media (min-width:90rem){._1dhy1c6w{grid-area:panel}._9sns1wug{z-index:auto}}
|