@atlaskit/navigation-system 11.3.3 → 11.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/README.md +20 -0
- package/constellation/layout/code.mdx +1 -1
- package/constellation/layout/examples.mdx +4 -16
- package/constellation/layout/images/layout-anatomy-dark.png +0 -0
- package/constellation/layout/images/layout-anatomy-light.png +0 -0
- package/constellation/layout/images/layout-do-dark.png +0 -0
- package/constellation/layout/images/layout-do-light.png +0 -0
- package/constellation/layout/images/layout-dont-dark.png +0 -0
- package/constellation/layout/images/layout-dont-light.png +0 -0
- package/constellation/layout/images/layout-example-dark.png +0 -0
- package/constellation/layout/images/layout-example-light.png +0 -0
- package/constellation/layout/images/layout-example-sideNav-dark.png +0 -0
- package/constellation/layout/images/layout-example-sideNav-light.png +0 -0
- package/constellation/layout/images/layout-example-topNav-1-dark.png +0 -0
- package/constellation/layout/images/layout-example-topNav-1-light.png +0 -0
- package/constellation/layout/usage.mdx +1 -2
- package/constellation/top-nav-items/examples.mdx +7 -13
- package/dist/cjs/entry-points/layout/panel-layout.js +19 -0
- package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +4 -4
- package/dist/cjs/ui/page-layout/chat-panel.js +1 -1
- package/dist/cjs/ui/page-layout/constants.js +15 -1
- package/dist/cjs/ui/page-layout/get-panel-layout-defaults.js +22 -0
- package/dist/cjs/ui/page-layout/layout-area-sizing-provider.js +2 -1
- package/dist/cjs/ui/page-layout/layout-area-sizing-runtime.js +5 -4
- package/dist/cjs/ui/page-layout/local-panel-surface.compiled.css +26 -0
- package/dist/cjs/ui/page-layout/local-panel-surface.js +206 -0
- package/dist/cjs/ui/page-layout/main/main.js +5 -2
- package/dist/cjs/ui/page-layout/main-min-width-context.js +10 -0
- package/dist/cjs/ui/page-layout/panel-layout-shell.compiled.css +27 -0
- package/dist/cjs/ui/page-layout/panel-layout-shell.js +67 -0
- package/dist/cjs/ui/page-layout/panel-layout.js +162 -0
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +12 -5
- package/dist/cjs/ui/page-layout/root.js +3 -1
- package/dist/cjs/ui/page-layout/side-nav/bind-open-layer-change.js +56 -0
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +167 -57
- package/dist/cjs/ui/page-layout/side-nav/toggle-button.js +8 -1
- package/dist/cjs/ui/page-layout/side-nav/use-side-nav-toggle-keyboard-shortcut.js +15 -1
- package/dist/cjs/ui/page-layout/top-nav/top-nav-end.js +3 -2
- package/dist/cjs/ui/page-layout/top-nav/top-nav-middle.js +2 -1
- package/dist/es2019/entry-points/layout/panel-layout.js +2 -0
- package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +4 -4
- package/dist/es2019/ui/page-layout/chat-panel.js +2 -2
- package/dist/es2019/ui/page-layout/constants.js +14 -0
- package/dist/es2019/ui/page-layout/get-panel-layout-defaults.js +16 -0
- package/dist/es2019/ui/page-layout/layout-area-sizing-provider.js +2 -1
- package/dist/es2019/ui/page-layout/layout-area-sizing-runtime.js +4 -3
- package/dist/es2019/ui/page-layout/local-panel-surface.compiled.css +26 -0
- package/dist/es2019/ui/page-layout/local-panel-surface.js +193 -0
- package/dist/es2019/ui/page-layout/main/main.js +6 -3
- package/dist/es2019/ui/page-layout/main-min-width-context.js +5 -0
- package/dist/es2019/ui/page-layout/panel-layout-shell.compiled.css +27 -0
- package/dist/es2019/ui/page-layout/panel-layout-shell.js +74 -0
- package/dist/es2019/ui/page-layout/panel-layout.js +147 -0
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +12 -5
- package/dist/es2019/ui/page-layout/root.js +3 -1
- package/dist/es2019/ui/page-layout/side-nav/bind-open-layer-change.js +51 -0
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +123 -10
- package/dist/es2019/ui/page-layout/side-nav/toggle-button.js +8 -1
- package/dist/es2019/ui/page-layout/side-nav/use-side-nav-toggle-keyboard-shortcut.js +15 -1
- package/dist/es2019/ui/page-layout/top-nav/top-nav-end.js +3 -2
- package/dist/es2019/ui/page-layout/top-nav/top-nav-middle.js +2 -1
- package/dist/esm/entry-points/layout/panel-layout.js +2 -0
- package/dist/esm/ui/page-layout/calculate-layout-area-states.js +4 -4
- package/dist/esm/ui/page-layout/chat-panel.js +2 -2
- package/dist/esm/ui/page-layout/constants.js +14 -0
- package/dist/esm/ui/page-layout/get-panel-layout-defaults.js +16 -0
- package/dist/esm/ui/page-layout/layout-area-sizing-provider.js +2 -1
- package/dist/esm/ui/page-layout/layout-area-sizing-runtime.js +4 -3
- package/dist/esm/ui/page-layout/local-panel-surface.compiled.css +26 -0
- package/dist/esm/ui/page-layout/local-panel-surface.js +197 -0
- package/dist/esm/ui/page-layout/main/main.js +6 -3
- package/dist/esm/ui/page-layout/main-min-width-context.js +5 -0
- package/dist/esm/ui/page-layout/panel-layout-shell.compiled.css +27 -0
- package/dist/esm/ui/page-layout/panel-layout-shell.js +59 -0
- package/dist/esm/ui/page-layout/panel-layout.js +154 -0
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +12 -5
- package/dist/esm/ui/page-layout/root.js +3 -1
- package/dist/esm/ui/page-layout/side-nav/bind-open-layer-change.js +50 -0
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +168 -58
- package/dist/esm/ui/page-layout/side-nav/toggle-button.js +8 -1
- package/dist/esm/ui/page-layout/side-nav/use-side-nav-toggle-keyboard-shortcut.js +15 -1
- package/dist/esm/ui/page-layout/top-nav/top-nav-end.js +3 -2
- package/dist/esm/ui/page-layout/top-nav/top-nav-middle.js +2 -1
- package/dist/types/entry-points/layout/panel-layout.d.ts +3 -0
- package/dist/types/ui/page-layout/constants.d.ts +12 -0
- package/dist/types/ui/page-layout/get-panel-layout-defaults.d.ts +10 -0
- package/dist/types/ui/page-layout/layout-area-sizing-context.d.ts +5 -1
- package/dist/types/ui/page-layout/local-panel-surface.d.ts +32 -0
- package/dist/types/ui/page-layout/main-min-width-context.d.ts +2 -0
- package/dist/types/ui/page-layout/panel-layout-shell.d.ts +47 -0
- package/dist/types/ui/page-layout/panel-layout.d.ts +74 -0
- package/dist/types/ui/page-layout/side-nav/bind-open-layer-change.d.ts +17 -0
- package/layout/panel-layout/package.json +10 -0
- package/package.json +6 -6
- package/constellation/layout/images/layout-example-topNav-2-dark.png +0 -0
- package/constellation/layout/images/layout-example-topNav-2-light.png +0 -0
|
@@ -23,6 +23,7 @@ var _openLayerObserverNamespaceProvider = require("@atlaskit/layering/open-layer
|
|
|
23
23
|
var _useOpenLayerObserver = require("@atlaskit/layering/use-open-layer-observer");
|
|
24
24
|
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
25
25
|
var _elementAdapter = require("@atlaskit/pragmatic-drag-and-drop/adapter/element-adapter");
|
|
26
|
+
var _hasOpenDialogOrPopover = require("@atlaskit/top-layer/page-surface/has-open-dialog-or-popover");
|
|
26
27
|
var _useSkipLinkInternal = require("../../../context/skip-links/use-skip-link-internal");
|
|
27
28
|
var _topNavStartElement = require("../../../context/top-nav-start/top-nav-start-element");
|
|
28
29
|
var _constants = require("../constants");
|
|
@@ -36,6 +37,7 @@ var _useLayoutAreaSizing2 = require("../use-layout-area-sizing");
|
|
|
36
37
|
var _useLayoutId = require("../use-layout-id");
|
|
37
38
|
var _useResizingWidthCssVarOnRootElement = require("../use-resizing-width-css-var-on-root-element");
|
|
38
39
|
var _useSafeDefaultWidth = require("../use-safe-default-width");
|
|
40
|
+
var _bindOpenLayerChange = require("./bind-open-layer-change");
|
|
39
41
|
var _flyoutCloseDelayMs = require("./flyout-close-delay-ms");
|
|
40
42
|
var _setSideNavVisibilityState = require("./set-side-nav-visibility-state");
|
|
41
43
|
var _sideNavToggleButtonElement = require("./side-nav-toggle-button-element");
|
|
@@ -65,6 +67,51 @@ function getPixelCustomProperty(element, propertyName, fallback) {
|
|
|
65
67
|
* Avoiding nesting the `@supports` at-rule inside of `@media` means Compiled can remove duplicate styles from the generated CSS.
|
|
66
68
|
*/
|
|
67
69
|
var isFirefox = typeof navigator !== 'undefined' && navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
|
70
|
+
var textEntryInputTypes = new Set(['text', 'search', 'email', 'url', 'tel', 'password', 'number']);
|
|
71
|
+
function isEditableContent(_ref) {
|
|
72
|
+
var element = _ref.element;
|
|
73
|
+
if (element instanceof HTMLElement && typeof element.isContentEditable === 'boolean') {
|
|
74
|
+
return element.isContentEditable;
|
|
75
|
+
}
|
|
76
|
+
// Fallback for DOM implementations without `isContentEditable`.
|
|
77
|
+
var editingHost = element.closest('[contenteditable]');
|
|
78
|
+
return editingHost !== null && editingHost.getAttribute('contenteditable') !== 'false';
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Returns `true` for an element that the user can type text into.
|
|
83
|
+
*/
|
|
84
|
+
function isTextEntryElement(_ref2) {
|
|
85
|
+
var element = _ref2.element;
|
|
86
|
+
if (element instanceof HTMLInputElement) {
|
|
87
|
+
return textEntryInputTypes.has(element.type) && !element.readOnly && !element.disabled;
|
|
88
|
+
}
|
|
89
|
+
if (element instanceof HTMLTextAreaElement) {
|
|
90
|
+
return !element.readOnly && !element.disabled;
|
|
91
|
+
}
|
|
92
|
+
return isEditableContent({
|
|
93
|
+
element: element
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Used when the `platform-dst-top-layer` gate is on.
|
|
99
|
+
*
|
|
100
|
+
* The flyout stays open while a layer opened from the side nav is open, or while the user
|
|
101
|
+
* is typing in a text field inside the side nav (for example while renaming an item inline).
|
|
102
|
+
*/
|
|
103
|
+
function isFlyoutHeldOpen(_ref3) {
|
|
104
|
+
var nav = _ref3.nav;
|
|
105
|
+
if ((0, _hasOpenDialogOrPopover.hasOpenDialogOrPopover)({
|
|
106
|
+
within: nav
|
|
107
|
+
})) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
var activeElement = nav.ownerDocument.activeElement;
|
|
111
|
+
return activeElement !== null && nav.contains(activeElement) && isTextEntryElement({
|
|
112
|
+
element: activeElement
|
|
113
|
+
});
|
|
114
|
+
}
|
|
68
115
|
var styles = {
|
|
69
116
|
root: "_191wglyw _t51zglyw _bfhk1bhr _16qs130s _vchhusvi _4t3ieqxy _152timx3 _kqsw1if8 _1bsb1ego _1pbycs5v _14b5hc79 _qilnk0mc _p5clia51 _4ap3vuon _scbpglyw _89fi1b6c",
|
|
70
117
|
chatPanelSizing: "_1bsbhc79",
|
|
@@ -106,26 +153,26 @@ var onPeekStartDelayMs = exports.onPeekStartDelayMs = 500;
|
|
|
106
153
|
* We need an additional component layer so we can wrap the side nav in a `OpenLayerObserver` and have access to the
|
|
107
154
|
* context value.
|
|
108
155
|
*/
|
|
109
|
-
function SideNavInternal(
|
|
156
|
+
function SideNavInternal(_ref4) {
|
|
110
157
|
var _managedSizing$mode, _managedSizing$width, _sideNavState$lastTri;
|
|
111
|
-
var children =
|
|
112
|
-
defaultCollapsed =
|
|
113
|
-
|
|
114
|
-
defaultWidthProp =
|
|
115
|
-
|
|
116
|
-
minWidth =
|
|
117
|
-
maxWidth =
|
|
118
|
-
testId =
|
|
119
|
-
|
|
120
|
-
label =
|
|
121
|
-
|
|
122
|
-
skipLinkLabel =
|
|
123
|
-
onExpand =
|
|
124
|
-
onCollapse =
|
|
125
|
-
onPeekStart =
|
|
126
|
-
onPeekEnd =
|
|
127
|
-
providedId =
|
|
128
|
-
canToggleWithShortcut =
|
|
158
|
+
var children = _ref4.children,
|
|
159
|
+
defaultCollapsed = _ref4.defaultCollapsed,
|
|
160
|
+
_ref4$defaultWidth = _ref4.defaultWidth,
|
|
161
|
+
defaultWidthProp = _ref4$defaultWidth === void 0 ? fallbackDefaultWidth : _ref4$defaultWidth,
|
|
162
|
+
_ref4$minWidth = _ref4.minWidth,
|
|
163
|
+
minWidth = _ref4$minWidth === void 0 ? fallbackMinWidth : _ref4$minWidth,
|
|
164
|
+
maxWidth = _ref4.maxWidth,
|
|
165
|
+
testId = _ref4.testId,
|
|
166
|
+
_ref4$label = _ref4.label,
|
|
167
|
+
label = _ref4$label === void 0 ? 'Sidebar' : _ref4$label,
|
|
168
|
+
_ref4$skipLinkLabel = _ref4.skipLinkLabel,
|
|
169
|
+
skipLinkLabel = _ref4$skipLinkLabel === void 0 ? label : _ref4$skipLinkLabel,
|
|
170
|
+
onExpand = _ref4.onExpand,
|
|
171
|
+
onCollapse = _ref4.onCollapse,
|
|
172
|
+
onPeekStart = _ref4.onPeekStart,
|
|
173
|
+
onPeekEnd = _ref4.onPeekEnd,
|
|
174
|
+
providedId = _ref4.id,
|
|
175
|
+
canToggleWithShortcut = _ref4.canToggleWithShortcut;
|
|
129
176
|
var isChatPanelLayoutEnabled = (0, _fg.fg)('platform-dst-chat-panel-layout');
|
|
130
177
|
var id = (0, _useLayoutId.useLayoutId)({
|
|
131
178
|
providedId: providedId
|
|
@@ -315,7 +362,7 @@ function SideNavInternal(_ref) {
|
|
|
315
362
|
var isLocalPanelInline = localPanel && getComputedStyle(localPanel).gridArea === 'panel';
|
|
316
363
|
var localPanelWidth = isLocalPanelInline ? localPanel.getBoundingClientRect().width : 0;
|
|
317
364
|
var mainContentWidth = mainWidth - localPanelWidth;
|
|
318
|
-
var mainMinimumWidth = getPixelCustomProperty(main, _constants.mainMinimumWidthVar,
|
|
365
|
+
var mainMinimumWidth = getPixelCustomProperty(main, _constants.mainMinimumWidthVar, _constants.defaultMainMinWidth);
|
|
319
366
|
var availableWidth = Math.max(0, mainContentWidth - mainMinimumWidth);
|
|
320
367
|
var availableInlineWidth = Math.floor(sideNavWidth + availableWidth);
|
|
321
368
|
var constrainedMaxWidth = maxWidth ? Math.min((0, _convertResizeBoundToPixels.convertResizeBoundToPixels)(maxWidth), availableInlineWidth) : availableInlineWidth;
|
|
@@ -351,7 +398,9 @@ function SideNavInternal(_ref) {
|
|
|
351
398
|
var toggleButtonElement = (0, _react.useContext)(_sideNavToggleButtonElement.SideNavToggleButtonElement);
|
|
352
399
|
var topNavStartElement = (0, _react.useContext)(_topNavStartElement.TopNavStartElement);
|
|
353
400
|
var devTimeOnlyAttributes = {};
|
|
354
|
-
var openLayerObserver = (0, _useOpenLayerObserver.useOpenLayerObserver)(
|
|
401
|
+
var openLayerObserver = (0, _useOpenLayerObserver.useOpenLayerObserver)({
|
|
402
|
+
isEnabled: !(0, _fg.fg)('platform-dst-top-layer')
|
|
403
|
+
});
|
|
355
404
|
var flyoutStateRef = (0, _react.useRef)({
|
|
356
405
|
type: 'not-active'
|
|
357
406
|
});
|
|
@@ -429,6 +478,17 @@ function SideNavInternal(_ref) {
|
|
|
429
478
|
});
|
|
430
479
|
}
|
|
431
480
|
}
|
|
481
|
+
function canClose() {
|
|
482
|
+
if (!(0, _fg.fg)('platform-dst-top-layer')) {
|
|
483
|
+
return (openLayerObserver === null || openLayerObserver === void 0 ? void 0 : openLayerObserver.getCount({
|
|
484
|
+
namespace: _constants.openLayerObserverSideNavNamespace
|
|
485
|
+
})) === 0;
|
|
486
|
+
}
|
|
487
|
+
var nav = navRef.current;
|
|
488
|
+
return !(nav && isFlyoutHeldOpen({
|
|
489
|
+
nav: nav
|
|
490
|
+
}));
|
|
491
|
+
}
|
|
432
492
|
return function onAction(action) {
|
|
433
493
|
if (action === 'drag-from-flyout-started') {
|
|
434
494
|
open();
|
|
@@ -470,9 +530,7 @@ function SideNavInternal(_ref) {
|
|
|
470
530
|
}
|
|
471
531
|
if (action === 'ready-to-close') {
|
|
472
532
|
// If there are no open layers, we can close the flyout.
|
|
473
|
-
if ((
|
|
474
|
-
namespace: _constants.openLayerObserverSideNavNamespace
|
|
475
|
-
})) === 0) {
|
|
533
|
+
if (canClose()) {
|
|
476
534
|
close();
|
|
477
535
|
return;
|
|
478
536
|
}
|
|
@@ -513,9 +571,9 @@ function SideNavInternal(_ref) {
|
|
|
513
571
|
});
|
|
514
572
|
});
|
|
515
573
|
}, [initialDefaultCollapsed, setSideNavState, sideNavState]);
|
|
516
|
-
var handleExpand = (0, _react.useCallback)(function (
|
|
517
|
-
var screen =
|
|
518
|
-
trigger =
|
|
574
|
+
var handleExpand = (0, _react.useCallback)(function (_ref5) {
|
|
575
|
+
var screen = _ref5.screen,
|
|
576
|
+
trigger = _ref5.trigger;
|
|
519
577
|
onExpand === null || onExpand === void 0 || onExpand({
|
|
520
578
|
screen: screen,
|
|
521
579
|
trigger: trigger
|
|
@@ -535,9 +593,9 @@ function SideNavInternal(_ref) {
|
|
|
535
593
|
// This prevents the flyout from staying open and ensures we are respecting the user's intent to expand.
|
|
536
594
|
updateFlyoutState('force-close');
|
|
537
595
|
}, [onExpand, updateFlyoutState, createAnalyticsEvent]);
|
|
538
|
-
var handleCollapse = (0, _react.useCallback)(function (
|
|
539
|
-
var screen =
|
|
540
|
-
trigger =
|
|
596
|
+
var handleCollapse = (0, _react.useCallback)(function (_ref6) {
|
|
597
|
+
var screen = _ref6.screen,
|
|
598
|
+
trigger = _ref6.trigger;
|
|
541
599
|
onCollapse === null || onCollapse === void 0 || onCollapse({
|
|
542
600
|
screen: screen,
|
|
543
601
|
trigger: trigger
|
|
@@ -730,15 +788,15 @@ function SideNavInternal(_ref) {
|
|
|
730
788
|
// we are just interested in listening to events within an element
|
|
731
789
|
// - We do not want to impact `location.{*}.dropTargets` in events
|
|
732
790
|
return (0, _elementAdapter.monitorForElements)({
|
|
733
|
-
canMonitor: function canMonitor(
|
|
734
|
-
var source =
|
|
791
|
+
canMonitor: function canMonitor(_ref7) {
|
|
792
|
+
var source = _ref7.source;
|
|
735
793
|
return nav.contains(source.element);
|
|
736
794
|
},
|
|
737
795
|
onGenerateDragPreview: function onGenerateDragPreview() {
|
|
738
796
|
updateFlyoutState('drag-from-flyout-started');
|
|
739
797
|
},
|
|
740
|
-
onDrop: function onDrop(
|
|
741
|
-
var location =
|
|
798
|
+
onDrop: function onDrop(_ref8) {
|
|
799
|
+
var location = _ref8.location;
|
|
742
800
|
// Always marking the drag and done
|
|
743
801
|
updateFlyoutState('drag-from-flyout-finished');
|
|
744
802
|
|
|
@@ -799,8 +857,8 @@ function SideNavInternal(_ref) {
|
|
|
799
857
|
// Close the flyout if there are no more layers open and the user is not mousing over the
|
|
800
858
|
// flyout areas (side nav, TopNavStart element)
|
|
801
859
|
|
|
802
|
-
return openLayerObserver === null || openLayerObserver === void 0 ? void 0 : openLayerObserver.onChange(function (
|
|
803
|
-
var count =
|
|
860
|
+
return openLayerObserver === null || openLayerObserver === void 0 ? void 0 : openLayerObserver.onChange(function (_ref9) {
|
|
861
|
+
var count = _ref9.count;
|
|
804
862
|
if (flyoutStateRef.current.type === 'ready-to-close' && count === 0) {
|
|
805
863
|
updateFlyoutState('force-close');
|
|
806
864
|
}
|
|
@@ -808,6 +866,52 @@ function SideNavInternal(_ref) {
|
|
|
808
866
|
namespace: _constants.openLayerObserverSideNavNamespace
|
|
809
867
|
});
|
|
810
868
|
}, [openLayerObserver, updateFlyoutState]);
|
|
869
|
+
var focusOutTimeoutIdRef = (0, _react.useRef)(undefined);
|
|
870
|
+
(0, _react.useEffect)(function () {
|
|
871
|
+
// The same as the open layer observer `onChange` above, for when the `platform-dst-top-layer`
|
|
872
|
+
// gate is on. Top-layer surfaces opened from the side nav are DOM descendants of it.
|
|
873
|
+
var nav = navRef.current;
|
|
874
|
+
if (!nav || !(0, _fg.fg)('platform-dst-top-layer')) {
|
|
875
|
+
return;
|
|
876
|
+
}
|
|
877
|
+
function closeIfReady() {
|
|
878
|
+
if (flyoutStateRef.current.type !== 'ready-to-close' || !nav) {
|
|
879
|
+
return;
|
|
880
|
+
}
|
|
881
|
+
if (isFlyoutHeldOpen({
|
|
882
|
+
nav: nav
|
|
883
|
+
})) {
|
|
884
|
+
return;
|
|
885
|
+
}
|
|
886
|
+
updateFlyoutState('force-close');
|
|
887
|
+
}
|
|
888
|
+
var unbindLayerChange = (0, _bindOpenLayerChange.bindOpenLayerChange)({
|
|
889
|
+
within: nav,
|
|
890
|
+
onChange: closeIfReady
|
|
891
|
+
});
|
|
892
|
+
var unbindFocusOut = (0, _bindEventListener.bind)(nav, {
|
|
893
|
+
type: 'focusout',
|
|
894
|
+
listener: function listener() {
|
|
895
|
+
// Wait for focus to move before checking where it went.
|
|
896
|
+
clearTimeout(focusOutTimeoutIdRef.current);
|
|
897
|
+
focusOutTimeoutIdRef.current = setTimeout(closeIfReady, 0);
|
|
898
|
+
}
|
|
899
|
+
});
|
|
900
|
+
|
|
901
|
+
// Removing the focused text field (for example when an inline rename ends) fires no
|
|
902
|
+
// `focusout` in some browsers, so also check again when content inside the side nav changes.
|
|
903
|
+
var removalObserver = new MutationObserver(closeIfReady);
|
|
904
|
+
removalObserver.observe(nav, {
|
|
905
|
+
childList: true,
|
|
906
|
+
subtree: true
|
|
907
|
+
});
|
|
908
|
+
return function cleanup() {
|
|
909
|
+
unbindLayerChange();
|
|
910
|
+
unbindFocusOut();
|
|
911
|
+
removalObserver.disconnect();
|
|
912
|
+
clearTimeout(focusOutTimeoutIdRef.current);
|
|
913
|
+
};
|
|
914
|
+
}, [updateFlyoutState]);
|
|
811
915
|
(0, _react.useEffect)(function () {
|
|
812
916
|
// Clear flyout close timer if being unmounted
|
|
813
917
|
return function cleanupPendingFlyoutClose() {
|
|
@@ -944,26 +1048,24 @@ function SideNavInternal(_ref) {
|
|
|
944
1048
|
*
|
|
945
1049
|
* You can optionally render a `PanelSplitter` as a child to make the side navigation slot resizable.
|
|
946
1050
|
*/
|
|
947
|
-
function SideNav(
|
|
948
|
-
var children =
|
|
949
|
-
defaultCollapsed =
|
|
950
|
-
|
|
951
|
-
defaultWidth =
|
|
952
|
-
minWidth =
|
|
953
|
-
maxWidth =
|
|
954
|
-
testId =
|
|
955
|
-
label =
|
|
956
|
-
|
|
957
|
-
skipLinkLabel =
|
|
958
|
-
onExpand =
|
|
959
|
-
onCollapse =
|
|
960
|
-
onPeekStart =
|
|
961
|
-
onPeekEnd =
|
|
962
|
-
canToggleWithShortcut =
|
|
963
|
-
id =
|
|
964
|
-
|
|
965
|
-
namespace: _constants.openLayerObserverSideNavNamespace
|
|
966
|
-
}, /*#__PURE__*/_react.default.createElement(SideNavInternal, {
|
|
1051
|
+
function SideNav(_ref1) {
|
|
1052
|
+
var children = _ref1.children,
|
|
1053
|
+
defaultCollapsed = _ref1.defaultCollapsed,
|
|
1054
|
+
_ref1$defaultWidth = _ref1.defaultWidth,
|
|
1055
|
+
defaultWidth = _ref1$defaultWidth === void 0 ? 320 : _ref1$defaultWidth,
|
|
1056
|
+
minWidth = _ref1.minWidth,
|
|
1057
|
+
maxWidth = _ref1.maxWidth,
|
|
1058
|
+
testId = _ref1.testId,
|
|
1059
|
+
label = _ref1.label,
|
|
1060
|
+
_ref1$skipLinkLabel = _ref1.skipLinkLabel,
|
|
1061
|
+
skipLinkLabel = _ref1$skipLinkLabel === void 0 ? label : _ref1$skipLinkLabel,
|
|
1062
|
+
onExpand = _ref1.onExpand,
|
|
1063
|
+
onCollapse = _ref1.onCollapse,
|
|
1064
|
+
onPeekStart = _ref1.onPeekStart,
|
|
1065
|
+
onPeekEnd = _ref1.onPeekEnd,
|
|
1066
|
+
canToggleWithShortcut = _ref1.canToggleWithShortcut,
|
|
1067
|
+
id = _ref1.id;
|
|
1068
|
+
var sideNav = /*#__PURE__*/_react.default.createElement(SideNavInternal, {
|
|
967
1069
|
defaultCollapsed: defaultCollapsed,
|
|
968
1070
|
defaultWidth: defaultWidth,
|
|
969
1071
|
minWidth: minWidth,
|
|
@@ -977,5 +1079,13 @@ function SideNav(_ref8) {
|
|
|
977
1079
|
onPeekEnd: onPeekEnd,
|
|
978
1080
|
id: id,
|
|
979
1081
|
canToggleWithShortcut: canToggleWithShortcut
|
|
980
|
-
}, children)
|
|
1082
|
+
}, children);
|
|
1083
|
+
|
|
1084
|
+
// Top-layer surfaces are found through the DOM, so the namespace is only needed when the gate is off.
|
|
1085
|
+
if ((0, _fg.fg)('platform-dst-top-layer')) {
|
|
1086
|
+
return sideNav;
|
|
1087
|
+
}
|
|
1088
|
+
return /*#__PURE__*/_react.default.createElement(_openLayerObserverNamespaceProvider.OpenLayerObserverNamespaceProvider, {
|
|
1089
|
+
namespace: _constants.openLayerObserverSideNavNamespace
|
|
1090
|
+
}, sideNav);
|
|
981
1091
|
}
|
|
@@ -17,6 +17,8 @@ var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents"
|
|
|
17
17
|
var _sidebarCollapse = _interopRequireDefault(require("@atlaskit/icon/core/sidebar-collapse"));
|
|
18
18
|
var _sidebarExpand = _interopRequireDefault(require("@atlaskit/icon/core/sidebar-expand"));
|
|
19
19
|
var _useOpenLayerObserver = require("@atlaskit/layering/use-open-layer-observer");
|
|
20
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
21
|
+
var _requestClosePopovers = require("@atlaskit/top-layer/page-surface/request-close-popovers");
|
|
20
22
|
var _iconButton = require("../../top-nav-items/themed/icon-button");
|
|
21
23
|
var _sideNavToggleButtonAttachRef = require("./side-nav-toggle-button-attach-ref");
|
|
22
24
|
var _sideNavToggleTooltipKeyboardShortcut = require("./side-nav-toggle-tooltip-keyboard-shortcut");
|
|
@@ -102,12 +104,17 @@ var SideNavToggleButton = exports.SideNavToggleButton = function SideNavToggleBu
|
|
|
102
104
|
});
|
|
103
105
|
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
104
106
|
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
105
|
-
var openLayerObserver = (0, _useOpenLayerObserver.useOpenLayerObserver)(
|
|
107
|
+
var openLayerObserver = (0, _useOpenLayerObserver.useOpenLayerObserver)({
|
|
108
|
+
isEnabled: !(0, _fg.fg)('platform-dst-top-layer')
|
|
109
|
+
});
|
|
106
110
|
var handleClick = (0, _react.useCallback)(function (event, analyticsEvent) {
|
|
107
111
|
onClick === null || onClick === void 0 || onClick(event, analyticsEvent, {
|
|
108
112
|
isSideNavVisible: isSideNavExpanded
|
|
109
113
|
});
|
|
110
114
|
toggleVisibility();
|
|
115
|
+
|
|
116
|
+
// Not gated. Top-layer tooltips (`platform-dst-top-layer-tooltip`) are not known to the observer.
|
|
117
|
+
(0, _requestClosePopovers.requestClosePopovers)();
|
|
111
118
|
openLayerObserver === null || openLayerObserver === void 0 || openLayerObserver.closeLayers();
|
|
112
119
|
}, [isSideNavExpanded, onClick, openLayerObserver, toggleVisibility]);
|
|
113
120
|
var handlePointerEnter = (0, _react.useCallback)(function () {
|
|
@@ -9,6 +9,9 @@ var _react = require("react");
|
|
|
9
9
|
var _bindEventListener = require("bind-event-listener");
|
|
10
10
|
var _useStableRef = _interopRequireDefault(require("@atlaskit/ds-lib/use-stable-ref"));
|
|
11
11
|
var _useOpenLayerObserver = require("@atlaskit/layering/use-open-layer-observer");
|
|
12
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
|
+
var _hasOpenDialogOrPopover = require("@atlaskit/top-layer/page-surface/has-open-dialog-or-popover");
|
|
14
|
+
var _requestClosePopovers = require("@atlaskit/top-layer/page-surface/request-close-popovers");
|
|
12
15
|
var _useIsSideNavShortcutEnabled = require("./use-is-side-nav-shortcut-enabled");
|
|
13
16
|
var _useToggleSideNav = require("./use-toggle-side-nav");
|
|
14
17
|
/**
|
|
@@ -16,7 +19,9 @@ var _useToggleSideNav = require("./use-toggle-side-nav");
|
|
|
16
19
|
*/
|
|
17
20
|
function useSideNavToggleKeyboardShortcut(_ref) {
|
|
18
21
|
var canToggleWithShortcut = _ref.canToggleWithShortcut;
|
|
19
|
-
var openLayerObserver = (0, _useOpenLayerObserver.useOpenLayerObserver)(
|
|
22
|
+
var openLayerObserver = (0, _useOpenLayerObserver.useOpenLayerObserver)({
|
|
23
|
+
isEnabled: !(0, _fg.fg)('platform-dst-top-layer')
|
|
24
|
+
});
|
|
20
25
|
var toggleVisibilityByShortcut = (0, _useToggleSideNav.useToggleSideNav)({
|
|
21
26
|
trigger: 'keyboard'
|
|
22
27
|
});
|
|
@@ -39,12 +44,21 @@ function useSideNavToggleKeyboardShortcut(_ref) {
|
|
|
39
44
|
// Ignore repeated keydown events from holding down the keys
|
|
40
45
|
return;
|
|
41
46
|
}
|
|
47
|
+
if ((0, _fg.fg)('platform-dst-top-layer') && (0, _hasOpenDialogOrPopover.hasOpenDialogOrPopover)({
|
|
48
|
+
type: 'modal'
|
|
49
|
+
})) {
|
|
50
|
+
// Return early if there are any open modal dialogs
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
42
53
|
if (openLayerObserver && openLayerObserver.getCount({
|
|
43
54
|
type: 'modal'
|
|
44
55
|
}) > 0) {
|
|
45
56
|
// Return early if there are any open modals
|
|
46
57
|
return;
|
|
47
58
|
}
|
|
59
|
+
|
|
60
|
+
// Not gated. Top-layer tooltips (`platform-dst-top-layer-tooltip`) are not known to the observer.
|
|
61
|
+
(0, _requestClosePopovers.requestClosePopovers)();
|
|
48
62
|
openLayerObserver === null || openLayerObserver === void 0 || openLayerObserver.closeLayers();
|
|
49
63
|
toggleVisibilityByShortcut();
|
|
50
64
|
}
|
|
@@ -75,7 +75,8 @@ function TopNavEnd(_ref) {
|
|
|
75
75
|
|
|
76
76
|
// The shared provider also covers the mobile overflow popup itself. Keep the
|
|
77
77
|
// previous content-only namespace coverage when the layout gate is disabled.
|
|
78
|
-
|
|
78
|
+
// The observer is not used when the top-layer gate is on, so no provider is needed.
|
|
79
|
+
var actions = (0, _fg.fg)('platform-dst-chat-panel-layout') || (0, _fg.fg)('platform-dst-top-layer') ? children : /*#__PURE__*/_react.default.createElement(_openLayerObserverNamespaceProvider.OpenLayerObserverNamespaceProvider, {
|
|
79
80
|
namespace: _constants.openLayerObserverTopNavEndNamespace
|
|
80
81
|
}, children);
|
|
81
82
|
var content = /*#__PURE__*/_react.default.createElement("nav", {
|
|
@@ -113,7 +114,7 @@ function TopNavEnd(_ref) {
|
|
|
113
114
|
}) : /*#__PURE__*/_react.default.createElement(_list.List, {
|
|
114
115
|
xcss: (0, _react2.cx)(listStyles.root, listStyles.hideOnSmallViewport)
|
|
115
116
|
}, actions), hasPersistentItems && persistentItems);
|
|
116
|
-
return (0, _fg.fg)('platform-dst-chat-panel-layout') ? /*#__PURE__*/_react.default.createElement(_openLayerObserverNamespaceProvider.OpenLayerObserverNamespaceProvider, {
|
|
117
|
+
return (0, _fg.fg)('platform-dst-chat-panel-layout') && !(0, _fg.fg)('platform-dst-top-layer') ? /*#__PURE__*/_react.default.createElement(_openLayerObserverNamespaceProvider.OpenLayerObserverNamespaceProvider, {
|
|
117
118
|
namespace: _constants.openLayerObserverTopNavEndNamespace
|
|
118
119
|
}, content) : content;
|
|
119
120
|
}
|
|
@@ -10,6 +10,7 @@ require("./top-nav-middle.compiled.css");
|
|
|
10
10
|
var _runtime = require("@compiled/react/runtime");
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _openLayerObserverNamespaceProvider = require("@atlaskit/layering/open-layer-observer-namespace-provider");
|
|
13
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
13
14
|
var _constants = require("../constants");
|
|
14
15
|
var styles = {
|
|
15
16
|
root: "_zulpu2gc _yyhycs5v _1bsb1osq _4cvr1h6o _1e0c1txw _1bahh9n0 _181n11p5 _1j8b15b0 _lagd1bp4 _1t4c1ris _12e8h9n0"
|
|
@@ -27,7 +28,7 @@ function TopNavMiddle(_ref) {
|
|
|
27
28
|
var children = _ref.children;
|
|
28
29
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
30
|
className: (0, _runtime.ax)([styles.root])
|
|
30
|
-
}, /*#__PURE__*/_react.default.createElement(_openLayerObserverNamespaceProvider.OpenLayerObserverNamespaceProvider, {
|
|
31
|
+
}, (0, _fg.fg)('platform-dst-top-layer') ? children : /*#__PURE__*/_react.default.createElement(_openLayerObserverNamespaceProvider.OpenLayerObserverNamespaceProvider, {
|
|
31
32
|
namespace: _constants.openLayerObserverTopNavMiddleNamespace
|
|
32
33
|
}, children));
|
|
33
34
|
}
|
|
@@ -9,12 +9,12 @@ function clampTargetWidth({
|
|
|
9
9
|
function getTargetWidth(area, isSideNavOverlay) {
|
|
10
10
|
var _area$compactDefaultW, _area$liveResize, _ref, _area$requestedWidth;
|
|
11
11
|
const defaultWidth = isSideNavOverlay ? (_area$compactDefaultW = area.compactDefaultWidth) !== null && _area$compactDefaultW !== void 0 ? _area$compactDefaultW : area.defaultWidth : area.defaultWidth;
|
|
12
|
-
return ((_area$liveResize = area.liveResize) === null || _area$liveResize === void 0 ? void 0 : _area$liveResize.mode) === 'inline' ? area.liveResize.width : (_ref = (_area$requestedWidth = area.requestedWidth) !== null && _area$requestedWidth !== void 0 ? _area$requestedWidth : area.
|
|
12
|
+
return ((_area$liveResize = area.liveResize) === null || _area$liveResize === void 0 ? void 0 : _area$liveResize.mode) === 'inline' ? area.liveResize.width : (_ref = (_area$requestedWidth = area.requestedWidth) !== null && _area$requestedWidth !== void 0 ? _area$requestedWidth : area.preferredWidth) !== null && _ref !== void 0 ? _ref : defaultWidth;
|
|
13
13
|
}
|
|
14
|
-
function getOverlayTargetWidth(area, isSideNavOverlay) {
|
|
14
|
+
function getOverlayTargetWidth(area, isSideNavOverlay, areaName) {
|
|
15
15
|
var _area$compactDefaultW2, _area$liveResize2, _ref2, _area$requestedWidth2;
|
|
16
16
|
const defaultWidth = isSideNavOverlay ? (_area$compactDefaultW2 = area.compactDefaultWidth) !== null && _area$compactDefaultW2 !== void 0 ? _area$compactDefaultW2 : area.defaultWidth : area.defaultWidth;
|
|
17
|
-
return ((_area$liveResize2 = area.liveResize) === null || _area$liveResize2 === void 0 ? void 0 : _area$liveResize2.mode) === 'overlay' ? area.liveResize.width : (_ref2 = (_area$requestedWidth2 = area.requestedWidth) !== null && _area$requestedWidth2 !== void 0 ? _area$requestedWidth2 : area.preferredOverlayWidth) !== null && _ref2 !== void 0 ? _ref2 : defaultWidth;
|
|
17
|
+
return ((_area$liveResize2 = area.liveResize) === null || _area$liveResize2 === void 0 ? void 0 : _area$liveResize2.mode) === 'overlay' ? area.liveResize.width : (_ref2 = (_area$requestedWidth2 = area.requestedWidth) !== null && _area$requestedWidth2 !== void 0 ? _area$requestedWidth2 : areaName === 'panel' ? area.preferredWidth : area.preferredOverlayWidth) !== null && _ref2 !== void 0 ? _ref2 : defaultWidth;
|
|
18
18
|
}
|
|
19
19
|
export function calculateLayoutAreaStates({
|
|
20
20
|
viewportWidth,
|
|
@@ -142,7 +142,7 @@ export function calculateLayoutAreaStates({
|
|
|
142
142
|
const layoutMax = (areaName === 'chat-panel' ? layoutWidth : mainAreaWidth) * 0.9;
|
|
143
143
|
const max = Math.max(0, Math.min(configuredMax, layoutMax));
|
|
144
144
|
const effectiveMin = Math.min(min, max);
|
|
145
|
-
const target = getOverlayTargetWidth(area, isSideNavOverlay);
|
|
145
|
+
const target = getOverlayTargetWidth(area, isSideNavOverlay, areaName);
|
|
146
146
|
const width = clampTargetWidth({
|
|
147
147
|
target,
|
|
148
148
|
min: effectiveMin,
|
|
@@ -6,7 +6,7 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
6
6
|
import { bind } from 'bind-event-listener';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
8
8
|
import { useSkipLinkInternal } from '../../context/skip-links/use-skip-link-internal';
|
|
9
|
-
import { chatPanelLiveWidthVar, chatPanelVar, localSlotLayers, mainMinimumWidthVar } from './constants';
|
|
9
|
+
import { chatPanelLiveWidthVar, chatPanelVar, defaultMainMinWidth, localSlotLayers, mainMinimumWidthVar } from './constants';
|
|
10
10
|
import { convertResizeBoundToPixels } from './panel-splitter/convert-resize-bound-to-pixels';
|
|
11
11
|
import { PanelSplitterProvider } from './panel-splitter/provider';
|
|
12
12
|
import { resolveLayoutWidth } from './resolve-layout-width';
|
|
@@ -139,7 +139,7 @@ export function ChatPanel({
|
|
|
139
139
|
const localPanel = main.querySelector('[data-layout-with-panel-slot]');
|
|
140
140
|
const isLocalPanelInline = localPanel && getComputedStyle(localPanel).gridArea === 'panel';
|
|
141
141
|
const localPanelWidth = isLocalPanelInline ? localPanel.getBoundingClientRect().width : 0;
|
|
142
|
-
const mainMinimumWidth = getPixelCustomProperty(main, mainMinimumWidthVar,
|
|
142
|
+
const mainMinimumWidth = getPixelCustomProperty(main, mainMinimumWidthVar, defaultMainMinWidth);
|
|
143
143
|
const mainContentWidth = mainWidth - localPanelWidth;
|
|
144
144
|
const availableWidth = Math.max(0, mainContentWidth - mainMinimumWidth);
|
|
145
145
|
const availableInlineWidth = Math.floor(chatPanelWidth + availableWidth);
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* We have chosen to ignore this rule to prevent duplicating them across the different slots, and to provide a high level view of them and how they relate.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Default minimum width of Main, in pixels, before a custom minimum is registered.
|
|
9
|
+
*/
|
|
10
|
+
export const defaultMainMinWidth = 320;
|
|
11
|
+
|
|
7
12
|
// These are "compressed" to discourage usage.
|
|
8
13
|
export const sideNavVar = '--n_sNvw';
|
|
9
14
|
export const asideVar = '--n_asDw';
|
|
@@ -15,6 +20,15 @@ export const bannerMountedVar = '--n_bnrM';
|
|
|
15
20
|
export const topNavMountedVar = '--n_tNvM';
|
|
16
21
|
export const ribbonVar = '--n_rbnW';
|
|
17
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Rendered border-box width of the local PanelLayout surface, in both inline and overlay modes.
|
|
25
|
+
* Published on document.documentElement after mounting when Root opts into
|
|
26
|
+
* UNSAFE_dangerouslyHoistSlotSizes. Only the primary Root should opt in.
|
|
27
|
+
* Use `var(${localPanelWidthVar}, 0px)` for external controls, not for width persistence
|
|
28
|
+
* or sizing the panel itself. The property is removed when the surface unmounts.
|
|
29
|
+
*/
|
|
30
|
+
export const localPanelWidthVar = '--n_localPanelWidth';
|
|
31
|
+
|
|
18
32
|
/**
|
|
19
33
|
* Captures the current width of the side navigation, at all times, including during resizing.
|
|
20
34
|
*
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
|
+
const DEFAULT_PANEL_WIDTH = 365;
|
|
3
|
+
const DEFAULT_PANEL_WIDTH_WITH_CHAT_PANEL_LAYOUT = 400;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Local-panel defaults in pixels, used only when no explicit preference exists.
|
|
7
|
+
* Keep the existing desktop width until chat layout rolls out. Compact sizing is independent.
|
|
8
|
+
* These are requested defaults, not measurements of an open panel.
|
|
9
|
+
*/
|
|
10
|
+
export function getPanelLayoutDefaults() {
|
|
11
|
+
return {
|
|
12
|
+
panelWidth: fg('platform-dst-chat-panel-layout') ? DEFAULT_PANEL_WIDTH_WITH_CHAT_PANEL_LAYOUT : DEFAULT_PANEL_WIDTH,
|
|
13
|
+
compactPanelWidth: 320,
|
|
14
|
+
panelMinWidth: 320
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { bind, bindAll } from 'bind-event-listener';
|
|
3
|
+
import { defaultMainMinWidth } from './constants';
|
|
3
4
|
import { LayoutAreaSizingContext } from './layout-area-sizing-context';
|
|
4
5
|
import { layoutAreaStateContexts } from './layout-area-state-contexts';
|
|
5
6
|
import { useCssLayoutAreaStates } from './use-css-layout-area-states';
|
|
@@ -50,7 +51,7 @@ export function LayoutAreaSizingProvider({
|
|
|
50
51
|
listener: dismissOlderOverlay
|
|
51
52
|
});
|
|
52
53
|
}, [chatPanelMode, lastOpenedOverlay, sideNavMode]);
|
|
53
|
-
const mainMinWidth = useRef(
|
|
54
|
+
const mainMinWidth = useRef(defaultMainMinWidth);
|
|
54
55
|
const loadRef = useRef(() => {});
|
|
55
56
|
const ready = useRef(false);
|
|
56
57
|
const waiting = useRef([]);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
3
|
import { calculateLayoutAreaStates } from './calculate-layout-area-states';
|
|
4
|
+
import { defaultMainMinWidth } from './constants';
|
|
4
5
|
import { LayoutAreaSizingContext } from './layout-area-sizing-context';
|
|
5
6
|
import { layoutAreaStateContexts } from './layout-area-state-contexts';
|
|
6
7
|
import { resolveLayoutWidth } from './resolve-layout-width';
|
|
7
8
|
import { useOccupiedLayoutWidth } from './use-occupied-layout-width';
|
|
8
|
-
const defaultMainMinWidth = 320;
|
|
9
9
|
function useStableAreaState(state) {
|
|
10
10
|
const {
|
|
11
11
|
mode,
|
|
@@ -274,7 +274,7 @@ export function LayoutAreaSizingRuntime({
|
|
|
274
274
|
if (!existing) {
|
|
275
275
|
return current;
|
|
276
276
|
}
|
|
277
|
-
if (mode === 'overlay') {
|
|
277
|
+
if (mode === 'overlay' && area !== 'panel') {
|
|
278
278
|
return {
|
|
279
279
|
...current,
|
|
280
280
|
[area]: {
|
|
@@ -289,7 +289,8 @@ export function LayoutAreaSizingRuntime({
|
|
|
289
289
|
[area]: {
|
|
290
290
|
...existing,
|
|
291
291
|
liveResize: undefined,
|
|
292
|
-
|
|
292
|
+
// Local panels have one preference, regardless of the resized mode.
|
|
293
|
+
preferredWidth: width
|
|
293
294
|
}
|
|
294
295
|
};
|
|
295
296
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
._nd5l1c6w{grid-area:panel}
|
|
2
|
+
._nd5l1gzg{grid-area:main}
|
|
3
|
+
._nd5l32aw{grid-area:var(--p_lclPnlSsrArea,main)}
|
|
4
|
+
._y44v1mph{animation:var(--ds-panel-content-enter,.15s cubic-bezier(.4,1,.6,1) FadeIn0to100)}
|
|
5
|
+
._y44vf1qi{animation:var(--ds-panel-content-exit,50ms cubic-bezier(.6,0,.8,.6) FadeOut100to0)}
|
|
6
|
+
._191wbqna{border-inline-start:var(--p_lclPnlSsrBorder,none)}
|
|
7
|
+
._191wglyw{border-inline-start:none}
|
|
8
|
+
._191wia51{border-inline-start:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._10fph9n0{justify-self:end}
|
|
9
|
+
._152tidpf{inset-block-start:0}
|
|
10
|
+
._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
11
|
+
._16qs1dhr{box-shadow:var(--p_lclPnlSsrShadow,var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f))}
|
|
12
|
+
._16qsglyw{box-shadow:none}
|
|
13
|
+
._18m91wug{overflow-y:auto}
|
|
14
|
+
._1bsb13q4{width:min(90%,var(--p_lclPnlRsz,var(--p_lclPnlW)))}
|
|
15
|
+
._1bsb1c5w{width:var(--p_lclPnlRsz,var(--p_lclPnlW))}
|
|
16
|
+
._1bsb1cku{width:var(--p_lclPnlSsrWidth,min(90%,var(--p_lclPnlSsrPreferredW)))}
|
|
17
|
+
._1reo1wug{overflow-x:auto}
|
|
18
|
+
._4t3i1osq{height:100%}
|
|
19
|
+
._4t3ieqxy{height:calc(100vh - var(--n_bnrM, 0px) - var(--n_tNvM, 0px))}
|
|
20
|
+
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
21
|
+
._bfhk1g1j{background-color:var(--p_lclPnlSsrBackground,var(--ds-surface-overlay,#fff))}
|
|
22
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
23
|
+
._ju25dn4k{animation-delay:var(--ds-duration-xshort,.1s)}
|
|
24
|
+
._kqsw1if8{position:sticky}
|
|
25
|
+
._vchhusvi{box-sizing:border-box}
|
|
26
|
+
@media (prefers-reduced-motion:no-preference){._k1af14vv{animation:var(--ds-panel-exit-right,.2s cubic-bezier(0,.4,0,1) SlideOut100PercentRight)}[dir=rtl] ._105aeydr{animation:var(--ds-panel-exit-left,.2s cubic-bezier(0,.4,0,1) SlideOut100PercentLeft)}._bq641n9t{position:fixed}@starting-style{._1kmh1n9t{position:fixed}}._k1af1nn1{animation:var(--ds-panel-enter-right,.25s cubic-bezier(0,.4,0,1) SlideIn100PercentRight)}._10t81ia4{transition-property:position}._xrrp147i{transition-duration:var(--ds-duration-instant,0ms)}._1wsa1ign{transition-delay:var(--ds-duration-short,.15s)}._1vrh1a5r{transition-behavior:allow-discrete}[dir=rtl] ._105abamb{animation:var(--ds-panel-enter-left,.25s cubic-bezier(0,.4,0,1) SlideIn100PercentLeft)}}
|