xd-plugin-helper
Version:
collection of useful helpers to develop plugins for Adobe XD
57 lines (42 loc) • 2.27 kB
Markdown
Adobe XD is a great tool to create interactive prototypes for user experiences. Because they have just started to develop their plugin platform we often have to use some workarounds. This library is the place to collect all the little helpers to develop awesome Adobe XD Plugins.
The library will be extended and you can always push merge requests to add your own helpers.

This helper will create error rectangles as shown above.
```javascript
import { XDNodeErrorGroup } from "xd-plugin-helper";
const errors = [
node: //add an actual node from XD,
msg: //error text you want to display
]
const xdSelectionNode = //selection object you receive from XD
const errorGroup = new XDNodeErrorGroup(errorNodeList, xdSelectionNode);
errorGroup.addErrors();
```
```javascript
import { XDNodeErrorRectangle } from "xd-plugin-helper";
const xdNode = // actual XD Node
const error = new XDNodeErrorRectangle(xdNode);
error.create("Your error message");
```
Copyright (c) 2018 Sven Schannak
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.