@atlaskit/editor-tables 2.8.0 → 2.8.1

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,14 @@
1
1
  # @atlaskit/editor-tables
2
2
 
3
+ ## 2.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#139334](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/139334)
8
+ [`30793649657c0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/30793649657c0) -
9
+ [HOT-111629] We had an incident where the last character disappears when hitting the enter key on
10
+ windows OS for Korean characters. Bumping to prosemirror-view@1.34.2 for the fix.
11
+
3
12
  ## 2.8.0
4
13
 
5
14
  ### Minor Changes
@@ -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);
@@ -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;
@@ -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);
@@ -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';
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.1",
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": {