feat: add widgets schema validation (#3841)
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
import controlComponent from './CodeControl';
|
||||
import previewComponent from './CodePreview';
|
||||
import schema from './schema';
|
||||
|
||||
const Widget = (opts = {}) => ({
|
||||
name: 'code',
|
||||
controlComponent,
|
||||
previewComponent,
|
||||
schema,
|
||||
allowMapValue: true,
|
||||
codeMirrorConfig: {},
|
||||
...opts,
|
||||
|
11
packages/netlify-cms-widget-code/src/schema.js
Normal file
11
packages/netlify-cms-widget-code/src/schema.js
Normal file
@ -0,0 +1,11 @@
|
||||
export default {
|
||||
properties: {
|
||||
default_language: { type: 'string' },
|
||||
allow_language_selection: { type: 'boolean' },
|
||||
output_code_only: { type: 'boolean' },
|
||||
keys: {
|
||||
type: 'object',
|
||||
properties: { code: { type: 'string' }, lang: { type: 'string' } },
|
||||
},
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user