@atlaskit/editor-plugin-table 10.6.6 → 10.6.7
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 +9 -0
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +1 -2
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +3 -6
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +1 -2
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +3 -6
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +1 -2
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +3 -6
- package/package.json +1 -4
- package/src/pm-plugins/table-resizing/event-handlers.ts +1 -6
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 10.6.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#137753](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/137753)
|
|
8
|
+
[`fe189a7e249e9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fe189a7e249e9) -
|
|
9
|
+
EDITOR-317 Cleans up feature gate `platform_editor_nested_tables_resizing`
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 10.6.6
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -8,7 +8,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
8
8
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
9
9
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
10
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _columnResize = require("../commands/column-resize");
|
|
13
12
|
var _misc = require("../commands/misc");
|
|
14
13
|
var _pluginFactory = require("../plugin-factory");
|
|
@@ -161,7 +160,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
161
160
|
// There may be a more elegant solution to this, to avoid a jarring experience. This used to
|
|
162
161
|
// be an equality check but that caused issues when a nested table would change (eg. when it
|
|
163
162
|
// dynamically updates its width on resize)
|
|
164
|
-
if (
|
|
163
|
+
if (!(0, _nodes.tablesHaveDifferentNoOfColumns)(originalTable, table)) {
|
|
165
164
|
var _table$attrs;
|
|
166
165
|
var map = _tableMap.TableMap.get(table);
|
|
167
166
|
var colIndex = map.colCount($cell.pos - start) + ($cell.nodeAfter ? $cell.nodeAfter.attrs.colspan : 1) - 1;
|
|
@@ -10,7 +10,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
10
10
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
11
11
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _columnWidth = require("../../transforms/column-width");
|
|
15
14
|
var _nodes = require("../../utils/nodes");
|
|
16
15
|
var _misc = require("../utils/misc");
|
|
@@ -178,11 +177,9 @@ var scaleTable = exports.scaleTable = function scaleTable(tableRef, options, dom
|
|
|
178
177
|
}
|
|
179
178
|
if (resizeState) {
|
|
180
179
|
tr = (0, _columnWidth.updateColumnWidths)(resizeState, node, start, api)(tr);
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
tr.setMeta('addToHistory', false);
|
|
185
|
-
}
|
|
180
|
+
// Avoid adding this transaction separately to the history as these are automatic updates
|
|
181
|
+
// as a consequence of another action
|
|
182
|
+
tr.setMeta('addToHistory', false);
|
|
186
183
|
if (tr.docChanged) {
|
|
187
184
|
tr.setMeta('scrollIntoView', false);
|
|
188
185
|
// TODO: ED-8995 - We need to do this check to reduce the number of race conditions when working with tables.
|
|
@@ -2,7 +2,6 @@ import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_OVERFLOW_
|
|
|
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 { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { stopKeyboardColumnResizing } from '../commands/column-resize';
|
|
7
6
|
import { updateResizeHandleDecorations } from '../commands/misc';
|
|
8
7
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
@@ -169,7 +168,7 @@ export const handleMouseDown = (view, event, localResizeHandlePos, getEditorCont
|
|
|
169
168
|
// There may be a more elegant solution to this, to avoid a jarring experience. This used to
|
|
170
169
|
// be an equality check but that caused issues when a nested table would change (eg. when it
|
|
171
170
|
// dynamically updates its width on resize)
|
|
172
|
-
if (
|
|
171
|
+
if (!tablesHaveDifferentNoOfColumns(originalTable, table)) {
|
|
173
172
|
var _table$attrs;
|
|
174
173
|
const map = TableMap.get(table);
|
|
175
174
|
const colIndex = map.colCount($cell.pos - start) + ($cell.nodeAfter ? $cell.nodeAfter.attrs.colspan : 1) - 1;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
2
2
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { updateColumnWidths } from '../../transforms/column-width';
|
|
6
5
|
import { getTableWidth } from '../../utils/nodes';
|
|
7
6
|
import { getLayoutSize } from '../utils/misc';
|
|
@@ -164,11 +163,9 @@ export const scaleTable = (tableRef, options, domAtPos, api, isTableScalingEnabl
|
|
|
164
163
|
}
|
|
165
164
|
if (resizeState) {
|
|
166
165
|
tr = updateColumnWidths(resizeState, node, start, api)(tr);
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
tr.setMeta('addToHistory', false);
|
|
171
|
-
}
|
|
166
|
+
// Avoid adding this transaction separately to the history as these are automatic updates
|
|
167
|
+
// as a consequence of another action
|
|
168
|
+
tr.setMeta('addToHistory', false);
|
|
172
169
|
if (tr.docChanged) {
|
|
173
170
|
tr.setMeta('scrollIntoView', false);
|
|
174
171
|
// TODO: ED-8995 - We need to do this check to reduce the number of race conditions when working with tables.
|
|
@@ -2,7 +2,6 @@ import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_OVERFLOW_
|
|
|
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 { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { stopKeyboardColumnResizing } from '../commands/column-resize';
|
|
7
6
|
import { updateResizeHandleDecorations } from '../commands/misc';
|
|
8
7
|
import { getPluginState as getTablePluginState } from '../plugin-factory';
|
|
@@ -155,7 +154,7 @@ export var handleMouseDown = function handleMouseDown(view, event, localResizeHa
|
|
|
155
154
|
// There may be a more elegant solution to this, to avoid a jarring experience. This used to
|
|
156
155
|
// be an equality check but that caused issues when a nested table would change (eg. when it
|
|
157
156
|
// dynamically updates its width on resize)
|
|
158
|
-
if (
|
|
157
|
+
if (!tablesHaveDifferentNoOfColumns(originalTable, table)) {
|
|
159
158
|
var _table$attrs;
|
|
160
159
|
var map = TableMap.get(table);
|
|
161
160
|
var colIndex = map.colCount($cell.pos - start) + ($cell.nodeAfter ? $cell.nodeAfter.attrs.colspan : 1) - 1;
|
|
@@ -4,7 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
5
5
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
import { updateColumnWidths } from '../../transforms/column-width';
|
|
9
8
|
import { getTableWidth } from '../../utils/nodes';
|
|
10
9
|
import { getLayoutSize } from '../utils/misc';
|
|
@@ -170,11 +169,9 @@ export var scaleTable = function scaleTable(tableRef, options, domAtPos, api) {
|
|
|
170
169
|
}
|
|
171
170
|
if (resizeState) {
|
|
172
171
|
tr = updateColumnWidths(resizeState, node, start, api)(tr);
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
tr.setMeta('addToHistory', false);
|
|
177
|
-
}
|
|
172
|
+
// Avoid adding this transaction separately to the history as these are automatic updates
|
|
173
|
+
// as a consequence of another action
|
|
174
|
+
tr.setMeta('addToHistory', false);
|
|
178
175
|
if (tr.docChanged) {
|
|
179
176
|
tr.setMeta('scrollIntoView', false);
|
|
180
177
|
// TODO: ED-8995 - We need to do this check to reduce the number of race conditions when working with tables.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "10.6.
|
|
3
|
+
"version": "10.6.7",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -132,9 +132,6 @@
|
|
|
132
132
|
"platform_editor_live_page_prevent_table_recreation": {
|
|
133
133
|
"type": "boolean"
|
|
134
134
|
},
|
|
135
|
-
"platform_editor_nested_tables_resizing": {
|
|
136
|
-
"type": "boolean"
|
|
137
|
-
},
|
|
138
135
|
"platform_editor_disable_table_lnv": {
|
|
139
136
|
"type": "boolean"
|
|
140
137
|
},
|
|
@@ -13,7 +13,6 @@ 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 { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
|
|
18
17
|
import type { PluginInjectionAPI } from '../../types';
|
|
19
18
|
import { stopKeyboardColumnResizing } from '../commands/column-resize';
|
|
@@ -203,11 +202,7 @@ export const handleMouseDown = (
|
|
|
203
202
|
// There may be a more elegant solution to this, to avoid a jarring experience. This used to
|
|
204
203
|
// be an equality check but that caused issues when a nested table would change (eg. when it
|
|
205
204
|
// dynamically updates its width on resize)
|
|
206
|
-
if (
|
|
207
|
-
fg('platform_editor_nested_tables_resizing')
|
|
208
|
-
? !tablesHaveDifferentNoOfColumns(originalTable, table)
|
|
209
|
-
: table.eq(originalTable)
|
|
210
|
-
) {
|
|
205
|
+
if (!tablesHaveDifferentNoOfColumns(originalTable, table)) {
|
|
211
206
|
const map = TableMap.get(table);
|
|
212
207
|
const colIndex =
|
|
213
208
|
map.colCount($cell.pos - start) +
|
|
@@ -4,7 +4,6 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { DomAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
6
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
|
|
9
8
|
import type { PluginInjectionAPI } from '../../../types';
|
|
10
9
|
import { updateColumnWidths } from '../../transforms/column-width';
|
|
@@ -268,11 +267,9 @@ export const scaleTable =
|
|
|
268
267
|
|
|
269
268
|
if (resizeState) {
|
|
270
269
|
tr = updateColumnWidths(resizeState, node, start, api)(tr);
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
tr.setMeta('addToHistory', false);
|
|
275
|
-
}
|
|
270
|
+
// Avoid adding this transaction separately to the history as these are automatic updates
|
|
271
|
+
// as a consequence of another action
|
|
272
|
+
tr.setMeta('addToHistory', false);
|
|
276
273
|
|
|
277
274
|
if (tr.docChanged) {
|
|
278
275
|
tr.setMeta('scrollIntoView', false);
|