diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 0000000..cb84254 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,4 @@ +{ + "MD013": false, + "MD033": false +} \ No newline at end of file diff --git a/README.md b/README.md index dafa310..886d14e 100644 --- a/README.md +++ b/README.md @@ -1,54 +1,107 @@ +

Transpose

+
- Transpose + A simple Figma plugin to flip any layer's size.
- A simple figma plugin to flip any layers size. + +
+ +![GitHub last commit](https://img.shields.io/github/last-commit/mrstev3n/Transpose-plugin?color=blue&style=plastic) +![Repo size](https://img.shields.io/github/repo-size/mrstev3n/Transpose-plugin?color=orange&style=plastic) +
## Installation -Install the plugin and show some love, directly from the Figma Community +Click below to install directly from the Figma community -Install Plugin +Install Plugin ## Usage -Select One (1) or more layers and run the plugin. +### 1. Transpose > Each one + +Select one or more layers and run the plugin. Each layer will be resized individually. + +!["Layer flip"](assets/banner.gif) + +
+ +### 2. Transpose > Grouped + +Select multiple layers and choose this option to resize them as a group. (Feature coming soon) + +
+ +> #### Tips: Launch plugin actions with custom keyboard shortcuts +> +> For **Mac users**, it is possible to natively associate a keyboard shortcut to your Figma plugin from settings. +> - Learn more in this [YouTube video](https://www.youtube.com/watch?v=r-6q1AJNeTQ) or use +> [this method](https://www.youtube.com/watch?v=hkbTDbXc5Ng) for **Windows users**. -![](https://github.com/mrstev3n/Transpose-plugin/blob/master/assets/banner.gif) +## Object handled -Lil typo in the GIF 😅 : Read "Width" instead of "Weight" and "Transposition Done" instead of "Transpisition Done" +- RECTANGLE +- ELLIPSE +- POLYGON +- TEXT +- SHAPE_WITH_TEXT +- GROUP +- FRAME +- COMPONENT/ INSTANCE +- LINE (New: special handling to preserve the central position) -#### ProTip : Use a custom keyboard to lauch the plugin +## Support -## Contributing +Do you find this plugin useful?
Please consider making a donation to support 🙏🏼 -Contributions are welcomed, feel free to make a pull request or create an issue +

+Buy Me A Coffee +Liberapay +

+ +## Code + +### Quick Setup + +- Clone the repository. +- `npm install` installs all the dependencies. +- `npm run build` builds and bundles the plugin. +- Import the manifest into Figma and test. + +### Contribution + +Contributions are welcome. Feel free to make a pull request or create an issue. [![GitHub pull-requests](https://img.shields.io/github/issues-pr/mrstev3n/Transpose-plugin.svg)](https://GitHub.com/mrstev3n/Transpose-plugin/pull/) [![GitHub issues](https://img.shields.io/github/issues/mrstev3n/Transpose-plugin.svg)](https://GitHub.com/mrstev3n/Transpose-plugin/issues/) -## Development +## Credits and Thanks + +V2 - Maker: [@mrstev3n](https://github.com/mrstev3n), +V2 - Tester: [@rickfaf](https://github.com/rickfaf) -Install the packages -``` -npm i -``` +- Plugin with parameters: Transpose, each one | grouped -Run the plugin in dev mode -``` -npx webpack --mode=development --watch -``` +V1 - Maker: [@mrstev3n](https://github.com/mrstev3n) -Build for production -``` -npx webpack --mode=production -``` +- Run-once plugin with simple flip action + +Big thanks to [@boussarilatif](https://github.com/boussarilatif) & [@rickfaf](https://github.com/rickfaf) for support, testing, and code snippets
useful for the proper functioning of the plugin. + +
+ +## Other Links + +

+ + +

## License © 2021 Steven Houessou-adin [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/mrstev3n/Transpose-plugin/blob/master/LICENSE) - diff --git a/code.ts b/code.ts index 35877e4..011676c 100644 --- a/code.ts +++ b/code.ts @@ -72,8 +72,6 @@ function startPluginWithParameters(parameters: ParameterValues): string { // Group & Flip selected layers W & H - - break; default: return; @@ -99,7 +97,6 @@ function startPluginWithParameters(parameters: ParameterValues): string { node.type === "POLYGON" || node.type === "TEXT" || node.type === "SHAPE_WITH_TEXT" || - node.type === "COMPONENT" || node.type === "GROUP") ) } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 23d5cdb..526287b 100644 --- a/manifest.json +++ b/manifest.json @@ -5,14 +5,19 @@ "main": "code.js", "editorType": [ "figma", - "figjam" ], - "parameterOnly": true, + "figjam" + ], + "documentAccess": "dynamic-page", + "networkAccess": { + "allowedDomains": ["none"] + }, "parameters": [ { "name": "Type", "key": "type", - "description": "Chose a type of transpose", + "description": "Choose a type of transpose", "allowFreeform": false } - ] + ], + "parameterOnly": true } \ No newline at end of file