Skip to content

Commit 9126dea

Browse files
Merge pull request #13 from gridaco/staging
Staging
2 parents eb36b66 + 86a092a commit 9126dea

36 files changed

+3855
-24
lines changed

bridged/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

core-nodes/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# TODO

core-nodes/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "@design-sdk/core-nodes",
3+
"version": "0.0.0"
4+
}

core-types/design-provider.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export type DesignProvider =
2+
| "grida"
3+
| "nothing"
4+
| "figma"
5+
| "sketch"
6+
| "unknown";

core-types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./design-provider";

core-types/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "@design-sdk/core-types",
3+
"description": "Core typings for design representetives",
4+
"authors": "Grida.co",
5+
"version": "0.0.0",
6+
"main": "index.ts",
7+
"dependencies": {}
8+
}

core-types/tsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": ".",
5+
"outDir": "./dist"
6+
},
7+
"include": ["."],
8+
"exclude": ["dist", "node_modules", "__test__"]
9+
}

core/utils/node-width-height.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ export function nodeWidthHeight(
8989
let hPadding = 0;
9090
let vPadding = 0;
9191
if ("layoutMode" in node) {
92-
hPadding = node.padding.left + node.padding.right;
93-
vPadding = node.padding.top + node.padding.bottom;
92+
hPadding = node.padding?.left ?? 0 + node.padding?.right ?? 0;
93+
vPadding = node.padding?.top ?? 0 + node.padding?.bottom ?? 0;
9494
}
9595

9696
// set them independently, in case w is equal but h isn't

figma-oauth/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Grida
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

figma-oauth/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# `Figma-OAuth` _(`@design-sdk/Figma-OAuth`)_
2+
3+
> Figma OAuth, ready to use.
4+
5+
## Installation
6+
7+
```sh
8+
yarn add @design-sdk/figma-oauth
9+
10+
# or with npm
11+
npm i @design-sdk/figma-oauth
12+
```
13+
14+
## Usage
15+
16+
```ts
17+
import { urls, request } from "@design-sdk/figma-oauth";
18+
19+
const oauthTokenRequestUrl = urls.oauth_token_request_url({
20+
client_id,
21+
client_secret,
22+
redirect_uri,
23+
code,
24+
});
25+
26+
const oauthAuthenticationResult = request.authenticationoauth_token_request_url(
27+
{
28+
client_id,
29+
client_secret,
30+
redirect_uri,
31+
code,
32+
}
33+
);
34+
```

0 commit comments

Comments
 (0)