2016-09-11 23:08:18 +02:00
|
|
|
import registry from '../lib/registry';
|
2016-07-13 17:19:26 -03:00
|
|
|
import UnknownControl from './Widgets/UnknownControl';
|
|
|
|
import UnknownPreview from './Widgets/UnknownPreview';
|
|
|
|
import StringControl from './Widgets/StringControl';
|
|
|
|
import StringPreview from './Widgets/StringPreview';
|
|
|
|
import MarkdownControl from './Widgets/MarkdownControl';
|
|
|
|
import MarkdownPreview from './Widgets/MarkdownPreview';
|
|
|
|
import ImageControl from './Widgets/ImageControl';
|
|
|
|
import ImagePreview from './Widgets/ImagePreview';
|
2016-09-11 23:08:18 +02:00
|
|
|
import DateTimeControl from './Widgets/DateTimeControl';
|
|
|
|
import DateTimePreview from './Widgets/DateTimePreview';
|
2016-05-30 16:55:32 -07:00
|
|
|
|
2016-09-11 23:08:18 +02:00
|
|
|
registry.registerWidget('string', StringControl, StringPreview);
|
|
|
|
registry.registerWidget('markdown', MarkdownControl, MarkdownPreview);
|
|
|
|
registry.registerWidget('image', ImageControl, ImagePreview);
|
|
|
|
registry.registerWidget('datetime', DateTimeControl, DateTimePreview);
|
|
|
|
registry.registerWidget('_unknown', UnknownControl, UnknownPreview);
|
2016-05-30 16:55:32 -07:00
|
|
|
|
2016-09-11 23:08:18 +02:00
|
|
|
export function resolveWidget(name) {
|
|
|
|
return registry.getWidget(name) || registry.getWidget('_unknown');
|
|
|
|
}
|