@atlaskit/editor-tables 2.8.1 → 2.8.2

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,13 @@
1
1
  # @atlaskit/editor-tables
2
2
 
3
+ ## 2.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#165001](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/165001)
8
+ [`d77bdbfe892ed`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d77bdbfe892ed) -
9
+ tidy table duplicate cell color experiment
10
+
3
11
  ## 2.8.1
4
12
 
5
13
  ### Patch Changes
@@ -5,8 +5,7 @@
5
5
  "target": "es5",
6
6
  "composite": true,
7
7
  "outDir": "../dist",
8
- "rootDir": "../",
9
- "baseUrl": "../"
8
+ "rootDir": "../"
10
9
  },
11
10
  "include": [
12
11
  "../src/**/*.ts",
@@ -1,20 +1,20 @@
1
1
  {
2
- "extends": "../../../../tsconfig.entry-points.jira.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../tsDist/@atlaskit__editor-tables/app",
7
- "composite": true,
8
- "rootDir": "../"
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*"
18
- ],
19
- "references": []
20
- }
2
+ "extends": "../../../../tsconfig.entry-points.jira.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "outDir": "../../../../../tsDist/@atlaskit__editor-tables/app",
7
+ "rootDir": "../",
8
+ "composite": true
9
+ },
10
+ "include": [
11
+ "../src/**/*.ts",
12
+ "../src/**/*.tsx"
13
+ ],
14
+ "exclude": [
15
+ "../src/**/__tests__/*",
16
+ "../src/**/*.test.*",
17
+ "../src/**/test.*"
18
+ ],
19
+ "references": []
20
+ }
@@ -1,20 +1,20 @@
1
1
  {
2
- "extends": "../../../../tsconfig.entry-points.post-office.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "outDir": "../../../../../tsDist/@atlaskit__editor-tables/app",
7
- "composite": true,
8
- "rootDir": "../"
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*"
18
- ],
19
- "references": []
20
- }
2
+ "extends": "../../../../tsconfig.entry-points.post-office.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "outDir": "../../../../../post-office/tsDist/@atlaskit__editor-tables/app",
7
+ "rootDir": "../",
8
+ "composite": true
9
+ },
10
+ "include": [
11
+ "../src/**/*.ts",
12
+ "../src/**/*.tsx"
13
+ ],
14
+ "exclude": [
15
+ "../src/**/__tests__/*",
16
+ "../src/**/*.test.*",
17
+ "../src/**/test.*"
18
+ ],
19
+ "references": []
20
+ }
@@ -9,7 +9,7 @@ var _addColumn = require("./add-column");
9
9
  var _cloneTr = require("./clone-tr");
10
10
  var _find = require("./find");
11
11
  // Returns a new transaction that adds a new column at index `columnIndex`.
12
- var addColumnAt = exports.addColumnAt = function addColumnAt(columnIndex, isCellBackgroundDuplicated) {
12
+ var addColumnAt = exports.addColumnAt = function addColumnAt(columnIndex) {
13
13
  return function (tr) {
14
14
  var table = (0, _find.findTable)(tr.selection);
15
15
  if (table) {
@@ -19,7 +19,7 @@ var addColumnAt = exports.addColumnAt = function addColumnAt(columnIndex, isCell
19
19
  map: map,
20
20
  tableStart: table.start,
21
21
  table: table.node
22
- }, columnIndex, isCellBackgroundDuplicated));
22
+ }, columnIndex));
23
23
  }
24
24
  }
25
25
  return tr;
@@ -19,7 +19,7 @@ function columnIsHeader(map, table, col) {
19
19
  }
20
20
 
21
21
  // Add a column at the given position in a table.
