add editorProps to editorOptions
This commit is contained in:
@@ -50,6 +50,7 @@ export class Editor extends EventEmitter {
|
||||
extensions: [],
|
||||
autofocus: false,
|
||||
editable: true,
|
||||
editorProps: {},
|
||||
parseOptions: {},
|
||||
onInit: () => null,
|
||||
onUpdate: () => null,
|
||||
@@ -234,6 +235,7 @@ export class Editor extends EventEmitter {
|
||||
*/
|
||||
private createView() {
|
||||
this.view = new EditorView(this.options.element, {
|
||||
...this.options.editorProps,
|
||||
dispatchTransaction: this.dispatchTransaction.bind(this),
|
||||
state: EditorState.create({
|
||||
doc: this.createDocument(this.options.content),
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Node as ProseMirrorNode, ParseOptions } from 'prosemirror-model'
|
||||
import { EditorView, Decoration, NodeView } from 'prosemirror-view'
|
||||
import {
|
||||
EditorView,
|
||||
Decoration,
|
||||
NodeView,
|
||||
EditorProps,
|
||||
} from 'prosemirror-view'
|
||||
import { EditorState, Transaction } from 'prosemirror-state'
|
||||
import { Extension } from './Extension'
|
||||
import { Node } from './Node'
|
||||
@@ -16,6 +21,7 @@ export interface EditorOptions {
|
||||
injectCSS: boolean,
|
||||
autofocus: FocusPosition,
|
||||
editable: boolean,
|
||||
editorProps: EditorProps,
|
||||
parseOptions: ParseOptions,
|
||||
onInit: () => void,
|
||||
onUpdate: () => void,
|
||||
|
||||
Reference in New Issue
Block a user