Since I’ve seen a lot of developers struggling with presenting modals inside plugins, I’m excited to announce that I just released the first pre-release (!) version of my xd-dialog-helper on GitHub (https://github.com/pklaschka/xd-dialog-helper) and npm (https://www.npmjs.com/package/xd-dialog-helper). While I’m still in the process of writing the documentation (and refining some rougher edges here and there), it is already functional and allows to easily show simple to medium-complex dialogs to ask for a user’s input. You only need to pass the asynchronous function an array of the information that should get asked (including the type of input as well as some more parameters – depending on the type) and the returned Promise will then resolve with the results in a key-value-pair object (or reject if the user cancels the dialog).
As I’ve stated, I’ll still be fixing some minor issues in the next few days (and complete the documentation), but I just wanted to inform you that this is now officially released and ready to use (as all my open-source-stuff, it is MIT-Licensed). There’s also a sample plugin included in the repo to help you get started while the documentation is still a bit sparse. Depending on whether your plugin is configured to support npm packages, it is as simple as either installing it via npm or copying the
dialog-helper.js file which can be found on https://github.com/pklaschka/xd-dialog-helper/releases into your plugin…
If you find any issues, please feel free to open an issue on GitHub so I can get this to be rock-solid as fast as possible.