chore: Upgrade all of prosemirror (#5366)

Co-authored-by: Apoorv Mishra <apoorvmishra101092@gmail.com>
This commit is contained in:
Tom Moor
2023-05-24 22:24:05 -04:00
committed by GitHub
parent e340e568e2
commit d5341a486c
77 changed files with 875 additions and 675 deletions

View File

@@ -1,10 +1,9 @@
import { wrappingInputRule } from "prosemirror-inputrules";
import { NodeSpec, Node as ProsemirrorNode, NodeType } from "prosemirror-model";
import { EditorState } from "prosemirror-state";
import { Command } from "prosemirror-state";
import toggleWrap from "../commands/toggleWrap";
import { MarkdownSerializerState } from "../lib/markdown/serializer";
import isNodeActive from "../queries/isNodeActive";
import { Dispatch } from "../types";
import Node from "./Node";
export default class Blockquote extends Node {
@@ -34,17 +33,17 @@ export default class Blockquote extends Node {
return () => toggleWrap(type);
}
keys({ type }: { type: NodeType }) {
keys({ type }: { type: NodeType }): Record<string, Command> {
return {
"Ctrl->": toggleWrap(type),
"Mod-]": toggleWrap(type),
"Shift-Enter": (state: EditorState, dispatch: Dispatch) => {
"Shift-Enter": (state, dispatch) => {
if (!isNodeActive(type)(state)) {
return false;
}
const { tr, selection } = state;
dispatch(tr.split(selection.to));
dispatch?.(tr.split(selection.to));
return true;
},
};