From 961d8ec6276019c05779600ce4b81e8bc8c2bf86 Mon Sep 17 00:00:00 2001 From: Carlos Bravo <37012961+c4rl0sbr4v0@users.noreply.github.com> Date: Mon, 24 Jul 2023 15:42:06 +0200 Subject: [PATCH] Behaviors - Lightbox: Update theme.json schema (#51156) Co-authored-by: Michal Czaplinski --- .../theme-json-reference/theme-json-living.md | 10 ++++ schemas/json/theme.json | 57 +++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/docs/reference-guides/theme-json-reference/theme-json-living.md b/docs/reference-guides/theme-json-reference/theme-json-living.md index a2e88320cf58b..da08b4fe9eac1 100644 --- a/docs/reference-guides/theme-json-reference/theme-json-living.md +++ b/docs/reference-guides/theme-json-reference/theme-json-living.md @@ -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 diff --git a/schemas/json/theme.json b/schemas/json/theme.json index cbdcc9de4c39a..513dfbd2236fc 100644 --- a/schemas/json/theme.json +++ b/schemas/json/theme.json @@ -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": { @@ -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" }, @@ -672,6 +713,7 @@ { "properties": { "appearanceTools": {}, + "behaviors": {}, "border": {}, "color": {}, "dimensions": {}, @@ -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",