feat: Comment resolving (#7115)

This commit is contained in:
Tom Moor
2024-07-02 06:55:16 -04:00
committed by GitHub
parent f34557337d
commit 117c4f5009
38 changed files with 1126 additions and 291 deletions

View File

@@ -1,6 +1,11 @@
import { Command, TextSelection } from "prosemirror-state";
const collapseSelection = (): Command => (state, dispatch) => {
/**
* A prosemirror command to collapse the current selection to a cursor at the start of the selection.
*
* @returns A prosemirror command.
*/
export const collapseSelection = (): Command => (state, dispatch) => {
dispatch?.(
state.tr.setSelection(
TextSelection.create(state.doc, state.tr.selection.from)
@@ -8,5 +13,3 @@ const collapseSelection = (): Command => (state, dispatch) => {
);
return true;
};
export default collapseSelection;