This is very impressive. I'm curious how generic it is, is it possible to extend this to work with other structures like Canvas drawings or a React app?
If you right-click in the playground (https://try.webpdf.pro/) and pick the "Foreign (Markdown)" context menu item, you will find an example that uses https://zerodevx.github.io/zero-md/ for Markdown editing/formatting via web components.
The reason I force update-by-(re)load on other foreign elements is because there are lots of low-quality web component custom elements that do not deal with attribute or content changes as well as the standard HTML elements.
https://try.webpdf.pro/canvas/
Draw
• draw in the gray box to update img src
• right-click/long-tap on canvas to clear
Play
• add text around canvas or img elements
• change canvas style attribute value