UNPKG

@atlaskit/editor-plugin-selection-toolbar

Version:

@atlaskit/editor-plugin-selection-toolbar for @atlaskit/editor-core

11 lines • 269 B
export function getSelectionNodeTypes(state) { const { from, to } = state.selection; const selectionNodeTypes = new Set(); state.doc.nodesBetween(from, to, node => { selectionNodeTypes.add(node.type); }); return Array.from(selectionNodeTypes); }