import { findParentNodeOfType, findSelectedNodeOfType } from '@atlaskit/editor-prosemirror/utils';
export var findCodeBlock = function findCodeBlock(state, selection) {
  var codeBlock = state.schema.nodes.codeBlock;
  return findSelectedNodeOfType(codeBlock)(selection || state.selection) || findParentNodeOfType(codeBlock)(selection || state.selection);
};