wip: add extension.name
This commit is contained in:
@@ -367,24 +367,27 @@ declare module '@tiptap/core' {
|
||||
export class Node<Options = any> {
|
||||
type = 'node'
|
||||
|
||||
config: NodeConfig = {
|
||||
name: 'node',
|
||||
priority: 100,
|
||||
defaultOptions: {},
|
||||
}
|
||||
|
||||
options: Options
|
||||
name = 'node'
|
||||
|
||||
parent: Node | null = null
|
||||
|
||||
child: Node | null = null
|
||||
|
||||
options: Options
|
||||
|
||||
config: NodeConfig = {
|
||||
name: this.name,
|
||||
priority: 100,
|
||||
defaultOptions: {},
|
||||
}
|
||||
|
||||
constructor(config: Partial<NodeConfig<Options>> = {}) {
|
||||
this.config = {
|
||||
...this.config,
|
||||
...config,
|
||||
}
|
||||
|
||||
this.name = this.config.name
|
||||
this.options = this.config.defaultOptions
|
||||
}
|
||||
|
||||
@@ -405,6 +408,10 @@ export class Node<Options = any> {
|
||||
|
||||
this.child = extension
|
||||
|
||||
extension.name = extendedConfig.name
|
||||
? extendedConfig.name
|
||||
: this.name
|
||||
|
||||
extension.options = {
|
||||
...extension.parent.options,
|
||||
...extension.options,
|
||||
|
||||
Reference in New Issue
Block a user