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';
|
2016-10-28 04:51:37 +02:00
|
|
|
import NumberControl from './Widgets/NumberControl';
|
|
|
|
import NumberPreview from './Widgets/NumberPreview';
|
2016-10-21 20:42:14 -02:00
|
|
|
import ListControl from './Widgets/ListControl';
|
|
|
|
import ListPreview from './Widgets/ListPreview';
|
2016-09-12 11:14:21 +02:00
|
|
|
import TextControl from './Widgets/TextControl';
|
|
|
|
import TextPreview from './Widgets/TextPreview';
|
2016-07-13 17:19:26 -03:00
|
|
|
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-10-28 04:51:37 +02:00
|
|
|
import ObjectControl from './Widgets/ObjectControl';
|
|
|
|
import ObjectPreview from './Widgets/ObjectPreview';
|
2016-05-30 16:55:32 -07:00
|
|
|
|
2016-09-11 23:08:18 +02:00
|
|
|
registry.registerWidget('string', StringControl, StringPreview);
|
2016-09-12 11:14:21 +02:00
|
|
|
registry.registerWidget('text', TextControl, TextPreview);
|
2016-10-28 04:51:37 +02:00
|
|
|
registry.registerWidget('number', NumberControl, NumberPreview);
|
2016-10-21 20:42:14 -02:00
|
|
|
registry.registerWidget('list', ListControl, ListPreview);
|
2016-09-11 23:08:18 +02:00
|
|
|
registry.registerWidget('markdown', MarkdownControl, MarkdownPreview);
|
|
|
|
registry.registerWidget('image', ImageControl, ImagePreview);
|
|
|
|
registry.registerWidget('datetime', DateTimeControl, DateTimePreview);
|
2016-10-28 04:51:37 +02:00
|
|
|
registry.registerWidget('object', ObjectControl, ObjectPreview);
|
2016-10-26 19:51:50 +02:00
|
|
|
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) {
|
2016-10-26 19:51:50 +02:00
|
|
|
return registry.getWidget(name) || registry.getWidget('unknown');
|
2016-09-11 23:08:18 +02:00
|
|
|
}
|