@atlaskit/editor-tables 2.9.11 → 2.9.12
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,12 @@
|
|
|
1
1
|
# @atlaskit/editor-tables
|
|
2
2
|
|
|
3
|
+
## 2.9.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`d99dd614bde90`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d99dd614bde90) -
|
|
8
|
+
Add reverse selection support to rowSelection
|
|
9
|
+
|
|
3
10
|
## 2.9.11
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
|
@@ -307,6 +307,7 @@ var CellSelection = exports.CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
307
307
|
key: "rowSelection",
|
|
308
308
|
value: function rowSelection($anchorCell) {
|
|
309
309
|
var $headCell = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $anchorCell;
|
|
310
|
+
var reverse = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
310
311
|
var $calculatedAnchorCell = $anchorCell;
|
|
311
312
|
var $calculatedHeadCell = $headCell;
|
|
312
313
|
var map = _tableMap.TableMap.get($calculatedAnchorCell.node(-1));
|
|
@@ -329,7 +330,7 @@ var CellSelection = exports.CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
329
330
|
$calculatedAnchorCell = doc.resolve(start + map.map[map.width * (anchorRect.top + 1) - 1]);
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
|
-
return new CellSelection($calculatedAnchorCell, $calculatedHeadCell);
|
|
333
|
+
return reverse ? new CellSelection($calculatedHeadCell, $calculatedAnchorCell) : new CellSelection($calculatedAnchorCell, $calculatedHeadCell);
|
|
333
334
|
}
|
|
334
335
|
}, {
|
|
335
336
|
key: "fromJSON",
|
|
@@ -258,7 +258,7 @@ export class CellSelection extends Selection {
|
|
|
258
258
|
// :: (ResolvedPos, ?ResolvedPos) → CellSelection
|
|
259
259
|
// Returns the smallest row selection that covers the given anchor
|
|
260
260
|
// and head cell.
|
|
261
|
-
static rowSelection($anchorCell, $headCell = $anchorCell) {
|
|
261
|
+
static rowSelection($anchorCell, $headCell = $anchorCell, reverse = false) {
|
|
262
262
|
let $calculatedAnchorCell = $anchorCell;
|
|
263
263
|
let $calculatedHeadCell = $headCell;
|
|
264
264
|
const map = TableMap.get($calculatedAnchorCell.node(-1));
|
|
@@ -281,7 +281,7 @@ export class CellSelection extends Selection {
|
|
|
281
281
|
$calculatedAnchorCell = doc.resolve(start + map.map[map.width * (anchorRect.top + 1) - 1]);
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
|
-
return new CellSelection($calculatedAnchorCell, $calculatedHeadCell);
|
|
284
|
+
return reverse ? new CellSelection($calculatedHeadCell, $calculatedAnchorCell) : new CellSelection($calculatedAnchorCell, $calculatedHeadCell);
|
|
285
285
|
}
|
|
286
286
|
toJSON() {
|
|
287
287
|
return {
|
|
@@ -306,6 +306,7 @@ export var CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
306
306
|
key: "rowSelection",
|
|
307
307
|
value: function rowSelection($anchorCell) {
|
|
308
308
|
var $headCell = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $anchorCell;
|
|
309
|
+
var reverse = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
309
310
|
var $calculatedAnchorCell = $anchorCell;
|
|
310
311
|
var $calculatedHeadCell = $headCell;
|
|
311
312
|
var map = TableMap.get($calculatedAnchorCell.node(-1));
|
|
@@ -328,7 +329,7 @@ export var CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
328
329
|
$calculatedAnchorCell = doc.resolve(start + map.map[map.width * (anchorRect.top + 1) - 1]);
|
|
329
330
|
}
|
|
330
331
|
}
|
|
331
|
-
return new CellSelection($calculatedAnchorCell, $calculatedHeadCell);
|
|
332
|
+
return reverse ? new CellSelection($calculatedHeadCell, $calculatedAnchorCell) : new CellSelection($calculatedAnchorCell, $calculatedHeadCell);
|
|
332
333
|
}
|
|
333
334
|
}, {
|
|
334
335
|
key: "fromJSON",
|
|
@@ -17,7 +17,7 @@ export declare class CellSelection extends Selection {
|
|
|
17
17
|
static colSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos): CellSelection;
|
|
18
18
|
isRowSelection(): boolean;
|
|
19
19
|
eq(other: CellSelection): boolean;
|
|
20
|
-
static rowSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos): CellSelection;
|
|
20
|
+
static rowSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos, reverse?: boolean): CellSelection;
|
|
21
21
|
toJSON(): SerializedCellSelection;
|
|
22
22
|
static fromJSON(doc: PMNode, json: SerializedCellSelection): CellSelection;
|
|
23
23
|
static create(doc: PMNode, anchorCell: number, headCell?: number): CellSelection;
|
|
@@ -17,7 +17,7 @@ export declare class CellSelection extends Selection {
|
|
|
17
17
|
static colSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos): CellSelection;
|
|
18
18
|
isRowSelection(): boolean;
|
|
19
19
|
eq(other: CellSelection): boolean;
|
|
20
|
-
static rowSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos): CellSelection;
|
|
20
|
+
static rowSelection($anchorCell: ResolvedPos, $headCell?: ResolvedPos, reverse?: boolean): CellSelection;
|
|
21
21
|
toJSON(): SerializedCellSelection;
|
|
22
22
|
static fromJSON(doc: PMNode, json: SerializedCellSelection): CellSelection;
|
|
23
23
|
static create(doc: PMNode, anchorCell: number, headCell?: number): CellSelection;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-tables",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.12",
|
|
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": "^11.
|
|
32
|
+
"@atlaskit/tmp-editor-statsig": "^11.5.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0"
|
|
34
34
|
},
|
|
35
35
|
"techstack": {
|