@atlaskit/navigation-system 5.7.0 → 5.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/entry-points/side-nav-items/drag-and-drop/drag-handle.js +12 -0
- package/dist/cjs/ui/menu-item/{drag-handle.compiled.css → drag-handle/drag-handle.compiled.css} +3 -3
- package/dist/cjs/ui/menu-item/{drag-handle.js → drag-handle/drag-handle.js} +1 -1
- package/dist/cjs/ui/menu-item/drag-handle/lazy-drag-handle.js +20 -0
- package/dist/cjs/ui/menu-item/menu-item.js +4 -11
- package/dist/cjs/ui/menu-item/use-scroll-menu-item-into-view.js +3 -2
- package/dist/es2019/entry-points/side-nav-items/drag-and-drop/drag-handle.js +1 -0
- package/dist/{esm/ui/menu-item → es2019/ui/menu-item/drag-handle}/drag-handle.compiled.css +3 -3
- package/dist/es2019/ui/menu-item/{drag-handle.js → drag-handle/drag-handle.js} +1 -1
- package/dist/es2019/ui/menu-item/drag-handle/lazy-drag-handle.js +9 -0
- package/dist/es2019/ui/menu-item/menu-item.js +2 -5
- package/dist/es2019/ui/menu-item/use-scroll-menu-item-into-view.js +3 -2
- package/dist/esm/entry-points/side-nav-items/drag-and-drop/drag-handle.js +1 -0
- package/dist/{es2019/ui/menu-item → esm/ui/menu-item/drag-handle}/drag-handle.compiled.css +3 -3
- package/dist/esm/ui/menu-item/{drag-handle.js → drag-handle/drag-handle.js} +1 -1
- package/dist/esm/ui/menu-item/drag-handle/lazy-drag-handle.js +11 -0
- package/dist/esm/ui/menu-item/menu-item.js +2 -7
- package/dist/esm/ui/menu-item/use-scroll-menu-item-into-view.js +3 -2
- package/dist/types/entry-points/side-nav-items/drag-and-drop/drag-handle.d.ts +1 -0
- package/dist/types/ui/menu-item/drag-handle/lazy-drag-handle.d.ts +4 -0
- package/dist/types-ts4.5/entry-points/side-nav-items/drag-and-drop/drag-handle.d.ts +1 -0
- package/dist/types-ts4.5/ui/menu-item/drag-handle/lazy-drag-handle.d.ts +4 -0
- package/package.json +2 -2
- package/side-nav-items/drag-and-drop/drag-handle/package.json +17 -0
- /package/dist/types/ui/menu-item/{drag-handle.d.ts → drag-handle/drag-handle.d.ts} +0 -0
- /package/dist/types-ts4.5/ui/menu-item/{drag-handle.d.ts → drag-handle/drag-handle.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlassian/navigation-system
|
|
2
2
|
|
|
3
|
+
## 5.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c60dda81827ec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c60dda81827ec) -
|
|
8
|
+
Type fixes for scrollIntoViewIfNeeded
|
|
9
|
+
|
|
10
|
+
## 5.8.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`6a51c2d83eea1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6a51c2d83eea1) -
|
|
15
|
+
Export LazyDragHandle for use by custom menu items that wish to implement drag and drop.
|
|
16
|
+
|
|
3
17
|
## 5.7.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "LazyDragHandle", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _lazyDragHandle.LazyDragHandle;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _lazyDragHandle = require("../../../ui/menu-item/drag-handle/lazy-drag-handle");
|
package/dist/cjs/ui/menu-item/{drag-handle.compiled.css → drag-handle/drag-handle.compiled.css}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.
|
|
1
|
+
._152tidpf{inset-block-start:0}
|
|
2
2
|
._1bah1h6o{justify-content:center}
|
|
3
3
|
._1e02idpf{inset-inline-start:0}
|
|
4
4
|
._1e0c1i3c{display:var(--drag-handle-display,none)}
|
|
5
5
|
._2lx21bp4{flex-direction:column}
|
|
6
|
-
._94n5idpf{bottom:0}
|
|
7
6
|
._ahbqxmi2{margin-inline-start:var(--ds-space-negative-150,-9pt)}
|
|
8
7
|
._kqswstnw{position:absolute}
|
|
9
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
8
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
9
|
+
._u7coidpf{inset-block-end:0}
|
|
@@ -13,7 +13,7 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
13
13
|
var _dragHandleVertical = _interopRequireDefault(require("@atlaskit/icon/core/drag-handle-vertical"));
|
|
14
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); }
|
|
15
15
|
var styles = {
|
|
16
|
-
root: "_syazazsu _1e0c1i3c _2lx21bp4 _1bah1h6o _kqswstnw
|
|
16
|
+
root: "_syazazsu _1e0c1i3c _2lx21bp4 _1bah1h6o _kqswstnw _152tidpf _u7coidpf _1e02idpf _ahbqxmi2"
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
// Using default export to play well with React.lazy
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.LazyDragHandle = void 0;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
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" != (0, _typeof2.default)(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); } // Using `lazy` so that only consumers who want drag and drop
|
|
11
|
+
// need to include code for the drag handle.
|
|
12
|
+
/**
|
|
13
|
+
* Exposing this for use by custom components
|
|
14
|
+
*/
|
|
15
|
+
var LazyDragHandle = exports.LazyDragHandle = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
16
|
+
return Promise.resolve().then(function () {
|
|
17
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
|
|
18
|
+
'./drag-handle'));
|
|
19
|
+
});
|
|
20
|
+
});
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
6
|
Object.defineProperty(exports, "__esModule", {
|
|
6
7
|
value: true
|
|
7
8
|
});
|
|
8
9
|
exports.nestedOpenPopupCSSSelector = exports.MenuItemBase = void 0;
|
|
9
10
|
require("./menu-item.compiled.css");
|
|
10
11
|
var _runtime = require("@compiled/react/runtime");
|
|
11
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -19,20 +19,13 @@ var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
|
19
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
20
20
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
21
21
|
var _constants = require("./constants");
|
|
22
|
+
var _lazyDragHandle = require("./drag-handle/lazy-drag-handle");
|
|
22
23
|
var _expandableMenuItemContext = require("./expandable-menu-item/expandable-menu-item-context");
|
|
23
24
|
var _flyoutMenuItemContext = require("./flyout-menu-item/flyout-menu-item-context");
|
|
24
25
|
var _menuItemSignals = require("./menu-item-signals");
|
|
26
|
+
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); }
|
|
25
27
|
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; }
|
|
26
28
|
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; }
|
|
27
|
-
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" != (0, _typeof2.default)(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); }
|
|
28
|
-
// Using `lazy` so that only consumers who want drag and drop
|
|
29
|
-
// need to include code for the drag handle.
|
|
30
|
-
var LazyDragHandle = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
31
|
-
return Promise.resolve().then(function () {
|
|
32
|
-
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
|
|
33
|
-
'./drag-handle'));
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
29
|
function isTextClamped(element) {
|
|
37
30
|
// Checking for vertical height rather than horizontal height.
|
|
38
31
|
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
@@ -291,7 +284,7 @@ var MenuItemBaseNoRef = function MenuItemBaseNoRef(_ref2, forwardedRef) {
|
|
|
291
284
|
ref: descriptionRef
|
|
292
285
|
}, description)), hasDragIndicator ? /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
293
286
|
fallback: null
|
|
294
|
-
}, /*#__PURE__*/_react.default.createElement(LazyDragHandle, null)) : null, dropIndicator);
|
|
287
|
+
}, /*#__PURE__*/_react.default.createElement(_lazyDragHandle.LazyDragHandle, null)) : null, dropIndicator);
|
|
295
288
|
|
|
296
289
|
/**
|
|
297
290
|
* If the [expandable] menu item is expanded, show hover actions even when *not* hovered.
|
|
@@ -17,8 +17,9 @@ function scrollMenuItemIntoView(element) {
|
|
|
17
17
|
*
|
|
18
18
|
* Otherwise, we are falling back to [scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView).
|
|
19
19
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
var elementWithScrollMethod = element;
|
|
21
|
+
if (typeof elementWithScrollMethod.scrollIntoViewIfNeeded === 'function') {
|
|
22
|
+
elementWithScrollMethod.scrollIntoViewIfNeeded(true);
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LazyDragHandle } from '../../../ui/menu-item/drag-handle/lazy-drag-handle';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.
|
|
1
|
+
._152tidpf{inset-block-start:0}
|
|
2
2
|
._1bah1h6o{justify-content:center}
|
|
3
3
|
._1e02idpf{inset-inline-start:0}
|
|
4
4
|
._1e0c1i3c{display:var(--drag-handle-display,none)}
|
|
5
5
|
._2lx21bp4{flex-direction:column}
|
|
6
|
-
._94n5idpf{bottom:0}
|
|
7
6
|
._ahbqxmi2{margin-inline-start:var(--ds-space-negative-150,-9pt)}
|
|
8
7
|
._kqswstnw{position:absolute}
|
|
9
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
8
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
9
|
+
._u7coidpf{inset-block-end:0}
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
|
|
6
6
|
const styles = {
|
|
7
|
-
root: "_syazazsu _1e0c1i3c _2lx21bp4 _1bah1h6o _kqswstnw
|
|
7
|
+
root: "_syazazsu _1e0c1i3c _2lx21bp4 _1bah1h6o _kqswstnw _152tidpf _u7coidpf _1e02idpf _ahbqxmi2"
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
// Using default export to play well with React.lazy
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Using `lazy` so that only consumers who want drag and drop
|
|
2
|
+
// need to include code for the drag handle.
|
|
3
|
+
import { lazy } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Exposing this for use by custom components
|
|
7
|
+
*/
|
|
8
|
+
export const LazyDragHandle = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
|
|
9
|
+
'./drag-handle'));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
3
|
import "./menu-item.compiled.css";
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import React, {
|
|
5
|
+
import React, { Suspense, useCallback, useRef } from 'react';
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
7
|
import { AvatarContext } from '@atlaskit/avatar';
|
|
8
8
|
import forwardRefWithGeneric from '@atlaskit/ds-lib/forward-ref-with-generic';
|
|
@@ -10,13 +10,10 @@ import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
|
10
10
|
import { Anchor, Pressable, Text } from '@atlaskit/primitives/compiled';
|
|
11
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
12
12
|
import { expandableMenuItemIndentation } from './constants';
|
|
13
|
+
import { LazyDragHandle } from './drag-handle/lazy-drag-handle';
|
|
13
14
|
import { useLevel } from './expandable-menu-item/expandable-menu-item-context';
|
|
14
15
|
import { useFlyoutMenuOpen, useSetFlyoutMenuOpen } from './flyout-menu-item/flyout-menu-item-context';
|
|
15
16
|
import { COLLAPSE_ELEM_BEFORE } from './menu-item-signals';
|
|
16
|
-
// Using `lazy` so that only consumers who want drag and drop
|
|
17
|
-
// need to include code for the drag handle.
|
|
18
|
-
const LazyDragHandle = /*#__PURE__*/lazy(() => import( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
|
|
19
|
-
'./drag-handle'));
|
|
20
17
|
function isTextClamped(element) {
|
|
21
18
|
// Checking for vertical height rather than horizontal height.
|
|
22
19
|
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
@@ -10,8 +10,9 @@ function scrollMenuItemIntoView(element) {
|
|
|
10
10
|
*
|
|
11
11
|
* Otherwise, we are falling back to [scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView).
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const elementWithScrollMethod = element;
|
|
14
|
+
if (typeof elementWithScrollMethod.scrollIntoViewIfNeeded === 'function') {
|
|
15
|
+
elementWithScrollMethod.scrollIntoViewIfNeeded(true);
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LazyDragHandle } from '../../../ui/menu-item/drag-handle/lazy-drag-handle';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.
|
|
1
|
+
._152tidpf{inset-block-start:0}
|
|
2
2
|
._1bah1h6o{justify-content:center}
|
|
3
3
|
._1e02idpf{inset-inline-start:0}
|
|
4
4
|
._1e0c1i3c{display:var(--drag-handle-display,none)}
|
|
5
5
|
._2lx21bp4{flex-direction:column}
|
|
6
|
-
._94n5idpf{bottom:0}
|
|
7
6
|
._ahbqxmi2{margin-inline-start:var(--ds-space-negative-150,-9pt)}
|
|
8
7
|
._kqswstnw{position:absolute}
|
|
9
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
8
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
9
|
+
._u7coidpf{inset-block-end:0}
|
|
@@ -4,7 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';
|
|
6
6
|
var styles = {
|
|
7
|
-
root: "_syazazsu _1e0c1i3c _2lx21bp4 _1bah1h6o _kqswstnw
|
|
7
|
+
root: "_syazazsu _1e0c1i3c _2lx21bp4 _1bah1h6o _kqswstnw _152tidpf _u7coidpf _1e02idpf _ahbqxmi2"
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
// Using default export to play well with React.lazy
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Using `lazy` so that only consumers who want drag and drop
|
|
2
|
+
// need to include code for the drag handle.
|
|
3
|
+
import { lazy } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Exposing this for use by custom components
|
|
7
|
+
*/
|
|
8
|
+
export var LazyDragHandle = /*#__PURE__*/lazy(function () {
|
|
9
|
+
return import( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
|
|
10
|
+
'./drag-handle');
|
|
11
|
+
});
|
|
@@ -5,7 +5,7 @@ import "./menu-item.compiled.css";
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
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; }
|
|
7
7
|
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; }
|
|
8
|
-
import React, {
|
|
8
|
+
import React, { Suspense, useCallback, useRef } from 'react';
|
|
9
9
|
import { cx } from '@compiled/react';
|
|
10
10
|
import { AvatarContext } from '@atlaskit/avatar';
|
|
11
11
|
import forwardRefWithGeneric from '@atlaskit/ds-lib/forward-ref-with-generic';
|
|
@@ -13,15 +13,10 @@ import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
|
13
13
|
import { Anchor, Pressable, Text } from '@atlaskit/primitives/compiled';
|
|
14
14
|
import Tooltip from '@atlaskit/tooltip';
|
|
15
15
|
import { expandableMenuItemIndentation } from './constants';
|
|
16
|
+
import { LazyDragHandle } from './drag-handle/lazy-drag-handle';
|
|
16
17
|
import { useLevel } from './expandable-menu-item/expandable-menu-item-context';
|
|
17
18
|
import { useFlyoutMenuOpen, useSetFlyoutMenuOpen } from './flyout-menu-item/flyout-menu-item-context';
|
|
18
19
|
import { COLLAPSE_ELEM_BEFORE } from './menu-item-signals';
|
|
19
|
-
// Using `lazy` so that only consumers who want drag and drop
|
|
20
|
-
// need to include code for the drag handle.
|
|
21
|
-
var LazyDragHandle = /*#__PURE__*/lazy(function () {
|
|
22
|
-
return import( /* webpackChunkName: "@atlaskit-internal_nav4-menu-item-drag-handle" */
|
|
23
|
-
'./drag-handle');
|
|
24
|
-
});
|
|
25
20
|
function isTextClamped(element) {
|
|
26
21
|
// Checking for vertical height rather than horizontal height.
|
|
27
22
|
// When text is "clamped", it's technically being clamped vertically! 🤯
|
|
@@ -10,8 +10,9 @@ function scrollMenuItemIntoView(element) {
|
|
|
10
10
|
*
|
|
11
11
|
* Otherwise, we are falling back to [scrollIntoView](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView).
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var elementWithScrollMethod = element;
|
|
14
|
+
if (typeof elementWithScrollMethod.scrollIntoViewIfNeeded === 'function') {
|
|
15
|
+
elementWithScrollMethod.scrollIntoViewIfNeeded(true);
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LazyDragHandle } from '../../../ui/menu-item/drag-handle/lazy-drag-handle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LazyDragHandle } from '../../../ui/menu-item/drag-handle/lazy-drag-handle';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/navigation-system",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.1",
|
|
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",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
82
82
|
"@atlaskit/primitives": "^16.1.0",
|
|
83
83
|
"@atlaskit/tokens": "^8.0.0",
|
|
84
|
-
"@atlaskit/tooltip": "^20.
|
|
84
|
+
"@atlaskit/tooltip": "^20.10.0",
|
|
85
85
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
86
86
|
"@babel/runtime": "^7.0.0",
|
|
87
87
|
"@compiled/react": "^0.18.6",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/navigation-system/side-nav-items/drag-and-drop/drag-handle",
|
|
3
|
+
"main": "../../../dist/cjs/entry-points/side-nav-items/drag-and-drop/drag-handle.js",
|
|
4
|
+
"module": "../../../dist/esm/entry-points/side-nav-items/drag-and-drop/drag-handle.js",
|
|
5
|
+
"module:es2019": "../../../dist/es2019/entry-points/side-nav-items/drag-and-drop/drag-handle.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../../dist/types/entry-points/side-nav-items/drag-and-drop/drag-handle.d.ts",
|
|
10
|
+
"typesVersions": {
|
|
11
|
+
">=4.5 <5.9": {
|
|
12
|
+
"*": [
|
|
13
|
+
"../../../dist/types-ts4.5/entry-points/side-nav-items/drag-and-drop/drag-handle.d.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
File without changes
|
|
File without changes
|