draft-js-modifiers
Version:
Modular state modifiers for Draft.js
9 lines (7 loc) • 452 B
JavaScript
import { EditorState } from 'draft-js';
import adjustBlockDepthForContentState from 'draft-js/lib/adjustBlockDepthForContentState';
var adjustBlockDepth = function adjustBlockDepth(editorState, adjustment, maxDepth) {
var content = adjustBlockDepthForContentState(editorState.getCurrentContent(), editorState.getSelection(), adjustment, maxDepth);
return EditorState.push(editorState, content, 'adjust-depth');
};
export default adjustBlockDepth;