restructure commands
This commit is contained in:
@@ -3,7 +3,10 @@ import getNodeType from '../utils/getNodeType'
|
||||
import deleteProps from '../utils/deleteProps'
|
||||
import { Command } from '../types'
|
||||
|
||||
export default (typeOrName: string | NodeType, attributes: string | string[]): Command => ({ tr, state, dispatch }) => {
|
||||
/**
|
||||
* Resets node attributes to the default value.
|
||||
*/
|
||||
export const resetNodeAttributes = (typeOrName: string | NodeType, attributes: string | string[]): Command => ({ tr, state, dispatch }) => {
|
||||
const type = getNodeType(typeOrName, state.schema)
|
||||
const { selection } = tr
|
||||
const { from, to } = selection
|
||||
|
||||
Reference in New Issue
Block a user