How to check if other decorations are set within plugin state

I have the following types of Widget decorations:

  • Loader: is added for example when uploading a file.
  • Placeholder: should only be added if no content and also no decorations like a Loader is present

How can I check if there is an active Loader decoration present within my Placeholder plugin? Is there a way to access/find other active decorations in the state.apply(tr, state) function of my plugin, or is there another solution?

There isn’t a general way to access decorations from other plugins. You could give the placeholder plugin access to the loader plugin, and have it call its decorations() prop and inspect the result, I guess.

Thanks for the tipp, led me in the right direction. Now plugins like the loader can register itself to a editor context which can be accessed by the placeholder plugin and block the plugin decoration.

As always, thanks for the great support!