@atlaskit/editor-tables 2.9.10 → 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,18 @@
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
+
10
+ ## 2.9.11
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 2.9.10
4
17
 
5
18
  ### Patch Changes
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/cell-bookmark.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/cell-bookmark.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/cell-selection.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/cell-selection.d.ts"
12
12
  ]
@@ -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.10",
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": "^10.0.0",
32
+ "@atlaskit/tmp-editor-statsig": "^11.5.0",
33
33
  "@babel/runtime": "^7.0.0"
34
34
  },
35
35
  "techstack": {
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/pm-plugins.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/pm-plugins.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/table-map.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/table-map.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/types.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/types.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/utils.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/utils.d.ts"
12
12
  ]