GithubHelp home page GithubHelp logo

kawamurakazushi / figma-sort-it Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 2.0 920 KB

Figma Plugin to sort Frames and Layers by name.

Home Page: https://www.figma.com/c/plugin/731324768889901500/Sort-It

License: MIT License

TypeScript 100.00%
figma figma-plugins

figma-sort-it's Introduction

๐Ÿ‘‹ Hello,

figma-sort-it's People

Contributors

kawamurakazushi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

figma-sort-it's Issues

Numbers are not sorted numerically

Currently numbers are sorted alphabetically, i.e. 10 is sorted before 1. See example screenshot.

Screenshot 2020-03-04 at 11 08 03

Expected sort would be numeric, so we get [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].

Bonus points if negative numbers are sorted in reverse, before natural numbers!

Thanks for a great plugin though.

Components with capitals do not sort correctly

2020-07-07 13 39 29

Expected Behavior:

The expected behavior is to sort A-Z: Adobe, AWS, Chrome, CSS, Webpack, WebStorm.

Actual Behavior:

The actual behavior is that the frames with capital letters in any part of the string get sorted ahead of frames with lowercase: AWS, Adobe, CSS, Chrome, WebStorm, Webpack.

Add option to also sort on the canvas

While sorting in the layers is very handy, I would love to be able to sort the layers on the canvas as well. I would expect that it would re-arrange them using either the same spacing used or provide a margin.

tried your source code in figma console: it doesn't seem to work

I tried this snippet from your github source in figma console and it doesn't sort? Have I made a mistake or is there something missing in your code? Thanks

https://i.imgur.com/2FjScTT.png

` selectedNodes = [...figma.currentPage.selection]

selectedNodeParentIndexMap = selectedNodes.map(node => {
return { index: node.parent.children.indexOf(node), node: node }
})

selectedNodeParentIndexMap.sort((a, b) => a.index - b.index)

selectedNodeParentIndexMap.forEach((map, index) => {
let targetIndex = selectedNodeParentIndexMap[selectedNodeParentIndexMap.length - 1 - index].index
const currentIndex = map.node.parent.children.indexOf(map.node)
map.node.parent.insertChild(targetIndex, map.node)
})`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.