Gutenberg Single Block mode for Mobile unsupported blocks. #21874
Labels
[Feature] Blocks
Overall functionality of blocks
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
[Type] Discussion
For issues that are high-level and not yet ready to implement.
Projects
Is your feature request related to a problem? Please describe.
On Mobile Gutenberg, we will always have the problem of blocks that are unsupported.
We are working on a solution that will allow the user edit those blocks without leaving the mobile app, using a web view that loads and editor instance from their site.
Ideally we want this web editor instance to just show the single block the user wants to edit, Together with controls to edit this single block, hiding any other control like Page edition, Saving/Publishing, inserting new blocks, etc...
We have a working solution that looks like this:
What we do is basically:
new-post
URL.window.wp.data.dispatch/select
to insert/retrieve the HTML content of the block.Insert Block script
Retrieve Block script
Injected CSS
But there are a few issues with this approach:
window.onload
is not enough.Describe the solution you'd like
The objective of this ticket is to gather ideas for possible solutions to implement on a future version.
This is my innocent solution I would like to see, but you are the masters:
window.onload
won't work in all cases, maybe we could have anwindow.wp.editorReady
or something similar to know exactly when it's safe to inject the block.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
window.wp.data.subscribe
to inject the block when the store starts receiving events but this also didn't work. (apparently it's still too early).edit-post-header
) to appear in the document. This worked on WPCom but seemed to be way too fragile.The text was updated successfully, but these errors were encountered: