This idea sounds like serializing the workspace to a file, which the user downloads, and then allowing the user to deserialize it by dropping it onto the workspace. This idea is definitely possible! AppInventor does exactly this, by allowing the user to save a group of blocks as a png, and then drag that png into other projects to add the blocks there as well. All of AppInventor's logic for detecting a drop lives
here, but there might be better file-drop tutorials elsewhere hehe.
> or just dragging and dropping an object from one area to another area
This would actually probably be trickier. Blockly doesn't really support the idea of workspaces interacting. For example, the
connection checker has a
specific safety check to prevent blocks from different workspaces connecting.
Your best option for getting this working is probably to use the
event system (or a system you build) to communicate between the two workspaces. For example, say you have a block X in workspace A that you want to drag to workspace B. When you detect that block X has been "dropped" over workspace B, delete it from workspace A, and then recreate it in workspace A. The trickiest part will be making sure that X shows up at the right place in B, I'm not exactly sure how to achieve that :/
Someone else may have already gotten a system like this working though! (and hopefully they reach out)
I hope that helps! If you get something working, please share :D This sounds like a really cool project!
Best wishes,
Beka