Describe the bug
The current widgets editor is missing many of the features the normal editor provides,
namely the ability to edit the code directly, to copy everything, and so on.
Ideally the widget editor has the same feature parity as the normal editor, this also makes the UI less surprising.
To reproduce
Steps to reproduce the behavior:
Expected behavior
The same features as in the normal editor.
Additional context
https://github.com/WordPress/gutenberg/issues/22875
@strarsis It'd be great if you could list specific things that are missing.
My understanding is that being able to edit the code directly isn't possible due to the way widgets are stored. But I might be wrong on this (cc @draganescu @adamziel @kevin940726).
This is blocked while we're waiting on reporter feedback.
@talldan: Yes, the code editor and the copy all content of a widget features notably.
Thanks for getting back @strarsis.
Let's add the _Copy All Content_ button.
We cannot add _Code Editor_ as the widgets editor does not store its blocks into a single HTML field. We do already support _Edit as HTML_ on a per block basis, though.
Hm. Thinking about it further, I'm not sure how _Copy All Content_ would work.
In the post editors, it copies the raw HTML of the entire post. But the widget editor edits multiple widget areas, not a single post.
We could grab the HTML of every widget area and append it together. Would that be useful, though?
Note that you can already select multiple blocks by shift clicking and then and select Copy.
What do you think @mapk?
@noisysocks, good points!
If the "copy all content" option resides in the topbar, then I'd expect it to copy all content from all of the widget areas together as you mentioned. This doesn't seem to be useful though IMO. If we wanted to target an individual widget area, we start running into the similar problem that we experienced with the Global Inserter in the topbar. For now, I suggest we leave this out.
I think keeping this screen limited in features is okay to do. Selecting multiple blocks and copying them still works as noted, so that feels like a good interim solution.
Most helpful comment
Thanks for getting back @strarsis.
Let's add the _Copy All Content_ button.
We cannot add _Code Editor_ as the widgets editor does not store its blocks into a single HTML field. We do already support _Edit as HTML_ on a per block basis, though.