@atlaskit/editor-plugin-table 17.3.20 → 17.3.21
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 +8 -0
- package/dist/cjs/ui/DragHandle/index.js +10 -6
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/cjs/ui/FloatingDeleteButton/DeleteButton.js +6 -7
- package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +3 -0
- package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +6 -7
- package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +5 -6
- package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +22 -14
- package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +7 -6
- package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +2 -0
- package/dist/cjs/ui/TableFloatingControls/index.js +1 -0
- package/dist/es2019/ui/DragHandle/index.js +10 -6
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/es2019/ui/FloatingDeleteButton/DeleteButton.js +6 -7
- package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +3 -0
- package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +6 -7
- package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +5 -6
- package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +18 -14
- package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +5 -6
- package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +2 -0
- package/dist/es2019/ui/TableFloatingControls/index.js +1 -0
- package/dist/esm/ui/DragHandle/index.js +10 -6
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
- package/dist/esm/ui/FloatingDeleteButton/DeleteButton.js +6 -7
- package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +3 -0
- package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +6 -7
- package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +5 -6
- package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +22 -14
- package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +7 -6
- package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +2 -0
- package/dist/esm/ui/TableFloatingControls/index.js +1 -0
- package/dist/types/ui/DragHandle/index.d.ts +3 -1
- package/dist/types-ts4.5/ui/DragHandle/index.d.ts +3 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 17.3.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`dece098c3ab1f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/dece098c3ab1f) -
|
|
8
|
+
[ux] ENGHEALTH-46818 Add focus and blur handlers to table buttons to fix a11y
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 17.3.20
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -42,6 +42,8 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
42
42
|
previewHeight = _ref.previewHeight,
|
|
43
43
|
_onMouseOver = _ref.onMouseOver,
|
|
44
44
|
_onMouseOut = _ref.onMouseOut,
|
|
45
|
+
onFocus = _ref.onFocus,
|
|
46
|
+
onBlur = _ref.onBlur,
|
|
45
47
|
toggleDragMenu = _ref.toggleDragMenu,
|
|
46
48
|
hoveredCell = _ref.hoveredCell,
|
|
47
49
|
onClick = _ref.onClick,
|
|
@@ -203,19 +205,21 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
203
205
|
"data-testid": "table-drag-handle-button",
|
|
204
206
|
"aria-label": formatMessage(isRow ? _messages.tableMessages.rowDragHandle : _messages.tableMessages.columnDragHandle),
|
|
205
207
|
"aria-expanded": isDragMenuOpen && isDragMenuTarget ? 'true' : 'false',
|
|
206
|
-
"aria-haspopup": "menu"
|
|
207
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
208
|
-
,
|
|
208
|
+
"aria-haspopup": "menu",
|
|
209
209
|
onMouseOver: function onMouseOver(e) {
|
|
210
210
|
setIsHovered(true);
|
|
211
211
|
_onMouseOver && _onMouseOver(e);
|
|
212
|
-
}
|
|
213
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
214
|
-
,
|
|
212
|
+
},
|
|
215
213
|
onMouseOut: function onMouseOut(e) {
|
|
216
214
|
setIsHovered(false);
|
|
217
215
|
_onMouseOut && _onMouseOut(e);
|
|
218
216
|
},
|
|
217
|
+
onFocus: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function (e) {
|
|
218
|
+
onFocus && onFocus(e);
|
|
219
|
+
} : undefined,
|
|
220
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function (e) {
|
|
221
|
+
onBlur && onBlur(e);
|
|
222
|
+
} : undefined,
|
|
219
223
|
onMouseUp: function onMouseUp(e) {
|
|
220
224
|
// return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
|
|
221
225
|
// -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
|
|
@@ -38,6 +38,7 @@ var _tableColumnsDistribute = _interopRequireDefault(require("@atlaskit/icon/cor
|
|
|
38
38
|
var _tableRowAddBelow = _interopRequireDefault(require("@atlaskit/icon/core/table-row-add-below"));
|
|
39
39
|
var _tableRowDelete = _interopRequireDefault(require("@atlaskit/icon/core/table-row-delete"));
|
|
40
40
|
var _primitives = require("@atlaskit/primitives");
|
|
41
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
41
42
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
42
43
|
var _commands = require("../../pm-plugins/commands");
|
|
43
44
|
var _commandsWithAnalytics = require("../../pm-plugins/commands/commands-with-analytics");
|
|
@@ -749,10 +750,9 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
|
|
|
749
750
|
userIntent: "tableContextualMenuPopupOpen",
|
|
750
751
|
api: api
|
|
751
752
|
}, (0, _react2.jsx)("div", {
|
|
752
|
-
"data-testid": "table-cell-contextual-menu"
|
|
753
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
754
|
-
,
|
|
753
|
+
"data-testid": "table-cell-contextual-menu",
|
|
755
754
|
onMouseLeave: this.closeSubmenu,
|
|
755
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.closeSubmenu : undefined,
|
|
756
756
|
ref: this.dropdownMenuRef
|
|
757
757
|
}, (0, _react2.jsx)(_uiMenu.DropdownMenu
|
|
758
758
|
//This needs be removed when the a11y is completely handled
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _reactIntlNext = require("react-intl-next");
|
|
10
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
11
|
var _types = require("../../types");
|
|
11
12
|
var DeleteButton = function DeleteButton(_ref) {
|
|
12
13
|
var style = _ref.style,
|
|
@@ -20,13 +21,11 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
20
21
|
className: _types.TableCssClassName.CONTROLS_DELETE_BUTTON_WRAP
|
|
21
22
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
22
23
|
,
|
|
23
|
-
style: style
|
|
24
|
-
|
|
25
|
-
,
|
|
26
|
-
onMouseEnter:
|
|
27
|
-
|
|
28
|
-
,
|
|
29
|
-
onMouseLeave: onMouseLeave
|
|
24
|
+
style: style,
|
|
25
|
+
onMouseEnter: onMouseEnter,
|
|
26
|
+
onMouseLeave: onMouseLeave,
|
|
27
|
+
onFocus: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? onMouseEnter : undefined,
|
|
28
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? onMouseLeave : undefined
|
|
30
29
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
31
30
|
type: "button",
|
|
32
31
|
"aria-label": formatMessage(removeLabel, {
|
|
@@ -11,6 +11,7 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
11
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
12
|
var _editorTables = require("@atlaskit/editor-tables");
|
|
13
13
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
14
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
15
|
var _commands = require("../../../pm-plugins/commands");
|
|
15
16
|
var _commandsWithAnalytics = require("../../../pm-plugins/drag-and-drop/commands-with-analytics");
|
|
16
17
|
var _rowControls = require("../../../pm-plugins/utils/row-controls");
|
|
@@ -189,6 +190,8 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
|
|
|
189
190
|
onClick: handleClick,
|
|
190
191
|
onMouseOver: handleMouseOver,
|
|
191
192
|
onMouseOut: handleMouseOut,
|
|
193
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
194
|
+
onFocus: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOver : undefined,
|
|
192
195
|
toggleDragMenu: toggleDragMenuHandler,
|
|
193
196
|
editorView: editorView
|
|
194
197
|
}));
|
|
@@ -18,6 +18,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
18
18
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
19
19
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
20
20
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
21
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
21
22
|
var _commands = require("../../../pm-plugins/commands");
|
|
22
23
|
var _types = require("../../../types");
|
|
23
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); }
|
|
@@ -98,13 +99,11 @@ var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
|
98
99
|
className: (0, _classnames.default)(_types.TableCssClassName.CONTROLS_CORNER_BUTTON, {
|
|
99
100
|
danger: isActive && isInDanger
|
|
100
101
|
}),
|
|
101
|
-
onClick: this.selectTable
|
|
102
|
-
|
|
103
|
-
,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
,
|
|
107
|
-
onMouseOut: this.clearHoverSelection
|
|
102
|
+
onClick: this.selectTable,
|
|
103
|
+
onMouseOver: this.hoverTable,
|
|
104
|
+
onMouseOut: this.clearHoverSelection,
|
|
105
|
+
onFocus: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.hoverTable : undefined,
|
|
106
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.clearHoverSelection : undefined
|
|
108
107
|
}), !isHeaderRowEnabled &&
|
|
109
108
|
/*#__PURE__*/
|
|
110
109
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -12,6 +12,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
12
12
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
13
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
14
14
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
15
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
15
16
|
var _commands = require("../../../pm-plugins/commands");
|
|
16
17
|
var _types = require("../../../types");
|
|
17
18
|
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); }
|
|
@@ -49,10 +50,9 @@ var DragCornerControlsComponent = function DragCornerControlsComponent(_ref) {
|
|
|
49
50
|
}),
|
|
50
51
|
"aria-label": formatMessage(_messages.tableMessages.cornerControl),
|
|
51
52
|
type: "button",
|
|
52
|
-
onClick: handleOnClick
|
|
53
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
54
|
-
,
|
|
53
|
+
onClick: handleOnClick,
|
|
55
54
|
onMouseOut: handleMouseOut,
|
|
55
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
56
56
|
contentEditable: false
|
|
57
57
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
58
58
|
className: _types.TableCssClassName.DRAG_CORNER_BUTTON_INNER
|
|
@@ -102,10 +102,9 @@ var DragCornerControlsComponentWithSelection = function DragCornerControlsCompon
|
|
|
102
102
|
}),
|
|
103
103
|
"aria-label": formatMessage(_messages.tableMessages.cornerControl),
|
|
104
104
|
type: "button",
|
|
105
|
-
onClick: handleOnClick
|
|
106
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
107
|
-
,
|
|
105
|
+
onClick: handleOnClick,
|
|
108
106
|
onMouseOut: handleMouseOut,
|
|
107
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
109
108
|
contentEditable: false
|
|
110
109
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
111
110
|
className: _types.TableCssClassName.DRAG_CORNER_BUTTON_INNER
|
|
@@ -17,6 +17,7 @@ var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
|
17
17
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
18
18
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
19
19
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
20
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
20
21
|
var _commands = require("../../../pm-plugins/commands");
|
|
21
22
|
var _rowControls = require("../../../pm-plugins/utils/row-controls");
|
|
22
23
|
var _types = require("../../../types");
|
|
@@ -150,18 +151,18 @@ var NumberColumn = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
150
151
|
"data-index": index
|
|
151
152
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
152
153
|
,
|
|
153
|
-
style: _this2.getCellStyles(index, rowHeight)
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
style: _this2.getCellStyles(index, rowHeight),
|
|
155
|
+
onFocus: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function () {
|
|
156
|
+
return updateCellHoverLocation(index);
|
|
157
|
+
} : undefined,
|
|
156
158
|
onMouseOver: function onMouseOver() {
|
|
157
159
|
return updateCellHoverLocation(index);
|
|
158
160
|
}
|
|
159
|
-
}, hasHeaderRow ? index > 0 ? index : null : index + 1) :
|
|
160
|
-
/*#__PURE__*/
|
|
161
|
-
// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions
|
|
162
|
-
_react.default.createElement("div", {
|
|
161
|
+
}, hasHeaderRow ? index > 0 ? index : null : index + 1) : /*#__PURE__*/_react.default.createElement("div", {
|
|
163
162
|
// Ignored via go/ees005
|
|
163
|
+
role: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? 'button' : undefined
|
|
164
164
|
// eslint-disable-next-line react/no-array-index-key
|
|
165
|
+
,
|
|
165
166
|
key: "wrapper-".concat(index)
|
|
166
167
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
167
168
|
,
|
|
@@ -172,15 +173,22 @@ var NumberColumn = exports.default = /*#__PURE__*/function (_Component) {
|
|
|
172
173
|
style: _this2.getCellStyles(index, rowHeight),
|
|
173
174
|
onClick: function onClick(event) {
|
|
174
175
|
return _this2.selectRow(index, event);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
176
|
+
},
|
|
177
|
+
onFocus: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function () {
|
|
178
|
+
return _this2.hoverRows(index);
|
|
179
|
+
} : undefined,
|
|
178
180
|
onMouseOver: function onMouseOver() {
|
|
179
181
|
return _this2.hoverRows(index);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
,
|
|
183
|
-
|
|
182
|
+
},
|
|
183
|
+
tabIndex: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? 0 : undefined,
|
|
184
|
+
onKeyDown: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function (event) {
|
|
185
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
186
|
+
event.preventDefault();
|
|
187
|
+
_this2.selectRow(index, event);
|
|
188
|
+
}
|
|
189
|
+
} : undefined,
|
|
190
|
+
onMouseOut: _this2.clearHoverSelection,
|
|
191
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? _this2.clearHoverSelection : undefined
|
|
184
192
|
}, hasHeaderRow ? index > 0 ? index : null : index + 1);
|
|
185
193
|
}));
|
|
186
194
|
}
|
|
@@ -15,6 +15,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
var _reactIntlNext = require("react-intl-next");
|
|
17
17
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
19
|
var _commands = require("../../../pm-plugins/commands");
|
|
19
20
|
var _rowControls = require("../../../pm-plugins/utils/row-controls");
|
|
20
21
|
var _types = require("../../../types");
|
|
@@ -102,15 +103,15 @@ var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
|
102
103
|
className: "".concat(_types.TableCssClassName.ROW_CONTROLS_BUTTON, " ").concat(_types.TableCssClassName.CONTROLS_BUTTON),
|
|
103
104
|
onClick: function onClick(event) {
|
|
104
105
|
return _this2.props.selectRow(startIndex, event.shiftKey);
|
|
105
|
-
}
|
|
106
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
107
|
-
,
|
|
106
|
+
},
|
|
108
107
|
onMouseOver: function onMouseOver() {
|
|
109
108
|
return _this2.props.hoverRows([startIndex]);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
},
|
|
110
|
+
onFocus: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function () {
|
|
111
|
+
return _this2.props.hoverRows([startIndex]);
|
|
112
|
+
} : undefined,
|
|
113
113
|
onMouseOut: _this2.clearHoverSelection,
|
|
114
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? _this2.clearHoverSelection : undefined,
|
|
114
115
|
"data-start-index": startIndex,
|
|
115
116
|
"data-end-index": endIndex
|
|
116
117
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -186,6 +186,8 @@ var DragControls = exports.DragControls = function DragControls(_ref) {
|
|
|
186
186
|
onClick: handleClick,
|
|
187
187
|
onMouseOver: handleMouseOver,
|
|
188
188
|
onMouseOut: handleMouseOut,
|
|
189
|
+
onBlur: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
190
|
+
onFocus: (0, _expValEquals.expValEquals)('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOver : undefined,
|
|
189
191
|
toggleDragMenu: toggleDragMenuHandler,
|
|
190
192
|
editorView: editorView
|
|
191
193
|
}));
|
|
@@ -108,6 +108,7 @@ var TableFloatingControls = exports.TableFloatingControls = function TableFloati
|
|
|
108
108
|
className: wrapperClassName,
|
|
109
109
|
css: [(0, _expValEquals.expValEquals)('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && !(0, _platformFeatureFlags.fg)('platform_editor_table_sticky_header_patch_7') && styles]
|
|
110
110
|
}, (0, _react2.jsx)("div", {
|
|
111
|
+
role: "none",
|
|
111
112
|
onMouseDown: function onMouseDown(e) {
|
|
112
113
|
return !isDragAndDropEnabled && e.preventDefault();
|
|
113
114
|
}
|
|
@@ -28,6 +28,8 @@ const DragHandleComponent = ({
|
|
|
28
28
|
previewHeight,
|
|
29
29
|
onMouseOver,
|
|
30
30
|
onMouseOut,
|
|
31
|
+
onFocus,
|
|
32
|
+
onBlur,
|
|
31
33
|
toggleDragMenu,
|
|
32
34
|
hoveredCell,
|
|
33
35
|
onClick,
|
|
@@ -195,19 +197,21 @@ const DragHandleComponent = ({
|
|
|
195
197
|
"data-testid": "table-drag-handle-button",
|
|
196
198
|
"aria-label": formatMessage(isRow ? messages.rowDragHandle : messages.columnDragHandle),
|
|
197
199
|
"aria-expanded": isDragMenuOpen && isDragMenuTarget ? 'true' : 'false',
|
|
198
|
-
"aria-haspopup": "menu"
|
|
199
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
200
|
-
,
|
|
200
|
+
"aria-haspopup": "menu",
|
|
201
201
|
onMouseOver: e => {
|
|
202
202
|
setIsHovered(true);
|
|
203
203
|
onMouseOver && onMouseOver(e);
|
|
204
|
-
}
|
|
205
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
206
|
-
,
|
|
204
|
+
},
|
|
207
205
|
onMouseOut: e => {
|
|
208
206
|
setIsHovered(false);
|
|
209
207
|
onMouseOut && onMouseOut(e);
|
|
210
208
|
},
|
|
209
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? e => {
|
|
210
|
+
onFocus && onFocus(e);
|
|
211
|
+
} : undefined,
|
|
212
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? e => {
|
|
213
|
+
onBlur && onBlur(e);
|
|
214
|
+
} : undefined,
|
|
211
215
|
onMouseUp: e => {
|
|
212
216
|
// return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
|
|
213
217
|
// -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
|
|
@@ -31,6 +31,7 @@ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
|
|
|
31
31
|
import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
|
|
32
32
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
33
33
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
34
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
34
35
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
35
36
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../pm-plugins/commands';
|
|
36
37
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
|
|
@@ -807,10 +808,9 @@ export class ContextualMenu extends Component {
|
|
|
807
808
|
userIntent: "tableContextualMenuPopupOpen",
|
|
808
809
|
api: api
|
|
809
810
|
}, jsx("div", {
|
|
810
|
-
"data-testid": "table-cell-contextual-menu"
|
|
811
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
812
|
-
,
|
|
811
|
+
"data-testid": "table-cell-contextual-menu",
|
|
813
812
|
onMouseLeave: this.closeSubmenu,
|
|
813
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.closeSubmenu : undefined,
|
|
814
814
|
ref: this.dropdownMenuRef
|
|
815
815
|
}, jsx(DropdownMenu
|
|
816
816
|
//This needs be removed when the a11y is completely handled
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
4
|
import { TableCssClassName as ClassName } from '../../types';
|
|
4
5
|
const DeleteButton = ({
|
|
5
6
|
style,
|
|
@@ -15,13 +16,11 @@ const DeleteButton = ({
|
|
|
15
16
|
className: ClassName.CONTROLS_DELETE_BUTTON_WRAP
|
|
16
17
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
17
18
|
,
|
|
18
|
-
style: style
|
|
19
|
-
|
|
20
|
-
,
|
|
21
|
-
onMouseEnter:
|
|
22
|
-
|
|
23
|
-
,
|
|
24
|
-
onMouseLeave: onMouseLeave
|
|
19
|
+
style: style,
|
|
20
|
+
onMouseEnter: onMouseEnter,
|
|
21
|
+
onMouseLeave: onMouseLeave,
|
|
22
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? onMouseEnter : undefined,
|
|
23
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? onMouseLeave : undefined
|
|
25
24
|
}, /*#__PURE__*/React.createElement("button", {
|
|
26
25
|
type: "button",
|
|
27
26
|
"aria-label": formatMessage(removeLabel, {
|
|
@@ -6,6 +6,7 @@ import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
|
6
6
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { CellSelection } from '@atlaskit/editor-tables';
|
|
8
8
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
10
|
import { clearHoverSelection, hoverCell, hoverColumns, selectColumn, selectColumns } from '../../../pm-plugins/commands';
|
|
10
11
|
import { toggleDragMenuWithAnalytics } from '../../../pm-plugins/drag-and-drop/commands-with-analytics';
|
|
11
12
|
import { getRowsParams } from '../../../pm-plugins/utils/row-controls';
|
|
@@ -186,6 +187,8 @@ export const ColumnControls = ({
|
|
|
186
187
|
onClick: handleClick,
|
|
187
188
|
onMouseOver: handleMouseOver,
|
|
188
189
|
onMouseOut: handleMouseOut,
|
|
190
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
191
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOver : undefined,
|
|
189
192
|
toggleDragMenu: toggleDragMenuHandler,
|
|
190
193
|
editorView: editorView
|
|
191
194
|
}));
|
|
@@ -5,6 +5,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
7
|
import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
|
|
8
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
9
|
import { clearHoverSelection, hoverTable } from '../../../pm-plugins/commands';
|
|
9
10
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
10
11
|
// Ignored via go/ees005
|
|
@@ -82,13 +83,11 @@ class CornerControlComponent extends Component {
|
|
|
82
83
|
className: classnames(ClassName.CONTROLS_CORNER_BUTTON, {
|
|
83
84
|
danger: isActive && isInDanger
|
|
84
85
|
}),
|
|
85
|
-
onClick: this.selectTable
|
|
86
|
-
|
|
87
|
-
,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
,
|
|
91
|
-
onMouseOut: this.clearHoverSelection
|
|
86
|
+
onClick: this.selectTable,
|
|
87
|
+
onMouseOver: this.hoverTable,
|
|
88
|
+
onMouseOut: this.clearHoverSelection,
|
|
89
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.hoverTable : undefined,
|
|
90
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.clearHoverSelection : undefined
|
|
92
91
|
}), !isHeaderRowEnabled &&
|
|
93
92
|
/*#__PURE__*/
|
|
94
93
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -4,6 +4,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
8
9
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
9
10
|
const DragCornerControlsComponent = ({
|
|
@@ -49,10 +50,9 @@ const DragCornerControlsComponent = ({
|
|
|
49
50
|
}),
|
|
50
51
|
"aria-label": formatMessage(messages.cornerControl),
|
|
51
52
|
type: "button",
|
|
52
|
-
onClick: handleOnClick
|
|
53
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
54
|
-
,
|
|
53
|
+
onClick: handleOnClick,
|
|
55
54
|
onMouseOut: handleMouseOut,
|
|
55
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
56
56
|
contentEditable: false
|
|
57
57
|
}, /*#__PURE__*/React.createElement("div", {
|
|
58
58
|
className: ClassName.DRAG_CORNER_BUTTON_INNER
|
|
@@ -110,10 +110,9 @@ const DragCornerControlsComponentWithSelection = ({
|
|
|
110
110
|
}),
|
|
111
111
|
"aria-label": formatMessage(messages.cornerControl),
|
|
112
112
|
type: "button",
|
|
113
|
-
onClick: handleOnClick
|
|
114
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
115
|
-
,
|
|
113
|
+
onClick: handleOnClick,
|
|
116
114
|
onMouseOut: handleMouseOut,
|
|
115
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
117
116
|
contentEditable: false
|
|
118
117
|
}, /*#__PURE__*/React.createElement("div", {
|
|
119
118
|
className: ClassName.DRAG_CORNER_BUTTON_INNER
|
|
@@ -4,6 +4,7 @@ import classnames from 'classnames';
|
|
|
4
4
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
5
5
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
6
6
|
import { isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
8
9
|
import { getRowHeights } from '../../../pm-plugins/utils/row-controls';
|
|
9
10
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
@@ -134,16 +135,14 @@ export default class NumberColumn extends Component {
|
|
|
134
135
|
"data-index": index
|
|
135
136
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
136
137
|
,
|
|
137
|
-
style: this.getCellStyles(index, rowHeight)
|
|
138
|
-
|
|
139
|
-
,
|
|
138
|
+
style: this.getCellStyles(index, rowHeight),
|
|
139
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? () => updateCellHoverLocation(index) : undefined,
|
|
140
140
|
onMouseOver: () => updateCellHoverLocation(index)
|
|
141
|
-
}, hasHeaderRow ? index > 0 ? index : null : index + 1) :
|
|
142
|
-
/*#__PURE__*/
|
|
143
|
-
// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions
|
|
144
|
-
React.createElement("div", {
|
|
141
|
+
}, hasHeaderRow ? index > 0 ? index : null : index + 1) : /*#__PURE__*/React.createElement("div", {
|
|
145
142
|
// Ignored via go/ees005
|
|
143
|
+
role: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? 'button' : undefined
|
|
146
144
|
// eslint-disable-next-line react/no-array-index-key
|
|
145
|
+
,
|
|
147
146
|
key: `wrapper-${index}`
|
|
148
147
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
149
148
|
,
|
|
@@ -152,13 +151,18 @@ export default class NumberColumn extends Component {
|
|
|
152
151
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
153
152
|
,
|
|
154
153
|
style: this.getCellStyles(index, rowHeight),
|
|
155
|
-
onClick: event => this.selectRow(index, event)
|
|
156
|
-
|
|
157
|
-
,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
154
|
+
onClick: event => this.selectRow(index, event),
|
|
155
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? () => this.hoverRows(index) : undefined,
|
|
156
|
+
onMouseOver: () => this.hoverRows(index),
|
|
157
|
+
tabIndex: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? 0 : undefined,
|
|
158
|
+
onKeyDown: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? event => {
|
|
159
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
160
|
+
event.preventDefault();
|
|
161
|
+
this.selectRow(index, event);
|
|
162
|
+
}
|
|
163
|
+
} : undefined,
|
|
164
|
+
onMouseOut: this.clearHoverSelection,
|
|
165
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.clearHoverSelection : undefined
|
|
162
166
|
}, hasHeaderRow ? index > 0 ? index : null : index + 1)));
|
|
163
167
|
}
|
|
164
168
|
}
|
|
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
3
|
import { injectIntl } from 'react-intl-next';
|
|
4
4
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
5
6
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
6
7
|
import { getRowClassNames, getRowHeights, getRowsParams } from '../../../pm-plugins/utils/row-controls';
|
|
7
8
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
@@ -81,13 +82,11 @@ class RowControlsComponent extends Component {
|
|
|
81
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
82
83
|
,
|
|
83
84
|
className: `${ClassName.ROW_CONTROLS_BUTTON} ${ClassName.CONTROLS_BUTTON}`,
|
|
84
|
-
onClick: event => this.props.selectRow(startIndex, event.shiftKey)
|
|
85
|
-
|
|
86
|
-
,
|
|
87
|
-
onMouseOver: () => this.props.hoverRows([startIndex])
|
|
88
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
89
|
-
,
|
|
85
|
+
onClick: event => this.props.selectRow(startIndex, event.shiftKey),
|
|
86
|
+
onMouseOver: () => this.props.hoverRows([startIndex]),
|
|
87
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? () => this.props.hoverRows([startIndex]) : undefined,
|
|
90
88
|
onMouseOut: this.clearHoverSelection,
|
|
89
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.clearHoverSelection : undefined,
|
|
91
90
|
"data-start-index": startIndex,
|
|
92
91
|
"data-end-index": endIndex
|
|
93
92
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -175,6 +175,8 @@ export const DragControls = ({
|
|
|
175
175
|
onClick: handleClick,
|
|
176
176
|
onMouseOver: handleMouseOver,
|
|
177
177
|
onMouseOut: handleMouseOut,
|
|
178
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
179
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOver : undefined,
|
|
178
180
|
toggleDragMenu: toggleDragMenuHandler,
|
|
179
181
|
editorView: editorView
|
|
180
182
|
}));
|
|
@@ -109,6 +109,7 @@ export const TableFloatingControls = ({
|
|
|
109
109
|
className: wrapperClassName,
|
|
110
110
|
css: [expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && !fg('platform_editor_table_sticky_header_patch_7') && styles]
|
|
111
111
|
}, jsx("div", {
|
|
112
|
+
role: "none",
|
|
112
113
|
onMouseDown: e => !isDragAndDropEnabled && e.preventDefault()
|
|
113
114
|
}, isNumberColumnEnabled ? jsx(NumberColumn, {
|
|
114
115
|
editorView: editorView,
|
|
@@ -33,6 +33,8 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
33
33
|
previewHeight = _ref.previewHeight,
|
|
34
34
|
_onMouseOver = _ref.onMouseOver,
|
|
35
35
|
_onMouseOut = _ref.onMouseOut,
|
|
36
|
+
onFocus = _ref.onFocus,
|
|
37
|
+
onBlur = _ref.onBlur,
|
|
36
38
|
toggleDragMenu = _ref.toggleDragMenu,
|
|
37
39
|
hoveredCell = _ref.hoveredCell,
|
|
38
40
|
onClick = _ref.onClick,
|
|
@@ -194,19 +196,21 @@ var DragHandleComponent = function DragHandleComponent(_ref) {
|
|
|
194
196
|
"data-testid": "table-drag-handle-button",
|
|
195
197
|
"aria-label": formatMessage(isRow ? messages.rowDragHandle : messages.columnDragHandle),
|
|
196
198
|
"aria-expanded": isDragMenuOpen && isDragMenuTarget ? 'true' : 'false',
|
|
197
|
-
"aria-haspopup": "menu"
|
|
198
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
199
|
-
,
|
|
199
|
+
"aria-haspopup": "menu",
|
|
200
200
|
onMouseOver: function onMouseOver(e) {
|
|
201
201
|
setIsHovered(true);
|
|
202
202
|
_onMouseOver && _onMouseOver(e);
|
|
203
|
-
}
|
|
204
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
205
|
-
,
|
|
203
|
+
},
|
|
206
204
|
onMouseOut: function onMouseOut(e) {
|
|
207
205
|
setIsHovered(false);
|
|
208
206
|
_onMouseOut && _onMouseOut(e);
|
|
209
207
|
},
|
|
208
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function (e) {
|
|
209
|
+
onFocus && onFocus(e);
|
|
210
|
+
} : undefined,
|
|
211
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function (e) {
|
|
212
|
+
onBlur && onBlur(e);
|
|
213
|
+
} : undefined,
|
|
210
214
|
onMouseUp: function onMouseUp(e) {
|
|
211
215
|
// return focus to editor so copying table selections whilst still works, i cannot call e.preventDefault in a mousemove event as this stops dragstart events from firing
|
|
212
216
|
// -> this is bad for a11y but is the current standard new copy/paste keyboard shortcuts should be introduced instead
|
|
@@ -41,6 +41,7 @@ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
|
|
|
41
41
|
import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
|
|
42
42
|
// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
|
|
43
43
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
44
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
44
45
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
45
46
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, setFocusToCellMenu, toggleContextualMenu } from '../../pm-plugins/commands';
|
|
46
47
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../pm-plugins/commands/commands-with-analytics';
|
|
@@ -743,10 +744,9 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
743
744
|
userIntent: "tableContextualMenuPopupOpen",
|
|
744
745
|
api: api
|
|
745
746
|
}, jsx("div", {
|
|
746
|
-
"data-testid": "table-cell-contextual-menu"
|
|
747
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
748
|
-
,
|
|
747
|
+
"data-testid": "table-cell-contextual-menu",
|
|
749
748
|
onMouseLeave: this.closeSubmenu,
|
|
749
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.closeSubmenu : undefined,
|
|
750
750
|
ref: this.dropdownMenuRef
|
|
751
751
|
}, jsx(DropdownMenu
|
|
752
752
|
//This needs be removed when the a11y is completely handled
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
4
|
import { TableCssClassName as ClassName } from '../../types';
|
|
4
5
|
var DeleteButton = function DeleteButton(_ref) {
|
|
5
6
|
var style = _ref.style,
|
|
@@ -13,13 +14,11 @@ var DeleteButton = function DeleteButton(_ref) {
|
|
|
13
14
|
className: ClassName.CONTROLS_DELETE_BUTTON_WRAP
|
|
14
15
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
15
16
|
,
|
|
16
|
-
style: style
|
|
17
|
-
|
|
18
|
-
,
|
|
19
|
-
onMouseEnter:
|
|
20
|
-
|
|
21
|
-
,
|
|
22
|
-
onMouseLeave: onMouseLeave
|
|
17
|
+
style: style,
|
|
18
|
+
onMouseEnter: onMouseEnter,
|
|
19
|
+
onMouseLeave: onMouseLeave,
|
|
20
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? onMouseEnter : undefined,
|
|
21
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? onMouseLeave : undefined
|
|
23
22
|
}, /*#__PURE__*/React.createElement("button", {
|
|
24
23
|
type: "button",
|
|
25
24
|
"aria-label": formatMessage(removeLabel, {
|
|
@@ -6,6 +6,7 @@ import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
|
6
6
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { CellSelection } from '@atlaskit/editor-tables';
|
|
8
8
|
import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
10
|
import { clearHoverSelection, hoverCell, hoverColumns, selectColumn, selectColumns } from '../../../pm-plugins/commands';
|
|
10
11
|
import { toggleDragMenuWithAnalytics } from '../../../pm-plugins/drag-and-drop/commands-with-analytics';
|
|
11
12
|
import { getRowsParams } from '../../../pm-plugins/utils/row-controls';
|
|
@@ -181,6 +182,8 @@ export var ColumnControls = function ColumnControls(_ref) {
|
|
|
181
182
|
onClick: handleClick,
|
|
182
183
|
onMouseOver: handleMouseOver,
|
|
183
184
|
onMouseOut: handleMouseOut,
|
|
185
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
186
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOver : undefined,
|
|
184
187
|
toggleDragMenu: toggleDragMenuHandler,
|
|
185
188
|
editorView: editorView
|
|
186
189
|
}));
|
|
@@ -12,6 +12,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
12
12
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
14
14
|
import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
|
|
15
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
15
16
|
import { clearHoverSelection, hoverTable } from '../../../pm-plugins/commands';
|
|
16
17
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
17
18
|
// Ignored via go/ees005
|
|
@@ -89,13 +90,11 @@ var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
|
89
90
|
className: classnames(ClassName.CONTROLS_CORNER_BUTTON, {
|
|
90
91
|
danger: isActive && isInDanger
|
|
91
92
|
}),
|
|
92
|
-
onClick: this.selectTable
|
|
93
|
-
|
|
94
|
-
,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
,
|
|
98
|
-
onMouseOut: this.clearHoverSelection
|
|
93
|
+
onClick: this.selectTable,
|
|
94
|
+
onMouseOver: this.hoverTable,
|
|
95
|
+
onMouseOut: this.clearHoverSelection,
|
|
96
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.hoverTable : undefined,
|
|
97
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? this.clearHoverSelection : undefined
|
|
99
98
|
}), !isHeaderRowEnabled &&
|
|
100
99
|
/*#__PURE__*/
|
|
101
100
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -4,6 +4,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
|
|
7
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
8
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
8
9
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
9
10
|
var DragCornerControlsComponent = function DragCornerControlsComponent(_ref) {
|
|
@@ -40,10 +41,9 @@ var DragCornerControlsComponent = function DragCornerControlsComponent(_ref) {
|
|
|
40
41
|
}),
|
|
41
42
|
"aria-label": formatMessage(messages.cornerControl),
|
|
42
43
|
type: "button",
|
|
43
|
-
onClick: handleOnClick
|
|
44
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
45
|
-
,
|
|
44
|
+
onClick: handleOnClick,
|
|
46
45
|
onMouseOut: handleMouseOut,
|
|
46
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
47
47
|
contentEditable: false
|
|
48
48
|
}, /*#__PURE__*/React.createElement("div", {
|
|
49
49
|
className: ClassName.DRAG_CORNER_BUTTON_INNER
|
|
@@ -93,10 +93,9 @@ var DragCornerControlsComponentWithSelection = function DragCornerControlsCompon
|
|
|
93
93
|
}),
|
|
94
94
|
"aria-label": formatMessage(messages.cornerControl),
|
|
95
95
|
type: "button",
|
|
96
|
-
onClick: handleOnClick
|
|
97
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
98
|
-
,
|
|
96
|
+
onClick: handleOnClick,
|
|
99
97
|
onMouseOut: handleMouseOut,
|
|
98
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
100
99
|
contentEditable: false
|
|
101
100
|
}, /*#__PURE__*/React.createElement("div", {
|
|
102
101
|
className: ClassName.DRAG_CORNER_BUTTON_INNER
|
|
@@ -11,6 +11,7 @@ import classnames from 'classnames';
|
|
|
11
11
|
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
12
12
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
13
13
|
import { isRowSelected } from '@atlaskit/editor-tables/utils';
|
|
14
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
14
15
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
15
16
|
import { getRowHeights } from '../../../pm-plugins/utils/row-controls';
|
|
16
17
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
@@ -141,18 +142,18 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
141
142
|
"data-index": index
|
|
142
143
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
143
144
|
,
|
|
144
|
-
style: _this2.getCellStyles(index, rowHeight)
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
style: _this2.getCellStyles(index, rowHeight),
|
|
146
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function () {
|
|
147
|
+
return updateCellHoverLocation(index);
|
|
148
|
+
} : undefined,
|
|
147
149
|
onMouseOver: function onMouseOver() {
|
|
148
150
|
return updateCellHoverLocation(index);
|
|
149
151
|
}
|
|
150
|
-
}, hasHeaderRow ? index > 0 ? index : null : index + 1) :
|
|
151
|
-
/*#__PURE__*/
|
|
152
|
-
// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions
|
|
153
|
-
React.createElement("div", {
|
|
152
|
+
}, hasHeaderRow ? index > 0 ? index : null : index + 1) : /*#__PURE__*/React.createElement("div", {
|
|
154
153
|
// Ignored via go/ees005
|
|
154
|
+
role: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? 'button' : undefined
|
|
155
155
|
// eslint-disable-next-line react/no-array-index-key
|
|
156
|
+
,
|
|
156
157
|
key: "wrapper-".concat(index)
|
|
157
158
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
158
159
|
,
|
|
@@ -163,15 +164,22 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
|
|
|
163
164
|
style: _this2.getCellStyles(index, rowHeight),
|
|
164
165
|
onClick: function onClick(event) {
|
|
165
166
|
return _this2.selectRow(index, event);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
167
|
+
},
|
|
168
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function () {
|
|
169
|
+
return _this2.hoverRows(index);
|
|
170
|
+
} : undefined,
|
|
169
171
|
onMouseOver: function onMouseOver() {
|
|
170
172
|
return _this2.hoverRows(index);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
,
|
|
174
|
-
|
|
173
|
+
},
|
|
174
|
+
tabIndex: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? 0 : undefined,
|
|
175
|
+
onKeyDown: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function (event) {
|
|
176
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
177
|
+
event.preventDefault();
|
|
178
|
+
_this2.selectRow(index, event);
|
|
179
|
+
}
|
|
180
|
+
} : undefined,
|
|
181
|
+
onMouseOut: _this2.clearHoverSelection,
|
|
182
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? _this2.clearHoverSelection : undefined
|
|
175
183
|
}, hasHeaderRow ? index > 0 ? index : null : index + 1);
|
|
176
184
|
}));
|
|
177
185
|
}
|
|
@@ -9,6 +9,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
9
9
|
import React, { Component } from 'react';
|
|
10
10
|
import { injectIntl } from 'react-intl-next';
|
|
11
11
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
12
13
|
import { clearHoverSelection } from '../../../pm-plugins/commands';
|
|
13
14
|
import { getRowClassNames, getRowHeights, getRowsParams } from '../../../pm-plugins/utils/row-controls';
|
|
14
15
|
import { TableCssClassName as ClassName } from '../../../types';
|
|
@@ -93,15 +94,15 @@ var RowControlsComponent = /*#__PURE__*/function (_Component) {
|
|
|
93
94
|
className: "".concat(ClassName.ROW_CONTROLS_BUTTON, " ").concat(ClassName.CONTROLS_BUTTON),
|
|
94
95
|
onClick: function onClick(event) {
|
|
95
96
|
return _this2.props.selectRow(startIndex, event.shiftKey);
|
|
96
|
-
}
|
|
97
|
-
// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
|
|
98
|
-
,
|
|
97
|
+
},
|
|
99
98
|
onMouseOver: function onMouseOver() {
|
|
100
99
|
return _this2.props.hoverRows([startIndex]);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
},
|
|
101
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? function () {
|
|
102
|
+
return _this2.props.hoverRows([startIndex]);
|
|
103
|
+
} : undefined,
|
|
104
104
|
onMouseOut: _this2.clearHoverSelection,
|
|
105
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? _this2.clearHoverSelection : undefined,
|
|
105
106
|
"data-start-index": startIndex,
|
|
106
107
|
"data-end-index": endIndex
|
|
107
108
|
}), /*#__PURE__*/React.createElement("div", {
|
|
@@ -177,6 +177,8 @@ export var DragControls = function DragControls(_ref) {
|
|
|
177
177
|
onClick: handleClick,
|
|
178
178
|
onMouseOver: handleMouseOver,
|
|
179
179
|
onMouseOut: handleMouseOut,
|
|
180
|
+
onBlur: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOut : undefined,
|
|
181
|
+
onFocus: expValEquals('platform_editor_table_a11y_eslint_fix', 'isEnabled', true) ? handleMouseOver : undefined,
|
|
180
182
|
toggleDragMenu: toggleDragMenuHandler,
|
|
181
183
|
editorView: editorView
|
|
182
184
|
}));
|
|
@@ -100,6 +100,7 @@ export var TableFloatingControls = function TableFloatingControls(_ref) {
|
|
|
100
100
|
className: wrapperClassName,
|
|
101
101
|
css: [expValEquals('platform_editor_table_sticky_header_improvements', 'cohort', 'test_with_overflow') && !fg('platform_editor_table_sticky_header_patch_7') && styles]
|
|
102
102
|
}, jsx("div", {
|
|
103
|
+
role: "none",
|
|
103
104
|
onMouseDown: function onMouseDown(e) {
|
|
104
105
|
return !isDragAndDropEnabled && e.preventDefault();
|
|
105
106
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MouseEventHandler } from 'react';
|
|
1
|
+
import type { MouseEventHandler, FocusEventHandler } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -13,7 +13,9 @@ type DragHandleProps = {
|
|
|
13
13
|
hoveredCell?: CellHoverMeta;
|
|
14
14
|
indexes: number[];
|
|
15
15
|
isDragMenuTarget: boolean;
|
|
16
|
+
onBlur?: FocusEventHandler;
|
|
16
17
|
onClick?: MouseEventHandler;
|
|
18
|
+
onFocus?: FocusEventHandler;
|
|
17
19
|
onMouseOut?: MouseEventHandler;
|
|
18
20
|
onMouseOver?: MouseEventHandler;
|
|
19
21
|
previewHeight?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MouseEventHandler } from 'react';
|
|
1
|
+
import type { MouseEventHandler, FocusEventHandler } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
@@ -13,7 +13,9 @@ type DragHandleProps = {
|
|
|
13
13
|
hoveredCell?: CellHoverMeta;
|
|
14
14
|
indexes: number[];
|
|
15
15
|
isDragMenuTarget: boolean;
|
|
16
|
+
onBlur?: FocusEventHandler;
|
|
16
17
|
onClick?: MouseEventHandler;
|
|
18
|
+
onFocus?: FocusEventHandler;
|
|
17
19
|
onMouseOut?: MouseEventHandler;
|
|
18
20
|
onMouseOver?: MouseEventHandler;
|
|
19
21
|
previewHeight?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "17.3.
|
|
3
|
+
"version": "17.3.21",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^7.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-content-insertion": "^7.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^9.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-extension": "10.1.
|
|
40
|
+
"@atlaskit/editor-plugin-extension": "10.1.3",
|
|
41
41
|
"@atlaskit/editor-plugin-guideline": "^7.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-interaction": "^14.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-limited-mode": "^4.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
58
58
|
"@atlaskit/primitives": "^18.0.0",
|
|
59
59
|
"@atlaskit/theme": "^21.0.0",
|
|
60
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
60
|
+
"@atlaskit/tmp-editor-statsig": "^27.1.0",
|
|
61
61
|
"@atlaskit/toggle": "^15.2.0",
|
|
62
62
|
"@atlaskit/tokens": "^11.0.0",
|
|
63
63
|
"@atlaskit/tooltip": "^20.14.0",
|