UNPKG

@atlaskit/editor-plugin-selection-toolbar

Version:

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

16 lines (15 loc) • 459 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSelectionNodeTypes = getSelectionNodeTypes; 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); }