2020-11-03 05:43:54 +08:00
|
|
|
import { Plugin, PluginKey } from 'prosemirror-state'
|
2020-11-16 06:25:25 +08:00
|
|
|
import { Extension } from '../Extension'
|
2020-11-03 05:43:54 +08:00
|
|
|
|
2020-11-16 06:25:25 +08:00
|
|
|
export const Editable = Extension.create({
|
2020-11-03 05:43:54 +08:00
|
|
|
addProseMirrorPlugins() {
|
|
|
|
return [
|
|
|
|
new Plugin({
|
|
|
|
key: new PluginKey('editable'),
|
|
|
|
props: {
|
|
|
|
editable: () => this.editor.options.editable,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
]
|
|
|
|
},
|
|
|
|
})
|
2020-11-05 00:25:25 +08:00
|
|
|
|
2020-11-16 22:40:05 +08:00
|
|
|
declare global {
|
|
|
|
namespace Tiptap {
|
|
|
|
interface AllExtensions {
|
|
|
|
Editable: typeof Editable,
|
|
|
|
}
|
2020-11-16 17:03:21 +08:00
|
|
|
}
|
|
|
|
}
|