figma-transformer
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"name": "figma-transformer", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
<p align="center"> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="82" height="123" fill="none"> | ||
<path fill="#0ACF83" d="M20.5 82h9L15 122.3A20.5 20.5 0 0120.5 82zM25.8 101.2L41 84.6V82h-5.8L31 86.7l-5.2 14.5zM18 122.9l2.2.1L41 100.3v-9l-19.2 21L18 123zM40.3 107.8a20.5 20.5 0 01-12.8 14l12.8-14z"/> | ||
<path fill="#A259FF" d="M41 41v8.6L29.4 82h-8.9a20.5 20.5 0 010-41H41zM41 69l-6.1 6.6L40 61.1l.9-1V69zM41 75.7V82h-5.8l5.8-6.3z"/> | ||
<path fill="#1ABCFE" d="M66 41.5L42 68a20.5 20.5 0 01-1-7.9l17.2-18.7a20.5 20.5 0 017.9.2zM48 77a20.5 20.5 0 01-4-4.7l26.7-29.1c1.8.9 3.5 2 5 3.5L48 76.9zM51.8 79.6c2 1 4 1.7 6.2 2.1l23.3-25.5c-.6-2.1-1.5-4.1-2.7-6L51.8 79.6zM76 76c3.7-3.7 5.8-8.6 6-13.8L64 81.8c4.5-.5 8.8-2.6 12-5.8z"/> | ||
<path fill="#FF7262" d="M41 0h17.7L44 41H41V0zM53.2 24.3L72.5 3.2c-1.8-1.1-3.8-2-5.8-2.5l-8.3 9-5.2 14.6zM47.2 41h5l27.5-30c-1-1.8-2.2-3.5-3.6-5L49.2 35.5l-2 5.6zM67.3 40.1c-1.8.6-3.8.9-5.8.9h-3l23-25.2a20.5 20.5 0 010 8.8L67.4 40z"/> | ||
<path fill="#F24E1E" d="M0 20.5A20.5 20.5 0 0020.5 41H41V0H20.5A20.5 20.5 0 000 20.5z"/> | ||
</svg> | ||
<img width="100" src="./figma-transformer.svg" /> | ||
</p> | ||
@@ -34,10 +28,10 @@ | ||
// Fetch the file you want using your favourite method | ||
... | ||
const originalFile = fetchFigmaFile(); | ||
const fileData = processFile(originalFile); | ||
const file = processFile(originalFile); | ||
// ✨ You can now use `fileData` for whatever you need! ✨ | ||
// ✨ You can now use `file` for whatever you need! ✨ | ||
// Let's get the styles for a component named "Test" | ||
const testStyles = data.shortcuts.components | ||
const testStyles = file.shortcuts.components | ||
.find(component => component.name === "Test") | ||
@@ -265,3 +259,3 @@ .shortcuts.styles; | ||
```js | ||
const text = data.shortcuts.texts.map(node => node.characters); | ||
const text = file.shortcuts.texts.map(node => node.characters); | ||
``` | ||
@@ -272,3 +266,3 @@ | ||
```js | ||
const styles = data.shortcuts.components | ||
const styles = file.shortcuts.components | ||
.filter(component => component.name === "Test") | ||
@@ -281,3 +275,3 @@ .map(component => component.shortcuts.styles); | ||
```js | ||
const fills = data.shortcuts.pages | ||
const fills = file.shortcuts.pages | ||
.filter(page => page.name === "Page 1") | ||
@@ -284,0 +278,0 @@ .map(page => page.shortcuts.rectangles.fills); |
50956
316