@atlaskit/editor-toolbar 0.19.15 → 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 CHANGED
@@ -1,5 +1,18 @@
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
+
3
16
  ## 0.19.15
4
17
 
5
18
  ### 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,6 +10,8 @@ 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");
@@ -17,11 +19,14 @@ var _compiled = require("@atlaskit/primitives/compiled");
17
19
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
18
20
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
19
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"];
20
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); }
21
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; }
22
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; }
23
27
  var styles = {
24
28
  toolbarDropdownItem: "_11c8fhey _18zrutpp _1rjc1b66 _1e0c1txw _kqswh2mm _bfhksm61 _1bsb1osq _1tkezwfg _1ul9eoa3 _syazazsu _1bas12b0 _1ah31i6y",
29
+ anchor: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _1053azsu _9oik1r31 _1bnxglyw _jf4cnqa1 _30l3azsu",
25
30
  enabled: "_irr31dpa _1di6fcek",
26
31
  disabled: "_syaz1gmx _80om13gf",
27
32
  selected: "_bfhk15s3 _syaz6x5g _irr3ufnl _1di6nozp"
@@ -34,7 +39,8 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/(0, _react.forwardRef)(function
34
39
  ariaPressed = _ref['aria-pressed'],
35
40
  ariaKeyshortcuts = _ref['aria-keyshortcuts'],
36
41
  onClick = _ref.onClick,
37
- tabIndex = _ref.tabIndex;
42
+ tabIndex = _ref.tabIndex,
43
+ title = _ref.title;
38
44
  return /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
39
45
  role: (0, _expValEquals.expValEquals)('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
40
46
  testId: testId,
@@ -49,25 +55,64 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/(0, _react.forwardRef)(function
49
55
  "aria-disabled": ariaDisabled,
50
56
  "aria-keyshortcuts": ariaKeyshortcuts,
51
57
  "data-toolbar-component": (0, _experiments.editorExperiment)('platform_synced_block', true) ? 'menu-item' : undefined,
52
- ref: ref
58
+ ref: ref,
59
+ title: (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
53
60
  }, children);
54
61
  });
55
- var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
56
- var _onClick = _ref2.onClick,
57
- elemBefore = _ref2.elemBefore,
58
- elemAfter = _ref2.elemAfter,
59
- isSelected = _ref2.isSelected,
60
- children = _ref2.children,
61
- isDisabled = _ref2.isDisabled,
62
- hasNestedDropdownMenu = _ref2.hasNestedDropdownMenu,
63
- triggerRef = _ref2.triggerRef,
64
- _ref2$shouldTitleWrap = _ref2.shouldTitleWrap,
65
- shouldTitleWrap = _ref2$shouldTitleWrap === void 0 ? true : _ref2$shouldTitleWrap,
66
- testId = _ref2.testId,
67
- 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,
68
71
  href = _ref2.href,
69
72
  target = _ref2.target,
70
- 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);
71
116
  var parentContext = (0, _ToolbarDropdownMenuContext.useToolbarDropdownMenu)();
72
117
  var injectedElemAfter = function () {
73
118
  if (! /*#__PURE__*/(0, _react.isValidElement)(elemAfter)) {
@@ -81,7 +126,7 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
81
126
  isDisabled: isDisabled
82
127
  }));
83
128
  }();
