Are there events represent for document editing?

I want some events triggered by XD when document changes.
Like imageChanges, documentChanges, documentSaved, contentEditing, etc.
I don’t find them in the Plugin documents…

Hi @xiaoqiang.

Unfortunately, this isn’t available at this time. The only triggers for plugins are the menu items specified in the manifest.json. Without such user interaction (i.e. clicking on a menu item or pressing the corresponding keyboard shortcut), it isn’t possible to run plugin code – that’s also the reason why asynchronous stuff is a bit more complicated since you’ll need to keep the “timeframe”, in which you can edit the scenegraph with the plugin, open.

@xiaoqiang Can you provide some info on what you’re trying to accomplish? We’re exploring opening up events in the future, and having specific use cases will help us make sure we’re moving in the right direction.

like font changes and other stuff

To clarify, can you describe the workflow you’re trying to accomplish?

Yeah i am revealing my idea here

I was making a plugin that to be a non ui blocking

see this

its like context setting without a dialog so when something is selected or changed we can know and do something with the event

For eg : see the image (first read the above comment fully and go to post first otherwise you cannot understand this)

The below is an artboard that is used as plugin settings ui when user changes the corner radius of the white rectangle in the image then i was presently saving changes to a file with a shortcut and ask user to select outside of the artboard and get global context and changed the corner radius of elements that user required to change or all material widgets made through my plugin
when events are implemented it reduces these steps so that i watch for changes without any user interaction also same api can be useful for XD in future for non ui blocking dialogs or menu items

The experience of Adobe XD App for preview is poor. So I decided to create my own.
Before this plugin platform come out, I made a tool live preview your design with XD, It supports both iphone and android devices, and provide WIFI and USB connection. It’s very good, please refer to Design Mirror

But
Without XD plugin platform support, I can’t embed my panel to XD Application, and also can not listen the events that something changed. I did a bad way to make it “live”…

Sadly, I find that the API now provided by XD is not enough for me to embed my work to XD.
The model panel makes all plugins do one single step work…

So, what I want are two main points:

  1. support long live plugin panels(modeless), or background running plugin support
  2. some events triggered by host for plugins to listen (like document changed, image changed, target edited etc.)

thanks a lot.

1 Like

Thank you! I think I understand. If we were to have non-blocking UI and an onSelectionChange event, would that give you need?

@afuchs yeah you got it right

@afuchs onSelectionChange might be what I would need.

I have written a simple single-sided-border plugin that uses the stroke dash and stroke offset but if a user resizes an element there is no way for the plugin to know; so the user has to call it again.

What I would like is to be able to apply the pugin as the user is resizing (debounced somehow) or when the selection changes (so long as there is a way to get some kind of blur event).

1 Like

I also would be interested in an onSelectionChanged event.
And other events: layers changed, groups, styles etc.

Thanks!

I am glad if onContextMenu event is available, although I am not sure how multiple plugins share the event.

1 Like
  1. is addressed with plugin panels (est is XD 21)
    background running is not supported unless you use a “bad way” as you say
  2. no events yet

My use case is the save event. For me, if there is a document saved event then my plugin “reexports”.

Is this plugin completed ? I want to know the status

Unfortunately, any scenegraph changes will have to be triggered by some user activity in a panel (button pressed, text typed with enter, control changed, etc), so plugins can’t automatically update the selection as it changes.

1 Like