From 054defa2252497735d93abccec7bf216ee63742d Mon Sep 17 00:00:00 2001 From: softmarshmallow Date: Tue, 2 Nov 2021 15:08:56 +0900 Subject: [PATCH] move use-design under `hooks` from `query-hooks` --- editor/hooks/index.ts | 1 + editor/{query-hooks => hooks}/use-design.ts | 4 ++-- editor/pages/figma/inspect-component.tsx | 2 +- editor/pages/figma/inspect-frame.tsx | 2 +- editor/pages/figma/inspect-raw.tsx | 2 +- editor/pages/figma/to-flutter.tsx | 2 +- editor/pages/figma/to-token.tsx | 2 +- editor/pages/live/index.tsx | 2 +- editor/pages/to-code/index.tsx | 2 +- editor/query-hooks/index.ts | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) rename editor/{query-hooks => hooks}/use-design.ts (96%) diff --git a/editor/hooks/index.ts b/editor/hooks/index.ts index d472ec912..d39a011cc 100644 --- a/editor/hooks/index.ts +++ b/editor/hooks/index.ts @@ -1 +1,2 @@ +export * from "./use-design"; export * from "./use-async-effect"; diff --git a/editor/query-hooks/use-design.ts b/editor/hooks/use-design.ts similarity index 96% rename from editor/query-hooks/use-design.ts rename to editor/hooks/use-design.ts index 91fa8518c..0360aab3e 100644 --- a/editor/query-hooks/use-design.ts +++ b/editor/hooks/use-design.ts @@ -11,8 +11,8 @@ import { configure_auth_credentials } from "@design-sdk/figma-remote"; import { TargetNodeConfig } from "../query/target-node"; import { FigmaRemoteErrors } from "@design-sdk/figma-remote/lib/fetch"; import { RemoteDesignSessionCacheStore } from "../store"; -import { convert } from "../../packages/design-sdk/figma-node-conversion"; -import { mapFigmaRemoteToFigma } from "../../packages/design-sdk/figma-remote/lib/mapper"; +import { convert } from "@design-sdk/figma-node-conversion"; +import { mapFigmaRemoteToFigma } from "@design-sdk/figma-remote/lib/mapper"; // globally configure auth credentials for interacting with `@design-sdk/figma-remote` configure_auth_credentials({ diff --git a/editor/pages/figma/inspect-component.tsx b/editor/pages/figma/inspect-component.tsx index ed7bf4b2b..a023ffe88 100644 --- a/editor/pages/figma/inspect-component.tsx +++ b/editor/pages/figma/inspect-component.tsx @@ -17,7 +17,7 @@ import { WorkspaceContentPanelGridLayout, } from "../../layout/panel"; import { WorkspaceBottomPanelDockLayout } from "../../layout/panel/workspace-bottom-panel-dock-layout"; -import { useDesign } from "../../query-hooks"; +import { useDesign } from "../../hooks"; import { make_instance_component_meta } from "@code-features/component"; export default function InspectComponent() { diff --git a/editor/pages/figma/inspect-frame.tsx b/editor/pages/figma/inspect-frame.tsx index 54495d3a4..4fcd76df8 100644 --- a/editor/pages/figma/inspect-frame.tsx +++ b/editor/pages/figma/inspect-frame.tsx @@ -1,7 +1,7 @@ import React from "react"; import { MonacoEditor } from "../../components/code-editor"; import { SceneNode } from "@design-sdk/figma-types"; -import { useDesign } from "../../query-hooks"; +import { useDesign } from "../../hooks"; import LoadingLayout from "../../layout/loading-overlay"; /** diff --git a/editor/pages/figma/inspect-raw.tsx b/editor/pages/figma/inspect-raw.tsx index 7ed906e59..245c18061 100644 --- a/editor/pages/figma/inspect-raw.tsx +++ b/editor/pages/figma/inspect-raw.tsx @@ -1,6 +1,6 @@ import React from "react"; import { MonacoEditor } from "../../components/code-editor"; -import { useDesign } from "../../query-hooks"; +import { useDesign } from "../../hooks"; import LoadingLayout from "../../layout/loading-overlay"; /** diff --git a/editor/pages/figma/to-flutter.tsx b/editor/pages/figma/to-flutter.tsx index a7dbbc618..07e172dbf 100644 --- a/editor/pages/figma/to-flutter.tsx +++ b/editor/pages/figma/to-flutter.tsx @@ -16,7 +16,7 @@ import { WorkspaceContentPanelGridLayout, } from "../../layout/panel"; import { PreviewAndRunPanel } from "../../components/preview-and-run"; -import { useDesign } from "../../query-hooks"; +import { useDesign } from "../../hooks"; import { CodeEditor, MonacoEditor } from "../../components/code-editor"; import LoadingLayout from "../../layout/loading-overlay"; diff --git a/editor/pages/figma/to-token.tsx b/editor/pages/figma/to-token.tsx index bc25b8c72..5c6e1ac14 100644 --- a/editor/pages/figma/to-token.tsx +++ b/editor/pages/figma/to-token.tsx @@ -10,7 +10,7 @@ import { LayerHierarchy } from "../../components/editor-hierarchy"; import { WorkspaceContentPanelGridLayout } from "../../layout/panel/workspace-content-panel-grid-layout"; import { WorkspaceContentPanel } from "../../layout/panel"; import { WorkspaceBottomPanelDockLayout } from "../../layout/panel/workspace-bottom-panel-dock-layout"; -import { useDesign } from "../../query-hooks"; +import { useDesign } from "../../hooks"; import { ImageRepository, MainImageRepository, diff --git a/editor/pages/live/index.tsx b/editor/pages/live/index.tsx index b856181cd..0c5e5c5c1 100644 --- a/editor/pages/live/index.tsx +++ b/editor/pages/live/index.tsx @@ -3,7 +3,7 @@ import Pusher from "pusher-js"; import { useState } from "react"; import { useEffect } from "react"; import LoadingLayout from "../../layout/loading-overlay"; -import { useDesign } from "../../query-hooks"; +import { useDesign } from "../../hooks"; const _base_url = "https://ahzdf5x4q3.execute-api.us-west-1.amazonaws.com/production"; // "https://assistant-live-session.grida.cc"; diff --git a/editor/pages/to-code/index.tsx b/editor/pages/to-code/index.tsx index f973a8ad4..84feb185c 100644 --- a/editor/pages/to-code/index.tsx +++ b/editor/pages/to-code/index.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useState } from "react"; import { designToCode, Result } from "@designto/code"; -import { useDesign } from "../../query-hooks"; +import { useDesign } from "../../hooks"; import styled from "@emotion/styled"; import { DefaultEditorWorkspaceLayout } from "../../layout/default-editor-workspace-layout"; import { PreviewAndRunPanel } from "../../components/preview-and-run"; diff --git a/editor/query-hooks/index.ts b/editor/query-hooks/index.ts index 627279471..5c9c23e34 100644 --- a/editor/query-hooks/index.ts +++ b/editor/query-hooks/index.ts @@ -1 +1 @@ -export * from "./use-design"; +export const dummy = "wip";