@atlaskit/menu 2.7.4 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/menu-item/custom-item.js +3 -2
- package/dist/cjs/menu-item/link-item.js +3 -2
- package/dist/es2019/menu-item/custom-item.js +2 -1
- package/dist/es2019/menu-item/link-item.js +2 -1
- package/dist/esm/menu-item/custom-item.js +3 -2
- package/dist/esm/menu-item/link-item.js +3 -2
- package/dist/types/types.d.ts +10 -0
- package/dist/types-ts4.5/types.d.ts +10 -0
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/menu
|
|
2
2
|
|
|
3
|
+
## 2.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#120033](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120033)
|
|
8
|
+
[`89fdaa528833e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/89fdaa528833e) -
|
|
9
|
+
Added an UNSAFE_isDraggable prop to LinkItem and menu item that disable drag overrides within the
|
|
10
|
+
components
|
|
11
|
+
|
|
3
12
|
## 2.7.4
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -13,7 +13,7 @@ var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning");
|
|
|
13
13
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
14
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
15
|
var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/menu-item-primitive"));
|
|
16
|
-
var _excluded = ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className"];
|
|
16
|
+
var _excluded = ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className", "UNSAFE_isDraggable"];
|
|
17
17
|
/**
|
|
18
18
|
* @jsxRuntime classic
|
|
19
19
|
*/
|
|
@@ -52,6 +52,7 @@ var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
|
|
|
52
52
|
shouldTitleWrap = _ref.shouldTitleWrap,
|
|
53
53
|
shouldDescriptionWrap = _ref.shouldDescriptionWrap,
|
|
54
54
|
UNSAFE_className = _ref.className,
|
|
55
|
+
UNSAFE_isDraggable = _ref.UNSAFE_isDraggable,
|
|
55
56
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
56
57
|
var onMouseDownHandler = onMouseDown;
|
|
57
58
|
if (!Component) {
|
|
@@ -92,7 +93,7 @@ var CustomItem = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forwardR
|
|
|
92
93
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
93
94
|
className: className,
|
|
94
95
|
ref: ref
|
|
95
|
-
},
|
|
96
|
+
}, UNSAFE_isDraggable ? {} : {
|
|
96
97
|
draggable: false,
|
|
97
98
|
onDragStart: preventEvent
|
|
98
99
|
}, {
|
|
@@ -14,7 +14,7 @@ var _deprecationWarning = require("@atlaskit/ds-lib/deprecation-warning");
|
|
|
14
14
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
16
|
var _menuItemPrimitive = _interopRequireDefault(require("../internal/components/menu-item-primitive"));
|
|
17
|
-
var _excluded = ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className", "UNSAFE_shouldDisableRouterLink"];
|
|
17
|
+
var _excluded = ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className", "UNSAFE_shouldDisableRouterLink", "UNSAFE_isDraggable"];
|
|
18
18
|
/**
|
|
19
19
|
* @jsxRuntime classic
|
|
20
20
|
*/
|
|
@@ -56,6 +56,7 @@ function (props, ref) {
|
|
|
56
56
|
shouldDescriptionWrap = props.shouldDescriptionWrap,
|
|
57
57
|
UNSAFE_className = props.className,
|
|
58
58
|
UNSAFE_shouldDisableRouterLink = props.UNSAFE_shouldDisableRouterLink,
|
|
59
|
+
UNSAFE_isDraggable = props.UNSAFE_isDraggable,
|
|
59
60
|
rest = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
60
61
|
var onMouseDownHandler = onMouseDown;
|
|
61
62
|
var RouterLink = (0, _appProvider.useRouterLink)();
|
|
@@ -109,7 +110,7 @@ function (props, ref) {
|
|
|
109
110
|
// @ts-expect-error
|
|
110
111
|
,
|
|
111
112
|
href: isDisabled ? undefined : href
|
|
112
|
-
},
|
|
113
|
+
}, UNSAFE_isDraggable ? {} : {
|
|
113
114
|
draggable: false,
|
|
114
115
|
onDragStart: preventEvent
|
|
115
116
|
}, {
|
|
@@ -46,6 +46,7 @@ const CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
46
46
|
// picked it out and supressed the expected type error.
|
|
47
47
|
// @ts-expect-error
|
|
48
48
|
className: UNSAFE_className,
|
|
49
|
+
UNSAFE_isDraggable,
|
|
49
50
|
...rest
|
|
50
51
|
}, ref) => {
|
|
51
52
|
const onMouseDownHandler = onMouseDown;
|
|
@@ -87,7 +88,7 @@ const CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(({
|
|
|
87
88
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
88
89
|
className: className,
|
|
89
90
|
ref: ref
|
|
90
|
-
},
|
|
91
|
+
}, UNSAFE_isDraggable ? {} : {
|
|
91
92
|
draggable: false,
|
|
92
93
|
onDragStart: preventEvent
|
|
93
94
|
}, {
|
|
@@ -50,6 +50,7 @@ const LinkItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(
|
|
|
50
50
|
// @ts-expect-error
|
|
51
51
|
className: UNSAFE_className,
|
|
52
52
|
UNSAFE_shouldDisableRouterLink,
|
|
53
|
+
UNSAFE_isDraggable,
|
|
53
54
|
...rest
|
|
54
55
|
} = props;
|
|
55
56
|
const onMouseDownHandler = onMouseDown;
|
|
@@ -104,7 +105,7 @@ const LinkItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(
|
|
|
104
105
|
// @ts-expect-error
|
|
105
106
|
,
|
|
106
107
|
href: isDisabled ? undefined : href
|
|
107
|
-
},
|
|
108
|
+
}, UNSAFE_isDraggable ? {} : {
|
|
108
109
|
draggable: false,
|
|
109
110
|
onDragStart: preventEvent
|
|
110
111
|
}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className"];
|
|
3
|
+
var _excluded = ["component", "cssFn", "isDisabled", "isSelected", "onClick", "testId", "children", "description", "iconAfter", "iconBefore", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className", "UNSAFE_isDraggable"];
|
|
4
4
|
/**
|
|
5
5
|
* @jsxRuntime classic
|
|
6
6
|
*/
|
|
@@ -47,6 +47,7 @@ var CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
47
47
|
shouldTitleWrap = _ref.shouldTitleWrap,
|
|
48
48
|
shouldDescriptionWrap = _ref.shouldDescriptionWrap,
|
|
49
49
|
UNSAFE_className = _ref.className,
|
|
50
|
+
UNSAFE_isDraggable = _ref.UNSAFE_isDraggable,
|
|
50
51
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
51
52
|
var onMouseDownHandler = onMouseDown;
|
|
52
53
|
if (!Component) {
|
|
@@ -87,7 +88,7 @@ var CustomItem = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
87
88
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
88
89
|
className: className,
|
|
89
90
|
ref: ref
|
|
90
|
-
},
|
|
91
|
+
}, UNSAFE_isDraggable ? {} : {
|
|
91
92
|
draggable: false,
|
|
92
93
|
onDragStart: preventEvent
|
|
93
94
|
}, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className", "UNSAFE_shouldDisableRouterLink"];
|
|
3
|
+
var _excluded = ["children", "href", "cssFn", "description", "iconAfter", "iconBefore", "isDisabled", "isSelected", "onClick", "testId", "overrides", "onMouseDown", "shouldTitleWrap", "shouldDescriptionWrap", "className", "UNSAFE_shouldDisableRouterLink", "UNSAFE_isDraggable"];
|
|
4
4
|
/**
|
|
5
5
|
* @jsxRuntime classic
|
|
6
6
|
*/
|
|
@@ -50,6 +50,7 @@ function (props, ref) {
|
|
|
50
50
|
shouldDescriptionWrap = props.shouldDescriptionWrap,
|
|
51
51
|
UNSAFE_className = props.className,
|
|
52
52
|
UNSAFE_shouldDisableRouterLink = props.UNSAFE_shouldDisableRouterLink,
|
|
53
|
+
UNSAFE_isDraggable = props.UNSAFE_isDraggable,
|
|
53
54
|
rest = _objectWithoutProperties(props, _excluded);
|
|
54
55
|
var onMouseDownHandler = onMouseDown;
|
|
55
56
|
var RouterLink = useRouterLink();
|
|
@@ -103,7 +104,7 @@ function (props, ref) {
|
|
|
103
104
|
// @ts-expect-error
|
|
104
105
|
,
|
|
105
106
|
href: isDisabled ? undefined : href
|
|
106
|
-
},
|
|
107
|
+
}, UNSAFE_isDraggable ? {} : {
|
|
107
108
|
draggable: false,
|
|
108
109
|
onDragStart: preventEvent
|
|
109
110
|
}, {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -242,6 +242,11 @@ export interface LinkItemProps extends MenuItemProps {
|
|
|
242
242
|
* Marked as "unsafe" because ideally, router links should be used for all internal links.
|
|
243
243
|
*/
|
|
244
244
|
UNSAFE_shouldDisableRouterLink?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Use this to prevent disable of drag functionality on the menu item.
|
|
247
|
+
* Marked as "unsafe" as this may break existing instances of drag handling.
|
|
248
|
+
*/
|
|
249
|
+
UNSAFE_isDraggable?: boolean;
|
|
245
250
|
}
|
|
246
251
|
export interface CustomItemComponentProps {
|
|
247
252
|
/**
|
|
@@ -302,6 +307,11 @@ export interface CustomItemProps<TCustomComponentProps = CustomItemComponentProp
|
|
|
302
307
|
* __NOTE:__ Make sure the reference for this component does not change between renders else undefined behavior may happen.
|
|
303
308
|
*/
|
|
304
309
|
component?: React.ComponentType<PropsWithChildren<TCustomComponentProps>>;
|
|
310
|
+
/**
|
|
311
|
+
* Use this to prevent disable of drag functionality on the menu item.
|
|
312
|
+
* Marked as "unsafe" as this may break existing instances of drag handling.
|
|
313
|
+
*/
|
|
314
|
+
UNSAFE_isDraggable?: boolean;
|
|
305
315
|
}
|
|
306
316
|
export interface SkeletonItemProps {
|
|
307
317
|
/**
|
|
@@ -242,6 +242,11 @@ export interface LinkItemProps extends MenuItemProps {
|
|
|
242
242
|
* Marked as "unsafe" because ideally, router links should be used for all internal links.
|
|
243
243
|
*/
|
|
244
244
|
UNSAFE_shouldDisableRouterLink?: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Use this to prevent disable of drag functionality on the menu item.
|
|
247
|
+
* Marked as "unsafe" as this may break existing instances of drag handling.
|
|
248
|
+
*/
|
|
249
|
+
UNSAFE_isDraggable?: boolean;
|
|
245
250
|
}
|
|
246
251
|
export interface CustomItemComponentProps {
|
|
247
252
|
/**
|
|
@@ -302,6 +307,11 @@ export interface CustomItemProps<TCustomComponentProps = CustomItemComponentProp
|
|
|
302
307
|
* __NOTE:__ Make sure the reference for this component does not change between renders else undefined behavior may happen.
|
|
303
308
|
*/
|
|
304
309
|
component?: React.ComponentType<PropsWithChildren<TCustomComponentProps>>;
|
|
310
|
+
/**
|
|
311
|
+
* Use this to prevent disable of drag functionality on the menu item.
|
|
312
|
+
* Marked as "unsafe" as this may break existing instances of drag handling.
|
|
313
|
+
*/
|
|
314
|
+
UNSAFE_isDraggable?: boolean;
|
|
305
315
|
}
|
|
306
316
|
export interface SkeletonItemProps {
|
|
307
317
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/menu",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "A list of options to help users navigate, or perform actions.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
50
50
|
"@atlaskit/primitives": "^11.0.0",
|
|
51
51
|
"@atlaskit/theme": "^12.11.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.54.0",
|
|
53
53
|
"@babel/runtime": "^7.0.0",
|
|
54
54
|
"@emotion/react": "^11.7.1"
|
|
55
55
|
},
|
|
@@ -132,9 +132,6 @@
|
|
|
132
132
|
},
|
|
133
133
|
"platform.wanjel.use-router-links-for-the-linkitem-component": {
|
|
134
134
|
"type": "boolean"
|
|
135
|
-
},
|
|
136
|
-
"platform.wanjel.remove-drag-override-in-menu-items_l1dib": {
|
|
137
|
-
"type": "boolean"
|
|
138
135
|
}
|
|
139
136
|
},
|
|
140
137
|
"homepage": "https://atlassian.design/components/menu/"
|