Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
fcd792d
Add interactivity runtime
luisherranz Apr 21, 2023
9b0a62e
Add it to the image block
luisherranz Apr 21, 2023
d2c0803
Add a separate webpack config
luisherranz Apr 21, 2023
ed1df51
Make sure the runtime is imported only once
luisherranz Apr 21, 2023
ed043f5
Use sideEffects instead of init
luisherranz Apr 21, 2023
c9f389f
Move script registration to a general file
luisherranz Apr 21, 2023
261dacf
Add `defer` to the interactivity scripts
luisherranz Apr 21, 2023
27cfc1f
Revert changes of the image block
luisherranz Apr 21, 2023
7cf6ba9
Fix init import name
luisherranz Apr 21, 2023
55d37ef
Add experimental setting to use Interactivity API
SantosGuillamot Apr 24, 2023
7cfbffa
Add basic `interactivity.js` file
SantosGuillamot Apr 24, 2023
2a970e3
Enqueue old script/interactivity API conditionally
SantosGuillamot Apr 24, 2023
84146ae
Add `tick()` function until Preact bug is solved
SantosGuillamot Apr 24, 2023
c2c96da
Add code to handle the overlayMenu
SantosGuillamot Apr 24, 2023
71fbd35
Add Interactivity API to submenu block
SantosGuillamot Apr 24, 2023
85bf58f
Add Interactivity API to page list block
SantosGuillamot Apr 24, 2023
027e2a1
Change code to be more declarative and simple
SantosGuillamot Apr 26, 2023
0e4a604
Use `__DIR__` instead of `__FILE__`
SantosGuillamot Apr 27, 2023
67ffd65
Change loading script conditional
SantosGuillamot Apr 27, 2023
122a154
Fix issues momentarily
SantosGuillamot Apr 27, 2023
a6b1e62
Fix some issues with focus
SantosGuillamot Apr 27, 2023
e63c002
Add tabindex to modal
SantosGuillamot Apr 27, 2023
8f388df
Revert to current navigation block
SantosGuillamot Apr 27, 2023
938d57d
Add directives through a filter
SantosGuillamot Apr 27, 2023
1d0472d
Dont add latest modifications to navigation block
SantosGuillamot Apr 27, 2023
d5250fa
Ensure focus doesn't get inside menu after closing
SantosGuillamot Apr 27, 2023
3ae8097
Add conditionals and change function names
SantosGuillamot Apr 28, 2023
624bdb0
Use `gutenberg_is_experiment_enabled` function
SantosGuillamot Apr 28, 2023
ebba7b4
Add interactivity runtime
luisherranz Apr 21, 2023
af59781
Add it to the image block
luisherranz Apr 21, 2023
cca3d60
Add a separate webpack config
luisherranz Apr 21, 2023
160a029
Make sure the runtime is imported only once
luisherranz Apr 21, 2023
7f16f27
Use sideEffects instead of init
luisherranz Apr 21, 2023
f4b2ee8
Move script registration to a general file
luisherranz Apr 21, 2023
378b041
Add `defer` to the interactivity scripts
luisherranz Apr 21, 2023
409d161
Revert changes of the image block
luisherranz Apr 21, 2023
29e11ab
Fix init import name
luisherranz Apr 21, 2023
f4b6c0a
Move and refactor the interactive scritps registration
gziolo Apr 28, 2023
3d94473
Fix code style violations
gziolo Apr 28, 2023
6ae760f
Use `wp-interactivity-` prefix for script handles
gziolo Apr 28, 2023
9d6869e
Improve the matcher for side effects in `package.json`
gziolo Apr 28, 2023
3393bc2
Merge branch 'add-interactivity-runtime' into navigation-block-with-i…
SantosGuillamot May 3, 2023
32013ae
Enqueue interactivity scripts through hook
SantosGuillamot May 3, 2023
f829206
Revert `client-assets.php` file
SantosGuillamot May 3, 2023
3258326
Adapt to latest changes in base branch
SantosGuillamot May 3, 2023
c6d02d8
Add custom useSignalEffect
DAreRodz May 4, 2023
bb36577
Merge branch 'add-interactivity-runtime' into navigation-block-with-i…
SantosGuillamot May 4, 2023
9c95302
Move role attribute to selectors
SantosGuillamot May 4, 2023
af55917
Call `init` after `store` has been initialized
DAreRodz May 4, 2023
b58e6af
Merge branch 'add-interactivity-runtime' into navigation-block-with-i…
SantosGuillamot May 5, 2023
66b765c
Change focusable elements
SantosGuillamot May 5, 2023
7f1db8c
Add namespaces to context
SantosGuillamot May 5, 2023
79fd7b7
Move PHP file to interactivity-api folder
SantosGuillamot May 5, 2023
b553b04
Add comments with the markup to the PHP filter
SantosGuillamot May 5, 2023
182ed89
Remove micromodal attributes
SantosGuillamot May 5, 2023
5751344
Add interactivity runtime
luisherranz Apr 21, 2023
e8201c2
Add it to the image block
luisherranz Apr 21, 2023
df844f0
Add a separate webpack config
luisherranz Apr 21, 2023
d883391
Make sure the runtime is imported only once
luisherranz Apr 21, 2023
b1ea5e3
Use sideEffects instead of init
luisherranz Apr 21, 2023
20d6213
Move script registration to a general file
luisherranz Apr 21, 2023
6fb8aa7
Add `defer` to the interactivity scripts
luisherranz Apr 21, 2023
6c96509
Revert changes of the image block
luisherranz Apr 21, 2023
e843b80
Fix init import name
luisherranz Apr 21, 2023
cdf74b9
Move and refactor the interactive scritps registration
gziolo Apr 28, 2023
de0e874
Fix code style violations
gziolo Apr 28, 2023
fa7c00d
Use `wp-interactivity-` prefix for script handles
gziolo Apr 28, 2023
0d88c77
Improve the matcher for side effects in `package.json`
gziolo Apr 28, 2023
142050c
Add custom useSignalEffect
DAreRodz May 4, 2023
e65b91e
Call `init` after `store` has been initialized
DAreRodz May 4, 2023
9a31bb4
Update lib/experimental/interactivity-api/script-loader.php
gziolo May 5, 2023
0cdab08
Plugin: Ensure that translations are set correctly when overriding sc…
gziolo May 5, 2023
5dcf88e
Remove unnecessary comment in webpack config
SantosGuillamot May 5, 2023
5171e47
Merge branch 'add-interactivity-runtime' into navigation-block-with-i…
SantosGuillamot May 5, 2023
5af4b51
Clean up code to fix PHP coding standards issues
SantosGuillamot May 5, 2023
d4a16f3
Remove extra space
SantosGuillamot May 5, 2023
6f34728
Merge branch 'trunk' into navigation-block-with-interactivity-api
SantosGuillamot May 5, 2023
066d946
Add tests to the navigation block interactivity
SantosGuillamot May 8, 2023
91796b9
Modify `saveSiteEditorEntities` function to wait
SantosGuillamot May 8, 2023
c358346
Fix page-list tests
SantosGuillamot May 9, 2023
68b3dec
Remove e2e tests that are already included in trunk
gziolo May 9, 2023
c6ee68a
Fix the navigation menu when the overlay is not present
gziolo May 10, 2023
15d3546
Ensure that all scripts using Intereactivity API have defer attribute
gziolo May 10, 2023
4367b4d
Remove unused param in the callback used by hook
gziolo May 10, 2023
1626f90
Merge remote-tracking branch 'origin/trunk' into navigation-block-wit…
gziolo May 10, 2023
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
Prev Previous commit
Next Next commit
Revert changes of the image block
Co-authored-by: David Arenas <[email protected]>
  • Loading branch information
