@atlaskit/editor-plugin-list
Version:
List plugin for @atlaskit/editor-core
28 lines • 826 B
JavaScript
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 const getListQuickInsertComponents = ({
api
}) => [{
item: UNORDERED_LIST_MENU_ITEM,
type: 'unordered'
}, {
item: ORDERED_LIST_MENU_ITEM,
type: 'ordered'
}].map(({
item,
type
}) => ({
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: () => /*#__PURE__*/React.createElement(ListQuickInsertMenuItem, {
api: api,
type: type
})
}));