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

Behaviors - Lightbox: Update theme.json schema #51156

Merged
merged 18 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
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
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 @@ -2069,6 +2111,21 @@
"type": "string",
"description": "Description of the global styles variation."
},
"behaviors": {
cbravobernal marked this conversation as resolved.
Show resolved Hide resolved
"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