@atlaskit/editor-plugin-table 17.3.20 → 17.3.22

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/pm-plugins/commands/insert.js +2 -5
  3. package/dist/cjs/pm-plugins/utils/paste.js +32 -47
  4. package/dist/cjs/tablePlugin.js +2 -4
  5. package/dist/cjs/ui/DragHandle/index.js +10 -6
  6. package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  7. package/dist/cjs/ui/FloatingDeleteButton/DeleteButton.js +6 -7
  8. package/dist/cjs/ui/TableFloatingColumnControls/ColumnControls/index.js +3 -0
  9. package/dist/cjs/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +6 -7
  10. package/dist/cjs/ui/TableFloatingControls/CornerControls/DragCornerControls.js +5 -6
  11. package/dist/cjs/ui/TableFloatingControls/NumberColumn/index.js +22 -14
  12. package/dist/cjs/ui/TableFloatingControls/RowControls/ClassicControls.js +7 -6
  13. package/dist/cjs/ui/TableFloatingControls/RowControls/DragControls.js +2 -0
  14. package/dist/cjs/ui/TableFloatingControls/index.js +1 -0
  15. package/dist/es2019/pm-plugins/commands/insert.js +2 -5
  16. package/dist/es2019/pm-plugins/utils/paste.js +32 -47
  17. package/dist/es2019/tablePlugin.js +2 -4
  18. package/dist/es2019/ui/DragHandle/index.js +10 -6
  19. package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  20. package/dist/es2019/ui/FloatingDeleteButton/DeleteButton.js +6 -7
  21. package/dist/es2019/ui/TableFloatingColumnControls/ColumnControls/index.js +3 -0
  22. package/dist/es2019/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +6 -7
  23. package/dist/es2019/ui/TableFloatingControls/CornerControls/DragCornerControls.js +5 -6
  24. package/dist/es2019/ui/TableFloatingControls/NumberColumn/index.js +18 -14
  25. package/dist/es2019/ui/TableFloatingControls/RowControls/ClassicControls.js +5 -6
  26. package/dist/es2019/ui/TableFloatingControls/RowControls/DragControls.js +2 -0
  27. package/dist/es2019/ui/TableFloatingControls/index.js +1 -0
  28. package/dist/esm/pm-plugins/commands/insert.js +2 -5
  29. package/dist/esm/pm-plugins/utils/paste.js +32 -47
  30. package/dist/esm/tablePlugin.js +2 -4
  31. package/dist/esm/ui/DragHandle/index.js +10 -6
  32. package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +3 -3
  33. package/dist/esm/ui/FloatingDeleteButton/DeleteButton.js +6 -7
  34. package/dist/esm/ui/TableFloatingColumnControls/ColumnControls/index.js +3 -0
  35. package/dist/esm/ui/TableFloatingControls/CornerControls/ClassicCornerControls.js +6 -7
  36. package/dist/esm/ui/TableFloatingControls/CornerControls/DragCornerControls.js +5 -6
  37. package/dist/esm/ui/TableFloatingControls/NumberColumn/index.js +22 -14
  38. package/dist/esm/ui/TableFloatingControls/RowControls/ClassicControls.js +7 -6
  39. package/dist/esm/ui/TableFloatingControls/RowControls/DragControls.js +2 -0
  40. package/dist/esm/ui/TableFloatingControls/index.js +1 -0
  41. package/dist/types/ui/DragHandle/index.d.ts +3 -1
  42. package/dist/types-ts4.5/ui/DragHandle/index.d.ts +3 -1
  43. package/package.json +3 -3
@@ -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
- // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
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
- // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
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
- // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
173
- ,
174
- onMouseOut: _this2.clearHoverSelection
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
- // eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events
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.20",
3
+ "version": "17.3.22",
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.2",
40
+ "@atlaskit/editor-plugin-extension": "10.1.4",
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": "^26.0.0",
60
+ "@atlaskit/tmp-editor-statsig": "^28.0.0",
61
61
  "@atlaskit/toggle": "^15.2.0",
62
62
  "@atlaskit/tokens": "^11.0.0",
63
63
  "@atlaskit/tooltip": "^20.14.0",