-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Theme JSON schema: Add missing block names and unify block properties #51293
Conversation
"core/archives": { | ||
"type": "object", | ||
"description": "Archive block. Display a monthly archive of your posts. This block has no block-level settings", | ||
"additionalProperties": false | ||
"$ref": "#/definitions/settingsPropertiesComplete" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Archive block now has some support.
"core/post-comments": { | ||
"core/post-author-biography": { | ||
"$ref": "#/definitions/stylesPropertiesAndElementsComplete" | ||
}, | ||
"core/post-author-name": { | ||
"$ref": "#/definitions/stylesPropertiesAndElementsComplete" | ||
}, | ||
"core/post-comment": { | ||
"$ref": "#/definitions/stylesPropertiesAndElementsComplete" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes block name (core/post-comments
to core/post-comment
)
"core/post-comments": { | ||
"core/post-author-biography": { | ||
"$ref": "#/definitions/settingsPropertiesComplete" | ||
}, | ||
"core/post-author-name": { | ||
"$ref": "#/definitions/settingsPropertiesComplete" | ||
}, | ||
"core/post-comment": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes block name (core/post-comments
to core/post-comment
)
"core/button": { | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"$ref": "#/definitions/settingsPropertiesAppearanceTools" | ||
}, | ||
{ | ||
"type": "object", | ||
"properties": { | ||
"border": { | ||
"description": "Settings related to borders.", | ||
"type": "object", | ||
"properties": { | ||
"radius": { | ||
"description": "Allow users to set custom border radius.", | ||
"type": "boolean", | ||
"default": false | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ "$ref": "#/definitions/settingsPropertiesColor" }, | ||
{ "$ref": "#/definitions/settingsPropertiesLayout" }, | ||
{ "$ref": "#/definitions/settingsPropertiesSpacing" }, | ||
{ | ||
"$ref": "#/definitions/settingsPropertiesTypography" | ||
}, | ||
{ "$ref": "#/definitions/settingsPropertiesCustom" } | ||
] | ||
"$ref": "#/definitions/settingsPropertiesComplete" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should be necessary to define only button blocks specially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention when this was added was to update all blocks to only show the features that they support. But seeing as that was a year and a half ago and nothing else has been updated, I think it's fine.
We really need a system to automatically generate the schema so we can be more specific about blocks without the huge maintenance burden.
Flaky tests detected in 52028ea. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5521145155
|
0bc8246
to
52028ea
Compare
Thanks for the review, @ajlende 🎉 |
What?
This PR makes the following three changes in the theme.json schema:
core/button
andcore/archives
block schemacore/post-comments
tocore/post-comment
)Why?
To allow developers to design theme.json with reference to the correct schema.
Testing Instructions
Create the following JSON file, specifying the JSON schema changed by this PR.
Screenshots or screencast
Add missing block names
Simplify
core/button
andcore/archives
block schemaFix a typo (
core/post-comments
tocore/post-comment
)