@wordpress/block-editor
Version:
36 lines (34 loc) • 899 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.RichTextToolbarButton = RichTextToolbarButton;
var _components = require("@wordpress/components");
var _keycodes = require("@wordpress/keycodes");
var _jsxRuntime = require("react/jsx-runtime");
/**
* WordPress dependencies
*/
function RichTextToolbarButton({
name,
shortcutType,
shortcutCharacter,
...props
}) {
let shortcut;
let fillName = 'RichText.ToolbarControls';
if (name) {
fillName += `.${name}`;
}
if (shortcutType && shortcutCharacter) {
shortcut = _keycodes.displayShortcut[shortcutType](shortcutCharacter);
}
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Fill, {
name: fillName,
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
...props,
shortcut: shortcut
})
});
}
//# sourceMappingURL=toolbar-button.js.map