feat: add widgets schema validation (#3841)
This commit is contained in:
@ -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,
|
||||
});
|
||||
|
||||
|
27
packages/netlify-cms-widget-markdown/src/schema.js
Normal file
27
packages/netlify-cms-widget-markdown/src/schema.js
Normal 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' } },
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user