Hi,
I'm maintaining a collaborative Blockly editor and am trying to add a feature that allows the mouse cursor position of one user's editor to sync across to other users. I don't need the cursor's position to be exactly correct, but it should be accurate enough to see which element the user is hovering on (a block in the main workspace, a category in the toolbox, or a block in the toolbox flyout menu). I have to account for potentially different screen sizes and zoom levels across different users, so I'm making a solution that involves grabbing the hovered element's id (when hovering over <div>'s like the categories in the toolbox) or data-id (when hovering over blocks).
The toolbox category ids can be specified in the XML/JSON with the "toolboxitemid" attribute. However blocks have randomly generated data-ids. That's not a problem with blocks in the main workspace because the MouseCreate events object (which I sync across different users' editors) include the generated id. However, I'm having trouble identifying which block is hovered in the toolbox flyout menu. I have a hacky way that works right now, but is somewhat brittle.
Is there a way to specify custom data-ids for blocks in the toolbox XML/JSON definition?
thanks!