From 8fa0f80d0c676a23cbc235290417cc20433a1295 Mon Sep 17 00:00:00 2001 From: JuanMa Garrido Date: Mon, 24 Jun 2024 13:26:29 +0100 Subject: [PATCH 1/3] proper callouts for Block Editor Handbook --- .../interactivity-api/api-reference.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/reference-guides/interactivity-api/api-reference.md b/docs/reference-guides/interactivity-api/api-reference.md index fadbd82350c88..d4d8c1cb689b3 100644 --- a/docs/reference-guides/interactivity-api/api-reference.md +++ b/docs/reference-guides/interactivity-api/api-reference.md @@ -299,8 +299,9 @@ The returned value is used to change the inner content of the element: `
val ### `wp-on` -> [!NOTE] -> Consider using the more performant [`wp-on-async`](#wp-on-async) instead if your directive code does not need synchronous access to the event object. If synchronous access is required, consider implementing an [async action](#async-actions) which yields to the main thread after calling the synchronous API. +
+ Consider using the more performant wp-on-async instead if your directive code does not need synchronous access to the event object. If synchronous access is required, consider implementing an async action which yields to the main thread after calling the synchronous API. +
This directive runs code on dispatched DOM events like `click` or `keyup`. The syntax is `data-wp-on--[event]` (like `data-wp-on--click` or `data-wp-on--keyup`). @@ -335,8 +336,9 @@ to run sooner. Use this async version whenever there is no need for synchronous ### `wp-on-window` -> [!NOTE] -> Consider using the more performant [`wp-on-async-window`](#wp-on-async-window) instead if your directive code does not need synchronous access to the event object. If synchronous access is required, consider implementing an [async action](#async-actions) which yields to the main thread after calling the synchronous API. +
+ Consider using the more performant wp-on-async-window instead if your directive code does not need synchronous access to the event object. If synchronous access is required, consider implementing an async action which yields to the main thread after calling the synchronous API. +
This directive allows you to attach global window events like `resize`, `copy`, and `focus` and then execute a defined callback when those happen. @@ -371,8 +373,9 @@ Similar to `wp-on-async`, this is an optimized version of `wp-on-window` that im ### `wp-on-document` -> [!NOTE] -> Consider using the more performant [`wp-on-async-document`](#wp-on-async-document) instead if your directive code does not need synchronous access to the event object. If synchronous access is required, consider implementing an [async action](#async-actions) which yields to the main thread after calling the synchronous API. +
+ Consider using the more performant wp-on-async-document instead if your directive code does not need synchronous access to the event object. If synchronous access is required, consider implementing an async action which yields to the main thread after calling the synchronous API. +
This directive allows you to attach global document events like `scroll`, `mousemove`, and `keydown` and then execute a defined callback when those happen. From 71d283beb23db640468d891eec36752a82fe9103 Mon Sep 17 00:00:00 2001 From: JuanMa Garrido Date: Mon, 24 Jun 2024 13:30:23 +0100 Subject: [PATCH 2/3] replaced other notes with proper callouts --- .../interactivity-api/api-reference.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/reference-guides/interactivity-api/api-reference.md b/docs/reference-guides/interactivity-api/api-reference.md index d4d8c1cb689b3..1dbd7c338c98e 100644 --- a/docs/reference-guides/interactivity-api/api-reference.md +++ b/docs/reference-guides/interactivity-api/api-reference.md @@ -73,8 +73,9 @@ The `wp-interactive` directive "activates" the interactivity for the DOM element
``` -> **Note** -> The use of `data-wp-interactive` is a requirement for the Interactivity API "engine" to work. In the following examples the `data-wp-interactive` has not been added for the sake of simplicity. Also, the `data-wp-interactive` directive will be injected automatically in the future. +
+ The use of data-wp-interactive is a requirement for the Interactivity API "engine" to work. In the following examples the data-wp-interactive has not been added for the sake of simplicity. Also, the data-wp-interactive directive will be injected automatically in the future. +
### `wp-context` @@ -892,9 +893,9 @@ const { state } = store( "myPlugin", { } } ); ``` - -> **Note** -> All `store()` calls with the same namespace return the same references, i.e., the same `state`, `actions`, etc., containing the result of merging all the store parts passed. +
+ All store() calls with the same namespace return the same references, i.e., the same state, actions, etc., containing the result of merging all the store parts passed. +
- To access the context inside an action, derived state, or side effect, you can use the `getContext` function. - To access the reference, you can use the `getElement` function. From d0050cb2490f5a9fdf654634488b0b937e598f95 Mon Sep 17 00:00:00 2001 From: JuanMa Garrido Date: Mon, 24 Jun 2024 13:43:55 +0100 Subject: [PATCH 3/3] added id to h5 --- docs/reference-guides/interactivity-api/api-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference-guides/interactivity-api/api-reference.md b/docs/reference-guides/interactivity-api/api-reference.md index 1dbd7c338c98e..d92270d73bdb2 100644 --- a/docs/reference-guides/interactivity-api/api-reference.md +++ b/docs/reference-guides/interactivity-api/api-reference.md @@ -763,7 +763,7 @@ const { state, actions } = store("myPlugin", { }); ``` -##### Async actions +
Async actions
Async actions should use generators instead of async/await.