import { TextSelection } from '@atlaskit/editor-prosemirror/state';
export const insertContentDeleteRange = (tr, getSelectionResolvedPos, insertions, deletions) => {
  insertions.forEach(contentInsert => {
    const [content, pos] = contentInsert;
    tr.insert(tr.mapping.map(pos), content);
  });
  deletions.forEach(deleteRange => {
    const [firstPos, lastPos] = deleteRange;
    tr.delete(tr.mapping.map(firstPos), tr.mapping.map(lastPos));
  });
  tr.setSelection(new TextSelection(getSelectionResolvedPos(tr)));
};