Add a plugin for core blocks that create shadows when mutated
Category
- Plugins
Component
(new) block-shadow-mutators
Is your feature request related to a problem? Please describe.
Now that https://github.com/google/blockly/pull/4215 is merged it is possible to create mutators that generate shadow blocks. There are several blocks packaged with core Blockly that could benefit from this. They are:
- math_number_property

- text_charAt

- text_getSubstring

- lists_getIndex

- lists_setIndex

- lists_getSublist

- and maybe logic_compare

Describe the solution you'd like
I think that it might be nice to create a plugin that provides versions of these blocks where the mutators automatically create shadow blocks.
Describe alternatives you've considered
I've considered making changes to the blocks in the main repo, but that's a bad idea. Currently all shadow blocks are specified via XML, so people can use the core blocks without adding shadow blocks to their application. If we update these specific blocks to create shadows programmatically, it would automatically include shadows in any application using the core blocks, which may not be what developers want.
Additional context
The reason I didn't just go ahead and do this is that I'm not sure how often developers actually use the core blocks (rather than defining their own). So I'm not sure how often a plugin like this would get used.
Another option: Create an extension that adds shadows to any empty inputs that accept strings or numbers. Then it can be applied not only to the core blocks, but also to any new blocks someone builds.