@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
|
@@ -20,6 +20,7 @@ function CoordinatedPanelLayout({
|
|
|
20
20
|
panelWidth,
|
|
21
21
|
defaultPanelWidth,
|
|
22
22
|
compactDefaultPanelWidth,
|
|
23
|
+
xlDefaultPanelWidth,
|
|
23
24
|
panelMinWidth: suppliedMinWidth,
|
|
24
25
|
panelMaxWidth,
|
|
25
26
|
onPanelWidthChange,
|
|
@@ -29,7 +30,7 @@ function CoordinatedPanelLayout({
|
|
|
29
30
|
testId,
|
|
30
31
|
layoutRef
|
|
31
32
|
}) {
|
|
32
|
-
var _ref, _state$width;
|
|
33
|
+
var _ref, _ref2, _state$width;
|
|
33
34
|
const [defaults] = useState(getPanelLayoutDefaults);
|
|
34
35
|
const panelMinWidth = suppliedMinWidth !== null && suppliedMinWidth !== void 0 ? suppliedMinWidth : defaults.panelMinWidth;
|
|
35
36
|
const coordinator = useContext(LayoutAreaSizingContext);
|
|
@@ -44,6 +45,7 @@ function CoordinatedPanelLayout({
|
|
|
44
45
|
}, [coordinator]);
|
|
45
46
|
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
47
|
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);
|
|
48
|
+
const [xlWidth] = useState(fg('platform-dst-chat-panel-layout') ? (_ref2 = xlDefaultPanelWidth !== null && xlDefaultPanelWidth !== void 0 ? xlDefaultPanelWidth : defaultPanelWidth) !== null && _ref2 !== void 0 ? _ref2 : 500 : defaultWidth);
|
|
47
49
|
// Use the controlled request before measurement too, without changing the mount-time default.
|
|
48
50
|
const fallbackWidth = Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : defaultWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity));
|
|
49
51
|
const {
|
|
@@ -60,6 +62,7 @@ function CoordinatedPanelLayout({
|
|
|
60
62
|
requestedWidth: panelWidth,
|
|
61
63
|
defaultWidth,
|
|
62
64
|
compactDefaultWidth: compactWidth,
|
|
65
|
+
xlDefaultWidth: xlWidth,
|
|
63
66
|
minWidth: panelMinWidth,
|
|
64
67
|
maxWidth: panelMaxWidth
|
|
65
68
|
}
|
|
@@ -100,12 +103,14 @@ function CoordinatedPanelLayout({
|
|
|
100
103
|
isPanelOpen: isPanelOpen,
|
|
101
104
|
panelWidth: (_state$width = state === null || state === void 0 ? void 0 : state.width) !== null && _state$width !== void 0 ? _state$width : fallbackWidth,
|
|
102
105
|
defaultPanelWidth: defaultWidth,
|
|
106
|
+
xlDefaultPanelWidth: xlWidth,
|
|
107
|
+
xlPanelWidth: Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : xlWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity)),
|
|
103
108
|
compactDefaultPanelWidth: compactWidth,
|
|
104
109
|
compactPanelWidth: Math.max(panelMinWidth, Math.min(panelWidth !== null && panelWidth !== void 0 ? panelWidth : compactWidth, panelMaxWidth !== null && panelMaxWidth !== void 0 ? panelMaxWidth : Infinity)),
|
|
105
110
|
panelMinWidth: panelMinWidth,
|
|
106
111
|
mode: state === null || state === void 0 ? void 0 : state.mode,
|
|
107
112
|
layoutRef: layoutRef,
|
|
108
|
-
|
|
113
|
+
isMotionEnabled: isMotionEnabled,
|
|
109
114
|
testId: testId,
|
|
110
115
|
panel: isMotionEnabled ? /*#__PURE__*/React.createElement(ExitingPersistence, null, surface) : surface
|
|
111
116
|
}, children);
|
|
@@ -135,6 +140,7 @@ export function PanelLayout(props) {
|
|
|
135
140
|
panelWidth: props.panelWidth,
|
|
136
141
|
defaultPanelWidth: props.defaultPanelWidth,
|
|
137
142
|
compactDefaultPanelWidth: props.compactDefaultPanelWidth,
|
|
143
|
+
xlDefaultPanelWidth: props.xlDefaultPanelWidth,
|
|
138
144
|
panelMinWidth: props.panelMinWidth,
|
|
139
145
|
panelMaxWidth: props.panelMaxWidth,
|
|
140
146
|
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}}
|
|
@@ -17,6 +17,7 @@ import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context';
|
|
|
17
17
|
import { PanelSplitterProvider } from './panel-splitter/provider';
|
|
18
18
|
import { useSideNavRef } from './side-nav/use-side-nav-ref';
|
|
19
19
|
import { useLayoutId } from './use-layout-id';
|
|
20
|
+
import { usePanelContentEnter } from './use-panel-content-enter';
|
|
20
21
|
import { useResizingWidthCssVarOnRootElement } from './use-resizing-width-css-var-on-root-element';
|
|
21
22
|
import { useSafeDefaultWidth } from './use-safe-default-width';
|
|
22
23
|
const panelSplitterResizingVar = '--n_pnlRsz';
|
|
@@ -34,9 +35,10 @@ const styles = {
|
|
|
34
35
|
border: "_191wglyw _16qs130s _1w6eia51 _scbpglyw",
|
|
35
36
|
scrollContainer: "_1reo1wug _18m91wug _4t3i1osq",
|
|
36
37
|
hidden: "_1e0cglyw",
|
|
37
|
-
entering: "
|
|
38
|
-
exiting: "
|
|
38
|
+
entering: "_k1afx3bs _10t81ia4 _xrrp147i _1wsa1ja5 _1vrh1a5r _1kmh1n9t _105az3zp",
|
|
39
|
+
exiting: "_k1afry0p _bq641n9t _105a97o5",
|
|
39
40
|
contentEntering: "_y44v1mph",
|
|
41
|
+
contentEnteringOnOpen: "_k1afi8w4",
|
|
40
42
|
contentExiting: "_y44vf1qi",
|
|
41
43
|
contentChangeContainer: "_4t3i1osq"
|
|
42
44
|
};
|
|
@@ -104,6 +106,7 @@ export function Panel({
|
|
|
104
106
|
},
|
|
105
107
|
initialState: defaultWidth === 0 ? 'hidden' : undefined
|
|
106
108
|
});
|
|
109
|
+
const shouldAnimateContentEnter = usePanelContentEnter(state);
|
|
107
110
|
|
|
108
111
|
/**
|
|
109
112
|
* Don't show the skip link if the slot has 0 width.
|
|
@@ -233,7 +236,7 @@ export function Panel({
|
|
|
233
236
|
resizingCssVar: panelSplitterResizingVar,
|
|
234
237
|
position: "start"
|
|
235
238
|
}, /*#__PURE__*/React.createElement("div", {
|
|
236
|
-
className: ax([styles.scrollContainer, isMotionUpliftEnabled &&
|
|
239
|
+
className: ax([styles.scrollContainer, isMotionUpliftEnabled && shouldAnimateContentEnter && styles.contentEnteringOnOpen, isMotionUpliftEnabled && state === 'exiting' && styles.contentExiting])
|
|
237
240
|
}, isContentMotionEnabled ? /*#__PURE__*/React.createElement(ExitingPersistence, {
|
|
238
241
|
exitThenEnter: contentKey !== undefined
|
|
239
242
|
}, /*#__PURE__*/React.createElement(PanelContentMotion, {
|
|
@@ -6,20 +6,21 @@
|
|
|
6
6
|
._1bsbhc79{width:var(--n_snvRsz,var(--n_sNvw))}
|
|
7
7
|
._1e0c1txw{display:flex}
|
|
8
8
|
._1e0cglyw{display:none}
|
|
9
|
-
.
|
|
9
|
+
._1p2s1v7a{--exit-animation:var(--ds-sidenav-exit-left,200ms cubic-bezier(0.25,1,0.5,1) SlideOut100PercentLeft)}
|
|
10
10
|
._1pbycs5v{z-index:2}
|
|
11
11
|
._2lx21bp4{flex-direction:column}
|
|
12
12
|
._4t3i1osq{height:100%}
|
|
13
13
|
._4t3ieqxy{height:calc(100vh - var(--n_bnrM, 0px) - var(--n_tNvM, 0px))}
|
|
14
14
|
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
15
|
-
.
|
|
15
|
+
._cjprbksg{--enter-animation:var(--ds-sidenav-enter-left,200ms cubic-bezier(0.16,1,0.3,1) SlideIn100PercentLeft)}
|
|
16
16
|
._kqsw1if8{position:sticky}
|
|
17
17
|
._vchhusvi{box-sizing:border-box}
|
|
18
|
-
[dir=rtl] .
|
|
19
|
-
[dir=rtl] .
|
|
20
|
-
@media (prefers-reduced-motion:no-preference){._10t81t0s{transition-property:display}._1vrh1a5r{transition-behavior:allow-discrete}._xrrpi9qs{transition-duration:var(--ds-duration-medium,.2s)}
|
|
18
|
+
[dir=rtl] ._1jq4125i{--enter-animation:var(--ds-sidenav-enter-right,200ms cubic-bezier(0.16,1,0.3,1) SlideIn100PercentRight)}
|
|
19
|
+
[dir=rtl] ._2qe01hl6{--exit-animation:var(--ds-sidenav-exit-right,200ms cubic-bezier(0.25,1,0.5,1) SlideOut100PercentRight)}
|
|
20
|
+
@media (prefers-reduced-motion:no-preference){._10t81t0s{transition-property:display}._1vrh1a5r{transition-behavior:allow-discrete}._xrrpi9qs{transition-duration:var(--ds-duration-medium,.2s)}}
|
|
21
21
|
@media (min-width:48rem){._14b5hc79{width:var(--n_snvRsz,var(--n_sNvw))}}
|
|
22
22
|
@media (min-width:64rem){._cpcf1gzg._cpcf1gzg{grid-area:main}._6kttglyw._6kttglyw{border-inline-end:none}._w8v11bhr._w8v11bhr{background-color:var(--ds-surface-overlay,#fff)}._1jug130s._1jug130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}._dm2518uv{display:initial}._dm25glyw{display:none}._qiln1gzg{grid-area:main}._p5clglyw{border-inline-end:none}._4ap31bhr{background-color:var(--ds-surface-overlay,#fff)}._scbp130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}._qilnk0mc{grid-area:side-nav}._p5clia51{border-inline-end:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._4ap3vuon{background-color:var(--ds-surface,#fff)}._scbpglyw{box-shadow:none}}
|
|
23
|
-
@media (prefers-reduced-motion:no-preference) and (min-width:64rem){._1sg81gzg{grid-area:main}._n2infm5y{animation:var(--exit-animation)}._17ly1wzp{transition-property:grid-area,display}._hjoi1wsm{transition-duration:var(--ds-duration-instant,0ms),var(--ds-duration-medium,.2s)}.
|
|
23
|
+
@media (prefers-reduced-motion:no-preference) and (min-width:64rem){._1sg81gzg{grid-area:main}._n2infm5y{animation:var(--exit-animation)}._17ly1wzp{transition-property:grid-area,display}._hjoi1wsm{transition-duration:var(--ds-duration-instant,0ms),var(--ds-duration-medium,.2s)}._1wxo147i{transition-delay:var(--ds-duration-instant,0ms)}@starting-style{._1xpz1gzg{grid-area:main}}._1sg8k0mc{grid-area:side-nav}._n2in10ed{animation:var(--enter-animation)}._17ly1q8v{transition-property:grid-area}._hjoi147i{transition-duration:var(--ds-duration-instant,0ms)}._1wxo1ja5{transition-delay:60ms}}
|
|
24
24
|
@media not (min-width:64rem){._89fi1b6c{grid-area:main/aside/aside/aside}}
|
|
25
|
+
@media (prefers-reduced-motion:no-preference) and (width < 64rem){._nobw10ed{animation:var(--enter-animation)}._ycjn1gzg{grid-area:main}._nobwfm5y{animation:var(--exit-animation)}}
|
|
25
26
|
@supports not (-moz-appearance:none){@media (prefers-reduced-motion:no-preference){._139f8iot{transition-property:transform,display}._1tpvfnf5{transition-duration:.2s}._sylc1a5r{transition-behavior:allow-discrete}._1uwsjq3t{transform:translateX(-100%)}}@media (prefers-reduced-motion:no-preference){@starting-style{._oyeijq3t{transform:translateX(-100%)}}._139f8iot{transition-property:transform,display}._1tpvfnf5{transition-duration:.2s}._sylc1a5r{transition-behavior:allow-discrete}}@media (prefers-reduced-motion:no-preference){._4xci10ed{animation:var(--enter-animation)}._1tpv1mzy{transition-duration:var(--ds-duration-long,.25s)}._sylc1a5r{transition-behavior:allow-discrete}}@media (prefers-reduced-motion:no-preference){._4xcifm5y{animation:var(--exit-animation)}._1tpvi9qs{transition-duration:var(--ds-duration-medium,.2s)}._sylc1a5r{transition-behavior:allow-discrete}}}
|
|
@@ -122,20 +122,20 @@ const styles = {
|
|
|
122
122
|
* with `@starting-style` used by `styles`.
|
|
123
123
|
*
|
|
124
124
|
* ⚠️ The `transition-duration` values below need to stay in sync with the duration baked into the tokens
|
|
125
|
-
* (`motion.sidenav.enter.*`
|
|
125
|
+
* (`motion.sidenav.enter.*` and `motion.sidenav.exit.*` are both 200ms). The `display` property is
|
|
126
126
|
* transitioned (with `allow-discrete`) so the element stays rendered for the length of the exit animation —
|
|
127
127
|
* if the transition is shorter than the animation, `display: none` applies early and the exit animation
|
|
128
128
|
* never runs.
|
|
129
129
|
*/
|
|
130
130
|
const motionUpliftStyles = {
|
|
131
|
-
animationRTLSupport: "
|
|
131
|
+
animationRTLSupport: "_cjprbksg _1p2s1v7a _1jq4125i _2qe01hl6",
|
|
132
132
|
animationBaseStyles: "_10t81t0s _1vrh1a5r _xrrpi9qs",
|
|
133
|
-
expandAnimationMobile: "
|
|
134
|
-
collapseAnimationMobile: "
|
|
133
|
+
expandAnimationMobile: "_nobw10ed",
|
|
134
|
+
collapseAnimationMobile: "_ycjn1gzg _nobwfm5y",
|
|
135
135
|
flyoutOpen: "_qiln1gzg _p5clglyw _4ap31bhr _scbp130s _4xci10ed _1tpv1mzy _sylc1a5r",
|
|
136
136
|
flyoutAnimateClosed: "_1e0cglyw _qiln1gzg _4xcifm5y _1tpvi9qs _sylc1a5r",
|
|
137
|
-
expandAnimationDesktop: "_1sg8k0mc _n2in10ed _1xpz1gzg _17ly1q8v _hjoi147i
|
|
138
|
-
collapseAnimationDesktop: "_1sg81gzg _n2infm5y _17ly1wzp _hjoi1wsm
|
|
137
|
+
expandAnimationDesktop: "_1sg8k0mc _n2in10ed _1xpz1gzg _17ly1q8v _hjoi147i _1wxo1ja5",
|
|
138
|
+
collapseAnimationDesktop: "_1sg81gzg _n2infm5y _17ly1wzp _hjoi1wsm _1wxo147i"
|
|
139
139
|
};
|
|
140
140
|
const fallbackDefaultWidth = 320;
|
|
141
141
|
export const onPeekStartDelayMs = 500;
|
|
@@ -991,6 +991,7 @@ function SideNavInternal({
|
|
|
991
991
|
}), isChatPanelLayoutEnabled &&
|
|
992
992
|
/*#__PURE__*/
|
|
993
993
|
// CSS reserves only the nav minimum for chat's fit decision, before effects or lazy loading.
|
|
994
|
+
// Motion owns grid-area so this ID selector cannot override the entrance or exit snap.
|
|
994
995
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles
|
|
995
996
|
React.createElement("style", null, `
|
|
996
997
|
#${gridRootFitId} { --n_clearanceNavMin: 0px; --n_clearanceNavTarget: ${clampedWidth}; }
|
|
@@ -998,10 +999,10 @@ function SideNavInternal({
|
|
|
998
999
|
@media (min-width: 64rem) {
|
|
999
1000
|
#${gridRootFitId} { --n_clearanceNavMin: ${isExpandedOnDesktop ? minWidth : '0px'}; }
|
|
1000
1001
|
}
|
|
1001
|
-
${shouldApplyUnmanagedSizing ? `#${gridRootId} nav[data-layout-slot] { grid-area: main / aside / aside / aside; width: min(90%, ${clampedWidth}); }` : ''}
|
|
1002
|
+
${shouldApplyUnmanagedSizing ? `#${gridRootId} nav[data-layout-slot] { ${isMotionUpliftEnabled ? '' : 'grid-area: main / aside / aside / aside;'} width: min(90%, ${clampedWidth}); }` : ''}
|
|
1002
1003
|
@media (min-width: 64rem) {
|
|
1003
1004
|
#${gridRootChatFitId} { --n_fitNav: ${isExpandedOnDesktop ? minWidth : '0px'}; }
|
|
1004
|
-
${shouldApplyUnmanagedSizing ? `#${gridRootId} nav[data-layout-slot] { grid-area: side-nav; width: max(${minWidth}, min(${clampedWidth}, calc(100cqw + var(--n_fitNav) - var(--n_chatTrack, 0px)))); }` : ''}
|
|
1005
|
+
${shouldApplyUnmanagedSizing ? `#${gridRootId} nav[data-layout-slot] { ${isMotionUpliftEnabled ? '' : 'grid-area: side-nav;'} width: max(${minWidth}, min(${clampedWidth}, calc(100cqw + var(--n_fitNav) - var(--n_chatTrack, 0px)))); }` : ''}
|
|
1005
1006
|
}
|
|
1006
1007
|
`), /*#__PURE__*/React.createElement(DangerouslyHoistCssVarToDocumentRoot, {
|
|
1007
1008
|
variableName: sideNavLiveWidthVar,
|
|
@@ -10,6 +10,7 @@ export function useLayoutAreaSizing({
|
|
|
10
10
|
requestedWidth,
|
|
11
11
|
defaultWidth,
|
|
12
12
|
compactDefaultWidth,
|
|
13
|
+
xlDefaultWidth,
|
|
13
14
|
minWidth,
|
|
14
15
|
maxWidth,
|
|
15
16
|
isOpen,
|
|
@@ -37,12 +38,13 @@ export function useLayoutAreaSizing({
|
|
|
37
38
|
requestedWidth,
|
|
38
39
|
defaultWidth,
|
|
39
40
|
compactDefaultWidth,
|
|
41
|
+
xlDefaultWidth,
|
|
40
42
|
minWidth,
|
|
41
43
|
maxWidth,
|
|
42
44
|
isOpen,
|
|
43
45
|
onRequestClose: requestClose
|
|
44
46
|
});
|
|
45
|
-
}, [area, compactDefaultWidth, defaultWidth, isOpen, maxWidth, minWidth, registerArea, requestClose, requestedWidth]);
|
|
47
|
+
}, [area, compactDefaultWidth, xlDefaultWidth, defaultWidth, isOpen, maxWidth, minWidth, registerArea, requestClose, requestedWidth]);
|
|
46
48
|
useEffect(() => () => unregisterArea === null || unregisterArea === void 0 ? void 0 : unregisterArea(area), [area, unregisterArea]);
|
|
47
49
|
const startResize = useCallback(mode => startAreaResize === null || startAreaResize === void 0 ? void 0 : startAreaResize(area, mode), [area, startAreaResize]);
|
|
48
50
|
const resize = useCallback((mode, width) => resizeArea === null || resizeArea === void 0 ? void 0 : resizeArea(area, mode, width), [area, resizeArea]);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Keep the delayed content fade attached after the shorter panel slide finishes.
|
|
4
|
+
*/
|
|
5
|
+
export function usePanelContentEnter(state) {
|
|
6
|
+
const [hasEntered, setHasEntered] = useState(state === 'entering');
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
if (state !== 'visible') {
|
|
9
|
+
setHasEntered(state === 'entering');
|
|
10
|
+
}
|
|
11
|
+
}, [state]);
|
|
12
|
+
|
|
13
|
+
// Exit/hidden removes the animation so reopening starts a fresh fade. A panel
|
|
14
|
+
// initially mounted as visible should not gain an entrance animation.
|
|
15
|
+
return state === 'entering' || state === 'visible' && hasEntered;
|
|
16
|
+
}
|
|
@@ -10,14 +10,18 @@ function clampTargetWidth(_ref) {
|
|
|
10
10
|
max = _ref.max;
|
|
11
11
|
return Math.max(min, Math.min(target, max));
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
var _area$compactDefaultW, _area$
|
|
15
|
-
|
|
13
|
+
function getDefaultWidth(area, isCompact, isXlViewport) {
|
|
14
|
+
var _area$compactDefaultW, _area$xlDefaultWidth;
|
|
15
|
+
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;
|
|
16
|
+
}
|
|
17
|
+
function getTargetWidth(area, isSideNavOverlay, isXlViewport) {
|
|
18
|
+
var _area$liveResize, _ref2, _area$requestedWidth;
|
|
19
|
+
var defaultWidth = getDefaultWidth(area, isSideNavOverlay, isXlViewport);
|
|
16
20
|
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;
|
|
17
21
|
}
|
|
18
|
-
function getOverlayTargetWidth(area, isSideNavOverlay, areaName) {
|
|
19
|
-
var _area$
|
|
20
|
-
var defaultWidth =
|
|
22
|
+
function getOverlayTargetWidth(area, isSideNavOverlay, isXlViewport, areaName) {
|
|
23
|
+
var _area$liveResize2, _ref3, _area$requestedWidth2;
|
|
24
|
+
var defaultWidth = getDefaultWidth(area, isSideNavOverlay, isXlViewport);
|
|
21
25
|
return ((_area$liveResize2 = area.liveResize) === null || _area$liveResize2 === void 0 ? void 0 : _area$liveResize2.mode) === 'overlay' ? area.liveResize.width : (_ref3 = (_area$requestedWidth2 = area.requestedWidth) !== null && _area$requestedWidth2 !== void 0 ? _area$requestedWidth2 : areaName === 'panel' ? area.preferredWidth : area.preferredOverlayWidth) !== null && _ref3 !== void 0 ? _ref3 : defaultWidth;
|
|
22
26
|
}
|
|
23
27
|
export function calculateLayoutAreaStates(_ref4) {
|
|
@@ -27,6 +31,8 @@ export function calculateLayoutAreaStates(_ref4) {
|
|
|
27
31
|
layoutWidth = _ref4$layoutWidth === void 0 ? viewportWidth : _ref4$layoutWidth,
|
|
28
32
|
isChatPanelOverlay = _ref4.isChatPanelOverlay,
|
|
29
33
|
isSideNavOverlay = _ref4.isSideNavOverlay,
|
|
34
|
+
_ref4$isXlViewport = _ref4.isXlViewport,
|
|
35
|
+
isXlViewport = _ref4$isXlViewport === void 0 ? false : _ref4$isXlViewport,
|
|
30
36
|
_ref4$occupiedWidth = _ref4.occupiedWidth,
|
|
31
37
|
occupiedWidth = _ref4$occupiedWidth === void 0 ? 0 : _ref4$occupiedWidth,
|
|
32
38
|
mainMinWidthBound = _ref4.mainMinWidth,
|
|
@@ -49,7 +55,7 @@ export function calculateLayoutAreaStates(_ref4) {
|
|
|
49
55
|
// A growing panel cascades towards inline-start. Chat is on the other side
|
|
50
56
|
// of the local rail, so local growth must reserve its full starting width.
|
|
51
57
|
var shouldCollapseSideNav = Boolean(!isRefinedLayout && resizeSession && resizeSession.area !== 'side-nav' && resizeSession.baselineWidths['side-nav'] !== undefined && resizeSession.baselineWidths[resizeSession.area] !== undefined && resizingArea && !isSideNavOverlay && clampTargetWidth({
|
|
52
|
-
target: getTargetWidth(resizingArea, isSideNavOverlay),
|
|
58
|
+
target: getTargetWidth(resizingArea, isSideNavOverlay, isXlViewport),
|
|
53
59
|
min: resolveLayoutWidth(resizingArea.minWidth, viewportWidth),
|
|
54
60
|
max: resizingArea.maxWidth !== undefined ? resolveLayoutWidth(resizingArea.maxWidth, viewportWidth) : Number.POSITIVE_INFINITY
|
|
55
61
|
}) > 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));
|
|
@@ -92,7 +98,7 @@ export function calculateLayoutAreaStates(_ref4) {
|
|
|
92
98
|
var min = resolveLayoutWidth(area.minWidth, viewportWidth);
|
|
93
99
|
var max = area.maxWidth ? resolveLayoutWidth(area.maxWidth, viewportWidth) : Number.POSITIVE_INFINITY;
|
|
94
100
|
var baselineWidth = baselineWidths === null || baselineWidths === void 0 ? void 0 : baselineWidths[areaName];
|
|
95
|
-
var requestedTarget = resizeSession && areaName !== resizeSession.area ? shouldCollapseSideNav && resizeSession.area === 'chat-panel' ? min : baselineWidth !== null && baselineWidth !== void 0 ? baselineWidth : getTargetWidth(area, isSideNavOverlay) : getTargetWidth(area, isSideNavOverlay);
|
|
101
|
+
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);
|
|
96
102
|
var target = clampTargetWidth({
|
|
97
103
|
target: requestedTarget,
|
|
98
104
|
min: min,
|
|
@@ -156,12 +162,12 @@ export function calculateLayoutAreaStates(_ref4) {
|
|
|
156
162
|
_iterator2.f();
|
|
157
163
|
}
|
|
158
164
|
if (hasPanelClearance && panel) {
|
|
159
|
-
var
|
|
165
|
+
var _widths$get4, _widths$get5;
|
|
160
166
|
// Opening/viewport fitting gives up SideNav width before Chat. During a
|
|
161
167
|
// panel drag only SideNav yields; Chat retains its starting width.
|
|
162
168
|
var isPanelResize = (resizeSession === null || resizeSession === void 0 ? void 0 : resizeSession.area) === 'panel';
|
|
163
|
-
var desiredPanelWidth = Math.max(panelMinWidth, Math.min(getOverlayTargetWidth(panel, isSideNavOverlay, 'panel'), panel.maxWidth === undefined ? Infinity : resolveLayoutWidth(panel.maxWidth, viewportWidth)));
|
|
164
|
-
var overlayDefault =
|
|
169
|
+
var desiredPanelWidth = Math.max(panelMinWidth, Math.min(getOverlayTargetWidth(panel, isSideNavOverlay, isXlViewport, 'panel'), panel.maxWidth === undefined ? Infinity : resolveLayoutWidth(panel.maxWidth, viewportWidth)));
|
|
170
|
+
var overlayDefault = getDefaultWidth(panel, isSideNavOverlay, isXlViewport);
|
|
165
171
|
var reservedMainWidth = isPanelResize ? Math.max(effectiveMainMinWidth, desiredPanelWidth + 32,
|
|
166
172
|
// Above the default, Main must also fit the panel within its 90% cap.
|
|
167
173
|
desiredPanelWidth > overlayDefault ? desiredPanelWidth / 0.9 : 0) : effectiveMainMinWidth;
|
|
@@ -214,7 +220,7 @@ export function calculateLayoutAreaStates(_ref4) {
|
|
|
214
220
|
_step4;
|
|
215
221
|
try {
|
|
216
222
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
217
|
-
var _states$_areaName
|
|
223
|
+
var _states$_areaName;
|
|
218
224
|
var _areaName2 = _step4.value;
|
|
219
225
|
var _area = areas[_areaName2];
|
|
220
226
|
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) {
|
|
@@ -225,11 +231,11 @@ export function calculateLayoutAreaStates(_ref4) {
|
|
|
225
231
|
// Chat covers Root; SideNav and the local panel overlay Main's grid track.
|
|
226
232
|
// Occupied tracks and inline chat are not part of that covered region.
|
|
227
233
|
var layoutMax = (_areaName2 === 'chat-panel' ? layoutWidth : mainAreaWidth) * 0.9;
|
|
228
|
-
var defaultWidth =
|
|
234
|
+
var defaultWidth = getDefaultWidth(_area, isSideNavOverlay, isXlViewport);
|
|
229
235
|
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;
|
|
230
236
|
var _max = isRefinedLayout && (_areaName2 === 'panel' || _areaName2 === 'chat-panel') ? Math.max(_min2, Math.min(configuredMax, overlayMax)) : Math.max(0, Math.min(configuredMax, overlayMax));
|
|
231
237
|
var effectiveMin = isRefinedLayout && (_areaName2 === 'panel' || _areaName2 === 'chat-panel') ? _min2 : Math.min(_min2, _max);
|
|
232
|
-
var _target = getOverlayTargetWidth(_area, isSideNavOverlay, _areaName2);
|
|
238
|
+
var _target = getOverlayTargetWidth(_area, isSideNavOverlay, isXlViewport, _areaName2);
|
|
233
239
|
var _width2 = clampTargetWidth({
|
|
234
240
|
target: _target,
|
|
235
241
|
min: effectiveMin,
|
|
@@ -74,6 +74,7 @@ export function LayoutAreaSizingProvider(_ref) {
|
|
|
74
74
|
}, []);
|
|
75
75
|
var mainMinWidth = useRef(defaultMainMinWidth);
|
|
76
76
|
var loadRef = useRef(function () {});
|
|
77
|
+
var viewportWidthAtLoad = useRef();
|
|
77
78
|
var ready = useRef(false);
|
|
78
79
|
var waiting = useRef([]);
|
|
79
80
|
var pending = useRef([]);
|
|
@@ -99,6 +100,7 @@ export function LayoutAreaSizingProvider(_ref) {
|
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
101
102
|
loading = true;
|
|
103
|
+
viewportWidthAtLoad.current = window.innerWidth;
|
|
102
104
|
void import( /* webpackChunkName: "@atlaskit-internal_navigation-layout-sizing" */'./layout-area-sizing-runtime').then(function (_ref2) {
|
|
103
105
|
var LayoutAreaSizingRuntime = _ref2.LayoutAreaSizingRuntime;
|
|
104
106
|
if (!cancelled) {
|
|
@@ -308,6 +310,7 @@ export function LayoutAreaSizingProvider(_ref) {
|
|
|
308
310
|
}, children))), Runtime && /*#__PURE__*/React.createElement(Runtime, {
|
|
309
311
|
layoutRef: layoutRef,
|
|
310
312
|
onReady: onReady,
|
|
311
|
-
onUpdate: onUpdate
|
|
313
|
+
onUpdate: onUpdate,
|
|
314
|
+
viewportWidthAtLoad: viewportWidthAtLoad.current
|
|
312
315
|
}));
|
|
313
316
|
}
|
|
@@ -32,7 +32,8 @@ export function LayoutAreaSizingRuntime(_ref2) {
|
|
|
32
32
|
var children = _ref2.children,
|
|
33
33
|
layoutRef = _ref2.layoutRef,
|
|
34
34
|
onReady = _ref2.onReady,
|
|
35
|
-
onUpdate = _ref2.onUpdate
|
|
35
|
+
onUpdate = _ref2.onUpdate,
|
|
36
|
+
viewportWidthAtLoad = _ref2.viewportWidthAtLoad;
|
|
36
37
|
var occupiedWidth = useOccupiedLayoutWidth(layoutRef);
|
|
37
38
|
var _useState = useState(null),
|
|
38
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -52,7 +53,10 @@ export function LayoutAreaSizingRuntime(_ref2) {
|
|
|
52
53
|
setResizeSession = _useState8[1];
|
|
53
54
|
var areaStatesRef = React.useRef({});
|
|
54
55
|
var configsRef = React.useRef({});
|
|
55
|
-
|
|
56
|
+
// A viewport change while the chunk loads is already a layout event. Reallocate
|
|
57
|
+
// instead of adopting CSS geometry from the preceding breakpoint (which WebKit
|
|
58
|
+
// can still report during that handoff).
|
|
59
|
+
var _useState9 = useState(viewportWidthAtLoad !== undefined && viewportWidthAtLoad !== window.innerWidth),
|
|
56
60
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
57
61
|
hasInteraction = _useState0[0],
|
|
58
62
|
setHasInteraction = _useState0[1];
|
|
@@ -91,6 +95,7 @@ export function LayoutAreaSizingRuntime(_ref2) {
|
|
|
91
95
|
// Match the actual rem-based grid breakpoint, including browser font settings.
|
|
92
96
|
var inlineChatQuery = window.matchMedia('(min-width: 40rem)');
|
|
93
97
|
var inlineSideNavQuery = window.matchMedia('(min-width: 64rem)');
|
|
98
|
+
var xlQuery = window.matchMedia('(min-width: 110.5rem)');
|
|
94
99
|
var updateDimensions = function updateDimensions(contentWidth) {
|
|
95
100
|
var _style$width, _style$paddingLeft, _style$paddingRight, _style$borderLeftWidt, _style$borderRightWid, _previous;
|
|
96
101
|
var style = root && contentWidth === undefined ? getComputedStyle(root) : null;
|
|
@@ -105,9 +110,10 @@ export function LayoutAreaSizingRuntime(_ref2) {
|
|
|
105
110
|
viewportWidth: window.innerWidth,
|
|
106
111
|
layoutWidth: layoutWidth,
|
|
107
112
|
isChatPanelOverlay: !inlineChatQuery.matches,
|
|
108
|
-
isSideNavOverlay: !inlineSideNavQuery.matches
|
|
113
|
+
isSideNavOverlay: !inlineSideNavQuery.matches,
|
|
114
|
+
isXlViewport: xlQuery.matches
|
|
109
115
|
};
|
|
110
|
-
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) {
|
|
116
|
+
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) {
|
|
111
117
|
return;
|
|
112
118
|
}
|
|
113
119
|
if (previous) {
|
|
@@ -147,7 +153,14 @@ export function LayoutAreaSizingRuntime(_ref2) {
|
|
|
147
153
|
return updateDimensions();
|
|
148
154
|
}
|
|
149
155
|
});
|
|
156
|
+
var unbindXlQuery = bind(xlQuery, {
|
|
157
|
+
type: 'change',
|
|
158
|
+
listener: function listener() {
|
|
159
|
+
return updateDimensions();
|
|
160
|
+
}
|
|
161
|
+
});
|
|
150
162
|
return function () {
|
|
163
|
+
unbindXlQuery();
|
|
151
164
|
observer.disconnect();
|
|
152
165
|
unbindResize();
|
|
153
166
|
unbindQuery();
|
|
@@ -156,14 +169,14 @@ export function LayoutAreaSizingRuntime(_ref2) {
|
|
|
156
169
|
}, [layoutRef]);
|
|
157
170
|
var registerArea = useCallback(function (area, config) {
|
|
158
171
|
var previous = configsRef.current[area];
|
|
159
|
-
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)) {
|
|
172
|
+
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)) {
|
|
160
173
|
setHasInteraction(true);
|
|
161
174
|
}
|
|
162
175
|
configsRef.current[area] = config;
|
|
163
176
|
setResizeSession(function (current) {
|
|
164
177
|
// A changed layout/configuration needs a fresh allocation. A controlled
|
|
165
178
|
// acknowledgement for the resized area keeps its siblings fixed.
|
|
166
|
-
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;
|
|
179
|
+
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;
|
|
167
180
|
});
|
|
168
181
|
setAreas(function (current) {
|
|
169
182
|
var existing = current[area];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { layoutAreaStateContexts } from './layout-area-state-contexts';
|
|
2
3
|
import { gridRootChatFitId, gridRootId } from './root';
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -9,6 +10,13 @@ import { gridRootChatFitId, gridRootId } from './root';
|
|
|
9
10
|
export function LayoutOverlayClearance(_ref) {
|
|
10
11
|
var panelMinWidth = _ref.panelMinWidth,
|
|
11
12
|
mainMinWidth = _ref.mainMinWidth;
|
|
13
|
+
var sideNavSizing = useContext(layoutAreaStateContexts['side-nav']);
|
|
14
|
+
var chatSizing = useContext(layoutAreaStateContexts['chat-panel']);
|
|
15
|
+
// A newly opened local panel can be unmeasured for one render after its siblings have
|
|
16
|
+
// joined the resize coordinator. Its CSS fallback must not overwrite their managed widths.
|
|
17
|
+
if (sideNavSizing || chatSizing) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
12
20
|
var navMin = 'var(--n_clearanceNavMin, 0px)';
|
|
13
21
|
var navTarget = 'var(--n_clearanceNavTarget, 0px)';
|
|
14
22
|
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)}}
|
|
@@ -15,35 +15,34 @@ import ExitingPersistence from '@atlaskit/motion/exiting-persistence';
|
|
|
15
15
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
16
16
|
import { localPanelWidthVar } from './constants';
|
|
17
17
|
import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context';
|
|
18
|
+
import { LayoutOverlayClearance } from './layout-overlay-clearance';
|
|
19
|
+
import { MainMinWidthContext } from './main-min-width-context';
|
|
18
20
|
import { PanelSplitter } from './panel-splitter/panel-splitter';
|
|
19
21
|
import { PanelSplitterProvider } from './panel-splitter/provider';
|
|
22
|
+
import { usePanelContentEnter } from './use-panel-content-enter';
|
|
20
23
|
var localPanelVar = '--p_lclPnlW';
|
|
21
24
|
var panelSplitterResizingVar = '--p_lclPnlRsz';
|
|
22
25
|
var localPanelSplitterId = Symbol('LocalPanel PanelSplitter');
|
|
23
26
|
|
|
24
27
|
// Compiled preserves the existing container-relative widths and discrete motion styles.
|
|
25
|
-
/* eslint-disable @compiled/shorthand-property-sorting -- Content motion overrides only the animation delay. */
|
|
26
28
|
var styles = {
|
|
27
29
|
panelWrapper: "_nd5l1gzg _kqsw1if8 _bfhk1bhr _vchhusvi _4t3ieqxy _152tidpf _10fph9n0 _1bsb13q4",
|
|
28
|
-
managedInline: "
|
|
30
|
+
managedInline: "_nd5l12pz _bfhkvuon _152tidpf _1bsb1c5w",
|
|
29
31
|
refinedUnmeasured: "_1bsb123g",
|
|
30
|
-
unmeasured: "
|
|
32
|
+
unmeasured: "_nd5l108g _191wbqna _1bsb1cku _bfhk1g1j _16qs1dhr",
|
|
31
33
|
managedOverlay: "_nd5l1gzg _bfhk1bhr _1bsb1c5w",
|
|
32
34
|
panelScrollContainer: "_1reo1wug _18m91wug _4t3i1osq",
|
|
33
35
|
border: "_191wglyw _16qs130s",
|
|
34
36
|
managedInlineBorder: "_191wia51 _16qsglyw",
|
|
35
|
-
entering: "
|
|
36
|
-
motionUnmeasured: "
|
|
37
|
-
|
|
37
|
+
entering: "_k1afx3bs _15et1c5w _105az3zp",
|
|
38
|
+
motionUnmeasured: "_15et3aws",
|
|
39
|
+
refinedMotionUnmeasured: "_15etq93i",
|
|
40
|
+
exiting: "_k1afry0p _1lh81gzg _15et1c5w _105a97o5",
|
|
38
41
|
contentEntering: "_y44v1mph",
|
|
42
|
+
contentEnteringOnOpen: "_k1afi8w4",
|
|
39
43
|
contentExiting: "_y44vf1qi",
|
|
40
44
|
contentChangeContainer: "_4t3i1osq"
|
|
41
45
|
};
|
|
42
|
-
var contentEnteringDelayStyles = {
|
|
43
|
-
root: "_ju25dn4k"
|
|
44
|
-
};
|
|
45
|
-
/* eslint-enable @compiled/shorthand-property-sorting */
|
|
46
|
-
|
|
47
46
|
var PanelContentMotion = function PanelContentMotion(_ref) {
|
|
48
47
|
var children = _ref.children;
|
|
49
48
|
var _useMotion = useMotion(),
|
|
@@ -76,6 +75,7 @@ export function LocalPanelSurface(_ref2) {
|
|
|
76
75
|
onManagedResizeEnd = _ref2.onManagedResizeEnd,
|
|
77
76
|
onWidthChange = _ref2.onWidthChange,
|
|
78
77
|
onResizeEnd = _ref2.onResizeEnd;
|
|
78
|
+
var mainMinWidth = useContext(MainMinWidthContext);
|
|
79
79
|
var ref = useRef(null);
|
|
80
80
|
var dangerouslyHoistSlotSizes = useContext(DangerouslyHoistSlotSizes);
|
|
81
81
|
useLayoutEffect(function () {
|
|
@@ -116,6 +116,7 @@ export function LocalPanelSurface(_ref2) {
|
|
|
116
116
|
var _useMotion2 = useMotion(),
|
|
117
117
|
state = _useMotion2.state,
|
|
118
118
|
motionRef = _useMotion2.ref;
|
|
119
|
+
var shouldAnimateContentEnter = usePanelContentEnter(state);
|
|
119
120
|
var isMotionUpliftEnabled = fg('platform-dst-motion-uplift-panel');
|
|
120
121
|
var isContentMotionEnabled = fg('platform-dst-motion-uplift-panel-content');
|
|
121
122
|
var mergedRef = useMemo(function () {
|
|
@@ -169,8 +170,14 @@ export function LocalPanelSurface(_ref2) {
|
|
|
169
170
|
"data-layout-with-panel-slot": "",
|
|
170
171
|
style: _defineProperty({}, localPanelVar, "".concat(renderedWidth, "px")),
|
|
171
172
|
ref: mergedRef,
|
|
172
|
-
className: ax([
|
|
173
|
-
},
|
|
173
|
+
className: ax([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, isMotionUpliftEnabled && state === 'entering' && styles.entering, isMotionUpliftEnabled && state === 'exiting' && styles.exiting, isMotionUpliftEnabled && (state === 'entering' || state === 'exiting') && !managedSizing && styles.motionUnmeasured, isMotionUpliftEnabled && (state === 'entering' || state === 'exiting') && !managedSizing && fg('platform-dst-chat-panel-layout') && styles.refinedMotionUnmeasured])
|
|
174
|
+
}, !managedSizing && fg('platform-dst-chat-panel-layout') &&
|
|
175
|
+
/*#__PURE__*/
|
|
176
|
+
// Keep sibling allocation stable until the exiting surface actually unmounts.
|
|
177
|
+
React.createElement(LayoutOverlayClearance, {
|
|
178
|
+
panelMinWidth: minWidth,
|
|
179
|
+
mainMinWidth: mainMinWidth
|
|
180
|
+
}), /*#__PURE__*/React.createElement(PanelSplitterProvider, {
|
|
174
181
|
panelId: localPanelSplitterId,
|
|
175
182
|
panelRef: ref,
|
|
176
183
|
resizingElementRef: layoutRef,
|
|
@@ -186,7 +193,7 @@ export function LocalPanelSurface(_ref2) {
|
|
|
186
193
|
}, /*#__PURE__*/React.createElement("div", {
|
|
187
194
|
ref: scrollRef,
|
|
188
195
|
"data-testid": testId && "".concat(testId, "--scroll-container"),
|
|
189
|
-
className: ax([styles.panelScrollContainer, state === 'entering' && styles.contentEntering, isMotionUpliftEnabled &&
|
|
196
|
+
className: ax([styles.panelScrollContainer, !isMotionUpliftEnabled && state === 'entering' && styles.contentEntering, isMotionUpliftEnabled && shouldAnimateContentEnter && styles.contentEnteringOnOpen, state === 'exiting' && styles.contentExiting])
|
|
190
197
|
}, isContentMotionEnabled && contentKey !== undefined ? /*#__PURE__*/React.createElement(ExitingPersistence, {
|
|
191
198
|
exitThenEnter: true
|
|
192
199
|
}, /*#__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)}}
|