@atlaskit/editor-plugin-table 5.3.9 → 5.3.11

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 (68) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/plugins/table/commands/hover.js +4 -2
  3. package/dist/cjs/plugins/table/event-handlers.js +7 -4
  4. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +3 -2
  5. package/dist/cjs/plugins/table/ui/DragHandle/index.js +11 -25
  6. package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +59 -22
  7. package/dist/cjs/plugins/table/ui/TableFloatingColumnControls/index.js +3 -1
  8. package/dist/cjs/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +15 -27
  9. package/dist/cjs/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +68 -18
  10. package/dist/cjs/plugins/table/ui/TableFloatingControls/index.js +47 -29
  11. package/dist/cjs/plugins/table/ui/common-styles.js +2 -2
  12. package/dist/cjs/plugins/table/ui/icons/DragHandleIcon.js +11 -52
  13. package/dist/es2019/plugins/table/commands/hover.js +4 -2
  14. package/dist/es2019/plugins/table/event-handlers.js +7 -4
  15. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +3 -2
  16. package/dist/es2019/plugins/table/ui/DragHandle/index.js +10 -24
  17. package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +61 -18
  18. package/dist/es2019/plugins/table/ui/TableFloatingColumnControls/index.js +3 -1
  19. package/dist/es2019/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +4 -20
  20. package/dist/es2019/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +69 -17
  21. package/dist/es2019/plugins/table/ui/TableFloatingControls/index.js +24 -2
  22. package/dist/es2019/plugins/table/ui/common-styles.js +64 -4
  23. package/dist/es2019/plugins/table/ui/icons/DragHandleIcon.js +11 -52
  24. package/dist/esm/plugins/table/commands/hover.js +4 -2
  25. package/dist/esm/plugins/table/event-handlers.js +7 -4
  26. package/dist/esm/plugins/table/nodeviews/TableComponent.js +3 -2
  27. package/dist/esm/plugins/table/ui/DragHandle/index.js +11 -25
  28. package/dist/esm/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.js +56 -21
  29. package/dist/esm/plugins/table/ui/TableFloatingColumnControls/index.js +3 -1
  30. package/dist/esm/plugins/table/ui/TableFloatingControls/NumberColumn/index.js +16 -28
  31. package/dist/esm/plugins/table/ui/TableFloatingControls/RowControls/DragControls.js +67 -19
  32. package/dist/esm/plugins/table/ui/TableFloatingControls/index.js +48 -30
  33. package/dist/esm/plugins/table/ui/common-styles.js +2 -2
  34. package/dist/esm/plugins/table/ui/icons/DragHandleIcon.js +11 -51
  35. package/dist/types/plugins/table/commands/hover.d.ts +1 -1
  36. package/dist/types/plugins/table/types.d.ts +8 -4
  37. package/dist/types/plugins/table/ui/DragHandle/index.d.ts +3 -3
  38. package/dist/types/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +6 -5
  39. package/dist/types/plugins/table/ui/TableFloatingColumnControls/index.d.ts +3 -2
  40. package/dist/types/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +1 -1
  41. package/dist/types/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +6 -4
  42. package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +3 -2
  43. package/dist/types/plugins/table/ui/icons/DragHandleIcon.d.ts +1 -6
  44. package/dist/types-ts4.5/plugins/table/commands/hover.d.ts +1 -1
  45. package/dist/types-ts4.5/plugins/table/types.d.ts +8 -4
  46. package/dist/types-ts4.5/plugins/table/ui/DragHandle/index.d.ts +3 -3
  47. package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +6 -5
  48. package/dist/types-ts4.5/plugins/table/ui/TableFloatingColumnControls/index.d.ts +3 -2
  49. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +1 -1
  50. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/DragControls.d.ts +6 -4
  51. package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +3 -2
  52. package/dist/types-ts4.5/plugins/table/ui/icons/DragHandleIcon.d.ts +1 -6
  53. package/package.json +1 -1
  54. package/src/__tests__/unit/event-handlers.ts +4 -1
  55. package/src/__tests__/unit/ui/NumberColumn.tsx +5 -8
  56. package/src/__tests__/unit/ui/RowDragControls.tsx +6 -0
  57. package/src/plugins/table/commands/hover.ts +7 -2
  58. package/src/plugins/table/event-handlers.ts +18 -4
  59. package/src/plugins/table/nodeviews/TableComponent.tsx +3 -2
  60. package/src/plugins/table/types.ts +13 -4
  61. package/src/plugins/table/ui/DragHandle/index.tsx +10 -26
  62. package/src/plugins/table/ui/TableFloatingColumnControls/ColumnControls/index.tsx +90 -39
  63. package/src/plugins/table/ui/TableFloatingColumnControls/index.tsx +5 -2
  64. package/src/plugins/table/ui/TableFloatingControls/NumberColumn/index.tsx +10 -15
  65. package/src/plugins/table/ui/TableFloatingControls/RowControls/DragControls.tsx +97 -28
  66. package/src/plugins/table/ui/TableFloatingControls/index.tsx +19 -3
  67. package/src/plugins/table/ui/common-styles.ts +67 -4
  68. package/src/plugins/table/ui/icons/DragHandleIcon.tsx +5 -69
@@ -11,8 +11,7 @@ import React, { Component } from 'react';
11
11
  import classnames from 'classnames';
12
12
  import { Selection } from '@atlaskit/editor-prosemirror/state';
13
13
  import { isRowSelected } from '@atlaskit/editor-tables/utils';
14
- import { clearHoverSelection, hoverCell } from '../../../commands';
15
- import { getPluginState } from '../../../pm-plugins/plugin-factory';
14
+ import { clearHoverSelection } from '../../../commands';
16
15
  import { TableCssClassName as ClassName } from '../../../types';
17
16
  import { getRowHeights } from '../../../utils';
18
17
  import { tableBorderColor } from '../../consts';
@@ -62,22 +61,10 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
62
61
  clearHoverSelection()(state, dispatch);
63
62
  }
64
63
  });
