1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added in a custom menubar

This is a copy of the ProseMirror/prosemirror-menu repo files
which suggest working from a fork of this.

These changes include the ability to select callouts
from the menubar.
This commit is contained in:
Dan Brown
2022-01-09 16:37:16 +00:00
parent 47c3d4fc0f
commit 9d7174557e
11 changed files with 1193 additions and 7 deletions

View File

@ -5,6 +5,7 @@ import {exampleSetup} from "prosemirror-example-setup";
import {DOMParser, DOMSerializer} from "prosemirror-model";
import schema from "./schema";
import menu from "./menu";
class ProseMirrorView {
constructor(target, content) {
@ -16,7 +17,10 @@ class ProseMirrorView {
this.view = new EditorView(target, {
state: EditorState.create({
doc: DOMParser.fromSchema(schema).parse(renderDoc.body),
plugins: exampleSetup({schema})
plugins: [
...exampleSetup({schema, menuBar: false}),
menu,
]
})
});
}