@atlaskit/menu 2.7.1 → 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 CHANGED
@@ -1,5 +1,37 @@
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
+
12
+ ## 2.7.4
13
+
14
+ ### Patch Changes
15
+
16
+ - [#119132](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119132)
17
+ [`68ee7be8867d0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/68ee7be8867d0) -
18
+ Remove remnants of `extract-react-types` from tsconfig file.
19
+
20
+ ## 2.7.3
21
+
22
+ ### Patch Changes
23
+
24
+ - [#119110](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/119110)
25
+ [`cb28fa67e9a16`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cb28fa67e9a16) -
26
+ Update Atlaskit docs so that they point to current ADS site. Remove remnants of
27
+ `extract-react-types`.
28
+
29
+ ## 2.7.2
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies
34
+
3
35
  ## 2.7.1
4
36
 
5
37
  ### 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
- }, (0, _platformFeatureFlags.fg)('platform.wanjel.remove-drag-override-in-menu-items_l1dib') ? {} : {
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
- }, (0, _platformFeatureFlags.fg)('platform.wanjel.remove-drag-override-in-menu-items_l1dib') ? {} : {
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
- }, fg('platform.wanjel.remove-drag-override-in-menu-items_l1dib') ? {} : {
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
- }, fg('platform.wanjel.remove-drag-override-in-menu-items_l1dib') ? {} : {
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
- }, fg('platform.wanjel.remove-drag-override-in-menu-items_l1dib') ? {} : {
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
- }, fg('platform.wanjel.remove-drag-override-in-menu-items_l1dib') ? {} : {
107
+ }, UNSAFE_isDraggable ? {} : {
107
108
  draggable: false,
108
109
  onDragStart: preventEvent
109
110
  }, {
@@ -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.7.1",
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/"
@@ -47,9 +47,9 @@
47
47
  "@atlaskit/ds-lib": "^2.3.0",
48
48
  "@atlaskit/focus-ring": "^1.5.0",
49
49
  "@atlaskit/platform-feature-flags": "^0.3.0",
50
- "@atlaskit/primitives": "^10.0.0",
50
+ "@atlaskit/primitives": "^11.0.0",
51
51
  "@atlaskit/theme": "^12.11.0",
52
- "@atlaskit/tokens": "^1.53.0",
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/"
@@ -1,8 +0,0 @@
1
- import type { CustomItemProps } from '../src/types';
2
-
3
- /**
4
- * The props definition in custom-item.tsx breaks ERT unfortunately,
5
- * because we had to typecast the component to make forwardRef work with generics
6
- * (for the custom component props).
7
- */
8
- export default function (_: CustomItemProps) {}