@atlaskit/editor-toolbar 0.19.14 → 0.19.16
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 +21 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/ui/ToolbarDropdownItem.compiled.css +9 -1
- package/dist/cjs/ui/ToolbarDropdownItem.js +72 -21
- package/dist/cjs/ui/ToolbarNestedDropdownMenu.js +2 -1
- package/dist/cjs/ui/icons/AppIcon.js +13 -0
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/ui/ToolbarDropdownItem.compiled.css +9 -1
- package/dist/es2019/ui/ToolbarDropdownItem.js +56 -9
- package/dist/es2019/ui/ToolbarNestedDropdownMenu.js +2 -1
- package/dist/es2019/ui/icons/AppIcon.js +2 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/ui/ToolbarDropdownItem.compiled.css +9 -1
- package/dist/esm/ui/ToolbarDropdownItem.js +73 -22
- package/dist/esm/ui/ToolbarNestedDropdownMenu.js +2 -1
- package/dist/esm/ui/icons/AppIcon.js +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types.d.ts +3 -0
- package/dist/types/ui/ToolbarDropdownItem.d.ts +5 -2
- package/dist/types/ui/icons/AppIcon.d.ts +1 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/types.d.ts +3 -0
- package/dist/types-ts4.5/ui/ToolbarDropdownItem.d.ts +5 -2
- package/dist/types-ts4.5/ui/icons/AppIcon.d.ts +1 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 0.19.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2d81bc503e714`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2d81bc503e714) -
|
|
8
|
+
[ux] [EDITOR-4500] export AppIcon, add optional title prop to ToolbarDropdownItem and create the
|
|
9
|
+
CustomDropdownMenuItemAnchor component for DropdownMenuItems that render anchor elements
|
|
10
|
+
- [`3b3aa281c8524`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3b3aa281c8524) -
|
|
11
|
+
Editor 4149 Fix keyboard navigation inside turn into
|
|
12
|
+
- [`d4b2e174e207c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d4b2e174e207c) -
|
|
13
|
+
[EDITOR-4500] apply a11y fix to new custom ToolbarDropdownItem component
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 0.19.15
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`9b8e6a65567af`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9b8e6a65567af) -
|
|
21
|
+
ENGHEALTH-48871: Fix aria-required-children a11y issue with Editor toolbar.
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 0.19.14
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -100,6 +100,12 @@ Object.defineProperty(exports, "AlignTextRightIcon", {
|
|
|
100
100
|
return _AlignTextRightIcon.AlignTextRightIcon;
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
|
+
Object.defineProperty(exports, "AppIcon", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
get: function get() {
|
|
106
|
+
return _AppIcon.AppIcon;
|
|
107
|
+
}
|
|
108
|
+
});
|
|
103
109
|
Object.defineProperty(exports, "AppsIcon", {
|
|
104
110
|
enumerable: true,
|
|
105
111
|
get: function get() {
|
|
@@ -519,6 +525,7 @@ var _AITranslateIcon = require("./ui/icons/AITranslateIcon");
|
|
|
519
525
|
var _NestedDropdownRightIcon = require("./ui/icons/NestedDropdownRightIcon");
|
|
520
526
|
var _AICommandIcon = require("./ui/icons/AICommandIcon");
|
|
521
527
|
var _AddIcon = require("./ui/icons/AddIcon");
|
|
528
|
+
var _AppIcon = require("./ui/icons/AppIcon");
|
|
522
529
|
var _AppsIcon = require("./ui/icons/AppsIcon");
|
|
523
530
|
var _BoldIcon = require("./ui/icons/BoldIcon");
|
|
524
531
|
var _CommentIcon = require("./ui/icons/CommentIcon");
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
+
|
|
1
2
|
._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
3
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
3
4
|
._1rjc1b66{padding-block:var(--ds-space-050,4px)}
|
|
4
5
|
._1bsb1osq{width:100%}
|
|
5
6
|
._1e0c1txw{display:flex}
|
|
7
|
+
._1hmsglyw{text-decoration-line:none}
|
|
6
8
|
._1tkezwfg{min-height:2pc}
|
|
7
9
|
._1ul9eoa3{min-width:225px}
|
|
10
|
+
._4bfu1r31{text-decoration-color:currentColor}
|
|
8
11
|
._80om13gf{cursor:not-allowed}
|
|
12
|
+
._ajmmnqa1{text-decoration-style:solid}
|
|
9
13
|
._bfhk15s3{background-color:var(--ds-background-selected,#e9f2fe)}
|
|
10
14
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
11
15
|
._kqswh2mm{position:relative}
|
|
12
16
|
._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
|
|
13
17
|
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
14
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
18
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}._1053azsu:visited{color:var(--ds-text-subtle,#505258)}
|
|
15
19
|
._1bas12b0:focus-visible{border-radius:var(--ds-radius-small,4px)}
|
|
16
20
|
._1ah31i6y:focus-visible{outline-offset:var(--ds-space-negative-025,-2px)}
|
|
21
|
+
._1bnxglyw:hover{text-decoration-line:none}
|
|
22
|
+
._30l3azsu:hover{color:var(--ds-text-subtle,#505258)}
|
|
23
|
+
._9oik1r31:hover{text-decoration-color:currentColor}
|
|
17
24
|
._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
18
25
|
._irr3ufnl:hover{background-color:var(--ds-background-selected-hovered,#cfe1fd)}
|
|
26
|
+
._jf4cnqa1:hover{text-decoration-style:solid}
|
|
19
27
|
._1di6fcek:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
|
|
20
28
|
._1di6nozp:active{background-color:var(--ds-background-selected-pressed,#8fb8f6)}
|
|
@@ -10,17 +10,23 @@ exports.ToolbarDropdownItem = void 0;
|
|
|
10
10
|
require("./ToolbarDropdownItem.compiled.css");
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
14
16
|
var _css = require("@atlaskit/css");
|
|
15
17
|
var _dropdownMenu = require("@atlaskit/dropdown-menu");
|
|
16
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
19
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
17
20
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
18
21
|
var _ToolbarDropdownMenuContext = require("./ToolbarDropdownMenuContext");
|
|
22
|
+
var _excluded = ["children", "data-testid", "aria-haspopup", "aria-disabled", "aria-pressed", "aria-keyshortcuts", "onClick", "tabIndex", "href", "target", "rel", "title"],
|
|
23
|
+
_excluded2 = ["onClick", "elemBefore", "elemAfter", "isSelected", "children", "isDisabled", "hasNestedDropdownMenu", "triggerRef", "title", "shouldTitleWrap", "testId", "ariaKeyshortcuts", "href", "target", "rel"];
|
|
19
24
|
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); }
|
|
20
25
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
26
|
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) { (0, _defineProperty2.default)(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; }
|
|
22
27
|
var styles = {
|
|
23
28
|
toolbarDropdownItem: "_11c8fhey _18zrutpp _1rjc1b66 _1e0c1txw _kqswh2mm _bfhksm61 _1bsb1osq _1tkezwfg _1ul9eoa3 _syazazsu _1bas12b0 _1ah31i6y",
|
|
29
|
+
anchor: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _1053azsu _9oik1r31 _1bnxglyw _jf4cnqa1 _30l3azsu",
|
|
24
30
|
enabled: "_irr31dpa _1di6fcek",
|
|
25
31
|
disabled: "_syaz1gmx _80om13gf",
|
|
26
32
|
selected: "_bfhk15s3 _syaz6x5g _irr3ufnl _1di6nozp"
|
|
@@ -33,37 +39,80 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/(0, _react.forwardRef)(function
|
|
|
33
39
|
ariaPressed = _ref['aria-pressed'],
|
|
34
40
|
ariaKeyshortcuts = _ref['aria-keyshortcuts'],
|
|
35
41
|
onClick = _ref.onClick,
|
|
36
|
-
tabIndex = _ref.tabIndex
|
|
42
|
+
tabIndex = _ref.tabIndex,
|
|
43
|
+
title = _ref.title;
|
|
37
44
|
return /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
|
|
45
|
+
role: (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
38
46
|
testId: testId,
|
|
39
47
|
xcss: (0, _css.cx)(styles.toolbarDropdownItem, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
40
48
|
onClick: onClick,
|
|
41
49
|
tabIndex: tabIndex,
|
|
42
50
|
"aria-haspopup": ariaHasPopup,
|
|
43
|
-
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
44
|
-
|
|
51
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
52
|
+
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
53
|
+
,
|
|
54
|
+
"aria-pressed": (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
45
55
|
"aria-disabled": ariaDisabled,
|
|
46
56
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
47
57
|
"data-toolbar-component": (0, _experiments.editorExperiment)('platform_synced_block', true) ? 'menu-item' : undefined,
|
|
48
|
-
ref: ref
|
|
58
|
+
ref: ref,
|
|
59
|
+
title: (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
|
|
49
60
|
}, children);
|
|
50
61
|
});
|
|
51
|
-
var
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_ref2$shouldTitleWrap = _ref2.shouldTitleWrap,
|
|
61
|
-
shouldTitleWrap = _ref2$shouldTitleWrap === void 0 ? true : _ref2$shouldTitleWrap,
|
|
62
|
-
testId = _ref2.testId,
|
|
63
|
-
ariaKeyshortcuts = _ref2.ariaKeyshortcuts,
|
|
62
|
+
var CustomDropdownMenuItemAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
63
|
+
var children = _ref2.children,
|
|
64
|
+
testId = _ref2['data-testid'],
|
|
65
|
+
ariaHasPopup = _ref2['aria-haspopup'],
|
|
66
|
+
ariaDisabled = _ref2['aria-disabled'],
|
|
67
|
+
ariaPressed = _ref2['aria-pressed'],
|
|
68
|
+
ariaKeyshortcuts = _ref2['aria-keyshortcuts'],
|
|
69
|
+
onClick = _ref2.onClick,
|
|
70
|
+
tabIndex = _ref2.tabIndex,
|
|
64
71
|
href = _ref2.href,
|
|
65
72
|
target = _ref2.target,
|
|
66
|
-
rel = _ref2.rel
|
|
73
|
+
rel = _ref2.rel,
|
|
74
|
+
title = _ref2.title,
|
|
75
|
+
dataAttributes = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Anchor, (0, _extends2.default)({
|
|
77
|
+
role: (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
78
|
+
testId: testId,
|
|
79
|
+
xcss: (0, _css.cx)(styles.toolbarDropdownItem, styles.anchor, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
80
|
+
onClick: onClick,
|
|
81
|
+
tabIndex: tabIndex,
|
|
82
|
+
"aria-haspopup": ariaHasPopup,
|
|
83
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
84
|
+
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
85
|
+
,
|
|
86
|
+
"aria-pressed": (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
87
|
+
"aria-disabled": ariaDisabled,
|
|
88
|
+
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
89
|
+
"data-toolbar-component": "menu-item",
|
|
90
|
+
ref: ref,
|
|
91
|
+
href: href,
|
|
92
|
+
target: target,
|
|
93
|
+
rel: rel,
|
|
94
|
+
title: title
|
|
95
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
96
|
+
}, dataAttributes), children);
|
|
97
|
+
});
|
|
98
|
+
var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdownItem(_ref3) {
|
|
99
|
+
var _onClick = _ref3.onClick,
|
|
100
|
+
elemBefore = _ref3.elemBefore,
|
|
101
|
+
elemAfter = _ref3.elemAfter,
|
|
102
|
+
isSelected = _ref3.isSelected,
|
|
103
|
+
children = _ref3.children,
|
|
104
|
+
isDisabled = _ref3.isDisabled,
|
|
105
|
+
hasNestedDropdownMenu = _ref3.hasNestedDropdownMenu,
|
|
106
|
+
triggerRef = _ref3.triggerRef,
|
|
107
|
+
title = _ref3.title,
|
|
108
|
+
_ref3$shouldTitleWrap = _ref3.shouldTitleWrap,
|
|
109
|
+
shouldTitleWrap = _ref3$shouldTitleWrap === void 0 ? true : _ref3$shouldTitleWrap,
|
|
110
|
+
testId = _ref3.testId,
|
|
111
|
+
ariaKeyshortcuts = _ref3.ariaKeyshortcuts,
|
|
112
|
+
href = _ref3.href,
|
|
113
|
+
target = _ref3.target,
|
|
114
|
+
rel = _ref3.rel,
|
|
115
|
+
dataAttributes = (0, _objectWithoutProperties2.default)(_ref3, _excluded2);
|
|
67
116
|
var parentContext = (0, _ToolbarDropdownMenuContext.useToolbarDropdownMenu)();
|
|
68
117
|
var injectedElemAfter = function () {
|
|
69
118
|
if (! /*#__PURE__*/(0, _react.isValidElement)(elemAfter)) {
|
|
@@ -77,7 +126,7 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
|
|
|
77
126
|
isDisabled: isDisabled
|
|
78
127
|
}));
|
|
79
128
|
}();
|
|
80
|
-
return /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
|
|
129
|
+
return /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, (0, _extends2.default)({
|
|
81
130
|
onClick: function onClick(e) {
|
|
82
131
|
if (!hasNestedDropdownMenu) {
|
|
83
132
|
parentContext === null || parentContext === void 0 || parentContext.closeMenu(e);
|
|
@@ -97,9 +146,11 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
|
|
|
97
146
|
rel: rel
|
|
98
147
|
// @ts-ignore -- This `CustomDropdownMenuItemButton` has type conflicts with the `DropdownItem` component in a way that cannot be reconciled (ignored as it fails types in Jira and should in Platform)
|
|
99
148
|
,
|
|
100
|
-
component: href ? undefined : CustomDropdownMenuItemButton,
|
|
149
|
+
component: href ? (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? CustomDropdownMenuItemAnchor : undefined : CustomDropdownMenuItemButton,
|
|
101
150
|
testId: testId,
|
|
102
151
|
"data-toolbar-component": "menu-item",
|
|
152
|
+
title: title,
|
|
103
153
|
shouldTitleWrap: shouldTitleWrap
|
|
104
|
-
|
|
154
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
155
|
+
}, (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? dataAttributes : {}), children);
|
|
105
156
|
};
|
|
@@ -52,6 +52,7 @@ var ToolbarNestedDropdownMenu = exports.ToolbarNestedDropdownMenu = function Too
|
|
|
52
52
|
}, text);
|
|
53
53
|
}
|
|
54
54
|
}, /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
55
|
-
xcss: (0, _react2.cx)(enableMaxHeight && styles.scrollContainer)
|
|
55
|
+
xcss: (0, _react2.cx)(enableMaxHeight && styles.scrollContainer),
|
|
56
|
+
"data-toolbar-nested-dropdown-menu": true
|
|
56
57
|
}, children));
|
|
57
58
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
Object.defineProperty(exports, "AppIcon", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _app.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _app = _interopRequireDefault(require("@atlaskit/icon/core/app"));
|
package/dist/es2019/index.js
CHANGED
|
@@ -28,6 +28,7 @@ export { AITranslateIcon } from './ui/icons/AITranslateIcon';
|
|
|
28
28
|
export { NestedDropdownRightIcon } from './ui/icons/NestedDropdownRightIcon';
|
|
29
29
|
export { AICommandIcon } from './ui/icons/AICommandIcon';
|
|
30
30
|
export { AddIcon } from './ui/icons/AddIcon';
|
|
31
|
+
export { AppIcon } from './ui/icons/AppIcon';
|
|
31
32
|
export { AppsIcon } from './ui/icons/AppsIcon';
|
|
32
33
|
export { BoldIcon } from './ui/icons/BoldIcon';
|
|
33
34
|
export { CommentIcon } from './ui/icons/CommentIcon';
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
+
|
|
1
2
|
._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
3
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
3
4
|
._1rjc1b66{padding-block:var(--ds-space-050,4px)}
|
|
4
5
|
._1bsb1osq{width:100%}
|
|
5
6
|
._1e0c1txw{display:flex}
|
|
7
|
+
._1hmsglyw{text-decoration-line:none}
|
|
6
8
|
._1tkezwfg{min-height:2pc}
|
|
7
9
|
._1ul9eoa3{min-width:225px}
|
|
10
|
+
._4bfu1r31{text-decoration-color:currentColor}
|
|
8
11
|
._80om13gf{cursor:not-allowed}
|
|
12
|
+
._ajmmnqa1{text-decoration-style:solid}
|
|
9
13
|
._bfhk15s3{background-color:var(--ds-background-selected,#e9f2fe)}
|
|
10
14
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
11
15
|
._kqswh2mm{position:relative}
|
|
12
16
|
._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
|
|
13
17
|
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
14
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
18
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}._1053azsu:visited{color:var(--ds-text-subtle,#505258)}
|
|
15
19
|
._1bas12b0:focus-visible{border-radius:var(--ds-radius-small,4px)}
|
|
16
20
|
._1ah31i6y:focus-visible{outline-offset:var(--ds-space-negative-025,-2px)}
|
|
21
|
+
._1bnxglyw:hover{text-decoration-line:none}
|
|
22
|
+
._30l3azsu:hover{color:var(--ds-text-subtle,#505258)}
|
|
23
|
+
._9oik1r31:hover{text-decoration-color:currentColor}
|
|
17
24
|
._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
18
25
|
._irr3ufnl:hover{background-color:var(--ds-background-selected-hovered,#cfe1fd)}
|
|
26
|
+
._jf4cnqa1:hover{text-decoration-style:solid}
|
|
19
27
|
._1di6fcek:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
|
|
20
28
|
._1di6nozp:active{background-color:var(--ds-background-selected-pressed,#8fb8f6)}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
/* ToolbarDropdownItem.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import "./ToolbarDropdownItem.compiled.css";
|
|
3
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
5
|
import React, { forwardRef, isValidElement, cloneElement } from 'react';
|
|
5
6
|
import { cx } from '@atlaskit/css';
|
|
6
7
|
import { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
7
|
-
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { Anchor, Pressable } from '@atlaskit/primitives/compiled';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
11
|
import { useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
|
|
10
12
|
const styles = {
|
|
11
13
|
toolbarDropdownItem: "_11c8fhey _18zrutpp _1rjc1b66 _1e0c1txw _kqswh2mm _bfhksm61 _1bsb1osq _1tkezwfg _1ul9eoa3 _syazazsu _1bas12b0 _1ah31i6y",
|
|
14
|
+
anchor: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _1053azsu _9oik1r31 _1bnxglyw _jf4cnqa1 _30l3azsu",
|
|
12
15
|
enabled: "_irr31dpa _1di6fcek",
|
|
13
16
|
disabled: "_syaz1gmx _80om13gf",
|
|
14
17
|
selected: "_bfhk15s3 _syaz6x5g _irr3ufnl _1di6nozp"
|
|
@@ -21,20 +24,60 @@ const CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(({
|
|
|
21
24
|
'aria-pressed': ariaPressed,
|
|
22
25
|
'aria-keyshortcuts': ariaKeyshortcuts,
|
|
23
26
|
onClick,
|
|
24
|
-
tabIndex
|
|
27
|
+
tabIndex,
|
|
28
|
+
title
|
|
25
29
|
}, ref) => /*#__PURE__*/React.createElement(Pressable, {
|
|
30
|
+
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
26
31
|
testId: testId,
|
|
27
32
|
xcss: cx(styles.toolbarDropdownItem, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
28
33
|
onClick: onClick,
|
|
29
34
|
tabIndex: tabIndex,
|
|
30
35
|
"aria-haspopup": ariaHasPopup,
|
|
31
|
-
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
32
|
-
|
|
36
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
37
|
+
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
38
|
+
,
|
|
39
|
+
"aria-pressed": expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
33
40
|
"aria-disabled": ariaDisabled,
|
|
34
41
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
35
42
|
"data-toolbar-component": editorExperiment('platform_synced_block', true) ? 'menu-item' : undefined,
|
|
36
|
-
ref: ref
|
|
43
|
+
ref: ref,
|
|
44
|
+
title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
|
|
37
45
|
}, children));
|
|
46
|
+
const CustomDropdownMenuItemAnchor = /*#__PURE__*/forwardRef(({
|
|
47
|
+
children,
|
|
48
|
+
'data-testid': testId,
|
|
49
|
+
'aria-haspopup': ariaHasPopup,
|
|
50
|
+
'aria-disabled': ariaDisabled,
|
|
51
|
+
'aria-pressed': ariaPressed,
|
|
52
|
+
'aria-keyshortcuts': ariaKeyshortcuts,
|
|
53
|
+
onClick,
|
|
54
|
+
tabIndex,
|
|
55
|
+
href,
|
|
56
|
+
target,
|
|
57
|
+
rel,
|
|
58
|
+
title,
|
|
59
|
+
...dataAttributes
|
|
60
|
+
}, ref) => /*#__PURE__*/React.createElement(Anchor, _extends({
|
|
61
|
+
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
62
|
+
testId: testId,
|
|
63
|
+
xcss: cx(styles.toolbarDropdownItem, styles.anchor, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
64
|
+
onClick: onClick,
|
|
65
|
+
tabIndex: tabIndex,
|
|
66
|
+
"aria-haspopup": ariaHasPopup,
|
|
67
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
68
|
+
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
69
|
+
,
|
|
70
|
+
"aria-pressed": expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
71
|
+
"aria-disabled": ariaDisabled,
|
|
72
|
+
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
73
|
+
"data-toolbar-component": "menu-item",
|
|
74
|
+
ref: ref,
|
|
75
|
+
href: href,
|
|
76
|
+
target: target,
|
|
77
|
+
rel: rel,
|
|
78
|
+
title: title
|
|
79
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
80
|
+
}, dataAttributes), children));
|
|
38
81
|
export const ToolbarDropdownItem = ({
|
|
39
82
|
onClick,
|
|
40
83
|
elemBefore,
|
|
@@ -44,12 +87,14 @@ export const ToolbarDropdownItem = ({
|
|
|
44
87
|
isDisabled,
|
|
45
88
|
hasNestedDropdownMenu,
|
|
46
89
|
triggerRef,
|
|
90
|
+
title,
|
|
47
91
|
shouldTitleWrap = true,
|
|
48
92
|
testId,
|
|
49
93
|
ariaKeyshortcuts,
|
|
50
94
|
href,
|
|
51
95
|
target,
|
|
52
|
-
rel
|
|
96
|
+
rel,
|
|
97
|
+
...dataAttributes
|
|
53
98
|
}) => {
|
|
54
99
|
const parentContext = useToolbarDropdownMenu();
|
|
55
100
|
const injectedElemAfter = (() => {
|
|
@@ -65,7 +110,7 @@ export const ToolbarDropdownItem = ({
|
|
|
65
110
|
isDisabled
|
|
66
111
|
});
|
|
67
112
|
})();
|
|
68
|
-
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
113
|
+
return /*#__PURE__*/React.createElement(DropdownItem, _extends({
|
|
69
114
|
onClick: e => {
|
|
70
115
|
if (!hasNestedDropdownMenu) {
|
|
71
116
|
parentContext === null || parentContext === void 0 ? void 0 : parentContext.closeMenu(e);
|
|
@@ -85,9 +130,11 @@ export const ToolbarDropdownItem = ({
|
|
|
85
130
|
rel: rel
|
|
86
131
|
// @ts-ignore -- This `CustomDropdownMenuItemButton` has type conflicts with the `DropdownItem` component in a way that cannot be reconciled (ignored as it fails types in Jira and should in Platform)
|
|
87
132
|
,
|
|
88
|
-
component: href ? undefined : CustomDropdownMenuItemButton,
|
|
133
|
+
component: href ? expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? CustomDropdownMenuItemAnchor : undefined : CustomDropdownMenuItemButton,
|
|
89
134
|
testId: testId,
|
|
90
135
|
"data-toolbar-component": "menu-item",
|
|
136
|
+
title: title,
|
|
91
137
|
shouldTitleWrap: shouldTitleWrap
|
|
92
|
-
|
|
138
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
139
|
+
}, expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? dataAttributes : {}), children);
|
|
93
140
|
};
|
|
@@ -40,6 +40,7 @@ export const ToolbarNestedDropdownMenu = ({
|
|
|
40
40
|
isDisabled: isDisabled
|
|
41
41
|
}, text)
|
|
42
42
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
43
|
-
xcss: cx(enableMaxHeight && styles.scrollContainer)
|
|
43
|
+
xcss: cx(enableMaxHeight && styles.scrollContainer),
|
|
44
|
+
"data-toolbar-nested-dropdown-menu": true
|
|
44
45
|
}, children));
|
|
45
46
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -28,6 +28,7 @@ export { AITranslateIcon } from './ui/icons/AITranslateIcon';
|
|
|
28
28
|
export { NestedDropdownRightIcon } from './ui/icons/NestedDropdownRightIcon';
|
|
29
29
|
export { AICommandIcon } from './ui/icons/AICommandIcon';
|
|
30
30
|
export { AddIcon } from './ui/icons/AddIcon';
|
|
31
|
+
export { AppIcon } from './ui/icons/AppIcon';
|
|
31
32
|
export { AppsIcon } from './ui/icons/AppsIcon';
|
|
32
33
|
export { BoldIcon } from './ui/icons/BoldIcon';
|
|
33
34
|
export { CommentIcon } from './ui/icons/CommentIcon';
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
+
|
|
1
2
|
._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
3
|
._18zrutpp{padding-inline:var(--ds-space-150,9pt)}
|
|
3
4
|
._1rjc1b66{padding-block:var(--ds-space-050,4px)}
|
|
4
5
|
._1bsb1osq{width:100%}
|
|
5
6
|
._1e0c1txw{display:flex}
|
|
7
|
+
._1hmsglyw{text-decoration-line:none}
|
|
6
8
|
._1tkezwfg{min-height:2pc}
|
|
7
9
|
._1ul9eoa3{min-width:225px}
|
|
10
|
+
._4bfu1r31{text-decoration-color:currentColor}
|
|
8
11
|
._80om13gf{cursor:not-allowed}
|
|
12
|
+
._ajmmnqa1{text-decoration-style:solid}
|
|
9
13
|
._bfhk15s3{background-color:var(--ds-background-selected,#e9f2fe)}
|
|
10
14
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
11
15
|
._kqswh2mm{position:relative}
|
|
12
16
|
._syaz1gmx{color:var(--ds-text-disabled,#080f214a)}
|
|
13
17
|
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
14
|
-
._syazazsu{color:var(--ds-text-subtle,#505258)}
|
|
18
|
+
._syazazsu{color:var(--ds-text-subtle,#505258)}._1053azsu:visited{color:var(--ds-text-subtle,#505258)}
|
|
15
19
|
._1bas12b0:focus-visible{border-radius:var(--ds-radius-small,4px)}
|
|
16
20
|
._1ah31i6y:focus-visible{outline-offset:var(--ds-space-negative-025,-2px)}
|
|
21
|
+
._1bnxglyw:hover{text-decoration-line:none}
|
|
22
|
+
._30l3azsu:hover{color:var(--ds-text-subtle,#505258)}
|
|
23
|
+
._9oik1r31:hover{text-decoration-color:currentColor}
|
|
17
24
|
._irr31dpa:hover{background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
18
25
|
._irr3ufnl:hover{background-color:var(--ds-background-selected-hovered,#cfe1fd)}
|
|
26
|
+
._jf4cnqa1:hover{text-decoration-style:solid}
|
|
19
27
|
._1di6fcek:active{background-color:var(--ds-background-neutral-subtle-pressed,#0b120e24)}
|
|
20
28
|
._1di6nozp:active{background-color:var(--ds-background-selected-pressed,#8fb8f6)}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/* ToolbarDropdownItem.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["children", "data-testid", "aria-haspopup", "aria-disabled", "aria-pressed", "aria-keyshortcuts", "onClick", "tabIndex", "href", "target", "rel", "title"],
|
|
6
|
+
_excluded2 = ["onClick", "elemBefore", "elemAfter", "isSelected", "children", "isDisabled", "hasNestedDropdownMenu", "triggerRef", "title", "shouldTitleWrap", "testId", "ariaKeyshortcuts", "href", "target", "rel"];
|
|
3
7
|
import "./ToolbarDropdownItem.compiled.css";
|
|
4
8
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
9
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -7,11 +11,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
11
|
import React, { forwardRef, isValidElement, cloneElement } from 'react';
|
|
8
12
|
import { cx } from '@atlaskit/css';
|
|
9
13
|
import { DropdownItem } from '@atlaskit/dropdown-menu';
|
|
10
|
-
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
14
|
+
import { Anchor, Pressable } from '@atlaskit/primitives/compiled';
|
|
15
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
16
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
17
|
import { useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
|
|
13
18
|
var styles = {
|
|
14
19
|
toolbarDropdownItem: "_11c8fhey _18zrutpp _1rjc1b66 _1e0c1txw _kqswh2mm _bfhksm61 _1bsb1osq _1tkezwfg _1ul9eoa3 _syazazsu _1bas12b0 _1ah31i6y",
|
|
20
|
+
anchor: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _1053azsu _9oik1r31 _1bnxglyw _jf4cnqa1 _30l3azsu",
|
|
15
21
|
enabled: "_irr31dpa _1di6fcek",
|
|
16
22
|
disabled: "_syaz1gmx _80om13gf",
|
|
17
23
|
selected: "_bfhk15s3 _syaz6x5g _irr3ufnl _1di6nozp"
|
|
@@ -24,37 +30,80 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
24
30
|
ariaPressed = _ref['aria-pressed'],
|
|
25
31
|
ariaKeyshortcuts = _ref['aria-keyshortcuts'],
|
|
26
32
|
onClick = _ref.onClick,
|
|
27
|
-
tabIndex = _ref.tabIndex
|
|
33
|
+
tabIndex = _ref.tabIndex,
|
|
34
|
+
title = _ref.title;
|
|
28
35
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
36
|
+
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
29
37
|
testId: testId,
|
|
30
38
|
xcss: cx(styles.toolbarDropdownItem, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
31
39
|
onClick: onClick,
|
|
32
40
|
tabIndex: tabIndex,
|
|
33
41
|
"aria-haspopup": ariaHasPopup,
|
|
34
|
-
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
35
|
-
|
|
42
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
43
|
+
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
44
|
+
,
|
|
45
|
+
"aria-pressed": expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
36
46
|
"aria-disabled": ariaDisabled,
|
|
37
47
|
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
38
48
|
"data-toolbar-component": editorExperiment('platform_synced_block', true) ? 'menu-item' : undefined,
|
|
39
|
-
ref: ref
|
|
49
|
+
ref: ref,
|
|
50
|
+
title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
|
|
40
51
|
}, children);
|
|
41
52
|
});
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
_ref2$shouldTitleWrap = _ref2.shouldTitleWrap,
|
|
52
|
-
shouldTitleWrap = _ref2$shouldTitleWrap === void 0 ? true : _ref2$shouldTitleWrap,
|
|
53
|
-
testId = _ref2.testId,
|
|
54
|
-
ariaKeyshortcuts = _ref2.ariaKeyshortcuts,
|
|
53
|
+
var CustomDropdownMenuItemAnchor = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
54
|
+
var children = _ref2.children,
|
|
55
|
+
testId = _ref2['data-testid'],
|
|
56
|
+
ariaHasPopup = _ref2['aria-haspopup'],
|
|
57
|
+
ariaDisabled = _ref2['aria-disabled'],
|
|
58
|
+
ariaPressed = _ref2['aria-pressed'],
|
|
59
|
+
ariaKeyshortcuts = _ref2['aria-keyshortcuts'],
|
|
60
|
+
onClick = _ref2.onClick,
|
|
61
|
+
tabIndex = _ref2.tabIndex,
|
|
55
62
|
href = _ref2.href,
|
|
56
63
|
target = _ref2.target,
|
|
57
|
-
rel = _ref2.rel
|
|
64
|
+
rel = _ref2.rel,
|
|
65
|
+
title = _ref2.title,
|
|
66
|
+
dataAttributes = _objectWithoutProperties(_ref2, _excluded);
|
|
67
|
+
return /*#__PURE__*/React.createElement(Anchor, _extends({
|
|
68
|
+
role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
|
|
69
|
+
testId: testId,
|
|
70
|
+
xcss: cx(styles.toolbarDropdownItem, styles.anchor, ariaDisabled ? styles.disabled : ariaPressed ? styles.selected : styles.enabled),
|
|
71
|
+
onClick: onClick,
|
|
72
|
+
tabIndex: tabIndex,
|
|
73
|
+
"aria-haspopup": ariaHasPopup,
|
|
74
|
+
"aria-expanded": ariaHasPopup ? ariaPressed ? true : false : undefined
|
|
75
|
+
// platform_editor_enghealth_a11y_jan_fixes: menuitem roles cannot have aria-pressed attribute
|
|
76
|
+
,
|
|
77
|
+
"aria-pressed": expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? undefined : ariaPressed,
|
|
78
|
+
"aria-disabled": ariaDisabled,
|
|
79
|
+
"aria-keyshortcuts": ariaKeyshortcuts,
|
|
80
|
+
"data-toolbar-component": "menu-item",
|
|
81
|
+
ref: ref,
|
|
82
|
+
href: href,
|
|
83
|
+
target: target,
|
|
84
|
+
rel: rel,
|
|
85
|
+
title: title
|
|
86
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
87
|
+
}, dataAttributes), children);
|
|
88
|
+
});
|
|
89
|
+
export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref3) {
|
|
90
|
+
var _onClick = _ref3.onClick,
|
|
91
|
+
elemBefore = _ref3.elemBefore,
|
|
92
|
+
elemAfter = _ref3.elemAfter,
|
|
93
|
+
isSelected = _ref3.isSelected,
|
|
94
|
+
children = _ref3.children,
|
|
95
|
+
isDisabled = _ref3.isDisabled,
|
|
96
|
+
hasNestedDropdownMenu = _ref3.hasNestedDropdownMenu,
|
|
97
|
+
triggerRef = _ref3.triggerRef,
|
|
98
|
+
title = _ref3.title,
|
|
99
|
+
_ref3$shouldTitleWrap = _ref3.shouldTitleWrap,
|
|
100
|
+
shouldTitleWrap = _ref3$shouldTitleWrap === void 0 ? true : _ref3$shouldTitleWrap,
|
|
101
|
+
testId = _ref3.testId,
|
|
102
|
+
ariaKeyshortcuts = _ref3.ariaKeyshortcuts,
|
|
103
|
+
href = _ref3.href,
|
|
104
|
+
target = _ref3.target,
|
|
105
|
+
rel = _ref3.rel,
|
|
106
|
+
dataAttributes = _objectWithoutProperties(_ref3, _excluded2);
|
|
58
107
|
var parentContext = useToolbarDropdownMenu();
|
|
59
108
|
var injectedElemAfter = function () {
|
|
60
109
|
if (! /*#__PURE__*/isValidElement(elemAfter)) {
|
|
@@ -68,7 +117,7 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
|
|
|
68
117
|
isDisabled: isDisabled
|
|
69
118
|
}));
|
|
70
119
|
}();
|
|
71
|
-
return /*#__PURE__*/React.createElement(DropdownItem, {
|
|
120
|
+
return /*#__PURE__*/React.createElement(DropdownItem, _extends({
|
|
72
121
|
onClick: function onClick(e) {
|
|
73
122
|
if (!hasNestedDropdownMenu) {
|
|
74
123
|
parentContext === null || parentContext === void 0 || parentContext.closeMenu(e);
|
|
@@ -88,9 +137,11 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
|
|
|
88
137
|
rel: rel
|
|
89
138
|
// @ts-ignore -- This `CustomDropdownMenuItemButton` has type conflicts with the `DropdownItem` component in a way that cannot be reconciled (ignored as it fails types in Jira and should in Platform)
|
|
90
139
|
,
|
|
91
|
-
component: href ? undefined : CustomDropdownMenuItemButton,
|
|
140
|
+
component: href ? expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? CustomDropdownMenuItemAnchor : undefined : CustomDropdownMenuItemButton,
|
|
92
141
|
testId: testId,
|
|
93
142
|
"data-toolbar-component": "menu-item",
|
|
143
|
+
title: title,
|
|
94
144
|
shouldTitleWrap: shouldTitleWrap
|
|
95
|
-
|
|
145
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
146
|
+
}, expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? dataAttributes : {}), children);
|
|
96
147
|
};
|
|
@@ -43,6 +43,7 @@ export var ToolbarNestedDropdownMenu = function ToolbarNestedDropdownMenu(_ref)
|
|
|
43
43
|
}, text);
|
|
44
44
|
}
|
|
45
45
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
46
|
-
xcss: cx(enableMaxHeight && styles.scrollContainer)
|
|
46
|
+
xcss: cx(enableMaxHeight && styles.scrollContainer),
|
|
47
|
+
"data-toolbar-nested-dropdown-menu": true
|
|
47
48
|
}, children));
|
|
48
49
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { AITranslateIcon } from './ui/icons/AITranslateIcon';
|
|
|
27
27
|
export { NestedDropdownRightIcon } from './ui/icons/NestedDropdownRightIcon';
|
|
28
28
|
export { AICommandIcon } from './ui/icons/AICommandIcon';
|
|
29
29
|
export { AddIcon } from './ui/icons/AddIcon';
|
|
30
|
+
export { AppIcon } from './ui/icons/AppIcon';
|
|
30
31
|
export { AppsIcon } from './ui/icons/AppsIcon';
|
|
31
32
|
export { BoldIcon } from './ui/icons/BoldIcon';
|
|
32
33
|
export { CommentIcon } from './ui/icons/CommentIcon';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -9,3 +9,6 @@ export type ToolbarKeyboardNavigationProviderConfig = {
|
|
|
9
9
|
handleFocus: (event: KeyboardEvent) => void;
|
|
10
10
|
isShortcutToFocusToolbar: (event: KeyboardEvent) => boolean;
|
|
11
11
|
};
|
|
12
|
+
export type DataAttributes = {
|
|
13
|
+
[K in `data-${string}`]?: string | number | boolean | undefined;
|
|
14
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { type ReactNode, type Ref } from 'react';
|
|
2
2
|
import type { CustomItemComponentProps } from '@atlaskit/menu/types';
|
|
3
|
+
import type { DataAttributes } from '../types';
|
|
3
4
|
type TextStyle = 'normal' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
|
|
4
5
|
export type CustomDropdownMenuItemButtonProps = CustomItemComponentProps & {
|
|
5
6
|
'aria-disabled'?: boolean;
|
|
6
7
|
'aria-haspopup'?: boolean;
|
|
7
8
|
'aria-keyshortcuts'?: string;
|
|
8
9
|
'aria-pressed'?: boolean;
|
|
10
|
+
title?: string;
|
|
9
11
|
};
|
|
10
12
|
type ToolbarDropdownItemProps = {
|
|
11
13
|
ariaKeyshortcuts?: string;
|
|
@@ -22,7 +24,8 @@ type ToolbarDropdownItemProps = {
|
|
|
22
24
|
target?: string;
|
|
23
25
|
testId?: string;
|
|
24
26
|
textStyle?: TextStyle;
|
|
27
|
+
title?: string;
|
|
25
28
|
triggerRef?: Ref<HTMLButtonElement>;
|
|
26
|
-
};
|
|
27
|
-
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, shouldTitleWrap, testId, ariaKeyshortcuts, href, target, rel, }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
29
|
+
} & DataAttributes;
|
|
30
|
+
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, title, shouldTitleWrap, testId, ariaKeyshortcuts, href, target, rel, ...dataAttributes }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
28
31
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AppIcon } from '@atlaskit/icon/core/app';
|
|
@@ -27,6 +27,7 @@ export { AITranslateIcon } from './ui/icons/AITranslateIcon';
|
|
|
27
27
|
export { NestedDropdownRightIcon } from './ui/icons/NestedDropdownRightIcon';
|
|
28
28
|
export { AICommandIcon } from './ui/icons/AICommandIcon';
|
|
29
29
|
export { AddIcon } from './ui/icons/AddIcon';
|
|
30
|
+
export { AppIcon } from './ui/icons/AppIcon';
|
|
30
31
|
export { AppsIcon } from './ui/icons/AppsIcon';
|
|
31
32
|
export { BoldIcon } from './ui/icons/BoldIcon';
|
|
32
33
|
export { CommentIcon } from './ui/icons/CommentIcon';
|
|
@@ -9,3 +9,6 @@ export type ToolbarKeyboardNavigationProviderConfig = {
|
|
|
9
9
|
handleFocus: (event: KeyboardEvent) => void;
|
|
10
10
|
isShortcutToFocusToolbar: (event: KeyboardEvent) => boolean;
|
|
11
11
|
};
|
|
12
|
+
export type DataAttributes = {
|
|
13
|
+
[K in `data-${string}`]?: string | number | boolean | undefined;
|
|
14
|
+
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React, { type ReactNode, type Ref } from 'react';
|
|
2
2
|
import type { CustomItemComponentProps } from '@atlaskit/menu/types';
|
|
3
|
+
import type { DataAttributes } from '../types';
|
|
3
4
|
type TextStyle = 'normal' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
|
|
4
5
|
export type CustomDropdownMenuItemButtonProps = CustomItemComponentProps & {
|
|
5
6
|
'aria-disabled'?: boolean;
|
|
6
7
|
'aria-haspopup'?: boolean;
|
|
7
8
|
'aria-keyshortcuts'?: string;
|
|
8
9
|
'aria-pressed'?: boolean;
|
|
10
|
+
title?: string;
|
|
9
11
|
};
|
|
10
12
|
type ToolbarDropdownItemProps = {
|
|
11
13
|
ariaKeyshortcuts?: string;
|
|
@@ -22,7 +24,8 @@ type ToolbarDropdownItemProps = {
|
|
|
22
24
|
target?: string;
|
|
23
25
|
testId?: string;
|
|
24
26
|
textStyle?: TextStyle;
|
|
27
|
+
title?: string;
|
|
25
28
|
triggerRef?: Ref<HTMLButtonElement>;
|
|
26
|
-
};
|
|
27
|
-
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, shouldTitleWrap, testId, ariaKeyshortcuts, href, target, rel, }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
29
|
+
} & DataAttributes;
|
|
30
|
+
export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, title, shouldTitleWrap, testId, ariaKeyshortcuts, href, target, rel, ...dataAttributes }: ToolbarDropdownItemProps) => React.JSX.Element;
|
|
28
31
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as AppIcon } from '@atlaskit/icon/core/app';
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"registry": "https://registry.npmjs.org/"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.19.
|
|
6
|
+
"version": "0.19.16",
|
|
7
7
|
"description": "Common UI for Toolbars across the platform",
|
|
8
8
|
"atlassian": {
|
|
9
9
|
"team": "Editor: Jenga",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
31
31
|
"@atlaskit/popup": "^4.13.0",
|
|
32
32
|
"@atlaskit/primitives": "^18.0.0",
|
|
33
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
33
|
+
"@atlaskit/tmp-editor-statsig": "^20.0.0",
|
|
34
34
|
"@atlaskit/tokens": "^11.0.0",
|
|
35
35
|
"@atlaskit/tooltip": "^20.14.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|