@atlaskit/side-nav-items 1.4.0 → 1.4.2
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/ui/menu-item/button-menu-item.js +4 -5
- package/dist/cjs/ui/menu-item/drag-and-drop/use-menu-item-drag-and-drop.js +12 -3
- package/dist/es2019/ui/menu-item/button-menu-item.js +4 -5
- package/dist/es2019/ui/menu-item/drag-and-drop/use-menu-item-drag-and-drop.js +12 -3
- package/dist/esm/ui/menu-item/button-menu-item.js +4 -5
- package/dist/esm/ui/menu-item/drag-and-drop/use-menu-item-drag-and-drop.js +12 -3
- package/package.json +7 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/side-nav-items
|
|
2
2
|
|
|
3
|
+
## 1.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`20e1df968ddc7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/20e1df968ddc7) -
|
|
8
|
+
Clean up feature gate platform-dst-buttonmenuitem-selected-state-support
|
|
9
|
+
|
|
10
|
+
## 1.4.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 1.4.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ButtonMenuItem = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _menuItem = require("./menu-item");
|
|
11
10
|
var _menuListItem = require("./menu-list-item");
|
|
12
11
|
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); }
|
|
@@ -51,10 +50,10 @@ var ButtonMenuItem = exports.ButtonMenuItem = /*#__PURE__*/(0, _react.forwardRef
|
|
|
51
50
|
actions: isDisabled ? undefined : actions,
|
|
52
51
|
actionsOnHover: isDisabled ? undefined : actionsOnHover,
|
|
53
52
|
onClick: onClick,
|
|
54
|
-
ariaControls:
|
|
55
|
-
ariaExpanded:
|
|
56
|
-
ariaHasPopup:
|
|
57
|
-
isSelected:
|
|
53
|
+
ariaControls: ariaControls,
|
|
54
|
+
ariaExpanded: ariaExpanded,
|
|
55
|
+
ariaHasPopup: ariaHasPopup,
|
|
56
|
+
isSelected: isSelected,
|
|
58
57
|
ref: forwardedRef,
|
|
59
58
|
visualContentRef: visualContentRef,
|
|
60
59
|
interactionName: interactionName,
|
|
@@ -13,7 +13,6 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
var _reactDom = require("react-dom");
|
|
16
|
-
var _tinyInvariant = _interopRequireDefault(require("tiny-invariant"));
|
|
17
16
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
18
17
|
var _pointerOutsideOfPreview = require("@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview");
|
|
19
18
|
var _setCustomNativeDragPreview = require("@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview");
|
|
@@ -54,7 +53,12 @@ function useMenuItemDragAndDrop(_ref) {
|
|
|
54
53
|
return;
|
|
55
54
|
}
|
|
56
55
|
var element = getDraggableElement();
|
|
57
|
-
|
|
56
|
+
|
|
57
|
+
// Some elements may initially want to use DnD, then decide not to render.
|
|
58
|
+
// In that case, we don't want to throw an error.
|
|
59
|
+
if (!element) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
58
62
|
return (0, _adapter.draggable)({
|
|
59
63
|
element: element,
|
|
60
64
|
getInitialData: draggableArgs.getInitialData,
|
|
@@ -105,7 +109,12 @@ function useMenuItemDragAndDrop(_ref) {
|
|
|
105
109
|
// Using this element in our `canDrop` check
|
|
106
110
|
var draggableElement = getDraggableElement();
|
|
107
111
|
var dropTarget = dropTargetRef.current;
|
|
108
|
-
|
|
112
|
+
|
|
113
|
+
// Some elements may initially want to use DnD, then decide not to render.
|
|
114
|
+
// In that case, we don't want to throw an error
|
|
115
|
+
if (!dropTarget) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
109
118
|
return (0, _adapter.dropTargetForElements)({
|
|
110
119
|
element: dropTarget,
|
|
111
120
|
// cannot drop on self
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { MenuItemBase } from './menu-item';
|
|
4
3
|
import { MenuListItem } from './menu-list-item';
|
|
5
4
|
/**
|
|
@@ -44,10 +43,10 @@ export const ButtonMenuItem = /*#__PURE__*/forwardRef(({
|
|
|
44
43
|
actions: isDisabled ? undefined : actions,
|
|
45
44
|
actionsOnHover: isDisabled ? undefined : actionsOnHover,
|
|
46
45
|
onClick: onClick,
|
|
47
|
-
ariaControls:
|
|
48
|
-
ariaExpanded:
|
|
49
|
-
ariaHasPopup:
|
|
50
|
-
isSelected:
|
|
46
|
+
ariaControls: ariaControls,
|
|
47
|
+
ariaExpanded: ariaExpanded,
|
|
48
|
+
ariaHasPopup: ariaHasPopup,
|
|
49
|
+
isSelected: isSelected,
|
|
51
50
|
ref: forwardedRef,
|
|
52
51
|
visualContentRef: visualContentRef,
|
|
53
52
|
interactionName: interactionName,
|
|
@@ -3,7 +3,6 @@ import * as React from 'react';
|
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
|
-
import invariant from 'tiny-invariant';
|
|
7
6
|
import { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
8
7
|
import { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
|
|
9
8
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
|
|
@@ -39,7 +38,12 @@ export function useMenuItemDragAndDrop({
|
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
41
40
|
const element = getDraggableElement();
|
|
42
|
-
|
|
41
|
+
|
|
42
|
+
// Some elements may initially want to use DnD, then decide not to render.
|
|
43
|
+
// In that case, we don't want to throw an error.
|
|
44
|
+
if (!element) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
43
47
|
return draggable({
|
|
44
48
|
element,
|
|
45
49
|
getInitialData: draggableArgs.getInitialData,
|
|
@@ -92,7 +96,12 @@ export function useMenuItemDragAndDrop({
|
|
|
92
96
|
// Using this element in our `canDrop` check
|
|
93
97
|
const draggableElement = getDraggableElement();
|
|
94
98
|
const dropTarget = dropTargetRef.current;
|
|
95
|
-
|
|
99
|
+
|
|
100
|
+
// Some elements may initially want to use DnD, then decide not to render.
|
|
101
|
+
// In that case, we don't want to throw an error
|
|
102
|
+
if (!dropTarget) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
96
105
|
return dropTargetForElements({
|
|
97
106
|
element: dropTarget,
|
|
98
107
|
// cannot drop on self
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { MenuItemBase } from './menu-item';
|
|
4
3
|
import { MenuListItem } from './menu-list-item';
|
|
5
4
|
/**
|
|
@@ -43,10 +42,10 @@ export var ButtonMenuItem = /*#__PURE__*/forwardRef(function (_ref, forwardedRef
|
|
|
43
42
|
actions: isDisabled ? undefined : actions,
|
|
44
43
|
actionsOnHover: isDisabled ? undefined : actionsOnHover,
|
|
45
44
|
onClick: onClick,
|
|
46
|
-
ariaControls:
|
|
47
|
-
ariaExpanded:
|
|
48
|
-
ariaHasPopup:
|
|
49
|
-
isSelected:
|
|
45
|
+
ariaControls: ariaControls,
|
|
46
|
+
ariaExpanded: ariaExpanded,
|
|
47
|
+
ariaHasPopup: ariaHasPopup,
|
|
48
|
+
isSelected: isSelected,
|
|
50
49
|
ref: forwardedRef,
|
|
51
50
|
visualContentRef: visualContentRef,
|
|
52
51
|
interactionName: interactionName,
|
|
@@ -7,7 +7,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
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
8
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
import { createPortal } from 'react-dom';
|
|
10
|
-
import invariant from 'tiny-invariant';
|
|
11
10
|
import { draggable, dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
|
|
12
11
|
import { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';
|
|
13
12
|
import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';
|
|
@@ -45,7 +44,12 @@ export function useMenuItemDragAndDrop(_ref) {
|
|
|
45
44
|
return;
|
|
46
45
|
}
|
|
47
46
|
var element = getDraggableElement();
|
|
48
|
-
|
|
47
|
+
|
|
48
|
+
// Some elements may initially want to use DnD, then decide not to render.
|
|
49
|
+
// In that case, we don't want to throw an error.
|
|
50
|
+
if (!element) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
49
53
|
return draggable({
|
|
50
54
|
element: element,
|
|
51
55
|
getInitialData: draggableArgs.getInitialData,
|
|
@@ -96,7 +100,12 @@ export function useMenuItemDragAndDrop(_ref) {
|
|
|
96
100
|
// Using this element in our `canDrop` check
|
|
97
101
|
var draggableElement = getDraggableElement();
|
|
98
102
|
var dropTarget = dropTargetRef.current;
|
|
99
|
-
|
|
103
|
+
|
|
104
|
+
// Some elements may initially want to use DnD, then decide not to render.
|
|
105
|
+
// In that case, we don't want to throw an error
|
|
106
|
+
if (!dropTarget) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
100
109
|
return dropTargetForElements({
|
|
101
110
|
element: dropTarget,
|
|
102
111
|
// cannot drop on self
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/side-nav-items",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Menu items and elements for the navigation side nav area.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
|
|
42
42
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
43
43
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
44
|
-
"@atlaskit/primitives": "^
|
|
45
|
-
"@atlaskit/tokens": "^
|
|
44
|
+
"@atlaskit/primitives": "^18.0.0",
|
|
45
|
+
"@atlaskit/tokens": "^11.0.0",
|
|
46
46
|
"@atlaskit/tooltip": "^20.14.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@compiled/react": "^0.18.6",
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
"@af/accessibility-testing": "workspace:^",
|
|
57
57
|
"@af/integration-testing": "workspace:^",
|
|
58
58
|
"@af/visual-regression": "workspace:^",
|
|
59
|
-
"@atlaskit/app-provider": "^
|
|
60
|
-
"@atlaskit/lozenge": "^13.
|
|
59
|
+
"@atlaskit/app-provider": "^4.0.0",
|
|
60
|
+
"@atlaskit/lozenge": "^13.4.0",
|
|
61
61
|
"@atlaskit/navigation-system": "^5.32.0",
|
|
62
62
|
"@atlaskit/ssr": "workspace:^",
|
|
63
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
63
|
+
"@atlassian/a11y-jest-testing": "^0.9.0",
|
|
64
64
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
65
65
|
"@atlassian/testing-library": "^0.4.0",
|
|
66
|
-
"@testing-library/react": "^
|
|
66
|
+
"@testing-library/react": "^16.3.0",
|
|
67
67
|
"bind-event-listener": "^3.0.0",
|
|
68
68
|
"react-dom": "^18.2.0"
|
|
69
69
|
},
|
|
@@ -103,9 +103,6 @@
|
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
"platform-feature-flags": {
|
|
106
|
-
"platform-dst-buttonmenuitem-selected-state-support": {
|
|
107
|
-
"type": "boolean"
|
|
108
|
-
},
|
|
109
106
|
"platform-dst-shape-theme-default": {
|
|
110
107
|
"type": "boolean"
|
|
111
108
|
},
|