feat: add widgets schema validation (#3841)

This commit is contained in:
Bartholomew
2020-06-03 14:43:34 +01:00
committed by GitHub
parent 995739a85c
commit 2b46608f86
27 changed files with 304 additions and 25 deletions

View File

@ -1,10 +1,12 @@
import controlComponent from './MarkdownControl';
import previewComponent from './MarkdownPreview';
import schema from './schema';
const Widget = (opts = {}) => ({
name: 'markdown',
controlComponent,
previewComponent,
schema,
...opts,
});

View File

@ -0,0 +1,27 @@
export default {
properties: {
minimal: { type: 'boolean' },
buttons: {
type: 'array',
items: {
type: 'string',
enum: [
'bold',
'italic',
'code',
'link',
'heading-one',
'heading-two',
'heading-three',
'heading-four',
'heading-five',
'heading-six',
'quote',
'bulleted-list',
'numbered-list',
],
},
},
editorComponents: { type: 'array', items: { type: 'string' } },
},
};