22
- function addColumn(tr, _ref, col, isCellBackgroundDuplicated) {
22
+ function addColumn(tr, _ref, col) {
23
23
  var map = _ref.map,
24
24
  tableStart = _ref.tableStart,
25
25
  table = _ref.table;
@@ -54,7 +54,7 @@ function addColumn(tr, _ref, col, isCellBackgroundDuplicated) {
54
54
  throw new Error("addColumn: invalid node at mapped pos ".concat(mappedPos));
55
55
  }
56
56
  type = _cell.type;
57
- if (_cell.attrs.background && isCellBackgroundDuplicated) {
57
+ if (_cell.attrs.background) {
58
58
  attrs = {
59
59
  background: _cell.attrs.background
60
60
  };
@@ -88,7 +88,7 @@ var cloneRowAt = exports.cloneRowAt = function cloneRowAt(rowIndex) {
88
88
  };
89
89
 
90
90
  // Returns a new transaction that adds a new row at index `rowIndex`. Optionally clone the previous row.
91
- var addRowAt = exports.addRowAt = function addRowAt(rowIndex, clonePreviousRow, isCellBackgroundDuplicated) {
91
+ var addRowAt = exports.addRowAt = function addRowAt(rowIndex, clonePreviousRow) {
92
92
  return function (tr) {
93
93
  var table = (0, _find.findTable)(tr.selection);
94
94
  if (table) {
@@ -102,7 +102,7 @@ var addRowAt = exports.addRowAt = function addRowAt(rowIndex, clonePreviousRow,
102
102
  map: map,
103
103
  tableStart: table.start,
104
104
  table: table.node
105
- }, rowIndex, isCellBackgroundDuplicated));
105
+ }, rowIndex));
106
106
  }
107
107
  }
108
108
  return tr;
@@ -19,7 +19,7 @@ function rowIsHeader(map, table, row) {
19
19
  }
20
20
  return true;
21
21
  }
22
- function addRow(tr, _ref, row, isCellBackgroundDuplicated) {
22
+ function addRow(tr, _ref, row) {
23
23
  var map = _ref.map,
24
24
  tableStart = _ref.tableStart,
25
25
  table = _ref.table;
@@ -57,7 +57,7 @@ function addRow(tr, _ref, row, isCellBackgroundDuplicated) {
57
57
  throw new Error("addRow: invalid node at mapped pos ".concat(mappedPos));
58
58
  }
59
59
  type = cell.type;
60
- if (cell.attrs.background && isCellBackgroundDuplicated) {
60
+ if (cell.attrs.background) {
61
61
  _attrs = {
62
62
  background: cell.attrs.background
63
63
  };
@@ -4,7 +4,7 @@ import { cloneTr } from './clone-tr';
4
4
  import { findTable } from './find';
5
5
 
6
6
  // Returns a new transaction that adds a new column at index `columnIndex`.
7
- export const addColumnAt = (columnIndex, isCellBackgroundDuplicated) => tr => {
7
+ export const addColumnAt = columnIndex => tr => {
8
8
  const table = findTable(tr.selection);
9
9
  if (table) {
10
10
  const map = TableMap.get(table.node);
@@ -13,7 +13,7 @@ export const addColumnAt = (columnIndex, isCellBackgroundDuplicated) => tr => {
13
13
  map,
14
14
  tableStart: table.start,
15
15
  table: table.node
16
- }, columnIndex, isCellBackgroundDuplicated));
16
+ }, columnIndex));
17
17
  }
18
18
  }
19
19
  return tr;
@@ -16,7 +16,7 @@ export function addColumn(tr, {
16
16
  map,
17
17
  tableStart,
18
18
  table
19
- }, col, isCellBackgroundDuplicated) {
19
+ }, col) {
20
20
  let refColumn = col > 0 ? -1 : 0;
21
21
  if (columnIsHeader(map, table, col + refColumn)) {
22
22
  refColumn = col === 0 || col === map.width ? null : 0;
@@ -48,7 +48,7 @@ export function addColumn(tr, {
48
48
  throw new Error(`addColumn: invalid node at mapped pos ${mappedPos}`);
49
49
  }
50
50
  type = cell.type;
51
- if (cell.attrs.background && isCellBackgroundDuplicated) {
51
+ if (cell.attrs.background) {
52
52
  attrs = {
53
53
  background: cell.attrs.background
54
54
  };
@@ -73,7 +73,7 @@ export const cloneRowAt = rowIndex => tr => {
73
73
  };
74
74
 
75
75
  // Returns a new transaction that adds a new row at index `rowIndex`. Optionally clone the previous row.
76
- export const addRowAt = (rowIndex, clonePreviousRow, isCellBackgroundDuplicated) => tr => {
76
+ export const addRowAt = (rowIndex, clonePreviousRow) => tr => {
77
77
  const table = findTable(tr.selection);
78
78
  if (table) {
79
79
  const map = TableMap.get(table.node);
@@ -86,7 +86,7 @@ export const addRowAt = (rowIndex, clonePreviousRow, isCellBackgroundDuplicated)
86
86
  map,
87
87
  tableStart: table.start,
88
88
  table: table.node
89
- }, rowIndex, isCellBackgroundDuplicated));
89
+ }, rowIndex));
90
90
  }
91
91
  }
