UNPKG

@atlaskit/editor-plugin-rule

Version:

Rule plugin for @atlaskit/editor-core

28 lines 1.1 kB
import React from 'react'; import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages'; import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher'; import { RULE_MENU_ITEM, STRUCTURE_SECTION } from '@atlaskit/editor-common/quick-insert/keys'; import { STRUCTURE_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank'; import { RuleQuickInsertMenuItem } from './RuleQuickInsertMenuItem'; export const getRuleQuickInsertComponents = ({ api }) => [{ key: RULE_MENU_ITEM.key, type: RULE_MENU_ITEM.type, parents: [{ key: STRUCTURE_SECTION.key, type: STRUCTURE_SECTION.type, rank: STRUCTURE_SECTION_RANK[RULE_MENU_ITEM.key] }], match: createQuickInsertMatcher(({ formatMessage }) => ({ description: formatMessage(messages.horizontalRuleDescription), keywords: ['horizontal', 'rule', 'line', 'hr'], shortcut: '---', title: formatMessage(messages.horizontalRule) })), component: () => /*#__PURE__*/React.createElement(RuleQuickInsertMenuItem, { api: api }) }];