65
- _defineProperty(_assertThisInitialized(_this), "updateDragHandleLocation", function (rowIndex) {
66
- var _this$props3 = _this.props,
67
- editorView = _this$props3.editorView,
68
- tableActive = _this$props3.tableActive;
69
- var state = editorView.state,
70
- dispatch = editorView.dispatch;
71
- var _getPluginState = getPluginState(state),
72
- hoveredCell = _getPluginState.hoveredCell;
73
- if (tableActive && hoveredCell.rowIndex !== rowIndex) {
74
- hoverCell(rowIndex, hoveredCell.colIndex)(state, dispatch);
75
- }
76
- });
77
64
  _defineProperty(_assertThisInitialized(_this), "getCellStyles", function (index, rowHeight) {
78
- var _this$props4 = _this.props,
79
- stickyTop = _this$props4.stickyTop,
80
- hasHeaderRow = _this$props4.hasHeaderRow;
65
+ var _this$props3 = _this.props,
66
+ stickyTop = _this$props3.stickyTop,
67
+ hasHeaderRow = _this$props3.hasHeaderRow;
81
68
  if (stickyTop && hasHeaderRow && index === 0) {
82
69
  return {
83
70
  height: rowHeight,
@@ -91,11 +78,11 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
91
78
  _defineProperty(_assertThisInitialized(_this), "getClassNames", function (index) {
92
79
  var _classnames;
93
80
  var isButtonDisabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
94
- var _this$props5 = _this.props,
95
- hoveredRows = _this$props5.hoveredRows,
96
- editorView = _this$props5.editorView,
97
- isInDanger = _this$props5.isInDanger,
98
- isResizing = _this$props5.isResizing;
81
+ var _this$props4 = _this.props,
82
+ hoveredRows = _this$props4.hoveredRows,
83
+ editorView = _this$props4.editorView,
84
+ isInDanger = _this$props4.isInDanger,
85
+ isResizing = _this$props4.isResizing;
99
86
  var isActive = isRowSelected(index)(editorView.state.selection) || (hoveredRows || []).indexOf(index) !== -1 && !isResizing;
100
87
  return classnames(ClassName.NUMBERED_COLUMN_BUTTON, (_classnames = {}, _defineProperty(_classnames, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, isButtonDisabled), _defineProperty(_classnames, ClassName.HOVERED_CELL_IN_DANGER, isActive && isInDanger), _defineProperty(_classnames, ClassName.HOVERED_CELL_ACTIVE, isActive), _classnames));
101
88
  });
@@ -105,11 +92,12 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
105
92
  key: "render",
106
93
  value: function render() {
107
94
  var _this2 = this;
108
- var _this$props6 = this.props,
109
- tableRef = _this$props6.tableRef,
110
- hasHeaderRow = _this$props6.hasHeaderRow,
111
- isDragAndDropEnabled = _this$props6.isDragAndDropEnabled,
112
- tableActive = _this$props6.tableActive;
95
+ var _this$props5 = this.props,
96
+ tableRef = _this$props5.tableRef,
97
+ hasHeaderRow = _this$props5.hasHeaderRow,
98
+ isDragAndDropEnabled = _this$props5.isDragAndDropEnabled,
99
+ tableActive = _this$props5.tableActive,
100
+ updateCellHoverLocation = _this$props5.updateCellHoverLocation;
113
101
  var rowHeights = getRowHeights(tableRef);
114
102
  return /*#__PURE__*/React.createElement("div", {
115
103
  className: ClassName.NUMBERED_COLUMN,
@@ -125,7 +113,7 @@ var NumberColumn = /*#__PURE__*/function (_Component) {
125
113
  "data-index": index,
126
114
  style: _this2.getCellStyles(index, rowHeight),
127
115
  onMouseOver: function onMouseOver() {
128
- return _this2.updateDragHandleLocation(index);
116
+ return updateCellHoverLocation(index);
129
117
  }
130
118
  }, hasHeaderRow ? index > 0 ? index : null : index + 1) : /*#__PURE__*/React.createElement("div", {
131
119
  key: "wrapper-".concat(index),
@@ -1,50 +1,98 @@
1
- import React from 'react';
1
+ import React, { useCallback, useMemo } from 'react';
2
2
  import { injectIntl } from 'react-intl-next';
3
- import { findTable } from '@atlaskit/editor-tables/utils';
3
+ import { CellSelection } from '@atlaskit/editor-tables';
4
+ import { findTable, getSelectionRect } from '@atlaskit/editor-tables/utils';
5
+ import { clearHoverSelection } from '../../../commands';
4
6
  import { TableCssClassName as ClassName } from '../../../types';
5
- import { getRowHeights } from '../../../utils';
7
+ import { getRowHeights, getSelectedRowIndexes } from '../../../utils';
6
8
  import { DragHandle } from '../../DragHandle';
9
+ var getSelectedRows = function getSelectedRows(selection) {
10
+ if (selection instanceof CellSelection && selection.isRowSelection()) {
11
+ var rect = getSelectionRect(selection);
12
+ if (!rect) {
13
+ return [];
14
+ }
15
+ return getSelectedRowIndexes(rect);
16
+ }
17
+ return [];
18
+ };
7
19
  var DragControlsComponent = function DragControlsComponent(_ref) {
8
20
  var tableRef = _ref.tableRef,
9
21
  hoveredCell = _ref.hoveredCell,
22
+ tableActive = _ref.tableActive,
23
+ editorView = _ref.editorView,
24
+ isInDanger = _ref.isInDanger,
10
25
  hoverRows = _ref.hoverRows,
11
26
  selectRow = _ref.selectRow,
12
- tableActive = _ref.tableActive,
13
- editorView = _ref.editorView;
27
+ updateCellHoverLocation = _ref.updateCellHoverLocation;
14
28
  var rowHeights = getRowHeights(tableRef);
15
- var heights = rowHeights.map(function (height, index) {
29
+ var heights = rowHeights.map(function (height) {
16
30
  return "".concat(height - 1, "px");
17
31
  }).join(' ');
32
+ var selectedRowIndexes = getSelectedRows(editorView.state.selection);
18
33
  var rowWidth = tableRef.offsetWidth;
19
- var _onClick = function onClick(index, event) {};
20
- var onMouseOver = function onMouseOver() {};
21
- var onMouseOut = function onMouseOut() {};
22
34
  var rowIndex = hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.rowIndex;
35
+ var gridRowPosition = useMemo(function () {
36
+ // if more than one row is selected, ensure the handle spans over the selected range
37
+ if (selectedRowIndexes.includes(rowIndex)) {
38
+ return "".concat(selectedRowIndexes[0] + 1, " / span ").concat(selectedRowIndexes.length);
39
+ }
40
+ return "".concat(rowIndex + 1, " / span 1");
41
+ }, [rowIndex, selectedRowIndexes]);
23
42
  var getLocalId = function getLocalId() {
24
43
  var _tableNode$node;
25
44
  var tableNode = findTable(editorView.state.selection);
26
45
  return (tableNode === null || tableNode === void 0 || (_tableNode$node = tableNode.node) === null || _tableNode$node === void 0 || (_tableNode$node = _tableNode$node.attrs) === null || _tableNode$node === void 0 ? void 0 : _tableNode$node.localId) || '';
27
46
  };
47
+ var handleMouseOut = useCallback(function () {
48
+ if (tableActive) {
49
+ var state = editorView.state,
50
+ dispatch = editorView.dispatch;
51
+ clearHoverSelection()(state, dispatch);
52
+ }
53
+ }, [editorView, tableActive]);
54
+ var handleMouseMove = useCallback(function (e) {
55
+ // avoid updating if event target is drag handle
56
+ if (!e.nativeEvent.target.classList.contains(ClassName.ROW_CONTROLS_WITH_DRAG)) {
57
+ return;
58
+ }
59
+ var hoverHeight = e.nativeEvent.offsetY;
60
+ var totalHeight = 0;
61
+ var rowIndex = rowHeights.findIndex(function (row) {
62
+ totalHeight += row;
63
+ return hoverHeight <= totalHeight;
64
+ });
65
+ updateCellHoverLocation(rowIndex);
66
+ }, [updateCellHoverLocation, rowHeights]);
67
+ var handleMouseOver = useCallback(function () {
68
+ hoverRows([rowIndex]);
69
+ }, [hoverRows, rowIndex]);
70
+ var handleClick = useCallback(function (e) {
71
+ selectRow(rowIndex, e === null || e === void 0 ? void 0 : e.shiftKey);
72
+ }, [rowIndex, selectRow]);
28
73
  return /*#__PURE__*/React.createElement("div", {
29
74
  className: ClassName.ROW_CONTROLS_WITH_DRAG,
30
75
  style: {
31
76
  gridTemplateRows: heights
32
- }
33
- }, rowIndex !== undefined && Number.isFinite(rowIndex) && /*#__PURE__*/React.createElement("div", {
77
+ },
78
+ onMouseMove: handleMouseMove
79
+ }, Number.isFinite(rowIndex) && /*#__PURE__*/React.createElement("div", {
34
80
  style: {
35
- gridRow: "".concat(rowIndex + 1, " / span 1"),
36
- display: 'flex'
81
+ gridRow: gridRowPosition,
82
+ display: 'flex',
83
+ height: '100%',
84
+ alignItems: 'center',
85
+ justifyContent: 'center'
37
86
  }
38
87
  }, /*#__PURE__*/React.createElement(DragHandle, {
39
- onClick: function onClick(event) {
40
- return _onClick(rowIndex, event);
41
- },
42
- onMouseOver: onMouseOver,
43
- onMouseOut: onMouseOut,
44
88
  tableLocalId: getLocalId(),
45
89
  indexes: [rowIndex],
46
90
  previewWidth: rowWidth,
47
- previewHeight: rowHeights[rowIndex]
91
+ previewHeight: rowHeights[rowIndex],
92
+ appearance: selectedRowIndexes.includes(rowIndex) ? isInDanger ? 'danger' : 'selected' : 'default',
93
+ onClick: handleClick,
94
+ onMouseOver: handleMouseOver,
95
+ onMouseOut: handleMouseOut
48
96
  })));
49
97
  };
50
98
  export var DragControls = injectIntl(DragControlsComponent);
@@ -12,7 +12,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
12
12
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
13
  import React, { Component } from 'react';
14
14
  import { browser } from '@atlaskit/editor-common/utils';
15
- import { hoverRows, selectRow } from '../../commands';
15
+ import { hoverCell, hoverRows, selectRow } from '../../commands';
16
+ import { getPluginState } from '../../pm-plugins/plugin-factory';
16
17
  import { isSelectionUpdated } from '../../utils';
17
18
  import { CornerControls } from './CornerControls';
18
19
  import NumberColumn from './NumberColumn';
@@ -43,6 +44,19 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
43
44
  dispatch = _this$props$editorVie.dispatch;
44
45
  hoverRows(rows, danger)(state, dispatch);
45
46
  });
47
+ // re-use across numbered columns and row controls
48
+ _defineProperty(_assertThisInitialized(_this), "updateCellHoverLocation", function (rowIndex) {
49
+ var _this$props = _this.props,
50
+ editorView = _this$props.editorView,
51
+ tableActive = _this$props.tableActive;
52
+ var state = editorView.state,
53
+ dispatch = editorView.dispatch;
54
+ var _getPluginState = getPluginState(state),
55
+ hoveredCell = _getPluginState.hoveredCell;
56
+ if (tableActive && hoveredCell.rowIndex !== rowIndex) {
57
+ hoverCell(rowIndex, hoveredCell.colIndex)(state, dispatch);
58
+ }
59
+ });
46
60
  return _this;
47
61
  }
48
62
  _createClass(TableFloatingControls, [{
@@ -89,20 +103,20 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
89
103
  key: "shouldComponentUpdate",
90
104
  value: function shouldComponentUpdate(nextProps, nextState) {
91
105
  var _this$state;
92
- var _this$props = this.props,
93
- tableRef = _this$props.tableRef,
94
- isInDanger = _this$props.isInDanger,
95
- isResizing = _this$props.isResizing,
96
- isHeaderRowEnabled = _this$props.isHeaderRowEnabled,
97
- isNumberColumnEnabled = _this$props.isNumberColumnEnabled,
98
- hoveredRows = _this$props.hoveredRows,
99
- selection = _this$props.selection,
100
- tableActive = _this$props.tableActive,
101
- isHeaderColumnEnabled = _this$props.isHeaderColumnEnabled,
102
- ordering = _this$props.ordering,
103
- headerRowHeight = _this$props.headerRowHeight,
104
- stickyHeader = _this$props.stickyHeader,
105
- hoveredCell = _this$props.hoveredCell;
106
+ var _this$props2 = this.props,
107
+ tableRef = _this$props2.tableRef,
108
+ isInDanger = _this$props2.isInDanger,
109
+ isResizing = _this$props2.isResizing,
110
+ isHeaderRowEnabled = _this$props2.isHeaderRowEnabled,
111
+ isNumberColumnEnabled = _this$props2.isNumberColumnEnabled,
112
+ hoveredRows = _this$props2.hoveredRows,
113
+ selection = _this$props2.selection,
114
+ tableActive = _this$props2.tableActive,
115
+ isHeaderColumnEnabled = _this$props2.isHeaderColumnEnabled,
116
+ ordering = _this$props2.ordering,
117
+ headerRowHeight = _this$props2.headerRowHeight,
118
+ stickyHeader = _this$props2.stickyHeader,
119
+ hoveredCell = _this$props2.hoveredCell;
106
120
  var tableHeight = (_this$state = this.state) === null || _this$state === void 0 ? void 0 : _this$state.tableHeight;
107
121
  var nextTableHeight = nextState === null || nextState === void 0 ? void 0 : nextState.tableHeight;
108
122
  return ordering !== nextProps.ordering || tableRef !== nextProps.tableRef || tableHeight !== nextTableHeight || tableActive !== nextProps.tableActive || isInDanger !== nextProps.isInDanger || isResizing !== nextProps.isResizing || hoveredRows !== nextProps.hoveredRows || isHeaderRowEnabled !== nextProps.isHeaderRowEnabled || isHeaderColumnEnabled !== nextProps.isHeaderColumnEnabled || isNumberColumnEnabled !== nextProps.isNumberColumnEnabled || isSelectionUpdated(selection, nextProps.selection) || headerRowHeight !== nextProps.headerRowHeight || stickyHeader !== nextProps.stickyHeader || hoveredCell !== nextProps.hoveredCell;
@@ -117,20 +131,20 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
117
131
  }, {
118
132
  key: "render",
119
133
  value: function render() {
120
- var _this$props2 = this.props,
121
- editorView = _this$props2.editorView,
122
- tableRef = _this$props2.tableRef,
123
- isInDanger = _this$props2.isInDanger,
124
- isResizing = _this$props2.isResizing,
125
- isNumberColumnEnabled = _this$props2.isNumberColumnEnabled,
126
- isHeaderRowEnabled = _this$props2.isHeaderRowEnabled,
127
- isHeaderColumnEnabled = _this$props2.isHeaderColumnEnabled,
128
- tableActive = _this$props2.tableActive,
129
- hasHeaderRow = _this$props2.hasHeaderRow,
130
- hoveredRows = _this$props2.hoveredRows,
131
- stickyHeader = _this$props2.stickyHeader,
132
- isDragAndDropEnabled = _this$props2.isDragAndDropEnabled,
133
- hoveredCell = _this$props2.hoveredCell;
134
+ var _this$props3 = this.props,
135
+ editorView = _this$props3.editorView,
136
+ tableRef = _this$props3.tableRef,
137
+ isInDanger = _this$props3.isInDanger,
138
+ isResizing = _this$props3.isResizing,
139
+ isNumberColumnEnabled = _this$props3.isNumberColumnEnabled,
140
+ isHeaderRowEnabled = _this$props3.isHeaderRowEnabled,
141
+ isHeaderColumnEnabled = _this$props3.isHeaderColumnEnabled,
142
+ tableActive = _this$props3.tableActive,
143
+ hasHeaderRow = _this$props3.hasHeaderRow,
144
+ hoveredRows = _this$props3.hoveredRows,
145
+ stickyHeader = _this$props3.stickyHeader,
146
+ isDragAndDropEnabled = _this$props3.isDragAndDropEnabled,
147
+ hoveredCell = _this$props3.hoveredCell;
134
148
  if (!tableRef) {
135
149
  return null;
136
150
  }
@@ -149,14 +163,18 @@ var TableFloatingControls = /*#__PURE__*/function (_Component) {
149
163
  isInDanger: isInDanger,
150
164
  isResizing: isResizing,
151
165
  selectRow: this.selectRow,
166
+ updateCellHoverLocation: this.updateCellHoverLocation,
152
167
  stickyTop: stickyTop,
153
168
  isDragAndDropEnabled: isDragAndDropEnabled
154
169
  }) : null, tableActive && /*#__PURE__*/React.createElement(React.Fragment, null, isDragAndDropEnabled ? /*#__PURE__*/React.createElement(DragControls, {
155
170
  tableRef: tableRef,
156
171
  hoveredCell: hoveredCell,
157
172
  editorView: editorView,
173
+ tableActive: tableActive,
174
+ isInDanger: isInDanger,
158
175
  hoverRows: this.hoverRows,
159
- selectRow: this.selectRow
176
+ selectRow: this.selectRow,
177
+ updateCellHoverLocation: this.updateCellHoverLocation
160
178
  }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CornerControls, {
161
179
  editorView: editorView,
162
180
  tableRef: tableRef,
@@ -48,7 +48,7 @@ var tableStickyHeaderColumnControlsDecorationsStyle = function tableStickyHeader
48
48
  }
49
49
  };
50
50
  var tableRowControlStyles = function tableRowControlStyles() {
51
- return getBooleanFF('platform.editor.table.drag-and-drop') ? css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n margin-top: ", "px;\n left: -", "px;\n z-index: ", ";\n }\n "])), ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop, tableToolbarSize + 1, rowControlsZIndex) : css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n left: -", "px;\n }\n "])), ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, tableToolbarSize);
51
+ return getBooleanFF('platform.editor.table.drag-and-drop') ? css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n margin-top: ", "px;\n left: -", "px;\n z-index: ", ";\n }\n "])), ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop, tableToolbarSize + 1, rowControlsZIndex + 4) : css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n .", " {\n position: absolute;\n /* top of corner control is table margin top - corner control height + 1 pixel of table border. */\n top: ", "px;\n left: -", "px;\n }\n "])), ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, tableToolbarSize);
52
52
  };
53
53
  var tableWrapperStyles = function tableWrapperStyles() {
54
54
  if (getBooleanFF('platform.editor.custom-table-width')) {
@@ -61,7 +61,7 @@ var tableWrapperStyles = function tableWrapperStyles() {
61
61
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4139
62
62
  export var tableStyles = function tableStyles(props) {
63
63
  var _props$featureFlags;
64
- return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n\n // ED-15246: Trello card is visible through a border of a table border\n // This fixes a border issue caused by relative positioned table cells\n &::after {\n height: 100%;\n content: '';\n border-left: 1px solid ", ";\n border-bottom: 1px solid ", ";\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n width: 100%;\n display: inline-block;\n pointer-events: none;\n }\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n ", "\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: ", "px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n .", ", .", " {\n width: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n .", " {\n display: grid;\n align-items: center;\n position: absolute;\n left: -4px;\n }\n\n .", " {\n cursor: grab;\n width: max-content;\n padding: 0;\n border: none;\n background: none;\n }\n\n ", "\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", ":first-of-type::after {\n content: '';\n display: block;\n height: 33px;\n width: 100%;\n background-color: ", ";\n position: absolute;\n\n // the extra pixel is accounting for borders\n top: -34px;\n left: -1px;\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", ":not(.", ") {\n cursor: pointer;\n }\n .", ":not(.", "):hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n // Allows better positioning for the shadow sentinels - ED-16668\n position: relative;\n\n > tbody > tr {\n white-space: pre-wrap;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n z-index: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n z-index: ", ";\n }\n // ED-15246: Trello card is visible through a border of a table border\n /* ED-19064: To fix when enable header column in the table,\n and selection the header column, the right border is not tableBorderSelectedColor\n when deleting the header column, the right border is not tableToolbarDeleteColor */\n td.", ",\n td.", ",\n th.", ".", ",\n th.", ".", " {\n &::after {\n height: 100%;\n width: 100%;\n border: 1px solid ", ";\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n bottom: 0;\n z-index: ", ";\n display: inline-block;\n pointer-events: none;\n }\n &.", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n ", "\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), ClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)", tableSharedStyle(props), columnControlsLineMarker(), hoveredDeleteButton(props), hoveredCell(props), hoveredWarningCell, getBooleanFF('platform.editor.table.drag-and-drop') && insertLine(props), resizeHandle(props), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(props), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(props), DeleteButton(props), ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, "var(--ds-surface, white)", ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, "var(--ds-surface, white)", tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(props), ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, "var(--ds-surface, white)", tableToolbarSize, ClassName.TABLE_STICKY, "var(--ds-surface, green)", stickyRowOffsetTop, akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, akEditorTableCellOnStickyHeaderZIndex, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, insertColumnButtonOffset + 1, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, OverflowShadow(props), stickyScrollbarStyles(), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.COLUMN_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(props), rowControlsWrapperDotStyle(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableHeaderCellBackgroundColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), tableToolbarDeleteColor(props), ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.ROW_CONTROLS_WITH_DRAG, ClassName.DRAG_HANDLE_BUTTON_CONTAINER, floatingColumnControls(props), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, getBooleanFF('platform.editor.table.drag-and-drop') ? 0 : akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), "var(--ds-text-danger, ".concat(R500, ")"), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor(props), ClassName.SELECTED_CELL, tableCellSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor(props), akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(props), akEditorUnitZIndex * 100, tableRowControlStyles(), ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.COLUMN_CONTROLS_WRAPPER, tableMarginTop + 1, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
64
+ return css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .", " button {\n background: ", ";\n color: ", ";\n cursor: none;\n }\n\n .", ":not(.", ") button:hover {\n background: ", ";\n color: ", " !important;\n cursor: pointer;\n }\n\n .ProseMirror {\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n\n .", " {\n margin-bottom: 0;\n }\n\n .", " {\n td.", ", th.", " {\n position: relative;\n overflow: visible;\n }\n\n td.", " {\n background-color: ", ";\n\n // ED-15246: Trello card is visible through a border of a table border\n // This fixes a border issue caused by relative positioned table cells\n &::after {\n height: 100%;\n content: '';\n border-left: 1px solid ", ";\n border-bottom: 1px solid ", ";\n position: absolute;\n right: 0px;\n top: 0px;\n bottom: 0;\n width: 100%;\n display: inline-block;\n pointer-events: none;\n }\n }\n }\n\n .", " {\n ", "\n }\n\n .", " {\n ", "\n }\n\n /* Delete button */\n ", "\n /* Ends Delete button */\n\n /* sticky styles */\n .", " .", " .", ":first-of-type {\n margin-top: ", "px;\n width: ", "px;\n\n position: fixed !important;\n z-index: ", " !important;\n box-shadow: 0px -", "px ", ";\n border-right: 0 none;\n /* top set by NumberColumn component */\n }\n\n .", " .", ".sticky {\n position: fixed !important;\n /* needs to be above row controls */\n z-index: ", " !important;\n background: ", ";\n\n width: ", "px;\n height: ", "px;\n }\n\n .", ".sticky .", " {\n border-bottom: 0px none;\n border-right: 0px none;\n\n height: ", "px;\n width: ", "px;\n }\n\n ", "\n\n .", "\n .", "\n .", ".sticky {\n position: fixed !important;\n z-index: ", " !important;\n display: flex;\n border-left: ", "px solid\n ", ";\n margin-left: -", "px;\n }\n\n .", " col:first-of-type {\n /* moving rows out of a table layout does weird things in Chrome */\n border-right: 1px solid ", ";\n }\n\n tr.sticky {\n padding-top: ", "px;\n position: fixed;\n display: grid;\n\n /* to keep it above cell selection but below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n\n overflow-y: visible;\n overflow-x: hidden;\n\n grid-auto-flow: column;\n\n /* background for where controls apply */\n background: ", ";\n box-sizing: content-box;\n\n margin-top: 2px;\n\n box-shadow: 0 6px 4px -4px ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\n /* needs to be above sticky header row and below date and other nodes popups that are inside sticky header */\n z-index: ", ";\n }\n\n .", ".", "\n .", " {\n padding-bottom: ", "px;\n }\n\n tr.sticky th {\n border-bottom: ", "px solid\n ", ";\n margin-right: -1px;\n }\n\n .", " tr.sticky > th:last-child {\n border-right-width: 1px;\n }\n\n /* add left edge for first cell */\n .", " tr.sticky > th:first-of-type {\n margin-left: 0px;\n }\n\n /* add a little bit so the scroll lines up with the table */\n .", " tr.sticky::after {\n content: ' ';\n width: ", "px;\n }\n\n /* To fix jumpiness caused in Chrome Browsers for sticky headers */\n .", " .sticky + tr {\n min-height: 0px;\n }\n\n /* move resize line a little in sticky bar */\n .", ".", " {\n tr.sticky\n td.", ",\n tr.sticky\n th.", " {\n .", "::after {\n right: ", "px;\n }\n }\n\n /* when selected put it back to normal -- :not selector would be nicer */\n tr.sticky\n td.", ".", ",\n tr.sticky\n th.", ".", " {\n .", "::after {\n right: ", "px;\n }\n }\n }\n\n tr.sticky\n .", ",\n tr.sticky\n .", " {\n z-index: 1;\n }\n\n .", " tr.sticky {\n padding-top: ", "px;\n }\n\n .", ".", "\n .", "\n .", ":first-of-type {\n margin-top: ", "px;\n }\n\n .", ".sticky {\n border-top: ", "px solid\n ", ";\n }\n\n ", "\n ", "\n ", "\n\n .", " .", " {\n height: 0; // stop overflow flash & set correct height in update-overflow-shadows.ts\n }\n\n .less-padding {\n padding: 0 ", "px;\n\n .", " {\n padding: 0 ", "px;\n\n // https://product-fabric.atlassian.net/browse/ED-16386\n // Fixes issue where the extra padding that is added here throws off the position\n // of the rows control dot\n &::after {\n right: 6px !important;\n }\n }\n\n .", " {\n padding: 0 ", "px;\n }\n\n &.", "[data-number-column='true'] {\n padding-left: ", "px;\n }\n .", ", .", " {\n width: ", "px;\n }\n\n .", " {\n left: 6px;\n }\n\n .", " {\n left: calc(100% - 6px);\n }\n }\n\n > .", " {\n /**\n * Prevent margins collapsing, aids with placing the gap-cursor correctly\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Box_Model/Mastering_margin_collapsing\n *\n * TODO: Enable this, many tests will fail!\n * border-top: 1px solid transparent;\n */\n }\n\n /* Breakout only works on top level unless wrapped in fragment mark */\n ", "\n\n ", ";\n ", ";\n\n /* Corner controls */\n .", " {\n width: ", "px;\n height: ", "px;\n display: none;\n\n .", " {\n position: relative;\n\n ", ";\n }\n }\n\n .", ".sticky {\n .", " {\n /* sticky row insert dot overlaps other row insert and messes things up */\n display: none !important;\n }\n }\n\n .", " {\n position: absolute;\n top: 0;\n width: ", "px;\n height: ", "px;\n border: 1px solid ", ";\n border-radius: 0;\n border-top-left-radius: ", "px;\n background: ", ";\n box-sizing: border-box;\n padding: 0;\n :focus {\n outline: none;\n }\n }\n .active .", " {\n border-color: ", ";\n background: ", ";\n }\n\n .", "[data-number-column='true'] {\n .", ", .", " {\n width: ", "px;\n }\n .", " .", " {\n border-right-width: 0;\n }\n }\n\n :not(.", ") .", ":hover {\n border-color: ", ";\n background: ", ";\n cursor: pointer;\n }\n\n :not(.", ")\n .", ".", " {\n border-color: ", ";\n background: ", ";\n }\n\n /* Row controls */\n .", " {\n width: ", "px;\n box-sizing: border-box;\n display: none;\n position: relative;\n\n ", ";\n\n .", " {\n display: flex;\n flex-direction: column;\n }\n .", ":last-child > button {\n border-bottom-left-radius: ", "px;\n }\n .", " {\n position: relative;\n margin-top: -1px;\n }\n .", ":hover,\n .", ".active,\n .", ":hover {\n z-index: ", ";\n }\n\n ", "\n }\n\n .", " {\n display: grid;\n align-items: center;\n position: absolute;\n left: -4px;\n z-index: ", ";\n }\n\n .", " {\n cursor: grab;\n padding: 0;\n\n border-radius: 6px;\n width: max-content;\n height: max-content;\n border: 2px solid ", ";\n display: flex;\n justify-content: center;\n align-items: center;\n\n svg {\n rect {\n //\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n\n &:hover {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.selected {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.danger {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n\n &.disabled {\n svg {\n rect {\n fill: ", ";\n }\n g {\n fill: ", ";\n }\n }\n }\n }\n\n ", "\n\n :not(.", ") .", " {\n ", "\n ", "\n }\n\n /* Numbered column */\n .", " {\n position: relative;\n float: right;\n margin-left: ", "px;\n top: ", "px;\n width: ", "px;\n box-sizing: border-box;\n }\n\n .", " {\n border: 1px solid ", ";\n box-sizing: border-box;\n margin-top: -1px;\n padding-bottom: 2px;\n padding: 10px 2px;\n text-align: center;\n font-size: ", ";\n background-color: ", ";\n color: ", ";\n border-color: ", ";\n\n :first-child:not(style),\n style:first-child + * {\n margin-top: 0;\n }\n :last-child {\n border-bottom: 1px solid ", ";\n }\n }\n\n // add a background above the first numbered column cell when sticky header is engaged\n // which hides the table when scrolling\n .", ":first-of-type::after {\n content: '';\n display: block;\n height: 33px;\n width: 100%;\n background-color: ", ";\n position: absolute;\n\n // the extra pixel is accounting for borders\n top: -34px;\n left: -1px;\n }\n\n .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: ", "px;\n\n .", " {\n border-left: 0 none;\n }\n\n .", ".active {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n }\n }\n :not(.", ") .", " {\n .", ":not(.", ") {\n cursor: pointer;\n }\n .", ":not(.", "):hover {\n border-bottom: 1px solid ", ";\n border-color: ", ";\n background-color: ", ";\n position: relative;\n z-index: ", ";\n color: ", ";\n }\n .", ".", " {\n background-color: ", ";\n border: 1px solid ", ";\n border-left: 0;\n color: ", ";\n position: relative;\n z-index: ", ";\n }\n }\n\n /* Table */\n .", " > table {\n table-layout: fixed;\n white-space: normal;\n border-top: none;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n // Allows better positioning for the shadow sentinels - ED-16668\n position: relative;\n\n > tbody > tr {\n white-space: pre-wrap;\n }\n\n .", " + * {\n margin-top: 0;\n }\n\n /*\n * Headings have a top margin by default, but we don't want this on the\n * first heading within table header cells.\n *\n * This specifically sets margin-top for the first heading within a header\n * cell when center/right aligned.\n */\n th.", " > .fabric-editor-block-mark {\n > h1:first-of-type,\n > h2:first-of-type,\n > h3:first-of-type,\n > h4:first-of-type,\n > h5:first-of-type,\n > h6:first-of-type {\n margin-top: 0;\n }\n }\n\n .", ", .", " {\n position: relative;\n }\n /* Give selected cells a blue overlay */\n .", "::after,\n .", "::after {\n z-index: ", ";\n position: absolute;\n content: '';\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n width: 100%;\n pointer-events: none;\n }\n .", " {\n border: 1px solid ", ";\n }\n .", "::after {\n background: ", ";\n z-index: ", ";\n }\n th.", "::after,\n td.", "::after {\n background: ", ";\n z-index: ", ";\n }\n // ED-15246: Trello card is visible through a border of a table border\n /* ED-19064: To fix when enable header column in the table,\n and selection the header column, the right border is not tableBorderSelectedColor\n when deleting the header column, the right border is not tableToolbarDeleteColor */\n td.", ",\n td.", ",\n th.", ".", ",\n th.", ".", " {\n &::after {\n height: 100%;\n width: 100%;\n border: 1px solid ", ";\n content: '';\n position: absolute;\n left: -1px;\n top: -1px;\n bottom: 0;\n z-index: ", ";\n display: inline-block;\n pointer-events: none;\n }\n &.", "::after {\n ", ";\n z-index: ", ";\n }\n }\n }\n ", "\n .", ".", " {\n z-index: ", ";\n }\n\n .", " {\n position: absolute;\n top: ", "px;\n }\n\n ", "\n }\n\n .ProseMirror.", " {\n .", " {\n overflow-x: auto;\n ", ";\n }\n }\n\n .ProseMirror.", " {\n cursor: col-resize;\n }\n\n /*\n ED-15882: When custom start numbers is enabled for lists, we have\n styles that handle this generally (in editor-common) so we can\n throw away the older table-specific styles here.\n */\n ", "\n\n ", "\n"])), ClassName.LAYOUT_BUTTON, "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), ClassName.LAYOUT_BUTTON, ClassName.IS_RESIZING, "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)", tableSharedStyle(props), columnControlsLineMarker(), hoveredDeleteButton(props), hoveredCell(props), hoveredWarningCell, getBooleanFF('platform.editor.table.drag-and-drop') && insertLine(props), resizeHandle(props), rangeSelectionStyles, ClassName.LAST_ITEM_IN_CELL, ClassName.TABLE_NODE_WRAPPER, ClassName.TABLE_CELL, ClassName.TABLE_HEADER_CELL, ClassName.TABLE_CELL, tableCellBackgroundColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.CONTROLS_FLOATING_BUTTON_COLUMN, insertColumnButtonWrapper(props), ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper(props), DeleteButton(props), ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, stickyRowOffsetTop + 2, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, stickyRowOffsetTop, "var(--ds-surface, white)", ClassName.TABLE_STICKY, ClassName.CORNER_CONTROLS, akEditorSmallZIndex, "var(--ds-surface, white)", tableToolbarSize, tableToolbarSize, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize, tableToolbarSize, tableStickyHeaderColumnControlsDecorationsStyle(props), ClassName.TABLE_STICKY, ClassName.ROW_CONTROLS, ClassName.ROW_CONTROLS_BUTTON_WRAP, akEditorStickyHeaderZIndex, tableToolbarSize, "var(--ds-surface, white)", tableToolbarSize, ClassName.TABLE_STICKY, "var(--ds-surface, green)", stickyRowOffsetTop, akEditorTableCellOnStickyHeaderZIndex - 5, "var(--ds-surface, white)", "var(--ds-shadow-overflow-perimeter, ".concat(N40A, ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, akEditorTableCellOnStickyHeaderZIndex, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tableToolbarSize, stickyHeaderBorderBottomWidth, tableBorderColor(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, ClassName.TABLE_STICKY, insertColumnButtonOffset + 1, ClassName.TABLE_STICKY, ClassName.TABLE_CONTAINER, ClassName.TABLE_STICKY, ClassName.WITH_RESIZE_LINE, ClassName.WITH_RESIZE_LINE, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2 + 1, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.WITH_RESIZE_LINE, ClassName.SELECTED_CELL, ClassName.RESIZE_HANDLE_DECORATION, (resizeHandlerAreaWidth - resizeLineWidth) / 2, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.WITH_CONTROLS, tableControlsSpacing, ClassName.WITH_CONTROLS, ClassName.TABLE_STICKY, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, tableControlsSpacing + 2, ClassName.CORNER_CONTROLS, tableControlsSpacing - tableToolbarSize + 2, "var(--ds-surface, white)", sentinelStyles, OverflowShadow(props), stickyScrollbarStyles(), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.COLUMN_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, tableOverflowShadowWidth, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, breakoutWidthStyling(), columnControlsDecoration(props), rowControlsWrapperDotStyle(props), ClassName.CORNER_CONTROLS, tableToolbarSize + 1, cornerControlHeight, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, InsertMarker(props, "\n left: -11px;\n top: 9px;\n "), ClassName.CORNER_CONTROLS, ClassName.CORNER_CONTROLS_INSERT_ROW_MARKER, ClassName.CONTROLS_CORNER_BUTTON, tableToolbarSize + 1, tableToolbarSize + 1, tableBorderColor(props), tableBorderRadiusSize, tableHeaderCellBackgroundColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize + akEditorTableNumberColumnWidth + 1 : akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor(props), tableToolbarSelectedColor(props), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor(props), tableToolbarDeleteColor(props), ClassName.ROW_CONTROLS, tableToolbarSize, InsertMarker(props, "\n bottom: -1px;\n left: -11px;\n "), ClassName.ROW_CONTROLS_INNER, ClassName.ROW_CONTROLS_BUTTON_WRAP, tableBorderRadiusSize, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.ROW_CONTROLS_BUTTON_WRAP, ClassName.CONTROLS_BUTTON, akEditorUnitZIndex, HeaderButton(props, "\n border-bottom: 1px solid ".concat(tableBorderColor(props), ";\n border-right: 0px;\n border-radius: 0;\n height: 100%;\n width: ").concat(tableToolbarSize, "px;\n\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, " {\n position: absolute;\n width: 30px;\n height: 50%;\n right: 0;\n bottom: 0;\n }\n .").concat(ClassName.CONTROLS_BUTTON_OVERLAY, ":first-of-type {\n top: 0;\n }\n ")), ClassName.ROW_CONTROLS_WITH_DRAG, akEditorUnitZIndex, ClassName.DRAG_HANDLE_BUTTON_CONTAINER, "var(--ds-surface, ".concat(N0, ")"), "var(--ds-background-accent-gray-subtlest, #F1F2F4)", "var(--ds-icon-subtle, #626F86)", "var(--ds-background-accent-blue-subtle, #579DFF)", "var(--ds-icon-inverse, #FFF)", "var(--ds-background-accent-blue-subtle, #579DFF)", "var(--ds-icon-inverse, #FFF)", "var(--ds-background-accent-red-subtler-pressed, #F87462)", "var(--ds-border-inverse, #FFF)", "var(--ds-background-accent-gray-subtlest, #F1F2F4)", "var(--ds-border-inverse, #FFF)", floatingColumnControls(props), ClassName.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(props), HeaderButtonDanger(props), ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? akEditorTableToolbarSize : akEditorTableToolbarSize - 1, getBooleanFF('platform.editor.table.drag-and-drop') ? 0 : akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableHeaderCellBackgroundColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, "var(--ds-surface, white)", ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, getBooleanFF('platform.editor.custom-table-width') ? 0 : 1, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON_DISABLED, tableBorderSelectedColor(props), tableBorderSelectedColor(props), tableToolbarSelectedColor(props), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableToolbarDeleteColor(props), tableBorderDeleteColor(props), "var(--ds-text-danger, ".concat(R500, ")"), akEditorUnitZIndex, ClassName.TABLE_NODE_WRAPPER, ClassName.COLUMN_CONTROLS_DECORATIONS, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, ClassName.SELECTED_CELL, ClassName.HOVERED_CELL_IN_DANGER, akEditorSmallZIndex, ClassName.SELECTED_CELL, tableBorderSelectedColor(props), ClassName.SELECTED_CELL, tableCellSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor(props), akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.SELECTED_CELL, ClassName.TABLE_HEADER_CELL, ClassName.HOVERED_CELL, tableBorderSelectedColor(props), akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderStyles(props), akEditorUnitZIndex * 100, tableRowControlStyles(), ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.COLUMN_CONTROLS_WRAPPER, tableMarginTop + 1, tableWrapperStyles(), ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles, shadowSentinelStyles);
65
65
  };
66
66
  export var tableFullPageEditorStyles = css(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212\n margin-right: -1px;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
67
67
  export var tableCommentEditorStyles = css(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
@@ -1,55 +1,15 @@
1
- /* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
2
1
  import React from 'react';
3
- export var DragHandleIcon = function DragHandleIcon(_ref) {
4
- var backgroundColor = _ref.backgroundColor,
5
- foregroundColor = _ref.foregroundColor;
2
+ export var DragHandleIcon = function DragHandleIcon() {
6
3
  return /*#__PURE__*/React.createElement("svg", {
7
- width: "28",
8
- height: "20",
9
- viewBox: "0 0 28 20",
10
- fill: "none",
11
- xmlns: "http://www.w3.org/2000/svg"
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: "24",
6
+ height: "16",
7
+ fill: "none"
12
8
  }, /*#__PURE__*/React.createElement("rect", {
13
- x: "1",
14
- y: "1",
15
- width: "26",
16
- height: "18",
17
- rx: "5",
18
- fill: backgroundColor || '#F1F2F4'
19
- }), /*#__PURE__*/React.createElement("g", {
20
- clipPath: "url(#clip0_125_45007)"
21
- }, /*#__PURE__*/React.createElement("path", {
22
- d: "M11 12C11 11.4477 10.5523 11 10 11C9.44772 11 9 11.4477 9 12C9 12.5523 9.44772 13 10 13C10.5523 13 11 12.5523 11 12Z",
23
- fill: foregroundColor || '#626F86'
24
- }), /*#__PURE__*/React.createElement("path", {
25
- d: "M11 8C11 7.44772 10.5523 7 10 7C9.44772 7 9 7.44772 9 8C9 8.55228 9.44772 9 10 9C10.5523 9 11 8.55228 11 8Z",
26
- fill: foregroundColor || '#626F86'
27
- }), /*#__PURE__*/React.createElement("path", {
28
- d: "M19 12C19 11.4477 18.5523 11 18 11C17.4477 11 17 11.4477 17 12C17 12.5523 17.4477 13 18 13C18.5523 13 19 12.5523 19 12Z",
29
- fill: foregroundColor || '#626F86'
30
- }), /*#__PURE__*/React.createElement("path", {
31
- d: "M19 8C19 7.44772 18.5523 7 18 7C17.4477 7 17 7.44772 17 8C17 8.55228 17.4477 9 18 9C18.5523 9 19 8.55228 19 8Z",
32
- fill: foregroundColor || '#626F86'
33
- }), /*#__PURE__*/React.createElement("path", {
34
- d: "M15 12C15 11.4477 14.5523 11 14 11C13.4477 11 13 11.4477 13 12C13 12.5523 13.4477 13 14 13C14.5523 13 15 12.5523 15 12Z",
35
- fill: foregroundColor || '#626F86'
36
- }), /*#__PURE__*/React.createElement("path", {
37
- d: "M15 8C15 7.44772 14.5523 7 14 7C13.4477 7 13 7.44772 13 8C13 8.55228 13.4477 9 14 9C14.5523 9 15 8.55228 15 8Z",
38
- fill: foregroundColor || '#626F86'
39
- })), /*#__PURE__*/React.createElement("rect", {
40
- x: "1",
41
- y: "1",
42
- width: "26",
43
- height: "18",
44
- rx: "5",
45
- stroke: "white",
46
- strokeWidth: "2"
47
- }), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
48
- id: "clip0_125_45007"
49
- }, /*#__PURE__*/React.createElement("rect", {
50
- width: "16",
51
- height: "24",
52
- fill: "white",
53
- transform: "matrix(0 -1 1 0 2 18)"
54
- }))));
9
+ width: "24",
10
+ height: "16",
11
+ rx: "4"
12
+ }), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
13
+ d: "M9 10a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM9 6a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM17 10a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM17 6a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM13 10a1 1 0 1 0-2 0 1 1 0 0 0 2 0ZM13 6a1 1 0 1 0-2 0 1 1 0 0 0 2 0Z"
14
+ })));
55
15
  };
