@atlaskit/dropdown-menu 12.13.4 → 12.14.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
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/dropdown-menu
|
|
2
2
|
|
|
3
|
+
## 12.14.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 12.14.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#116502](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116502)
|
|
14
|
+
[`9796cf77195b6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9796cf77195b6) -
|
|
15
|
+
Adds a new optional `UNSAFE_shouldDisableRouterLink` prop to the `DropdownItem` component, which
|
|
16
|
+
when set to `true`, will opt out of using a router link and instead use a regular anchor element
|
|
17
|
+
when used alongside the `href` prop.
|
|
18
|
+
|
|
3
19
|
## 12.13.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -14,7 +14,7 @@ var _buttonItem = _interopRequireDefault(require("@atlaskit/menu/button-item"));
|
|
|
14
14
|
var _customItem = _interopRequireDefault(require("@atlaskit/menu/custom-item"));
|
|
15
15
|
var _linkItem = _interopRequireDefault(require("@atlaskit/menu/link-item"));
|
|
16
16
|
var _useRegisterItemWithFocusManager = _interopRequireDefault(require("./internal/hooks/use-register-item-with-focus-manager"));
|
|
17
|
-
var _excluded = ["children", "component", "description", "elemAfter", "elemBefore", "href", "isDisabled", "isSelected", "onClick", "rel", "shouldDescriptionWrap", "shouldTitleWrap", "target", "testId"];
|
|
17
|
+
var _excluded = ["children", "component", "description", "elemAfter", "elemBefore", "href", "isDisabled", "isSelected", "onClick", "rel", "shouldDescriptionWrap", "shouldTitleWrap", "target", "testId", "UNSAFE_shouldDisableRouterLink"];
|
|
18
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
19
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
20
|
/**
|
|
@@ -43,6 +43,7 @@ var DropdownMenuItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
43
43
|
shouldTitleWrap = _ref$shouldTitleWrap === void 0 ? true : _ref$shouldTitleWrap,
|
|
44
44
|
target = _ref.target,
|
|
45
45
|
testId = _ref.testId,
|
|
46
|
+
UNSAFE_shouldDisableRouterLink = _ref.UNSAFE_shouldDisableRouterLink,
|
|
46
47
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
47
48
|
var itemRef = (0, _useRegisterItemWithFocusManager.default)();
|
|
48
49
|
if (component) {
|
|
@@ -82,7 +83,8 @@ var DropdownMenuItem = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref)
|
|
|
82
83
|
shouldDescriptionWrap: shouldDescriptionWrap,
|
|
83
84
|
shouldTitleWrap: shouldTitleWrap,
|
|
84
85
|
target: target,
|
|
85
|
-
testId: testId
|
|
86
|
+
testId: testId,
|
|
87
|
+
UNSAFE_shouldDisableRouterLink: UNSAFE_shouldDisableRouterLink
|
|
86
88
|
// DSP-13312 TODO: remove spread props in future major release
|
|
87
89
|
}, rest), children);
|
|
88
90
|
} else {
|
|
@@ -29,6 +29,7 @@ const DropdownMenuItem = /*#__PURE__*/forwardRef(({
|
|
|
29
29
|
shouldTitleWrap = true,
|
|
30
30
|
target,
|
|
31
31
|
testId,
|
|
32
|
+
UNSAFE_shouldDisableRouterLink,
|
|
32
33
|
...rest
|
|
33
34
|
}, ref) => {
|
|
34
35
|
const itemRef = useRegisterItemWithFocusManager();
|
|
@@ -69,7 +70,8 @@ const DropdownMenuItem = /*#__PURE__*/forwardRef(({
|
|
|
69
70
|
shouldDescriptionWrap: shouldDescriptionWrap,
|
|
70
71
|
shouldTitleWrap: shouldTitleWrap,
|
|
71
72
|
target: target,
|
|
72
|
-
testId: testId
|
|
73
|
+
testId: testId,
|
|
74
|
+
UNSAFE_shouldDisableRouterLink: UNSAFE_shouldDisableRouterLink
|
|
73
75
|
// DSP-13312 TODO: remove spread props in future major release
|
|
74
76
|
}, rest), children);
|
|
75
77
|
} else {
|
|
@@ -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", "component", "description", "elemAfter", "elemBefore", "href", "isDisabled", "isSelected", "onClick", "rel", "shouldDescriptionWrap", "shouldTitleWrap", "target", "testId"];
|
|
3
|
+
var _excluded = ["children", "component", "description", "elemAfter", "elemBefore", "href", "isDisabled", "isSelected", "onClick", "rel", "shouldDescriptionWrap", "shouldTitleWrap", "target", "testId", "UNSAFE_shouldDisableRouterLink"];
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
6
6
|
import ButtonItem from '@atlaskit/menu/button-item';
|
|
@@ -33,6 +33,7 @@ var DropdownMenuItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
33
33
|
shouldTitleWrap = _ref$shouldTitleWrap === void 0 ? true : _ref$shouldTitleWrap,
|
|
34
34
|
target = _ref.target,
|
|
35
35
|
testId = _ref.testId,
|
|
36
|
+
UNSAFE_shouldDisableRouterLink = _ref.UNSAFE_shouldDisableRouterLink,
|
|
36
37
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
37
38
|
var itemRef = useRegisterItemWithFocusManager();
|
|
38
39
|
if (component) {
|
|
@@ -72,7 +73,8 @@ var DropdownMenuItem = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
72
73
|
shouldDescriptionWrap: shouldDescriptionWrap,
|
|
73
74
|
shouldTitleWrap: shouldTitleWrap,
|
|
74
75
|
target: target,
|
|
75
|
-
testId: testId
|
|
76
|
+
testId: testId,
|
|
77
|
+
UNSAFE_shouldDisableRouterLink: UNSAFE_shouldDisableRouterLink
|
|
76
78
|
// DSP-13312 TODO: remove spread props in future major release
|
|
77
79
|
}, rest), children);
|
|
78
80
|
} else {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -228,6 +228,12 @@ export interface DropdownItemProps {
|
|
|
228
228
|
* serving as a hook for automated tests.
|
|
229
229
|
*/
|
|
230
230
|
testId?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Use this to opt out of using a router link and instead use a regular anchor element when
|
|
233
|
+
* using the `href` prop.
|
|
234
|
+
* Marked as "unsafe" because ideally, router links should be used for all internal links.
|
|
235
|
+
*/
|
|
236
|
+
UNSAFE_shouldDisableRouterLink?: boolean;
|
|
231
237
|
}
|
|
232
238
|
export interface DropdownItemCheckboxProps {
|
|
233
239
|
/**
|
|
@@ -228,6 +228,12 @@ export interface DropdownItemProps {
|
|
|
228
228
|
* serving as a hook for automated tests.
|
|
229
229
|
*/
|
|
230
230
|
testId?: string;
|
|
231
|
+
/**
|
|
232
|
+
* Use this to opt out of using a router link and instead use a regular anchor element when
|
|
233
|
+
* using the `href` prop.
|
|
234
|
+
* Marked as "unsafe" because ideally, router links should be used for all internal links.
|
|
235
|
+
*/
|
|
236
|
+
UNSAFE_shouldDisableRouterLink?: boolean;
|
|
231
237
|
}
|
|
232
238
|
export interface DropdownItemCheckboxProps {
|
|
233
239
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/dropdown-menu",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.14.1",
|
|
4
4
|
"description": "A dropdown menu displays a list of actions or options to a user.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"runReact18": true
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/button": "^18.
|
|
30
|
+
"@atlaskit/button": "^18.3.0",
|
|
31
31
|
"@atlaskit/codemod-utils": "^4.2.0",
|
|
32
32
|
"@atlaskit/ds-lib": "^2.3.0",
|
|
33
|
-
"@atlaskit/icon": "^22.
|
|
33
|
+
"@atlaskit/icon": "^22.6.0",
|
|
34
34
|
"@atlaskit/layering": "^0.3.0",
|
|
35
|
-
"@atlaskit/menu": "^2.
|
|
36
|
-
"@atlaskit/popup": "^1.
|
|
37
|
-
"@atlaskit/primitives": "^
|
|
35
|
+
"@atlaskit/menu": "^2.7.0",
|
|
36
|
+
"@atlaskit/popup": "^1.20.0",
|
|
37
|
+
"@atlaskit/primitives": "^11.0.0",
|
|
38
38
|
"@atlaskit/spinner": "^16.2.0",
|
|
39
39
|
"@atlaskit/theme": "^12.11.0",
|
|
40
40
|
"@atlaskit/tokens": "^1.53.0",
|
|
@@ -51,11 +51,12 @@
|
|
|
51
51
|
"@af/accessibility-testing": "*",
|
|
52
52
|
"@af/integration-testing": "*",
|
|
53
53
|
"@af/visual-regression": "*",
|
|
54
|
+
"@atlaskit/app-provider": "^1.3.0",
|
|
54
55
|
"@atlaskit/modal-dialog": "^12.14.0",
|
|
55
56
|
"@atlaskit/toggle": "^13.2.0",
|
|
56
57
|
"@atlaskit/visual-regression": "*",
|
|
57
58
|
"@atlassian/feature-flags-test-utils": "*",
|
|
58
|
-
"@testing-library/dom": "^
|
|
59
|
+
"@testing-library/dom": "^10.1.0",
|
|
59
60
|
"@testing-library/react": "^12.1.5",
|
|
60
61
|
"@testing-library/react-hooks": "^8.0.1",
|
|
61
62
|
"@testing-library/user-event": "^14.4.3",
|