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