@atlaskit/editor-plugin-media
Version:
Media plugin for @atlaskit/editor-core
14 lines • 484 B
JavaScript
import { currentMediaNodeWithPos } from '../utils/current-media-node';
export function shouldShowImageBorder(editorState) {
var border = editorState.schema.marks.border;
if (!border) {
return false;
}
var nodeWithPos = currentMediaNodeWithPos(editorState);
if (!nodeWithPos) {
return false;
}
var _editorState$doc$reso = editorState.doc.resolve(nodeWithPos.pos),
parent = _editorState$doc$reso.parent;
return parent && parent.type.allowsMarkType(border);
}