Skip to content

Commit

Permalink
Block Bindings: Add @since tag in bindings apis JSDocs (WordPress#6…
Browse files Browse the repository at this point in the history
…5796)

* Add tag to `useBlockBindingsUtils`

* Add since tag to the registration functions

Co-authored-by: SantosGuillamot <[email protected]>
Co-authored-by: gziolo <[email protected]>
Co-authored-by: colorful-tones <[email protected]>
  • Loading branch information
4 people authored Oct 2, 2024
1 parent 41804e1 commit 08052d4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,10 @@ _Returns_

- `?WPBlockBindingsUtils`: Object containing the block bindings utils.

_Changelog_

`6.7.0` Introduced in WordPress core.

### useBlockCommands

Undocumented declaration.
Expand Down
2 changes: 2 additions & 0 deletions packages/block-editor/src/utils/block-bindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions packages/blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ _Returns_

- `?Object`: Block bindings source.

_Changelog_

`6.7.0` Introduced in WordPress core.

### getBlockBindingsSources

Returns all registered block bindings sources.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions packages/blocks/src/api/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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() {
Expand Down

0 comments on commit 08052d4

Please sign in to comment.