add historyPluginOptions
This commit is contained in:
@@ -4,14 +4,13 @@ export default abstract class Extension {
|
|||||||
|
|
||||||
constructor(options = {}) {
|
constructor(options = {}) {
|
||||||
this.options = {
|
this.options = {
|
||||||
...this.defaultOptions,
|
...this.defaultOptions(),
|
||||||
...options,
|
...options,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
editor!: Editor
|
editor!: Editor
|
||||||
options: { [key: string]: any } = {}
|
options: { [key: string]: any } = {}
|
||||||
defaultOptions: { [key: string]: any } = {}
|
|
||||||
|
|
||||||
public abstract name: string
|
public abstract name: string
|
||||||
|
|
||||||
@@ -23,6 +22,10 @@ export default abstract class Extension {
|
|||||||
this.editor = editor
|
this.editor = editor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defaultOptions(): { [key: string]: any } {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
|
||||||
update(): any {
|
update(): any {
|
||||||
return () => {}
|
return () => {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,12 @@ export default class History extends Extension {
|
|||||||
|
|
||||||
name = 'history'
|
name = 'history'
|
||||||
|
|
||||||
|
defaultOptions() {
|
||||||
|
return {
|
||||||
|
historyPluginOptions: {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
commands(): CommandSpec {
|
commands(): CommandSpec {
|
||||||
return {
|
return {
|
||||||
undo: (next, { view }) => {
|
undo: (next, { view }) => {
|
||||||
@@ -41,7 +47,7 @@ export default class History extends Extension {
|
|||||||
|
|
||||||
plugins() {
|
plugins() {
|
||||||
return [
|
return [
|
||||||
history()
|
history(this.options.historyPluginOptions)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user