Widget fixes (#162)

* Make string the default widget if none is specified

* Linting fixes for PreviewPane

* Linting fixes for ControlPane

* Add date widget

* Fix name of date control class

* Fix spaces in list control with no fields

* Fix linting error for List Control

* Fix linting errors in raw editor

* Add Select widget

* Fix linting error
This commit is contained in:
Mathias Biilmann
2016-11-17 04:08:37 -08:00
committed by Cássio Souza
parent 0338e5c9c2
commit d81d0d416f
12 changed files with 179 additions and 67 deletions

View File

@ -39,3 +39,26 @@ for (const method in registry) {
}
window.createClass = React.createClass;
window.h = React.createElement;
const buildtInPlugins = [{
label: 'Image',
id: 'image',
fromBlock: match => match && {
image: match[2],
alt: match[1],
},
toBlock: data => `![${ data.alt }](${ data.image })`,
toPreview: (data) => {
return <img src={data.image} alt={data.alt} />;
},
pattern: /^!\[([^\]]+)\]\(([^\)]+)\)$/,
fields: [{
label: 'Image',
name: 'image',
widget: 'image',
}, {
label: 'Alt Text',
name: 'alt',
}],
}];
buildtInPlugins.forEach(plugin => registry.registerEditorComponent(plugin));