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

Theme JSON schema: Add missing block names and unify block properties #51293

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 98 additions & 38 deletions schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,7 @@
"type": "object",
"properties": {
"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"
},
Comment on lines 692 to 694
Copy link
Contributor Author

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/audio": {
"$ref": "#/definitions/settingsPropertiesComplete"
Expand All @@ -704,35 +702,7 @@
"$ref": "#/definitions/settingsPropertiesComplete"
},
"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"
},
Comment on lines 704 to 706
Copy link
Contributor Author

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.

Copy link
Contributor

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.

"core/buttons": {
"$ref": "#/definitions/settingsPropertiesComplete"
Expand All @@ -752,6 +722,9 @@
"core/columns": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/comment-author-avatar": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/comment-author-name": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
Expand All @@ -767,15 +740,33 @@
"core/comment-reply-link": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/comment-template": {
"core/comments": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/comments": {
"core/comments-pagination": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/comments-pagination-next": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/comments-pagination-numbers": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/comments-pagination-previous": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/comments-title": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/comment-template": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/cover": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/details": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/embed": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
Expand Down Expand Up @@ -812,6 +803,9 @@
"core/list": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/list-item": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/loginout": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
Expand All @@ -830,19 +824,31 @@
"core/navigation-link": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/navigation-submenu": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/nextpage": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/page-list": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/page-list-item": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/paragraph": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/post-author": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/post-comments": {
"core/post-author-biography": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/post-author-name": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/post-comment": {
Comment on lines -845 to +851
Copy link
Contributor Author

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)

"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/post-comments-count": {
Expand Down Expand Up @@ -875,6 +881,9 @@
"core/post-terms": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/post-time-to-read": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/post-title": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
Expand All @@ -887,6 +896,9 @@
"core/query": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/query-no-results": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/query-pagination": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
Expand All @@ -905,6 +917,9 @@
"core/quote": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/read-more": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
"core/rss": {
"$ref": "#/definitions/settingsPropertiesComplete"
},
Expand Down Expand Up @@ -1789,6 +1804,9 @@
"core/columns": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/comment-author-avatar": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/comment-author-name": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
Expand All @@ -1804,15 +1822,33 @@
"core/comment-reply-link": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/comment-template": {
"core/comments": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/comments": {
"core/comments-pagination": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/comments-pagination-next": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/comments-pagination-numbers": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/comments-pagination-previous": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/comments-title": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/comment-template": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/cover": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/details": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/embed": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
Expand Down Expand Up @@ -1849,6 +1885,9 @@
"core/list": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/list-item": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/loginout": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
Expand All @@ -1867,19 +1906,31 @@
"core/navigation-link": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/navigation-submenu": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/nextpage": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/page-list": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/page-list-item": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/paragraph": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/post-author": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/post-comments": {
"core/post-author-biography": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/post-author-name": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/post-comment": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
Comment on lines -1882 to 1935
Copy link
Contributor Author

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-count": {
Expand Down Expand Up @@ -1912,6 +1963,9 @@
"core/post-terms": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/post-time-to-read": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/post-title": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
Expand All @@ -1924,6 +1978,9 @@
"core/query": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/query-no-results": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/query-pagination": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
Expand All @@ -1942,6 +1999,9 @@
"core/quote": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/read-more": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
"core/rss": {
"$ref": "#/definitions/stylesPropertiesAndElementsComplete"
},
Expand Down