A configurable editor which replicates a social editors behaviour.
The following editor would add emoji characters as valid prefix characters when typing the @
key in the
editor.
import emojiRegex from 'emoji-regex';
import { SocialEditor } from '@remirror/editor-social';
const Editor = props => (
<SocialEditor
{...props}
attributes={{ 'data-testid': 'editor-social' }}
userData={[]}
tagData={[]}
onMentionChange={onChange}
atMatcherOptions={{
// Adds emoji characters the the valid prefix characters.
validPrefixCharacters: `^([\\s\\0]|${emojiRegex().source})?$`,
}}
/>
);
yarn add @remirror/editor-social