-
Notifications
You must be signed in to change notification settings - Fork 30
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
Convert add-to-calendar into interactive button block-variation #606
Comments
This doesn't took too long. Still without using the Interactivity API at all, but working! Bildschirmaufzeichnung.vom.14.03.2024.14.19.48.mp4 |
This is so exciting!(to me) I’ve made good progress and would call it Enhanced feature parity. My new implementation of the Add to calendar Block is a button block under the hood. So you can use every of the default controls for normal button blocks, as long as your theme allows you to. Besides that I made sure that all of the existing functionality is ported into the new block. I called it Enhanced, because the new block (variation) …
Notable Changes
Open todos & questions
This could still be improved
|
This is my current exploration repo: Install the .zip-file and have a look, if you want. |
Solved I defined another block-variation, this time one of the This pseudo-block that has the same name, description and icon like our new block, but once inserted into the editor it becomes a pure normal And voila, we can select our Add to calendar block from all possible spots. |
After I read through Thoughts on the WordPress Interactivity API by @markhowellsmead I wanted to make sure, we're not running into new and maybe overseen performance issues. So I tested the existing block against my new block from the interactivity-api branch of my exploration plugin. Luckily the results show nothing to worry about.
|
✅ Viewed 606 - Convert custom block to Gutenberg block variation - Carsten has it |
|
👀
https://developer.wordpress.org/news/2024/04/11/a-first-look-at-the-interactivity-api/#comment-5685 |
The new (and also the old) block do not let me download iCal or outlook files on iPadOs 17.5.1 trim.20723FBA-F318-430D-8A87-B5F9926198B8.MOV |
✅ Reviewed June 22 - Kudos on progress @carstingaxion |
Thanks @MervinHernandez ! |
No matter if on a theatre stage during rehearsal or in software development, every art knows: Kill your darlingsThat's why I would like to drop my matured proposoal of an interactive Add-to-calendar block, in favor of a much simpler non-interactive Add-to-calendar block. After some while that I tested and figured out a Bildschirmaufzeichnung.vom.24.06.2024.04.24.46.mp4From top to bottom:
Variant number 3 turned out to be the best of the four, because:
I added this as an alternate Add-to-calendar block to the GatherPress Block Playground. Due to my lack of time, this block is not yet used in any patterns or templates, but is available from the block inserter with I also added a block-style to provide an icon, like the current implementation does. (#631 (comment)) Give it a try & tell me what you think, please! |
Is your enhancement related to a problem? Please describe.
Everything that looks like a button, should behave like a button (within the WordPress editor).
To allow for individual styling and also to remove some maintenance burden on the GatherPress side, I recommend converting the existing
add-to-calendar
block into a block-variation of the corebutton
block.Currently this block has minimal interactivity already implemented, which could be a perfect fit to further explore using the new Interactivity API (publicly rolled out in WP 6.5).
Designs
You can test the block within the GatherPress Block Playground
Using the wordpress/create-block package with a new interactivity template, we instantly get 50% of our needs already delivered - a button, that reveals some more content on click.
Calling this ...
npx @wordpress/create-block@latest gatherpress-interactive-block --template @wordpress/create-block-interactive-template
Creates this
Bildschirmaufzeichnung.vom.14.03.2024.10.36.13.mp4
Which should be relatively easy to adopt to our needs ... Let's go!
First questions & findings
"supports": {"interactivity": true }
to only a variation of a block rather than all of a block-type?Describe alternatives you've considered
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: