@atlaskit/navigation-system 2.3.2 → 2.3.4
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 +13 -0
- package/dist/cjs/components/skip-links/skip-links-container.js +46 -3
- package/dist/cjs/context/skip-links/skip-links-provider.js +3 -7
- package/dist/cjs/ui/page-layout/root.js +1 -12
- package/dist/es2019/components/skip-links/skip-links-container.js +33 -2
- package/dist/es2019/context/skip-links/skip-links-provider.js +3 -7
- package/dist/es2019/ui/page-layout/root.js +1 -12
- package/dist/esm/components/skip-links/skip-links-container.js +44 -2
- package/dist/esm/context/skip-links/skip-links-provider.js +3 -7
- package/dist/esm/ui/page-layout/root.js +1 -12
- package/dist/types/context/skip-links/skip-links-provider.d.ts +1 -1
- package/dist/types-ts4.5/context/skip-links/skip-links-provider.d.ts +1 -1
- package/package.json +5 -8
- package/dist/cjs/context/skip-links/skip-links-data-context.js +0 -69
- package/dist/es2019/context/skip-links/skip-links-data-context.js +0 -50
- package/dist/esm/context/skip-links/skip-links-data-context.js +0 -61
- package/dist/types/context/skip-links/skip-links-data-context.d.ts +0 -20
- package/dist/types-ts4.5/context/skip-links/skip-links-data-context.d.ts +0 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 2.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.3.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`5a4eb937344d9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5a4eb937344d9) -
|
|
14
|
+
Internal refactors to skip links. This was previously behind a feature flag, which is now removed.
|
|
15
|
+
|
|
3
16
|
## 2.3.2
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
/* skip-links-container.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.SkipLinksContainer = SkipLinksContainer;
|
|
9
10
|
require("./skip-links-container.compiled.css");
|
|
10
|
-
var
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var React = _react;
|
|
11
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
16
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
13
|
-
var _skipLinksDataContext = require("../../context/skip-links/skip-links-data-context");
|
|
14
17
|
var _skipLink = require("./skip-link");
|
|
15
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16
21
|
var styles = {
|
|
17
22
|
root: "_zulp1b66 _2rko12b0 _1rjcutpp _18zrutpp _1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs1cd0 _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
|
|
18
23
|
skipLinkList: "_zulp1b66 _1e0c1txw _2lx21bp4 _1x8w11lx _2mzuglyw _1pfhze3t _bozgze3t"
|
|
@@ -39,6 +44,42 @@ var closeOnEscape = function closeOnEscape(event) {
|
|
|
39
44
|
activeElement.blur();
|
|
40
45
|
}
|
|
41
46
|
};
|
|
47
|
+
var _assignIndex = function assignIndex(num, arr) {
|
|
48
|
+
if (!arr.includes(num)) {
|
|
49
|
+
return num;
|
|
50
|
+
}
|
|
51
|
+
return _assignIndex(num + 1, arr);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Sorts an array of skip links by list indexes.
|
|
56
|
+
*
|
|
57
|
+
* Skip links with custom list indexes are positioned first, followed by regular skip links,
|
|
58
|
+
* which are automatically assigned available index positions to avoid conflicts.
|
|
59
|
+
*/
|
|
60
|
+
function sortSkipLinks(arr) {
|
|
61
|
+
var customLinks = arr.filter(function (link) {
|
|
62
|
+
return Number.isInteger(link.listIndex);
|
|
63
|
+
});
|
|
64
|
+
if (customLinks.length === 0) {
|
|
65
|
+
return arr;
|
|
66
|
+
}
|
|
67
|
+
var usedIndexes = customLinks.map(function (a) {
|
|
68
|
+
return a.listIndex;
|
|
69
|
+
});
|
|
70
|
+
var regularLinksWithIndex = arr.filter(function (link) {
|
|
71
|
+
return link.listIndex === undefined;
|
|
72
|
+
}).map(function (link, index) {
|
|
73
|
+
var listIndex = _assignIndex(index, usedIndexes);
|
|
74
|
+
usedIndexes.push(listIndex);
|
|
75
|
+
return _objectSpread(_objectSpread({}, link), {}, {
|
|
76
|
+
listIndex: listIndex
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
return [].concat((0, _toConsumableArray2.default)(customLinks), (0, _toConsumableArray2.default)(regularLinksWithIndex)).sort(function (a, b) {
|
|
80
|
+
return a.listIndex - b.listIndex;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
42
83
|
var isOnlyWhitespaceRegex = /^\s*$/;
|
|
43
84
|
|
|
44
85
|
/**
|
|
@@ -56,7 +97,9 @@ function SkipLinksContainer(_ref) {
|
|
|
56
97
|
var label = _ref.label,
|
|
57
98
|
testId = _ref.testId,
|
|
58
99
|
links = _ref.links;
|
|
59
|
-
var sortedLinks = (0,
|
|
100
|
+
var sortedLinks = (0, _react.useMemo)(function () {
|
|
101
|
+
return sortSkipLinks(links);
|
|
102
|
+
}, [links]);
|
|
60
103
|
if (sortedLinks.length === 0) {
|
|
61
104
|
return null;
|
|
62
105
|
}
|
|
@@ -9,10 +9,8 @@ exports.SkipLinksProvider = SkipLinksProvider;
|
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
var _skipLinksContainer = require("../../components/skip-links/skip-links-container");
|
|
14
13
|
var _skipLinksContext = require("./skip-links-context");
|
|
15
|
-
var _skipLinksDataContext = require("./skip-links-data-context");
|
|
16
14
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
15
|
var getByDomOrderSortFunction = function getByDomOrderSortFunction() {
|
|
18
16
|
var layoutSlots = Array.from(document.querySelectorAll("[data-layout-slot]"));
|
|
@@ -42,7 +40,7 @@ var getByDomOrderSortFunction = function getByDomOrderSortFunction() {
|
|
|
42
40
|
* Provider for skip links. Should be rendered at the top level of the application.
|
|
43
41
|
*
|
|
44
42
|
* - Provides the context to register/unregister skip links
|
|
45
|
-
* - Renders the skip links container
|
|
43
|
+
* - Renders the skip links container
|
|
46
44
|
*/
|
|
47
45
|
function SkipLinksProvider(_ref) {
|
|
48
46
|
var children = _ref.children,
|
|
@@ -84,11 +82,9 @@ function SkipLinksProvider(_ref) {
|
|
|
84
82
|
}, [registerSkipLink, unregisterSkipLink]);
|
|
85
83
|
return /*#__PURE__*/_react.default.createElement(_skipLinksContext.SkipLinksContext.Provider, {
|
|
86
84
|
value: contextValue
|
|
87
|
-
},
|
|
85
|
+
}, /*#__PURE__*/_react.default.createElement(_skipLinksContainer.SkipLinksContainer, {
|
|
88
86
|
label: label,
|
|
89
87
|
testId: testId,
|
|
90
88
|
links: links
|
|
91
|
-
}), children)
|
|
92
|
-
value: links
|
|
93
|
-
}, children));
|
|
89
|
+
}), children);
|
|
94
90
|
}
|
|
@@ -11,8 +11,6 @@ require("./root.compiled.css");
|
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
var _openLayerObserver = require("@atlaskit/layering/experimental/open-layer-observer");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
|
-
var _skipLinksContainer = require("../../components/skip-links/skip-links-container");
|
|
16
14
|
var _skipLinksProvider = require("../../context/skip-links/skip-links-provider");
|
|
17
15
|
var _topNavStartContextProvider = require("../../context/top-nav-start/top-nav-start-context-provider");
|
|
18
16
|
var _hoistSlotSizesContext = require("./hoist-slot-sizes-context");
|
|
@@ -57,16 +55,7 @@ function Root(_ref) {
|
|
|
57
55
|
}, /*#__PURE__*/_react.default.createElement(_skipLinksProvider.SkipLinksProvider, {
|
|
58
56
|
label: skipLinksLabel,
|
|
59
57
|
testId: testId
|
|
60
|
-
},
|
|
61
|
-
/*#__PURE__*/
|
|
62
|
-
// SkipLinksContainer is rendered directly inside SkipLinksProvider when the FG is enabled.
|
|
63
|
-
_react.default.createElement(_skipLinksContainer.SkipLinksContainer, {
|
|
64
|
-
label: skipLinksLabel,
|
|
65
|
-
testId: testId,
|
|
66
|
-
links:
|
|
67
|
-
// The links prop won't be used when the FG is disabled.
|
|
68
|
-
[]
|
|
69
|
-
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
70
59
|
ref: ref,
|
|
71
60
|
className: (0, _runtime.ax)([styles.root, xcss]),
|
|
72
61
|
id: gridRootId,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import "./skip-links-container.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useMemo } from 'react';
|
|
5
6
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
6
|
-
import { useSortedSkipLinks } from '../../context/skip-links/skip-links-data-context';
|
|
7
7
|
import { SkipLink } from './skip-link';
|
|
8
8
|
const styles = {
|
|
9
9
|
root: "_zulp1b66 _2rko12b0 _1rjcutpp _18zrutpp _1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs1cd0 _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
|
|
@@ -31,6 +31,35 @@ const closeOnEscape = event => {
|
|
|
31
31
|
activeElement.blur();
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
+
const assignIndex = (num, arr) => {
|
|
35
|
+
if (!arr.includes(num)) {
|
|
36
|
+
return num;
|
|
37
|
+
}
|
|
38
|
+
return assignIndex(num + 1, arr);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Sorts an array of skip links by list indexes.
|
|
43
|
+
*
|
|
44
|
+
* Skip links with custom list indexes are positioned first, followed by regular skip links,
|
|
45
|
+
* which are automatically assigned available index positions to avoid conflicts.
|
|
46
|
+
*/
|
|
47
|
+
function sortSkipLinks(arr) {
|
|
48
|
+
const customLinks = arr.filter(link => Number.isInteger(link.listIndex));
|
|
49
|
+
if (customLinks.length === 0) {
|
|
50
|
+
return arr;
|
|
51
|
+
}
|
|
52
|
+
const usedIndexes = customLinks.map(a => a.listIndex);
|
|
53
|
+
const regularLinksWithIndex = arr.filter(link => link.listIndex === undefined).map((link, index) => {
|
|
54
|
+
const listIndex = assignIndex(index, usedIndexes);
|
|
55
|
+
usedIndexes.push(listIndex);
|
|
56
|
+
return {
|
|
57
|
+
...link,
|
|
58
|
+
listIndex
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
return [...customLinks, ...regularLinksWithIndex].sort((a, b) => a.listIndex - b.listIndex);
|
|
62
|
+
}
|
|
34
63
|
const isOnlyWhitespaceRegex = /^\s*$/;
|
|
35
64
|
|
|
36
65
|
/**
|
|
@@ -49,7 +78,9 @@ export function SkipLinksContainer({
|
|
|
49
78
|
testId,
|
|
50
79
|
links
|
|
51
80
|
}) {
|
|
52
|
-
const sortedLinks =
|
|
81
|
+
const sortedLinks = useMemo(() => {
|
|
82
|
+
return sortSkipLinks(links);
|
|
83
|
+
}, [links]);
|
|
53
84
|
if (sortedLinks.length === 0) {
|
|
54
85
|
return null;
|
|
55
86
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { SkipLinksContainer } from '../../components/skip-links/skip-links-container';
|
|
4
3
|
import { SkipLinksContext } from './skip-links-context';
|
|
5
|
-
import { SkipLinksDataContext } from './skip-links-data-context';
|
|
6
4
|
const getByDomOrderSortFunction = () => {
|
|
7
5
|
const layoutSlots = Array.from(document.querySelectorAll(`[data-layout-slot]`));
|
|
8
6
|
return (a, b) => {
|
|
@@ -31,7 +29,7 @@ const getByDomOrderSortFunction = () => {
|
|
|
31
29
|
* Provider for skip links. Should be rendered at the top level of the application.
|
|
32
30
|
*
|
|
33
31
|
* - Provides the context to register/unregister skip links
|
|
34
|
-
* - Renders the skip links container
|
|
32
|
+
* - Renders the skip links container
|
|
35
33
|
*/
|
|
36
34
|
export function SkipLinksProvider({
|
|
37
35
|
children,
|
|
@@ -71,11 +69,9 @@ This error will not be shown in production, and the duplicate skip link will be
|
|
|
71
69
|
}, [registerSkipLink, unregisterSkipLink]);
|
|
72
70
|
return /*#__PURE__*/React.createElement(SkipLinksContext.Provider, {
|
|
73
71
|
value: contextValue
|
|
74
|
-
},
|
|
72
|
+
}, /*#__PURE__*/React.createElement(SkipLinksContainer, {
|
|
75
73
|
label: label,
|
|
76
74
|
testId: testId,
|
|
77
75
|
links: links
|
|
78
|
-
}), children)
|
|
79
|
-
value: links
|
|
80
|
-
}, children));
|
|
76
|
+
}), children);
|
|
81
77
|
}
|
|
@@ -3,8 +3,6 @@ import "./root.compiled.css";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useEffect, useRef } from 'react';
|
|
5
5
|
import { OpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import { SkipLinksContainer } from '../../components/skip-links/skip-links-container';
|
|
8
6
|
import { SkipLinksProvider } from '../../context/skip-links/skip-links-provider';
|
|
9
7
|
import { TopNavStartProvider } from '../../context/top-nav-start/top-nav-start-context-provider';
|
|
10
8
|
import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context';
|
|
@@ -57,16 +55,7 @@ This message will not be displayed in production.
|
|
|
57
55
|
}, /*#__PURE__*/React.createElement(SkipLinksProvider, {
|
|
58
56
|
label: skipLinksLabel,
|
|
59
57
|
testId: testId
|
|
60
|
-
},
|
|
61
|
-
/*#__PURE__*/
|
|
62
|
-
// SkipLinksContainer is rendered directly inside SkipLinksProvider when the FG is enabled.
|
|
63
|
-
React.createElement(SkipLinksContainer, {
|
|
64
|
-
label: skipLinksLabel,
|
|
65
|
-
testId: testId,
|
|
66
|
-
links:
|
|
67
|
-
// The links prop won't be used when the FG is disabled.
|
|
68
|
-
[]
|
|
69
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
58
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
70
59
|
ref: ref,
|
|
71
60
|
className: ax([styles.root, xcss]),
|
|
72
61
|
id: gridRootId,
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/* skip-links-container.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
4
|
import "./skip-links-container.compiled.css";
|
|
3
5
|
import * as React from 'react';
|
|
4
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
+
import { useMemo } from 'react';
|
|
5
10
|
import { Text } from '@atlaskit/primitives/compiled';
|
|
6
|
-
import { useSortedSkipLinks } from '../../context/skip-links/skip-links-data-context';
|
|
7
11
|
import { SkipLink } from './skip-link';
|
|
8
12
|
var styles = {
|
|
9
13
|
root: "_zulp1b66 _2rko12b0 _1rjcutpp _18zrutpp _1e0c1txw _2lx21bp4 _kqsw1n9t _1e02v47k _152tv47k _bfhk1bhr _16qs1cd0 _1pby1mrw _tzy4idpf _lcxvglyw _1digjh3g _1mygkb7n _18eu1wug",
|
|
@@ -31,6 +35,42 @@ var closeOnEscape = function closeOnEscape(event) {
|
|
|
31
35
|
activeElement.blur();
|
|
32
36
|
}
|
|
33
37
|
};
|
|
38
|
+
var _assignIndex = function assignIndex(num, arr) {
|
|
39
|
+
if (!arr.includes(num)) {
|
|
40
|
+
return num;
|
|
41
|
+
}
|
|
42
|
+
return _assignIndex(num + 1, arr);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Sorts an array of skip links by list indexes.
|
|
47
|
+
*
|
|
48
|
+
* Skip links with custom list indexes are positioned first, followed by regular skip links,
|
|
49
|
+
* which are automatically assigned available index positions to avoid conflicts.
|
|
50
|
+
*/
|
|
51
|
+
function sortSkipLinks(arr) {
|
|
52
|
+
var customLinks = arr.filter(function (link) {
|
|
53
|
+
return Number.isInteger(link.listIndex);
|
|
54
|
+
});
|
|
55
|
+
if (customLinks.length === 0) {
|
|
56
|
+
return arr;
|
|
57
|
+
}
|
|
58
|
+
var usedIndexes = customLinks.map(function (a) {
|
|
59
|
+
return a.listIndex;
|
|
60
|
+
});
|
|
61
|
+
var regularLinksWithIndex = arr.filter(function (link) {
|
|
62
|
+
return link.listIndex === undefined;
|
|
63
|
+
}).map(function (link, index) {
|
|
64
|
+
var listIndex = _assignIndex(index, usedIndexes);
|
|
65
|
+
usedIndexes.push(listIndex);
|
|
66
|
+
return _objectSpread(_objectSpread({}, link), {}, {
|
|
67
|
+
listIndex: listIndex
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
return [].concat(_toConsumableArray(customLinks), _toConsumableArray(regularLinksWithIndex)).sort(function (a, b) {
|
|
71
|
+
return a.listIndex - b.listIndex;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
34
74
|
var isOnlyWhitespaceRegex = /^\s*$/;
|
|
35
75
|
|
|
36
76
|
/**
|
|
@@ -48,7 +88,9 @@ export function SkipLinksContainer(_ref) {
|
|
|
48
88
|
var label = _ref.label,
|
|
49
89
|
testId = _ref.testId,
|
|
50
90
|
links = _ref.links;
|
|
51
|
-
var sortedLinks =
|
|
91
|
+
var sortedLinks = useMemo(function () {
|
|
92
|
+
return sortSkipLinks(links);
|
|
93
|
+
}, [links]);
|
|
52
94
|
if (sortedLinks.length === 0) {
|
|
53
95
|
return null;
|
|
54
96
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { SkipLinksContainer } from '../../components/skip-links/skip-links-container';
|
|
6
5
|
import { SkipLinksContext } from './skip-links-context';
|
|
7
|
-
import { SkipLinksDataContext } from './skip-links-data-context';
|
|
8
6
|
var getByDomOrderSortFunction = function getByDomOrderSortFunction() {
|
|
9
7
|
var layoutSlots = Array.from(document.querySelectorAll("[data-layout-slot]"));
|
|
10
8
|
return function (a, b) {
|
|
@@ -33,7 +31,7 @@ var getByDomOrderSortFunction = function getByDomOrderSortFunction() {
|
|
|
33
31
|
* Provider for skip links. Should be rendered at the top level of the application.
|
|
34
32
|
*
|
|
35
33
|
* - Provides the context to register/unregister skip links
|
|
36
|
-
* - Renders the skip links container
|
|
34
|
+
* - Renders the skip links container
|
|
37
35
|
*/
|
|
38
36
|
export function SkipLinksProvider(_ref) {
|
|
39
37
|
var children = _ref.children,
|
|
@@ -75,11 +73,9 @@ export function SkipLinksProvider(_ref) {
|
|
|
75
73
|
}, [registerSkipLink, unregisterSkipLink]);
|
|
76
74
|
return /*#__PURE__*/React.createElement(SkipLinksContext.Provider, {
|
|
77
75
|
value: contextValue
|
|
78
|
-
},
|
|
76
|
+
}, /*#__PURE__*/React.createElement(SkipLinksContainer, {
|
|
79
77
|
label: label,
|
|
80
78
|
testId: testId,
|
|
81
79
|
links: links
|
|
82
|
-
}), children)
|
|
83
|
-
value: links
|
|
84
|
-
}, children));
|
|
80
|
+
}), children);
|
|
85
81
|
}
|
|
@@ -3,8 +3,6 @@ import "./root.compiled.css";
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useEffect, useRef } from 'react';
|
|
5
5
|
import { OpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
import { SkipLinksContainer } from '../../components/skip-links/skip-links-container';
|
|
8
6
|
import { SkipLinksProvider } from '../../context/skip-links/skip-links-provider';
|
|
9
7
|
import { TopNavStartProvider } from '../../context/top-nav-start/top-nav-start-context-provider';
|
|
10
8
|
import { DangerouslyHoistSlotSizes } from './hoist-slot-sizes-context';
|
|
@@ -49,16 +47,7 @@ export function Root(_ref) {
|
|
|
49
47
|
}, /*#__PURE__*/React.createElement(SkipLinksProvider, {
|
|
50
48
|
label: skipLinksLabel,
|
|
51
49
|
testId: testId
|
|
52
|
-
},
|
|
53
|
-
/*#__PURE__*/
|
|
54
|
-
// SkipLinksContainer is rendered directly inside SkipLinksProvider when the FG is enabled.
|
|
55
|
-
React.createElement(SkipLinksContainer, {
|
|
56
|
-
label: skipLinksLabel,
|
|
57
|
-
testId: testId,
|
|
58
|
-
links:
|
|
59
|
-
// The links prop won't be used when the FG is disabled.
|
|
60
|
-
[]
|
|
61
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
50
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
62
51
|
ref: ref,
|
|
63
52
|
className: ax([styles.root, xcss]),
|
|
64
53
|
id: gridRootId,
|
|
@@ -3,7 +3,7 @@ import React, { type ReactNode } from 'react';
|
|
|
3
3
|
* Provider for skip links. Should be rendered at the top level of the application.
|
|
4
4
|
*
|
|
5
5
|
* - Provides the context to register/unregister skip links
|
|
6
|
-
* - Renders the skip links container
|
|
6
|
+
* - Renders the skip links container
|
|
7
7
|
*/
|
|
8
8
|
export declare function SkipLinksProvider({ children, label, testId, }: {
|
|
9
9
|
children: ReactNode;
|
|
@@ -3,7 +3,7 @@ import React, { type ReactNode } from 'react';
|
|
|
3
3
|
* Provider for skip links. Should be rendered at the top level of the application.
|
|
4
4
|
*
|
|
5
5
|
* - Provides the context to register/unregister skip links
|
|
6
|
-
* - Renders the skip links container
|
|
6
|
+
* - Renders the skip links container
|
|
7
7
|
*/
|
|
8
8
|
export declare function SkipLinksProvider({ children, label, testId, }: {
|
|
9
9
|
children: ReactNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.4",
|
|
4
4
|
"description": "The latest navigation system for Atlassian apps.",
|
|
5
5
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
6
6
|
"author": "Atlassian Pty Ltd",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
70
70
|
"@atlaskit/avatar": "^25.1.0",
|
|
71
71
|
"@atlaskit/button": "^23.4.0",
|
|
72
|
-
"@atlaskit/css": "^0.
|
|
72
|
+
"@atlaskit/css": "^0.14.0",
|
|
73
73
|
"@atlaskit/ds-lib": "^5.0.0",
|
|
74
74
|
"@atlaskit/icon": "^28.1.0",
|
|
75
75
|
"@atlaskit/layering": "^3.0.0",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
80
80
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
81
81
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
82
|
-
"@atlaskit/primitives": "^14.
|
|
83
|
-
"@atlaskit/tokens": "^6.
|
|
82
|
+
"@atlaskit/primitives": "^14.14.0",
|
|
83
|
+
"@atlaskit/tokens": "^6.3.0",
|
|
84
84
|
"@atlaskit/tooltip": "^20.4.0",
|
|
85
85
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
86
86
|
"@babel/runtime": "^7.0.0",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"@atlaskit/banner": "^14.0.0",
|
|
102
102
|
"@atlaskit/breadcrumbs": "^15.3.0",
|
|
103
103
|
"@atlaskit/dropdown-menu": "^16.3.0",
|
|
104
|
-
"@atlaskit/form": "^12.
|
|
104
|
+
"@atlaskit/form": "^12.5.0",
|
|
105
105
|
"@atlaskit/heading": "^5.2.0",
|
|
106
106
|
"@atlaskit/link": "^3.2.0",
|
|
107
107
|
"@atlaskit/lozenge": "^13.0.0",
|
|
@@ -173,9 +173,6 @@
|
|
|
173
173
|
"platform_dst_nav4_flyout_use_capture_outside": {
|
|
174
174
|
"type": "boolean"
|
|
175
175
|
},
|
|
176
|
-
"platform_dst_nav4_skip_links_hydration_fix": {
|
|
177
|
-
"type": "boolean"
|
|
178
|
-
},
|
|
179
176
|
"platform_dst_nav4_actionsonhover_focus_fix": {
|
|
180
177
|
"type": "boolean"
|
|
181
178
|
},
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.sortSkipLinks = exports.SkipLinksDataContext = void 0;
|
|
8
|
-
exports.useSortedSkipLinks = useSortedSkipLinks;
|
|
9
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
var _react = require("react");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
/**
|
|
16
|
-
* Provides a way to store skip links
|
|
17
|
-
*
|
|
18
|
-
* Note: This will be cleaned up with fg('platform_dst_nav4_skip_links_hydration_fix')
|
|
19
|
-
*/
|
|
20
|
-
var SkipLinksDataContext = exports.SkipLinksDataContext = /*#__PURE__*/(0, _react.createContext)([]);
|
|
21
|
-
var _assignIndex = function assignIndex(num, arr) {
|
|
22
|
-
if (!arr.includes(num)) {
|
|
23
|
-
return num;
|
|
24
|
-
}
|
|
25
|
-
return _assignIndex(num + 1, arr);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Sorts an array of skip links by list indexes.
|
|
30
|
-
*
|
|
31
|
-
* Skip links with custom list indexes are positioned first, followed by regular skip links,
|
|
32
|
-
* which are automatically assigned available index positions to avoid conflicts.
|
|
33
|
-
*/
|
|
34
|
-
var sortSkipLinks = exports.sortSkipLinks = function sortSkipLinks(arr) {
|
|
35
|
-
var customLinks = arr.filter(function (link) {
|
|
36
|
-
return Number.isInteger(link.listIndex);
|
|
37
|
-
});
|
|
38
|
-
if (customLinks.length === 0) {
|
|
39
|
-
return arr;
|
|
40
|
-
}
|
|
41
|
-
var usedIndexes = customLinks.map(function (a) {
|
|
42
|
-
return a.listIndex;
|
|
43
|
-
});
|
|
44
|
-
var regularLinksWithIndex = arr.filter(function (link) {
|
|
45
|
-
return link.listIndex === undefined;
|
|
46
|
-
}).map(function (link, index) {
|
|
47
|
-
var listIndex = _assignIndex(index, usedIndexes);
|
|
48
|
-
usedIndexes.push(listIndex);
|
|
49
|
-
return _objectSpread(_objectSpread({}, link), {}, {
|
|
50
|
-
listIndex: listIndex
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
return [].concat((0, _toConsumableArray2.default)(customLinks), (0, _toConsumableArray2.default)(regularLinksWithIndex)).sort(function (a, b) {
|
|
54
|
-
return a.listIndex - b.listIndex;
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Returns memoized and sorted skip links.
|
|
60
|
-
*
|
|
61
|
-
* TODO: when cleaning up fg('platform_dst_nav4_skip_links_hydration_fix'), we can inline this inside `SkipLinksContainer`.
|
|
62
|
-
*/
|
|
63
|
-
function useSortedSkipLinks(providedLinks) {
|
|
64
|
-
var skipLinksData = (0, _react.useContext)(SkipLinksDataContext);
|
|
65
|
-
var links = (0, _platformFeatureFlags.fg)('platform_dst_nav4_skip_links_hydration_fix') ? providedLinks : skipLinksData;
|
|
66
|
-
return (0, _react.useMemo)(function () {
|
|
67
|
-
return sortSkipLinks(links);
|
|
68
|
-
}, [links]);
|
|
69
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext, useMemo } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
|
-
/**
|
|
4
|
-
* Provides a way to store skip links
|
|
5
|
-
*
|
|
6
|
-
* Note: This will be cleaned up with fg('platform_dst_nav4_skip_links_hydration_fix')
|
|
7
|
-
*/
|
|
8
|
-
export const SkipLinksDataContext = /*#__PURE__*/createContext([]);
|
|
9
|
-
const assignIndex = (num, arr) => {
|
|
10
|
-
if (!arr.includes(num)) {
|
|
11
|
-
return num;
|
|
12
|
-
}
|
|
13
|
-
return assignIndex(num + 1, arr);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Sorts an array of skip links by list indexes.
|
|
18
|
-
*
|
|
19
|
-
* Skip links with custom list indexes are positioned first, followed by regular skip links,
|
|
20
|
-
* which are automatically assigned available index positions to avoid conflicts.
|
|
21
|
-
*/
|
|
22
|
-
export const sortSkipLinks = arr => {
|
|
23
|
-
const customLinks = arr.filter(link => Number.isInteger(link.listIndex));
|
|
24
|
-
if (customLinks.length === 0) {
|
|
25
|
-
return arr;
|
|
26
|
-
}
|
|
27
|
-
const usedIndexes = customLinks.map(a => a.listIndex);
|
|
28
|
-
const regularLinksWithIndex = arr.filter(link => link.listIndex === undefined).map((link, index) => {
|
|
29
|
-
const listIndex = assignIndex(index, usedIndexes);
|
|
30
|
-
usedIndexes.push(listIndex);
|
|
31
|
-
return {
|
|
32
|
-
...link,
|
|
33
|
-
listIndex
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
return [...customLinks, ...regularLinksWithIndex].sort((a, b) => a.listIndex - b.listIndex);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Returns memoized and sorted skip links.
|
|
41
|
-
*
|
|
42
|
-
* TODO: when cleaning up fg('platform_dst_nav4_skip_links_hydration_fix'), we can inline this inside `SkipLinksContainer`.
|
|
43
|
-
*/
|
|
44
|
-
export function useSortedSkipLinks(providedLinks) {
|
|
45
|
-
const skipLinksData = useContext(SkipLinksDataContext);
|
|
46
|
-
const links = fg('platform_dst_nav4_skip_links_hydration_fix') ? providedLinks : skipLinksData;
|
|
47
|
-
return useMemo(() => {
|
|
48
|
-
return sortSkipLinks(links);
|
|
49
|
-
}, [links]);
|
|
50
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import { createContext, useContext, useMemo } from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
-
/**
|
|
8
|
-
* Provides a way to store skip links
|
|
9
|
-
*
|
|
10
|
-
* Note: This will be cleaned up with fg('platform_dst_nav4_skip_links_hydration_fix')
|
|
11
|
-
*/
|
|
12
|
-
export var SkipLinksDataContext = /*#__PURE__*/createContext([]);
|
|
13
|
-
var _assignIndex = function assignIndex(num, arr) {
|
|
14
|
-
if (!arr.includes(num)) {
|
|
15
|
-
return num;
|
|
16
|
-
}
|
|
17
|
-
return _assignIndex(num + 1, arr);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Sorts an array of skip links by list indexes.
|
|
22
|
-
*
|
|
23
|
-
* Skip links with custom list indexes are positioned first, followed by regular skip links,
|
|
24
|
-
* which are automatically assigned available index positions to avoid conflicts.
|
|
25
|
-
*/
|
|
26
|
-
export var sortSkipLinks = function sortSkipLinks(arr) {
|
|
27
|
-
var customLinks = arr.filter(function (link) {
|
|
28
|
-
return Number.isInteger(link.listIndex);
|
|
29
|
-
});
|
|
30
|
-
if (customLinks.length === 0) {
|
|
31
|
-
return arr;
|
|
32
|
-
}
|
|
33
|
-
var usedIndexes = customLinks.map(function (a) {
|
|
34
|
-
return a.listIndex;
|
|
35
|
-
});
|
|
36
|
-
var regularLinksWithIndex = arr.filter(function (link) {
|
|
37
|
-
return link.listIndex === undefined;
|
|
38
|
-
}).map(function (link, index) {
|
|
39
|
-
var listIndex = _assignIndex(index, usedIndexes);
|
|
40
|
-
usedIndexes.push(listIndex);
|
|
41
|
-
return _objectSpread(_objectSpread({}, link), {}, {
|
|
42
|
-
listIndex: listIndex
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
return [].concat(_toConsumableArray(customLinks), _toConsumableArray(regularLinksWithIndex)).sort(function (a, b) {
|
|
46
|
-
return a.listIndex - b.listIndex;
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Returns memoized and sorted skip links.
|
|
52
|
-
*
|
|
53
|
-
* TODO: when cleaning up fg('platform_dst_nav4_skip_links_hydration_fix'), we can inline this inside `SkipLinksContainer`.
|
|
54
|
-
*/
|
|
55
|
-
export function useSortedSkipLinks(providedLinks) {
|
|
56
|
-
var skipLinksData = useContext(SkipLinksDataContext);
|
|
57
|
-
var links = fg('platform_dst_nav4_skip_links_hydration_fix') ? providedLinks : skipLinksData;
|
|
58
|
-
return useMemo(function () {
|
|
59
|
-
return sortSkipLinks(links);
|
|
60
|
-
}, [links]);
|
|
61
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type SkipLinkData } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Provides a way to store skip links
|
|
4
|
-
*
|
|
5
|
-
* Note: This will be cleaned up with fg('platform_dst_nav4_skip_links_hydration_fix')
|
|
6
|
-
*/
|
|
7
|
-
export declare const SkipLinksDataContext: import("react").Context<SkipLinkData[]>;
|
|
8
|
-
/**
|
|
9
|
-
* Sorts an array of skip links by list indexes.
|
|
10
|
-
*
|
|
11
|
-
* Skip links with custom list indexes are positioned first, followed by regular skip links,
|
|
12
|
-
* which are automatically assigned available index positions to avoid conflicts.
|
|
13
|
-
*/
|
|
14
|
-
export declare const sortSkipLinks: (arr: SkipLinkData[]) => SkipLinkData[];
|
|
15
|
-
/**
|
|
16
|
-
* Returns memoized and sorted skip links.
|
|
17
|
-
*
|
|
18
|
-
* TODO: when cleaning up fg('platform_dst_nav4_skip_links_hydration_fix'), we can inline this inside `SkipLinksContainer`.
|
|
19
|
-
*/
|
|
20
|
-
export declare function useSortedSkipLinks(providedLinks: Array<SkipLinkData>): Array<SkipLinkData>;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type SkipLinkData } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Provides a way to store skip links
|
|
4
|
-
*
|
|
5
|
-
* Note: This will be cleaned up with fg('platform_dst_nav4_skip_links_hydration_fix')
|
|
6
|
-
*/
|
|
7
|
-
export declare const SkipLinksDataContext: import("react").Context<SkipLinkData[]>;
|
|
8
|
-
/**
|
|
9
|
-
* Sorts an array of skip links by list indexes.
|
|
10
|
-
*
|
|
11
|
-
* Skip links with custom list indexes are positioned first, followed by regular skip links,
|
|
12
|
-
* which are automatically assigned available index positions to avoid conflicts.
|
|
13
|
-
*/
|
|
14
|
-
export declare const sortSkipLinks: (arr: SkipLinkData[]) => SkipLinkData[];
|
|
15
|
-
/**
|
|
16
|
-
* Returns memoized and sorted skip links.
|
|
17
|
-
*
|
|
18
|
-
* TODO: when cleaning up fg('platform_dst_nav4_skip_links_hydration_fix'), we can inline this inside `SkipLinksContainer`.
|
|
19
|
-
*/
|
|
20
|
-
export declare function useSortedSkipLinks(providedLinks: Array<SkipLinkData>): Array<SkipLinkData>;
|