import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
export const findExpand = (state, selection) => {
  const {
    expand,
    nestedExpand
  } = state.schema.nodes;
  return findSelectedNodeOfType([expand, nestedExpand])(selection || state.selection) || findParentNodeOfType([expand, nestedExpand])(selection || state.selection);
};