84
- return /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, {
129
+ return /*#__PURE__*/_react.default.createElement(_dropdownMenu.DropdownItem, (0, _extends2.default)({
85
130
  onClick: function onClick(e) {
86
131
  if (!hasNestedDropdownMenu) {
87
132
  parentContext === null || parentContext === void 0 || parentContext.closeMenu(e);
@@ -101,9 +146,11 @@ var ToolbarDropdownItem = exports.ToolbarDropdownItem = function ToolbarDropdown
101
146
  rel: rel
102
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)
103
148
  ,
104
- component: href ? undefined : CustomDropdownMenuItemButton,
149
+ component: href ? (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? CustomDropdownMenuItemAnchor : undefined : CustomDropdownMenuItemButton,
105
150
  testId: testId,
106
151
  "data-toolbar-component": "menu-item",
152
+ title: title,
107
153
  shouldTitleWrap: shouldTitleWrap
108
- }, children);
154
+ // eslint-disable-next-line react/jsx-props-no-spreading
155
+ }, (0, _expValEquals.expValEquals)('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? dataAttributes : {}), children);
109
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"));
@@ -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,15 +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';
8
9
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
9
10
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
10
11
  import { useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
11
12
  const styles = {
12
13
  toolbarDropdownItem: "_11c8fhey _18zrutpp _1rjc1b66 _1e0c1txw _kqswh2mm _bfhksm61 _1bsb1osq _1tkezwfg _1ul9eoa3 _syazazsu _1bas12b0 _1ah31i6y",
14
+ anchor: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _1053azsu _9oik1r31 _1bnxglyw _jf4cnqa1 _30l3azsu",
13
15
  enabled: "_irr31dpa _1di6fcek",
14
16
  disabled: "_syaz1gmx _80om13gf",
15
17
  selected: "_bfhk15s3 _syaz6x5g _irr3ufnl _1di6nozp"
@@ -22,7 +24,8 @@ const CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(({
22
24
  'aria-pressed': ariaPressed,
23
25
  'aria-keyshortcuts': ariaKeyshortcuts,
24
26
  onClick,
25
- tabIndex
27
+ tabIndex,
28
+ title
26
29
  }, ref) => /*#__PURE__*/React.createElement(Pressable, {
27
30
  role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
28
31
  testId: testId,
@@ -37,8 +40,44 @@ const CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(({
37
40
  "aria-disabled": ariaDisabled,
38
41
  "aria-keyshortcuts": ariaKeyshortcuts,
39
42
  "data-toolbar-component": editorExperiment('platform_synced_block', true) ? 'menu-item' : undefined,
40
- ref: ref
43
+ ref: ref,
44
+ title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
41
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));
42
81
  export const ToolbarDropdownItem = ({
43
82
  onClick,
44
83
  elemBefore,
@@ -48,12 +87,14 @@ export const ToolbarDropdownItem = ({
48
87
  isDisabled,
49
88
  hasNestedDropdownMenu,
50
89
  triggerRef,
90
+ title,
51
91
  shouldTitleWrap = true,
52
92
  testId,
53
93
  ariaKeyshortcuts,
54
94
  href,
55
95
  target,
56
- rel
96
+ rel,
97
+ ...dataAttributes
57
98
  }) => {
58
99
  const parentContext = useToolbarDropdownMenu();
59
100
  const injectedElemAfter = (() => {
@@ -69,7 +110,7 @@ export const ToolbarDropdownItem = ({
69
110
  isDisabled
70
111
  });
71
112
  })();
72
- return /*#__PURE__*/React.createElement(DropdownItem, {
113
+ return /*#__PURE__*/React.createElement(DropdownItem, _extends({
73
114
  onClick: e => {
74
115
  if (!hasNestedDropdownMenu) {
75
116
  parentContext === null || parentContext === void 0 ? void 0 : parentContext.closeMenu(e);
@@ -89,9 +130,11 @@ export const ToolbarDropdownItem = ({
89
130
  rel: rel
90
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)
91
132
  ,
92
- component: href ? undefined : CustomDropdownMenuItemButton,
133
+ component: href ? expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? CustomDropdownMenuItemAnchor : undefined : CustomDropdownMenuItemButton,
93
134
  testId: testId,
94
135
  "data-toolbar-component": "menu-item",
136
+ title: title,
95
137
  shouldTitleWrap: shouldTitleWrap
96
- }, children);
138
+ // eslint-disable-next-line react/jsx-props-no-spreading
139
+ }, expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? dataAttributes : {}), children);
97
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
  };
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ export { default as AppIcon } from '@atlaskit/icon/core/app';
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,12 +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';
11
15
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
16
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
13
17
  import { useToolbarDropdownMenu } from './ToolbarDropdownMenuContext';
14
18
  var styles = {
15
19
  toolbarDropdownItem: "_11c8fhey _18zrutpp _1rjc1b66 _1e0c1txw _kqswh2mm _bfhksm61 _1bsb1osq _1tkezwfg _1ul9eoa3 _syazazsu _1bas12b0 _1ah31i6y",
20
+ anchor: "_4bfu1r31 _1hmsglyw _ajmmnqa1 _1053azsu _9oik1r31 _1bnxglyw _jf4cnqa1 _30l3azsu",
16
21
  enabled: "_irr31dpa _1di6fcek",
17
22
  disabled: "_syaz1gmx _80om13gf",
18
23
  selected: "_bfhk15s3 _syaz6x5g _irr3ufnl _1di6nozp"
@@ -25,7 +30,8 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref)
25
30
  ariaPressed = _ref['aria-pressed'],
26
31
  ariaKeyshortcuts = _ref['aria-keyshortcuts'],
27
32
  onClick = _ref.onClick,
28
- tabIndex = _ref.tabIndex;
33
+ tabIndex = _ref.tabIndex,
34
+ title = _ref.title;
29
35
  return /*#__PURE__*/React.createElement(Pressable, {
30
36
  role: expValEquals('platform_editor_enghealth_a11y_jan_fixes', 'isEnabled', true) ? 'menuitem' : undefined,
31
37
  testId: testId,
@@ -40,25 +46,64 @@ var CustomDropdownMenuItemButton = /*#__PURE__*/forwardRef(function (_ref, ref)
40
46
  "aria-disabled": ariaDisabled,
41
47
  "aria-keyshortcuts": ariaKeyshortcuts,
42
48
  "data-toolbar-component": editorExperiment('platform_synced_block', true) ? 'menu-item' : undefined,
43
- ref: ref
49
+ ref: ref,
50
+ title: expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? title : undefined
44
51
  }, children);
45
52
  });
46
- export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
47
- var _onClick = _ref2.onClick,
48
- elemBefore = _ref2.elemBefore,
49
- elemAfter = _ref2.elemAfter,
50
- isSelected = _ref2.isSelected,
51
- children = _ref2.children,
52
- isDisabled = _ref2.isDisabled,
53
- hasNestedDropdownMenu = _ref2.hasNestedDropdownMenu,
54
- triggerRef = _ref2.triggerRef,
55
- _ref2$shouldTitleWrap = _ref2.shouldTitleWrap,
56
- shouldTitleWrap = _ref2$shouldTitleWrap === void 0 ? true : _ref2$shouldTitleWrap,
57
- testId = _ref2.testId,
58
- 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,
59
62
  href = _ref2.href,
60
63
  target = _ref2.target,
61
- 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);
62
107
  var parentContext = useToolbarDropdownMenu();
63
108
  var injectedElemAfter = function () {
64
109
  if (! /*#__PURE__*/isValidElement(elemAfter)) {
@@ -72,7 +117,7 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
72
117
  isDisabled: isDisabled
73
118
  }));
74
119
  }();
75
- return /*#__PURE__*/React.createElement(DropdownItem, {
120
+ return /*#__PURE__*/React.createElement(DropdownItem, _extends({
76
121
  onClick: function onClick(e) {
77
122
  if (!hasNestedDropdownMenu) {
78
123
  parentContext === null || parentContext === void 0 || parentContext.closeMenu(e);
@@ -92,9 +137,11 @@ export var ToolbarDropdownItem = function ToolbarDropdownItem(_ref2) {
92
137
  rel: rel
93
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)
94
139
  ,
95
- component: href ? undefined : CustomDropdownMenuItemButton,
140
+ component: href ? expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? CustomDropdownMenuItemAnchor : undefined : CustomDropdownMenuItemButton,
96
141
  testId: testId,
97
142
  "data-toolbar-component": "menu-item",
143
+ title: title,
98
144
  shouldTitleWrap: shouldTitleWrap
99
- }, children);
145
+ // eslint-disable-next-line react/jsx-props-no-spreading
146
+ }, expValEquals('platform_editor_renderer_toolbar_updates', 'isEnabled', true) ? dataAttributes : {}), children);
100
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
  };
@@ -0,0 +1,2 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ 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';
@@ -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.15",
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": "^19.0.0",
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",