@atlaskit/editor-plugin-insert-block
Version:
Insert block plugin for @atlaskit/editor-core
42 lines • 1.55 kB
JavaScript
import React from 'react';
import { BlockInsertElementBrowser } from './block-insert-element-browser';
import { DropDownButton } from './dropdown-button';
export var BlockInsertMenu = function BlockInsertMenu(props) {
if (props.items.length === 0 && !props.showElementBrowserLink) {
return null;
}
if (props.disabled) {
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(DropDownButton, {
"aria-expanded": props.open,
"aria-haspopup": true,
handleRef: props.onRef,
selected: props.open,
disabled: props.disabled,
onClick: props.onClick,
onKeyDown: props.onKeyDown,
spacing: props.spacing,
label: props.label,
"aria-keyshortcuts": "/"
}));
}
return /*#__PURE__*/React.createElement(BlockInsertElementBrowser, {
disabled: props.disabled,
editorView: props.editorView,
items: props.items,
label: props.label,
onClick: props.onClick,
onKeyDown: props.onKeyDown,
onInsert: props.onInsert,
onRef: props.onPlusButtonRef,
open: props.open,
plusButtonRef: props.plusButtonRef,
popupsBoundariesElement: props.popupsBoundariesElement,
popupsMountPoint: props.popupsMountPoint,
popupsScrollableElement: props.popupsScrollableElement,
spacing: props.spacing,
togglePlusMenuVisibility: props.togglePlusMenuVisibility,
showElementBrowserLink: props.showElementBrowserLink,
pluginInjectionApi: props.pluginInjectionApi,
isFullPageAppearance: props.isFullPageAppearance
});
};