@atlaskit/navigation-system 11.3.1 → 11.3.3
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 +18 -0
- package/dist/cjs/ui/page-layout/calculate-layout-area-states.js +76 -37
- package/dist/cjs/ui/page-layout/chat-panel.js +6 -3
- package/dist/cjs/ui/page-layout/layout-area-sizing-context.js +2 -2
- package/dist/cjs/ui/page-layout/layout-area-sizing-provider.js +243 -247
- package/dist/cjs/ui/page-layout/layout-area-sizing-runtime.js +468 -0
- package/dist/cjs/ui/page-layout/main/main.js +1 -1
- package/dist/cjs/ui/page-layout/panel-splitter/panel-splitter.js +239 -99
- package/dist/cjs/ui/page-layout/panel-splitter/provider.js +3 -1
- package/dist/cjs/ui/page-layout/panel.js +10 -3
- package/dist/cjs/ui/page-layout/root.compiled.css +14 -3
- package/dist/cjs/ui/page-layout/root.js +43 -17
- package/dist/cjs/ui/page-layout/side-nav/side-nav.js +14 -3
- package/dist/cjs/ui/page-layout/use-css-layout-area-states.js +117 -0
- package/dist/cjs/ui/page-layout/use-layout-area-sizing.js +3 -1
- package/dist/es2019/ui/page-layout/calculate-layout-area-states.js +51 -17
- package/dist/es2019/ui/page-layout/chat-panel.js +29 -5
- package/dist/es2019/ui/page-layout/layout-area-sizing-context.js +2 -2
- package/dist/es2019/ui/page-layout/layout-area-sizing-provider.js +171 -241
- package/dist/es2019/ui/page-layout/layout-area-sizing-runtime.js +419 -0
- package/dist/es2019/ui/page-layout/main/main.js +2 -2
- package/dist/es2019/ui/page-layout/panel-splitter/panel-splitter.js +60 -10
- package/dist/es2019/ui/page-layout/panel-splitter/provider.js +3 -1
- package/dist/es2019/ui/page-layout/panel.js +10 -3
- package/dist/es2019/ui/page-layout/root.compiled.css +14 -3
- package/dist/es2019/ui/page-layout/root.js +30 -3
- package/dist/es2019/ui/page-layout/side-nav/side-nav.js +23 -3
- package/dist/es2019/ui/page-layout/use-css-layout-area-states.js +73 -0
- package/dist/es2019/ui/page-layout/use-layout-area-sizing.js +3 -1
- package/dist/esm/ui/page-layout/calculate-layout-area-states.js +75 -37
- package/dist/esm/ui/page-layout/chat-panel.js +7 -4
- package/dist/esm/ui/page-layout/layout-area-sizing-context.js +2 -2
- package/dist/esm/ui/page-layout/layout-area-sizing-provider.js +243 -248
- package/dist/esm/ui/page-layout/layout-area-sizing-runtime.js +459 -0
- package/dist/esm/ui/page-layout/main/main.js +2 -2
- package/dist/esm/ui/page-layout/panel-splitter/panel-splitter.js +238 -98
- package/dist/esm/ui/page-layout/panel-splitter/provider.js +3 -1
- package/dist/esm/ui/page-layout/panel.js +10 -3
- package/dist/esm/ui/page-layout/root.compiled.css +14 -3
- package/dist/esm/ui/page-layout/root.js +42 -16
- package/dist/esm/ui/page-layout/side-nav/side-nav.js +14 -3
- package/dist/esm/ui/page-layout/use-css-layout-area-states.js +110 -0
- package/dist/esm/ui/page-layout/use-layout-area-sizing.js +3 -1
- package/dist/types/ui/page-layout/calculate-layout-area-states.d.ts +7 -2
- package/dist/types/ui/page-layout/layout-area-sizing-context.d.ts +10 -3
- package/dist/types/ui/page-layout/layout-area-sizing-provider.d.ts +6 -0
- package/dist/types/ui/page-layout/layout-area-sizing-runtime.d.ts +8 -0
- package/dist/types/ui/page-layout/panel-splitter/panel-splitter-context.d.ts +4 -0
- package/dist/types/ui/page-layout/panel-splitter/provider.d.ts +1 -1
- package/dist/types/ui/page-layout/root.d.ts +2 -0
- package/dist/types/ui/page-layout/use-css-layout-area-states.d.ts +8 -0
- package/dist/types/ui/page-layout/use-layout-area-sizing.d.ts +2 -0
- package/package.json +11 -6
|
@@ -26,6 +26,7 @@ import { DangerouslyHoistSlotSizes } from '../hoist-slot-sizes-context';
|
|
|
26
26
|
import { convertResizeBoundToPixels } from '../panel-splitter/convert-resize-bound-to-pixels';
|
|
27
27
|
import { PanelSplitterProvider } from '../panel-splitter/provider';
|
|
28
28
|
import { resolveLayoutWidth } from '../resolve-layout-width';
|
|
29
|
+
import { gridRootChatFitId, gridRootId } from '../root';
|
|
29
30
|
import { useLayoutAreaSizing } from '../use-layout-area-sizing';
|
|
30
31
|
import { useLayoutId } from '../use-layout-id';
|
|
31
32
|
import { useResizingWidthCssVarOnRootElement } from '../use-resizing-width-css-var-on-root-element';
|
|
@@ -248,6 +249,8 @@ function SideNavInternal(_ref) {
|
|
|
248
249
|
}
|
|
249
250
|
}),
|
|
250
251
|
managedSizing = _useLayoutAreaSizing.state,
|
|
252
|
+
isManaged = _useLayoutAreaSizing.isManaged,
|
|
253
|
+
prepareResize = _useLayoutAreaSizing.prepareResize,
|
|
251
254
|
getManagedResizeBounds = _useLayoutAreaSizing.getResizeBounds,
|
|
252
255
|
startResize = _useLayoutAreaSizing.startResize,
|
|
253
256
|
resize = _useLayoutAreaSizing.resize,
|
|
@@ -345,6 +348,9 @@ function SideNavInternal(_ref) {
|
|
|
345
348
|
type: 'not-active'
|
|
346
349
|
});
|
|
347
350
|
var isFlyoutVisible = (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open';
|
|
351
|
+
// Flyouts, including their close animation, already have overlay placement.
|
|
352
|
+
// The CSS-first inline allocation must not override it with an ID selector.
|
|
353
|
+
var shouldApplyUnmanagedSizing = !managedSizing && (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) !== 'open' && (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) !== 'triggered-animate-close';
|
|
348
354
|
var isExpandedOnDesktopRef = useStableRef(isExpandedOnDesktop);
|
|
349
355
|
var hasPeekStartedRef = useRef(false);
|
|
350
356
|
var onPeekStartRef = useStableRef(onPeekStart);
|
|
@@ -884,7 +890,11 @@ function SideNavInternal(_ref) {
|
|
|
884
890
|
ref: mergedRef,
|
|
885
891
|
"data-testid": testId,
|
|
886
892
|
className: ax([styles.root, isChatPanelLayoutEnabled && styles.chatPanelSizing, isChatPanelLayoutEnabled && (managedSizing === null || managedSizing === void 0 ? void 0 : managedSizing.mode) === 'overlay' && styles.managedOverlay, isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileOnly, !isExpandedOnDesktop && isExpandedOnMobile && !isFlyoutVisible && styles.hiddenDesktopOnly, !isExpandedOnDesktop && !isExpandedOnMobile && !isFlyoutVisible && styles.hiddenMobileAndDesktop, isMotionUpliftEnabled && motionUpliftStyles.animationRTLSupport, shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.animationBaseStyles, isExpandedOnMobile && shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.expandAnimationMobile, !isExpandedOnMobile && shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.collapseAnimationMobile, isExpandedOnDesktop && shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.expandAnimationDesktop, !isExpandedOnDesktop && shouldShowSidebarToggleAnimation && isMotionUpliftEnabled && motionUpliftStyles.collapseAnimationDesktop, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && isMotionUpliftEnabled && motionUpliftStyles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'open' && !isMotionUpliftEnabled && styles.flyoutOpen, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && isMotionUpliftEnabled && motionUpliftStyles.flyoutAnimateClosed, (sideNavState === null || sideNavState === void 0 ? void 0 : sideNavState.flyout) === 'triggered-animate-close' && !isMotionUpliftEnabled && styles.flyoutAnimateClosed])
|
|
887
|
-
}),
|
|
893
|
+
}), isChatPanelLayoutEnabled &&
|
|
894
|
+
/*#__PURE__*/
|
|
895
|
+
// CSS reserves only the nav minimum for chat's fit decision, before effects or lazy loading.
|
|
896
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles
|
|
897
|
+
React.createElement("style", null, "\n#".concat(gridRootChatFitId, " { --n_fitNav: 0px; }\n").concat(shouldApplyUnmanagedSizing ? "#".concat(gridRootId, " nav[data-layout-slot] { grid-area: main / aside / aside / aside; width: min(90%, ").concat(clampedWidth, "); }") : '', "\n@media (min-width: 64rem) {\n @container navigation-main-space (min-width: ").concat(minWidth, ") {\n #").concat(gridRootChatFitId, " { --n_fitNav: ").concat(isExpandedOnDesktop ? minWidth : '0px', "; }\n ").concat(shouldApplyUnmanagedSizing ? "#".concat(gridRootId, " nav[data-layout-slot] { grid-area: side-nav; width: min(").concat(clampedWidth, ", calc(100cqw + var(--n_fitNav) - var(--n_chatTrack, 0px))); }") : '', "\n }\n}\n")), /*#__PURE__*/React.createElement(DangerouslyHoistCssVarToDocumentRoot, {
|
|
888
898
|
variableName: sideNavLiveWidthVar,
|
|
889
899
|
value: "0px",
|
|
890
900
|
mediaQuery: '@media (min-width: 64rem)',
|
|
@@ -904,8 +914,9 @@ function SideNavInternal(_ref) {
|
|
|
904
914
|
panelRef: navRef,
|
|
905
915
|
panelWidth: renderedWidth,
|
|
906
916
|
onCompleteResize: onCompleteResize,
|
|
907
|
-
onResizeStartInternal: isChatPanelLayoutEnabled &&
|
|
908
|
-
onResizeInternal: isChatPanelLayoutEnabled &&
|
|
917
|
+
onResizeStartInternal: isChatPanelLayoutEnabled && isManaged ? onResizeStartInternal : undefined,
|
|
918
|
+
onResizeInternal: isChatPanelLayoutEnabled && isManaged ? onResizeInternal : undefined,
|
|
919
|
+
prepareResize: isChatPanelLayoutEnabled ? prepareResize : undefined,
|
|
909
920
|
getResizeBounds: getResizeBounds,
|
|
910
921
|
resizingCssVar: panelSplitterResizingVar
|
|
911
922
|
// Not resizable when in peek (flyout) mode.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
import { bindAll } from 'bind-event-listener';
|
|
8
|
+
/**
|
|
9
|
+
* Observe CSS's responsive modes without loading the drag allocator or publishing
|
|
10
|
+
* measured widths back into CSS. Observe the host and independent occupied tracks;
|
|
11
|
+
* managed panels, TopNav and Banner are deliberately not observed during dragging.
|
|
12
|
+
*/
|
|
13
|
+
export function useCssLayoutAreaStates(layoutRef, revision, isEnabled) {
|
|
14
|
+
var _useState = useState({}),
|
|
15
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16
|
+
modes = _useState2[0],
|
|
17
|
+
setModes = _useState2[1];
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
var root = layoutRef === null || layoutRef === void 0 ? void 0 : layoutRef.current;
|
|
20
|
+
if (!root || !isEnabled) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
var measure = function measure() {
|
|
24
|
+
var selectors = {
|
|
25
|
+
'side-nav': ':scope > nav[data-layout-slot]',
|
|
26
|
+
panel: '[data-layout-with-panel-slot]',
|
|
27
|
+
'chat-panel': ':scope > [data-layout-chat-panel]'
|
|
28
|
+
};
|
|
29
|
+
var next = {};
|
|
30
|
+
var _iterator = _createForOfIteratorHelper(['side-nav', 'panel', 'chat-panel']),
|
|
31
|
+
_step;
|
|
32
|
+
try {
|
|
33
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
34
|
+
var area = _step.value;
|
|
35
|
+
var element = root.querySelector(selectors[area]);
|
|
36
|
+
if (element) {
|
|
37
|
+
next[area] = getComputedStyle(element).gridArea.split('/')[0].trim() === area ? 'inline' : 'overlay';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
} catch (err) {
|
|
41
|
+
_iterator.e(err);
|
|
42
|
+
} finally {
|
|
43
|
+
_iterator.f();
|
|
44
|
+
}
|
|
45
|
+
setModes(function (previous) {
|
|
46
|
+
return ['side-nav', 'panel', 'chat-panel'].every(function (area) {
|
|
47
|
+
return previous[area] === next[area];
|
|
48
|
+
}) ? previous : next;
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
var widths = new Map();
|
|
52
|
+
var observer = new ResizeObserver(function (entries) {
|
|
53
|
+
var changed = false;
|
|
54
|
+
var _iterator2 = _createForOfIteratorHelper(entries),
|
|
55
|
+
_step2;
|
|
56
|
+
try {
|
|
57
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
58
|
+
var entry = _step2.value;
|
|
59
|
+
if (widths.get(entry.target) !== entry.contentRect.width) {
|
|
60
|
+
widths.set(entry.target, entry.contentRect.width);
|
|
61
|
+
changed = true;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
} catch (err) {
|
|
65
|
+
_iterator2.e(err);
|
|
66
|
+
} finally {
|
|
67
|
+
_iterator2.f();
|
|
68
|
+
}
|
|
69
|
+
if (changed) {
|
|
70
|
+
measure();
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
var observeSlots = function observeSlots() {
|
|
74
|
+
observer.disconnect();
|
|
75
|
+
widths.clear();
|
|
76
|
+
var occupied = Array.from(root.children).filter(function (element) {
|
|
77
|
+
return element.matches('[data-layout-slot]:not(nav):not(header):not([role="main"]):not([data-layout-chat-panel])') && ['aside', 'ribbon', 'panel'].includes(getComputedStyle(element).gridArea.split('/')[0].trim());
|
|
78
|
+
});
|
|
79
|
+
for (var _i = 0, _arr = [root].concat(_toConsumableArray(occupied)); _i < _arr.length; _i++) {
|
|
80
|
+
var element = _arr[_i];
|
|
81
|
+
widths.set(element, element.getBoundingClientRect().width);
|
|
82
|
+
observer.observe(element);
|
|
83
|
+
}
|
|
84
|
+
measure();
|
|
85
|
+
};
|
|
86
|
+
observeSlots();
|
|
87
|
+
var mutations = new MutationObserver(observeSlots);
|
|
88
|
+
mutations.observe(root, {
|
|
89
|
+
childList: true
|
|
90
|
+
});
|
|
91
|
+
var queries = [window.matchMedia('(min-width: 40rem)'), window.matchMedia('(min-width: 64rem)')];
|
|
92
|
+
var unbind = [bindAll(window, [{
|
|
93
|
+
type: 'resize',
|
|
94
|
+
listener: measure
|
|
95
|
+
}])].concat(_toConsumableArray(queries.map(function (query) {
|
|
96
|
+
return bindAll(query, [{
|
|
97
|
+
type: 'change',
|
|
98
|
+
listener: measure
|
|
99
|
+
}]);
|
|
100
|
+
})));
|
|
101
|
+
return function () {
|
|
102
|
+
observer.disconnect();
|
|
103
|
+
mutations.disconnect();
|
|
104
|
+
unbind.forEach(function (cleanup) {
|
|
105
|
+
return cleanup();
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
}, [isEnabled, layoutRef, revision]);
|
|
109
|
+
return modes;
|
|
110
|
+
}
|
|
@@ -62,6 +62,8 @@ export function useLayoutAreaSizing(_ref) {
|
|
|
62
62
|
startResize: startResize,
|
|
63
63
|
resize: resize,
|
|
64
64
|
completeResize: completeResize,
|
|
65
|
-
getResizeBounds: getResizeBounds
|
|
65
|
+
getResizeBounds: getResizeBounds,
|
|
66
|
+
isManaged: context !== null,
|
|
67
|
+
prepareResize: context === null || context === void 0 ? void 0 : context.prepareResize
|
|
66
68
|
};
|
|
67
69
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LayoutArea, LayoutAreaAllocation, LayoutWidthBound, ResizeSession, StoredLayoutArea } from './layout-area-sizing-context';
|
|
2
|
-
export declare function calculateLayoutAreaStates({ viewportWidth, layoutWidth, isChatPanelOverlay, isSideNavOverlay, occupiedWidth, mainMinWidth: mainMinWidthBound, areas, resizeSession, }: {
|
|
1
|
+
import type { LayoutArea, LayoutAreaAllocation, LayoutAreaMode, LayoutWidthBound, ResizeSession, StoredLayoutArea } from './layout-area-sizing-context';
|
|
2
|
+
export declare function calculateLayoutAreaStates({ viewportWidth, layoutWidth, isChatPanelOverlay, isSideNavOverlay, occupiedWidth, mainMinWidth: mainMinWidthBound, areas, resizeSession, initialModes, }: {
|
|
3
3
|
viewportWidth: number;
|
|
4
4
|
/**
|
|
5
5
|
* Root's content width, excluding scrollbars, borders and padding.
|
|
@@ -17,4 +17,9 @@ export declare function calculateLayoutAreaStates({ viewportWidth, layoutWidth,
|
|
|
17
17
|
mainMinWidth: LayoutWidthBound;
|
|
18
18
|
areas: Partial<Record<LayoutArea, StoredLayoutArea>>;
|
|
19
19
|
resizeSession?: ResizeSession | null;
|
|
20
|
+
/**
|
|
21
|
+
* The CSS-rendered modes during deferred activation. Bounds must describe the
|
|
22
|
+
* existing layout until the user actually resizes it.
|
|
23
|
+
*/
|
|
24
|
+
initialModes?: Partial<Record<LayoutArea, LayoutAreaMode>>;
|
|
20
25
|
}): Partial<Record<LayoutArea, LayoutAreaAllocation>>;
|
|
@@ -22,15 +22,21 @@ export type StoredLayoutArea = LayoutAreaConfig & {
|
|
|
22
22
|
mode: LayoutAreaMode;
|
|
23
23
|
width: number;
|
|
24
24
|
};
|
|
25
|
-
openedAt?: number;
|
|
26
25
|
};
|
|
27
26
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
27
|
+
* One resize transaction. Keep its starting widths for controlled rejection,
|
|
28
|
+
* and its resulting widths for synchronous or delayed acknowledgement.
|
|
30
29
|
*/
|
|
31
30
|
export type ResizeSession = {
|
|
32
31
|
area: LayoutArea;
|
|
33
32
|
baselineWidths: Partial<Record<LayoutArea, number>>;
|
|
33
|
+
/**
|
|
34
|
+
* Overlay resizing changes only its surface width, not the inline layout modes.
|
|
35
|
+
* Retain these modes until a layout/configuration change ends the transaction.
|
|
36
|
+
*/
|
|
37
|
+
overlayModes?: Partial<Record<LayoutArea, LayoutAreaMode>>;
|
|
38
|
+
completedWidth?: number;
|
|
39
|
+
completedWidths?: Partial<Record<LayoutArea, number>>;
|
|
34
40
|
};
|
|
35
41
|
export type LayoutAreaState = {
|
|
36
42
|
mode: LayoutAreaMode;
|
|
@@ -44,6 +50,7 @@ export type LayoutAreaAllocation = LayoutAreaState & {
|
|
|
44
50
|
};
|
|
45
51
|
};
|
|
46
52
|
export type LayoutAreaSizingContextValue = {
|
|
53
|
+
prepareResize?: () => Promise<boolean>;
|
|
47
54
|
getResizeBounds: (area: LayoutArea) => ResizeBounds | undefined;
|
|
48
55
|
registerArea: (area: LayoutArea, config: LayoutAreaConfig) => void;
|
|
49
56
|
unregisterArea: (area: LayoutArea) => void;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Stable, synchronous boundary for SSR content. The drag/cascade implementation
|
|
4
|
+
* is a sibling, not a replacement wrapper, so loading it cannot remount the app.
|
|
5
|
+
* CSS handles initial and responsive geometry; only splitter interaction requests
|
|
6
|
+
* the asynchronous chunk. The eager observer reads modes without changing widths.
|
|
7
|
+
*/
|
|
2
8
|
export declare function LayoutAreaSizingProvider({ children, layoutRef, }: {
|
|
3
9
|
children: ReactNode;
|
|
4
10
|
layoutRef?: React.RefObject<HTMLDivElement | null>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type LayoutArea, type LayoutAreaState, type LayoutAreaSizingContextValue } from './layout-area-sizing-context';
|
|
3
|
+
export declare function LayoutAreaSizingRuntime({ children, layoutRef, onReady, onUpdate, }: {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
layoutRef?: React.RefObject<HTMLDivElement | null>;
|
|
6
|
+
onReady?: (actions: LayoutAreaSizingContextValue | null) => void;
|
|
7
|
+
onUpdate?: (states: Partial<Record<LayoutArea, LayoutAreaState>>) => void;
|
|
8
|
+
}): JSX.Element;
|
|
@@ -32,6 +32,10 @@ export type PanelSplitterContextType = {
|
|
|
32
32
|
* Called with the unconstrained live pointer width while dragging.
|
|
33
33
|
*/
|
|
34
34
|
onResizeInternal?: (newWidth: number) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Loads the optional sizing engine before committing an interaction.
|
|
37
|
+
*/
|
|
38
|
+
prepareResize?: () => Promise<boolean>;
|
|
35
39
|
/**
|
|
36
40
|
* The minimum and maximum bounds for resizing the panel.
|
|
37
41
|
* The bounds can be provided as `px` or `vw` values.
|
|
@@ -25,4 +25,4 @@ export type PanelSplitterProviderProps = Omit<PanelSplitterContextType, 'portalR
|
|
|
25
25
|
*
|
|
26
26
|
* Should be used in the layout area components, e.g. SideNav, Aside etc, as opposed to products.
|
|
27
27
|
*/
|
|
28
|
-
export declare const PanelSplitterProvider: ({ panelId, panelWidth, onCompleteResize, onResizeStartInternal, onResizeInternal, getResizeBounds, resizingCssVar, panelRef, resizingElementRef, portalRef: providedPortalRef, position, isEnabled, shortcut, children, }: PanelSplitterProviderProps) => React.JSX.Element;
|
|
28
|
+
export declare const PanelSplitterProvider: ({ panelId, panelWidth, onCompleteResize, onResizeStartInternal, onResizeInternal, prepareResize, getResizeBounds, resizingCssVar, panelRef, resizingElementRef, portalRef: providedPortalRef, position, isEnabled, shortcut, children, }: PanelSplitterProviderProps) => React.JSX.Element;
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { StrictXCSSProp } from '@atlaskit/css';
|
|
7
7
|
export declare const gridRootId = "unsafe-design-system-page-layout-root";
|
|
8
|
+
export declare const gridRootFitId: string;
|
|
9
|
+
export declare const gridRootChatFitId: string;
|
|
8
10
|
/**
|
|
9
11
|
* The root component of the navigation system. It wraps the underlying components with the necessary contexts allowing to use certain data and hooks
|
|
10
12
|
* @param skipLinksLabel - The very first element of the layout is a skip links container that can be accessed by pressing Tab button and holds the links to the other sections of the layout thus improving accessibility. This parameter defines the header text for this container
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { LayoutArea, LayoutAreaMode } from './layout-area-sizing-context';
|
|
3
|
+
/**
|
|
4
|
+
* Observe CSS's responsive modes without loading the drag allocator or publishing
|
|
5
|
+
* measured widths back into CSS. Observe the host and independent occupied tracks;
|
|
6
|
+
* managed panels, TopNav and Banner are deliberately not observed during dragging.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useCssLayoutAreaStates(layoutRef: RefObject<HTMLDivElement | null> | undefined, revision: number, isEnabled: boolean): Partial<Record<LayoutArea, LayoutAreaMode>>;
|
|
@@ -4,6 +4,8 @@ export declare function useLayoutAreaSizing({ area, config, }: {
|
|
|
4
4
|
area: LayoutArea;
|
|
5
5
|
config: LayoutAreaConfig;
|
|
6
6
|
}): {
|
|
7
|
+
isManaged: boolean;
|
|
8
|
+
prepareResize: (() => Promise<boolean>) | undefined;
|
|
7
9
|
state: LayoutAreaState | undefined;
|
|
8
10
|
getResizeBounds: () => ResizeBounds | undefined;
|
|
9
11
|
startResize: (mode: LayoutAreaMode) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "11.3.
|
|
3
|
+
"version": "11.3.3",
|
|
4
4
|
"description": "The latest navigation system for Atlassian apps.",
|
|
5
5
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@atlaskit/analytics-next": "^12.6.0",
|
|
61
|
-
"@atlaskit/app-provider": "^8.
|
|
61
|
+
"@atlaskit/app-provider": "^8.2.0",
|
|
62
62
|
"@atlaskit/avatar": "^30.0.0",
|
|
63
|
-
"@atlaskit/button": "^25.
|
|
63
|
+
"@atlaskit/button": "^25.6.0",
|
|
64
64
|
"@atlaskit/css": "^1.1.0",
|
|
65
65
|
"@atlaskit/ds-lib": "^8.0.0",
|
|
66
66
|
"@atlaskit/icon": "^38.0.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@atlaskit/pragmatic-drag-and-drop": "^4.0.0",
|
|
74
74
|
"@atlaskit/primitives": "^22.6.0",
|
|
75
75
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
76
|
-
"@atlaskit/side-nav-items": "^2.
|
|
76
|
+
"@atlaskit/side-nav-items": "^2.6.0",
|
|
77
77
|
"@atlaskit/tokens": "^20.6.0",
|
|
78
78
|
"@atlaskit/tooltip": "^24.4.0",
|
|
79
79
|
"@atlaskit/visually-hidden": "^4.4.0",
|
|
@@ -90,10 +90,12 @@
|
|
|
90
90
|
"devDependencies": {
|
|
91
91
|
"@af/accessibility-testing": "workspace:^",
|
|
92
92
|
"@af/integration-testing": "workspace:^",
|
|
93
|
+
"@af/react-unit-testing": "workspace:^",
|
|
93
94
|
"@af/visual-regression": "workspace:^",
|
|
94
95
|
"@atlaskit/badge": "^22.0.0",
|
|
95
96
|
"@atlaskit/banner": "^15.3.0",
|
|
96
97
|
"@atlaskit/breadcrumbs": "^17.8.0",
|
|
98
|
+
"@atlaskit/docs": "^12.3.0",
|
|
97
99
|
"@atlaskit/dropdown-menu": "^21.0.0",
|
|
98
100
|
"@atlaskit/flag": "^19.0.0",
|
|
99
101
|
"@atlaskit/form": "^18.2.0",
|
|
@@ -110,6 +112,9 @@
|
|
|
110
112
|
"@atlaskit/page-layout": "^5.5.0",
|
|
111
113
|
"@atlaskit/popper": "^9.4.0",
|
|
112
114
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
|
|
115
|
+
"@atlaskit/pragmatic-drag-and-drop-flourish": "^3.2.0",
|
|
116
|
+
"@atlaskit/pragmatic-drag-and-drop-live-region": "^2.1.0",
|
|
117
|
+
"@atlaskit/radio": "^10.2.0",
|
|
113
118
|
"@atlaskit/section-message": "^10.2.0",
|
|
114
119
|
"@atlaskit/select": "^23.1.0",
|
|
115
120
|
"@atlaskit/skeleton": "^4.4.0",
|
|
@@ -118,13 +123,13 @@
|
|
|
118
123
|
"@atlaskit/tag": "^17.0.0",
|
|
119
124
|
"@atlaskit/textarea": "^10.2.0",
|
|
120
125
|
"@atlaskit/textfield": "^10.2.0",
|
|
121
|
-
"@atlaskit/top-layer": "^6.
|
|
126
|
+
"@atlaskit/top-layer": "^6.5.0",
|
|
122
127
|
"@atlassian/feature-flags-test-utils": "^1.3.0",
|
|
123
128
|
"@atlassian/gemini": "^1.54.0",
|
|
124
129
|
"@atlassian/panel-system": "^1.14.0",
|
|
125
130
|
"@atlassian/react-async": "^0.23.0",
|
|
126
131
|
"@atlassian/react-entrypoint": "^1.1.0",
|
|
127
|
-
"@atlassian/search-dialog": "^10.
|
|
132
|
+
"@atlassian/search-dialog": "^10.23.0",
|
|
128
133
|
"@atlassian/ssr-tests": "workspace:^",
|
|
129
134
|
"@atlassian/test-utils": "^1.1.0",
|
|
130
135
|
"@atlassian/testing-library": "^0.12.0",
|