@atlaskit/editor-plugin-floating-toolbar 1.2.2 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/ui/Dropdown.js +7 -6
- package/dist/cjs/ui/DropdownMenu.js +27 -2
- package/dist/cjs/ui/ScrollButtons.js +11 -4
- package/dist/cjs/ui/Toolbar.js +1 -0
- package/dist/es2019/ui/Dropdown.js +6 -6
- package/dist/es2019/ui/DropdownMenu.js +31 -2
- package/dist/es2019/ui/ScrollButtons.js +9 -9
- package/dist/es2019/ui/Toolbar.js +1 -0
- package/dist/esm/ui/Dropdown.js +6 -4
- package/dist/esm/ui/DropdownMenu.js +27 -2
- package/dist/esm/ui/ScrollButtons.js +9 -3
- package/dist/esm/ui/Toolbar.js +1 -0
- package/package.json +19 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-floating-toolbar
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934) [`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) - bumped editor-prosemirror version to 4.0.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.2.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#80728](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80728) [`aac7ad9bb32d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/aac7ad9bb32d) - [ux] The table's floating toolbar dropdown menu a11y annnouncement.
|
|
18
|
+
|
|
3
19
|
## 1.2.2
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/ui/Dropdown.js
CHANGED
|
@@ -13,26 +13,27 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
13
13
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
14
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
15
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
17
|
var _react2 = require("@emotion/react");
|
|
19
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
20
19
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
21
20
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-down"));
|
|
22
21
|
var _DropdownMenu = _interopRequireWildcard(require("./DropdownMenu"));
|
|
23
|
-
var _templateObject, _templateObject2;
|
|
24
|
-
/** @jsx jsx */
|
|
25
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
26
23
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
27
24
|
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; }
|
|
28
25
|
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; }
|
|
29
26
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
30
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
27
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
31
28
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
32
|
-
var dropdownExpandContainer = (0, _react2.css)(
|
|
29
|
+
var dropdownExpandContainer = (0, _react2.css)({
|
|
30
|
+
margin: "0px ".concat("var(--ds-space-negative-050, -4px)")
|
|
31
|
+
});
|
|
33
32
|
|
|
34
33
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
35
|
-
var iconGroup = (0, _react2.css)(
|
|
34
|
+
var iconGroup = (0, _react2.css)({
|
|
35
|
+
display: 'flex'
|
|
36
|
+
});
|
|
36
37
|
var CompositeIcon = function CompositeIcon(_ref) {
|
|
37
38
|
var icon = _ref.icon;
|
|
38
39
|
return (0, _react2.jsx)("div", {
|
|
@@ -17,6 +17,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
17
17
|
var _floatingToolbar = require("@atlaskit/editor-common/floating-toolbar");
|
|
18
18
|
var _done = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/done"));
|
|
19
19
|
var _menu = require("@atlaskit/menu");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
21
|
var _colors = require("@atlaskit/theme/colors");
|
|
21
22
|
var _constants = require("@atlaskit/theme/constants");
|
|
22
23
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
@@ -133,6 +134,18 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
133
134
|
e.preventDefault();
|
|
134
135
|
}
|
|
135
136
|
}, [item.disabled]);
|
|
137
|
+
var isAriaChecked = function isAriaChecked(item) {
|
|
138
|
+
var selected = item.selected,
|
|
139
|
+
domItemOptions = item.domItemOptions;
|
|
140
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') && (domItemOptions === null || domItemOptions === void 0 ? void 0 : domItemOptions.type) === 'item-checkbox') {
|
|
141
|
+
return selected;
|
|
142
|
+
}
|
|
143
|
+
return undefined;
|
|
144
|
+
};
|
|
145
|
+
var hasRole = function hasRole(item) {
|
|
146
|
+
var domItemOptions = item.domItemOptions;
|
|
147
|
+
return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') && (domItemOptions === null || domItemOptions === void 0 ? void 0 : domItemOptions.type) === 'item-checkbox' ? 'menuitemcheckbox' : undefined;
|
|
148
|
+
};
|
|
136
149
|
(0, _react.useEffect)(function () {
|
|
137
150
|
var labelRefCurrent = labelRef.current;
|
|
138
151
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -158,7 +171,9 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
158
171
|
onMouseLeave: handleItemMouseLeave,
|
|
159
172
|
onMouseOut: handleItemMouseOut,
|
|
160
173
|
onFocus: handleItemOnFocus,
|
|
161
|
-
onBlur: handleItemOnBlur
|
|
174
|
+
onBlur: handleItemOnBlur,
|
|
175
|
+
role: hasRole(item),
|
|
176
|
+
"aria-checked": isAriaChecked(item)
|
|
162
177
|
}, (0, _react2.jsx)("span", {
|
|
163
178
|
ref: labelRef,
|
|
164
179
|
css: labelStyles
|
|
@@ -190,7 +205,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
190
205
|
intl = _this$props.intl,
|
|
191
206
|
editorView = _this$props.editorView;
|
|
192
207
|
return (0, _react2.jsx)("div", {
|
|
193
|
-
css: menuContainerStyles
|
|
208
|
+
css: menuContainerStyles,
|
|
209
|
+
role: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') ? 'menu' : undefined
|
|
194
210
|
}, items.filter(function (item) {
|
|
195
211
|
return !item.hidden;
|
|
196
212
|
}).map(function (item, idx) {
|
|
@@ -211,6 +227,15 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
211
227
|
showSelected = _this$props$showSelec === void 0 ? true : _this$props$showSelec;
|
|
212
228
|
var selected = item.selected;
|
|
213
229
|
if (showSelected && selected) {
|
|
230
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33')) {
|
|
231
|
+
return (0, _react2.jsx)("span", {
|
|
232
|
+
"aria-hidden": "true"
|
|
233
|
+
}, (0, _react2.jsx)(_done.default, {
|
|
234
|
+
primaryColor: "var(--ds-icon-selected, ".concat(_colors.B400, ")"),
|
|
235
|
+
size: "small",
|
|
236
|
+
label: intl.formatMessage(_floatingToolbar.messages.confirmModalOK)
|
|
237
|
+
}));
|
|
238
|
+
}
|
|
214
239
|
return (0, _react2.jsx)(_done.default, {
|
|
215
240
|
primaryColor: "var(--ds-icon-selected, ".concat(_colors.B400, ")"),
|
|
216
241
|
size: "small",
|
|
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.ScrollButtons = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
11
|
var _react2 = require("@emotion/react");
|
|
13
12
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
@@ -16,12 +15,20 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
16
15
|
var _chevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-left-large"));
|
|
17
16
|
var _chevronRightLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/chevron-right-large"));
|
|
18
17
|
var _colors = require("@atlaskit/theme/colors");
|
|
19
|
-
var _templateObject;
|
|
20
|
-
/** @jsx jsx */
|
|
21
18
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
19
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
/** @jsx jsx */
|
|
21
|
+
|
|
23
22
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
24
|
-
var toolbarScrollButtons = (0, _react2.css)(
|
|
23
|
+
var toolbarScrollButtons = (0, _react2.css)({
|
|
24
|
+
display: 'grid',
|
|
25
|
+
gridTemplateColumns: '1fr 1fr',
|
|
26
|
+
gridGap: "var(--ds-space-050, 4px)",
|
|
27
|
+
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)"),
|
|
28
|
+
borderLeft: "solid ".concat("var(--ds-border, ".concat(_colors.N30, ")"), " 1px"),
|
|
29
|
+
flexShrink: 0,
|
|
30
|
+
alignItems: 'center'
|
|
31
|
+
});
|
|
25
32
|
var LeftIcon = _chevronLeftLarge.default;
|
|
26
33
|
var RightIcon = _chevronRightLarge.default;
|
|
27
34
|
var ScrollButtons = exports.ScrollButtons = function ScrollButtons(_ref) {
|
package/dist/cjs/ui/Toolbar.js
CHANGED
|
@@ -37,6 +37,7 @@ var _ScrollButtons = require("./ScrollButtons");
|
|
|
37
37
|
var _Select = _interopRequireDefault(require("./Select"));
|
|
38
38
|
var _Separator = _interopRequireDefault(require("./Separator"));
|
|
39
39
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
40
|
+
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation */
|
|
40
41
|
/** @jsx jsx */
|
|
41
42
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
42
43
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -9,14 +9,14 @@ import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
|
9
9
|
import DropdownMenu, { itemSpacing, menuItemDimensions } from './DropdownMenu';
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
12
|
-
const dropdownExpandContainer = css
|
|
13
|
-
margin: 0px ${"var(--ds-space-negative-050, -4px)"}
|
|
14
|
-
|
|
12
|
+
const dropdownExpandContainer = css({
|
|
13
|
+
margin: `0px ${"var(--ds-space-negative-050, -4px)"}`
|
|
14
|
+
});
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
17
|
-
const iconGroup = css
|
|
18
|
-
display: flex
|
|
19
|
-
|
|
17
|
+
const iconGroup = css({
|
|
18
|
+
display: 'flex'
|
|
19
|
+
});
|
|
20
20
|
const CompositeIcon = ({
|
|
21
21
|
icon
|
|
22
22
|
}) => jsx("div", {
|
|
@@ -7,6 +7,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
7
7
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
8
8
|
import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
9
9
|
import { ButtonItem } from '@atlaskit/menu';
|
|
10
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { B400 } from '@atlaskit/theme/colors';
|
|
11
12
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
12
13
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -119,6 +120,22 @@ const DropdownMenuItem = ({
|
|
|
119
120
|
e.preventDefault();
|
|
120
121
|
}
|
|
121
122
|
}, [item.disabled]);
|
|
123
|
+
const isAriaChecked = item => {
|
|
124
|
+
const {
|
|
125
|
+
selected,
|
|
126
|
+
domItemOptions
|
|
127
|
+
} = item;
|
|
128
|
+
if (getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') && (domItemOptions === null || domItemOptions === void 0 ? void 0 : domItemOptions.type) === 'item-checkbox') {
|
|
129
|
+
return selected;
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
};
|
|
133
|
+
const hasRole = item => {
|
|
134
|
+
const {
|
|
135
|
+
domItemOptions
|
|
136
|
+
} = item;
|
|
137
|
+
return getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') && (domItemOptions === null || domItemOptions === void 0 ? void 0 : domItemOptions.type) === 'item-checkbox' ? 'menuitemcheckbox' : undefined;
|
|
138
|
+
};
|
|
122
139
|
useEffect(() => {
|
|
123
140
|
const labelRefCurrent = labelRef.current;
|
|
124
141
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -144,7 +161,9 @@ const DropdownMenuItem = ({
|
|
|
144
161
|
onMouseLeave: handleItemMouseLeave,
|
|
145
162
|
onMouseOut: handleItemMouseOut,
|
|
146
163
|
onFocus: handleItemOnFocus,
|
|
147
|
-
onBlur: handleItemOnBlur
|
|
164
|
+
onBlur: handleItemOnBlur,
|
|
165
|
+
role: hasRole(item),
|
|
166
|
+
"aria-checked": isAriaChecked(item)
|
|
148
167
|
}, jsx("span", {
|
|
149
168
|
ref: labelRef,
|
|
150
169
|
css: labelStyles
|
|
@@ -168,7 +187,8 @@ class Dropdown extends Component {
|
|
|
168
187
|
editorView
|
|
169
188
|
} = this.props;
|
|
170
189
|
return jsx("div", {
|
|
171
|
-
css: menuContainerStyles
|
|
190
|
+
css: menuContainerStyles,
|
|
191
|
+
role: getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') ? 'menu' : undefined
|
|
172
192
|
}, items.filter(item => !item.hidden).map((item, idx) => jsx(DropdownMenuItem, {
|
|
173
193
|
key: idx,
|
|
174
194
|
item: item,
|
|
@@ -186,6 +206,15 @@ class Dropdown extends Component {
|
|
|
186
206
|
selected
|
|
187
207
|
} = item;
|
|
188
208
|
if (showSelected && selected) {
|
|
209
|
+
if (getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33')) {
|
|
210
|
+
return jsx("span", {
|
|
211
|
+
"aria-hidden": "true"
|
|
212
|
+
}, jsx(EditorDoneIcon, {
|
|
213
|
+
primaryColor: `var(--ds-icon-selected, ${B400})`,
|
|
214
|
+
size: "small",
|
|
215
|
+
label: intl.formatMessage(messages.confirmModalOK)
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
189
218
|
return jsx(EditorDoneIcon, {
|
|
190
219
|
primaryColor: `var(--ds-icon-selected, ${B400})`,
|
|
191
220
|
size: "small",
|
|
@@ -8,15 +8,15 @@ import ChevronLeftLargeIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
|
8
8
|
import ChevronRightLargeIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
|
9
9
|
import { N30 } from '@atlaskit/theme/colors';
|
|
10
10
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
11
|
-
const toolbarScrollButtons = css
|
|
12
|
-
display: grid
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
padding:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const toolbarScrollButtons = css({
|
|
12
|
+
display: 'grid',
|
|
13
|
+
gridTemplateColumns: '1fr 1fr',
|
|
14
|
+
gridGap: "var(--ds-space-050, 4px)",
|
|
15
|
+
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-100, 8px)"}`,
|
|
16
|
+
borderLeft: `solid ${`var(--ds-border, ${N30})`} 1px`,
|
|
17
|
+
flexShrink: 0,
|
|
18
|
+
alignItems: 'center'
|
|
19
|
+
});
|
|
20
20
|
const LeftIcon = ChevronLeftLargeIcon;
|
|
21
21
|
const RightIcon = ChevronRightLargeIcon;
|
|
22
22
|
export const ScrollButtons = ({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation */
|
|
3
4
|
/** @jsx jsx */
|
|
4
5
|
import React, { Component } from 'react';
|
|
5
6
|
import { css, jsx } from '@emotion/react';
|
package/dist/esm/ui/Dropdown.js
CHANGED
|
@@ -5,8 +5,6 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
9
|
-
var _templateObject, _templateObject2;
|
|
10
8
|
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; }
|
|
11
9
|
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) { _defineProperty(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; }
|
|
12
10
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -21,10 +19,14 @@ import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
|
21
19
|
import DropdownMenu, { itemSpacing, menuItemDimensions } from './DropdownMenu';
|
|
22
20
|
|
|
23
21
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
24
|
-
var dropdownExpandContainer = css(
|
|
22
|
+
var dropdownExpandContainer = css({
|
|
23
|
+
margin: "0px ".concat("var(--ds-space-negative-050, -4px)")
|
|
24
|
+
});
|
|
25
25
|
|
|
26
26
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
27
|
-
var iconGroup = css(
|
|
27
|
+
var iconGroup = css({
|
|
28
|
+
display: 'flex'
|
|
29
|
+
});
|
|
28
30
|
var CompositeIcon = function CompositeIcon(_ref) {
|
|
29
31
|
var icon = _ref.icon;
|
|
30
32
|
return jsx("div", {
|
|
@@ -15,6 +15,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
15
15
|
import { messages } from '@atlaskit/editor-common/floating-toolbar';
|
|
16
16
|
import EditorDoneIcon from '@atlaskit/icon/glyph/editor/done';
|
|
17
17
|
import { ButtonItem } from '@atlaskit/menu';
|
|
18
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
18
19
|
import { B400 } from '@atlaskit/theme/colors';
|
|
19
20
|
// eslint-disable-next-line @atlaskit/design-system/no-deprecated-imports
|
|
20
21
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
@@ -129,6 +130,18 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
129
130
|
e.preventDefault();
|
|
130
131
|
}
|
|
131
132
|
}, [item.disabled]);
|
|
133
|
+
var isAriaChecked = function isAriaChecked(item) {
|
|
134
|
+
var selected = item.selected,
|
|
135
|
+
domItemOptions = item.domItemOptions;
|
|
136
|
+
if (getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') && (domItemOptions === null || domItemOptions === void 0 ? void 0 : domItemOptions.type) === 'item-checkbox') {
|
|
137
|
+
return selected;
|
|
138
|
+
}
|
|
139
|
+
return undefined;
|
|
140
|
+
};
|
|
141
|
+
var hasRole = function hasRole(item) {
|
|
142
|
+
var domItemOptions = item.domItemOptions;
|
|
143
|
+
return getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') && (domItemOptions === null || domItemOptions === void 0 ? void 0 : domItemOptions.type) === 'item-checkbox' ? 'menuitemcheckbox' : undefined;
|
|
144
|
+
};
|
|
132
145
|
useEffect(function () {
|
|
133
146
|
var labelRefCurrent = labelRef.current;
|
|
134
147
|
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
@@ -154,7 +167,9 @@ var DropdownMenuItem = function DropdownMenuItem(_ref) {
|
|
|
154
167
|
onMouseLeave: handleItemMouseLeave,
|
|
155
168
|
onMouseOut: handleItemMouseOut,
|
|
156
169
|
onFocus: handleItemOnFocus,
|
|
157
|
-
onBlur: handleItemOnBlur
|
|
170
|
+
onBlur: handleItemOnBlur,
|
|
171
|
+
role: hasRole(item),
|
|
172
|
+
"aria-checked": isAriaChecked(item)
|
|
158
173
|
}, jsx("span", {
|
|
159
174
|
ref: labelRef,
|
|
160
175
|
css: labelStyles
|
|
@@ -186,7 +201,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
186
201
|
intl = _this$props.intl,
|
|
187
202
|
editorView = _this$props.editorView;
|
|
188
203
|
return jsx("div", {
|
|
189
|
-
css: menuContainerStyles
|
|
204
|
+
css: menuContainerStyles,
|
|
205
|
+
role: getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') ? 'menu' : undefined
|
|
190
206
|
}, items.filter(function (item) {
|
|
191
207
|
return !item.hidden;
|
|
192
208
|
}).map(function (item, idx) {
|
|
@@ -207,6 +223,15 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
207
223
|
showSelected = _this$props$showSelec === void 0 ? true : _this$props$showSelec;
|
|
208
224
|
var selected = item.selected;
|
|
209
225
|
if (showSelected && selected) {
|
|
226
|
+
if (getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33')) {
|
|
227
|
+
return jsx("span", {
|
|
228
|
+
"aria-hidden": "true"
|
|
229
|
+
}, jsx(EditorDoneIcon, {
|
|
230
|
+
primaryColor: "var(--ds-icon-selected, ".concat(B400, ")"),
|
|
231
|
+
size: "small",
|
|
232
|
+
label: intl.formatMessage(messages.confirmModalOK)
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
210
235
|
return jsx(EditorDoneIcon, {
|
|
211
236
|
primaryColor: "var(--ds-icon-selected, ".concat(B400, ")"),
|
|
212
237
|
size: "small",
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
-
var _templateObject;
|
|
4
2
|
/** @jsx jsx */
|
|
5
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
6
4
|
import { css, jsx } from '@emotion/react';
|
|
@@ -11,7 +9,15 @@ import ChevronLeftLargeIcon from '@atlaskit/icon/glyph/chevron-left-large';
|
|
|
11
9
|
import ChevronRightLargeIcon from '@atlaskit/icon/glyph/chevron-right-large';
|
|
12
10
|
import { N30 } from '@atlaskit/theme/colors';
|
|
13
11
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
14
|
-
var toolbarScrollButtons = css(
|
|
12
|
+
var toolbarScrollButtons = css({
|
|
13
|
+
display: 'grid',
|
|
14
|
+
gridTemplateColumns: '1fr 1fr',
|
|
15
|
+
gridGap: "var(--ds-space-050, 4px)",
|
|
16
|
+
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-100, 8px)"),
|
|
17
|
+
borderLeft: "solid ".concat("var(--ds-border, ".concat(N30, ")"), " 1px"),
|
|
18
|
+
flexShrink: 0,
|
|
19
|
+
alignItems: 'center'
|
|
20
|
+
});
|
|
15
21
|
var LeftIcon = ChevronLeftLargeIcon;
|
|
16
22
|
var RightIcon = ChevronRightLargeIcon;
|
|
17
23
|
export var ScrollButtons = function ScrollButtons(_ref) {
|
package/dist/esm/ui/Toolbar.js
CHANGED
|
@@ -10,6 +10,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
|
+
/* eslint-disable @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation */
|
|
13
14
|
/** @jsx jsx */
|
|
14
15
|
import React, { Component } from 'react';
|
|
15
16
|
import { css, jsx } from '@emotion/react';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-floating-toolbar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Floating toolbar plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,27 +25,27 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/adf-utils": "^19.0.0",
|
|
28
|
-
"@atlaskit/button": "^17.
|
|
28
|
+
"@atlaskit/button": "^17.14.0",
|
|
29
29
|
"@atlaskit/checkbox": "^13.1.0",
|
|
30
|
-
"@atlaskit/editor-common": "^78.
|
|
30
|
+
"@atlaskit/editor-common": "^78.31.0",
|
|
31
31
|
"@atlaskit/editor-palette": "1.5.3",
|
|
32
|
-
"@atlaskit/editor-plugin-context-panel": "^1.
|
|
33
|
-
"@atlaskit/editor-plugin-copy-button": "^1.
|
|
34
|
-
"@atlaskit/editor-plugin-decorations": "^1.
|
|
35
|
-
"@atlaskit/editor-plugin-editor-disabled": "^1.
|
|
36
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^1.
|
|
37
|
-
"@atlaskit/editor-plugin-extension": "^1.
|
|
38
|
-
"@atlaskit/editor-plugin-table": "^7.
|
|
39
|
-
"@atlaskit/editor-prosemirror": "
|
|
32
|
+
"@atlaskit/editor-plugin-context-panel": "^1.1.0",
|
|
33
|
+
"@atlaskit/editor-plugin-copy-button": "^1.1.0",
|
|
34
|
+
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
35
|
+
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
36
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^1.1.0",
|
|
37
|
+
"@atlaskit/editor-plugin-extension": "^1.3.0",
|
|
38
|
+
"@atlaskit/editor-plugin-table": "^7.8.0",
|
|
39
|
+
"@atlaskit/editor-prosemirror": "4.0.0",
|
|
40
40
|
"@atlaskit/emoji": "^67.6.0",
|
|
41
41
|
"@atlaskit/icon": "^22.1.0",
|
|
42
42
|
"@atlaskit/menu": "^2.1.0",
|
|
43
|
-
"@atlaskit/modal-dialog": "^12.
|
|
43
|
+
"@atlaskit/modal-dialog": "^12.11.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^0.2.5",
|
|
45
|
-
"@atlaskit/select": "^17.
|
|
46
|
-
"@atlaskit/theme": "^12.
|
|
47
|
-
"@atlaskit/tokens": "^1.
|
|
48
|
-
"@atlaskit/tooltip": "^18.
|
|
45
|
+
"@atlaskit/select": "^17.6.0",
|
|
46
|
+
"@atlaskit/theme": "^12.7.0",
|
|
47
|
+
"@atlaskit/tokens": "^1.43.0",
|
|
48
|
+
"@atlaskit/tooltip": "^18.2.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"@emotion/react": "^11.7.1",
|
|
51
51
|
"lodash": "^4.17.21",
|
|
@@ -109,6 +109,9 @@
|
|
|
109
109
|
"platform-feature-flags": {
|
|
110
110
|
"platform.editor.a11y-floating-toolbar-markup_vexmo": {
|
|
111
111
|
"type": "boolean"
|
|
112
|
+
},
|
|
113
|
+
"platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33": {
|
|
114
|
+
"type": "boolean"
|
|
112
115
|
}
|
|
113
116
|
}
|
|
114
117
|
}
|