improve extending nodes and marks
This commit is contained in:
@@ -66,7 +66,7 @@ declare module '@tiptap/core' {
|
||||
}
|
||||
}
|
||||
|
||||
interface NodeSchemaFields<Options> {
|
||||
interface NodeConfig<Options> {
|
||||
/**
|
||||
* Table Role
|
||||
*/
|
||||
@@ -89,14 +89,6 @@ export const Table = Node.create<TableOptions>({
|
||||
allowTableNodeSelection: false,
|
||||
},
|
||||
|
||||
extendNodeSchema(extension) {
|
||||
const context = { options: extension.options }
|
||||
|
||||
return {
|
||||
tableRole: callOrReturn(extension.config.tableRole, context),
|
||||
}
|
||||
},
|
||||
|
||||
content: 'tableRow+',
|
||||
|
||||
tableRole: 'table',
|
||||
@@ -265,4 +257,12 @@ export const Table = Node.create<TableOptions>({
|
||||
}),
|
||||
]
|
||||
},
|
||||
|
||||
extendNodeSchema(extension) {
|
||||
const context = { options: extension.options }
|
||||
|
||||
return {
|
||||
tableRole: callOrReturn(extension.config.tableRole, context),
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user