UNPKG

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

Version:

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

34 lines 1.05 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 const BulletedListButton = ({ api, parents }) => { const { bulletMessage, onClick, isDisabled, isSelected } = useBulletedListInfo({ api, parents }); 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 })); };