44 lines
2.2 KiB
JavaScript
Raw Normal View History

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';
import ListControl from './Widgets/ListControl';
import ListPreview from './Widgets/ListPreview';
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';
import DateControl from './Widgets/DateControl';
import DatePreview from './Widgets/DatePreview';
2016-09-11 23:08:18 +02:00
import DateTimeControl from './Widgets/DateTimeControl';
import DateTimePreview from './Widgets/DateTimePreview';
import SelectControl from './Widgets/SelectControl';
import SelectPreview from './Widgets/SelectPreview';
2016-10-28 04:51:37 +02:00
import ObjectControl from './Widgets/ObjectControl';
import ObjectPreview from './Widgets/ObjectPreview';
import RelationControl from './Widgets/RelationControl';
import RelationPreview from './Widgets/RelationPreview';
2016-05-30 16:55:32 -07:00
2016-09-11 23:08:18 +02:00
registry.registerWidget('string', StringControl, StringPreview);
registry.registerWidget('text', TextControl, TextPreview);
2016-10-28 04:51:37 +02:00
registry.registerWidget('number', NumberControl, NumberPreview);
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('date', DateControl, DatePreview);
2016-09-11 23:08:18 +02:00
registry.registerWidget('datetime', DateTimeControl, DateTimePreview);
registry.registerWidget('select', SelectControl, SelectPreview);
2016-10-28 04:51:37 +02:00
registry.registerWidget('object', ObjectControl, ObjectPreview);
registry.registerWidget('relation', RelationControl, RelationPreview);
registry.registerWidget('unknown', UnknownControl, UnknownPreview);
2016-05-30 16:55:32 -07:00
export function resolveWidget(name) { // eslint-disable-line
return registry.getWidget(name || 'string') || registry.getWidget('unknown');
2016-09-11 23:08:18 +02:00
}