@atlaskit/editor-plugin-emoji
Version:
Emoji plugin for @atlaskit/editor-core
25 lines • 1.05 kB
JavaScript
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
import { createQuickInsertMatcher } from '@atlaskit/editor-common/quick-insert/create-quick-insert-matcher';
import { EMOJI_MENU_ITEM, MEDIA_SECTION } from '@atlaskit/editor-common/quick-insert/keys';
import { MEDIA_SECTION_RANK } from '@atlaskit/editor-common/quick-insert/rank';
import { EmojiQuickInsertMenuItem } from './EmojiQuickInsertMenuItem';
export var getEmojiQuickInsertComponents = function getEmojiQuickInsertComponents() {
return [{
key: EMOJI_MENU_ITEM.key,
type: EMOJI_MENU_ITEM.type,
parents: [{
key: MEDIA_SECTION.key,
type: MEDIA_SECTION.type,
rank: MEDIA_SECTION_RANK[EMOJI_MENU_ITEM.key]
}],
match: createQuickInsertMatcher(function (_ref) {
var formatMessage = _ref.formatMessage;
return {
description: formatMessage(messages.emojiDescription),
shortcut: ':',
title: formatMessage(messages.emoji)
};
}),
component: EmojiQuickInsertMenuItem
}];
};