@atlaskit/editor-plugin-table 7.21.0 → 7.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 7.21.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 7.21.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#121046](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121046)
14
+ [`828e8f6bec2b3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/828e8f6bec2b3) -
15
+ [ux] ED-17789 Fixing last column resizing to right fast
16
+ - Updated dependencies
17
+
3
18
  ## 7.21.0
4
19
 
5
20
  ### Minor Changes
@@ -75,7 +75,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
75
75
  start: start,
76
76
  domAtPos: domAtPos,
77
77
  isTableScalingEnabled: shouldScale,
78
- shouldUseIncreasedScalingPercent: isTableScalingWithFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent')
78
+ shouldUseIncreasedScalingPercent: isTableScalingWithFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.fg)('platform.editor.table.use-increased-scaling-percent')
79
79
  });
80
80
  if ((0, _commands.evenColumns)({
81
81
  resizeState: resizeState,
@@ -152,7 +152,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
152
152
  _shouldScale = _shouldScale && originalTable.attrs.displayMode !== 'fixed';
153
153
  }
154
154
  var resizedDelta = clientX - startX;
155
- var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
155
+ var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.fg)('platform.editor.table.use-increased-scaling-percent');
156
156
  if (isNewColumnResizingEnabled && !(0, _utils2.isTableNested)(state, tablePos)) {
157
157
  var newResizeState = (0, _utils3.resizeColumnAndTable)(resizeState, colIndex, resizedDelta, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, _shouldScale,
158
158
  // isTableScalingEnabled
@@ -241,17 +241,18 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
241
241
  resizeHandlePos = _getPluginState2.resizeHandlePos;
242
242
  var _getTablePluginState3 = (0, _pluginFactory.getPluginState)(state),
243
243
  isTableHovered = _getTablePluginState3.isTableHovered;
244
- if (!which || !dragging || resizeHandlePos === null || !(0, _utils3.pointsAtCell)(state.doc.resolve(resizeHandlePos)) || !isTableHovered) {
244
+ var tablePos = state.doc.resolve(start).start(-1);
245
+ if (!which || !dragging || resizeHandlePos === null || !(0, _utils3.pointsAtCell)(state.doc.resolve(resizeHandlePos)) || (!isNewColumnResizingEnabled || (0, _utils2.isTableNested)(state, tablePos)) && !isTableHovered) {
245
246
  return finish(event);
246
247
  }
247
248
  var $cell = state.doc.resolve(resizeHandlePos);
248
249
  var table = $cell.node(-1);
249
- var tablePos = state.doc.resolve(start).start(-1);
250
+ // const tablePos = state.doc.resolve(start).start(-1);
250
251
  var tableDepth = state.doc.resolve(tablePos).depth;
251
252
  var map = _tableMap.TableMap.get(table);
252
253
  var colIndex = map.colCount($cell.pos - $cell.start(-1)) + $cell.nodeAfter.attrs.colspan - 1;
253
254
  var shouldScale = tableDepth === 0 && isTableScalingEnabled;
254
- var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
255
+ var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.fg)('platform.editor.table.use-increased-scaling-percent');
255
256
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
256
257
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
257
258
  }
@@ -2,7 +2,7 @@ import { ACTION_SUBJECT, CHANGE_ALIGNMENT_REASON, EVENT_TYPE, INPUT_METHOD, TABL
2
2
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
3
3
  import { TableMap } from '@atlaskit/editor-tables/table-map';
4
4
  import { getSelectionRect } from '@atlaskit/editor-tables/utils';
5
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
6
6
  import { stopKeyboardColumnResizing } from '../../commands/column-resize';
7
7
  import { updateResizeHandleDecorations } from '../../commands/misc';
8
8
  import { updateColumnWidths } from '../../transforms';
@@ -69,7 +69,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
69
69
  start,
70
70
  domAtPos,
71
71
  isTableScalingEnabled: shouldScale,
72
- shouldUseIncreasedScalingPercent: isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent')
72
+ shouldUseIncreasedScalingPercent: isTableScalingWithFixedColumnWidthsOptionEnabled && fg('platform.editor.table.use-increased-scaling-percent')
73
73
  });
74
74
  if (evenColumns({
75
75
  resizeState,
@@ -156,7 +156,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
156
156
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
157
157
  }
158
158
  const resizedDelta = clientX - startX;
159
- const shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
159
+ const shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && fg('platform.editor.table.use-increased-scaling-percent');
160
160
  if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
161
161
  const newResizeState = resizeColumnAndTable(resizeState, colIndex, resizedDelta, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, shouldScale,
162
162
  // isTableScalingEnabled
@@ -252,17 +252,18 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
252
252
  const {
253
253
  isTableHovered
254
254
  } = getTablePluginState(state);
255
- if (!which || !dragging || resizeHandlePos === null || !pointsAtCell(state.doc.resolve(resizeHandlePos)) || !isTableHovered) {
255
+ const tablePos = state.doc.resolve(start).start(-1);
256
+ if (!which || !dragging || resizeHandlePos === null || !pointsAtCell(state.doc.resolve(resizeHandlePos)) || (!isNewColumnResizingEnabled || isTableNested(state, tablePos)) && !isTableHovered) {
256
257
  return finish(event);
257
258
  }
258
259
  const $cell = state.doc.resolve(resizeHandlePos);
259
260
  const table = $cell.node(-1);
260
- const tablePos = state.doc.resolve(start).start(-1);
261
+ // const tablePos = state.doc.resolve(start).start(-1);
261
262
  const tableDepth = state.doc.resolve(tablePos).depth;
262
263
  const map = TableMap.get(table);
263
264
  const colIndex = map.colCount($cell.pos - $cell.start(-1)) + $cell.nodeAfter.attrs.colspan - 1;
264
265
  let shouldScale = tableDepth === 0 && isTableScalingEnabled;
265
- const shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
266
+ const shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && fg('platform.editor.table.use-increased-scaling-percent');
266
267
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
267
268
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
268
269
  }
@@ -5,7 +5,7 @@ import { ACTION_SUBJECT, CHANGE_ALIGNMENT_REASON, EVENT_TYPE, INPUT_METHOD, TABL
5
5
  import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
6
6
  import { TableMap } from '@atlaskit/editor-tables/table-map';
7
7
  import { getSelectionRect } from '@atlaskit/editor-tables/utils';
8
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { stopKeyboardColumnResizing } from '../../commands/column-resize';
10
10
  import { updateResizeHandleDecorations } from '../../commands/misc';
11
11
  import { updateColumnWidths } from '../../transforms';
@@ -68,7 +68,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
68
68
  start: start,
69
69
  domAtPos: domAtPos,
70
70
  isTableScalingEnabled: shouldScale,
71
- shouldUseIncreasedScalingPercent: isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent')
71
+ shouldUseIncreasedScalingPercent: isTableScalingWithFixedColumnWidthsOptionEnabled && fg('platform.editor.table.use-increased-scaling-percent')
72
72
  });
73
73
  if (evenColumns({
74
74
  resizeState: resizeState,
@@ -145,7 +145,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
145
145
  _shouldScale = _shouldScale && originalTable.attrs.displayMode !== 'fixed';
146
146
  }
147
147
  var resizedDelta = clientX - startX;
148
- var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
148
+ var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && fg('platform.editor.table.use-increased-scaling-percent');
149
149
  if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
150
150
  var newResizeState = resizeColumnAndTable(resizeState, colIndex, resizedDelta, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, _shouldScale,
151
151
  // isTableScalingEnabled
@@ -234,17 +234,18 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
234
234
  resizeHandlePos = _getPluginState2.resizeHandlePos;
235
235
  var _getTablePluginState3 = getTablePluginState(state),
236
236
  isTableHovered = _getTablePluginState3.isTableHovered;
237
- if (!which || !dragging || resizeHandlePos === null || !pointsAtCell(state.doc.resolve(resizeHandlePos)) || !isTableHovered) {
237
+ var tablePos = state.doc.resolve(start).start(-1);
238
+ if (!which || !dragging || resizeHandlePos === null || !pointsAtCell(state.doc.resolve(resizeHandlePos)) || (!isNewColumnResizingEnabled || isTableNested(state, tablePos)) && !isTableHovered) {
238
239
  return finish(event);
239
240
  }
240
241
  var $cell = state.doc.resolve(resizeHandlePos);
241
242
  var table = $cell.node(-1);
242
- var tablePos = state.doc.resolve(start).start(-1);
243
+ // const tablePos = state.doc.resolve(start).start(-1);
243
244
  var tableDepth = state.doc.resolve(tablePos).depth;
244
245
  var map = TableMap.get(table);
245
246
  var colIndex = map.colCount($cell.pos - $cell.start(-1)) + $cell.nodeAfter.attrs.colspan - 1;
246
247
  var shouldScale = tableDepth === 0 && isTableScalingEnabled;
247
- var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
248
+ var shouldUseIncreasedScalingPercent = isTableScalingWithFixedColumnWidthsOptionEnabled && fg('platform.editor.table.use-increased-scaling-percent');
248
249
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
249
250
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
250
251
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "7.21.0",
3
+ "version": "7.21.2",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,9 +29,9 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@atlaskit/adf-schema": "^39.0.3",
32
- "@atlaskit/button": "^18.4.0",
32
+ "@atlaskit/button": "^19.0.0",
33
33
  "@atlaskit/custom-steps": "^0.4.0",
34
- "@atlaskit/editor-common": "^86.1.0",
34
+ "@atlaskit/editor-common": "^86.2.0",
35
35
  "@atlaskit/editor-palette": "1.6.0",
36
36
  "@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.4.0",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/primitives": "^11.0.0",
53
53
  "@atlaskit/theme": "^12.11.0",
54
54
  "@atlaskit/toggle": "^13.2.0",
55
- "@atlaskit/tokens": "^1.55.0",
55
+ "@atlaskit/tokens": "^1.56.0",
56
56
  "@atlaskit/tooltip": "^18.5.0",
57
57
  "@babel/runtime": "^7.0.0",
58
58
  "@emotion/react": "^11.7.1",
@@ -13,7 +13,7 @@ import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/e
13
13
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
14
14
  import { TableMap } from '@atlaskit/editor-tables/table-map';
15
15
  import { getSelectionRect } from '@atlaskit/editor-tables/utils';
16
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
16
+ import { fg } from '@atlaskit/platform-feature-flags';
17
17
 
18
18
  import { stopKeyboardColumnResizing } from '../../commands/column-resize';
19
19
  import { updateResizeHandleDecorations } from '../../commands/misc';
@@ -112,7 +112,7 @@ export const handleMouseDown = (
112
112
  isTableScalingEnabled: shouldScale,
113
113
  shouldUseIncreasedScalingPercent:
114
114
  isTableScalingWithFixedColumnWidthsOptionEnabled &&
115
- getBooleanFF('platform.editor.table.use-increased-scaling-percent'),
115
+ fg('platform.editor.table.use-increased-scaling-percent'),
116
116
  });
117
117
 
118
118
  if (
@@ -200,7 +200,7 @@ export const handleMouseDown = (
200
200
  const resizedDelta = clientX - startX;
201
201
  const shouldUseIncreasedScalingPercent =
202
202
  isTableScalingWithFixedColumnWidthsOptionEnabled &&
203
- getBooleanFF('platform.editor.table.use-increased-scaling-percent');
203
+ fg('platform.editor.table.use-increased-scaling-percent');
204
204
  if (isNewColumnResizingEnabled && !isTableNested(state, tablePos)) {
205
205
  const newResizeState = resizeColumnAndTable(
206
206
  resizeState,
@@ -311,19 +311,21 @@ export const handleMouseDown = (
311
311
  const { state } = view;
312
312
  const { dragging, resizeHandlePos } = getPluginState(state);
313
313
  const { isTableHovered } = getTablePluginState(state);
314
+ const tablePos = state.doc.resolve(start).start(-1);
315
+
314
316
  if (
315
317
  !which ||
316
318
  !dragging ||
317
319
  resizeHandlePos === null ||
318
320
  !pointsAtCell(state.doc.resolve(resizeHandlePos)) ||
319
- !isTableHovered
321
+ ((!isNewColumnResizingEnabled || isTableNested(state, tablePos)) && !isTableHovered)
320
322
  ) {
321
323
  return finish(event);
322
324
  }
323
325
 
324
326
  const $cell = state.doc.resolve(resizeHandlePos);
325
327
  const table = $cell.node(-1);
326
- const tablePos = state.doc.resolve(start).start(-1);
328
+ // const tablePos = state.doc.resolve(start).start(-1);
327
329
  const tableDepth = state.doc.resolve(tablePos).depth;
328
330
  const map = TableMap.get(table);
329
331
  const colIndex = map.colCount($cell.pos - $cell.start(-1)) + $cell.nodeAfter!.attrs.colspan - 1;
@@ -332,7 +334,7 @@ export const handleMouseDown = (
332
334
 
333
335
  const shouldUseIncreasedScalingPercent =
334
336
  isTableScalingWithFixedColumnWidthsOptionEnabled &&
335
- getBooleanFF('platform.editor.table.use-increased-scaling-percent');
337
+ fg('platform.editor.table.use-increased-scaling-percent');
336
338
  if (isTableScalingWithFixedColumnWidthsOptionEnabled) {
337
339
  shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
338
340
  }