MyScript / iinkTS

Other
52 stars 5 forks source link

Editor styles unavailable in shadow dom elements #2

Closed adamc-texthelp closed 7 months ago

adamc-texthelp commented 9 months ago

The editor styles are added to the top level of the page instead of inside the passed editor element due to the change to directly import the css file at the top of the editor class. This means elements inside shadow doms no longer receive the styles and also increases the chance of style conflicts.

In iink-js the style element was directly added to the editor element so this was not an issue.

We use this library inside a chrome extension where we must keep our styles separate from the page we're loading on. Is there any way to replicate the old behaviour? I'm aware we can just copy and inject the iink.css ourselves, but that isn't ideal and would still result in the page having the styles added to the top level.

leJsboureau commented 9 months ago

In fact, this is a use case that we have not taken into account, thank you for your feedback. We will deliver a fix in the next version to resolve your problem.

adamc-texthelp commented 8 months ago

Appreciate you looking into this. Is there a rough timeline for the next release that may include this fix?

Asking as the latest iink-js has a dependency on an older version of crypto-js which has been flagged for a weak hash security vulnerability. We'd like to update as soon as possible, but this issue is holding us back currently.

leJsboureau commented 8 months ago

Sorry for the long time without updating iink-ts. The next release of iink-TS should arrive in 2 or 3 weeks. It will contain, among other things, the requested fix regarding css.

leJsboureau commented 7 months ago

New version (1.0.4) with style fix available. Thank you for your feedback.