@atlaskit/editor-tables 2.8.0 → 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,22 @@
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
+
11
+ ## 2.8.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#139334](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139334)
16
+ [`30793649657c0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/30793649657c0) -
17
+ [HOT-111629] We had an incident where the last character disappears when hitting the enter key on
18
+ windows OS for Korean characters. Bumping to prosemirror-view@1.34.2 for the fix.
19
+
3
20
  ## 2.8.0
4
21
 
5
22
  ### Minor 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
+ }
@@ -21,7 +21,7 @@ var _getCellSelectionRanges = require("./utils/get-cell-selection-ranges");
21
21
  var _tables = require("./utils/tables");
22
22
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
23
23
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
24
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
24
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = (0, _getPrototypeOf2.default)(t); if (r) { var s = (0, _getPrototypeOf2.default)(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return (0, _possibleConstructorReturn2.default)(this, e); }; }
25
25
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } // Was copied from https://github.com/ProseMirror/prosemirror-tables/blob/master/src/cellselection.js
26
26
  // This file defines a ProseMirror selection subclass that models
27
27
  // table cell selections. The table plugin needs to be active to wire
@@ -91,13 +91,13 @@ var CellSelection = exports.CellSelection = /*#__PURE__*/function (_Selection) {
91
91
  for (var row = rect.top; row < rect.bottom; row++) {
92
92
  var rowContent = [];
93
93
  for (var index = row * map.width + rect.left, col = rect.left; col < rect.right; col++, index++) {
94
- var _pos = map.map[index];
95
- if (!seen[_pos]) {
96
- seen[_pos] = true;
97
- var cellRect = map.findCell(_pos);
98
- var cell = table.nodeAt(_pos);
94
+ var pos = map.map[index];
95
+ if (!seen[pos]) {
96
+ seen[pos] = true;
97
+ var cellRect = map.findCell(pos);
98
+ var cell = table.nodeAt(pos);
99
99
  if (cell === null || cell === undefined) {
100
- throw new Error("No cell at position ".concat(_pos));
100
+ throw new Error("No cell at position ".concat(pos));
101
101
  }
102
102
  var extraLeft = rect.left - cellRect.left;
103
103
  var extraRight = cellRect.right - rect.right;
@@ -105,7 +105,7 @@ var CellSelection = exports.CellSelection = /*#__PURE__*/function (_Selection) {
105
105
  var _cell = cell,
106
106
  attrs = _cell.attrs;
107
107
  if (!attrs) {
108
- throw new Error("No cell at position ".concat(_pos));
108
+ throw new Error("No cell at position ".concat(pos));
109
109
  }
110
110
  if (extraLeft > 0) {
111
111
  attrs = (0, _colspan.removeColSpan)(attrs, 0, extraLeft);
@@ -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
  };
@@ -21,22 +21,22 @@ function changedDescendants(old, cur, offsetStart, f) {
21
21
  var oldSize = old.childCount;
22
22
  var curSize = cur.childCount;
23
23
  outer: for (var i = 0, j = 0; i < curSize; i++) {
24
- var _child = cur.child(i);
24
+ var child = cur.child(i);
25
25
  for (var scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) {
26
- if (old.child(scan) === _child) {
26
+ if (old.child(scan) === child) {
27
27
  j = scan + 1;
28
- offset += _child.nodeSize;
28
+ offset += child.nodeSize;
29
29
  // eslint-disable-next-line no-continue
30
30
  continue outer;
31
31
  }
32
32
  }
33
- f(_child, offset);
34
- if (j < oldSize && old.child(j).sameMarkup(_child)) {
35
- changedDescendants(old.child(j), _child, offset + 1, f);
33
+ f(child, offset);
34
+ if (j < oldSize && old.child(j).sameMarkup(child)) {
35
+ changedDescendants(old.child(j), child, offset + 1, f);
36
36
  } else {
37
- _child.nodesBetween(0, _child.content.size, f, offset + 1);
37
+ child.nodesBetween(0, child.content.size, f, offset + 1);
38
38
  }
39
- offset += _child.nodeSize;
39
+ offset += child.nodeSize;
40
40
  }
41
41
  }
42
42
 
@@ -11,9 +11,9 @@ var _selectionCell = require("../utils/selection-cell");
11
11
  var _tableNodeTypes = require("../utils/table-node-types");
12
12
  var _tables = require("../utils/tables");
13
13
  var _copyPaste = require("./copy-paste");
14
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
15
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
15
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
16
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17
17
  function handlePaste(view, event, slice) {
18
18
  if (!(0, _tables.isInTable)(view.state)) {
19
19
  return false;
@@ -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
  };
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
6
6
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
7
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
8
8
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
9
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+ function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
10
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
11
  // Was copied from https://github.com/ProseMirror/prosemirror-tables/blob/master/src/cellselection.js
12
12
 
@@ -88,13 +88,13 @@ export var CellSelection = /*#__PURE__*/function (_Selection) {
88
88
  for (var row = rect.top; row < rect.bottom; row++) {
89
89
  var rowContent = [];
90
90
  for (var index = row * map.width + rect.left, col = rect.left; col < rect.right; col++, index++) {
91
- var _pos = map.map[index];
92
- if (!seen[_pos]) {
93
- seen[_pos] = true;
94
- var cellRect = map.findCell(_pos);
95
- var cell = table.nodeAt(_pos);
91
+ var pos = map.map[index];
92
+ if (!seen[pos]) {
93
+ seen[pos] = true;
94
+ var cellRect = map.findCell(pos);
95
+ var cell = table.nodeAt(pos);
96
96
  if (cell === null || cell === undefined) {
97
- throw new Error("No cell at position ".concat(_pos));
97
+ throw new Error("No cell at position ".concat(pos));
98
98
  }
99
99
  var extraLeft = rect.left - cellRect.left;
100
100
  var extraRight = cellRect.right - rect.right;
@@ -102,7 +102,7 @@ export var CellSelection = /*#__PURE__*/function (_Selection) {
102
102
  var _cell = cell,
103
103
  attrs = _cell.attrs;
104
104
  if (!attrs) {
105
- throw new Error("No cell at position ".concat(_pos));
105
+ throw new Error("No cell at position ".concat(pos));
106
106
  }
107
107
  if (extraLeft > 0) {
108
108
  attrs = removeColSpan(attrs, 0, extraLeft);
@@ -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
  };
@@ -13,22 +13,22 @@ function changedDescendants(old, cur, offsetStart, f) {
13
13
  var oldSize = old.childCount;
14
14
  var curSize = cur.childCount;
15
15
  outer: for (var i = 0, j = 0; i < curSize; i++) {
16
- var _child = cur.child(i);
16
+ var child = cur.child(i);
17
17
  for (var scan = j, e = Math.min(oldSize, i + 3); scan < e; scan++) {
18
- if (old.child(scan) === _child) {
18
+ if (old.child(scan) === child) {
19
19
  j = scan + 1;
20
- offset += _child.nodeSize;
20
+ offset += child.nodeSize;
21
21
  // eslint-disable-next-line no-continue
22
22
  continue outer;
23
23
  }
24
24
  }
25
- f(_child, offset);
26
- if (j < oldSize && old.child(j).sameMarkup(_child)) {
27
- changedDescendants(old.child(j), _child, offset + 1, f);
25
+ f(child, offset);
26
+ if (j < oldSize && old.child(j).sameMarkup(child)) {
27
+ changedDescendants(old.child(j), child, offset + 1, f);
28
28
  } else {
29
- _child.nodesBetween(0, _child.content.size, f, offset + 1);
29
+ child.nodesBetween(0, child.content.size, f, offset + 1);
30
30
  }
31
- offset += _child.nodeSize;
31
+ offset += child.nodeSize;
32
32
  }
33
33
  }
34
34
 
@@ -1,6 +1,6 @@
1
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
1
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
2
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
3
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
4
4
  import { Fragment } from '@atlaskit/editor-prosemirror/model';
5
5
  import { CellSelection } from '../cell-selection';
6
6
  import { TableMap } from '../table-map';
@@ -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.0",
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/"
@@ -24,11 +24,10 @@
24
24
  "atlaskit:src": "src/index.ts",
25
25
  "atlassian": {
26
26
  "team": "Editor: Jenga",
27
- "singleton": true,
28
- "releaseModel": "continuous"
27
+ "singleton": true
29
28
  },
30
29
  "dependencies": {
31
- "@atlaskit/editor-prosemirror": "5.0.1",
30
+ "@atlaskit/editor-prosemirror": "6.0.0",
32
31
  "@babel/runtime": "^7.0.0"
33
32
  },
34
33
  "techstack": {