Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JSON Schema for WordPress block.json files #1879

Merged
Merged
Prev Previous commit
Next Next commit
update example schema
fabiankaegy committed Oct 13, 2021
commit 7014dd266c203693f6cd03343187fce01763cf2e
70 changes: 65 additions & 5 deletions src/test/block/block.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,68 @@
{
"$schema": "../../schemas/json/block.json",
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "",
"title": "",
"description": "",
"category": "theme"
"name": "namespace/block-name",
"title": "Example Block",
"description": "This is an Example Block to showcase the json schema",
"category": "theme",
"icon": "smile",
"keywords": [
"example",
"block"
],
"textdomain": "my-textdomain",
"attributes": {
"imageSource": {
"type": "string",
"source": "html",
"selector": "img",
"attribute": "src"
},
"heading": {
"type": "string",
"source": "html",
"selector": ".my-custom-selector",
"default": "Example Heading"
}
},
"styles": [
{
"name": "rounded",
"label": "Rounded"
},
{
"name": "square",
"label": "Square",
"isDefault": true
}
],
"example": {
"viewportWidth": 1000
},
"parent": [ "namespace/parent" ],
"providesContext": {
"test": "test",
"example-background-color": "background-color"
},
"usesContext": [ "postId" ],
"supports": {
"anchor": false,
"align": [ "full", "left" ],
"className": false,
"customClassName": false,
"defaultStylePicker": false,
"fontSize": true,
"html": false,
"lineHeight": true,
"multiple": false,
"reusable": false,
"spacing": {
"margin": true,
"padding": [ "top", "bottom" ]
}
},
"editorScript": "file:./build/editorScript.js",
"editorStyle": "file:./build/editorStyle.css",
"style": "file:./build/style.css",
"script": "file:./build/script.js"
}