@ctzhian/tiptap 1.6.29 → 1.6.30
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.
|
@@ -6,10 +6,10 @@ import TableContextMenu from "./ContextMenu";
|
|
|
6
6
|
var hasMultipleCellSelection = function hasMultipleCellSelection(editor) {
|
|
7
7
|
var selection = editor.state.selection;
|
|
8
8
|
console.log('1️⃣ selection', selection);
|
|
9
|
+
console.log('2️⃣ cellSelection.constructor.name', selection.constructor.name);
|
|
10
|
+
console.log('2️⃣ cellSelection.ranges', selection.ranges);
|
|
9
11
|
if (selection.constructor.name === '_CellSelection') {
|
|
10
12
|
var cellSelection = selection;
|
|
11
|
-
console.log('2️⃣ cellSelection.constructor.name', cellSelection.constructor.name);
|
|
12
|
-
console.log('2️⃣ cellSelection.ranges', cellSelection.ranges);
|
|
13
13
|
console.log('2️⃣ cellSelection.$anchorCell', cellSelection.$anchorCell);
|
|
14
14
|
console.log('2️⃣ cellSelection.$headCell', cellSelection.$headCell);
|
|
15
15
|
if (cellSelection.ranges && cellSelection.ranges.length > 1) {
|
|
@@ -20,9 +20,11 @@ var hasMultipleCellSelection = function hasMultipleCellSelection(editor) {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
var selectionAny = selection;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
var isColSelection = selectionAny.isColSelection();
|
|
24
|
+
var isRowSelection = selectionAny.isRowSelection();
|
|
25
|
+
console.log('3️⃣ selectionAny.isColSelection', isColSelection);
|
|
26
|
+
console.log('3️⃣ selectionAny.isRowSelection', isRowSelection);
|
|
27
|
+
if (isColSelection || isRowSelection) {
|
|
26
28
|
return true;
|
|
27
29
|
}
|
|
28
30
|
console.log('3️⃣ selection.from', selection.from);
|
|
@@ -287,10 +289,10 @@ export var createTableContextMenuPlugin = function createTableContextMenuPlugin(
|
|
|
287
289
|
if (cellElement) {
|
|
288
290
|
var currentHasMultipleSelection = hasMultipleCellSelection(editor);
|
|
289
291
|
if (currentHasMultipleSelection) {
|
|
290
|
-
var _window$getSelection, _window$getSelection2, _window$getSelection3;
|
|
291
|
-
console.log('🍊🍊 mouseup current selection', (_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.toString());
|
|
292
|
-
(_window$
|
|
293
|
-
console.log('🍊🍊 mouseup current selection', (_window$
|
|
292
|
+
var _window$getSelection, _window$getSelection2, _window$getSelection3, _window$getSelection4, _window$getSelection5;
|
|
293
|
+
console.log('🍊🍊 mouseup current selection', (_window$getSelection = window.getSelection()) === null || _window$getSelection === void 0 ? void 0 : _window$getSelection.toString().length, (_window$getSelection2 = window.getSelection()) === null || _window$getSelection2 === void 0 ? void 0 : _window$getSelection2.toString());
|
|
294
|
+
(_window$getSelection3 = window.getSelection()) === null || _window$getSelection3 === void 0 || _window$getSelection3.removeAllRanges();
|
|
295
|
+
console.log('🍊🍊 mouseup current selection', (_window$getSelection4 = window.getSelection()) === null || _window$getSelection4 === void 0 ? void 0 : _window$getSelection4.toString().length, (_window$getSelection5 = window.getSelection()) === null || _window$getSelection5 === void 0 ? void 0 : _window$getSelection5.toString());
|
|
294
296
|
}
|
|
295
297
|
}
|
|
296
298
|
}
|