UNPKG

@atlaskit/editor-plugin-list

Version:

List plugin for @atlaskit/editor-core

32 lines 1.06 kB
import React from 'react'; import { ORDERED_LIST_MENU_ITEM, TEXT_FORMATTING_SECTION, UNORDERED_LIST_MENU_ITEM } from '@atlaskit/editor-common/quick-insert/keys'; import { TEXT_FORMATTING_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank'; import { ListQuickInsertMenuItem } from './ListQuickInsertMenuItem'; export var getListQuickInsertComponents = function getListQuickInsertComponents(_ref) { var api = _ref.api; return [{ item: UNORDERED_LIST_MENU_ITEM, type: 'unordered' }, { item: ORDERED_LIST_MENU_ITEM, type: 'ordered' }].map(function (_ref2) { var item = _ref2.item, type = _ref2.type; return { key: item.key, type: item.type, parents: [{ key: TEXT_FORMATTING_SECTION.key, type: TEXT_FORMATTING_SECTION.type, rank: TEXT_FORMATTING_SECTION_RANK[item.key] }], component: function component() { return /*#__PURE__*/React.createElement(ListQuickInsertMenuItem, { api: api, type: type }); } }; }); };