open-source-labs / Svelvet

🎛 A Svelte library for building dynamic, infinitely customizable node-based user interfaces and flowcharts
https://svelvet.io
2.5k stars 161 forks source link

Not rendered correctly in Shadow DOM #457

Open try0 opened 10 months ago

try0 commented 10 months ago

8.1.0

Is there any workaround?

stephane commented 9 months ago

Could you give more details about your issue?

try0 commented 9 months ago

When the Svelvet component is in a Shadow DOM it uses document.querySelector and therefore cannot resolve Edge, Anchor, etc.

https://github.com/open-source-labs/Svelvet/blob/5f835b641887547d4ab6b4cdf491edb21d62a968/src/lib/components/Edge/Edge.svelte#L20

I think it is necessary to implement a provider that can change the execution target from the document to the shadow root.

try0 commented 9 months ago

Also, need to be able to place styles in the Shadow DOM instead of in the head.