@@ -6,4 +6,4 @@ export declare const hoverTable: (isInDanger?: boolean, isSelected?: boolean) =>
6
6
  export declare const clearHoverSelection: () => import("@atlaskit/editor-common/types").Command;
7
7
  export declare const showResizeHandleLine: (cellColumnPositioning: CellColumnPositioning) => import("@atlaskit/editor-common/types").Command;
8
8
  export declare const hideResizeHandleLine: () => import("@atlaskit/editor-common/types").Command;
9
- export declare const hoverCell: (rowIndex?: number, colIndex?: number) => import("@atlaskit/editor-common/types").Command;
9
+ export declare const hoverCell: (rowIndex?: number, colIndex?: number, colWidth?: number, colHeight?: number) => import("@atlaskit/editor-common/types").Command;
@@ -44,15 +44,17 @@ export interface PluginConfig {
44
44
  }
45
45
  export type { ColumnResizingPluginState } from '@atlaskit/editor-common/types';
46
46
  export type CellColumnPositioning = Pick<Rect, 'right' | 'left'>;
47
- export type CellHoverCoordinates = {
47
+ export interface CellHoverMeta {
48
48
  colIndex?: number;
49
49
  rowIndex?: number;
50
- };
50
+ colWidth?: number;
51
+ colHeight?: number;
52
+ }
51
53
  export interface TablePluginState {
52
54
  editorHasFocus?: boolean;
53
55
  hoveredColumns: number[];
54
56
  hoveredRows: number[];
55
- hoveredCell: CellHoverCoordinates;
57
+ hoveredCell: CellHoverMeta;
56
58
  pluginConfig: PluginConfig;
57
59
  isHeaderColumnEnabled: boolean;
58
60
  isHeaderRowEnabled: boolean;
@@ -170,7 +172,9 @@ export type TablePluginAction = {
170
172
  };
171
173
  } | {
172
174
  type: 'HOVER_CELL';
173
- data: CellHoverCoordinates;
175
+ data: {
176
+ hoveredCell: CellHoverMeta;
177
+ };
174
178
  } | {
175
179
  type: 'SET_TARGET_CELL_POSITION';
176
180
  data: {
@@ -1,15 +1,15 @@
1
1
  import type { MouseEventHandler } from 'react';
2
- type DragHandleState = 'default' | 'selected' | 'disabled' | 'danger';
2
+ type DragHandleAppearance = 'default' | 'selected' | 'disabled' | 'danger';
3
3
  type DragHandleProps = {
4
4
  tableLocalId: string;
5
5
  indexes: number[];
6
6
  previewWidth?: number;
7
7
  previewHeight?: number;
8
8
  direction?: 'column' | 'row';
9
- state?: DragHandleState;
9
+ appearance?: DragHandleAppearance;
10
10
  onClick?: MouseEventHandler;
11
11
  onMouseOver?: MouseEventHandler;
12
12
  onMouseOut?: MouseEventHandler;
13
13
  };
14
- export declare const DragHandle: ({ tableLocalId, direction, state, indexes, previewWidth, previewHeight, onClick, onMouseOver, onMouseOut, }: DragHandleProps) => JSX.Element;
14
+ export declare const DragHandle: ({ tableLocalId, direction, appearance, indexes, previewWidth, previewHeight, onMouseOver, onMouseOut, onClick, }: DragHandleProps) => JSX.Element;
15
15
  export {};
@@ -1,16 +1,17 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- import type { CellHoverCoordinates } from '../../../types';
4
- export interface Props {
3
+ import type { CellHoverMeta } from '../../../types';
4
+ export interface ColumnControlsProps {
5
5
  editorView: EditorView;
6
6
  tableActive?: boolean;
7
+ isInDanger?: boolean;
7
8
  tableRef: HTMLTableElement;
8
- hoveredCell?: CellHoverCoordinates;
9
+ hoveredCell?: CellHoverMeta;
9
10
  isResizing?: boolean;
10
11
  stickyTop?: number;
11
12
  localId?: string;
12
13
  rowHeights?: number[];
13
14
  colWidths?: (number | undefined)[];
14
15
  }
15
- export declare const ColumnControls: React.FC<Props>;
16
+ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hoveredCell, isResizing, stickyTop, localId, isInDanger, rowHeights, colWidths, }: ColumnControlsProps) => JSX.Element;
16
17
  export default ColumnControls;
@@ -5,7 +5,7 @@ import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
5
5
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
6
6
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
7
7
  import type { RowStickyState } from '../../pm-plugins/sticky-headers';
8
- import type { CellHoverCoordinates } from '../../types';
8
+ import type { CellHoverMeta } from '../../types';
9
9
  export interface Props {
10
10
  editorView: EditorView;
11
11
  getEditorFeatureFlags: GetEditorFeatureFlags;
@@ -13,10 +13,11 @@ export interface Props {
13
13
  tableRef?: HTMLTableElement;
14
14
  getNode: () => PmNode;
15
15
  tableActive?: boolean;
16
+ isInDanger?: boolean;
16
17
  hasHeaderRow?: boolean;
17
18
  headerRowHeight?: number;
18
19
  hoveredRows?: number[];
19
- hoveredCell?: CellHoverCoordinates;
20
+ hoveredCell?: CellHoverMeta;
20
21
  isResizing?: boolean;
21
22
  ordering?: TableColumnOrdering;
22
23
  stickyHeader?: RowStickyState;