tiptap/packages/core/src/extensions/editable.ts

23 lines
511 B
TypeScript
Raw Normal View History

2020-11-03 05:43:54 +08:00
import { Plugin, PluginKey } from 'prosemirror-state'
import { createExtension } from '../Extension'
export const Editable = createExtension({
addProseMirrorPlugins() {
return [
new Plugin({
key: new PluginKey('editable'),
props: {
editable: () => this.editor.options.editable,
},
}),
]
},
})
2020-11-05 00:25:25 +08:00
// TODO: Editable circularly references itself!?
// declare module '../Editor' {
// interface AllExtensions {
// Editable: typeof Editable,
// }
// }