@atlaskit/editor-plugin-table 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/plugins/table/nodeviews/TableComponent.js +13 -3
  3. package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +7 -2
  4. package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -1
  5. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +17 -1
  6. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +38 -6
  7. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +2 -2
  8. package/dist/cjs/plugins/table/transforms/column-width.js +47 -5
  9. package/dist/cjs/plugins/table/ui/common-styles.js +4 -3
  10. package/dist/cjs/version.json +1 -1
  11. package/dist/es2019/plugins/table/nodeviews/TableComponent.js +13 -3
  12. package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +7 -2
  13. package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -1
  14. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +15 -0
  15. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +37 -4
  16. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +2 -2
  17. package/dist/es2019/plugins/table/transforms/column-width.js +45 -5
  18. package/dist/es2019/plugins/table/ui/common-styles.js +5 -2
  19. package/dist/es2019/version.json +1 -1
  20. package/dist/esm/plugins/table/nodeviews/TableComponent.js +13 -3
  21. package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +7 -2
  22. package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +5 -1
  23. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +15 -0
  24. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +35 -4
  25. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-logic.js +2 -2
  26. package/dist/esm/plugins/table/transforms/column-width.js +47 -5
  27. package/dist/esm/plugins/table/ui/common-styles.js +3 -3
  28. package/dist/esm/version.json +1 -1
  29. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +7 -0
  30. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +2 -1
  31. package/dist/types/plugins/table/ui/common-styles.d.ts +1 -0
  32. package/package.json +8 -6
  33. package/src/__tests__/integration/__fixtures__/empty-layout.ts +35 -0
  34. package/src/__tests__/integration/__fixtures__/nested-in-expand.ts +129 -0
  35. package/src/__tests__/integration/horizontal-scroll.ts +489 -0
  36. package/src/__tests__/unit/commands/insert.ts +3 -3
  37. package/src/__tests__/unit/keymap.ts +3 -1
  38. package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +38 -0
  39. package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +5 -2
  40. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-visual-hints-should-be-added-to-the-table-column-on-hover-1-snap.png +2 -2
  41. package/src/__tests__/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-visual-hints-should-be-added-to-the-table-row-on-hover-1-snap.png +2 -2
  42. package/src/__tests__/visual-regression/__image_snapshots__/sticky-header-ts-snapshot-test-table-sticky-header-should-align-with-table-cell-when-active-2-snap.png +2 -2
  43. package/src/__tests__/visual-regression/sticky-header.ts +2 -1
  44. package/src/plugins/table/nodeviews/TableComponent.tsx +16 -3
  45. package/src/plugins/table/pm-plugins/table-resizing/commands.ts +6 -2
  46. package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +9 -1
  47. package/src/plugins/table/pm-plugins/table-resizing/utils/colgroup.ts +19 -1
  48. package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +57 -5
  49. package/src/plugins/table/pm-plugins/table-resizing/utils/resize-logic.ts +2 -2
  50. package/src/plugins/table/transforms/column-width.ts +60 -6
  51. package/src/plugins/table/ui/common-styles.ts +5 -2
@@ -3,6 +3,8 @@ import { getBreakpoint, mapBreakpointToLayoutMaxWidth } from '@atlaskit/editor-c
3
3
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorWideLayoutWidth, akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
4
4
  import { containsClassName } from '@atlaskit/editor-common/utils';
5
5
  import { getParentNodeWidth } from '@atlaskit/editor-common/node-width';
