Skip to content

Commit 1499e83

Browse files
Karan SinghKaran Singh
authored andcommitted
first commit
0 parents  commit 1499e83

File tree

3,279 files changed

+1477130
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,279 files changed

+1477130
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Below are the steps to get your plugin running. You can also find instructions at:
2+
3+
https://www.figma.com/plugin-docs/setup/
4+
5+
This plugin template uses Typescript and NPM, two standard tools in creating JavaScript applications.
6+
7+
First, download Node.js which comes with NPM. This will allow you to install TypeScript and other
8+
libraries. You can find the download link here:
9+
10+
https://nodejs.org/en/download/
11+
12+
Next, install TypeScript using the command:
13+
14+
npm install -g typescript
15+
16+
Finally, in the directory of your plugin, get the latest type definitions for the plugin API by running:
17+
18+
npm install --save-dev @figma/plugin-typings
19+
20+
If you are familiar with JavaScript, TypeScript will look very familiar. In fact, valid JavaScript code
21+
is already valid Typescript code.
22+
23+
TypeScript adds type annotations to variables. This allows code editors such as Visual Studio Code
24+
to provide information about the Figma API while you are writing code, as well as help catch bugs
25+
you previously didn't notice.
26+
27+
For more information, visit https://www.typescriptlang.org/
28+
29+
Using TypeScript requires a compiler to convert TypeScript (code.ts) into JavaScript (code.js)
30+
for the browser to run.
31+
32+
We recommend writing TypeScript code using Visual Studio code:
33+
34+
1. Download Visual Studio Code if you haven't already: https://code.visualstudio.com/.
35+
2. Open this directory in Visual Studio Code.
36+
3. Compile TypeScript to JavaScript: Run the "Terminal > Run Build Task..." menu item,
37+
then select "tsc: watch - tsconfig.json". You will have to do this again every time
38+
you reopen Visual Studio Code.
39+
40+
That's it! Visual Studio Code will regenerate the JavaScript file every time you save.

code.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
3+
* This devtool is neither made for production nor for readable output files.
4+
* It uses "eval()" calls to create a separate source file in the browser devtools.
5+
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
6+
* or disable the default devtool with "devtool: false".
7+
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
8+
*/
9+
/******/ (() => { // webpackBootstrap
10+
/******/ var __webpack_modules__ = ({
11+
12+
/***/ "./code.ts":
13+
/*!*****************!*\
14+
!*** ./code.ts ***!
15+
\*****************/
16+
/***/ (() => {
17+
18+
eval("// This plugin creates 5 rectangles on the screen.\n// const numberOfRectangles = 5\n// This file holds the main code for the plugins. It has access to the *document*.\n// You can access browser APIs such as the network by creating a UI which contains\n// a full browser environment (see documentation).\n// const nodes: SceneNode[] = [];\n// for (let i = 0; i < numberOfRectangles; i++) {\n// const rect = figma.createRectangle();\n// rect.x = i * 150;\n// rect.fills = [{type: 'SOLID', color: {r: 1, g: 0.5, b: 0}}];\n// figma.currentPage.appendChild(rect);\n// nodes.push(rect);\n// }\n// figma.currentPage.selection = nodes;\n// figma.viewport.scrollAndZoomIntoView(nodes);\n// Make sure to close the plugin when you're done. Otherwise the plugin will\n// keep running, which shows the cancel button at the bottom of the screen.\nlet pages = [\n \"Cover\",\n \"-------------\",\n \"Style Components\",\n \"Typography Components\",\n \"-------------\",\n \"Design-v1 In Progress\",\n \"Design-v2 In Progress\",\n \"Design-v3 In Progress\",\n \"-------------\",\n \"Icon/FavIcons\",\n \"Assets\",\n \"Discovery\",\n \"References\",\n \"Junkyard\",\n];\nlet currentPage = figma.currentPage;\ncurrentPage.name = pages[0];\nfor (let page of pages.slice(1)) {\n let newPage = figma.createPage();\n newPage.name = page;\n}\nfigma.notify(\"Pages Created Successfully!\");\nfigma.closePlugin();\n\n\n//# sourceURL=webpack://Figma-Pages/./code.ts?");
19+
20+
/***/ })
21+
22+
/******/ });
23+
/************************************************************************/
24+
/******/
25+
/******/ // startup
26+
/******/ // Load entry module and return exports
27+
/******/ // This entry module can't be inlined because the eval devtool is used.
28+
/******/ var __webpack_exports__ = {};
29+
/******/ __webpack_modules__["./code.ts"]();
30+
/******/
31+
/******/ })()
32+
;

code.ts

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// This plugin creates 5 rectangles on the screen.
2+
// const numberOfRectangles = 5
3+
4+
// This file holds the main code for the plugins. It has access to the *document*.
5+
// You can access browser APIs such as the network by creating a UI which contains
6+
// a full browser environment (see documentation).
7+
8+
// const nodes: SceneNode[] = [];
9+
// for (let i = 0; i < numberOfRectangles; i++) {
10+
// const rect = figma.createRectangle();
11+
// rect.x = i * 150;
12+
// rect.fills = [{type: 'SOLID', color: {r: 1, g: 0.5, b: 0}}];
13+
// figma.currentPage.appendChild(rect);
14+
// nodes.push(rect);
15+
// }
16+
// figma.currentPage.selection = nodes;
17+
// figma.viewport.scrollAndZoomIntoView(nodes);
18+
19+
// Make sure to close the plugin when you're done. Otherwise the plugin will
20+
// keep running, which shows the cancel button at the bottom of the screen.
21+
22+
let pages = [
23+
"Cover",
24+
"-------------",
25+
"Style Components",
26+
"Typography Components",
27+
"-------------",
28+
"Design-v1 In Progress",
29+
"Design-v2 In Progress",
30+
"Design-v3 In Progress",
31+
"-------------",
32+
"Icon/FavIcons",
33+
"Assets",
34+
"Discovery",
35+
"References",
36+
"Junkyard",
37+
];
38+
39+
let currentPage = figma.currentPage;
40+
currentPage.name = pages[0];
41+
42+
for (let page of pages.slice(1)) {
43+
let newPage = figma.createPage();
44+
newPage.name = page;
45+
}
46+
figma.notify("Pages Created Successfully!");
47+
48+
figma.closePlugin();

manifest.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "Design System Pages",
3+
"id": "1086869650406820989",
4+
"api": "1.0.0",
5+
"main": "code.js",
6+
"editorType": ["figma"]
7+
}

node_modules/.bin/acorn

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/browserslist

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/envinfo

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/import-local-fixture

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/node-which

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_modules/.bin/resolve

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)