feat: add updateAttributes() command, deprecate updateNodeAttributes(), fix #254

This commit is contained in:
Philipp Kühn
2021-04-07 21:17:02 +02:00
parent e61b2a51ed
commit aac32b4df6
5 changed files with 73 additions and 2 deletions

View File

@@ -14,6 +14,8 @@ declare module '@tiptap/core' {
}
export const updateNodeAttributes: RawCommands['updateNodeAttributes'] = (typeOrName, attributes = {}) => ({ tr, state, dispatch }) => {
console.warn('[tiptap warn]: updateNodeAttributes() is deprecated. please use updateAttributes() instead.')
const type = getNodeType(typeOrName, state.schema)
const { selection } = tr
const { ranges } = selection