UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

38 lines (33 loc) 714 B
import { ComponentClass } from 'react'; import { Mark } from '../../../prosemirror'; import Code from './code'; import Em from './em'; import Link from './link'; import Strike from './strike'; import Strong from './strong'; import Subsup from './subsup'; import TextColor from './textColor'; import Underline from './underline'; export const markToReact = { 'code': Code, 'em': Em, 'link': Link, 'strike': Strike, 'strong': Strong, 'subsup': Subsup, 'textColor': TextColor, 'underline': Underline, }; export const toReact = (mark: Mark): ComponentClass<any> => { return markToReact[mark.type.name]; }; export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, };