luisherranz and DAreRodz committed Apr 21, 2023
commit 27cfc1f4c2aa2a85eafe6ba4fd074fa12afca9a8
14 changes: 1 addition & 13 deletions packages/block-library/src/image/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,8 @@
* @return string Returns the block content with the data-id attribute added.
*/
function render_block_core_image( $attributes, $content ) {
wp_enqueue_script(
'interactivity-image',
plugins_url('../interactive-blocks/image.min.js', __FILE__ ),
array( 'interactivity-runtime' )
);

$processor = new WP_HTML_Tag_Processor( $content );
$processor->next_tag( 'figure' );
$processor->set_attribute( 'data-wp-island', '' );
$processor->set_attribute( 'data-wp-context', '{ "text": "image hydrated" }' );
$processor->next_tag( 'img' );
$processor->set_attribute( 'data-wp-effect', 'effects.alert' );

if ( $processor->get_attribute( 'src' ) === null ) {
return '';
Expand All @@ -37,10 +27,8 @@ function render_block_core_image( $attributes, $content ) {
// which now wraps Image Blocks within innerBlocks.
// The data-id attribute is added in a core/gallery `render_block_data` hook.
$processor->set_attribute( 'data-id', $attributes['data-id'] );
$content = $processor->get_updated_html();
}

$content = $processor->get_updated_html();

return $content;
}

Expand Down
13 changes: 0 additions & 13 deletions packages/block-library/src/image/interactivity.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/block-library/src/image/interactivity2.js

This file was deleted.

2 changes: 1 addition & 1 deletion tools/webpack/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ module.exports = [
},
{
entry: {
image: './packages/block-library/src/image/interactivity.js',
// blockname: './packages/block-library/src/blockname/interactivity.js',
},
output: {
devtoolNamespace: 'wp',
Expand Down