2016-09-11 23:08:18 +02:00
|
|
|
const _registry = {
|
2016-09-11 17:53:44 +02:00
|
|
|
templates: {},
|
2016-09-11 23:08:18 +02:00
|
|
|
previewStyles: [],
|
|
|
|
widgets: {}
|
2016-09-11 17:53:44 +02:00
|
|
|
};
|
|
|
|
|
2016-09-11 23:08:18 +02:00
|
|
|
export default {
|
|
|
|
registerPreviewStyle(style) {
|
|
|
|
_registry.previewStyles.push(style);
|
|
|
|
},
|
|
|
|
registerPreviewTemplate(name, component) {
|
|
|
|
_registry.templates[name] = component;
|
|
|
|
},
|
|
|
|
getPreviewTemplate(name) {
|
|
|
|
return _registry.templates[name];
|
|
|
|
},
|
|
|
|
getPreviewStyles() {
|
|
|
|
return _registry.previewStyles;
|
|
|
|
},
|
|
|
|
registerWidget(name, control, preview) {
|
|
|
|
_registry.widgets[name] = { control, preview };
|
|
|
|
},
|
|
|
|
getWidget(name) {
|
|
|
|
return _registry.widgets[name];
|
|
|
|
}
|
|
|
|
};
|