@atlaskit/editor-toolbar 2.1.1 → 2.1.3
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 +14 -0
- package/dist/cjs/ui/ToolbarButton.js +4 -1
- package/dist/cjs/ui/ToolbarButtonGroup.compiled.css +1 -0
- package/dist/cjs/ui/ToolbarButtonGroup.js +3 -1
- package/dist/es2019/ui/ToolbarButton.js +4 -1
- package/dist/es2019/ui/ToolbarButtonGroup.compiled.css +1 -0
- package/dist/es2019/ui/ToolbarButtonGroup.js +3 -1
- package/dist/esm/ui/ToolbarButton.js +4 -1
- package/dist/esm/ui/ToolbarButtonGroup.compiled.css +1 -0
- package/dist/esm/ui/ToolbarButtonGroup.js +3 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-toolbar
|
|
2
2
|
|
|
3
|
+
## 2.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.1.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`7ebb725ea5629`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7ebb725ea5629) -
|
|
14
|
+
Remove pressed semantics from toolbar popup triggers, gated behind jira_editor_a11y_toolbar_fixes
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 2.1.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -11,6 +11,7 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _css = require("@atlaskit/css");
|
|
13
13
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
14
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
15
|
var _uiContext = require("../hooks/ui-context");
|
|
15
16
|
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); }
|
|
16
17
|
var styles = {
|
|
@@ -46,7 +47,8 @@ var ToolbarButton = exports.ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
46
47
|
return /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
|
|
47
48
|
ref: ref,
|
|
48
49
|
xcss: (0, _css.cx)(styles.button, disabled ? styles.disabled : isSelected ? styles.selected : styles.enabled),
|
|
49
|
-
"aria-pressed":
|
|
50
|
+
"aria-pressed": (0, _expValEquals.expValEquals)('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? Boolean(ariaHasPopup) ? undefined // No aria-pressed for dropdown buttons
|
|
51
|
+
: isSelected : isSelected,
|
|
50
52
|
"aria-expanded": ariaExpanded,
|
|
51
53
|
"aria-haspopup": ariaHasPopup,
|
|
52
54
|
"aria-controls": ariaControls,
|
|
@@ -67,6 +69,7 @@ var ToolbarButton = exports.ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
67
69
|
}
|
|
68
70
|
},
|
|
69
71
|
"data-toolbar-component": "button",
|
|
72
|
+
"data-selected": (0, _expValEquals.expValEquals)('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? isSelected : undefined,
|
|
70
73
|
interactionName: interactionName
|
|
71
74
|
}, iconBefore, children);
|
|
72
75
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
._19pe12x7 [data-toolbar-component=button]{padding-inline:var(--ds-space-075,6px)}._14jy1dpa:has([data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):hover) [data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
4
4
|
._15rdidpf [data-toolbar-component=button]{border-top-left-radius:0}
|
|
5
5
|
._1e0c1txw{display:flex}
|
|
6
|
+
._1gt41dpa:has([data-toolbar-component=button]:not([data-selected=true]):not([disabled]):hover) [data-toolbar-component=button]:not([data-selected=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
6
7
|
._1qq0idpf [data-toolbar-component=button]{border-top-right-radius:0}
|
|
7
8
|
._3nesidpf [data-toolbar-component=button]{border-bottom-right-radius:0}
|
|
8
9
|
._i84vidpf [data-toolbar-component=button]{border-bottom-left-radius:0}
|
|
@@ -12,9 +12,11 @@ var React = _react;
|
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
14
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
16
|
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); }
|
|
16
17
|
var styles = {
|
|
17
18
|
container: "_zulpv77o _1e0c1txw _14jy1dpa",
|
|
19
|
+
containerWithA11yToolbarFixes: "_zulpv77o _1e0c1txw _1gt41dpa",
|
|
18
20
|
firstChild: "_19pe12x7 _1qq0idpf _3nesidpf",
|
|
19
21
|
lastChild: "_19pe12x7 _15rdidpf _i84vidpf"
|
|
20
22
|
};
|
|
@@ -27,7 +29,7 @@ var ToolbarButtonGroup = exports.ToolbarButtonGroup = function ToolbarButtonGrou
|
|
|
27
29
|
var LastChild = (0, _platformFeatureFlags.fg)('platform_editor_fix_t_at_is_not_a_function') ? items[items.length - 1] : items.at(-1);
|
|
28
30
|
var middleChildren = items.slice(1, -1);
|
|
29
31
|
return /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
30
|
-
xcss: styles.container,
|
|
32
|
+
xcss: (0, _expValEquals.expValEquals)('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? styles.containerWithA11yToolbarFixes : styles.container,
|
|
31
33
|
"data-toolbar-component": "button-group"
|
|
32
34
|
}, items.length <= 1 ? children : /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
33
35
|
className: (0, _runtime.ax)([styles.firstChild])
|
|
@@ -4,6 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import { cx } from '@atlaskit/css';
|
|
6
6
|
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
import { useToolbarUI } from '../hooks/ui-context';
|
|
8
9
|
const styles = {
|
|
9
10
|
button: "_zulp12x7 _2rko12b0 _11c8fhey _1e0c1txw _bfhksm61 _o5721q9c _4cvr1h6o _1bah1h6o _1tke1f4h _syazazsu _19bvu2gc _u5f3u2gc _1ah3idpf _g0pbkb7n _oh03h2mm",
|
|
@@ -40,7 +41,8 @@ export const ToolbarButton = /*#__PURE__*/forwardRef(({
|
|
|
40
41
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
41
42
|
ref: ref,
|
|
42
43
|
xcss: cx(styles.button, disabled ? styles.disabled : isSelected ? styles.selected : styles.enabled),
|
|
43
|
-
"aria-pressed":
|
|
44
|
+
"aria-pressed": expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? Boolean(ariaHasPopup) ? undefined // No aria-pressed for dropdown buttons
|
|
45
|
+
: isSelected : isSelected,
|
|
44
46
|
"aria-expanded": ariaExpanded,
|
|
45
47
|
"aria-haspopup": ariaHasPopup,
|
|
46
48
|
"aria-controls": ariaControls,
|
|
@@ -61,6 +63,7 @@ export const ToolbarButton = /*#__PURE__*/forwardRef(({
|
|
|
61
63
|
}
|
|
62
64
|
},
|
|
63
65
|
"data-toolbar-component": "button",
|
|
66
|
+
"data-selected": expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? isSelected : undefined,
|
|
64
67
|
interactionName: interactionName
|
|
65
68
|
}, iconBefore, children);
|
|
66
69
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
._19pe12x7 [data-toolbar-component=button]{padding-inline:var(--ds-space-075,6px)}._14jy1dpa:has([data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):hover) [data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
4
4
|
._15rdidpf [data-toolbar-component=button]{border-top-left-radius:0}
|
|
5
5
|
._1e0c1txw{display:flex}
|
|
6
|
+
._1gt41dpa:has([data-toolbar-component=button]:not([data-selected=true]):not([disabled]):hover) [data-toolbar-component=button]:not([data-selected=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
6
7
|
._1qq0idpf [data-toolbar-component=button]{border-top-right-radius:0}
|
|
7
8
|
._3nesidpf [data-toolbar-component=button]{border-bottom-right-radius:0}
|
|
8
9
|
._i84vidpf [data-toolbar-component=button]{border-bottom-left-radius:0}
|
|
@@ -5,8 +5,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { Children, Fragment } from 'react';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
const styles = {
|
|
9
10
|
container: "_zulpv77o _1e0c1txw _14jy1dpa",
|
|
11
|
+
containerWithA11yToolbarFixes: "_zulpv77o _1e0c1txw _1gt41dpa",
|
|
10
12
|
firstChild: "_19pe12x7 _1qq0idpf _3nesidpf",
|
|
11
13
|
lastChild: "_19pe12x7 _15rdidpf _i84vidpf"
|
|
12
14
|
};
|
|
@@ -20,7 +22,7 @@ export const ToolbarButtonGroup = ({
|
|
|
20
22
|
const LastChild = fg('platform_editor_fix_t_at_is_not_a_function') ? items[items.length - 1] : items.at(-1);
|
|
21
23
|
const middleChildren = items.slice(1, -1);
|
|
22
24
|
return /*#__PURE__*/React.createElement(Box, {
|
|
23
|
-
xcss: styles.container,
|
|
25
|
+
xcss: expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? styles.containerWithA11yToolbarFixes : styles.container,
|
|
24
26
|
"data-toolbar-component": "button-group"
|
|
25
27
|
}, items.length <= 1 ? children : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
26
28
|
className: ax([styles.firstChild])
|
|
@@ -4,6 +4,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import { cx } from '@atlaskit/css';
|
|
6
6
|
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
import { useToolbarUI } from '../hooks/ui-context';
|
|
8
9
|
var styles = {
|
|
9
10
|
button: "_zulp12x7 _2rko12b0 _11c8fhey _1e0c1txw _bfhksm61 _o5721q9c _4cvr1h6o _1bah1h6o _1tke1f4h _syazazsu _19bvu2gc _u5f3u2gc _1ah3idpf _g0pbkb7n _oh03h2mm",
|
|
@@ -38,7 +39,8 @@ export var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
38
39
|
return /*#__PURE__*/React.createElement(Pressable, {
|
|
39
40
|
ref: ref,
|
|
40
41
|
xcss: cx(styles.button, disabled ? styles.disabled : isSelected ? styles.selected : styles.enabled),
|
|
41
|
-
"aria-pressed":
|
|
42
|
+
"aria-pressed": expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? Boolean(ariaHasPopup) ? undefined // No aria-pressed for dropdown buttons
|
|
43
|
+
: isSelected : isSelected,
|
|
42
44
|
"aria-expanded": ariaExpanded,
|
|
43
45
|
"aria-haspopup": ariaHasPopup,
|
|
44
46
|
"aria-controls": ariaControls,
|
|
@@ -59,6 +61,7 @@ export var ToolbarButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
59
61
|
}
|
|
60
62
|
},
|
|
61
63
|
"data-toolbar-component": "button",
|
|
64
|
+
"data-selected": expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? isSelected : undefined,
|
|
62
65
|
interactionName: interactionName
|
|
63
66
|
}, iconBefore, children);
|
|
64
67
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
._19pe12x7 [data-toolbar-component=button]{padding-inline:var(--ds-space-075,6px)}._14jy1dpa:has([data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):hover) [data-toolbar-component=button]:not([aria-pressed=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
4
4
|
._15rdidpf [data-toolbar-component=button]{border-top-left-radius:0}
|
|
5
5
|
._1e0c1txw{display:flex}
|
|
6
|
+
._1gt41dpa:has([data-toolbar-component=button]:not([data-selected=true]):not([disabled]):hover) [data-toolbar-component=button]:not([data-selected=true]):not([disabled]):not(:hover){background-color:var(--ds-background-neutral-subtle-hovered,#0515240f)}
|
|
6
7
|
._1qq0idpf [data-toolbar-component=button]{border-top-right-radius:0}
|
|
7
8
|
._3nesidpf [data-toolbar-component=button]{border-bottom-right-radius:0}
|
|
8
9
|
._i84vidpf [data-toolbar-component=button]{border-bottom-left-radius:0}
|
|
@@ -5,8 +5,10 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { Children, Fragment } from 'react';
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
var styles = {
|
|
9
10
|
container: "_zulpv77o _1e0c1txw _14jy1dpa",
|
|
11
|
+
containerWithA11yToolbarFixes: "_zulpv77o _1e0c1txw _1gt41dpa",
|
|
10
12
|
firstChild: "_19pe12x7 _1qq0idpf _3nesidpf",
|
|
11
13
|
lastChild: "_19pe12x7 _15rdidpf _i84vidpf"
|
|
12
14
|
};
|
|
@@ -19,7 +21,7 @@ export var ToolbarButtonGroup = function ToolbarButtonGroup(_ref) {
|
|
|
19
21
|
var LastChild = fg('platform_editor_fix_t_at_is_not_a_function') ? items[items.length - 1] : items.at(-1);
|
|
20
22
|
var middleChildren = items.slice(1, -1);
|
|
21
23
|
return /*#__PURE__*/React.createElement(Box, {
|
|
22
|
-
xcss: styles.container,
|
|
24
|
+
xcss: expValEquals('jira_editor_a11y_toolbar_fixes', 'isEnabled', true) ? styles.containerWithA11yToolbarFixes : styles.container,
|
|
23
25
|
"data-toolbar-component": "button-group"
|
|
24
26
|
}, items.length <= 1 ? children : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
25
27
|
className: ax([styles.firstChild])
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"registry": "https://registry.npmjs.org/"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.1.
|
|
6
|
+
"version": "2.1.3",
|
|
7
7
|
"description": "Common UI for Toolbars across the platform",
|
|
8
8
|
"atlassian": {
|
|
9
9
|
"react-compiler": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/popup": "^5.1.0",
|
|
39
39
|
"@atlaskit/primitives": "^20.2.0",
|
|
40
40
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^115.0.0",
|
|
42
42
|
"@atlaskit/tokens": "^15.2.0",
|
|
43
43
|
"@atlaskit/tooltip": "^23.1.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|