92
92
  return tr;
@@ -13,7 +13,7 @@ export function addRow(tr, {
13
13
  map,
14
14
  tableStart,
15
15
  table
16
- }, row, isCellBackgroundDuplicated) {
16
+ }, row) {
17
17
  let rowPos = tableStart;
18
18
  for (let i = 0; i < row; i++) {
19
19
  rowPos += table.child(i).nodeSize;
@@ -51,7 +51,7 @@ export function addRow(tr, {
51
51
  throw new Error(`addRow: invalid node at mapped pos ${mappedPos}`);
52
52
  }
53
53
  type = cell.type;
54
- if (cell.attrs.background && isCellBackgroundDuplicated) {
54
+ if (cell.attrs.background) {
55
55
  attrs = {
56
56
  background: cell.attrs.background
57
57
  };
@@ -4,7 +4,7 @@ import { cloneTr } from './clone-tr';
4
4
  import { findTable } from './find';
5
5
 
6
6
  // Returns a new transaction that adds a new column at index `columnIndex`.
7
- export var addColumnAt = function addColumnAt(columnIndex, isCellBackgroundDuplicated) {
7
+ export var addColumnAt = function addColumnAt(columnIndex) {
8
8
  return function (tr) {
9
9
  var table = findTable(tr.selection);
10
10
  if (table) {
@@ -14,7 +14,7 @@ export var addColumnAt = function addColumnAt(columnIndex, isCellBackgroundDupli
14
14
  map: map,
15
15
  tableStart: table.start,
16
16
  table: table.node
17
- }, columnIndex, isCellBackgroundDuplicated));
17
+ }, columnIndex));
18
18
  }
19
19
  }
20
20
  return tr;
@@ -12,7 +12,7 @@ export function columnIsHeader(map, table, col) {
12
12
  }
13
13
 
14
14
  // Add a column at the given position in a table.
15
- export function addColumn(tr, _ref, col, isCellBackgroundDuplicated) {
15
+ export function addColumn(tr, _ref, col) {
16
16
  var map = _ref.map,
17
17
  tableStart = _ref.tableStart,
18
18
  table = _ref.table;
@@ -47,7 +47,7 @@ export function addColumn(tr, _ref, col, isCellBackgroundDuplicated) {
47
47
  throw new Error("addColumn: invalid node at mapped pos ".concat(mappedPos));
48
48
  }
49
49
  type = _cell.type;
50
- if (_cell.attrs.background && isCellBackgroundDuplicated) {
50
+ if (_cell.attrs.background) {
51
51
  attrs = {
52
52
  background: _cell.attrs.background
53
53
  };
@@ -81,7 +81,7 @@ export var cloneRowAt = function cloneRowAt(rowIndex) {
81
81
  };
82
82
 
83
83
  // Returns a new transaction that adds a new row at index `rowIndex`. Optionally clone the previous row.
84
- export var addRowAt = function addRowAt(rowIndex, clonePreviousRow, isCellBackgroundDuplicated) {
84
+ export var addRowAt = function addRowAt(rowIndex, clonePreviousRow) {
85
85
  return function (tr) {
86
86
  var table = findTable(tr.selection);
87
87
  if (table) {
@@ -95,7 +95,7 @@ export var addRowAt = function addRowAt(rowIndex, clonePreviousRow, isCellBackgr
95
95
  map: map,
96
96
  tableStart: table.start,
97
97
  table: table.node
98
- }, rowIndex, isCellBackgroundDuplicated));
98
+ }, rowIndex));
99
99
  }
100
100
  }
101
101
  return tr;
@@ -12,7 +12,7 @@ function rowIsHeader(map, table, row) {
12
12
  }
13
13
  return true;
14
14
  }
15
- export function addRow(tr, _ref, row, isCellBackgroundDuplicated) {
15
+ export function addRow(tr, _ref, row) {
16
16
  var map = _ref.map,
17
17
  tableStart = _ref.tableStart,
18
18
  table = _ref.table;
@@ -50,7 +50,7 @@ export function addRow(tr, _ref, row, isCellBackgroundDuplicated) {
50
50
  throw new Error("addRow: invalid node at mapped pos ".concat(mappedPos));
51
51
  }
52
52
  type = cell.type;
53
- if (cell.attrs.background && isCellBackgroundDuplicated) {
53
+ if (cell.attrs.background) {
54
54
  _attrs = {
55
55
  background: cell.attrs.background
56
56
  };
@@ -1,2 +1,2 @@
1
1
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- export declare const addColumnAt: (columnIndex: number, isCellBackgroundDuplicated?: boolean) => (tr: Transaction) => Transaction;
2
+ export declare const addColumnAt: (columnIndex: number) => (tr: Transaction) => Transaction;
@@ -2,4 +2,4 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { TableContext, TableMap } from '../table-map';
4
4
  export declare function columnIsHeader(map: TableMap, table: PMNode, col: number): boolean;
5
- export declare function addColumn(tr: Transaction, { map, tableStart, table }: TableContext, col: number, isCellBackgroundDuplicated?: boolean): Transaction;
5
+ export declare function addColumn(tr: Transaction, { map, tableStart, table }: TableContext, col: number): Transaction;
@@ -1,3 +1,3 @@
1
1
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  export declare const cloneRowAt: (rowIndex: number) => (tr: Transaction) => Transaction;
3
- export declare const addRowAt: (rowIndex: number, clonePreviousRow?: boolean, isCellBackgroundDuplicated?: boolean) => (tr: Transaction) => Transaction;
3
+ export declare const addRowAt: (rowIndex: number, clonePreviousRow?: boolean) => (tr: Transaction) => Transaction;
@@ -1,3 +1,3 @@
1
1
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { TableContext } from '../table-map';
3
- export declare function addRow(tr: Transaction, { map, tableStart, table }: TableContext, row: number, isCellBackgroundDuplicated?: boolean): Transaction;
3
+ export declare function addRow(tr: Transaction, { map, tableStart, table }: TableContext, row: number): Transaction;
@@ -1,2 +1,2 @@
1
1
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
- export declare const addColumnAt: (columnIndex: number, isCellBackgroundDuplicated?: boolean) => (tr: Transaction) => Transaction;
2
+ export declare const addColumnAt: (columnIndex: number) => (tr: Transaction) => Transaction;
@@ -2,4 +2,4 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { TableContext, TableMap } from '../table-map';
4
4
  export declare function columnIsHeader(map: TableMap, table: PMNode, col: number): boolean;
5
- export declare function addColumn(tr: Transaction, { map, tableStart, table }: TableContext, col: number, isCellBackgroundDuplicated?: boolean): Transaction;
5
+ export declare function addColumn(tr: Transaction, { map, tableStart, table }: TableContext, col: number): Transaction;
@@ -1,3 +1,3 @@
1
1
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  export declare const cloneRowAt: (rowIndex: number) => (tr: Transaction) => Transaction;
3
- export declare const addRowAt: (rowIndex: number, clonePreviousRow?: boolean, isCellBackgroundDuplicated?: boolean) => (tr: Transaction) => Transaction;
3
+ export declare const addRowAt: (rowIndex: number, clonePreviousRow?: boolean) => (tr: Transaction) => Transaction;
@@ -1,3 +1,3 @@
1
1
  import type { Transaction } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { TableContext } from '../table-map';
3
- export declare function addRow(tr: Transaction, { map, tableStart, table }: TableContext, row: number, isCellBackgroundDuplicated?: boolean): Transaction;
3
+ export declare function addRow(tr: Transaction, { map, tableStart, table }: TableContext, row: number): Transaction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-tables",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
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/"