6
+ import { gridSize } from '@atlaskit/theme/constants';
7
+ import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
6
8
  export const tableLayoutToSize = {
7
9
  default: akEditorDefaultLayoutWidth,
8
10
  wide: akEditorWideLayoutWidth,
@@ -21,9 +23,6 @@ export function getLayoutSize(tableLayout, containerWidth = 0, options) {
21
23
  if (calculatedTableWidth.endsWith('px')) {
22
24
  return parseInt(calculatedTableWidth, 10);
23
25
  }
24
- if (tableLayout === 'default') {
25
- return getDefaultLayoutMaxWidth(containerWidth);
26
- }
27
26
  return tableLayoutToSize[tableLayout] || containerWidth;
28
27
  }
29
28
  export function getDefaultLayoutMaxWidth(containerWidth) {
@@ -74,9 +73,43 @@ export const getTableMaxWidth = ({
74
73
  }) => {
75
74
  const containerWidth = getEditorContainerWidth();
76
75
  const parentWidth = getParentNodeWidth(tableStart, state, containerWidth);
77
- let maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {});
76
+
77
+ // TODO - refactor this logic into getParentNodeWidth() in editor-common [ED-16718]
78
+ const parentActualWidth = getParentWidthWithoutPadding(parentWidth, tableStart, state);
79
+ let maxWidth = parentActualWidth || getLayoutSize(layout, containerWidth.width, {});
78
80
  if (table.attrs.isNumberColumnEnabled) {
79
81
  maxWidth -= akEditorTableNumberColumnWidth;
80
82
  }
81
83
  return maxWidth;
84
+ };
85
+ export const getParentWidthWithoutPadding = (parentWidth, tableStartPos, state) => {
86
+ const node = getNestedParentNode(tableStartPos, state);
87
+ if (!node) {
88
+ return;
89
+ }
90
+ const {
91
+ schema
92
+ } = state;
93
+ if (node.type === schema.nodes.expand) {
94
+ // padding
95
+ parentWidth -= gridSize() * 2;
96
+ // gutter offset
97
+ parentWidth += gridSize() * 1.5 * 2;
98
+ // padding right
99
+ parentWidth -= gridSize();
100
+ // padding left
101
+ parentWidth -= gridSize() * 4 - gridSize() / 2;
102
+ }
103
+ return parentWidth;
104
+ };
105
+
106
+ // copy of getNestedParentNode() from packages/editor/editor-common/src/node-width/index.ts
107
+ // to be removed later when we will move getParentWidthWithoutPadding() logic to editor-common
108
+ const getNestedParentNode = (tablePos, state) => {
109
+ if (tablePos === undefined) {
110
+ return null;
111
+ }
112
+ const $pos = state.doc.resolve(tablePos);
113
+ const parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
114
+ return parent ? parent.node : null;
82
115
  };
@@ -11,7 +11,7 @@ export const growColumn = (state, colIndex, amount, selectedColumns) => {
11
11
  if (remaining > 0) {
12
12
  newState = stackSpace(newState, colIndex, remaining).state;
13
13
  }
14
- if (selectedColumns) {
14
+ if (selectedColumns && selectedColumns.length > 1) {
15
15
  return bulkColumnsResize(newState, selectedColumns, colIndex);
16
16
  }
17
17
  return newState;
@@ -34,7 +34,7 @@ export const shrinkColumn = (state, colIndex, amount, selectedColumns) => {
34
34
  if (remaining < 0) {
35
35
  newState = stackSpace(newState, colIndex + 1, remaining).state;
36
36
  }
37
- if (selectedColumns) {
37
+ if (selectedColumns && selectedColumns.length > 1) {
38
38
  return bulkColumnsResize(newState, selectedColumns, colIndex);
39
39
  }
40
40
  return newState;
@@ -1,11 +1,14 @@
1
1
  import { TableMap } from '@atlaskit/editor-tables/table-map';
2
2
  import { tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
3
+ import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
3
4
  import { hasTableBeenResized } from '../pm-plugins/table-resizing/utils';
4
5
  import { setMeta } from './metadata';
5
6
  import { getResizeState, normaliseTableLayout } from '../pm-plugins/table-resizing/utils/resize-state';
6
7
  import { getTableMaxWidth } from '../pm-plugins/table-resizing/utils/misc';
7
8
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
8
9
  import { scaleTableTo } from '../pm-plugins/table-resizing/utils/scale-table';
10
+ import { isMinCellWidthTable } from '../pm-plugins/table-resizing/utils/colgroup';
11
+ import { insertColumnButtonOffset } from '../ui/common-styles';
9
12
  export const updateColumnWidths = (resizeState, table, start) => tr => {
10
13
  const map = TableMap.get(table);
11
14
  const updatedCellsAttrs = {};
@@ -108,18 +111,19 @@ export const updateColumnWidths = (resizeState, table, start) => tr => {
108
111
  * @returns Updated transaction with rescaled columns for a given table
109
112
  */
110
113
  export const rescaleColumns = getEditorContainerWidth => (table, view) => tr => {
111
- // If the table has been not been resized we skip updating the size
112
- // of columns here.
113
- if (!view || !hasTableBeenResized(table.node)) {
114
+ var _tableRef$parentEleme;
115
+ if (!view) {
114
116
  return tr;
115
117
  }
118
+ const pos = table.pos;
119
+ const newTable = tr.doc.nodeAt(pos);
116
120
  const {
117
121
  state
118
122
  } = view;
119
123
  const domAtPos = view.domAtPos.bind(view);
120
124
  const maybeTable = domAtPos(table.start).node;
121
125
  const tableRef = maybeTable.closest('table');
122
- if (!tableRef) {
126
+ if (!tableRef || !newTable) {
123
127
  return tr;
124
128
  }
125
129
  const layout = normaliseTableLayout(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout);
@@ -131,6 +135,42 @@ export const rescaleColumns = getEditorContainerWidth => (table, view) => tr =>
131
135
  layout,
132
136
  getEditorContainerWidth
133
137
  });
138
+ const tableWidth = tableRef.clientWidth || akEditorDefaultLayoutWidth;
139
+ let tableMaxWidth = (tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$parentEleme = tableRef.parentElement) === null || _tableRef$parentEleme === void 0 ? void 0 : _tableRef$parentEleme.clientWidth) || 0;
140
+ tableMaxWidth -= insertColumnButtonOffset;
141
+ const newTableMap = TableMap.get(newTable);
142
+ const noOfColumns = newTableMap.width;
143
+ if (!noOfColumns || noOfColumns <= 0) {
144
+ return tr;
145
+ }
146
+ const columnWidthUnresized = tableWidth / noOfColumns;
147
+
148
+ // If the table has not been resized, and the column width is bigger than the minimum column width
149
+ // we skip updating the size of columns here.
150
+ if (!hasTableBeenResized(table.node) && columnWidthUnresized > tableCellMinWidth) {
151
+ return tr;
152
+ }
153
+
154
+ // If the table has not been resized, and the column width is smaller than the minimum column width
155
+ // Or if the table has been resized, but each column width is either 48px or null
156
+ // we update the table to have 48px for each column
157
+ if (!hasTableBeenResized(table.node) && columnWidthUnresized <= tableCellMinWidth || hasTableBeenResized(table.node) && isMinCellWidthTable(table.node)) {
158
+ const widths = new Array(noOfColumns).fill(tableCellMinWidth);
159
+ const cols = widths.map((width, index) => ({
160
+ width: tableCellMinWidth,
161
+ minWidth: tableCellMinWidth,
162
+ index
163
+ }));
164
+ const overflow = tableWidth > maxSize;
165
+ const minWidthResizeState = {
166
+ cols,
167
+ widths,
168
+ maxSize,
169
+ tableWidth,
170
+ overflow
171
+ };
172
+ return updateColumnWidths(minWidthResizeState, table.node, table.start)(tr);
173
+ }
134
174
  let resizeState = getResizeState({
135
175
  minWidth: tableCellMinWidth,
136
176
  table: table.node,
@@ -140,7 +180,7 @@ export const rescaleColumns = getEditorContainerWidth => (table, view) => tr =>
140
180
  maxSize
141
181
  });
142
182
  const previousTableWidth = resizeState.tableWidth - tableNewColumnMinWidth;
143
- const tableDidntPreviouslyOverflow = previousTableWidth <= maxSize;
183
+ const tableDidntPreviouslyOverflow = previousTableWidth <= Math.max(maxSize, tableMaxWidth);
144
184
 
145
185
  // If the new table width will result in the table going into an overflow state
146
186
  // we resize the cells to avoid the overflow occuring
@@ -14,7 +14,7 @@ const cornerControlHeight = tableToolbarSize + 1;
14
14
  that is aligned to the right edge initially on hover of the top right column control when table overflown,
15
15
  its center should be aligned with the edge
16
16
  */
17
- const insertColumnButtonOffset = tableInsertColumnButtonSize / 2;
17
+ export const insertColumnButtonOffset = tableInsertColumnButtonSize / 2;
18
18
  const rangeSelectionStyles = `
19
19
  .${ClassName.NODEVIEW_WRAPPER}.${akEditorSelectedNodeClassName} table tbody tr {
20
20
  th,td {
@@ -523,6 +523,8 @@ export const tableStyles = props => {
523
523
  table-layout: fixed;
524
524
  white-space: normal;
525
525
  border-top: none;
526
+ // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212
527
+ margin-right: -1px;
526
528
 
527
529
  > tbody > tr {
528
530
  white-space: pre-wrap;
@@ -643,7 +645,8 @@ export const tableStyles = props => {
643
645
  export const tableFullPageEditorStyles = css`
644
646
  .ProseMirror .${ClassName.TABLE_NODE_WRAPPER} > table {
645
647
  margin-left: 0;
646
- margin-right: 0;
648
+ // 1px border width offset added here to prevent unwanted overflow and scolling - ED-16212
649
+ margin-right: -1px;
647
650
  width: 100%;
648
651
  }
649
652
  `;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "sideEffects": false
5
5
  }
@@ -31,6 +31,7 @@ import { containsHeaderRow, tablesHaveDifferentColumnWidths, tablesHaveDifferent
31
31
  import { updateOverflowShadows } from './update-overflow-shadows';
32
32
  import memoizeOne from 'memoize-one';
33
33
  import { OverflowShadowsObserver } from './OverflowShadowsObserver';
34
+ import { getParentWidthWithoutPadding } from '../pm-plugins/table-resizing/utils/misc';
34
35
  var isIE11 = browser.ie_version === 11;
35
36
  var NOOP = function NOOP() {
36
37
  return undefined;
@@ -192,15 +193,23 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
192
193
  }
193
194
  });
194
195
  _defineProperty(_assertThisInitialized(_this), "handleWindowResize", function () {
196
+ var _node$attrs, _node$attrs2;
195
197
  var _this$props4 = _this.props,
196
198
  getNode = _this$props4.getNode,
197
199
  containerWidth = _this$props4.containerWidth;
198
- var layoutSize = _this.tableNodeLayoutSize(getNode());
200
+ var node = getNode();
201
+ var prevNode = _this.node;
202
+ var layoutSize = _this.tableNodeLayoutSize(node);
203
+ var prevAttrs = prevNode === null || prevNode === void 0 ? void 0 : prevNode.attrs;
204
+ var layoutChanged = (prevAttrs === null || prevAttrs === void 0 ? void 0 : prevAttrs.layout) !== (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.layout) && (prevAttrs === null || prevAttrs === void 0 ? void 0 : prevAttrs.__autoSize) === (node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.__autoSize);
199
205
  if (containerWidth.width > layoutSize) {
200
206
  return;
201
207
  }
202
208
  var parentWidth = _this.getParentNodeWidth();
203
- _this.scaleTableDebounced(parentWidth);
209
+ _this.scaleTableDebounced({
210
+ layoutChanged: layoutChanged,
211
+ parentWidth: parentWidth
212
+ });
204
213
  });
205
214
  _defineProperty(_assertThisInitialized(_this), "updateTableContainerWidth", function () {
206
215
  var _this$props5 = _this.props,
@@ -236,7 +245,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
236
245
  if (!isValidPosition(pos, state)) {
237
246
  return;
238
247
  }
239
- return getParentNodeWidth(pos, state, containerWidth, options && options.isFullWidthModeEnabled);
248
+ var parentNodeWith = getParentNodeWidth(pos, state, containerWidth, options && options.isFullWidthModeEnabled);
249
+ return getParentWidthWithoutPadding(parentNodeWith, pos, state);
240
250
  });
241
251
  _defineProperty(_assertThisInitialized(_this), "updateParentWidth", function (width) {
242
252
  _this.setState({
@@ -10,7 +10,8 @@ export var scaleTable = function scaleTable(tableRef, options, domAtPos) {
10
10
  }
11
11
  var node = options.node,
12
12
  start = options.start,
13
- parentWidth = options.parentWidth;
13
+ parentWidth = options.parentWidth,
14
+ layoutChanged = options.layoutChanged;
14
15
 
15
16
  // If a table has not been resized yet, columns should be auto.
16
17
  if (hasTableBeenResized(node) === false) {
@@ -33,7 +34,11 @@ export var scaleTable = function scaleTable(tableRef, options, domAtPos) {
33
34
  // TODO: ED-8995
34
35
  // We need to do this check to reduce the number of race conditions when working with tables.
35
36
  // This metadata is been used in the sendTransaction function in the Collab plugin
36
- _tr.setMeta('scaleTable', true);
37
+ /* Added !layoutChanged check here to solve unnecessary scroll bar after publish when click on breakout button multiple times and publish
38
+ scaleTable is only called once every time a breakout button is clicked, so it is safe not to add the meta 'scaleTable' to the tr.
39
+ Leaving the tr.setMeta('scaleTable', true) here for race conditions that we aren't aware of.
40
+ */
41
+ !layoutChanged && _tr.setMeta('scaleTable', true);
37
42
  dispatch(_tr);
38
43
  return true;
39
44
  }
@@ -9,6 +9,7 @@ import { evenColumns, setDragging, stopResizing } from './commands';
9
9
  import { getPluginState } from './plugin-factory';
10
10
  import { currentColWidth, getLayoutSize, getResizeState, pointsAtCell, resizeColumn, updateControls } from './utils';
11
11
  import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
12
+ import { getParentWidthWithoutPadding } from './utils/misc';
12
13
  export var handleMouseDown = function handleMouseDown(view, event, localResizeHandlePos, getEditorContainerWidth, getEditorFeatureFlags, editorAnalyticsAPI) {
13
14
  var state = view.state,
14
15
  dispatch = view.dispatch;
@@ -29,7 +30,10 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
29
30
  }
30
31
  var containerWidth = getEditorContainerWidth();
31
32
  var parentWidth = getParentNodeWidth(start, state, containerWidth);
32
- var maxSize = parentWidth || getLayoutSize(dom.getAttribute('data-layout'), containerWidth.width, {});
33
+
34
+ // TODO - refactor this logic into getParentNodeWidth() in editor-common [ED-16718]
35
+ var parentActualWidth = getParentWidthWithoutPadding(parentWidth, start, state);
36
+ var maxSize = parentActualWidth || getLayoutSize(dom.getAttribute('data-layout'), containerWidth.width, {});
33
37
  if (originalTable.attrs.isNumberColumnEnabled) {
34
38
  maxSize -= akEditorTableNumberColumnWidth;
35
39
  }
@@ -1,6 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { DOMSerializer } from 'prosemirror-model';
3
3
  import { getFragmentBackingArray } from '@atlaskit/editor-common/utils';
4
+ import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
4
5
  export var generateColgroup = function generateColgroup(table) {
5
6
  var cols = [];
6
7
  table.content.firstChild.content.forEach(function (cell) {
@@ -40,6 +41,20 @@ export var hasTableBeenResized = function hasTableBeenResized(table) {
40
41
  return cell.attrs.colwidth;
41
42
  });
42
43
  };
44
+
45
+ /**
46
+ * Check if a table has all the column width set to tableCellMinWidth(48px) or null
47
+ *
48
+ * @param table
49
+ * @returns true if all column width is equal to tableCellMinWidth or null, false otherwise
50
+ */
51
+ export var isMinCellWidthTable = function isMinCellWidthTable(table) {
52
+ var cellArray = getFragmentBackingArray(table.content.firstChild.content);
53
+ var isTableMinCellWidth = cellArray.every(function (cell) {
54
+ return cell.attrs.colwidth && cell.attrs.colwidth[0] === tableCellMinWidth || cell.attrs.colwidth === null;
55
+ });
56
+ return isTableMinCellWidth;
57
+ };
43
58
  function renderColgroupFromNode(table) {
44
59
  var rendered = DOMSerializer.renderSpec(document, ['colgroup', {}].concat(_toConsumableArray(generateColgroup(table))));
45
60
  return rendered.dom;
@@ -3,6 +3,8 @@ import { getBreakpoint, mapBreakpointToLayoutMaxWidth } from '@atlaskit/editor-c
3
3
  import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorWideLayoutWidth, akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
4
4
  import { containsClassName } from '@atlaskit/editor-common/utils';
5
5
  import { getParentNodeWidth } from '@atlaskit/editor-common/node-width';
6
+ import { gridSize } from '@atlaskit/theme/constants';
7
+ import { findParentNodeOfTypeClosestToPos } from 'prosemirror-utils';
6
8
  export var tableLayoutToSize = {
7
9
  default: akEditorDefaultLayoutWidth,
8
10
  wide: akEditorWideLayoutWidth,
@@ -21,9 +23,6 @@ export function getLayoutSize(tableLayout) {
21
23
  if (calculatedTableWidth.endsWith('px')) {
22
24
  return parseInt(calculatedTableWidth, 10);
23
25
  }
24
- if (tableLayout === 'default') {
25
- return getDefaultLayoutMaxWidth(containerWidth);
26
- }
27
26
  return tableLayoutToSize[tableLayout] || containerWidth;
28
27
  }
29
28
  export function getDefaultLayoutMaxWidth(containerWidth) {
@@ -72,9 +71,41 @@ export var getTableMaxWidth = function getTableMaxWidth(_ref2) {
72
71
  getEditorContainerWidth = _ref2.getEditorContainerWidth;
73
72
  var containerWidth = getEditorContainerWidth();
74
73
  var parentWidth = getParentNodeWidth(tableStart, state, containerWidth);
75
- var maxWidth = parentWidth || getLayoutSize(layout, containerWidth.width, {});
74
+
75
+ // TODO - refactor this logic into getParentNodeWidth() in editor-common [ED-16718]
76
+ var parentActualWidth = getParentWidthWithoutPadding(parentWidth, tableStart, state);
77
+ var maxWidth = parentActualWidth || getLayoutSize(layout, containerWidth.width, {});
76
78
  if (table.attrs.isNumberColumnEnabled) {
77
79
  maxWidth -= akEditorTableNumberColumnWidth;
78
80
  }
79
81
  return maxWidth;
82
+ };
83
+ export var getParentWidthWithoutPadding = function getParentWidthWithoutPadding(parentWidth, tableStartPos, state) {
84
+ var node = getNestedParentNode(tableStartPos, state);
85
+ if (!node) {
86
+ return;
87
+ }
88
+ var schema = state.schema;
89
+ if (node.type === schema.nodes.expand) {
90
+ // padding
91
+ parentWidth -= gridSize() * 2;
92
+ // gutter offset
93
+ parentWidth += gridSize() * 1.5 * 2;
94
+ // padding right
95
+ parentWidth -= gridSize();
96
+ // padding left
97
+ parentWidth -= gridSize() * 4 - gridSize() / 2;
98
+ }
99
+ return parentWidth;
100
+ };
101
+
102
+ // copy of getNestedParentNode() from packages/editor/editor-common/src/node-width/index.ts
103
+ // to be removed later when we will move getParentWidthWithoutPadding() logic to editor-common
104
+ var getNestedParentNode = function getNestedParentNode(tablePos, state) {
105
+ if (tablePos === undefined) {
106
+ return null;
107
+ }
108
+ var $pos = state.doc.resolve(tablePos);
109
+ var parent = findParentNodeOfTypeClosestToPos($pos, [state.schema.nodes.bodiedExtension, state.schema.nodes.layoutSection, state.schema.nodes.expand]);
110
+ return parent ? parent.node : null;
80
111
  };
@@ -16,7 +16,7 @@ export var growColumn = function growColumn(state, colIndex, amount, selectedCol
16
16
  if (remaining > 0) {
17
17
  newState = stackSpace(newState, colIndex, remaining).state;
18
18
  }
19
- if (selectedColumns) {
19
+ if (selectedColumns && selectedColumns.length > 1) {
20
20
  return bulkColumnsResize(newState, selectedColumns, colIndex);
21
21
  }
22
22
  return newState;
@@ -39,7 +39,7 @@ export var shrinkColumn = function shrinkColumn(state, colIndex, amount, selecte
39
39
  if (remaining < 0) {
40
40
  newState = stackSpace(newState, colIndex + 1, remaining).state;
41
41
  }
42
- if (selectedColumns) {
42
+ if (selectedColumns && selectedColumns.length > 1) {
43
43
  return bulkColumnsResize(newState, selectedColumns, colIndex);
44
44
  }
45
45
  return newState;
@@ -3,12 +3,15 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
3
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
4
  import { TableMap } from '@atlaskit/editor-tables/table-map';
5
5
  import { tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
6
+ import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
6
7
  import { hasTableBeenResized } from '../pm-plugins/table-resizing/utils';
7
8
  import { setMeta } from './metadata';
8
9
  import { getResizeState, normaliseTableLayout } from '../pm-plugins/table-resizing/utils/resize-state';
9
10
  import { getTableMaxWidth } from '../pm-plugins/table-resizing/utils/misc';
10
11
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
11
12
  import { scaleTableTo } from '../pm-plugins/table-resizing/utils/scale-table';
13
+ import { isMinCellWidthTable } from '../pm-plugins/table-resizing/utils/colgroup';
14
+ import { insertColumnButtonOffset } from '../ui/common-styles';
12
15
  export var updateColumnWidths = function updateColumnWidths(resizeState, table, start) {
13
16
  return function (tr) {
14
17
  var map = TableMap.get(table);
@@ -112,16 +115,17 @@ export var updateColumnWidths = function updateColumnWidths(resizeState, table,
112
115
  export var rescaleColumns = function rescaleColumns(getEditorContainerWidth) {
113
116
  return function (table, view) {
114
117
  return function (tr) {
115
- // If the table has been not been resized we skip updating the size
116
- // of columns here.
117
- if (!view || !hasTableBeenResized(table.node)) {
118
+ var _tableRef$parentEleme;
119
+ if (!view) {
118
120
  return tr;
119
121
  }
122
+ var pos = table.pos;
123
+ var newTable = tr.doc.nodeAt(pos);
120
124
  var state = view.state;
121
125
  var domAtPos = view.domAtPos.bind(view);
122
126
  var maybeTable = domAtPos(table.start).node;
123
127
  var tableRef = maybeTable.closest('table');
124
- if (!tableRef) {
128
+ if (!tableRef || !newTable) {
125
129
  return tr;
126
130
  }
127
131
  var layout = normaliseTableLayout(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout);
@@ -133,6 +137,44 @@ export var rescaleColumns = function rescaleColumns(getEditorContainerWidth) {
133
137
  layout: layout,
134
138
  getEditorContainerWidth: getEditorContainerWidth
135
139
  });
140
+ var tableWidth = tableRef.clientWidth || akEditorDefaultLayoutWidth;
141
+ var tableMaxWidth = (tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$parentEleme = tableRef.parentElement) === null || _tableRef$parentEleme === void 0 ? void 0 : _tableRef$parentEleme.clientWidth) || 0;
142
+ tableMaxWidth -= insertColumnButtonOffset;
143
+ var newTableMap = TableMap.get(newTable);
144
+ var noOfColumns = newTableMap.width;
145
+ if (!noOfColumns || noOfColumns <= 0) {
146
+ return tr;
147
+ }
148
+ var columnWidthUnresized = tableWidth / noOfColumns;
149
+
150
+ // If the table has not been resized, and the column width is bigger than the minimum column width
151
+ // we skip updating the size of columns here.
152
+ if (!hasTableBeenResized(table.node) && columnWidthUnresized > tableCellMinWidth) {
153
+ return tr;
154
+ }
155
+
156
+ // If the table has not been resized, and the column width is smaller than the minimum column width
157
+ // Or if the table has been resized, but each column width is either 48px or null
158
+ // we update the table to have 48px for each column
159
+ if (!hasTableBeenResized(table.node) && columnWidthUnresized <= tableCellMinWidth || hasTableBeenResized(table.node) && isMinCellWidthTable(table.node)) {
160
+ var widths = new Array(noOfColumns).fill(tableCellMinWidth);
161
+ var cols = widths.map(function (width, index) {
162
+ return {
163
+ width: tableCellMinWidth,
164
+ minWidth: tableCellMinWidth,
165
+ index: index
166
+ };
167
+ });
168
+ var overflow = tableWidth > maxSize;
169
+ var minWidthResizeState = {
170
+ cols: cols,
171
+ widths: widths,
172
+ maxSize: maxSize,
173
+ tableWidth: tableWidth,
174
+ overflow: overflow
175
+ };
176
+ return updateColumnWidths(minWidthResizeState, table.node, table.start)(tr);
177
+ }
136
178
  var resizeState = getResizeState({
137
179
  minWidth: tableCellMinWidth,
138
180
  table: table.node,
@@ -142,7 +184,7 @@ export var rescaleColumns = function rescaleColumns(getEditorContainerWidth) {
142
184
  maxSize: maxSize
143
185
  });
144
186
  var previousTableWidth = resizeState.tableWidth - tableNewColumnMinWidth;
145
- var tableDidntPreviouslyOverflow = previousTableWidth <= maxSize;
187
+ var tableDidntPreviouslyOverflow = previousTableWidth <= Math.max(maxSize, tableMaxWidth);
146
188
 
147
189
  // If the new table width will result in the table going into an overflow state
148
190
  // we resize the cells to avoid the overflow occuring
@@ -16,7 +16,7 @@ var cornerControlHeight = tableToolbarSize + 1;
16
16
  that is aligned to the right edge initially on hover of the top right column control when table overflown,
17
17
  its center should be aligned with the edge
18
18
  */
19
- var insertColumnButtonOffset = tableInsertColumnButtonSize / 2;
19
+ export var insertColumnButtonOffset = tableInsertColumnButtonSize / 2;
20
20
  var rangeSelectionStyles = "\n.".concat(ClassName.NODEVIEW_WRAPPER, ".").concat(akEditorSelectedNodeClassName, " table tbody tr {\n th,td {\n ").concat(getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.Border]), "\n }\n}\n");
21
21
  var sentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n position: absolute;\n width: 100%;\n height: 1px;\n margin-top: -1px;\n // need this to avoid sentinel being focused via keyboard\n // this still allows it to be detected by intersection observer\n visibility: hidden;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(columnControlsDecorationHeight, "px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(tableScrollbarOffset + stickyRowOffsetTop + tablePadding * 2 + 23, "px;\n }\n &.").concat(ClassName.WITH_CONTROLS, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(columnControlsDecorationHeight, "px;\n }\n }\n}");
22
22
 
@@ -27,7 +27,7 @@ var listLargeNumericMarkersOldStyles = "\n .ProseMirror .pm-table-cell-content-
27
27
  // TODO: https://product-fabric.atlassian.net/browse/DSP-4139
28
28
  export var tableStyles = function tableStyles(props) {
29
29
  var _props$featureFlags, _props$featureFlags2;
30
- return css(_templateObject || (_templateObject = _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 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 z-index: 0;\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 */\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: ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\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 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\n &.", "[data-number-column='true'] {\n padding-left: ", "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 */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\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 :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 .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\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 .", " {\n cursor: pointer;\n }\n .", ":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\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 td.", ", td.", " {\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 border: 1px solid ", ";\n z-index: ", ";\n }\n }\n }\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 }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\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"])), 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(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, 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, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, 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, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, 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, stickyRowZIndex, "var(--ds-surface, white)", "var(--ds-shadow-overflow, ".concat("0 6px 4px -4px ".concat(N40A), ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, 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)", (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(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, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, "var(--ds-background-selected, ".concat(tableToolbarSelectedColor, ")"), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, "var(--ds-background-selected, ".concat(tableToolbarSelectedColor, ")"), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, "var(--ds-background-danger, ".concat(tableToolbarDeleteColor, ")"), 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.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, "var(--ds-background-selected, ".concat(tableToolbarSelectedColor, ")"), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, "var(--ds-background-selected, ".concat(tableToolbarSelectedColor, ")"), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, "var(--ds-background-danger, ".concat(tableToolbarDeleteColor, ")"), tableBorderDeleteColor, "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, ClassName.SELECTED_CELL, tableCellSelectedColor, akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, tableBorderSelectedColor, akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, akEditorUnitZIndex * 100, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, insertColumnButtonOffset, insertColumnButtonOffset, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles);
30
+ return css(_templateObject || (_templateObject = _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 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 z-index: 0;\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 */\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: ", ";\n margin-left: -1px;\n\n &.no-pointer-events {\n pointer-events: none;\n }\n }\n\n .", " .", " {\n left: unset;\n position: fixed;\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 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\n &.", "[data-number-column='true'] {\n padding-left: ", "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 */\n > * .", " .", " {\n margin-left: unset !important;\n width: 100% !important;\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 :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 .", " {\n .", ", .", " {\n display: block;\n }\n .", " {\n padding-left: 1px;\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 .", " {\n cursor: pointer;\n }\n .", ":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\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 td.", ", td.", " {\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 border: 1px solid ", ";\n z-index: ", ";\n }\n }\n }\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 }\n .", ".", " {\n z-index: ", ";\n }\n .", " {\n left: -", "px;\n }\n .", " {\n padding-right: ", "px;\n margin-right: -", "px;\n padding-bottom: ", "px;\n margin-bottom: -", "px;\n /* fixes gap cursor height */\n overflow: auto;\n position: relative;\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"])), 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(props), hoveredDeleteButton, hoveredCell, hoveredWarningCell, resizeHandle, 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, ClassName.CONTROLS_FLOATING_BUTTON_ROW, insertRowButtonWrapper, DeleteButton, 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, ClassName.TABLE_STICKY, ClassName.COLUMN_CONTROLS_DECORATIONS, 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, stickyRowZIndex, "var(--ds-surface, white)", "var(--ds-shadow-overflow, ".concat("0 6px 4px -4px ".concat(N40A), ")"), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, stickyRowZIndex + 1, 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)", (_props$featureFlags = props.featureFlags) !== null && _props$featureFlags !== void 0 && _props$featureFlags.stickyHeadersOptimization ? sentinelStyles : '', OverflowShadow(props), ClassName.TABLE_STICKY, ClassName.TABLE_STICKY_SHADOW, tablePadding, ClassName.ROW_CONTROLS_WRAPPER, tablePadding, ClassName.TABLE_CONTAINER, akEditorTableNumberColumnWidth + tablePadding - 1, ClassName.TABLE_LEFT_SHADOW, ClassName.TABLE_RIGHT_SHADOW, ClassName.NODEVIEW_WRAPPER, ClassName.NODEVIEW_WRAPPER, ClassName.TABLE_CONTAINER, columnControlsDecoration(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, tableToolbarColor(props), ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, "var(--ds-background-selected, ".concat(tableToolbarSelectedColor, ")"), ClassName.TABLE_CONTAINER, ClassName.CORNER_CONTROLS, ClassName.CONTROLS_CORNER_BUTTON, akEditorTableToolbarSize + akEditorTableNumberColumnWidth, ClassName.ROW_CONTROLS, ClassName.CONTROLS_BUTTON, ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, tableBorderSelectedColor, "var(--ds-background-selected, ".concat(tableToolbarSelectedColor, ")"), ClassName.IS_RESIZING, ClassName.CONTROLS_CORNER_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, "var(--ds-background-danger, ".concat(tableToolbarDeleteColor, ")"), 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.IS_RESIZING, ClassName.ROW_CONTROLS, HeaderButtonHover(), HeaderButtonDanger(), ClassName.NUMBERED_COLUMN, akEditorTableToolbarSize - 1, akEditorTableToolbarSize, akEditorTableNumberColumnWidth + 1, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderColor(props), relativeFontSizeToBase16(fontSize()), tableToolbarColor(props), tableTextColor(props), tableBorderColor(props), tableBorderColor(props), ClassName.WITH_CONTROLS, ClassName.CORNER_CONTROLS, ClassName.ROW_CONTROLS, ClassName.NUMBERED_COLUMN, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, "var(--ds-background-selected, ".concat(tableToolbarSelectedColor, ")"), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.IS_RESIZING, ClassName.WITH_CONTROLS, ClassName.NUMBERED_COLUMN_BUTTON, ClassName.NUMBERED_COLUMN_BUTTON, tableBorderSelectedColor, tableBorderSelectedColor, "var(--ds-background-selected, ".concat(tableToolbarSelectedColor, ")"), akEditorUnitZIndex, "var(--ds-text-selected, ".concat(N0, ")"), ClassName.NUMBERED_COLUMN_BUTTON, ClassName.HOVERED_CELL_IN_DANGER, "var(--ds-background-danger, ".concat(tableToolbarDeleteColor, ")"), tableBorderDeleteColor, "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, ClassName.SELECTED_CELL, tableCellSelectedColor, akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, ClassName.HOVERED_CELL_IN_DANGER, tableCellDeleteColor, akEditorUnitZIndex * 100, ClassName.HOVERED_CELL, ClassName.SELECTED_CELL, tableBorderSelectedColor, akEditorSmallZIndex, ClassName.HOVERED_CELL_IN_DANGER, tableBorderDeleteColor, akEditorUnitZIndex * 100, ClassName.ROW_CONTROLS_WRAPPER, tableMarginTop - cornerControlHeight + 1, ClassName.ROW_CONTROLS_WRAPPER, ClassName.TABLE_LEFT_SHADOW, akEditorUnitZIndex, ClassName.ROW_CONTROLS_WRAPPER, tableToolbarSize, ClassName.TABLE_NODE_WRAPPER, insertColumnButtonOffset, insertColumnButtonOffset, tableScrollbarOffset, tableScrollbarOffset, ClassName.IS_RESIZING, ClassName.TABLE_NODE_WRAPPER, scrollbarStyles, ClassName.RESIZE_CURSOR, props !== null && props !== void 0 && (_props$featureFlags2 = props.featureFlags) !== null && _props$featureFlags2 !== void 0 && _props$featureFlags2.restartNumberedLists ? "" : listLargeNumericMarkersOldStyles);
31
31
  };
32
- export var tableFullPageEditorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n width: 100%;\n }\n"])), ClassName.TABLE_NODE_WRAPPER);
32
+ export var tableFullPageEditorStyles = css(_templateObject2 || (_templateObject2 = _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);
33
33
  export var tableCommentEditorStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .ProseMirror .", " > table {\n margin-left: 0;\n margin-right: 0;\n ", ";\n }\n"])), ClassName.TABLE_NODE_WRAPPER, scrollbarStyles);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "sideEffects": false
5
5
  }