UNPKG

@atlaskit/editor-plugin-toolbar-lists-indentation

Version:

Toolbar lists and indentation plugin for @atlaskit/editor-core

32 lines 1.28 kB
import React from 'react'; import { toggleBulletList as toggleBulletListKeymap, ToolTipContent, getAriaKeyshortcuts } from '@atlaskit/editor-common/keymaps'; import { ListBulletedIcon, ToolbarButton, ToolbarTooltip } from '@atlaskit/editor-toolbar'; import { useBulletedListInfo } from './BulletedListMenuItem'; export var BulletedListButton = function BulletedListButton(_ref) { var api = _ref.api, parents = _ref.parents; var _useBulletedListInfo = useBulletedListInfo({ api: api, parents: parents }), bulletMessage = _useBulletedListInfo.bulletMessage, onClick = _useBulletedListInfo.onClick, isDisabled = _useBulletedListInfo.isDisabled, isSelected = _useBulletedListInfo.isSelected; return /*#__PURE__*/React.createElement(ToolbarTooltip, { content: /*#__PURE__*/React.createElement(ToolTipContent, { description: bulletMessage, keymap: toggleBulletListKeymap }) }, /*#__PURE__*/React.createElement(ToolbarButton, { iconBefore: /*#__PURE__*/React.createElement(ListBulletedIcon, { size: "small", label: "" }), onClick: onClick, isSelected: isSelected, isDisabled: isDisabled, ariaKeyshortcuts: getAriaKeyshortcuts(toggleBulletListKeymap), label: bulletMessage })); };