Skip to content

Commit

Permalink
Behaviors - Lightbox: Update theme.json schema (#51156)
Browse files Browse the repository at this point in the history
Co-authored-by: Michal Czaplinski <[email protected]>
  • Loading branch information
cbravobernal and michalczaplinski authored Jul 24, 2023
1 parent dc27d6b commit 961d8ec
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/reference-guides/theme-json-reference/theme-json-living.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,16 @@ Settings related to typography.
Generate custom CSS custom properties of the form `--wp--custom--{key}--{nested-key}: {value};`. `camelCased` keys are transformed to `kebab-case` as to follow the CSS property naming schema. Keys at different depth levels are separated by `--`, so keys should not include `--` in the name.


---

### behaviors

Settings related to behaviors.

| Property | Type | Default | Props |
| --- | --- | --- |--- |
| lightbox | boolean | false | |

---
## Styles

Expand Down
57 changes: 57 additions & 0 deletions schemas/json/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@
"createTheme": "https://developer.wordpress.org/block-editor/how-to-guides/themes/create-block-theme/",
"reference": "https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/"
},
"behaviorsBlocksPropertiesComplete": {
"type": "object",
"properties": {
"lightbox": {
"description": "Settings related to the lightbox behavior.",
"type": "object",
"properties": {
"enabled": {
"description": "Allow users to enable the lightbox behavior.",
"type": "boolean",
"default": false
},
"animation": {
"description": "Set lightbox animation. Possible values: `fade`, `zoom`, `''` (empty string).",
"type": "string",
"enum": [ "fade", "zoom", "" ]
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"refComplete": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -649,9 +672,27 @@
}
}
},
"settingsPropertiesBehaviors": {
"type": "object",
"properties": {
"behaviors": {
"description": "Settings related to behaviors.",
"type": "object",
"properties": {
"lightbox": {
"description": "Allow users to enable/disable lightbox.",
"type": "boolean",
"default": false
}
},
"additionalProperties": false
}
}
},
"settingsProperties": {
"allOf": [
{ "$ref": "#/definitions/settingsPropertiesAppearanceTools" },
{ "$ref": "#/definitions/settingsPropertiesBehaviors" },
{ "$ref": "#/definitions/settingsPropertiesBorder" },
{ "$ref": "#/definitions/settingsPropertiesColor" },
{ "$ref": "#/definitions/settingsPropertiesDimensions" },
Expand All @@ -672,6 +713,7 @@
{
"properties": {
"appearanceTools": {},
"behaviors": {},
"border": {},
"color": {},
"dimensions": {},
Expand Down Expand Up @@ -2129,6 +2171,21 @@
"type": "string",
"description": "Description of the global styles variation."
},
"behaviors": {
"description": "A list of blocks that have behaviors. This setting controls the display of the Behaviors UI in the block editor.",
"type": "object",
"properties": {
"blocks": {
"type": "object",
"properties": {
"core/image": {
"$ref": "#/definitions/behaviorsBlocksPropertiesComplete"
}
},
"additionalProperties": false
}
}
},
"settings": {
"description": "Settings for the block editor and individual blocks. These include things like:\n- Which customization options should be available to the user. \n- The default colors, font sizes... available to the user. \n- CSS custom properties and class names used in styles.\n- And the default layout of the editor (widths and available alignments).",
"type": "object",
Expand Down

0 comments on commit 961d8ec

Please sign in to comment.