Skip to content

Commit

Permalink
Interactivity API Docs: Update image with Github source (#59281)
Browse files Browse the repository at this point in the history
* Update image with github source

* Fix typo

* Add note to indicate that API works only in 6.5 and above.

* Use make core filesystem

Co-authored-by: c4rl0sbr4v0 <cbravobernal@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
  • Loading branch information
3 people authored Feb 22, 2024
1 parent 3bb8b94 commit dc364b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/interactivity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
> **Note**
> This package enables the API shared at [Proposal: The Interactivity API – A better developer experience in building interactive blocks](https://make.wordpress.org/core/2023/03/30/proposal-the-interactivity-api-a-better-developer-experience-in-building-interactive-blocks/). As part of an [Open Source project](https://developer.wordpress.org/block-editor/getting-started/faq/#the-gutenberg-project), participation is encouraged in testing this API providing feedback at the [discussions in GitHub](https://github.com/WordPress/gutenberg/discussions/categories/interactivity-api).
The Interactivity API is available at WordPress Core from version 6.5 [Merge announcement](https://make.wordpress.org/core/2024/02/19/merge-announcement-interactivity-api/)
The Interactivity API is available at WordPress Core from version 6.5: [Merge announcement](https://make.wordpress.org/core/2024/02/19/merge-announcement-interactivity-api/)

These Core blocks are already powered by thi API:
These Core blocks are already powered by the API:

- Search
- Query
Expand Down
5 changes: 4 additions & 1 deletion packages/interactivity/docs/api-reference.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# API Reference

> **Note**
> Interactivity API is only available for WordPress 6.5 and above.
To add interactivity to blocks using the Interactivity API, developers can use:

- **Directives** - added to the markup to add specific behavior to the DOM elements of the block.
- **Store** - that contains the logic and data (state, actions, or side effects, among others) needed for the behavior.

DOM elements are connected to data stored in the state and context through directives. If data in the state or context change directives will react to those changes, updating the DOM accordingly (see [diagram](https://excalidraw.com/#json=T4meh6lltJh6TCX51NTIu,DmIhxYSGFTL_ywZFbsmuSw)).

![State & Directives](./assets/interactivity-state-directives.png)
![State & Directives](https://make.wordpress.org/core/files/2024/02/interactivity-state-directives.png)

## Table of Contents

Expand Down
Binary file not shown.

1 comment on commit dc364b4

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in dc364b4.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/8008015200
📝 Reported issues:

Please sign in to comment.