blockly-samples
blockly-samples copied to clipboard
Customize Backpack button depending on state
Category Plugins
Component @blockly/workspace-backpack
Is your feature request related to a problem? Please describe. Some existing examples of a Backpack feature in Blockly support changing the button asset depending on the Backpack state (empty, non-empty, drag-over). Currently the Backpack plugin in Samples only supports adding a CSS class when the Backpack is hovered over and if someone wanted their Backpack to support this they would need to subclass the Backpack.
Describe the solution you'd like Add support for changing the Backpack look through hooks for when the Backpack state changes between the following state:
- empty
- non-empty
- block dragged over
- mouse dragged over
These hooks could be methods on the Backpack or CSS classes applied.
Describe alternatives you've considered Not support this feature and instead offer documentation offering advice on how to subclass the plugin to get this working.
Additional context Design for this should be influenced by the implementation of: https://github.com/google/blockly-samples/issues/809