prosemirror-utils
Advanced tools
Comparing version 0.7.5 to 0.7.6
@@ -1151,4 +1151,3 @@ 'use strict'; | ||
var removeSelectedColumns = function removeSelectedColumns(tr) { | ||
var _tr = tr, | ||
selection = _tr.selection; | ||
var selection = tr.selection; | ||
@@ -1163,6 +1162,22 @@ if (isTableSelected(selection)) { | ||
var rect = map.rectBetween(selection.$anchorCell.pos - table.start, selection.$headCell.pos - table.start); | ||
for (var i = rect.right - 1; i >= rect.left; i--) { | ||
tr = removeColumnAt(i)(tr); | ||
if (rect.left == 0 && rect.right == map.width) { | ||
return false; | ||
} | ||
return tr; | ||
var pmTableRect = Object.assign({}, rect, { | ||
map: map, | ||
table: table.node, | ||
tableStart: table.start | ||
}); | ||
for (var i = pmTableRect.right - 1;; i--) { | ||
prosemirrorTables.removeColumn(tr, pmTableRect, i); | ||
if (i === pmTableRect.left) { | ||
break; | ||
} | ||
pmTableRect.table = pmTableRect.tableStart ? tr.doc.nodeAt(pmTableRect.tableStart - 1) : tr.doc; | ||
pmTableRect.map = prosemirrorTables.TableMap.get(pmTableRect.table); | ||
} | ||
return cloneTr(tr); | ||
} | ||
@@ -1182,4 +1197,3 @@ } | ||
var removeSelectedRows = function removeSelectedRows(tr) { | ||
var _tr2 = tr, | ||
selection = _tr2.selection; | ||
var selection = tr.selection; | ||
@@ -1194,6 +1208,23 @@ if (isTableSelected(selection)) { | ||
var rect = map.rectBetween(selection.$anchorCell.pos - table.start, selection.$headCell.pos - table.start); | ||
for (var i = rect.bottom - 1; i >= rect.top; i--) { | ||
tr = removeRowAt(i)(tr); | ||
if (rect.top == 0 && rect.bottom == map.height) { | ||
return false; | ||
} | ||
return tr; | ||
var pmTableRect = Object.assign({}, rect, { | ||
map: map, | ||
table: table.node, | ||
tableStart: table.start | ||
}); | ||
for (var i = pmTableRect.bottom - 1;; i--) { | ||
prosemirrorTables.removeRow(tr, pmTableRect, i); | ||
if (i === pmTableRect.top) { | ||
break; | ||
} | ||
pmTableRect.table = pmTableRect.tableStart ? tr.doc.nodeAt(pmTableRect.tableStart - 1) : tr.doc; | ||
pmTableRect.map = prosemirrorTables.TableMap.get(pmTableRect.table); | ||
} | ||
return cloneTr(tr); | ||
} | ||
@@ -1200,0 +1231,0 @@ } |
{ | ||
"name": "prosemirror-utils", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"description": "Utils library for ProseMirror", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
173755
1583