Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion editor/components/canvas/figma-embed-canvas.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { embed, FigmaEmbedInput } from "@design-sdk/figma-url";
import { FigmaEmbedInput } from "@design-sdk/figma-url";
import { FigmaEmbed } from "@reflect-blocks/figma-embed";
export function FigmaEmbedCanvas(props: {
src: FigmaEmbedInput;
Expand Down
25 changes: 13 additions & 12 deletions editor/components/figma/screen-importer.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React, { useState } from "react";
import { convert, remote, nodes, Figma } from "@design-sdk/figma";
import { utils_figma } from "../../utils";
import { UserInputCache } from "../../utils/user-input-value-cache";
import { convert, nodes, Figma } from "@design-sdk/figma";
import { types, api, mapper } from "@design-sdk/figma-remote";
import {
parseFileAndNodeId,
FigmaTargetNodeConfig,
} from "@design-sdk/figma-url";
import { utils_figma } from "../../utils";
import { UserInputCache } from "../../utils/user-input-value-cache";

export type OnImportedCallback = (reflect: nodes.ReflectSceneNode) => void;
type _OnRemoteLoadedCallback = (reflect: remote.types.Node) => void;
type _OnRemoteLoadedCallback = (reflect: types.Node) => void;

export interface FigmaReflectImportPack {
remote: remote.api.Node;
remote: api.Node;
figma: Figma.SceneNode;
reflect: nodes.ReflectSceneNode;
}
Expand All @@ -21,7 +22,7 @@ export async function fetchTargetAsReflect(
node: string
): Promise<FigmaReflectImportPack> {
const d = await fetchTarget(file, node);
const _mapped = remote.mapper.mapFigmaRemoteToFigma(d as any);
const _mapped = mapper.mapFigmaRemoteToFigma(d as any);
const _converted = convert.intoReflectNode(_mapped);
return {
remote: d,
Expand All @@ -31,7 +32,7 @@ export async function fetchTargetAsReflect(
}

async function fetchTarget(file: string, node: string) {
const client = remote.api.Client({
const client = api.Client({
personalAccessToken: utils_figma.figmaPersonalAccessToken(),
});

Expand All @@ -47,7 +48,7 @@ async function fetchTarget(file: string, node: string) {

async function fetchDemo() {
const _nid = utils_figma.FIGMA_BRIDGED_DEMO_APP_ENTRY_NODE_ID;
const client = remote.api.Client({
const client = api.Client({
personalAccessToken: utils_figma.figmaPersonalAccessToken(),
});

Expand All @@ -71,9 +72,9 @@ export function FigmaScreenImporter(props: {
}) {
const [reflect, setReflect] = useState<nodes.ReflectSceneNode>();

const handleLocalDataLoad = (d: remote.types.Node) => {
const handleLocalDataLoad = (d: types.Node) => {
console.log("api raw", d);
const _mapped = remote.mapper.mapFigmaRemoteToFigma(d as any);
const _mapped = mapper.mapFigmaRemoteToFigma(d as any);
console.log("mapped", _mapped);
const _converted = convert.intoReflectNode(_mapped);
console.log("converted", _converted);
Expand Down Expand Up @@ -114,7 +115,7 @@ function _DefaultImporterSegment(props: { onLoaded: _OnRemoteLoadedCallback }) {
const handleOnLoadDefaultDesignClick = () => {
fetchDemo().then((d) => {
// it's okay to force cast here. since the typings are the same (following official figma remote api spec)
props.onLoaded(d as remote.types.Node);
props.onLoaded(d as types.Node);
});
};

Expand Down Expand Up @@ -152,7 +153,7 @@ function _UrlImporterSegment(props: {
fetchTarget(figmaTargetConfig.file, figmaTargetConfig.node)
.then((d) => {
setLoadState("complete");
props.onLoaded(d as remote.types.Node);
props.onLoaded(d as types.Node);
})
.catch((_) => {
setLoadState("failed");
Expand Down
4 changes: 2 additions & 2 deletions editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.58",
"@monaco-editor/react": "^4.1.3",
"@reflect-blocks/figma-embed": "^0.0.4",
"@reflect-blocks/figma-embed": "^0.0.5",
"@reflect-ui/editor-ui": "0.0.1",
"@visx/gradient": "^1.7.0",
"@visx/group": "^1.7.0",
Expand Down Expand Up @@ -49,4 +49,4 @@
"next-transpile-modules": "^7.0.0",
"typescript": "^4.2.3"
}
}
}
2 changes: 1 addition & 1 deletion editor/pages/figma/inspect-frame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from "react";
import styled from "@emotion/styled";
import { useReflectTargetNode } from "../../query/from-figma";
import { MonacoEditor } from "../../components/code-editor";
import { BaseFrameMixin, SceneNode } from "@design-sdk/figma";
import { SceneNode } from "@design-sdk/figma-types";

export default function InspectAutolayout() {
//
Expand Down
2 changes: 1 addition & 1 deletion editor/pages/figma/to-reflect.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { figmacomp, canvas } from "../../components";
import { canvas } from "../../components";
import { ReflectSceneNode } from "@design-sdk/core/nodes";
import { visualize_node } from "../../components/visualization";
import { JsonTree } from "../../components/visualization/json-visualization/json-tree";
Expand Down
8 changes: 3 additions & 5 deletions editor/pages/figma/to-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
} from "../../components/visualization/json-visualization/json-tree";
import {
FigmaTargetNodeConfig,
parseFileAndNodeIdFromUrl_Figma,
} from "@design-sdk/core/utils/figma-api-utils";
parseFileAndNodeId,
} from "@design-sdk/figma-url";
import { useRouter } from "next/router";
import { extractFromFigmaQueryParams } from "../../query/from-figma";
import { Figma } from "@design-sdk/figma";
Expand All @@ -35,9 +35,7 @@ export default function FigmaToReflectWidgetTokenPage() {
const params = extractFromFigmaQueryParams(router);
if (params.figma_target_url) {
setFigmaNodeUrl(params.figma_target_url);
const targetnodeconfig = parseFileAndNodeIdFromUrl_Figma(
params.figma_target_url
);
const targetnodeconfig = parseFileAndNodeId(params.figma_target_url);
setTargetnodeConfig(targetnodeconfig);
fetchTargetAsReflect(targetnodeconfig.file, targetnodeconfig.node).then(
(res) => {
Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
"packages/*",
"ui/*",
"packages/reflect-core/packages/*",
"packages/design-sdk/core",
"packages/design-sdk/figma",
"packages/design-sdk/key-annotations",
"packages/design-sdk/sketch",
"packages/design-sdk/universal",
"packages/design-sdk/*",
"packages/coli/packages/*",
"packages/coli-web-builder/*"
]
Expand Down
2 changes: 1 addition & 1 deletion packages/design-sdk
2 changes: 1 addition & 1 deletion packages/designto-token/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"license": "Apache 2.0",
"private": false,
"dependencies": {
"@reflect-ui/core": "0.0.2-rc.7"
"@reflect-ui/core": "0.0.2-rc.7-local"
}
}
2 changes: 1 addition & 1 deletion packages/designto-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"license": "Apache 2.0",
"private": false,
"dependencies": {
"@reflect-ui/core": "0.0.2-rc.7"
"@reflect-ui/core": "0.0.2-rc.7-local"
}
}
2 changes: 1 addition & 1 deletion packages/reflect-core
2 changes: 1 addition & 1 deletion packages/reflect-detection
Loading