Are there events represent for document editing?


#1

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…


I Started developing Material Theme Editor guys Stay tuned for Updates
#2

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.


#3

@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.


#4

like font changes and other stuff


#5

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


#6

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


#7

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


#8

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.


#9

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


#10

@afuchs yeah you got it right


#11

@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).


#12

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

Thanks!