|
7 | 7 | * @module |
8 | 8 | */ |
9 | 9 |
|
10 | | -import { Plugin, PluginKey, EditorState, Transaction } from 'prosemirror-state'; |
| 10 | +import { Plugin, PluginKey, EditorState } from 'prosemirror-state'; |
11 | 11 | import { EditorView, Decoration, DecorationSet } from 'prosemirror-view'; |
12 | | -import { Node as PMNode, ResolvedPos } from 'prosemirror-model'; |
| 12 | +import { Node as PMNode } from 'prosemirror-model'; |
13 | 13 |
|
14 | 14 | /** |
15 | 15 | * State for multi-block selection. |
@@ -59,9 +59,8 @@ function getBlockAtPos( |
59 | 59 | */ |
60 | 60 | function getAllBlockPositions(doc: PMNode): number[] { |
61 | 61 | const positions: number[] = []; |
62 | | - let pos = 0; |
63 | 62 |
|
64 | | - doc.forEach((node, offset) => { |
| 63 | + doc.forEach((_node, offset) => { |
65 | 64 | positions.push(offset); |
66 | 65 | }); |
67 | 66 |
|
@@ -146,7 +145,7 @@ export function createMultiBlockSelectionPlugin( |
146 | 145 | }; |
147 | 146 | }, |
148 | 147 |
|
149 | | - apply(tr, state, oldEditorState, newEditorState): MultiBlockSelectionState { |
| 148 | + apply(tr, state, _oldEditorState, newEditorState): MultiBlockSelectionState { |
150 | 149 | // Check for meta to update state |
151 | 150 | const meta = tr.getMeta(MULTI_BLOCK_SELECTION_KEY); |
152 | 151 | if (meta) { |
@@ -189,7 +188,7 @@ export function createMultiBlockSelectionPlugin( |
189 | 188 | return createBlockSelectionDecorations(state, pluginState.selectedBlocks); |
190 | 189 | }, |
191 | 190 |
|
192 | | - handleClick(view: EditorView, pos: number, event: MouseEvent): boolean { |
| 191 | + handleClick(view: EditorView, _pos: number, event: MouseEvent): boolean { |
193 | 192 | // Clear selection on regular click without modifiers |
194 | 193 | if (!event.shiftKey && !event.metaKey && !event.ctrlKey) { |
195 | 194 | const state = MULTI_BLOCK_SELECTION_KEY.getState(view.state); |
@@ -269,7 +268,7 @@ export function createMultiBlockSelectionPlugin( |
269 | 268 |
|
270 | 269 | const state = MULTI_BLOCK_SELECTION_KEY.getState(view.state); |
271 | 270 |
|
272 | | - if (event.shiftKey && state?.anchorPos !== null) { |
| 271 | + if (event.shiftKey && state && state.anchorPos !== null) { |
273 | 272 | // Range selection |
274 | 273 | const blocks = getBlocksInRange(view.state.doc, state.anchorPos, block.pos); |
275 | 274 | view.dispatch( |
|
0 commit comments