UNPKG

@atlaskit/editor-plugin-media-insert

Version:

Media Insert plugin for @atlaskit/editor-core

33 lines 1.39 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 { MEDIA_INSERT_MENU_ITEM, MEDIA_SECTION } from '@atlaskit/editor-common/quick-insert/keys'; import { MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank'; import { MediaInsertQuickInsertMenuItem } from './MediaInsertQuickInsertMenuItem'; export var getMediaInsertQuickInsertComponents = function getMediaInsertQuickInsertComponents(_ref) { var api = _ref.api, config = _ref.config; return [{ key: MEDIA_INSERT_MENU_ITEM.key, type: MEDIA_INSERT_MENU_ITEM.type, parents: [{ key: MEDIA_SECTION.key, type: MEDIA_SECTION.type, rank: MEDIA_SECTION_RANK[MEDIA_INSERT_MENU_ITEM.key] }], match: createQuickInsertMatcher(function (_ref2) { var formatMessage = _ref2.formatMessage; return { description: formatMessage(messages.mediaFilesDescription), keywords: ['attachment', 'gif', 'media', 'picture', 'image', 'video', 'file'], title: formatMessage(messages.mediaFiles) }; }), component: function component() { return /*#__PURE__*/React.createElement(MediaInsertQuickInsertMenuItem, { api: api, config: config }); } }]; };