The implementation involves a TiddlyWiki plugin that defines a new content type.
It also expects a local Excalidraw instance to be running (the code for this instance is also provided)
For mode details and the code:
Please note that, this is very unpolished (e.g. i have not bothered to rename the content type into something more sensible than foo), but i believe the essentials are there.
Feel free to take it remix it as you wish.
If anyone does take it up and make a polished version of it, i will be really happy if you could share as well.