Skip to content

Commit 6ef7031

Browse files
add to reflect json viewer
1 parent fc31898 commit 6ef7031

File tree

5 files changed

+80
-3
lines changed

5 files changed

+80
-3
lines changed

editor/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"next": "10.0.3",
2222
"react": "17.0.1",
2323
"react-codemirror2": "^7.2.1",
24-
"react-dom": "17.0.1"
24+
"react-dom": "17.0.1",
25+
"react-json-tree": "^0.15.0"
2526
},
2627
"devDependencies": {
2728
"@babel/core": "^7.14.0",
@@ -34,4 +35,4 @@
3435
"next-transpile-modules": "^7.0.0",
3536
"typescript": "^4.2.3"
3637
}
37-
}
38+
}

editor/pages/_development/figma/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ export default function FigmaDemoIndexPage() {
1212
<Link href="./figma/to-flutter">Flutter demo</Link>
1313
<br />
1414
<Link href="./figma/to-react">React demo</Link>
15+
<br />
16+
<Link href="./figma/to-reflect">Figma To Reflect Design Nodes</Link>
17+
<br />
18+
<Link href="./figma/to-token">Figma design to Reflect Widget Tokens</Link>
1519
</>
1620
);
1721
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React, { useState } from "react";
2+
import { figmacomp, canvas, runner } from "../../../components";
3+
import { ReflectSceneNode } from "@design-sdk/core/nodes";
4+
import JSONTree from "react-json-tree";
5+
6+
export default function FigmaToReflectNodePage() {
7+
const [reflect, setReflect] = useState<ReflectSceneNode>();
8+
9+
const handleOnDesignImported = (reflect: ReflectSceneNode) => {
10+
setReflect(reflect);
11+
};
12+
13+
return (
14+
<>
15+
<canvas.DefaultCanvas />
16+
<figmacomp.FigmaScreenImporter onImported={handleOnDesignImported} />
17+
<JSONTree data={reflect} />
18+
</>
19+
);
20+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import React from "react";
2+
export default function FigmaToReflectWidgetTokenPage() {
3+
return <></>;
4+
}

yarn.lock

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,28 @@
587587
resolved "https://registry.yarnpkg.com/@reflect-ui/uiutils/-/uiutils-0.1.2.tgz#1020e557d2fdbf512a10b97b0c424c430ff7ad38"
588588
integrity sha512-uhE5Btrzud86MuNykB23EfEHn/jBJ8BicYjOkq7ZFgh38dnvF54vqZV0/LNYF77Z+3jTgQMwZR++e4gL8zCyHw==
589589

590+
"@types/base16@^1.0.2":
591+
version "1.0.2"
592+
resolved "https://registry.yarnpkg.com/@types/base16/-/base16-1.0.2.tgz#eb3a07db52309bfefb9ba010dfdb3c0784971f65"
593+
integrity sha512-oYO/U4VD1DavwrKuCSQWdLG+5K22SLPem2OQaHmFcQuwHoVeGC+JGVRji2MUqZUAIQZHEonOeVfAX09hYiLsdg==
594+
590595
"@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6":
591596
version "7.0.7"
592597
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad"
593598
integrity sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==
594599

600+
"@types/lodash.curry@^4.1.6":
601+
version "4.1.6"
602+
resolved "https://registry.yarnpkg.com/@types/lodash.curry/-/lodash.curry-4.1.6.tgz#f26c490c80c92d7cbaa2300d542e89781d44b1ff"
603+
integrity sha512-x3ctCcmOYqRrihNNnQJW6fe/yZFCgnrIa6p80AiPQRO8Jis29bBdy1dEw1FwngoF/mCZa3Bx+33fUZvOEE635Q==
604+
dependencies:
605+
"@types/lodash" "*"
606+
607+
"@types/lodash@*":
608+
version "4.14.168"
609+
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.168.tgz#fe24632e79b7ade3f132891afff86caa5e5ce008"
610+
integrity sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==
611+
595612
"@types/minimatch@^3.0.3":
596613
version "3.0.4"
597614
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21"
@@ -607,7 +624,7 @@
607624
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
608625
integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
609626

610-
"@types/prop-types@*":
627+
"@types/prop-types@*", "@types/prop-types@^15.7.3":
611628
version "15.7.3"
612629
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.3.tgz#2ab0d5da2e5815f94b0b9d4b95d1e5f243ab2ca7"
613630
integrity sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==
@@ -1092,6 +1109,11 @@ balanced-match@^1.0.0:
10921109
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee"
10931110
integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
10941111

1112+
base16@^1.0.0:
1113+
version "1.0.0"
1114+
resolved "https://registry.yarnpkg.com/base16/-/base16-1.0.0.tgz#e297f60d7ec1014a7a971a39ebc8a98c0b681e70"
1115+
integrity sha1-4pf2DX7BAUp6lxo568ipjAtoHnA=
1116+
10951117
base64-js@^1.0.2, base64-js@^1.3.1:
10961118
version "1.5.1"
10971119
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
@@ -3338,6 +3360,11 @@ lodash.camelcase@^4.3.0:
33383360
resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"
33393361
integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY=
33403362

3363+
lodash.curry@^4.1.1:
3364+
version "4.1.1"
3365+
resolved "https://registry.yarnpkg.com/lodash.curry/-/lodash.curry-4.1.1.tgz#248e36072ede906501d75966200a86dab8b23170"
3366+
integrity sha1-JI42By7ekGUB11lmIAqG2riyMXA=
3367+
33413368
lodash.sortby@^4.7.0:
33423369
version "4.7.0"
33433370
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
@@ -4376,6 +4403,18 @@ rc@^1.2.7:
43764403
minimist "^1.2.0"
43774404
strip-json-comments "~2.0.1"
43784405

4406+
react-base16-styling@^0.8.0:
4407+
version "0.8.0"
4408+
resolved "https://registry.yarnpkg.com/react-base16-styling/-/react-base16-styling-0.8.0.tgz#6251b814b4e09efab3284ae1ecdd490f2c4111eb"
4409+
integrity sha512-ElvciPaL4xpWh7ISX7ugkNS/dvoh7DpVMp4t93ngnEsS2LkMd8Gu+cDDOLis2rj4889CNK662UdjOfv3wvZg9w==
4410+
dependencies:
4411+
"@types/base16" "^1.0.2"
4412+
"@types/lodash.curry" "^4.1.6"
4413+
base16 "^1.0.0"
4414+
color "^3.1.2"
4415+
csstype "^3.0.2"
4416+
lodash.curry "^4.1.1"
4417+
43794418
react-codemirror2@^7.2.1:
43804419
version "7.2.1"
43814420
resolved "https://registry.yarnpkg.com/react-codemirror2/-/react-codemirror2-7.2.1.tgz#38dab492fcbe5fb8ebf5630e5bb7922db8d3a10c"
@@ -4400,6 +4439,15 @@ react-is@16.13.1, react-is@^16.7.0, react-is@^16.8.1:
44004439
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
44014440
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==
44024441

4442+
react-json-tree@^0.15.0:
4443+
version "0.15.0"
4444+
resolved "https://registry.yarnpkg.com/react-json-tree/-/react-json-tree-0.15.0.tgz#16a5bbed761f711d1656de6c62818d40ddb09442"
4445+
integrity sha512-/bEFXZBfLFiep6ReuzatR8mz9G7sRmejElRDgcAuqY0Jsx7llouax2DM03rlQifrUJgmvTGmPA+olyWYyGagqA==
4446+
dependencies:
4447+
"@types/prop-types" "^15.7.3"
4448+
prop-types "^15.7.2"
4449+
react-base16-styling "^0.8.0"
4450+
44034451
react-refresh@0.8.3:
44044452
version "0.8.3"
44054453
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.3.tgz#721d4657672d400c5e3c75d063c4a85fb2d5d68f"

0 commit comments

Comments
 (0)