@atlaskit/editor-plugin-block-controls
Version:
Block controls plugin for @atlaskit/editor-core
15 lines (14 loc) • 613 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.hasSurfaceControls = void 0;
/**
* Structural toolbar nodes do not render a control by themselves. Treat a surface as populated
* only once a contributor has registered an interactive descendant.
*/
var hasSurfaceControls = exports.hasSurfaceControls = function hasSurfaceControls(components) {
return components.some(function (component) {
return Boolean(component.component) || component.type === 'button' || component.type === 'menu' || component.type === 'menu-item' || component.type === 'nested-menu';
});
};