Skip to content

Commit

Permalink
Merge pull request #36 from lukasoppermann/help
Browse files Browse the repository at this point in the history
Help
  • Loading branch information
lukasoppermann authored Oct 5, 2020
2 parents f8f5a9e + 378c6a2 commit efcb997
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
7 changes: 7 additions & 0 deletions dist/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,13 @@
// const frames = figma.root.children.map(page => page.findChildren(node => isTokenFrame(node))).reduce((flatten, arr) => [...flatten, ...arr])
// figma.ui.show()
}
// HELP
// Open github help page
if (figma.command === 'help') {
figma.ui.postMessage({
command: "help"
});
}
figma.ui.onmessage = (message) => {
if (message.command === 'closePlugin') {
figma.closePlugin();
Expand Down
4 changes: 3 additions & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"main": "dist/plugin.js",
"ui": "ui/settings.html",
"menu": [
{"name": "Export Design Tokens", "command": "export"}
{"name": "Export Design Tokens", "command": "export"},
{"separator": true},
{"name": "Help", "command": "help"}
]
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Design-Tokens",
"version": "0.7.1",
"version": "0.7.2",
"description": "Your Figma Plugin",
"main": "code.js",
"repository": {
Expand Down
7 changes: 7 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ if(figma.command === 'settings') {
// const frames = figma.root.children.map(page => page.findChildren(node => isTokenFrame(node))).reduce((flatten, arr) => [...flatten, ...arr])
// figma.ui.show()
}
// HELP
// Open github help page
if (figma.command === 'help') {
figma.ui.postMessage({
command: "help"
})
}


figma.ui.onmessage = (message) => {
Expand Down
9 changes: 9 additions & 0 deletions ui/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ <h2>Design Token Settings</h2>
notification: '🎉 Design token export succesfull!'
}}, '*')
}
// open help page
if (message.command === "help") {
window.open('https://github.com/lukasoppermann/design-tokens')
parent.postMessage({
pluginMessage: {
command: 'closePlugin'
}
}, '*')
}
}

</script>

0 comments on commit efcb997

Please sign in to comment.