@atlaskit/editor-plugin-table 10.6.1 → 10.6.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,13 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 10.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#136562](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/136562)
8
+ [`5d68129d8e4e0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d68129d8e4e0) -
9
+ ED-26726 Cleaned up platform_editor_nested_tables_resize_border_fix
10
+
3
11
  ## 10.6.1
4
12
 
5
13
  ### Patch Changes
@@ -17,7 +17,6 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
17
17
  var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
18
18
  var _tableMap = require("@atlaskit/editor-tables/table-map");
19
19
  var _utils3 = require("@atlaskit/editor-tables/utils");
20
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
20
  var _commands = require("../pm-plugins/commands");
22
21
  var _pluginFactory = require("../pm-plugins/drag-and-drop/plugin-factory");
23
22
  var _pluginFactory2 = require("../pm-plugins/plugin-factory");
@@ -158,14 +157,8 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, m
158
157
  var nearestTable = (0, _utils.closestElement)(target, 'table');
159
158
  var nestedTable = (0, _utils2.findParentNodeOfTypeClosestToPos)(state.doc.resolve(state.selection.from), [state.schema.nodes.table]);
160
159
  var parentTable = (0, _utils2.findParentNodeOfTypeClosestToPos)(state.doc.resolve((nestedTable === null || nestedTable === void 0 ? void 0 : nestedTable.pos) || 0), [state.schema.nodes.table]);
161
- if ((0, _platformFeatureFlags.fg)('platform_editor_nested_tables_resize_border_fix')) {
162
- if ((nearestTable === null || nearestTable === void 0 ? void 0 : nearestTable.dataset.tableLocalId) !== (parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs.localId) && ((0, _dom.isCell)(target) || (0, _dom.isCornerButton)(target)) && (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')) {
163
- return (0, _commands.hideInsertColumnOrRowButton)()(state, dispatch);
164
- }
165
- } else {
166
- if ((nearestTable === null || nearestTable === void 0 ? void 0 : nearestTable.dataset.tableLocalId) !== (parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs.localId)) {
167
- return (0, _commands.hideInsertColumnOrRowButton)()(state, dispatch);
168
- }
160
+ if ((nearestTable === null || nearestTable === void 0 ? void 0 : nearestTable.dataset.tableLocalId) !== (parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs.localId) && ((0, _dom.isCell)(target) || (0, _dom.isCornerButton)(target)) && (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')) {
161
+ return (0, _commands.hideInsertColumnOrRowButton)()(state, dispatch);
169
162
  }
170
163
  } else if (((0, _dom.isCell)(target) || (0, _dom.isCornerButton)(target)) && (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')) {
171
164
  return (0, _commands.hideInsertColumnOrRowButton)()(state, dispatch);
@@ -7,7 +7,6 @@ import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/u
7
7
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
8
8
  import { TableMap } from '@atlaskit/editor-tables/table-map';
9
9
  import { cellAround, findCellRectClosestToPos, findTable, getSelectionRect, removeTable } from '@atlaskit/editor-tables/utils';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  import { addResizeHandleDecorations, clearHoverSelection, hideInsertColumnOrRowButton, hideResizeHandleLine, hoverCell, hoverColumns, selectColumn, setEditorFocus, setTableHovered, showInsertColumnButton, showInsertRowButton, showResizeHandleLine } from '../pm-plugins/commands';
12
11
  import { getPluginState as getDragDropPluginState } from '../pm-plugins/drag-and-drop/plugin-factory';
13
12
  import { getPluginState } from '../pm-plugins/plugin-factory';
@@ -149,14 +148,8 @@ export const handleMouseOver = (view, mouseEvent) => {
149
148
  const nearestTable = closestElement(target, 'table');
150
149
  const nestedTable = findParentNodeOfTypeClosestToPos(state.doc.resolve(state.selection.from), [state.schema.nodes.table]);
151
150
  const parentTable = findParentNodeOfTypeClosestToPos(state.doc.resolve((nestedTable === null || nestedTable === void 0 ? void 0 : nestedTable.pos) || 0), [state.schema.nodes.table]);
152
- if (fg('platform_editor_nested_tables_resize_border_fix')) {
153
- if ((nearestTable === null || nearestTable === void 0 ? void 0 : nearestTable.dataset.tableLocalId) !== (parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs.localId) && (isCell(target) || isCornerButton(target)) && (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')) {
154
- return hideInsertColumnOrRowButton()(state, dispatch);
155
- }
156
- } else {
157
- if ((nearestTable === null || nearestTable === void 0 ? void 0 : nearestTable.dataset.tableLocalId) !== (parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs.localId)) {
158
- return hideInsertColumnOrRowButton()(state, dispatch);
159
- }
151
+ if ((nearestTable === null || nearestTable === void 0 ? void 0 : nearestTable.dataset.tableLocalId) !== (parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs.localId) && (isCell(target) || isCornerButton(target)) && (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')) {
152
+ return hideInsertColumnOrRowButton()(state, dispatch);
160
153
  }
161
154
  } else if ((isCell(target) || isCornerButton(target)) && (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')) {
162
155
  return hideInsertColumnOrRowButton()(state, dispatch);
@@ -8,7 +8,6 @@ import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/u
8
8
  import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
9
9
  import { TableMap } from '@atlaskit/editor-tables/table-map';
10
10
  import { cellAround, findCellRectClosestToPos, findTable, getSelectionRect, removeTable } from '@atlaskit/editor-tables/utils';
11
- import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { addResizeHandleDecorations, clearHoverSelection, hideInsertColumnOrRowButton, hideResizeHandleLine, hoverCell, hoverColumns, selectColumn, setEditorFocus, setTableHovered, showInsertColumnButton, showInsertRowButton, showResizeHandleLine } from '../pm-plugins/commands';
13
12
  import { getPluginState as getDragDropPluginState } from '../pm-plugins/drag-and-drop/plugin-factory';
14
13
  import { getPluginState } from '../pm-plugins/plugin-factory';
@@ -149,14 +148,8 @@ export var handleMouseOver = function handleMouseOver(view, mouseEvent) {
149
148
  var nearestTable = closestElement(target, 'table');
150
149
  var nestedTable = findParentNodeOfTypeClosestToPos(state.doc.resolve(state.selection.from), [state.schema.nodes.table]);
151
150
  var parentTable = findParentNodeOfTypeClosestToPos(state.doc.resolve((nestedTable === null || nestedTable === void 0 ? void 0 : nestedTable.pos) || 0), [state.schema.nodes.table]);
152
- if (fg('platform_editor_nested_tables_resize_border_fix')) {
153
- if ((nearestTable === null || nearestTable === void 0 ? void 0 : nearestTable.dataset.tableLocalId) !== (parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs.localId) && (isCell(target) || isCornerButton(target)) && (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')) {
154
- return hideInsertColumnOrRowButton()(state, dispatch);
155
- }
156
- } else {
157
- if ((nearestTable === null || nearestTable === void 0 ? void 0 : nearestTable.dataset.tableLocalId) !== (parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs.localId)) {
158
- return hideInsertColumnOrRowButton()(state, dispatch);
159
- }
151
+ if ((nearestTable === null || nearestTable === void 0 ? void 0 : nearestTable.dataset.tableLocalId) !== (parentTable === null || parentTable === void 0 ? void 0 : parentTable.node.attrs.localId) && (isCell(target) || isCornerButton(target)) && (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')) {
152
+ return hideInsertColumnOrRowButton()(state, dispatch);
160
153
  }
161
154
  } else if ((isCell(target) || isCornerButton(target)) && (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')) {
162
155
  return hideInsertColumnOrRowButton()(state, dispatch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "10.6.1",
3
+ "version": "10.6.2",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -156,9 +156,6 @@
156
156
  "platform_editor_nested_tables_bodied_extension_fix": {
157
157
  "type": "boolean"
158
158
  },
159
- "platform_editor_nested_tables_resize_border_fix": {
160
- "type": "boolean"
161
- },
162
159
  "platform_editor_nested_table_drag_controls": {
163
160
  "type": "boolean"
164
161
  },
@@ -25,7 +25,6 @@ import {
25
25
  getSelectionRect,
26
26
  removeTable,
27
27
  } from '@atlaskit/editor-tables/utils';
28
- import { fg } from '@atlaskit/platform-feature-flags';
29
28
 
30
29
  import {
31
30
  addResizeHandleDecorations,
@@ -240,18 +239,12 @@ export const handleMouseOver = (view: EditorView, mouseEvent: Event): boolean =>
240
239
  state.schema.nodes.table,
241
240
  ]);
242
241
 
243
- if (fg('platform_editor_nested_tables_resize_border_fix')) {
244
- if (
245
- nearestTable?.dataset.tableLocalId !== parentTable?.node.attrs.localId &&
246
- (isCell(target) || isCornerButton(target)) &&
247
- (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')
248
- ) {
249
- return hideInsertColumnOrRowButton()(state, dispatch);
250
- }
251
- } else {
252
- if (nearestTable?.dataset.tableLocalId !== parentTable?.node.attrs.localId) {
253
- return hideInsertColumnOrRowButton()(state, dispatch);
254
- }
242
+ if (
243
+ nearestTable?.dataset.tableLocalId !== parentTable?.node.attrs.localId &&
244
+ (isCell(target) || isCornerButton(target)) &&
245
+ (typeof insertColumnButtonIndex === 'number' || typeof insertRowButtonIndex === 'number')
246
+ ) {
247
+ return hideInsertColumnOrRowButton()(state, dispatch);
255
248
  }
256
249
  } else if (
257
250
  (isCell(target) || isCornerButton(target)) &&