Skip to content

Commit

Permalink
Merge pull request #76 from BitcoinDesign/release/milestone-0-1-8
Browse files Browse the repository at this point in the history
Release/milestone 0 1 8
  • Loading branch information
GBKS authored Nov 22, 2021
2 parents 6691b6a + fa0af6a commit 32723b7
Show file tree
Hide file tree
Showing 191 changed files with 708 additions and 14 deletions.
18 changes: 13 additions & 5 deletions figma-plugins/icon-export-helper/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@
const page = figma.createPage();
page.name = "Icons for export";
figma.root.appendChild(page);
// Get all nodes that are components and begin with "Icon/"
const nodes = figma.currentPage.findAll(node => node.name.indexOf('Icon/') === 0 && node.type == 'COMPONENT_SET');
let nodes;
if (figma.currentPage.selection && figma.currentPage.selection.length > 0) {
// Go over nodes the user has selected
nodes = figma.currentPage.selection;
}
else {
// Get all nodes that are components and begin with "Icon/"
nodes = figma.currentPage.findAll(node => node.name.indexOf('Icon/') === 0 && node.type == 'COMPONENT_SET');
}
const newNodes = [];
const iconData = {};
const problematicIcons = {};
let processedIcons = 0;
let svgX = 0;
let svgY = 0;
let pngX = 0;
Expand Down Expand Up @@ -308,6 +316,7 @@ for (const node of nodes) {
// exportIcon = false
// }
if (exportIcon === true) {
processedIcons++;
exportComponentAsSVG(node, nodeVariant, subFolder);
exportComponentAsPNG(node, nodeVariant, subFolder);
}
Expand All @@ -317,6 +326,7 @@ for (const node of nodes) {
}
}
console.log('Problematic icons', problematicIcons);
console.log('Processed icons', processedIcons);
// Select our new instances for easy export.
page.selection = newNodes;
// Go to our new page.
Expand All @@ -327,7 +337,5 @@ textNode.x = 1000;
textNode.resize(1000, 1000);
figma.loadFontAsync({ family: "Roboto", style: "Regular" }).then(() => {
textNode.characters = JSON.stringify(iconData);
figma.closePlugin();
});
// Make sure to close the plugin when you're done. Otherwise the plugin will
// keep running, which shows the cancel button at the bottom of the screen.
figma.closePlugin();
20 changes: 14 additions & 6 deletions figma-plugins/icon-export-helper/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ page.name = "Icons for export"

figma.root.appendChild(page);

// Get all nodes that are components and begin with "Icon/"
const nodes = figma.currentPage.findAll(node => node.name.indexOf('Icon/') === 0 && node.type == 'COMPONENT_SET')
let nodes
if(figma.currentPage.selection && figma.currentPage.selection.length > 0) {
// Go over nodes the user has selected
nodes = figma.currentPage.selection
} else {
// Get all nodes that are components and begin with "Icon/"
nodes = figma.currentPage.findAll(node => node.name.indexOf('Icon/') === 0 && node.type == 'COMPONENT_SET')
}

const newNodes = []
const iconData = {}
const problematicIcons = {}
let processedIcons = 0

let svgX = 0
let svgY = 0
Expand Down Expand Up @@ -377,6 +384,8 @@ for (const node of nodes) {
// }

if(exportIcon === true) {
processedIcons++

exportComponentAsSVG(node, nodeVariant, subFolder)
exportComponentAsPNG(node, nodeVariant, subFolder)
}
Expand All @@ -387,6 +396,7 @@ for (const node of nodes) {
}

console.log('Problematic icons', problematicIcons)
console.log('Processed icons', processedIcons)

// Select our new instances for easy export.
page.selection = newNodes
Expand All @@ -401,8 +411,6 @@ textNode.resize(1000, 1000)

figma.loadFontAsync({ family: "Roboto", style: "Regular" }).then(() => {
textNode.characters = JSON.stringify(iconData)
})

// Make sure to close the plugin when you're done. Otherwise the plugin will
// keep running, which shows the cancel button at the bottom of the screen.
figma.closePlugin()
figma.closePlugin()
})
4 changes: 4 additions & 0 deletions optimized/filled/address-book.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/brush.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/channel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/channels.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/code.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/coins.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/confirmations-0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/confirmations-1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/confirmations-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/confirmations-3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/confirmations-4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/confirmations-5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/confirmations-6.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/credit-card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions optimized/filled/globe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions optimized/filled/graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/invoice.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions optimized/filled/moon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/pantheon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/photo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/pie-chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions optimized/filled/point-of-sale.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimized/filled/refresh.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 32723b7

Please sign in to comment.