Skip to content

Instantly share code, notes, and snippets.

{
"name": "My first XD plugin",
"id": "00000000",
"version":"1.0.0",
"Description":"my first plugin for Adobe XD",
"host":{
"app":"XD",
"minVersion":"21.0"
},
"uiEntryPoints":[
const { Rectangle, selection, Color } = require("scenegraph");
function myFunction(){
}
module.exports = {
commands: {
myFunction
}
async function getDropboxProfile() {
return createUI();
}
async function createUI() {
if (!dialog) {
dialog = document.createElement("dialog");
const html = `
<style>
title {
module.exports = {
commands: {
myFunction
}
};
function myFunction(){
const { Rectangle, selection, Color } = require("scenegraph");
const newRectangle = new Rectangle();
newRectangle.width = 100;
newRectangle.height = 50;
newRectangle.fill = new Color("red");
selection.insertionParent.addChild(newRectangle);
}
selection.insertionParent.addChild(newRectangle);
newRectangle.width = 100;
newRectangle.height = 50;
newRectangle.fill = new Color("red");
const newRectangle = new Rectangle();
{
"name": "My first XD plugin",
"id": "00000000",
"version":"1.0.0",
"Description":"my first plugin for Adobe XD",
"host":{
"app":"XD",
"minVersion":"13.0"
},
"uiEntryPoints":[
const { Rectangle, selection, Color } = require("scenegraph");
const newRectangle = new Rectangle();
newRectangle.width = 100;
newRectangle.height = 50;
newRectangle.fill = new Color("red");
selection.insertionParent.addChild(newRectangle);