UNPKG

@atlaskit/editor-plugin-insert-block

Version:

Insert block plugin for @atlaskit/editor-core

49 lines (48 loc) 1.87 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.BlockInsertMenu = void 0; var _react = _interopRequireDefault(require("react")); var _blockInsertElementBrowser = require("./block-insert-element-browser"); var _dropdownButton = require("./dropdown-button"); var BlockInsertMenu = exports.BlockInsertMenu = function BlockInsertMenu(props) { if (props.items.length === 0 && !props.showElementBrowserLink) { return null; } if (props.disabled) { return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_dropdownButton.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.default.createElement(_blockInsertElementBrowser.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 }); };