Skip to content

Commit

Permalink
Update block.json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Jun 27, 2024
1 parent ec93880 commit ebaf704
Showing 1 changed file with 65 additions and 28 deletions.
93 changes: 65 additions & 28 deletions schemas/json/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@
},
"heading": {
"type": "boolean",
"description": "This property adds block controls which allow the user to set heading colors in a block, heading color is disabled by default.\n\nHeading color presets are sourced from the editor-color-palette theme support.\n\nWhen the block declares support for color.heading, its attributes definition is extended to include the style attribute",
"description": "This property adds block controls which allow the user to set heading colors in a block. Heading color is disabled by default.\n\nHeading color presets are sourced from the editor-color-palette theme support.\n\nWhen the block declares support for color.heading, its attributes definition is extended to include the style attribute",
"default": false
},
"button": {
"type": "boolean",
"description": "This property adds block controls which allow the user to set button colors in a block, button color is disabled by default.\n\nButton color presets are sourced from the editor-color-palette theme support.\n\nWhen the block declares support for color.heading, its attributes definition is extended to include the style attribute",
"description": "This property adds block controls which allow the user to set button colors in a block. Button color is disabled by default.\n\nButton color presets are sourced from the editor-color-palette theme support.\n\nWhen the block declares support for color.button, its attributes definition is extended to include the style attribute",
"default": false
},
"enableContrastChecker": {
Expand Down Expand Up @@ -346,6 +346,22 @@
}
}
},
"background": {
"type": "object",
"description": "This value signals that a block supports some of the CSS style properties related to background. When it does, the block editor will show UI controls for the user to set their values if the theme declares support.\n\nWhen the block declares support for a specific background property, its attributes definition is extended to include the style attribute.",
"properties": {
"backgroundImage": {
"type": "boolean",
"description": "Allow blocks to define a background image.",
"default": false
},
"backgroundSize": {
"type": "boolean",
"description": "Allow blocks to define values related to the size of a background image, including size, position, and repeat controls",
"default": false
}
}
},
"html": {
"type": "boolean",
"description": "By default, a block’s markup can be edited individually. To disable this behavior, set html to false.",
Expand Down Expand Up @@ -466,6 +482,11 @@
"type": "boolean",
"description": "For the `flex` layout type only, determines display of the orientation control in the block toolbar.",
"default": true
},
"allowCustomContentAndWideSize": {
"type": "boolean",
"description": "For the `constrained` layout type only, determines display of the custom content and wide size controls in the block sidebar.",
"default": true
}
}
}
Expand Down Expand Up @@ -556,10 +577,12 @@
}
},
"shadow": {
"default": false,
"description": "Allow blocks to define a box shadow.",
"oneOf": [
{
"type": "boolean"
"type": "boolean",
"description": "Defines whether a box shadow is enabled or not."
},
{
"type": "object"
Expand All @@ -581,6 +604,31 @@
"default": false
}
}
},
"interactivity": {
"description": "Indicates if the block is using Interactivity API features.",
"oneOf": [
{
"type": "boolean",
"description": "Indicates whether the block is using the Interactivity API directives.",
"default": false
},
{
"type": "object",
"properties": {
"clientNavigation": {
"type": "boolean",
"description": "Indicates whether a block is compatible with the Interactivity API client-side navigation.\n\nSet it to true only if the block is not interactive or if it is interactive using the Interactivity API. Set it to false if the block is interactive but uses vanilla JS, jQuery or another JS framework/library other than the Interactivity API.",
"default": false
},
"interactive": {
"type": "boolean",
"description": "Indicates whether the block is using the Interactivity API directives.",
"default": false
}
}
}
]
}
},
"additionalProperties": true
Expand Down Expand Up @@ -681,31 +729,6 @@
}
}
]
},
"interactivity": {
"description": "Indicates if the block is using Interactivity API features.",
"oneOf": [
{
"type": "boolean",
"description": "Indicates whether the block is using the Interactivity API directives.",
"default": false
},
{
"type": "object",
"properties": {
"clientNavigation": {
"type": "boolean",
"description": "Indicates whether a block is compatible with the Interactivity API client-side navigation.\n\nSet it to true only if the block is not interactive or if it is interactive using the Interactivity API. Set it to false if the block is interactive but uses vanilla JS, jQuery or another JS framework/library other than the Interactivity API.",
"default": false
},
"interactive": {
"type": "boolean",
"description": "Indicates whether the block is using the Interactivity API directives.",
"default": false
}
}
}
]
}
}
},
Expand Down Expand Up @@ -801,6 +824,20 @@
}
]
},
"viewScriptModule": {
"description": "Block type frontend script module definition. It will be enqueued only when viewing the content on the front of the site.",
"oneOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"editorStyle": {
"description": "Block type editor style definition. It will only be enqueued in the context of the editor.",
"oneOf": [
Expand Down

0 comments on commit ebaf704

Please sign in to comment.