2019-12-17 06:20:05 +08:00
|
|
|
import Extension from './Extension'
|
2020-04-01 04:57:39 +08:00
|
|
|
import { NodeSpec } from 'prosemirror-model'
|
2019-12-17 06:20:05 +08:00
|
|
|
|
2020-03-06 03:30:58 +08:00
|
|
|
export default abstract class Node extends Extension {
|
2019-12-17 06:20:05 +08:00
|
|
|
|
|
|
|
constructor(options = {}) {
|
|
|
|
super(options)
|
|
|
|
}
|
|
|
|
|
2020-03-06 04:05:01 +08:00
|
|
|
public type = 'node'
|
2019-12-17 06:20:05 +08:00
|
|
|
|
2020-03-06 07:15:36 +08:00
|
|
|
public topNode = false
|
|
|
|
|
2020-04-01 04:57:39 +08:00
|
|
|
abstract schema(): NodeSpec
|
2019-12-17 06:20:05 +08:00
|
|
|
|
2020-03-30 18:40:25 +08:00
|
|
|
get schemaType() {
|
|
|
|
return this.editor.schema.nodes[this.name]
|
|
|
|
}
|
|
|
|
|
2019-12-17 06:20:05 +08:00
|
|
|
}
|