@atlaskit/editor-tables 2.3.6 → 2.3.8
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 +12 -0
- package/dist/cjs/cell-bookmark.js +3 -3
- package/dist/cjs/cell-selection.js +11 -11
- package/dist/cjs/pm-plugins/input.js +11 -11
- package/dist/cjs/pm-plugins/plugin-key.js +3 -3
- package/dist/cjs/pm-plugins/table-editing.js +2 -2
- package/dist/cjs/utils/add-row-at.js +2 -2
- package/dist/cjs/utils/copy-paste.js +12 -12
- package/dist/cjs/utils/draw-cell-selection.js +3 -3
- package/dist/cjs/utils/find.js +4 -4
- package/dist/cjs/utils/for-each-cell.js +3 -3
- package/dist/cjs/utils/get-cell-selection-ranges.js +2 -2
- package/dist/cjs/utils/go-to-next-cell.js +2 -2
- package/dist/cjs/utils/handle-paste.js +4 -2
- package/dist/cjs/utils/normalize-selection.js +7 -7
- package/dist/cjs/utils/remove-column.js +2 -2
- package/dist/cjs/utils/remove-row.js +2 -2
- package/dist/cjs/utils/replace-table.js +4 -4
- package/dist/cjs/utils/split-cell-with-type.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/cell-bookmark.js +1 -1
- package/dist/es2019/cell-selection.js +2 -2
- package/dist/es2019/pm-plugins/input.js +3 -3
- package/dist/es2019/pm-plugins/plugin-key.js +1 -1
- package/dist/es2019/pm-plugins/table-editing.js +1 -1
- package/dist/es2019/utils/add-row-at.js +1 -1
- package/dist/es2019/utils/copy-paste.js +2 -2
- package/dist/es2019/utils/draw-cell-selection.js +1 -1
- package/dist/es2019/utils/find.js +1 -1
- package/dist/es2019/utils/for-each-cell.js +1 -1
- package/dist/es2019/utils/get-cell-selection-ranges.js +1 -1
- package/dist/es2019/utils/go-to-next-cell.js +1 -1
- package/dist/es2019/utils/handle-paste.js +3 -1
- package/dist/es2019/utils/normalize-selection.js +1 -1
- package/dist/es2019/utils/remove-column.js +1 -1
- package/dist/es2019/utils/remove-row.js +1 -1
- package/dist/es2019/utils/replace-table.js +2 -2
- package/dist/es2019/utils/split-cell-with-type.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/cell-bookmark.js +1 -1
- package/dist/esm/cell-selection.js +2 -2
- package/dist/esm/pm-plugins/input.js +3 -3
- package/dist/esm/pm-plugins/plugin-key.js +1 -1
- package/dist/esm/pm-plugins/table-editing.js +1 -1
- package/dist/esm/utils/add-row-at.js +1 -1
- package/dist/esm/utils/copy-paste.js +2 -2
- package/dist/esm/utils/draw-cell-selection.js +1 -1
- package/dist/esm/utils/find.js +1 -1
- package/dist/esm/utils/for-each-cell.js +1 -1
- package/dist/esm/utils/get-cell-selection-ranges.js +1 -1
- package/dist/esm/utils/go-to-next-cell.js +1 -1
- package/dist/esm/utils/handle-paste.js +3 -1
- package/dist/esm/utils/normalize-selection.js +1 -1
- package/dist/esm/utils/remove-column.js +1 -1
- package/dist/esm/utils/remove-row.js +1 -1
- package/dist/esm/utils/replace-table.js +2 -2
- package/dist/esm/utils/split-cell-with-type.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/cell-bookmark.d.ts +3 -3
- package/dist/types/cell-selection.d.ts +3 -3
- package/dist/types/pm-plugins/input.d.ts +2 -2
- package/dist/types/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types/pm-plugins/table-editing.d.ts +1 -1
- package/dist/types/table-map.d.ts +1 -1
- package/dist/types/types.d.ts +3 -3
- package/dist/types/utils/add-column-at.d.ts +1 -1
- package/dist/types/utils/add-column.d.ts +2 -2
- package/dist/types/utils/add-row-at.d.ts +1 -1
- package/dist/types/utils/add-row.d.ts +1 -1
- package/dist/types/utils/analytics-helpers.d.ts +1 -1
- package/dist/types/utils/cells.d.ts +2 -61
- package/dist/types/utils/clone-tr.d.ts +1 -1
- package/dist/types/utils/copy-paste.d.ts +2 -2
- package/dist/types/utils/create-table.d.ts +1 -1
- package/dist/types/utils/draw-cell-selection.d.ts +2 -2
- package/dist/types/utils/empty-cells.d.ts +3 -3
- package/dist/types/utils/find.d.ts +3 -3
- package/dist/types/utils/fix-tables.d.ts +2 -2
- package/dist/types/utils/for-each-cell.d.ts +2 -2
- package/dist/types/utils/get-cell-selection-ranges.d.ts +2 -2
- package/dist/types/utils/get-cells-in-column.d.ts +2 -2
- package/dist/types/utils/get-cells-in-row.d.ts +2 -2
- package/dist/types/utils/get-cells-in-table.d.ts +2 -2
- package/dist/types/utils/get-selection-range-in-column.d.ts +1 -1
- package/dist/types/utils/get-selection-range-in-row.d.ts +1 -1
- package/dist/types/utils/get-selection-rect.d.ts +1 -1
- package/dist/types/utils/handle-paste.d.ts +2 -2
- package/dist/types/utils/is-selected.d.ts +1 -1
- package/dist/types/utils/is-selection-type.d.ts +2 -2
- package/dist/types/utils/move-column.d.ts +1 -1
- package/dist/types/utils/move-row.d.ts +1 -1
- package/dist/types/utils/normalize-selection.d.ts +1 -1
- package/dist/types/utils/remove-column.d.ts +2 -2
- package/dist/types/utils/remove-row.d.ts +2 -2
- package/dist/types/utils/remove-table.d.ts +1 -1
- package/dist/types/utils/reorder-utils.d.ts +2 -2
- package/dist/types/utils/replace-table.d.ts +2 -2
- package/dist/types/utils/select-nodes.d.ts +2 -2
- package/dist/types/utils/selection-cell.d.ts +2 -2
- package/dist/types/utils/selection-rect.d.ts +1 -1
- package/dist/types/utils/set-cell-attrs.d.ts +2 -2
- package/dist/types/utils/split-cell-with-type.d.ts +1 -1
- package/dist/types/utils/table-node-types.d.ts +1 -1
- package/dist/types/utils/tables.d.ts +2 -2
- package/dist/types-ts4.5/cell-bookmark.d.ts +3 -3
- package/dist/types-ts4.5/cell-selection.d.ts +3 -3
- package/dist/types-ts4.5/pm-plugins/input.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-editing.d.ts +1 -1
- package/dist/types-ts4.5/table-map.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +3 -3
- package/dist/types-ts4.5/utils/add-column-at.d.ts +1 -1
- package/dist/types-ts4.5/utils/add-column.d.ts +2 -2
- package/dist/types-ts4.5/utils/add-row-at.d.ts +1 -1
- package/dist/types-ts4.5/utils/add-row.d.ts +1 -1
- package/dist/types-ts4.5/utils/analytics-helpers.d.ts +1 -1
- package/dist/types-ts4.5/utils/cells.d.ts +2 -61
- package/dist/types-ts4.5/utils/clone-tr.d.ts +1 -1
- package/dist/types-ts4.5/utils/copy-paste.d.ts +2 -2
- package/dist/types-ts4.5/utils/create-table.d.ts +1 -1
- package/dist/types-ts4.5/utils/draw-cell-selection.d.ts +2 -2
- package/dist/types-ts4.5/utils/empty-cells.d.ts +3 -3
- package/dist/types-ts4.5/utils/find.d.ts +3 -3
- package/dist/types-ts4.5/utils/fix-tables.d.ts +2 -2
- package/dist/types-ts4.5/utils/for-each-cell.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-cell-selection-ranges.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-cells-in-column.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-cells-in-row.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-cells-in-table.d.ts +2 -2
- package/dist/types-ts4.5/utils/get-selection-range-in-column.d.ts +1 -1
- package/dist/types-ts4.5/utils/get-selection-range-in-row.d.ts +1 -1
- package/dist/types-ts4.5/utils/get-selection-rect.d.ts +1 -1
- package/dist/types-ts4.5/utils/handle-paste.d.ts +2 -2
- package/dist/types-ts4.5/utils/is-selected.d.ts +1 -1
- package/dist/types-ts4.5/utils/is-selection-type.d.ts +2 -2
- package/dist/types-ts4.5/utils/move-column.d.ts +1 -1
- package/dist/types-ts4.5/utils/move-row.d.ts +1 -1
- package/dist/types-ts4.5/utils/normalize-selection.d.ts +1 -1
- package/dist/types-ts4.5/utils/remove-column.d.ts +2 -2
- package/dist/types-ts4.5/utils/remove-row.d.ts +2 -2
- package/dist/types-ts4.5/utils/remove-table.d.ts +1 -1
- package/dist/types-ts4.5/utils/reorder-utils.d.ts +2 -2
- package/dist/types-ts4.5/utils/replace-table.d.ts +2 -2
- package/dist/types-ts4.5/utils/select-nodes.d.ts +2 -2
- package/dist/types-ts4.5/utils/selection-cell.d.ts +2 -2
- package/dist/types-ts4.5/utils/selection-rect.d.ts +1 -1
- package/dist/types-ts4.5/utils/set-cell-attrs.d.ts +2 -2
- package/dist/types-ts4.5/utils/split-cell-with-type.d.ts +1 -1
- package/dist/types-ts4.5/utils/table-node-types.d.ts +1 -1
- package/dist/types-ts4.5/utils/tables.d.ts +2 -2
- package/package.json +4 -9
- package/report.api.md +9 -9
- package/tmp/api-report-tmp.d.ts +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-tables
|
|
2
2
|
|
|
3
|
+
## 2.3.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 2.3.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4e6f1bf8511`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4e6f1bf8511) - [ED-19233] Import prosemirror libraries from internal facade package
|
|
14
|
+
|
|
3
15
|
## 2.3.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.CellBookmark = void 0;
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var
|
|
10
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
11
11
|
var _tables = require("./utils/tables");
|
|
12
12
|
var CellBookmark = /*#__PURE__*/function () {
|
|
13
13
|
function CellBookmark(anchor, head) {
|
|
@@ -31,9 +31,9 @@ var CellBookmark = /*#__PURE__*/function () {
|
|
|
31
31
|
anchor: $anchorCell.pos,
|
|
32
32
|
head: $headCell.pos
|
|
33
33
|
};
|
|
34
|
-
return
|
|
34
|
+
return _state.Selection.fromJSON(doc, data);
|
|
35
35
|
}
|
|
36
|
-
return
|
|
36
|
+
return _state.Selection.near($headCell, 1);
|
|
37
37
|
}
|
|
38
38
|
}]);
|
|
39
39
|
return CellBookmark;
|
|
@@ -11,8 +11,8 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
11
11
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
15
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
16
16
|
var _cellBookmark = require("./cell-bookmark");
|
|
17
17
|
var _tableMap = require("./table-map");
|
|
18
18
|
var _cells = require("./utils/cells");
|
|
@@ -73,7 +73,7 @@ var CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
73
73
|
}
|
|
74
74
|
return new CellSelection($anchorCell, $headCell);
|
|
75
75
|
}
|
|
76
|
-
return
|
|
76
|
+
return _state.TextSelection.between($anchorCell, $headCell);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
// :: () → Slice
|
|
@@ -138,15 +138,15 @@ var CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
138
138
|
rowContent.push(cell);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
rows.push(table.child(row).copy(
|
|
141
|
+
rows.push(table.child(row).copy(_model.Fragment.from(rowContent)));
|
|
142
142
|
}
|
|
143
143
|
var fragment = this.isColSelection() && this.isRowSelection() ? table : rows;
|
|
144
|
-
return new
|
|
144
|
+
return new _model.Slice(_model.Fragment.from(fragment), 1, 1);
|
|
145
145
|
}
|
|
146
146
|
}, {
|
|
147
147
|
key: "replace",
|
|
148
148
|
value: function replace(tr) {
|
|
149
|
-
var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
149
|
+
var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _model.Slice.empty;
|
|
150
150
|
var mapFrom = tr.steps.length;
|
|
151
151
|
var ranges = this.ranges;
|
|
152
152
|
for (var i = 0; i < ranges.length; i++) {
|
|
@@ -154,9 +154,9 @@ var CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
154
154
|
$from = _ranges$i.$from,
|
|
155
155
|
$to = _ranges$i.$to;
|
|
156
156
|
var mapping = tr.mapping.slice(mapFrom);
|
|
157
|
-
tr.replace(mapping.map($from.pos), mapping.map($to.pos), i ?
|
|
157
|
+
tr.replace(mapping.map($from.pos), mapping.map($to.pos), i ? _model.Slice.empty : content);
|
|
158
158
|
}
|
|
159
|
-
var sel =
|
|
159
|
+
var sel = _state.Selection.findFrom(tr.doc.resolve(tr.mapping.slice(mapFrom).map(this.to)), -1);
|
|
160
160
|
if (sel) {
|
|
161
161
|
tr.setSelection(sel);
|
|
162
162
|
}
|
|
@@ -164,7 +164,7 @@ var CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
164
164
|
}, {
|
|
165
165
|
key: "replaceWith",
|
|
166
166
|
value: function replaceWith(tr, node) {
|
|
167
|
-
this.replace(tr, new
|
|
167
|
+
this.replace(tr, new _model.Slice(_model.Fragment.from(node), 0, 0));
|
|
168
168
|
}
|
|
169
169
|
}, {
|
|
170
170
|
key: "forEachCell",
|
|
@@ -336,6 +336,6 @@ var CellSelection = /*#__PURE__*/function (_Selection) {
|
|
|
336
336
|
}
|
|
337
337
|
}]);
|
|
338
338
|
return CellSelection;
|
|
339
|
-
}(
|
|
339
|
+
}(_state.Selection);
|
|
340
340
|
exports.CellSelection = CellSelection;
|
|
341
|
-
|
|
341
|
+
_state.Selection.jsonID('cell', CellSelection);
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.handleKeyDown = void 0;
|
|
7
7
|
exports.handleMouseDown = handleMouseDown;
|
|
8
8
|
exports.handleTripleClick = handleTripleClick;
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
9
|
+
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
10
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
11
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
12
|
var _cellSelection = require("../cell-selection");
|
|
13
13
|
var _utils = require("../utils");
|
|
14
14
|
var _cells = require("../utils/cells");
|
|
@@ -17,7 +17,7 @@ var _pluginKey = require("./plugin-key");
|
|
|
17
17
|
// This file defines a number of helpers for wiring up user input to
|
|
18
18
|
// table-related functionality.
|
|
19
19
|
|
|
20
|
-
var handleKeyDown = (0,
|
|
20
|
+
var handleKeyDown = (0, _keymap.keydownHandler)({
|
|
21
21
|
ArrowLeft: arrow('horiz', -1),
|
|
22
22
|
ArrowRight: arrow('horiz', 1),
|
|
23
23
|
ArrowUp: arrow('vert', -1),
|
|
@@ -46,7 +46,7 @@ function arrow(axis, dir) {
|
|
|
46
46
|
if (dispatch) {
|
|
47
47
|
var sel = state.selection;
|
|
48
48
|
if (sel instanceof _cellSelection.CellSelection) {
|
|
49
|
-
return maybeSetSelection(state, dispatch,
|
|
49
|
+
return maybeSetSelection(state, dispatch, _state.Selection.near(sel.$headCell, dir));
|
|
50
50
|
}
|
|
51
51
|
if (axis !== 'horiz' && !sel.empty) {
|
|
52
52
|
return false;
|
|
@@ -56,17 +56,17 @@ function arrow(axis, dir) {
|
|
|
56
56
|
return false;
|
|
57
57
|
}
|
|
58
58
|
if (axis === 'horiz') {
|
|
59
|
-
return maybeSetSelection(state, dispatch,
|
|
59
|
+
return maybeSetSelection(state, dispatch, _state.Selection.near(state.doc.resolve(sel.head + dir), dir));
|
|
60
60
|
}
|
|
61
61
|
var $cell = state.doc.resolve(end);
|
|
62
62
|
var $next = (0, _cells.nextCell)($cell, axis, dir);
|
|
63
63
|
var newSel;
|
|
64
64
|
if ($next) {
|
|
65
|
-
newSel =
|
|
65
|
+
newSel = _state.Selection.near($next, 1);
|
|
66
66
|
} else if (dir < 0) {
|
|
67
|
-
newSel =
|
|
67
|
+
newSel = _state.Selection.near(state.doc.resolve($cell.before(-1)), -1);
|
|
68
68
|
} else {
|
|
69
|
-
newSel =
|
|
69
|
+
newSel = _state.Selection.near(state.doc.resolve($cell.after(-1)), 1);
|
|
70
70
|
}
|
|
71
71
|
return maybeSetSelection(state, dispatch, newSel);
|
|
72
72
|
}
|
|
@@ -114,7 +114,7 @@ function deleteCellSelection(state, dispatch) {
|
|
|
114
114
|
var baseContent = (0, _utils.tableNodeTypes)(state.schema).cell.createAndFill().content;
|
|
115
115
|
sel.forEachCell(function (cell, pos) {
|
|
116
116
|
if (!cell.content.eq(baseContent)) {
|
|
117
|
-
tr.replace(tr.mapping.map(pos + 1), tr.mapping.map(pos + cell.nodeSize - 1), new
|
|
117
|
+
tr.replace(tr.mapping.map(pos + 1), tr.mapping.map(pos + cell.nodeSize - 1), new _model.Slice(baseContent, 0, 0));
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
120
|
if (tr.docChanged) {
|
|
@@ -213,7 +213,7 @@ function handleMouseDown(view, event) {
|
|
|
213
213
|
// Check whether the cursor is at the end of a cell (so that further
|
|
214
214
|
// motion would move out of the cell)
|
|
215
215
|
function atEndOfCell(view, axis, dir) {
|
|
216
|
-
if (!(view.state.selection instanceof
|
|
216
|
+
if (!(view.state.selection instanceof _state.TextSelection)) {
|
|
217
217
|
return null;
|
|
218
218
|
}
|
|
219
219
|
var $head = view.state.selection.$head;
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tableEditingKey = exports.fixTablesKey = void 0;
|
|
7
|
-
var
|
|
8
|
-
var tableEditingKey = new
|
|
7
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
+
var tableEditingKey = new _state.PluginKey('selectingCells');
|
|
9
9
|
exports.tableEditingKey = tableEditingKey;
|
|
10
|
-
var fixTablesKey = new
|
|
10
|
+
var fixTablesKey = new _state.PluginKey('fix-tables');
|
|
11
11
|
exports.fixTablesKey = fixTablesKey;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tableEditing = tableEditing;
|
|
7
|
-
var
|
|
7
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
8
|
var _utils = require("../utils");
|
|
9
9
|
var _drawCellSelection = require("../utils/draw-cell-selection");
|
|
10
10
|
var _fixTables = require("../utils/fix-tables");
|
|
@@ -29,7 +29,7 @@ function tableEditing() {
|
|
|
29
29
|
_ref$allowTableNodeSe = _ref.allowTableNodeSelection,
|
|
30
30
|
allowTableNodeSelection = _ref$allowTableNodeSe === void 0 ? false : _ref$allowTableNodeSe,
|
|
31
31
|
reportFixedTable = _ref.reportFixedTable;
|
|
32
|
-
return new
|
|
32
|
+
return new _state.Plugin({
|
|
33
33
|
key: _pluginKey.tableEditingKey,
|
|
34
34
|
// This piece of state is used to remember when a mouse-drag
|
|
35
35
|
// cell-selection is happening, so that it can continue even as
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.cloneRowAt = exports.addRowAt = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var
|
|
9
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
10
|
var _tableMap = require("../table-map");
|
|
11
11
|
var _addRow = require("./add-row");
|
|
12
12
|
var _cloneTr = require("./clone-tr");
|
|
@@ -80,7 +80,7 @@ var cloneRowAt = function cloneRowAt(rowIndex) {
|
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
return (0,
|
|
83
|
+
return (0, _utils.safeInsert)(tableNodes.row.create(cloneRow.attrs, cells), rowPos)(tr);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
return tr;
|
|
@@ -9,8 +9,8 @@ exports.fitSlice = fitSlice;
|
|
|
9
9
|
exports.insertCells = insertCells;
|
|
10
10
|
exports.pastedCells = pastedCells;
|
|
11
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
|
-
var
|
|
13
|
-
var
|
|
12
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
13
|
+
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
14
14
|
var _cellSelection = require("../cell-selection");
|
|
15
15
|
var _tableMap = require("../table-map");
|
|
16
16
|
var _colspan = require("./colspan");
|
|
@@ -46,7 +46,7 @@ function stripHeaderType(schema, cells) {
|
|
|
46
46
|
var tableCell = cell.type === cellNodeType ? cell : (_cellNodeType$createA = cellNodeType.createAndFill(cell.attrs, cell.content, cell.marks)) !== null && _cellNodeType$createA !== void 0 ? _cellNodeType$createA : cell;
|
|
47
47
|
newCells.push(tableCell);
|
|
48
48
|
});
|
|
49
|
-
return
|
|
49
|
+
return _model.Fragment.from(newCells);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// : (Slice) → ?{width: number, height: number, rows: [Fragment]}
|
|
@@ -80,12 +80,12 @@ function pastedCells(slice) {
|
|
|
80
80
|
var left = i ? 0 : Math.max(0, openStart - 1);
|
|
81
81
|
var right = i < content.childCount - 1 ? 0 : Math.max(0, openEnd - 1);
|
|
82
82
|
if (left || right) {
|
|
83
|
-
cells = fitSlice((0, _tableNodeTypes.tableNodeTypes)(schema).row, new
|
|
83
|
+
cells = fitSlice((0, _tableNodeTypes.tableNodeTypes)(schema).row, new _model.Slice(cells, left, right)).content;
|
|
84
84
|
}
|
|
85
85
|
rows.push(cells);
|
|
86
86
|
}
|
|
87
87
|
} else if (role === 'cell' || role === 'header_cell') {
|
|
88
|
-
rows.push(openStart || openEnd ? fitSlice((0, _tableNodeTypes.tableNodeTypes)(schema).row, new
|
|
88
|
+
rows.push(openStart || openEnd ? fitSlice((0, _tableNodeTypes.tableNodeTypes)(schema).row, new _model.Slice(content, openStart, openEnd)).content : content);
|
|
89
89
|
} else {
|
|
90
90
|
return null;
|
|
91
91
|
}
|
|
@@ -118,7 +118,7 @@ function ensureRectangular(schema, rowsFragment) {
|
|
|
118
118
|
}
|
|
119
119
|
for (var _r2 = 0; _r2 < widths.length; _r2++) {
|
|
120
120
|
if (_r2 >= rows.length) {
|
|
121
|
-
rows.push(
|
|
121
|
+
rows.push(_model.Fragment.empty);
|
|
122
122
|
}
|
|
123
123
|
if (widths[_r2] < width) {
|
|
124
124
|
var empty = (0, _tableNodeTypes.tableNodeTypes)(schema).cell.createAndFill();
|
|
@@ -126,7 +126,7 @@ function ensureRectangular(schema, rowsFragment) {
|
|
|
126
126
|
for (var _i = widths[_r2]; _i < width; _i++) {
|
|
127
127
|
cells.push(empty);
|
|
128
128
|
}
|
|
129
|
-
rows[_r2] = rows[_r2].append(
|
|
129
|
+
rows[_r2] = rows[_r2].append(_model.Fragment.from(cells));
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
return {
|
|
@@ -140,7 +140,7 @@ function fitSlice(nodeType, slice) {
|
|
|
140
140
|
if (!node) {
|
|
141
141
|
throw new Error("fitSlice: unable to create node");
|
|
142
142
|
}
|
|
143
|
-
var tr = new
|
|
143
|
+
var tr = new _transform.Transform(node).replace(0, node.content.size, slice);
|
|
144
144
|
return tr.doc;
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -172,7 +172,7 @@ function clipCells(_ref, newWidth, newHeight) {
|
|
|
172
172
|
added[row + j] = (added[row + j] || 0) + cell.attrs.colspan;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
newRows.push(
|
|
175
|
+
newRows.push(_model.Fragment.from(cells));
|
|
176
176
|
}
|
|
177
177
|
rows = newRows;
|
|
178
178
|
width = newWidth;
|
|
@@ -191,7 +191,7 @@ function clipCells(_ref, newWidth, newHeight) {
|
|
|
191
191
|
}
|
|
192
192
|
_cells.push(_cell);
|
|
193
193
|
}
|
|
194
|
-
_newRows.push(
|
|
194
|
+
_newRows.push(_model.Fragment.from(_cells));
|
|
195
195
|
}
|
|
196
196
|
rows = _newRows;
|
|
197
197
|
height = newHeight;
|
|
@@ -243,7 +243,7 @@ function growTable(tr, map, table, start, width, height, mapFrom) {
|
|
|
243
243
|
}
|
|
244
244
|
_cells2.push(header ? emptyHead || (emptyHead = types.header_cell.createAndFill()) : empty || (empty = types.cell.createAndFill()));
|
|
245
245
|
}
|
|
246
|
-
var emptyRow = types.row.create(null,
|
|
246
|
+
var emptyRow = types.row.create(null, _model.Fragment.from(_cells2));
|
|
247
247
|
var rows = [];
|
|
248
248
|
for (var _i4 = map.height; _i4 < height; _i4++) {
|
|
249
249
|
rows.push(emptyRow);
|
|
@@ -395,7 +395,7 @@ function insertCells(state, dispatch, tableStart, rect, cells) {
|
|
|
395
395
|
for (var row = top; row < bottom; row++) {
|
|
396
396
|
var from = map.positionAt(row, left, table);
|
|
397
397
|
var to = map.positionAt(row, right, table);
|
|
398
|
-
tr.replace(tr.mapping.slice(mapFrom).map(from + tableStart), tr.mapping.slice(mapFrom).map(to + tableStart), new
|
|
398
|
+
tr.replace(tr.mapping.slice(mapFrom).map(from + tableStart), tr.mapping.slice(mapFrom).map(to + tableStart), new _model.Slice(cells.rows[row - top], 0, 0));
|
|
399
399
|
}
|
|
400
400
|
recomp();
|
|
401
401
|
applyHeaderCells(tr, map, state, tableStart, table, headerRowEnabled, headerColumnEnabled);
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.drawCellSelection = drawCellSelection;
|
|
7
|
-
var
|
|
7
|
+
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
8
8
|
var _cellSelection = require("../cell-selection");
|
|
9
9
|
function drawCellSelection(state) {
|
|
10
10
|
if (!(state.selection instanceof _cellSelection.CellSelection)) {
|
|
@@ -12,9 +12,9 @@ function drawCellSelection(state) {
|
|
|
12
12
|
}
|
|
13
13
|
var cells = [];
|
|
14
14
|
state.selection.forEachCell(function (node, pos) {
|
|
15
|
-
cells.push(
|
|
15
|
+
cells.push(_view.Decoration.node(pos, pos + node.nodeSize, {
|
|
16
16
|
class: 'selectedCell'
|
|
17
17
|
}));
|
|
18
18
|
});
|
|
19
|
-
return
|
|
19
|
+
return _view.DecorationSet.create(state.doc, cells);
|
|
20
20
|
}
|
package/dist/cjs/utils/find.js
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.findTableClosestToPos = exports.findTable = exports.findCellRectClosestToPos = exports.findCellClosestToPos = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
8
|
var _tableMap = require("../table-map");
|
|
9
9
|
// Iterates over parent nodes, returning the closest table node.
|
|
10
10
|
var findTable = function findTable(selection) {
|
|
11
|
-
return (0,
|
|
11
|
+
return (0, _utils.findParentNode)(function (node) {
|
|
12
12
|
return node.type.spec.tableRole && node.type.spec.tableRole === 'table';
|
|
13
13
|
})(selection);
|
|
14
14
|
};
|
|
@@ -19,7 +19,7 @@ var findTableClosestToPos = function findTableClosestToPos($pos) {
|
|
|
19
19
|
var predicate = function predicate(node) {
|
|
20
20
|
return node.type.spec.tableRole && node.type.spec.tableRole === 'table';
|
|
21
21
|
};
|
|
22
|
-
return (0,
|
|
22
|
+
return (0, _utils.findParentNodeClosestToPos)($pos, predicate);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
// Iterates over parent nodes, returning a table cell or a table header node closest to a given `$pos`.
|
|
@@ -28,7 +28,7 @@ var findCellClosestToPos = function findCellClosestToPos($pos) {
|
|
|
28
28
|
var predicate = function predicate(node) {
|
|
29
29
|
return node.type.spec.tableRole && /cell/i.test(node.type.spec.tableRole);
|
|
30
30
|
};
|
|
31
|
-
return (0,
|
|
31
|
+
return (0, _utils.findParentNodeClosestToPos)($pos, predicate);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
// Returns the rectangle spanning a cell closest to a given `$pos`.
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.forEachCellInRow = exports.forEachCellInColumn = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
8
|
var _cloneTr = require("./clone-tr");
|
|
9
9
|
var _getCellsInColumn = require("./get-cells-in-column");
|
|
10
10
|
var _getCellsInRow = require("./get-cells-in-row");
|
|
@@ -19,7 +19,7 @@ var forEachCellInColumn = function forEachCellInColumn(columnIndex, cellTransfor
|
|
|
19
19
|
}
|
|
20
20
|
if (setCursorToLastCell) {
|
|
21
21
|
var $pos = tr.doc.resolve(tr.mapping.map(cells[cells.length - 1].pos));
|
|
22
|
-
tr.setSelection(
|
|
22
|
+
tr.setSelection(_state.Selection.near($pos));
|
|
23
23
|
}
|
|
24
24
|
return (0, _cloneTr.cloneTr)(tr);
|
|
25
25
|
}
|
|
@@ -39,7 +39,7 @@ var forEachCellInRow = function forEachCellInRow(rowIndex, cellTransform, setCur
|
|
|
39
39
|
}
|
|
40
40
|
if (setCursorToLastCell) {
|
|
41
41
|
var $pos = tr.doc.resolve(tr.mapping.map(cells[cells.length - 1].pos));
|
|
42
|
-
tr.setSelection(
|
|
42
|
+
tr.setSelection(_state.Selection.near($pos));
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
return tr;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getCellSelectionRanges = getCellSelectionRanges;
|
|
7
|
-
var
|
|
7
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
8
|
var _tableMap = require("../table-map");
|
|
9
9
|
function getCellSelectionRanges($anchorCell, $headCell) {
|
|
10
10
|
var table = $anchorCell.node(-1);
|
|
@@ -24,6 +24,6 @@ function getCellSelectionRanges($anchorCell, $headCell) {
|
|
|
24
24
|
throw new Error("No cell at position ".concat(pos));
|
|
25
25
|
}
|
|
26
26
|
var from = pos + start + 1;
|
|
27
|
-
return new
|
|
27
|
+
return new _state.SelectionRange(doc.resolve(from), doc.resolve(from + cell.content.size));
|
|
28
28
|
});
|
|
29
29
|
}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.goToNextCell = goToNextCell;
|
|
7
|
-
var
|
|
7
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
8
|
var _selectionCell = require("./selection-cell");
|
|
9
9
|
var _tables = require("./tables");
|
|
10
10
|
function moveCellForward($pos) {
|
|
@@ -29,7 +29,7 @@ function goToNextCell(direction) {
|
|
|
29
29
|
}
|
|
30
30
|
if (dispatch) {
|
|
31
31
|
var $cell = state.doc.resolve(cell);
|
|
32
|
-
dispatch(state.tr.setSelection(
|
|
32
|
+
dispatch(state.tr.setSelection(_state.TextSelection.between($cell, moveCellForward($cell))).scrollIntoView());
|
|
33
33
|
}
|
|
34
34
|
return true;
|
|
35
35
|
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.handlePaste = handlePaste;
|
|
7
|
-
var
|
|
7
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
8
8
|
var _cellSelection = require("../cell-selection");
|
|
9
9
|
var _tableMap2 = require("../table-map");
|
|
10
10
|
var _selectionCell = require("../utils/selection-cell");
|
|
@@ -25,7 +25,7 @@ function handlePaste(view, event, slice) {
|
|
|
25
25
|
cells = {
|
|
26
26
|
width: 1,
|
|
27
27
|
height: 1,
|
|
28
|
-
rows: [
|
|
28
|
+
rows: [_model.Fragment.from((0, _copyPaste.fitSlice)((0, _tableNodeTypes.tableNodeTypes)(view.state.schema).cell, slice))]
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
31
|
var table = sel.$anchorCell.node(-1);
|
|
@@ -80,6 +80,8 @@ var clearColumnWidthOfCells = function clearColumnWidthOfCells(cells, rect, tabl
|
|
|
80
80
|
}
|
|
81
81
|
for (var _i = 0, _overlappingCells = overlappingCells; _i < _overlappingCells.length; _i++) {
|
|
82
82
|
var cell = _overlappingCells[_i];
|
|
83
|
+
// TODO: ED-13910 unblock Prosemirror bump
|
|
84
|
+
// @ts-ignore
|
|
83
85
|
cell.attrs.colwidth = null;
|
|
84
86
|
}
|
|
85
87
|
return cells;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.normalizeSelection = normalizeSelection;
|
|
7
|
-
var
|
|
7
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
8
|
var _cellSelection = require("../cell-selection");
|
|
9
9
|
var _tableMap = require("../table-map");
|
|
10
10
|
function normalizeSelection(state, transaction, allowTableNodeSelection) {
|
|
@@ -14,10 +14,10 @@ function normalizeSelection(state, transaction, allowTableNodeSelection) {
|
|
|
14
14
|
doc = _ref.doc;
|
|
15
15
|
var normalize;
|
|
16
16
|
var role;
|
|
17
|
-
if (sel instanceof
|
|
17
|
+
if (sel instanceof _state.NodeSelection) {
|
|
18
18
|
role = sel.node.type.spec.tableRole;
|
|
19
19
|
}
|
|
20
|
-
if (sel instanceof
|
|
20
|
+
if (sel instanceof _state.NodeSelection && role) {
|
|
21
21
|
if (role === 'cell' || role === 'header_cell') {
|
|
22
22
|
normalize = _cellSelection.CellSelection.create(doc, sel.from);
|
|
23
23
|
} else if (role === 'row') {
|
|
@@ -29,10 +29,10 @@ function normalizeSelection(state, transaction, allowTableNodeSelection) {
|
|
|
29
29
|
var lastCell = start + map.map[map.width * map.height - 1];
|
|
30
30
|
normalize = _cellSelection.CellSelection.create(doc, start + 1, lastCell);
|
|
31
31
|
}
|
|
32
|
-
} else if (sel instanceof
|
|
33
|
-
normalize =
|
|
34
|
-
} else if (sel instanceof
|
|
35
|
-
normalize =
|
|
32
|
+
} else if (sel instanceof _state.TextSelection && isCellBoundarySelection(sel)) {
|
|
33
|
+
normalize = _state.TextSelection.create(doc, sel.from);
|
|
34
|
+
} else if (sel instanceof _state.TextSelection && isTextSelectionAcrossCells(sel)) {
|
|
35
|
+
normalize = _state.TextSelection.create(doc, sel.$from.start(), sel.$from.end());
|
|
36
36
|
}
|
|
37
37
|
if (normalize) {
|
|
38
38
|
(tr || (tr = state.tr)).setSelection(normalize);
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.removeSelectedColumns = exports.removeColumnClosestToPos = exports.removeColumnAt = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
10
|
var _tableMap = require("../table-map");
|
|
11
11
|
var _cloneTr = require("./clone-tr");
|
|
12
12
|
var _colspan = require("./colspan");
|
|
@@ -102,7 +102,7 @@ var removeColumnClosestToPos = function removeColumnClosestToPos($pos) {
|
|
|
102
102
|
return function (tr) {
|
|
103
103
|
var rect = (0, _find.findCellRectClosestToPos)($pos);
|
|
104
104
|
if (rect) {
|
|
105
|
-
return removeColumnAt(rect.left)((0,
|
|
105
|
+
return removeColumnAt(rect.left)((0, _utils.setTextSelection)($pos.pos)(tr));
|
|
106
106
|
}
|
|
107
107
|
return tr;
|
|
108
108
|
};
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.removeSelectedRows = exports.removeRowClosestToPos = exports.removeRowAt = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var
|
|
9
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
10
10
|
var _tableMap = require("../table-map");
|
|
11
11
|
var _cloneTr = require("./clone-tr");
|
|
12
12
|
var _find = require("./find");
|
|
@@ -117,7 +117,7 @@ var removeRowClosestToPos = function removeRowClosestToPos($pos) {
|
|
|
117
117
|
return function (tr) {
|
|
118
118
|
var rect = (0, _find.findCellRectClosestToPos)($pos);
|
|
119
119
|
if (rect) {
|
|
120
|
-
return removeRowAt(rect.top)((0,
|
|
120
|
+
return removeRowAt(rect.top)((0, _utils.setTextSelection)($pos.pos)(tr));
|
|
121
121
|
}
|
|
122
122
|
return tr;
|
|
123
123
|
};
|
|
@@ -4,17 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.replaceSelectedTable = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
7
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
8
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
9
|
var _find = require("./find");
|
|
10
10
|
var _isSelected = require("./is-selected");
|
|
11
11
|
var replaceSelectedTable = function replaceSelectedTable(state, content) {
|
|
12
12
|
if ((0, _isSelected.isTableSelected)(state.selection)) {
|
|
13
13
|
var table = (0, _find.findTable)(state.selection);
|
|
14
14
|
if (table) {
|
|
15
|
-
var slice = typeof content === 'string' ? new
|
|
15
|
+
var slice = typeof content === 'string' ? new _model.Slice(_model.Fragment.from(state.schema.text(content)), 0, 0) : content;
|
|
16
16
|
var tr = state.tr.replace(table.pos, table.pos + table.node.nodeSize, slice);
|
|
17
|
-
tr.setSelection(
|
|
17
|
+
tr.setSelection(_state.TextSelection.create(tr.doc, table.pos + slice.size + 1));
|
|
18
18
|
return tr;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.cellWrapping = cellWrapping;
|
|
8
8
|
exports.splitCellWithType = splitCellWithType;
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var
|
|
10
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
11
11
|
var _cellSelection = require("../cell-selection");
|
|
12
12
|
var _cells = require("./cells");
|
|
13
13
|
var _selectionRect = require("./selection-rect");
|
|
@@ -95,7 +95,7 @@ function splitCellWithType(getCellType) {
|
|
|
95
95
|
}), attrs[0]);
|
|
96
96
|
}
|
|
97
97
|
var $lastCellPosition = lastCell && tr.doc.resolve(lastCell);
|
|
98
|
-
if (sel instanceof _cellSelection.CellSelection && $lastCellPosition instanceof
|
|
98
|
+
if (sel instanceof _cellSelection.CellSelection && $lastCellPosition instanceof _model.ResolvedPos) {
|
|
99
99
|
var cellSelection = new _cellSelection.CellSelection(tr.doc.resolve(sel.$anchorCell.pos), $lastCellPosition);
|
|
100
100
|
tr.setSelection(cellSelection);
|
|
101
101
|
}
|
package/dist/cjs/version.json
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
// in the user interaction part of table selections (so that you
|
|
6
6
|
// actually get such selections when you select across cells).
|
|
7
7
|
|
|
8
|
-
import { Fragment, Slice } from 'prosemirror
|
|
9
|
-
import { Selection, TextSelection } from 'prosemirror
|
|
8
|
+
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
9
|
+
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
10
10
|
import { CellBookmark } from './cell-bookmark';
|
|
11
11
|
import { TableMap } from './table-map';
|
|
12
12
|
import { pointsAtCell } from './utils/cells';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file defines a number of helpers for wiring up user input to
|
|
2
2
|
// table-related functionality.
|
|
3
3
|
|
|
4
|
-
import { keydownHandler } from 'prosemirror
|
|
5
|
-
import { Slice } from 'prosemirror
|
|
6
|
-
import { Selection, TextSelection } from 'prosemirror
|
|
4
|
+
import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
|
+
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import { Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
7
7
|
import { CellSelection } from '../cell-selection';
|
|
8
8
|
import { tableNodeTypes } from '../utils';
|
|
9
9
|
import { cellAround, nextCell } from '../utils/cells';
|