@atlaskit/editor-tables 2.3.13 → 2.3.15
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 +12 -0
- package/dist/cjs/utils/move-column.js +1 -9
- package/dist/cjs/utils/move-row.js +1 -9
- package/dist/es2019/utils/move-column.js +1 -9
- package/dist/es2019/utils/move-row.js +1 -9
- package/dist/esm/utils/move-column.js +1 -9
- package/dist/esm/utils/move-row.js +1 -9
- package/dist/types/table-map.d.ts +2 -2
- package/dist/types-ts4.5/table-map.d.ts +2 -2
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-tables
|
|
2
2
|
|
|
3
|
+
## 2.3.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43255](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43255) [`6c1b3270538`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c1b3270538) - Remove setSelection from move commands as it's unnecessary
|
|
8
|
+
|
|
9
|
+
## 2.3.14
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#42754](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42754) [`b2396966987`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b2396966987) - use 'as' type assertion rather than angle brackets
|
|
14
|
+
|
|
3
15
|
## 2.3.13
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.moveColumn = void 0;
|
|
7
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
7
|
var _cloneTr = require("./clone-tr");
|
|
10
8
|
var _find = require("./find");
|
|
11
9
|
var _getSelectionRangeInColumn = require("./get-selection-range-in-column");
|
|
@@ -149,7 +147,6 @@ var moveColumn = exports.moveColumn = function moveColumn(originColumnIndex, tar
|
|
|
149
147
|
if (!table) {
|
|
150
148
|
return tr;
|
|
151
149
|
}
|
|
152
|
-
var anchor = tr.selection.anchor;
|
|
153
150
|
var originalColumnRanges = (0, _getSelectionRangeInColumn.getSelectionRangeInColumn)(originColumnIndex)(tr);
|
|
154
151
|
var targetColumnRanges = (0, _getSelectionRangeInColumn.getSelectionRangeInColumn)(targetColumnIndex)(tr);
|
|
155
152
|
var indexesOriginColumn = (_originalColumnRanges = originalColumnRanges === null || originalColumnRanges === void 0 ? void 0 : originalColumnRanges.indexes) !== null && _originalColumnRanges !== void 0 ? _originalColumnRanges : [];
|
|
@@ -162,11 +159,6 @@ var moveColumn = exports.moveColumn = function moveColumn(originColumnIndex, tar
|
|
|
162
159
|
}
|
|
163
160
|
var newTable = (0, _reorderUtils.moveTableColumn)(table, indexesOriginColumn, indexesTargetColumn, options.direction);
|
|
164
161
|
var newTr = (0, _cloneTr.cloneTr)(tr).replaceWith(table.pos, table.pos + table.node.nodeSize, newTable);
|
|
165
|
-
|
|
166
|
-
// Set selection inside a newly created table
|
|
167
|
-
return newTr.setSelection(_state.TextSelection.create(newTr.doc, anchor));
|
|
168
|
-
} else {
|
|
169
|
-
return newTr;
|
|
170
|
-
}
|
|
162
|
+
return newTr;
|
|
171
163
|
};
|
|
172
164
|
};
|
|
@@ -4,8 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.moveRow = void 0;
|
|
7
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
7
|
var _cloneTr = require("./clone-tr");
|
|
10
8
|
var _find = require("./find");
|
|
11
9
|
var _getSelectionRangeInRow = require("./get-selection-range-in-row");
|
|
@@ -163,7 +161,6 @@ var moveRow = exports.moveRow = function moveRow(originRowIndex, targetRowIndex)
|
|
|
163
161
|
if (!table) {
|
|
164
162
|
return tr;
|
|
165
163
|
}
|
|
166
|
-
var anchor = tr.selection.anchor;
|
|
167
164
|
var originalRowRanges = (0, _getSelectionRangeInRow.getSelectionRangeInRow)(originRowIndex)(tr);
|
|
168
165
|
var targetRowRanges = (0, _getSelectionRangeInRow.getSelectionRangeInRow)(targetRowIndex)(tr);
|
|
169
166
|
var indexesOriginRow = (originalRowRanges === null || originalRowRanges === void 0 ? void 0 : originalRowRanges.indexes) || [];
|
|
@@ -176,11 +173,6 @@ var moveRow = exports.moveRow = function moveRow(originRowIndex, targetRowIndex)
|
|
|
176
173
|
}
|
|
177
174
|
var newTable = (0, _reorderUtils.moveTableRow)(table, indexesOriginRow, indexesTargetRow, options.direction);
|
|
178
175
|
var newTr = (0, _cloneTr.cloneTr)(tr).replaceWith(table.pos, table.pos + table.node.nodeSize, newTable);
|
|
179
|
-
|
|
180
|
-
// Set selection inside a newly created table
|
|
181
|
-
return newTr.setSelection(_state.TextSelection.create(newTr.doc, anchor));
|
|
182
|
-
} else {
|
|
183
|
-
return newTr;
|
|
184
|
-
}
|
|
176
|
+
return newTr;
|
|
185
177
|
};
|
|
186
178
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
1
|
import { cloneTr } from './clone-tr';
|
|
4
2
|
import { findTable } from './find';
|
|
5
3
|
import { getSelectionRangeInColumn } from './get-selection-range-in-column';
|
|
@@ -142,7 +140,6 @@ export const moveColumn = (originColumnIndex, targetColumnIndex, options = {
|
|
|
142
140
|
if (!table) {
|
|
143
141
|
return tr;
|
|
144
142
|
}
|
|
145
|
-
const anchor = tr.selection.anchor;
|
|
146
143
|
const originalColumnRanges = getSelectionRangeInColumn(originColumnIndex)(tr);
|
|
147
144
|
const targetColumnRanges = getSelectionRangeInColumn(targetColumnIndex)(tr);
|
|
148
145
|
const indexesOriginColumn = (_originalColumnRanges = originalColumnRanges === null || originalColumnRanges === void 0 ? void 0 : originalColumnRanges.indexes) !== null && _originalColumnRanges !== void 0 ? _originalColumnRanges : [];
|
|
@@ -155,10 +152,5 @@ export const moveColumn = (originColumnIndex, targetColumnIndex, options = {
|
|
|
155
152
|
}
|
|
156
153
|
const newTable = moveTableColumn(table, indexesOriginColumn, indexesTargetColumn, options.direction);
|
|
157
154
|
const newTr = cloneTr(tr).replaceWith(table.pos, table.pos + table.node.nodeSize, newTable);
|
|
158
|
-
|
|
159
|
-
// Set selection inside a newly created table
|
|
160
|
-
return newTr.setSelection(TextSelection.create(newTr.doc, anchor));
|
|
161
|
-
} else {
|
|
162
|
-
return newTr;
|
|
163
|
-
}
|
|
155
|
+
return newTr;
|
|
164
156
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
1
|
import { cloneTr } from './clone-tr';
|
|
4
2
|
import { findTable } from './find';
|
|
5
3
|
import { getSelectionRangeInRow } from './get-selection-range-in-row';
|
|
@@ -156,7 +154,6 @@ export const moveRow = (originRowIndex, targetRowIndex, options = {
|
|
|
156
154
|
if (!table) {
|
|
157
155
|
return tr;
|
|
158
156
|
}
|
|
159
|
-
const anchor = tr.selection.anchor;
|
|
160
157
|
const originalRowRanges = getSelectionRangeInRow(originRowIndex)(tr);
|
|
161
158
|
const targetRowRanges = getSelectionRangeInRow(targetRowIndex)(tr);
|
|
162
159
|
const indexesOriginRow = (originalRowRanges === null || originalRowRanges === void 0 ? void 0 : originalRowRanges.indexes) || [];
|
|
@@ -169,10 +166,5 @@ export const moveRow = (originRowIndex, targetRowIndex, options = {
|
|
|
169
166
|
}
|
|
170
167
|
const newTable = moveTableRow(table, indexesOriginRow, indexesTargetRow, options.direction);
|
|
171
168
|
const newTr = cloneTr(tr).replaceWith(table.pos, table.pos + table.node.nodeSize, newTable);
|
|
172
|
-
|
|
173
|
-
// Set selection inside a newly created table
|
|
174
|
-
return newTr.setSelection(TextSelection.create(newTr.doc, anchor));
|
|
175
|
-
} else {
|
|
176
|
-
return newTr;
|
|
177
|
-
}
|
|
169
|
+
return newTr;
|
|
178
170
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
1
|
import { cloneTr } from './clone-tr';
|
|
4
2
|
import { findTable } from './find';
|
|
5
3
|
import { getSelectionRangeInColumn } from './get-selection-range-in-column';
|
|
@@ -144,7 +142,6 @@ export var moveColumn = function moveColumn(originColumnIndex, targetColumnIndex
|
|
|
144
142
|
if (!table) {
|
|
145
143
|
return tr;
|
|
146
144
|
}
|
|
147
|
-
var anchor = tr.selection.anchor;
|
|
148
145
|
var originalColumnRanges = getSelectionRangeInColumn(originColumnIndex)(tr);
|
|
149
146
|
var targetColumnRanges = getSelectionRangeInColumn(targetColumnIndex)(tr);
|
|
150
147
|
var indexesOriginColumn = (_originalColumnRanges = originalColumnRanges === null || originalColumnRanges === void 0 ? void 0 : originalColumnRanges.indexes) !== null && _originalColumnRanges !== void 0 ? _originalColumnRanges : [];
|
|
@@ -157,11 +154,6 @@ export var moveColumn = function moveColumn(originColumnIndex, targetColumnIndex
|
|
|
157
154
|
}
|
|
158
155
|
var newTable = moveTableColumn(table, indexesOriginColumn, indexesTargetColumn, options.direction);
|
|
159
156
|
var newTr = cloneTr(tr).replaceWith(table.pos, table.pos + table.node.nodeSize, newTable);
|
|
160
|
-
|
|
161
|
-
// Set selection inside a newly created table
|
|
162
|
-
return newTr.setSelection(TextSelection.create(newTr.doc, anchor));
|
|
163
|
-
} else {
|
|
164
|
-
return newTr;
|
|
165
|
-
}
|
|
157
|
+
return newTr;
|
|
166
158
|
};
|
|
167
159
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
1
|
import { cloneTr } from './clone-tr';
|
|
4
2
|
import { findTable } from './find';
|
|
5
3
|
import { getSelectionRangeInRow } from './get-selection-range-in-row';
|
|
@@ -158,7 +156,6 @@ export var moveRow = function moveRow(originRowIndex, targetRowIndex) {
|
|
|
158
156
|
if (!table) {
|
|
159
157
|
return tr;
|
|
160
158
|
}
|
|
161
|
-
var anchor = tr.selection.anchor;
|
|
162
159
|
var originalRowRanges = getSelectionRangeInRow(originRowIndex)(tr);
|
|
163
160
|
var targetRowRanges = getSelectionRangeInRow(targetRowIndex)(tr);
|
|
164
161
|
var indexesOriginRow = (originalRowRanges === null || originalRowRanges === void 0 ? void 0 : originalRowRanges.indexes) || [];
|
|
@@ -171,11 +168,6 @@ export var moveRow = function moveRow(originRowIndex, targetRowIndex) {
|
|
|
171
168
|
}
|
|
172
169
|
var newTable = moveTableRow(table, indexesOriginRow, indexesTargetRow, options.direction);
|
|
173
170
|
var newTr = cloneTr(tr).replaceWith(table.pos, table.pos + table.node.nodeSize, newTable);
|
|
174
|
-
|
|
175
|
-
// Set selection inside a newly created table
|
|
176
|
-
return newTr.setSelection(TextSelection.create(newTr.doc, anchor));
|
|
177
|
-
} else {
|
|
178
|
-
return newTr;
|
|
179
|
-
}
|
|
171
|
+
return newTr;
|
|
180
172
|
};
|
|
181
173
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { Axis } from './types';
|
|
1
|
+
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Axis } from './types';
|
|
3
3
|
export declare class Rect {
|
|
4
4
|
left: number;
|
|
5
5
|
top: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import { Axis } from './types';
|
|
1
|
+
import type { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Axis } from './types';
|
|
3
3
|
export declare class Rect {
|
|
4
4
|
left: number;
|
|
5
5
|
top: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-tables",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.15",
|
|
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/"
|
|
@@ -59,9 +59,6 @@
|
|
|
59
59
|
"platform.editor.custom-table-width": {
|
|
60
60
|
"type": "boolean"
|
|
61
61
|
},
|
|
62
|
-
"platform.editor.table.drag-and-drop": {
|
|
63
|
-
"type": "boolean"
|
|
64
|
-
},
|
|
65
62
|
"platform.editor.table-shift-click-selection-backward": {
|
|
66
63
|
"type": "boolean"
|
|
67
64
|
}
|