@atlaskit/editor-plugin-selection-toolbar
Version:
@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core
10 lines • 331 B
JavaScript
export function getSelectionNodeTypes(state) {
var _state$selection = state.selection,
from = _state$selection.from,
to = _state$selection.to;
var selectionNodeTypes = new Set();
state.doc.nodesBetween(from, to, function (node) {
selectionNodeTypes.add(node.type);
});
return Array.from(selectionNodeTypes);
}