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

Block Bindings: Add @since tag in bindings apis JSDocs #65796

Merged
merged 2 commits into from
Oct 2, 2024
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
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.

Comment on lines +884 to +887
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

### 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
Loading