code: function changeBlocksDepth(
    editorState: EditorState,
    adjustment: number,
    maxDepth: number,
  ): ContentState {
    const selectionState = editorState.getSelection();
    const contentState = editorState.getCurrentContent();
    let blockMap = contentState.getBlockMap();
    const blocks = getSelectedBlocksMap(editorState).map(block => {
      let depth = block.getDepth() + adjustment;
      depth = Math.max(0, Math.min(depth, maxDepth));
      return block.set('depth', depth);
    });
    blockMap = blockMap.merge(blocks);
    return contentState.merge({
      blockMap,
      selectionBefore: selectionState,
      selectionAfter: selectionState,
    });
  }
docs: Function to change depth of block(s).