UNPKG

@atlaskit/editor-plugin-emoji

Version:

Emoji plugin for @atlaskit/editor-core

36 lines 1.01 kB
import { emojiPluginKey } from '../emojiPlugin'; export const ACTIONS = { SET_PROVIDER: 'SET_PROVIDER', SET_RESULTS: 'SET_RESULTS', SET_ASCII_MAP: 'SET_ASCII_MAP', SET_INLINE_POPUP: 'SET_INLINE_POPUP' }; export const setAsciiMap = asciiMap => tr => { return tr.setMeta(emojiPluginKey, { action: ACTIONS.SET_ASCII_MAP, params: { asciiMap } }); }; export const openTypeAhead = (typeaheadHandler, api) => inputMethod => { var _api$typeAhead; return Boolean(api === null || api === void 0 ? void 0 : (_api$typeAhead = api.typeAhead) === null || _api$typeAhead === void 0 ? void 0 : _api$typeAhead.actions.open({ triggerHandler: typeaheadHandler, inputMethod })); }; export const setProvider = provider => tr => { return tr.setMeta(emojiPluginKey, { action: ACTIONS.SET_PROVIDER, params: { provider } }); }; export const setInlineEmojiPopupOpen = open => tr => tr.setMeta(emojiPluginKey, { action: ACTIONS.SET_INLINE_POPUP, params: { open } });