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,8 +1,8 @@
import { Node } from "prosemirror-model";
import { Plugin, PluginKey, Transaction } from "prosemirror-state";
import { findBlockNodes } from "prosemirror-utils";
import { Decoration, DecorationSet } from "prosemirror-view";
import { v4 as uuidv4 } from "uuid";
import { findBlockNodes } from "../queries/findChildren";
type MermaidState = {
decorationSet: DecorationSet;
@@ -135,7 +135,7 @@ export default function Mermaid({
return new Plugin({
key: new PluginKey("mermaid"),
state: {
init: (_: Plugin, { doc }) => {
init: (_, { doc }) => {
const pluginState: MermaidState = {
decorationSet: DecorationSet.create(doc, []),
diagramVisibility: {},
@@ -208,7 +208,7 @@ export default function Mermaid({
},
props: {
decorations(state) {
return this.getState(state).decorationSet;
return this.getState(state)?.decorationSet;
},
},
});