@atlaskit/editor-plugin-table 37.0.2 → 38.0.0

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,21 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 38.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c0f0f6750f0b5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0f0f6750f0b5) -
8
+ Clean up experiment `platform_editor_table_menu_updates_patch_5`
9
+ - [`daf8bd93659e4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/daf8bd93659e4) -
10
+ Clean up experiment `platform_editor_fix_table_move_shortcut`
11
+ - Updated dependencies
12
+
13
+ ## 37.0.3
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+
3
19
  ## 37.0.2
4
20
 
5
21
  ### Patch Changes
@@ -23,7 +23,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
23
23
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
24
24
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
25
25
  var _tableMap = require("@atlaskit/editor-tables/table-map");
26
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
27
26
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
28
27
  var _createPluginConfig = require("../pm-plugins/create-plugin-config");
29
28
  var _pluginFactory = require("../pm-plugins/plugin-factory");
@@ -149,7 +148,7 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
149
148
  if (node && this.table && !node.contains(this.table)) {
150
149
  // Patch to prevent selection collapsing when moving the table down with ctrl + shift + down
151
150
  var selectionBeforeMove = this.view.state.selection;
152
- var shouldPreserveCellSelection = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_fix_table_move_shortcut') && selectionBeforeMove instanceof _cellSelection.CellSelection;
151
+ var shouldPreserveCellSelection = selectionBeforeMove instanceof _cellSelection.CellSelection;
153
152
 
154
153
  // Store the current ignoreMutation handler so we can restore it later
155
154
  oldIgnoreMutation = this.ignoreMutation;
@@ -14,7 +14,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
14
14
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
15
15
  var _tableMap = require("@atlaskit/editor-tables/table-map");
16
16
  var _utils2 = require("@atlaskit/editor-tables/utils");
17
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
18
17
  var _types = require("../../types");
19
18
  var _plugin = require("../decorations/plugin");
20
19
  var _columnResizing = require("../decorations/utils/column-resizing");
@@ -422,12 +421,7 @@ var selectColumn = exports.selectColumn = function selectColumn(column, expand)
422
421
  if (!cells || !cells.length || typeof cells[0].pos !== 'number') {
423
422
  return false;
424
423
  }
425
- var selectionTransaction;
426
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_menu_updates_patch_5')) {
427
- selectionTransaction = selectColumnWithMergedEdgeRows(state.tr, column, expand);
428
- } else {
429
- selectionTransaction = (0, _utils2.selectColumn)(column, expand)(state.tr);
430
- }
424
+ var selectionTransaction = selectColumnWithMergedEdgeRows(state.tr, column, expand);
431
425
  var decorations = (0, _decoration.createColumnSelectedDecoration)(selectionTransaction);
432
426
  var decorationSet = (0, _updatePluginStateDecorations.updatePluginStateDecorations)(state, decorations, _types.TableDecorations.COLUMN_SELECTED);
433
427
  var targetCellPosition = cells[0].pos;
@@ -439,12 +433,7 @@ var selectColumn = exports.selectColumn = function selectColumn(column, expand)
439
433
  }
440
434
  };
441
435
  }, function (tr) {
442
- var selectionTransaction;
443
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_menu_updates_patch_5')) {
444
- selectionTransaction = selectColumnWithMergedEdgeRows(tr, column, expand);
445
- } else {
446
- selectionTransaction = (0, _utils2.selectColumn)(column, expand)(tr);
447
- }
436
+ var selectionTransaction = selectColumnWithMergedEdgeRows(tr, column, expand);
448
437
  return selectionTransaction.setMeta('addToHistory', false).setMeta('selectedColumnViaKeyboard', triggeredByKeyboard);
449
438
  });
450
439
  };
@@ -7,7 +7,6 @@ exports.isRowSelectionWithMergedFirstColumn = exports.isFullRowOrColumnSelected
7
7
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
8
8
  var _tableMap = require("@atlaskit/editor-tables/table-map");
9
9
  var _utils = require("@atlaskit/editor-tables/utils");
10
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
11
10
  var getSelectedColumnIndexes = exports.getSelectedColumnIndexes = function getSelectedColumnIndexes(selectionRect) {
12
11
  var columnIndexes = [];
13
12
  for (var i = selectionRect.left; i < selectionRect.right; i++) {
@@ -119,10 +118,5 @@ var isFullRowOrColumnSelected = exports.isFullRowOrColumnSelected = function isF
119
118
  if (!(selection instanceof _cellSelection.CellSelection)) {
120
119
  return false;
121
120
  }
122
- var isExistingFullRowOrColumnSelection = selection.isRowSelection() || selection.isColSelection() || isRowSelectionWithMergedFirstColumn(selection) || isColumnSelectionWithMergedFirstRow(selection);
123
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_menu_updates_patch_5')) {
124
- return isExistingFullRowOrColumnSelection || isColumnSelectionWithMergedLastRow(selection);
125
- } else {
126
- return isExistingFullRowOrColumnSelection;
127
- }
121
+ return selection.isRowSelection() || selection.isColSelection() || isRowSelectionWithMergedFirstColumn(selection) || isColumnSelectionWithMergedFirstRow(selection) || isColumnSelectionWithMergedLastRow(selection);
128
122
  };
@@ -12,7 +12,6 @@ var _styles = require("@atlaskit/editor-common/styles");
12
12
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
13
13
  var _editorTables = require("@atlaskit/editor-tables");
14
14
  var _utils = require("@atlaskit/editor-tables/utils");
15
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
16
15
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
17
16
  var _commands = require("../../../pm-plugins/commands");
18
17
  var _commandsWithAnalytics = require("../../../pm-plugins/drag-and-drop/commands-with-analytics");
@@ -29,12 +28,7 @@ var getSelectedColumns = function getSelectedColumns(selection) {
29
28
  return [];
30
29
  }
31
30
  if ((0, _expValEquals.expValEquals)('platform_editor_table_menu_updates', 'isEnabled', true)) {
32
- var isColumnSelection;
33
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_menu_updates_patch_5')) {
34
- isColumnSelection = selection.isColSelection() || (0, _selection.isColumnSelectionWithMergedFirstRow)(selection) || (0, _selection.isColumnSelectionWithMergedLastRow)(selection);
35
- } else {
36
- isColumnSelection = selection.isColSelection() || (0, _selection.isColumnSelectionWithMergedFirstRow)(selection);
37
- }
31
+ var isColumnSelection = selection.isColSelection() || (0, _selection.isColumnSelectionWithMergedFirstRow)(selection) || (0, _selection.isColumnSelectionWithMergedLastRow)(selection);
38
32
  if (!isColumnSelection) {
39
33
  return [];
40
34
  }
@@ -90,12 +84,7 @@ var ColumnControls = exports.ColumnControls = function ColumnControls(_ref) {
90
84
  var columnParams = (0, _rowControls.getRowsParams)(colWidths !== null && colWidths !== void 0 ? colWidths : []);
91
85
  var colIndex = hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex;
92
86
  var selectedColIndexes = getSelectedColumns(selection || editorView.state.selection);
93
- var renderedSelectedColIndexes;
94
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_table_menu_updates_patch_5')) {
95
- renderedSelectedColIndexes = (activeTableMenu === null || activeTableMenu === void 0 ? void 0 : activeTableMenu.type) === 'column' ? [activeTableMenu.index] : selectedColIndexes;
96
- } else {
97
- renderedSelectedColIndexes = selectedColIndexes;
98
- }
87
+ var renderedSelectedColIndexes = (activeTableMenu === null || activeTableMenu === void 0 ? void 0 : activeTableMenu.type) === 'column' ? [activeTableMenu.index] : selectedColIndexes;
99
88
  var firstRow = tableRef.querySelector('tr');
100
89
  var hasHeaderRow = firstRow ? firstRow.getAttribute('data-header-row') : false;
101
90
  var rowControlStickyTop = 45;
@@ -9,7 +9,6 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
9
9
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
10
10
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
11
11
  import { TableMap } from '@atlaskit/editor-tables/table-map';
12
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
13
12
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
14
13
  import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
15
14
  import { getPluginState } from '../pm-plugins/plugin-factory';
@@ -119,7 +118,7 @@ export default class TableView extends ReactNodeView {
119
118
  if (node && this.table && !node.contains(this.table)) {
120
119
  // Patch to prevent selection collapsing when moving the table down with ctrl + shift + down
121
120
  const selectionBeforeMove = this.view.state.selection;
122
- const shouldPreserveCellSelection = isExperimentEnabled('platform_editor_fix_table_move_shortcut') && selectionBeforeMove instanceof CellSelection;
121
+ const shouldPreserveCellSelection = selectionBeforeMove instanceof CellSelection;
123
122
 
124
123
  // Store the current ignoreMutation handler so we can restore it later
125
124
  oldIgnoreMutation = this.ignoreMutation;
@@ -5,7 +5,6 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
6
6
  import { TableMap } from '@atlaskit/editor-tables/table-map';
7
7
  import { findCellClosestToPos, findTable, getCellsInColumn, getCellsInRow, getSelectionRect, isSelectionType, isTableSelected, removeTable, selectColumns as selectColumnsTransform, selectColumn as selectColumnTransform, selectionCell, selectRows as selectRowsTransform, selectRow as selectRowTransform, setCellAttrs } from '@atlaskit/editor-tables/utils';
8
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
9
8
  import { TableCssClassName as ClassName, TableDecorations } from '../../types';
10
9
  import { getDecorations } from '../decorations/plugin';
11
10
  import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils/column-resizing';
@@ -428,12 +427,7 @@ export const selectColumn = (column, expand, triggeredByKeyboard = false) => cre
428
427
  if (!cells || !cells.length || typeof cells[0].pos !== 'number') {
429
428
  return false;
430
429
  }
431
- let selectionTransaction;
432
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
433
- selectionTransaction = selectColumnWithMergedEdgeRows(state.tr, column, expand);
434
- } else {
435
- selectionTransaction = selectColumnTransform(column, expand)(state.tr);
436
- }
430
+ const selectionTransaction = selectColumnWithMergedEdgeRows(state.tr, column, expand);
437
431
  const decorations = createColumnSelectedDecoration(selectionTransaction);
438
432
  const decorationSet = updatePluginStateDecorations(state, decorations, TableDecorations.COLUMN_SELECTED);
439
433
  const targetCellPosition = cells[0].pos;
@@ -445,12 +439,7 @@ export const selectColumn = (column, expand, triggeredByKeyboard = false) => cre
445
439
  }
446
440
  };
447
441
  }, tr => {
448
- let selectionTransaction;
449
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
450
- selectionTransaction = selectColumnWithMergedEdgeRows(tr, column, expand);
451
- } else {
452
- selectionTransaction = selectColumnTransform(column, expand)(tr);
453
- }
442
+ const selectionTransaction = selectColumnWithMergedEdgeRows(tr, column, expand);
454
443
  return selectionTransaction.setMeta('addToHistory', false).setMeta('selectedColumnViaKeyboard', triggeredByKeyboard);
455
444
  });
456
445
  export const selectColumns = columnIndexes => createCommand(state => {
@@ -1,7 +1,6 @@
1
1
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
2
2
  import { TableMap } from '@atlaskit/editor-tables/table-map';
3
3
  import { findTableClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
4
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
5
4
  export const getSelectedColumnIndexes = selectionRect => {
6
5
  const columnIndexes = [];
7
6
  for (let i = selectionRect.left; i < selectionRect.right; i++) {
@@ -113,10 +112,5 @@ export const isFullRowOrColumnSelected = selection => {
113
112
  if (!(selection instanceof CellSelection)) {
114
113
  return false;
115
114
  }
116
- const isExistingFullRowOrColumnSelection = selection.isRowSelection() || selection.isColSelection() || isRowSelectionWithMergedFirstColumn(selection) || isColumnSelectionWithMergedFirstRow(selection);
117
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
118
- return isExistingFullRowOrColumnSelection || isColumnSelectionWithMergedLastRow(selection);
119
- } else {
120
- return isExistingFullRowOrColumnSelection;
121
- }
115
+ return selection.isRowSelection() || selection.isColSelection() || isRowSelectionWithMergedFirstColumn(selection) || isColumnSelectionWithMergedFirstRow(selection) || isColumnSelectionWithMergedLastRow(selection);
122
116
  };
@@ -7,7 +7,6 @@ import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
7
7
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
8
8
  import { CellSelection } from '@atlaskit/editor-tables';
9
9
  import { getSelectionRect } from '@atlaskit/editor-tables/utils';
10
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
11
10
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
11
  import { clearHoverSelection, hoverCell, hoverColumns, selectColumn, selectColumns, toggleActiveTableMenu } from '../../../pm-plugins/commands';
13
12
  import { toggleDragMenuWithAnalytics } from '../../../pm-plugins/drag-and-drop/commands-with-analytics';
@@ -21,12 +20,7 @@ const getSelectedColumns = selection => {
21
20
  return [];
22
21
  }
23
22
  if (expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
24
- let isColumnSelection;
25
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
26
- isColumnSelection = selection.isColSelection() || isColumnSelectionWithMergedFirstRow(selection) || isColumnSelectionWithMergedLastRow(selection);
27
- } else {
28
- isColumnSelection = selection.isColSelection() || isColumnSelectionWithMergedFirstRow(selection);
29
- }
23
+ const isColumnSelection = selection.isColSelection() || isColumnSelectionWithMergedFirstRow(selection) || isColumnSelectionWithMergedLastRow(selection);
30
24
  if (!isColumnSelection) {
31
25
  return [];
32
26
  }
@@ -81,12 +75,7 @@ export const ColumnControls = ({
81
75
  const columnParams = getRowsParams(colWidths !== null && colWidths !== void 0 ? colWidths : []);
82
76
  const colIndex = hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex;
83
77
  const selectedColIndexes = getSelectedColumns(selection || editorView.state.selection);
84
- let renderedSelectedColIndexes;
85
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
86
- renderedSelectedColIndexes = (activeTableMenu === null || activeTableMenu === void 0 ? void 0 : activeTableMenu.type) === 'column' ? [activeTableMenu.index] : selectedColIndexes;
87
- } else {
88
- renderedSelectedColIndexes = selectedColIndexes;
89
- }
78
+ const renderedSelectedColIndexes = (activeTableMenu === null || activeTableMenu === void 0 ? void 0 : activeTableMenu.type) === 'column' ? [activeTableMenu.index] : selectedColIndexes;
90
79
  const firstRow = tableRef.querySelector('tr');
91
80
  const hasHeaderRow = firstRow ? firstRow.getAttribute('data-header-row') : false;
92
81
  const rowControlStickyTop = 45;
@@ -19,7 +19,6 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
19
19
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
20
20
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
21
21
  import { TableMap } from '@atlaskit/editor-tables/table-map';
22
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
23
22
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
24
23
  import { pluginConfig as getPluginConfig } from '../pm-plugins/create-plugin-config';
25
24
  import { getPluginState } from '../pm-plugins/plugin-factory';
@@ -142,7 +141,7 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
142
141
  if (node && this.table && !node.contains(this.table)) {
143
142
  // Patch to prevent selection collapsing when moving the table down with ctrl + shift + down
144
143
  var selectionBeforeMove = this.view.state.selection;
145
- var shouldPreserveCellSelection = isExperimentEnabled('platform_editor_fix_table_move_shortcut') && selectionBeforeMove instanceof CellSelection;
144
+ var shouldPreserveCellSelection = selectionBeforeMove instanceof CellSelection;
146
145
 
147
146
  // Store the current ignoreMutation handler so we can restore it later
148
147
  oldIgnoreMutation = this.ignoreMutation;
@@ -9,7 +9,6 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
9
9
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
10
10
  import { TableMap } from '@atlaskit/editor-tables/table-map';
11
11
  import { findCellClosestToPos, findTable, getCellsInColumn, getCellsInRow, getSelectionRect, isSelectionType, isTableSelected, removeTable, selectColumns as selectColumnsTransform, selectColumn as selectColumnTransform, selectionCell, selectRows as selectRowsTransform, selectRow as selectRowTransform, setCellAttrs } from '@atlaskit/editor-tables/utils';
12
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
13
12
  import { TableCssClassName as ClassName, TableDecorations } from '../../types';
14
13
  import { getDecorations } from '../decorations/plugin';
15
14
  import { buildColumnResizingDecorations, clearColumnResizingDecorations } from '../decorations/utils/column-resizing';
@@ -415,12 +414,7 @@ export var selectColumn = function selectColumn(column, expand) {
415
414
  if (!cells || !cells.length || typeof cells[0].pos !== 'number') {
416
415
  return false;
417
416
  }
418
- var selectionTransaction;
419
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
420
- selectionTransaction = selectColumnWithMergedEdgeRows(state.tr, column, expand);
421
- } else {
422
- selectionTransaction = selectColumnTransform(column, expand)(state.tr);
423
- }
417
+ var selectionTransaction = selectColumnWithMergedEdgeRows(state.tr, column, expand);
424
418
  var decorations = createColumnSelectedDecoration(selectionTransaction);
425
419
  var decorationSet = updatePluginStateDecorations(state, decorations, TableDecorations.COLUMN_SELECTED);
426
420
  var targetCellPosition = cells[0].pos;
@@ -432,12 +426,7 @@ export var selectColumn = function selectColumn(column, expand) {
432
426
  }
433
427
  };
434
428
  }, function (tr) {
435
- var selectionTransaction;
436
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
437
- selectionTransaction = selectColumnWithMergedEdgeRows(tr, column, expand);
438
- } else {
439
- selectionTransaction = selectColumnTransform(column, expand)(tr);
440
- }
429
+ var selectionTransaction = selectColumnWithMergedEdgeRows(tr, column, expand);
441
430
  return selectionTransaction.setMeta('addToHistory', false).setMeta('selectedColumnViaKeyboard', triggeredByKeyboard);
442
431
  });
443
432
  };
@@ -1,7 +1,6 @@
1
1
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
2
2
  import { TableMap } from '@atlaskit/editor-tables/table-map';
3
3
  import { findTableClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
4
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
5
4
  export var getSelectedColumnIndexes = function getSelectedColumnIndexes(selectionRect) {
6
5
  var columnIndexes = [];
7
6
  for (var i = selectionRect.left; i < selectionRect.right; i++) {
@@ -113,10 +112,5 @@ export var isFullRowOrColumnSelected = function isFullRowOrColumnSelected(select
113
112
  if (!(selection instanceof CellSelection)) {
114
113
  return false;
115
114
  }
116
- var isExistingFullRowOrColumnSelection = selection.isRowSelection() || selection.isColSelection() || isRowSelectionWithMergedFirstColumn(selection) || isColumnSelectionWithMergedFirstRow(selection);
117
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
118
- return isExistingFullRowOrColumnSelection || isColumnSelectionWithMergedLastRow(selection);
119
- } else {
120
- return isExistingFullRowOrColumnSelection;
121
- }
115
+ return selection.isRowSelection() || selection.isColSelection() || isRowSelectionWithMergedFirstColumn(selection) || isColumnSelectionWithMergedFirstRow(selection) || isColumnSelectionWithMergedLastRow(selection);
122
116
  };
@@ -7,7 +7,6 @@ import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
7
7
  import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
8
8
  import { CellSelection } from '@atlaskit/editor-tables';
9
9
  import { getSelectionRect } from '@atlaskit/editor-tables/utils';
10
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
11
10
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
11
  import { clearHoverSelection, hoverCell, hoverColumns, selectColumn, selectColumns, toggleActiveTableMenu } from '../../../pm-plugins/commands';
13
12
  import { toggleDragMenuWithAnalytics } from '../../../pm-plugins/drag-and-drop/commands-with-analytics';
@@ -21,12 +20,7 @@ var getSelectedColumns = function getSelectedColumns(selection) {
21
20
  return [];
22
21
  }
23
22
  if (expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
24
- var isColumnSelection;
25
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
26
- isColumnSelection = selection.isColSelection() || isColumnSelectionWithMergedFirstRow(selection) || isColumnSelectionWithMergedLastRow(selection);
27
- } else {
28
- isColumnSelection = selection.isColSelection() || isColumnSelectionWithMergedFirstRow(selection);
29
- }
23
+ var isColumnSelection = selection.isColSelection() || isColumnSelectionWithMergedFirstRow(selection) || isColumnSelectionWithMergedLastRow(selection);
30
24
  if (!isColumnSelection) {
31
25
  return [];
32
26
  }
@@ -82,12 +76,7 @@ export var ColumnControls = function ColumnControls(_ref) {
82
76
  var columnParams = getRowsParams(colWidths !== null && colWidths !== void 0 ? colWidths : []);
83
77
  var colIndex = hoveredCell === null || hoveredCell === void 0 ? void 0 : hoveredCell.colIndex;
84
78
  var selectedColIndexes = getSelectedColumns(selection || editorView.state.selection);
85
- var renderedSelectedColIndexes;
86
- if (isExperimentEnabled('platform_editor_table_menu_updates_patch_5')) {
87
- renderedSelectedColIndexes = (activeTableMenu === null || activeTableMenu === void 0 ? void 0 : activeTableMenu.type) === 'column' ? [activeTableMenu.index] : selectedColIndexes;
88
- } else {
89
- renderedSelectedColIndexes = selectedColIndexes;
90
- }
79
+ var renderedSelectedColIndexes = (activeTableMenu === null || activeTableMenu === void 0 ? void 0 : activeTableMenu.type) === 'column' ? [activeTableMenu.index] : selectedColIndexes;
91
80
  var firstRow = tableRef.querySelector('tr');
92
81
  var hasHeaderRow = firstRow ? firstRow.getAttribute('data-header-row') : false;
93
82
  var rowControlStickyTop = 45;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "37.0.2",
3
+ "version": "38.0.0",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,20 +24,20 @@
24
24
  "@atlaskit/button": "^25.4.0",
25
25
  "@atlaskit/custom-steps": "^1.1.0",
26
26
  "@atlaskit/editor-palette": "^3.5.0",
27
- "@atlaskit/editor-plugin-accessibility-utils": "^25.0.0",
28
- "@atlaskit/editor-plugin-analytics": "^25.0.0",
29
- "@atlaskit/editor-plugin-batch-attribute-updates": "^25.0.0",
30
- "@atlaskit/editor-plugin-content-insertion": "^25.0.0",
31
- "@atlaskit/editor-plugin-editor-viewmode": "^27.0.0",
32
- "@atlaskit/editor-plugin-extension": "28.0.2",
33
- "@atlaskit/editor-plugin-guideline": "^25.0.0",
34
- "@atlaskit/editor-plugin-interaction": "^39.0.0",
35
- "@atlaskit/editor-plugin-limited-mode": "^22.0.0",
36
- "@atlaskit/editor-plugin-selection": "^25.0.0",
37
- "@atlaskit/editor-plugin-toolbar": "^22.0.0",
38
- "@atlaskit/editor-plugin-ui-control-registry": "^19.0.0",
39
- "@atlaskit/editor-plugin-user-intent": "^23.0.0",
40
- "@atlaskit/editor-plugin-width": "^26.0.0",
27
+ "@atlaskit/editor-plugin-accessibility-utils": "^26.0.0",
28
+ "@atlaskit/editor-plugin-analytics": "^26.0.0",
29
+ "@atlaskit/editor-plugin-batch-attribute-updates": "^26.0.0",
30
+ "@atlaskit/editor-plugin-content-insertion": "^26.0.0",
31
+ "@atlaskit/editor-plugin-editor-viewmode": "^28.0.0",
32
+ "@atlaskit/editor-plugin-extension": "29.0.0",
33
+ "@atlaskit/editor-plugin-guideline": "^26.0.0",
34
+ "@atlaskit/editor-plugin-interaction": "^40.0.0",
35
+ "@atlaskit/editor-plugin-limited-mode": "^23.0.0",
36
+ "@atlaskit/editor-plugin-selection": "^26.0.0",
37
+ "@atlaskit/editor-plugin-toolbar": "^23.0.0",
38
+ "@atlaskit/editor-plugin-ui-control-registry": "^20.0.0",
39
+ "@atlaskit/editor-plugin-user-intent": "^24.0.0",
40
+ "@atlaskit/editor-plugin-width": "^27.0.0",
41
41
  "@atlaskit/editor-prosemirror": "^9.0.0",
42
42
  "@atlaskit/editor-shared-styles": "^4.3.0",
43
43
  "@atlaskit/editor-tables": "^3.2.0",
@@ -53,9 +53,9 @@
53
53
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^3.2.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop-hitbox": "^3.0.0",
55
55
  "@atlaskit/primitives": "^22.5.0",
56
- "@atlaskit/tmp-editor-statsig": "^226.0.0",
56
+ "@atlaskit/tmp-editor-statsig": "^227.0.0",
57
57
  "@atlaskit/toggle": "^17.3.0",
58
- "@atlaskit/tokens": "^20.3.0",
58
+ "@atlaskit/tokens": "^20.4.0",
59
59
  "@atlaskit/tooltip": "^24.4.0",
60
60
  "@babel/runtime": "^7.0.0",
61
61
  "@compiled/react": "^1.0.2",
@@ -68,7 +68,7 @@
68
68
  "uuid": "^11.1.1"
69
69
  },
70
70
  "peerDependencies": {
71
- "@atlaskit/editor-common": "^129.1.0",
71
+ "@atlaskit/editor-common": "^130.0.0",
72
72
  "react": "^18.2.0 || ^19.2.0",
73
73
  "react-dom": "^18.2.0 || ^19.2.0",
74
74
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"