From 08052d42071822f435242ff0bd1cb33ce9cf7f19 Mon Sep 17 00:00:00 2001 From: Mario Santos <34552881+SantosGuillamot@users.noreply.github.com> Date: Wed, 2 Oct 2024 08:41:44 +0200 Subject: [PATCH] Block Bindings: Add `@since` tag in bindings apis JSDocs (#65796) * Add tag to `useBlockBindingsUtils` * Add since tag to the registration functions Co-authored-by: SantosGuillamot Co-authored-by: gziolo Co-authored-by: colorful-tones --- packages/block-editor/README.md | 4 ++++ .../block-editor/src/utils/block-bindings.js | 2 ++ packages/blocks/README.md | 16 ++++++++++++++++ packages/blocks/src/api/registration.js | 8 ++++++++ 4 files changed, 30 insertions(+) diff --git a/packages/block-editor/README.md b/packages/block-editor/README.md index 32ba4598c4f92..a6f3b8980cfd7 100644 --- a/packages/block-editor/README.md +++ b/packages/block-editor/README.md @@ -881,6 +881,10 @@ _Returns_ - `?WPBlockBindingsUtils`: Object containing the block bindings utils. +_Changelog_ + +`6.7.0` Introduced in WordPress core. + ### useBlockCommands Undocumented declaration. diff --git a/packages/block-editor/src/utils/block-bindings.js b/packages/block-editor/src/utils/block-bindings.js index db4de9d39cb25..2deeb95937174 100644 --- a/packages/block-editor/src/utils/block-bindings.js +++ b/packages/block-editor/src/utils/block-bindings.js @@ -30,6 +30,8 @@ function isObjectEmpty( object ) { * - `updateBlockBindings`: Updates the value of the bindings connected to block attributes. It can be used to remove a specific binding by setting the value to `undefined`. * - `removeAllBlockBindings`: Removes the bindings property of the `metadata` attribute. * + * @since 6.7.0 Introduced in WordPress core. + * * @return {?WPBlockBindingsUtils} Object containing the block bindings utils. * * @example diff --git a/packages/blocks/README.md b/packages/blocks/README.md index c5a754f88d492..f4805e1c60b38 100644 --- a/packages/blocks/README.md +++ b/packages/blocks/README.md @@ -127,6 +127,10 @@ _Returns_ - `?Object`: Block bindings source. +_Changelog_ + +`6.7.0` Introduced in WordPress core. + ### getBlockBindingsSources Returns all registered block bindings sources. @@ -135,6 +139,10 @@ _Returns_ - `Array`: Block bindings sources. +_Changelog_ + +`6.7.0` Introduced in WordPress core. + ### getBlockContent Given a block object, returns the Block's Inner HTML markup. @@ -542,6 +550,10 @@ _Parameters_ - _source.setValues_ `[Function]`: Optional function to update multiple values connected to the source. - _source.canUserEditValue_ `[Function]`: Optional function to determine if the user can edit the value. +_Changelog_ + +`6.7.0` Introduced in WordPress core. + ### registerBlockCollection Registers a new block collection to group blocks in the same namespace in the inserter. @@ -859,6 +871,10 @@ _Parameters_ - _name_ `string`: The name of the block bindings source to unregister. +_Changelog_ + +`6.7.0` Introduced in WordPress core. + ### unregisterBlockStyle Unregisters a block style for the given block. diff --git a/packages/blocks/src/api/registration.js b/packages/blocks/src/api/registration.js index f7d85cd816c9d..31be38b861c28 100644 --- a/packages/blocks/src/api/registration.js +++ b/packages/blocks/src/api/registration.js @@ -767,6 +767,8 @@ export const unregisterBlockVariation = ( blockName, variationName ) => { * behavior. Once registered, the source is available to be connected * to the supported block attributes. * + * @since 6.7.0 Introduced in WordPress core. + * * @param {Object} source Properties of the source to be registered. * @param {string} source.name The unique and machine-readable name. * @param {string} [source.label] Human-readable label. Optional when it is defined in the server. @@ -905,6 +907,8 @@ export const registerBlockBindingsSource = ( source ) => { /** * Unregisters a block bindings source by providing its name. * + * @since 6.7.0 Introduced in WordPress core. + * * @param {string} name The name of the block bindings source to unregister. * * @example @@ -926,6 +930,8 @@ export function unregisterBlockBindingsSource( name ) { /** * Returns a registered block bindings source by its name. * + * @since 6.7.0 Introduced in WordPress core. + * * @param {string} name Block bindings source name. * * @return {?Object} Block bindings source. @@ -937,6 +943,8 @@ export function getBlockBindingsSource( name ) { /** * Returns all registered block bindings sources. * + * @since 6.7.0 Introduced in WordPress core. + * * @return {Array} Block bindings sources. */ export function getBlockBindingsSources() {