diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml
index adafd067..dbe6b0b0 100644
--- a/.github/workflows/artifacts.yml
+++ b/.github/workflows/artifacts.yml
@@ -10,8 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
-# platform: [ ubuntu-latest, macos-latest, windows-latest ]
- platform: [ macos-latest ]
+ platform: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- uses: actions/checkout@v3
diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json
index 20413c28..6b71864f 100644
--- a/src-tauri/tauri.conf.json
+++ b/src-tauri/tauri.conf.json
@@ -8,7 +8,7 @@
},
"package": {
"productName": "Yaak",
- "version": "0.0.1"
+ "version": "0.0.2"
},
"tauri": {
"windows": [
diff --git a/src-web/App.tsx b/src-web/components/App.tsx
similarity index 88%
rename from src-web/App.tsx
rename to src-web/components/App.tsx
index b9489754..c3cba9f8 100644
--- a/src-web/App.tsx
+++ b/src-web/components/App.tsx
@@ -2,12 +2,12 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { listen } from '@tauri-apps/api/event';
import { MotionConfig } from 'framer-motion';
import { HelmetProvider } from 'react-helmet-async';
-import { AppRouter } from './components/AppRouter';
-import { requestsQueryKey } from './hooks/useRequests';
-import { responsesQueryKey } from './hooks/useResponses';
-import { DEFAULT_FONT_SIZE } from './lib/constants';
-import type { HttpRequest, HttpResponse } from './lib/models';
-import { convertDates } from './lib/models';
+import { AppRouter } from './AppRouter';
+import { requestsQueryKey } from '../hooks/useRequests';
+import { responsesQueryKey } from '../hooks/useResponses';
+import { DEFAULT_FONT_SIZE } from '../lib/constants';
+import type { HttpRequest, HttpResponse } from '../lib/models';
+import { convertDates } from '../lib/models';
const queryClient = new QueryClient();
diff --git a/src-web/components/AppRouter.tsx b/src-web/components/AppRouter.tsx
index 3c50531d..ad7977a6 100644
--- a/src-web/components/AppRouter.tsx
+++ b/src-web/components/AppRouter.tsx
@@ -1,8 +1,8 @@
import { lazy, Suspense } from 'react';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
-const Workspaces = lazy(() => import('../pages/Workspaces'));
-const Workspace = lazy(() => import('../pages/Workspace'));
+const Workspaces = lazy(() => import('./Workspaces'));
+const Workspace = lazy(() => import('./Workspace'));
const RouteError = lazy(() => import('./RouteError'));
const router = createBrowserRouter([
diff --git a/src-web/components/Colors.tsx b/src-web/components/Colors.tsx
deleted file mode 100644
index 34f1b162..00000000
--- a/src-web/components/Colors.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import classnames from 'classnames';
-import { HStack, VStack } from './Stacks';
-
-export function Colors() {
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-}
-
-function Color({ className }: { className: string }) {
- return
;
-}
diff --git a/src-web/components/Grid.tsx b/src-web/components/Grid.tsx
deleted file mode 100644
index 6d705f87..00000000
--- a/src-web/components/Grid.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import classnames from 'classnames';
-import type { ReactNode } from 'react';
-
-const colsClasses: Record = {
- none: 'grid-cols-none',
- 1: 'grid-cols-1',
- 2: 'grid-cols-2',
- 3: 'grid-cols-3',
- 11: 'grid-cols-11',
-};
-
-const rowsClasses = {
- none: 'grid-rows-none',
- 1: 'grid-rows-1',
- 2: 'grid-rows-2',
- 3: 'grid-rows-3',
- 11: 'grid-rows-11',
-};
-
-const gapClasses = {
- 0: 'gap-0',
- 1: 'gap-1',
- 2: 'gap-2',
- 3: 'gap-3',
-};
-
-interface Props {
- rows?: keyof typeof rowsClasses;
- cols?: keyof typeof colsClasses;
- gap?: keyof typeof gapClasses;
- className?: string;
- children?: ReactNode;
-}
-
-export function Grid({ className, cols, gap, children }: Props) {
- return (
-
- {children}
-
- );
-}
diff --git a/src-web/components/HeaderEditor.tsx b/src-web/components/HeaderEditor.tsx
index 18179fd6..0aa9a84e 100644
--- a/src-web/components/HeaderEditor.tsx
+++ b/src-web/components/HeaderEditor.tsx
@@ -2,9 +2,9 @@ import classnames from 'classnames';
import { useEffect, useState } from 'react';
import { useUpdateRequest } from '../hooks/useUpdateRequest';
import type { HttpHeader, HttpRequest } from '../lib/models';
-import { IconButton } from './IconButton';
-import { Input } from './Input';
-import { VStack } from './Stacks';
+import { IconButton } from './core/IconButton';
+import { Input } from './core/Input';
+import { VStack } from './core/Stacks';
interface Props {
request: HttpRequest;
diff --git a/src-web/components/RequestPane.tsx b/src-web/components/RequestPane.tsx
index 059507e2..7d67a6c2 100644
--- a/src-web/components/RequestPane.tsx
+++ b/src-web/components/RequestPane.tsx
@@ -2,9 +2,9 @@ import classnames from 'classnames';
import { useActiveRequest } from '../hooks/useActiveRequest';
import { useSendRequest } from '../hooks/useSendRequest';
import { useUpdateRequest } from '../hooks/useUpdateRequest';
-import { Editor } from './Editor';
+import { Editor } from './core/Editor';
import { HeaderEditor } from './HeaderEditor';
-import { TabContent, Tabs } from './Tabs';
+import { TabContent, Tabs } from './core/Tabs/Tabs';
import { UrlBar } from './UrlBar';
interface Props {
diff --git a/src-web/components/ResponsePane.tsx b/src-web/components/ResponsePane.tsx
index 794ac6b9..ad6cbde3 100644
--- a/src-web/components/ResponsePane.tsx
+++ b/src-web/components/ResponsePane.tsx
@@ -4,13 +4,13 @@ import { useDeleteResponses } from '../hooks/useDeleteResponses';
import { useDeleteResponse } from '../hooks/useResponseDelete';
import { useResponses } from '../hooks/useResponses';
import { tryFormatJson } from '../lib/formatters';
-import { Dropdown } from './Dropdown';
-import { Editor } from './Editor';
-import { Icon } from './Icon';
-import { IconButton } from './IconButton';
-import { HStack } from './Stacks';
-import { StatusColor } from './StatusColor';
-import { Webview } from './Webview';
+import { Dropdown } from './core/Dropdown';
+import { Editor } from './core/Editor';
+import { Icon } from './core/Icon';
+import { IconButton } from './core/IconButton';
+import { HStack } from './core/Stacks';
+import { StatusColor } from './core/StatusColor';
+import { Webview } from './core/Webview';
interface Props {
className?: string;
diff --git a/src-web/components/RouteError.tsx b/src-web/components/RouteError.tsx
index aada28b1..cb05f3b2 100644
--- a/src-web/components/RouteError.tsx
+++ b/src-web/components/RouteError.tsx
@@ -1,7 +1,7 @@
import { useRouteError } from 'react-router-dom';
-import { ButtonLink } from './ButtonLink';
-import { Heading } from './Heading';
-import { VStack } from './Stacks';
+import { ButtonLink } from './core/ButtonLink';
+import { Heading } from './core/Heading';
+import { VStack } from './core/Stacks';
export default function RouteError() {
const error = useRouteError();
diff --git a/src-web/components/Sidebar.tsx b/src-web/components/Sidebar.tsx
index c6147aad..4f151760 100644
--- a/src-web/components/Sidebar.tsx
+++ b/src-web/components/Sidebar.tsx
@@ -6,10 +6,10 @@ import { useRequests } from '../hooks/useRequests';
import { useTheme } from '../hooks/useTheme';
import { useUpdateRequest } from '../hooks/useUpdateRequest';
import type { HttpRequest } from '../lib/models';
-import { ButtonLink } from './ButtonLink';
-import { IconButton } from './IconButton';
-import { HStack, VStack } from './Stacks';
-import { WindowDragRegion } from './WindowDragRegion';
+import { ButtonLink } from './core/ButtonLink';
+import { IconButton } from './core/IconButton';
+import { HStack, VStack } from './core/Stacks';
+import { WindowDragRegion } from './core/WindowDragRegion';
interface Props {
className?: string;
diff --git a/src-web/components/UrlBar.tsx b/src-web/components/UrlBar.tsx
index 651b02fe..099a45af 100644
--- a/src-web/components/UrlBar.tsx
+++ b/src-web/components/UrlBar.tsx
@@ -1,7 +1,7 @@
-import { Button } from './Button';
-import { DropdownMenuRadio } from './Dropdown';
-import { IconButton } from './IconButton';
-import { Input } from './Input';
+import { Button } from './core/Button';
+import { DropdownMenuRadio } from './core/Dropdown';
+import { IconButton } from './core/IconButton';
+import { Input } from './core/Input';
interface Props {
sendRequest: () => void;
diff --git a/src-web/pages/Workspace.tsx b/src-web/components/Workspace.tsx
similarity index 79%
rename from src-web/pages/Workspace.tsx
rename to src-web/components/Workspace.tsx
index 7771593a..0eb275b8 100644
--- a/src-web/pages/Workspace.tsx
+++ b/src-web/components/Workspace.tsx
@@ -1,10 +1,10 @@
import classnames from 'classnames';
import { useWindowSize } from 'react-use';
-import { RequestPane } from '../components/RequestPane';
-import { ResponsePane } from '../components/ResponsePane';
-import { Sidebar } from '../components/Sidebar';
-import { HStack } from '../components/Stacks';
-import { WindowDragRegion } from '../components/WindowDragRegion';
+import { RequestPane } from './RequestPane';
+import { ResponsePane } from './ResponsePane';
+import { Sidebar } from './Sidebar';
+import { HStack } from './core/Stacks';
+import { WindowDragRegion } from './core/WindowDragRegion';
import { useActiveRequest } from '../hooks/useActiveRequest';
export default function Workspace() {
diff --git a/src-web/pages/Workspaces.tsx b/src-web/components/Workspaces.tsx
similarity index 72%
rename from src-web/pages/Workspaces.tsx
rename to src-web/components/Workspaces.tsx
index 076b8612..74016ce3 100644
--- a/src-web/pages/Workspaces.tsx
+++ b/src-web/components/Workspaces.tsx
@@ -1,6 +1,6 @@
-import { ButtonLink } from '../components/ButtonLink';
-import { Heading } from '../components/Heading';
-import { VStack } from '../components/Stacks';
+import { ButtonLink } from './core/ButtonLink';
+import { Heading } from './core/Heading';
+import { VStack } from './core/Stacks';
import { useWorkspaces } from '../hooks/useWorkspaces';
export default function Workspaces() {
diff --git a/src-web/components/Button.tsx b/src-web/components/core/Button.tsx
similarity index 100%
rename from src-web/components/Button.tsx
rename to src-web/components/core/Button.tsx
diff --git a/src-web/components/ButtonLink.tsx b/src-web/components/core/ButtonLink.tsx
similarity index 100%
rename from src-web/components/ButtonLink.tsx
rename to src-web/components/core/ButtonLink.tsx
diff --git a/src-web/components/Dialog.tsx b/src-web/components/core/Dialog.tsx
similarity index 100%
rename from src-web/components/Dialog.tsx
rename to src-web/components/core/Dialog.tsx
diff --git a/src-web/components/Divider.tsx b/src-web/components/core/Divider.tsx
similarity index 100%
rename from src-web/components/Divider.tsx
rename to src-web/components/core/Divider.tsx
diff --git a/src-web/components/Dropdown.tsx b/src-web/components/core/Dropdown.tsx
similarity index 100%
rename from src-web/components/Dropdown.tsx
rename to src-web/components/core/Dropdown.tsx
diff --git a/src-web/components/Editor/Editor.css b/src-web/components/core/Editor/Editor.css
similarity index 100%
rename from src-web/components/Editor/Editor.css
rename to src-web/components/core/Editor/Editor.css
diff --git a/src-web/components/Editor/Editor.tsx b/src-web/components/core/Editor/Editor.tsx
similarity index 99%
rename from src-web/components/Editor/Editor.tsx
rename to src-web/components/core/Editor/Editor.tsx
index d7d9635a..dd38e718 100644
--- a/src-web/components/Editor/Editor.tsx
+++ b/src-web/components/core/Editor/Editor.tsx
@@ -6,7 +6,7 @@ import { EditorView } from 'codemirror';
import { formatSdl } from 'format-graphql';
import { useEffect, useRef } from 'react';
import { useDebounce, useUnmount } from 'react-use';
-import { debounce } from '../../lib/debounce';
+import { debounce } from '../../../lib/debounce';
import { IconButton } from '../IconButton';
import './Editor.css';
import { baseExtensions, getLanguageExtension, multiLineExtensions } from './extensions';
diff --git a/src-web/components/Editor/autocomplete.ts b/src-web/components/core/Editor/autocomplete.ts
similarity index 95%
rename from src-web/components/Editor/autocomplete.ts
rename to src-web/components/core/Editor/autocomplete.ts
index f1606861..0ad8b584 100644
--- a/src-web/components/Editor/autocomplete.ts
+++ b/src-web/components/core/Editor/autocomplete.ts
@@ -1,6 +1,6 @@
import { closeCompletion, startCompletion } from '@codemirror/autocomplete';
import { EditorView } from 'codemirror';
-import { debounce } from '../../lib/debounce';
+import { debounce } from '../../../lib/debounce';
/*
* Debounce autocomplete until user stops typing for `millis` milliseconds.
diff --git a/src-web/components/Editor/extensions.ts b/src-web/components/core/Editor/extensions.ts
similarity index 100%
rename from src-web/components/Editor/extensions.ts
rename to src-web/components/core/Editor/extensions.ts
diff --git a/src-web/components/Editor/index.tsx b/src-web/components/core/Editor/index.tsx
similarity index 100%
rename from src-web/components/Editor/index.tsx
rename to src-web/components/core/Editor/index.tsx
diff --git a/src-web/components/Editor/singleLine.ts b/src-web/components/core/Editor/singleLine.ts
similarity index 100%
rename from src-web/components/Editor/singleLine.ts
rename to src-web/components/core/Editor/singleLine.ts
diff --git a/src-web/components/Editor/twig/completion.ts b/src-web/components/core/Editor/twig/completion.ts
similarity index 100%
rename from src-web/components/Editor/twig/completion.ts
rename to src-web/components/core/Editor/twig/completion.ts
diff --git a/src-web/components/Editor/twig/extension.ts b/src-web/components/core/Editor/twig/extension.ts
similarity index 100%
rename from src-web/components/Editor/twig/extension.ts
rename to src-web/components/core/Editor/twig/extension.ts
diff --git a/src-web/components/Editor/twig/highlight.ts b/src-web/components/core/Editor/twig/highlight.ts
similarity index 100%
rename from src-web/components/Editor/twig/highlight.ts
rename to src-web/components/core/Editor/twig/highlight.ts
diff --git a/src-web/components/Editor/twig/twig.grammar b/src-web/components/core/Editor/twig/twig.grammar
similarity index 100%
rename from src-web/components/Editor/twig/twig.grammar
rename to src-web/components/core/Editor/twig/twig.grammar
diff --git a/src-web/components/Editor/twig/twig.terms.ts b/src-web/components/core/Editor/twig/twig.terms.ts
similarity index 100%
rename from src-web/components/Editor/twig/twig.terms.ts
rename to src-web/components/core/Editor/twig/twig.terms.ts
diff --git a/src-web/components/Editor/twig/twig.ts b/src-web/components/core/Editor/twig/twig.ts
similarity index 100%
rename from src-web/components/Editor/twig/twig.ts
rename to src-web/components/core/Editor/twig/twig.ts
diff --git a/src-web/components/Editor/url/completion.ts b/src-web/components/core/Editor/url/completion.ts
similarity index 100%
rename from src-web/components/Editor/url/completion.ts
rename to src-web/components/core/Editor/url/completion.ts
diff --git a/src-web/components/Editor/url/extension.ts b/src-web/components/core/Editor/url/extension.ts
similarity index 100%
rename from src-web/components/Editor/url/extension.ts
rename to src-web/components/core/Editor/url/extension.ts
diff --git a/src-web/components/Editor/url/highlight.ts b/src-web/components/core/Editor/url/highlight.ts
similarity index 100%
rename from src-web/components/Editor/url/highlight.ts
rename to src-web/components/core/Editor/url/highlight.ts
diff --git a/src-web/components/Editor/url/url.grammar b/src-web/components/core/Editor/url/url.grammar
similarity index 100%
rename from src-web/components/Editor/url/url.grammar
rename to src-web/components/core/Editor/url/url.grammar
diff --git a/src-web/components/Editor/url/url.terms.ts b/src-web/components/core/Editor/url/url.terms.ts
similarity index 100%
rename from src-web/components/Editor/url/url.terms.ts
rename to src-web/components/core/Editor/url/url.terms.ts
diff --git a/src-web/components/Editor/url/url.ts b/src-web/components/core/Editor/url/url.ts
similarity index 100%
rename from src-web/components/Editor/url/url.ts
rename to src-web/components/core/Editor/url/url.ts
diff --git a/src-web/components/Editor/widgets.ts b/src-web/components/core/Editor/widgets.ts
similarity index 100%
rename from src-web/components/Editor/widgets.ts
rename to src-web/components/core/Editor/widgets.ts
diff --git a/src-web/components/Heading.tsx b/src-web/components/core/Heading.tsx
similarity index 100%
rename from src-web/components/Heading.tsx
rename to src-web/components/core/Heading.tsx
diff --git a/src-web/components/HotKey.tsx b/src-web/components/core/HotKey.tsx
similarity index 100%
rename from src-web/components/HotKey.tsx
rename to src-web/components/core/HotKey.tsx
diff --git a/src-web/components/Icon.tsx b/src-web/components/core/Icon.tsx
similarity index 100%
rename from src-web/components/Icon.tsx
rename to src-web/components/core/Icon.tsx
diff --git a/src-web/components/IconButton.tsx b/src-web/components/core/IconButton.tsx
similarity index 96%
rename from src-web/components/IconButton.tsx
rename to src-web/components/core/IconButton.tsx
index 7e4ba978..354213de 100644
--- a/src-web/components/IconButton.tsx
+++ b/src-web/components/core/IconButton.tsx
@@ -1,5 +1,5 @@
import classnames from 'classnames';
-import { forwardRef } from "react";
+import { forwardRef } from 'react';
import type { ButtonProps } from './Button';
import { Button } from './Button';
import type { IconProps } from './Icon';
diff --git a/src-web/components/Input.tsx b/src-web/components/core/Input.tsx
similarity index 100%
rename from src-web/components/Input.tsx
rename to src-web/components/core/Input.tsx
diff --git a/src-web/components/ScrollArea.tsx b/src-web/components/core/ScrollArea.tsx
similarity index 100%
rename from src-web/components/ScrollArea.tsx
rename to src-web/components/core/ScrollArea.tsx
diff --git a/src-web/components/Stacks.tsx b/src-web/components/core/Stacks.tsx
similarity index 100%
rename from src-web/components/Stacks.tsx
rename to src-web/components/core/Stacks.tsx
diff --git a/src-web/components/StatusColor.tsx b/src-web/components/core/StatusColor.tsx
similarity index 100%
rename from src-web/components/StatusColor.tsx
rename to src-web/components/core/StatusColor.tsx
diff --git a/src-web/components/Tabs.css b/src-web/components/core/Tabs/Tabs.css
similarity index 100%
rename from src-web/components/Tabs.css
rename to src-web/components/core/Tabs/Tabs.css
diff --git a/src-web/components/Tabs.tsx b/src-web/components/core/Tabs/Tabs.tsx
similarity index 88%
rename from src-web/components/Tabs.tsx
rename to src-web/components/core/Tabs/Tabs.tsx
index bc0c2d90..17d09184 100644
--- a/src-web/components/Tabs.tsx
+++ b/src-web/components/core/Tabs/Tabs.tsx
@@ -2,9 +2,9 @@ import * as T from '@radix-ui/react-tabs';
import classnames from 'classnames';
import type { ReactNode } from 'react';
import { useState } from 'react';
-import { Button } from './Button';
-import { ScrollArea } from './ScrollArea';
-import { HStack } from './Stacks';
+import { Button } from '../Button';
+import { ScrollArea } from '../ScrollArea';
+import { HStack } from '../Stacks';
import './Tabs.css';
@@ -27,7 +27,10 @@ export function Tabs({ defaultValue, label, children, tabs, className, tabListCl
>
{/**/}
diff --git a/src-web/components/Webview.tsx b/src-web/components/core/Webview.tsx
similarity index 100%
rename from src-web/components/Webview.tsx
rename to src-web/components/core/Webview.tsx
diff --git a/src-web/components/WindowDragRegion.tsx b/src-web/components/core/WindowDragRegion.tsx
similarity index 100%
rename from src-web/components/WindowDragRegion.tsx
rename to src-web/components/core/WindowDragRegion.tsx
diff --git a/src-web/main.tsx b/src-web/main.tsx
index 3850ea9d..db0fd1ef 100644
--- a/src-web/main.tsx
+++ b/src-web/main.tsx
@@ -1,5 +1,5 @@
import ReactDOM from 'react-dom/client';
-import { App } from './App';
+import { App } from './components/App';
import { setAppearance } from './lib/theme/window';
import './main.css';