-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[Documentation] Add examples for core/keyboard-shortcut package #42831
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
[Documentation] Add examples for core/keyboard-shortcut package #42831
Conversation
Size Change: 0 B Total Size: 1.44 MB ℹ️ View Unchanged
|
Nice work @t-hamano. Thank you for your another contribution. We need help with reviewing those examples. |
This PR was reviewed in today's Block Editor Handbook Docs Scrub, and we wanted to see if anything is holding up this PR besides a thorough review? |
14b3c77
to
62f11a1
Compare
I rebased this PR with the latest trunk branch and tested all the examples again. All samples appear to be working as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing via the plugin and everything worked as expected. This is fantastic work @t-hamano (as usual)! Let's get it merged!
I merged latest trunk and pushed to trigger the checks that didn't report correctly. Hopefully that will get this moved forward. I'll enable auto-merge as well. |
Thanks for the review, @ryanwelcher! |
What?
This PR adds examples for the
core/keyboard-shortcut
package docs. Part of #42125I used
createInterpolateElement
to display the key in the codetag
, but that made the code a bit longer.To make example code more simpler, it might be good to remove this function.
Testing Instructions
Paste the example code from the documentation page using the following code:
I also created a minimal plugin to test all examples.
keybard-shortcut-example.zip
Import only the examples you wish to test and then build:
Screenshots or screencast
When you run the example code, you should get the following results:
Selectors
getAllShortcutKeyCombinations
getAllShortcutRawKeyCombinations
getCategoryShortcuts
getShortcutAliases
getShortcutDescription
getShortcutKeyCombination
getShortcutRepresentation
Actions
registerShortcut
unregisterShortcut