-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ff8604
commit cf89472
Showing
28 changed files
with
12,400 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { Rectangle, Color } = require('scenegraph'); | ||
|
||
function main(selection, documentRoot) { | ||
// Go to Plugins > Development > Developer Console to see this log output | ||
console.log('No dialog is running!'); | ||
|
||
// Insert a red square at (0, 0) in the current artboard or group/container | ||
const shape = new Rectangle(); | ||
shape.width = 100; | ||
shape.height = 100; | ||
shape.fill = new Color('#f00'); | ||
selection.insertionParent.addChild(shape); | ||
} | ||
|
||
module.exports = { | ||
commands: { | ||
menuCommand: main, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "Red square", | ||
"id": "abcd0123", | ||
"version": "1.0.0", | ||
"description": "Insert a square", | ||
"icons": [ | ||
{ | ||
"width": 96, | ||
"height": 96, | ||
"path": "images/icon.png" | ||
} | ||
], | ||
"host": { | ||
"app": "XD", | ||
"minVersion": "13.0.0" | ||
}, | ||
"uiEntryPoints": [ | ||
{ | ||
"type": "menu", | ||
"label": { | ||
"default": "Insert a square", | ||
"en": "Insert a square", | ||
"ja": "正方形を挿入する" | ||
}, | ||
"commandId": "menuCommand" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
build/ | ||
.git/ | ||
node_modules/ | ||
doc/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"extends": [ | ||
"airbnb" | ||
], | ||
"plugins": [], | ||
"parserOptions": {}, | ||
"env": { | ||
"browser": true | ||
}, | ||
"globals": { | ||
"scenegraph": true | ||
}, | ||
"rules": { | ||
"indent": ["error", 4], | ||
"no-unused-vars": "warn", | ||
"no-console": "off", | ||
"import/no-unresolved": ["warn", { "ignore": ["uxp", "secenegraph", "commands", "clipboard"] }], | ||
"no-param-reassign": ["error", { "props": true, "ignorePropertyModificationsFor": ["selection"] }] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
build | ||
build.xdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Red square | ||
|
||
## Setup | ||
|
||
```bash | ||
npm install | ||
``` | ||
|
||
## Live-loading plugin for `Develop` folder | ||
|
||
Deploy the plugin and monitor updates of files. | ||
|
||
```bash | ||
npm start | ||
``` | ||
|
||
## Deploy plugin to the `Develop` Folder | ||
|
||
```bash | ||
npm deploy | ||
``` | ||
|
||
## Usage | ||
|
||
#### 1. Reload plugins: | ||
`Plugins` > `Development` > `Reload Plugins` or press `shift + command(ctrl) + R` keys. | ||
#### 2. Run the plugin: | ||
`Plugins` > `Insert a square` |
Oops, something went wrong.