@atlaskit/editor-toolbar 1.5.0 → 1.5.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 +16 -0
- package/dist/cjs/ui/ToolbarDropdownItem.js +13 -8
- package/dist/cjs/ui/ToolbarMenuContainer.js +2 -1
- package/dist/cjs/ui/ToolbarNestedDropdownMenu.js +5 -2
- package/dist/es2019/ui/ToolbarDropdownItem.js +13 -8
- package/dist/es2019/ui/ToolbarMenuContainer.js +2 -1
- package/dist/es2019/ui/ToolbarNestedDropdownMenu.js +5 -2
- package/dist/esm/ui/ToolbarDropdownItem.js +13 -8
- package/dist/esm/ui/ToolbarMenuContainer.js +2 -1
- package/dist/esm/ui/ToolbarNestedDropdownMenu.js +5 -2
- package/dist/types/ui/ToolbarDropdownItem.d.ts +1 -0
- package/dist/types/ui/ToolbarNestedDropdownMenu.d.ts +2 -1
- package/dist/types-ts4.5/ui/ToolbarDropdownItem.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarNestedDropdownMenu.d.ts +2 -1
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 1.5.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`0197bccd3d244`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0197bccd3d244) -
|
|
8
|
+
Add vertical alignment options to layout column menus and rendering.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 1.5.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`6aa28179246c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6aa28179246c9) -
|
|
16
|
+
Support data-extension-item-key to identify the selection extension menu items.
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 1.5.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -15,6 +15,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
|
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
var _css = require("@atlaskit/css");
|
|
17
17
|
var _dropdownMenu = require("@atlaskit/dropdown-menu");
|
|
18
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
20
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
21
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
@@ -41,23 +42,26 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
41
42
|
ariaKeyshortcuts = _ref['aria-keyshortcuts'],
|
|
42
43
|
onClick = _ref.onClick,
|
|
43
44
|
tabIndex = _ref.tabIndex,
|
|
44
|
-
title = _ref.title
|
|
45
|
+
title = _ref.title,
|
|
46
|
+
dataExtensionItemKey = _ref['data-extension-item-key'];
|
|
45
47
|
return /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
|
|
46
|
-
role: (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
48
|
+
role: (0, _expValEquals.expValEquals)('platform_editor_layout_column_menu', 'isEnabled', true) ? ariaPressed !== undefined && !ariaHasPopup ? 'menuitemradio' : 'menuitem' : (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
47
49
|
testId: testId,
|
|
48
50
|
xcss: (0, _css.cx)(styles.toolbarDropdownItem, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
49
51
|
onClick: onClick,
|
|
50
52
|
tabIndex: tabIndex,
|
|
51
53
|
"aria-haspopup": ariaHasPopup,
|
|
52
|
-
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
54
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined,
|
|
55
|
+
"aria-checked": (0, _expValEquals.expValEquals)('platform_editor_layout_column_menu', 'isEnabled', true) && !ariaHasPopup ? ariaPressed : undefined
|
|
53
56
|
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
54
57
|
,
|
|
55
|
-
"aria-pressed": (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
58
|
+
"aria-pressed": (0, _expValEquals.expValEquals)('platform_editor_layout_column_menu', 'isEnabled', true) ? undefined : (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
56
59
|
"aria-disabled": ariaDisabled,
|
|
57
60
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
58
61
|
"data-toolbar-component": (0, _experiments.editorExperiment)('platform_synced_block', true) ? 'menu-item' : undefined,
|
|
59
62
|
ref: ref,
|
|
60
|
-
title: (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
|
|
63
|
+
title: (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined,
|
|
64
|
+
"data-extension-item-key": (0, _platformFeatureFlags.fg)('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
|
|
61
65
|
}, children);
|
|
62
66
|
});
|
|
63
67
|
var CustomDropdownMenuItemAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
@@ -75,16 +79,17 @@ var CustomDropdownMenuItemAnchor = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
75
79
|
title = _ref2.title,
|
|
76
80
|
dataAttributes = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
77
81
|
return /*#__PURE__*/_react.default.createElement(_compiled.Anchor, (0, _extends2.default)({
|
|
78
|
-
role: (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
82
|
+
role: (0, _expValEquals.expValEquals)('platform_editor_layout_column_menu', 'isEnabled', true) ? ariaPressed !== undefined && !ariaHasPopup ? 'menuitemradio' : 'menuitem' : (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
79
83
|
testId: testId,
|
|
80
84
|
xcss: (0, _css.cx)(styles.toolbarDropdownItem, styles.anchor, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
81
85
|
onClick: onClick,
|
|
82
86
|
tabIndex: tabIndex,
|
|
83
87
|
"aria-haspopup": ariaHasPopup,
|
|
84
|
-
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
88
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined,
|
|
89
|
+
"aria-checked": (0, _expValEquals.expValEquals)('platform_editor_layout_column_menu', 'isEnabled', true) && !ariaHasPopup ? ariaPressed : undefined
|
|
85
90
|
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
86
91
|
,
|
|
87
|
-
"aria-pressed": (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
92
|
+
"aria-pressed": (0, _expValEquals.expValEquals)('platform_editor_layout_column_menu', 'isEnabled', true) ? undefined : (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
88
93
|
"aria-disabled": ariaDisabled,
|
|
89
94
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
90
95
|
"data-toolbar-component": "menu-item",
|
|
@@ -22,6 +22,7 @@ var ToolbarMenuContainer = exports.ToolbarMenuContainer = function ToolbarMenuCo
|
|
|
22
22
|
var children = _ref.children;
|
|
23
23
|
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
24
24
|
xcss: styles.container,
|
|
25
|
-
"data-toolbar-component": "menu"
|
|
25
|
+
"data-toolbar-component": "menu",
|
|
26
|
+
role: "menu"
|
|
26
27
|
}, children);
|
|
27
28
|
};
|
|
@@ -13,6 +13,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _react2 = require("@compiled/react");
|
|
15
15
|
var _dropdownMenu = _interopRequireDefault(require("@atlaskit/dropdown-menu"));
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
17
18
|
var _ToolbarDropdownItem = require("./ToolbarDropdownItem");
|
|
18
19
|
var _ToolbarTooltip = require("./ToolbarTooltip");
|
|
@@ -35,7 +36,8 @@ var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function Too
|
|
|
35
36
|
_ref$shouldFitContain = _ref.shouldFitContainer,
|
|
36
37
|
shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain,
|
|
37
38
|
shouldTitleWrap = _ref.shouldTitleWrap,
|
|
38
|
-
tooltipContent = _ref.tooltipContent
|
|
39
|
+
tooltipContent = _ref.tooltipContent,
|
|
40
|
+
dataExtensionItemKey = _ref['data-extension-item-key'];
|
|
39
41
|
return /*#__PURE__*/React.createElement(_dropdownMenu.default, {
|
|
40
42
|
shouldFitContainer: shouldFitContainer,
|
|
41
43
|
placement: "right-start",
|
|
@@ -57,7 +59,8 @@ var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function Too
|
|
|
57
59
|
triggerRef: triggerProps.triggerRef,
|
|
58
60
|
hasNestedDropdownMenu: true,
|
|
59
61
|
isDisabled: isDisabled,
|
|
60
|
-
shouldTitleWrap: shouldTitleWrap
|
|
62
|
+
shouldTitleWrap: shouldTitleWrap,
|
|
63
|
+
"data-extension-item-key": (0, _platformFeatureFlags.fg)('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
|
|
61
64
|
}, text, elemAfterText);
|
|
62
65
|
if (tooltipContent) {
|
|
63
66
|
return /*#__PURE__*/React.createElement(_ToolbarTooltip.ToolbarTooltip, {
|
|
@@ -5,6 +5,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import React, { forwardRef, isValidElement, cloneElement } from 'react';
|
|
6
6
|
import { cx } from '@atlaskit/css';
|
|
7
7
|
import { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { Anchor, Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
9
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
10
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -26,23 +27,26 @@ const CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(({
|
|
|
26
27
|
'aria-keyshortcuts': ariaKeyshortcuts,
|
|
27
28
|
onClick,
|
|
28
29
|
tabIndex,
|
|
29
|
-
title
|
|
30
|
+
title,
|
|
31
|
+
'data-extension-item-key': dataExtensionItemKey
|
|
30
32
|
}, ref) => /*#__PURE__*/React.createElement(Pressable, {
|
|
31
|
-
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
33
|
+
role: expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) ? ariaPressed !== undefined && !ariaHasPopup ? 'menuitemradio' : 'menuitem' : expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
32
34
|
testId: testId,
|
|
33
35
|
xcss: cx(styles.toolbarDropdownItem, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
34
36
|
onClick: onClick,
|
|
35
37
|
tabIndex: tabIndex,
|
|
36
38
|
"aria-haspopup": ariaHasPopup,
|
|
37
|
-
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
39
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined,
|
|
40
|
+
"aria-checked": expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) && !ariaHasPopup ? ariaPressed : undefined
|
|
38
41
|
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
39
42
|
,
|
|
40
|
-
"aria-pressed": expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
43
|
+
"aria-pressed": expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) ? undefined : expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
41
44
|
"aria-disabled": ariaDisabled,
|
|
42
45
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
43
46
|
"data-toolbar-component": editorExperiment('platform_synced_block', true) ? 'menu-item' : undefined,
|
|
44
47
|
ref: ref,
|
|
45
|
-
title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
|
|
48
|
+
title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined,
|
|
49
|
+
"data-extension-item-key": fg('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
|
|
46
50
|
}, children));
|
|
47
51
|
const CustomDropdownMenuItemAnchor = /*#__PURE__*/forwardRef(({
|
|
48
52
|
children,
|
|
@@ -59,16 +63,17 @@ const CustomDropdownMenuItemAnchor = /*#__PURE__*/forwardRef(({
|
|
|
59
63
|
title,
|
|
60
64
|
...dataAttributes
|
|
61
65
|
}, ref) => /*#__PURE__*/React.createElement(Anchor, _extends({
|
|
62
|
-
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
66
|
+
role: expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) ? ariaPressed !== undefined && !ariaHasPopup ? 'menuitemradio' : 'menuitem' : expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
63
67
|
testId: testId,
|
|
64
68
|
xcss: cx(styles.toolbarDropdownItem, styles.anchor, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
65
69
|
onClick: onClick,
|
|
66
70
|
tabIndex: tabIndex,
|
|
67
71
|
"aria-haspopup": ariaHasPopup,
|
|
68
|
-
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
72
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined,
|
|
73
|
+
"aria-checked": expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) && !ariaHasPopup ? ariaPressed : undefined
|
|
69
74
|
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
70
75
|
,
|
|
71
|
-
"aria-pressed": expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
76
|
+
"aria-pressed": expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) ? undefined : expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
72
77
|
"aria-disabled": ariaDisabled,
|
|
73
78
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
74
79
|
"data-toolbar-component": "menu-item",
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
7
|
import DropdownMenu from '@atlaskit/dropdown-menu';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
9
10
|
import { ToolbarDropdownItem } from './ToolbarDropdownItem';
|
|
10
11
|
import { ToolbarTooltip } from './ToolbarTooltip';
|
|
@@ -24,7 +25,8 @@ export const ToolbarNestedDropdownMenu = ({
|
|
|
24
25
|
onClick,
|
|
25
26
|
shouldFitContainer = false,
|
|
26
27
|
shouldTitleWrap,
|
|
27
|
-
tooltipContent
|
|
28
|
+
tooltipContent,
|
|
29
|
+
'data-extension-item-key': dataExtensionItemKey
|
|
28
30
|
}) => {
|
|
29
31
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
30
32
|
shouldFitContainer: shouldFitContainer,
|
|
@@ -47,7 +49,8 @@ export const ToolbarNestedDropdownMenu = ({
|
|
|
47
49
|
triggerRef: triggerProps.triggerRef,
|
|
48
50
|
hasNestedDropdownMenu: true,
|
|
49
51
|
isDisabled: isDisabled,
|
|
50
|
-
shouldTitleWrap: shouldTitleWrap
|
|
52
|
+
shouldTitleWrap: shouldTitleWrap,
|
|
53
|
+
"data-extension-item-key": fg('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
|
|
51
54
|
}, text, elemAfterText);
|
|
52
55
|
if (tooltipContent) {
|
|
53
56
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
@@ -11,6 +11,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
import React, { forwardRef, isValidElement, cloneElement } from 'react';
|
|
12
12
|
import { cx } from '@atlaskit/css';
|
|
13
13
|
import { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { Anchor, Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
15
16
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
17
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
@@ -32,23 +33,26 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
32
33
|
ariaKeyshortcuts = _ref['aria-keyshortcuts'],
|
|
33
34
|
onClick = _ref.onClick,
|
|
34
35
|
tabIndex = _ref.tabIndex,
|
|
35
|
-
title = _ref.title
|
|
36
|
+
title = _ref.title,
|
|
37
|
+
dataExtensionItemKey = _ref['data-extension-item-key'];
|
|
36
38
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
37
|
-
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
39
|
+
role: expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) ? ariaPressed !== undefined && !ariaHasPopup ? 'menuitemradio' : 'menuitem' : expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
38
40
|
testId: testId,
|
|
39
41
|
xcss: cx(styles.toolbarDropdownItem, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
40
42
|
onClick: onClick,
|
|
41
43
|
tabIndex: tabIndex,
|
|
42
44
|
"aria-haspopup": ariaHasPopup,
|
|
43
|
-
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
45
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined,
|
|
46
|
+
"aria-checked": expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) && !ariaHasPopup ? ariaPressed : undefined
|
|
44
47
|
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
45
48
|
,
|
|
46
|
-
"aria-pressed": expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
49
|
+
"aria-pressed": expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) ? undefined : expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
47
50
|
"aria-disabled": ariaDisabled,
|
|
48
51
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
49
52
|
"data-toolbar-component": editorExperiment('platform_synced_block', true) ? 'menu-item' : undefined,
|
|
50
53
|
ref: ref,
|
|
51
|
-
title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
|
|
54
|
+
title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined,
|
|
55
|
+
"data-extension-item-key": fg('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
|
|
52
56
|
}, children);
|
|
53
57
|
});
|
|
54
58
|
var CustomDropdownMenuItemAnchor = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
@@ -66,16 +70,17 @@ var CustomDropdownMenuItemAnchor = /*#__PURE__*/forwardRef(function (_ref2, ref)
|
|
|
66
70
|
title = _ref2.title,
|
|
67
71
|
dataAttributes = _objectWithoutProperties(_ref2, _excluded);
|
|
68
72
|
return /*#__PURE__*/React.createElement(Anchor, _extends({
|
|
69
|
-
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
73
|
+
role: expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) ? ariaPressed !== undefined && !ariaHasPopup ? 'menuitemradio' : 'menuitem' : expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
70
74
|
testId: testId,
|
|
71
75
|
xcss: cx(styles.toolbarDropdownItem, styles.anchor, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
72
76
|
onClick: onClick,
|
|
73
77
|
tabIndex: tabIndex,
|
|
74
78
|
"aria-haspopup": ariaHasPopup,
|
|
75
|
-
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
79
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined,
|
|
80
|
+
"aria-checked": expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) && !ariaHasPopup ? ariaPressed : undefined
|
|
76
81
|
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
77
82
|
,
|
|
78
|
-
"aria-pressed": expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
83
|
+
"aria-pressed": expValEquals('platform_editor_layout_column_menu', 'isEnabled', true) ? undefined : expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
79
84
|
"aria-disabled": ariaDisabled,
|
|
80
85
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
81
86
|
"data-toolbar-component": "menu-item",
|
|
@@ -15,6 +15,7 @@ export var ToolbarMenuContainer = function ToolbarMenuContainer(_ref) {
|
|
|
15
15
|
var children = _ref.children;
|
|
16
16
|
return /*#__PURE__*/React.createElement(Box, {
|
|
17
17
|
xcss: styles.container,
|
|
18
|
-
"data-toolbar-component": "menu"
|
|
18
|
+
"data-toolbar-component": "menu",
|
|
19
|
+
role: "menu"
|
|
19
20
|
}, children);
|
|
20
21
|
};
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { cx } from '@compiled/react';
|
|
7
7
|
import DropdownMenu from '@atlaskit/dropdown-menu';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
9
10
|
import { ToolbarDropdownItem } from './ToolbarDropdownItem';
|
|
10
11
|
import { ToolbarTooltip } from './ToolbarTooltip';
|
|
@@ -26,7 +27,8 @@ export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref)
|
|
|
26
27
|
_ref$shouldFitContain = _ref.shouldFitContainer,
|
|
27
28
|
shouldFitContainer = _ref$shouldFitContain === void 0 ? false : _ref$shouldFitContain,
|
|
28
29
|
shouldTitleWrap = _ref.shouldTitleWrap,
|
|
29
|
-
tooltipContent = _ref.tooltipContent
|
|
30
|
+
tooltipContent = _ref.tooltipContent,
|
|
31
|
+
dataExtensionItemKey = _ref['data-extension-item-key'];
|
|
30
32
|
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
31
33
|
shouldFitContainer: shouldFitContainer,
|
|
32
34
|
placement: "right-start",
|
|
@@ -48,7 +50,8 @@ export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref)
|
|
|
48
50
|
triggerRef: triggerProps.triggerRef,
|
|
49
51
|
hasNestedDropdownMenu: true,
|
|
50
52
|
isDisabled: isDisabled,
|
|
51
|
-
shouldTitleWrap: shouldTitleWrap
|
|
53
|
+
shouldTitleWrap: shouldTitleWrap,
|
|
54
|
+
"data-extension-item-key": fg('cc_blocks_changeboarding') ? dataExtensionItemKey : undefined
|
|
52
55
|
}, text, elemAfterText);
|
|
53
56
|
if (tooltipContent) {
|
|
54
57
|
return /*#__PURE__*/React.createElement(ToolbarTooltip, {
|
|
@@ -8,6 +8,7 @@ export type CustomDropdownMenuItemButtonProps = CustomItemComponentProps & {
|
|
|
8
8
|
'aria-haspopup'?: boolean;
|
|
9
9
|
'aria-keyshortcuts'?: string;
|
|
10
10
|
'aria-pressed'?: boolean;
|
|
11
|
+
'data-extension-item-key'?: string;
|
|
11
12
|
title?: string;
|
|
12
13
|
};
|
|
13
14
|
type ToolbarDropdownItemProps = {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import type { ReactNode } from 'react';
|
|
6
6
|
type ToolbarNestedDropdownMenuProps = {
|
|
7
7
|
children?: ReactNode;
|
|
8
|
+
'data-extension-item-key'?: string;
|
|
8
9
|
dropdownTestId?: string;
|
|
9
10
|
elemAfter: ReactNode;
|
|
10
11
|
elemAfterText?: ReactNode;
|
|
@@ -21,5 +22,5 @@ type ToolbarNestedDropdownMenuProps = {
|
|
|
21
22
|
text?: string;
|
|
22
23
|
tooltipContent?: ReactNode;
|
|
23
24
|
};
|
|
24
|
-
export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfterText, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
|
|
25
|
+
export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfterText, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, "data-extension-item-key": dataExtensionItemKey, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -8,6 +8,7 @@ export type CustomDropdownMenuItemButtonProps = CustomItemComponentProps & {
|
|
|
8
8
|
'aria-haspopup'?: boolean;
|
|
9
9
|
'aria-keyshortcuts'?: string;
|
|
10
10
|
'aria-pressed'?: boolean;
|
|
11
|
+
'data-extension-item-key'?: string;
|
|
11
12
|
title?: string;
|
|
12
13
|
};
|
|
13
14
|
type ToolbarDropdownItemProps = {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import type { ReactNode } from 'react';
|
|
6
6
|
type ToolbarNestedDropdownMenuProps = {
|
|
7
7
|
children?: ReactNode;
|
|
8
|
+
'data-extension-item-key'?: string;
|
|
8
9
|
dropdownTestId?: string;
|
|
9
10
|
elemAfter: ReactNode;
|
|
10
11
|
elemAfterText?: ReactNode;
|
|
@@ -21,5 +22,5 @@ type ToolbarNestedDropdownMenuProps = {
|
|
|
21
22
|
text?: string;
|
|
22
23
|
tooltipContent?: ReactNode;
|
|
23
24
|
};
|
|
24
|
-
export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfterText, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
|
|
25
|
+
export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfterText, elemAfter, children, isDisabled, testId, dropdownTestId, enableMaxHeight, onClick, shouldFitContainer, shouldTitleWrap, tooltipContent, "data-extension-item-key": dataExtensionItemKey, }: ToolbarNestedDropdownMenuProps) => JSX.Element;
|
|
25
26
|
export {};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"registry": "https://registry.npmjs.org/"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.5.
|
|
6
|
+
"version": "1.5.2",
|
|
7
7
|
"description": "Common UI for Toolbars across the platform",
|
|
8
8
|
"atlassian": {
|
|
9
9
|
"react-compiler": {
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
"@atlaskit/browser-apis": "^0.0.1",
|
|
33
33
|
"@atlaskit/css": "^0.19.0",
|
|
34
34
|
"@atlaskit/dropdown-menu": "^16.8.0",
|
|
35
|
-
"@atlaskit/icon": "^
|
|
35
|
+
"@atlaskit/icon": "^35.0.0",
|
|
36
36
|
"@atlaskit/icon-lab": "^6.9.0",
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
38
38
|
"@atlaskit/popup": "^4.19.0",
|
|
39
39
|
"@atlaskit/primitives": "^19.0.0",
|
|
40
|
-
"@atlaskit/tmp-editor-statsig": "^81.
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^81.1.0",
|
|
41
41
|
"@atlaskit/tokens": "^13.0.0",
|
|
42
42
|
"@atlaskit/tooltip": "^22.2.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
@@ -92,6 +92,9 @@
|
|
|
92
92
|
"platform-feature-flags": {
|
|
93
93
|
"platform_editor_fix_t_at_is_not_a_function": {
|
|
94
94
|
"type": "boolean"
|
|
95
|
+
},
|
|
96
|
+
"cc_blocks_changeboarding": {
|
|
97
|
+
"type": "boolean"
|
|
95
98
|
}
|
|
96
99
|
}
|
|
97
100
|
}
|