@atlaskit/editor-tables 2.9.3 → 2.9.4
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,14 @@
|
|
|
1
1
|
# @atlaskit/editor-tables
|
|
2
2
|
|
|
3
|
+
## 2.9.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#155329](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/155329)
|
|
8
|
+
[`516452df3b2b5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/516452df3b2b5) -
|
|
9
|
+
clean up platform_editor_table_fix_move_column
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 2.9.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.moveColumn = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _cellSelection = require("../cell-selection");
|
|
11
10
|
var _tableMap = require("../table-map");
|
|
12
11
|
var _analyseTable = require("./analyse-table");
|
|
@@ -220,7 +219,7 @@ var moveColumn = exports.moveColumn = function moveColumn(state, originColumnInd
|
|
|
220
219
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
221
220
|
var node = table.node.nodeAt(rowTargetPosition);
|
|
222
221
|
var pos = table.start + rowTargetPosition;
|
|
223
|
-
var insertPos = direction === 'end' || tableMap.isCellMergedTopLeft(y, actualTargetIndex)
|
|
222
|
+
var insertPos = direction === 'end' || tableMap.isCellMergedTopLeft(y, actualTargetIndex) ? newTr.mapping.map(pos + node.nodeSize, 1) : newTr.mapping.map(pos, -1);
|
|
224
223
|
newTr.insert(insertPos, row.map(function (_ref, x) {
|
|
225
224
|
var node = _ref.node;
|
|
226
225
|
return normalizeCellNode(node, rowHeaderEnabled && y === 0, columnHeaderEnabled && actualTargetIndex === 0 && x === 0, types);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { CellSelection } from '../cell-selection';
|
|
3
2
|
import { TableMap } from '../table-map';
|
|
4
3
|
import { determineTableHeaderStateFromTableNode } from './analyse-table';
|
|
@@ -212,7 +211,7 @@ export const moveColumn = (state, originColumnIndex, targetColumnIndex, options
|
|
|
212
211
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
213
212
|
const node = table.node.nodeAt(rowTargetPosition);
|
|
214
213
|
const pos = table.start + rowTargetPosition;
|
|
215
|
-
const insertPos = direction === 'end' || tableMap.isCellMergedTopLeft(y, actualTargetIndex)
|
|
214
|
+
const insertPos = direction === 'end' || tableMap.isCellMergedTopLeft(y, actualTargetIndex) ? newTr.mapping.map(pos + node.nodeSize, 1) : newTr.mapping.map(pos, -1);
|
|
216
215
|
newTr.insert(insertPos, row.map(({
|
|
217
216
|
node
|
|
218
217
|
}, x) => normalizeCellNode(node, rowHeaderEnabled && y === 0, columnHeaderEnabled && actualTargetIndex === 0 && x === 0, types)));
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { CellSelection } from '../cell-selection';
|
|
4
3
|
import { TableMap } from '../table-map';
|
|
5
4
|
import { determineTableHeaderStateFromTableNode } from './analyse-table';
|
|
@@ -213,7 +212,7 @@ export var moveColumn = function moveColumn(state, originColumnIndex, targetColu
|
|
|
213
212
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
214
213
|
var node = table.node.nodeAt(rowTargetPosition);
|
|
215
214
|
var pos = table.start + rowTargetPosition;
|
|
216
|
-
var insertPos = direction === 'end' || tableMap.isCellMergedTopLeft(y, actualTargetIndex)
|
|
215
|
+
var insertPos = direction === 'end' || tableMap.isCellMergedTopLeft(y, actualTargetIndex) ? newTr.mapping.map(pos + node.nodeSize, 1) : newTr.mapping.map(pos, -1);
|
|
217
216
|
newTr.insert(insertPos, row.map(function (_ref, x) {
|
|
218
217
|
var node = _ref.node;
|
|
219
218
|
return normalizeCellNode(node, rowHeaderEnabled && y === 0, columnHeaderEnabled && actualTargetIndex === 0 && x === 0, types);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-tables",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.4",
|
|
4
4
|
"description": "A package that contains common classes and utility functions for editor tables",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
31
31
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
32
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^4.22.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0"
|
|
34
34
|
},
|
|
35
35
|
"techstack": {
|
|
@@ -50,9 +50,6 @@
|
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"platform-feature-flags": {
|
|
53
|
-
"platform_editor_table_fix_move_column": {
|
|
54
|
-
"type": "boolean"
|
|
55
|
-
},
|
|
56
53
|
"platform_editor_paste_full_table_inside_empty_cell": {
|
|
57
54
|
"type": "boolean"
|
|
58
55
|
}
|