Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

refactor folder structure

AykutSaracca36a4ba44ed
diff --git a/src/containers/Editor/index.tsx b/src/containers/Editor/index.tsx
deleted file mode 100644
index 2694b103..00000000
--- a/src/containers/Editor/index.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-import React from "react";
-import dynamic from "next/dynamic";
-import styled from "styled-components";
-import { Allotment } from "allotment";
-import "allotment/dist/style.css";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
-import { FullscreenDropzone } from "./components/FullscreenDropzone";
-
-export const StyledEditor = styled(Allotment)`
- position: relative !important;
- display: flex;
- background: ${({ theme }) => theme.BACKGROUND_SECONDARY};
- height: calc(100vh - 67px);
-
- @media only screen and (max-width: 320px) {
- height: 100vh;
- }
-`;
-
-const TextEditor = dynamic(() => import("src/containers/Editor/components/TextEditor"), {
- ssr: false,
-});
-
-const LiveEditor = dynamic(() => import("src/containers/Editor/components/LiveEditor"), {
- ssr: false,
-});
-
-export const Editor = () => {
- const fullscreen = useGraph(state => state.fullscreen);
-
- return (
- <>
- <StyledEditor proportionalLayout={false}>
- <Allotment.Pane
- preferredSize={450}
- minSize={fullscreen ? 0 : 300}
- maxSize={800}
- visible={!fullscreen}
- >
- <TextEditor />
- </Allotment.Pane>
- <Allotment.Pane minSize={0}>
- <LiveEditor />
- </Allotment.Pane>
- </StyledEditor>
- <FullscreenDropzone />
- </>
- );
-};
diff --git a/src/containers/Editor/components/BottomBar.tsx b/src/features/editor/BottomBar.tsx
similarity index 98%
rename from src/containers/Editor/components/BottomBar.tsx
rename to src/features/editor/BottomBar.tsx
index b5c2237b..7a7ea755 100644
--- a/src/containers/Editor/components/BottomBar.tsx
+++ b/src/features/editor/BottomBar.tsx
@@ -12,7 +12,7 @@ import {
VscSync,
VscSyncIgnored,
} from "react-icons/vsc";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import useConfig from "src/store/useConfig";
import useFile from "src/store/useFile";
diff --git a/src/layout/ExternalMode.tsx b/src/features/editor/ExternalMode.tsx
similarity index 100%
rename from src/layout/ExternalMode.tsx
rename to src/features/editor/ExternalMode.tsx
diff --git a/src/containers/Editor/components/FullscreenDropzone.tsx b/src/features/editor/FullscreenDropzone.tsx
similarity index 100%
rename from src/containers/Editor/components/FullscreenDropzone.tsx
rename to src/features/editor/FullscreenDropzone.tsx
diff --git a/src/containers/Editor/components/LiveEditor.tsx b/src/features/editor/LiveEditor.tsx
similarity index 86%
rename from src/containers/Editor/components/LiveEditor.tsx
rename to src/features/editor/LiveEditor.tsx
index 183bdd50..2fd80fbb 100644
--- a/src/containers/Editor/components/LiveEditor.tsx
+++ b/src/features/editor/LiveEditor.tsx
@@ -1,8 +1,8 @@
import React from "react";
import styled from "styled-components";
-import { GraphView } from "src/containers/Editor/components/views/GraphView";
-import { TreeView } from "src/containers/Editor/components/views/TreeView";
import { ViewMode } from "src/enums/viewMode.enum";
+import { GraphView } from "src/features/editor/views/GraphView";
+import { TreeView } from "src/features/editor/views/TreeView";
import useConfig from "src/store/useConfig";
const StyledLiveEditor = styled.div`
diff --git a/src/layout/ModalController.tsx b/src/features/editor/ModalController.tsx
similarity index 92%
rename from src/layout/ModalController.tsx
rename to src/features/editor/ModalController.tsx
index 47aceb79..f06e5ff6 100644
--- a/src/layout/ModalController.tsx
+++ b/src/features/editor/ModalController.tsx
@@ -1,7 +1,7 @@
import React from "react";
import type { ModalProps } from "@mantine/core";
-import * as Modals from "src/containers/Modals";
-import type { Modal } from "src/containers/Modals";
+import * as Modals from "src/features/modals";
+import type { Modal } from "src/features/modals";
import useModal from "src/store/useModal";
type ModalComponent = { key: Modal; component: React.FC<ModalProps> };
diff --git a/src/containers/Editor/components/TextEditor.tsx b/src/features/editor/TextEditor.tsx
similarity index 100%
rename from src/containers/Editor/components/TextEditor.tsx
rename to src/features/editor/TextEditor.tsx
diff --git a/src/containers/Toolbar/FileMenu.tsx b/src/features/editor/Toolbar/FileMenu.tsx
similarity index 100%
rename from src/containers/Toolbar/FileMenu.tsx
rename to src/features/editor/Toolbar/FileMenu.tsx
diff --git a/src/containers/Toolbar/Logo.tsx b/src/features/editor/Toolbar/Logo.tsx
similarity index 100%
rename from src/containers/Toolbar/Logo.tsx
rename to src/features/editor/Toolbar/Logo.tsx
diff --git a/src/containers/Toolbar/OptionsMenu.tsx b/src/features/editor/Toolbar/OptionsMenu.tsx
similarity index 100%
rename from src/containers/Toolbar/OptionsMenu.tsx
rename to src/features/editor/Toolbar/OptionsMenu.tsx
diff --git a/src/containers/Toolbar/SearchInput.tsx b/src/features/editor/Toolbar/SearchInput.tsx
similarity index 100%
rename from src/containers/Toolbar/SearchInput.tsx
rename to src/features/editor/Toolbar/SearchInput.tsx
diff --git a/src/containers/Toolbar/ToolsMenu.tsx b/src/features/editor/Toolbar/ToolsMenu.tsx
similarity index 100%
rename from src/containers/Toolbar/ToolsMenu.tsx
rename to src/features/editor/Toolbar/ToolsMenu.tsx
diff --git a/src/containers/Toolbar/ViewMenu.tsx b/src/features/editor/Toolbar/ViewMenu.tsx
similarity index 98%
rename from src/containers/Toolbar/ViewMenu.tsx
rename to src/features/editor/Toolbar/ViewMenu.tsx
index 3e95ddf9..0784f84c 100644
--- a/src/containers/Toolbar/ViewMenu.tsx
+++ b/src/features/editor/Toolbar/ViewMenu.tsx
@@ -7,8 +7,8 @@ import toast from "react-hot-toast";
import { CgChevronDown } from "react-icons/cg";
import { TiFlowMerge } from "react-icons/ti";
import { VscExpandAll, VscCollapseAll, VscTarget } from "react-icons/vsc";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
import { ViewMode } from "src/enums/viewMode.enum";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import useToggleHide from "src/hooks/useToggleHide";
import useConfig from "src/store/useConfig";
import type { LayoutDirection } from "src/types/graph";
diff --git a/src/containers/Toolbar/ZoomMenu.tsx b/src/features/editor/Toolbar/ZoomMenu.tsx
similarity index 97%
rename from src/containers/Toolbar/ZoomMenu.tsx
rename to src/features/editor/Toolbar/ZoomMenu.tsx
index e46ca910..d616d8b6 100644
--- a/src/containers/Toolbar/ZoomMenu.tsx
+++ b/src/features/editor/Toolbar/ZoomMenu.tsx
@@ -3,7 +3,7 @@ import { Menu, Flex, Input, Text } from "@mantine/core";
import { getHotkeyHandler, useHotkeys } from "@mantine/hooks";
import { event as gaEvent } from "nextjs-google-analytics";
import { CgChevronDown } from "react-icons/cg";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import { StyledToolElement } from "./styles";
export const ZoomMenu = () => {
diff --git a/src/containers/Toolbar/index.tsx b/src/features/editor/Toolbar/index.tsx
similarity index 97%
rename from src/containers/Toolbar/index.tsx
rename to src/features/editor/Toolbar/index.tsx
index 415da128..7b12870d 100644
--- a/src/containers/Toolbar/index.tsx
+++ b/src/features/editor/Toolbar/index.tsx
@@ -5,8 +5,8 @@ import toast from "react-hot-toast";
import { AiOutlineFullscreen } from "react-icons/ai";
import { FiDownload } from "react-icons/fi";
import { LuCrown } from "react-icons/lu";
-import { SearchInput } from "src/containers/Toolbar/SearchInput";
import { type FileFormat, formats } from "src/enums/file.enum";
+import { SearchInput } from "src/features/editor/Toolbar/SearchInput";
import { JSONCrackLogo } from "src/layout/JsonCrackLogo";
import useFile from "src/store/useFile";
import useModal from "src/store/useModal";
diff --git a/src/containers/Toolbar/styles.ts b/src/features/editor/Toolbar/styles.ts
similarity index 100%
rename from src/containers/Toolbar/styles.ts
rename to src/features/editor/Toolbar/styles.ts
diff --git a/src/containers/Editor/components/views/GraphView/CustomEdge/index.tsx b/src/features/editor/views/GraphView/CustomEdge/index.tsx
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/CustomEdge/index.tsx
rename to src/features/editor/views/GraphView/CustomEdge/index.tsx
diff --git a/src/containers/Editor/components/views/GraphView/CustomNode/ObjectNode.tsx b/src/features/editor/views/GraphView/CustomNode/ObjectNode.tsx
similarity index 92%
rename from src/containers/Editor/components/views/GraphView/CustomNode/ObjectNode.tsx
rename to src/features/editor/views/GraphView/CustomNode/ObjectNode.tsx
index 64e8c856..4d502722 100644
--- a/src/containers/Editor/components/views/GraphView/CustomNode/ObjectNode.tsx
+++ b/src/features/editor/views/GraphView/CustomNode/ObjectNode.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import type { CustomNodeProps } from "src/containers/Editor/components/views/GraphView/CustomNode";
+import type { CustomNodeProps } from "src/features/editor/views/GraphView/CustomNode";
import { TextRenderer } from "./TextRenderer";
import * as Styled from "./styles";
diff --git a/src/containers/Editor/components/views/GraphView/CustomNode/TextNode.tsx b/src/features/editor/views/GraphView/CustomNode/TextNode.tsx
similarity index 92%
rename from src/containers/Editor/components/views/GraphView/CustomNode/TextNode.tsx
rename to src/features/editor/views/GraphView/CustomNode/TextNode.tsx
index 91c48f6f..f223f03b 100644
--- a/src/containers/Editor/components/views/GraphView/CustomNode/TextNode.tsx
+++ b/src/features/editor/views/GraphView/CustomNode/TextNode.tsx
@@ -1,9 +1,9 @@
import React from "react";
import styled from "styled-components";
import { MdLink, MdLinkOff } from "react-icons/md";
-import type { CustomNodeProps } from "src/containers/Editor/components/views/GraphView/CustomNode";
-import { isContentImage } from "src/containers/Editor/components/views/GraphView/lib/utils/calculateNodeSize";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
+import type { CustomNodeProps } from "src/features/editor/views/GraphView/CustomNode";
+import { isContentImage } from "src/features/editor/views/GraphView/lib/utils/calculateNodeSize";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import useToggleHide from "src/hooks/useToggleHide";
import useConfig from "src/store/useConfig";
import { TextRenderer } from "./TextRenderer";
diff --git a/src/containers/Editor/components/views/GraphView/CustomNode/TextRenderer.tsx b/src/features/editor/views/GraphView/CustomNode/TextRenderer.tsx
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/CustomNode/TextRenderer.tsx
rename to src/features/editor/views/GraphView/CustomNode/TextRenderer.tsx
diff --git a/src/containers/Editor/components/views/GraphView/CustomNode/index.tsx b/src/features/editor/views/GraphView/CustomNode/index.tsx
similarity index 94%
rename from src/containers/Editor/components/views/GraphView/CustomNode/index.tsx
rename to src/features/editor/views/GraphView/CustomNode/index.tsx
index 05196d7e..485d2ced 100644
--- a/src/containers/Editor/components/views/GraphView/CustomNode/index.tsx
+++ b/src/features/editor/views/GraphView/CustomNode/index.tsx
@@ -1,7 +1,7 @@
import React from "react";
import type { NodeProps } from "reaflow";
import { Node } from "reaflow";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import useModal from "src/store/useModal";
import type { NodeData } from "src/types/graph";
import { ObjectNode } from "./ObjectNode";
diff --git a/src/containers/Editor/components/views/GraphView/CustomNode/styles.tsx b/src/features/editor/views/GraphView/CustomNode/styles.tsx
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/CustomNode/styles.tsx
rename to src/features/editor/views/GraphView/CustomNode/styles.tsx
diff --git a/src/containers/Editor/components/views/GraphView/NotSupported.tsx b/src/features/editor/views/GraphView/NotSupported.tsx
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/NotSupported.tsx
rename to src/features/editor/views/GraphView/NotSupported.tsx
diff --git a/src/containers/Editor/components/views/GraphView/index.tsx b/src/features/editor/views/GraphView/index.tsx
similarity index 97%
rename from src/containers/Editor/components/views/GraphView/index.tsx
rename to src/features/editor/views/GraphView/index.tsx
index 78097037..ea5dc8e3 100644
--- a/src/containers/Editor/components/views/GraphView/index.tsx
+++ b/src/features/editor/views/GraphView/index.tsx
@@ -6,8 +6,8 @@ import { Space } from "react-zoomable-ui";
import { Canvas } from "reaflow";
import type { ElkRoot } from "reaflow/dist/layout/useLayout";
import { useLongPress } from "use-long-press";
-import { CustomNode } from "src/containers/Editor/components/views/GraphView/CustomNode";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
+import { CustomNode } from "src/features/editor/views/GraphView/CustomNode";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import useToggleHide from "src/hooks/useToggleHide";
import useConfig from "src/store/useConfig";
import { CustomEdge } from "./CustomEdge";
diff --git a/src/containers/Editor/components/views/GraphView/lib/jsonParser.ts b/src/features/editor/views/GraphView/lib/jsonParser.ts
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/lib/jsonParser.ts
rename to src/features/editor/views/GraphView/lib/jsonParser.ts
diff --git a/src/containers/Editor/components/views/GraphView/lib/utils/addEdgeToGraph.ts b/src/features/editor/views/GraphView/lib/utils/addEdgeToGraph.ts
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/lib/utils/addEdgeToGraph.ts
rename to src/features/editor/views/GraphView/lib/utils/addEdgeToGraph.ts
diff --git a/src/containers/Editor/components/views/GraphView/lib/utils/addNodeToGraph.ts b/src/features/editor/views/GraphView/lib/utils/addNodeToGraph.ts
similarity index 75%
rename from src/containers/Editor/components/views/GraphView/lib/utils/addNodeToGraph.ts
rename to src/features/editor/views/GraphView/lib/utils/addNodeToGraph.ts
index 4e291dc8..0375090e 100644
--- a/src/containers/Editor/components/views/GraphView/lib/utils/addNodeToGraph.ts
+++ b/src/features/editor/views/GraphView/lib/utils/addNodeToGraph.ts
@@ -1,6 +1,6 @@
import type { NodeType } from "jsonc-parser";
-import type { Graph } from "src/containers/Editor/components/views/GraphView/lib/jsonParser";
-import { calculateNodeSize } from "src/containers/Editor/components/views/GraphView/lib/utils/calculateNodeSize";
+import type { Graph } from "src/features/editor/views/GraphView/lib/jsonParser";
+import { calculateNodeSize } from "src/features/editor/views/GraphView/lib/utils/calculateNodeSize";
type Props = {
graph: Graph;
diff --git a/src/containers/Editor/components/views/GraphView/lib/utils/calculateNodeSize.ts b/src/features/editor/views/GraphView/lib/utils/calculateNodeSize.ts
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/lib/utils/calculateNodeSize.ts
rename to src/features/editor/views/GraphView/lib/utils/calculateNodeSize.ts
diff --git a/src/containers/Editor/components/views/GraphView/lib/utils/getChildrenEdges.ts b/src/features/editor/views/GraphView/lib/utils/getChildrenEdges.ts
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/lib/utils/getChildrenEdges.ts
rename to src/features/editor/views/GraphView/lib/utils/getChildrenEdges.ts
diff --git a/src/containers/Editor/components/views/GraphView/lib/utils/getNodePath.ts b/src/features/editor/views/GraphView/lib/utils/getNodePath.ts
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/lib/utils/getNodePath.ts
rename to src/features/editor/views/GraphView/lib/utils/getNodePath.ts
diff --git a/src/containers/Editor/components/views/GraphView/lib/utils/getOutgoers.ts b/src/features/editor/views/GraphView/lib/utils/getOutgoers.ts
similarity index 100%
rename from src/containers/Editor/components/views/GraphView/lib/utils/getOutgoers.ts
rename to src/features/editor/views/GraphView/lib/utils/getOutgoers.ts
diff --git a/src/containers/Editor/components/views/GraphView/lib/utils/traverse.ts b/src/features/editor/views/GraphView/lib/utils/traverse.ts
similarity index 97%
rename from src/containers/Editor/components/views/GraphView/lib/utils/traverse.ts
rename to src/features/editor/views/GraphView/lib/utils/traverse.ts
index b66ff453..8ce490d5 100644
--- a/src/containers/Editor/components/views/GraphView/lib/utils/traverse.ts
+++ b/src/features/editor/views/GraphView/lib/utils/traverse.ts
@@ -1,9 +1,6 @@
import type { Node, NodeType } from "jsonc-parser";
-import type {
- Graph,
- States,
-} from "src/containers/Editor/components/views/GraphView/lib/jsonParser";
-import { calculateNodeSize } from "src/containers/Editor/components/views/GraphView/lib/utils/calculateNodeSize";
+import type { Graph, States } from "src/features/editor/views/GraphView/lib/jsonParser";
+import { calculateNodeSize } from "src/features/editor/views/GraphView/lib/utils/calculateNodeSize";
import { addEdgeToGraph } from "./addEdgeToGraph";
import { addNodeToGraph } from "./addNodeToGraph";
diff --git a/src/containers/Editor/components/views/GraphView/stores/useGraph.ts b/src/features/editor/views/GraphView/stores/useGraph.ts
similarity index 95%
rename from src/containers/Editor/components/views/GraphView/stores/useGraph.ts
rename to src/features/editor/views/GraphView/stores/useGraph.ts
index 938712e2..8ab1c851 100644
--- a/src/containers/Editor/components/views/GraphView/stores/useGraph.ts
+++ b/src/features/editor/views/GraphView/stores/useGraph.ts
@@ -1,11 +1,11 @@
import type { ViewPort } from "react-zoomable-ui/dist/ViewPort";
import type { CanvasDirection } from "reaflow/dist/layout/elkLayout";
import { create } from "zustand";
-import { parser } from "src/containers/Editor/components/views/GraphView/lib/jsonParser";
-import { getChildrenEdges } from "src/containers/Editor/components/views/GraphView/lib/utils/getChildrenEdges";
-import { getOutgoers } from "src/containers/Editor/components/views/GraphView/lib/utils/getOutgoers";
+import { parser } from "src/features/editor/views/GraphView/lib/jsonParser";
+import { getChildrenEdges } from "src/features/editor/views/GraphView/lib/utils/getChildrenEdges";
+import { getOutgoers } from "src/features/editor/views/GraphView/lib/utils/getOutgoers";
+import useJson from "src/store/useJson";
import type { NodeData, EdgeData } from "src/types/graph";
-import useJson from "../../../../../../store/useJson";
export interface Graph {
viewPort: ViewPort | null;
diff --git a/src/containers/Editor/components/views/TreeView/Label.tsx b/src/features/editor/views/TreeView/Label.tsx
similarity index 100%
rename from src/containers/Editor/components/views/TreeView/Label.tsx
rename to src/features/editor/views/TreeView/Label.tsx
diff --git a/src/containers/Editor/components/views/TreeView/Value.tsx b/src/features/editor/views/TreeView/Value.tsx
similarity index 90%
rename from src/containers/Editor/components/views/TreeView/Value.tsx
rename to src/features/editor/views/TreeView/Value.tsx
index e877f277..1e3c65f1 100644
--- a/src/containers/Editor/components/views/TreeView/Value.tsx
+++ b/src/features/editor/views/TreeView/Value.tsx
@@ -1,7 +1,7 @@
import React from "react";
import type { DefaultTheme } from "styled-components";
import { useTheme } from "styled-components";
-import { TextRenderer } from "src/containers/Editor/components/views/GraphView/CustomNode/TextRenderer";
+import { TextRenderer } from "src/features/editor/views/GraphView/CustomNode/TextRenderer";
type TextColorFn = {
theme: DefaultTheme;
diff --git a/src/containers/Editor/components/views/TreeView/index.tsx b/src/features/editor/views/TreeView/index.tsx
similarity index 100%
rename from src/containers/Editor/components/views/TreeView/index.tsx
rename to src/features/editor/views/TreeView/index.tsx
diff --git a/src/containers/Modals/DownloadModal/index.tsx b/src/features/modals/DownloadModal/index.tsx
similarity index 100%
rename from src/containers/Modals/DownloadModal/index.tsx
rename to src/features/modals/DownloadModal/index.tsx
diff --git a/src/containers/Modals/ImportModal/index.tsx b/src/features/modals/ImportModal/index.tsx
similarity index 100%
rename from src/containers/Modals/ImportModal/index.tsx
rename to src/features/modals/ImportModal/index.tsx
diff --git a/src/containers/Modals/JPathModal/index.tsx b/src/features/modals/JPathModal/index.tsx
similarity index 100%
rename from src/containers/Modals/JPathModal/index.tsx
rename to src/features/modals/JPathModal/index.tsx
diff --git a/src/containers/Modals/JQModal/index.tsx b/src/features/modals/JQModal/index.tsx
similarity index 100%
rename from src/containers/Modals/JQModal/index.tsx
rename to src/features/modals/JQModal/index.tsx
diff --git a/src/containers/Modals/JWTModal/index.tsx b/src/features/modals/JWTModal/index.tsx
similarity index 100%
rename from src/containers/Modals/JWTModal/index.tsx
rename to src/features/modals/JWTModal/index.tsx
diff --git a/src/containers/Modals/NodeModal/index.tsx b/src/features/modals/NodeModal/index.tsx
similarity index 95%
rename from src/containers/Modals/NodeModal/index.tsx
rename to src/features/modals/NodeModal/index.tsx
index ef3d671f..68b3fa62 100644
--- a/src/containers/Modals/NodeModal/index.tsx
+++ b/src/features/modals/NodeModal/index.tsx
@@ -4,7 +4,7 @@ import { Modal, Stack, Text, ScrollArea, Button } from "@mantine/core";
import { CodeHighlight } from "@mantine/code-highlight";
import { event as gaEvent } from "nextjs-google-analytics";
import { VscLock } from "react-icons/vsc";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import useModal from "src/store/useModal";
const dataToString = (data: any) => {
diff --git a/src/containers/Modals/SchemaModal/index.tsx b/src/features/modals/SchemaModal/index.tsx
similarity index 100%
rename from src/containers/Modals/SchemaModal/index.tsx
rename to src/features/modals/SchemaModal/index.tsx
diff --git a/src/containers/Modals/TypeModal/index.tsx b/src/features/modals/TypeModal/index.tsx
similarity index 100%
rename from src/containers/Modals/TypeModal/index.tsx
rename to src/features/modals/TypeModal/index.tsx
diff --git a/src/containers/Modals/UpgradeModal/index.tsx b/src/features/modals/UpgradeModal/index.tsx
similarity index 100%
rename from src/containers/Modals/UpgradeModal/index.tsx
rename to src/features/modals/UpgradeModal/index.tsx
diff --git a/src/containers/Modals/index.ts b/src/features/modals/index.ts
similarity index 100%
rename from src/containers/Modals/index.ts
rename to src/features/modals/index.ts
diff --git a/src/hooks/useFocusNode.ts b/src/hooks/useFocusNode.ts
index fab3234a..28d672c4 100644
--- a/src/hooks/useFocusNode.ts
+++ b/src/hooks/useFocusNode.ts
@@ -1,7 +1,7 @@
import React from "react";
import { useDebouncedValue } from "@mantine/hooks";
import { event as gaEvent } from "nextjs-google-analytics";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import { searchQuery, cleanupHighlight, highlightMatchedNodes } from "src/lib/utils/search";
export const useFocusNode = () => {
diff --git a/src/hooks/useToggleHide.ts b/src/hooks/useToggleHide.ts
index 05527949..690d75b6 100644
--- a/src/hooks/useToggleHide.ts
+++ b/src/hooks/useToggleHide.ts
@@ -1,5 +1,5 @@
import React from "react";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
const useToggleHide = () => {
const getCollapsedNodeIds = useGraph(state => state.getCollapsedNodeIds);
diff --git a/src/containers/ConverterLayout/PageLinks.tsx b/src/layout/ConverterLayout/PageLinks.tsx
similarity index 100%
rename from src/containers/ConverterLayout/PageLinks.tsx
rename to src/layout/ConverterLayout/PageLinks.tsx
diff --git a/src/containers/ConverterLayout/ToolPage.tsx b/src/layout/ConverterLayout/ToolPage.tsx
similarity index 95%
rename from src/containers/ConverterLayout/ToolPage.tsx
rename to src/layout/ConverterLayout/ToolPage.tsx
index bce87154..34d35edf 100644
--- a/src/containers/ConverterLayout/ToolPage.tsx
+++ b/src/layout/ConverterLayout/ToolPage.tsx
@@ -4,10 +4,10 @@ import { Editor } from "@monaco-editor/react";
import { NextSeo } from "next-seo";
import { LuCheck, LuXCircle } from "react-icons/lu";
import { SEO } from "src/constants/seo";
-import { PageLinks } from "src/containers/ConverterLayout/PageLinks";
-import { editorOptions } from "src/containers/ConverterLayout/options";
import { type FileFormat, formats } from "src/enums/file.enum";
-import Layout from "src/layout/Layout";
+import { PageLinks } from "src/layout/ConverterLayout/PageLinks";
+import { editorOptions } from "src/layout/ConverterLayout/options";
+import Layout from "src/layout/PageLayout";
import { contentToJson, jsonToContent } from "src/lib/utils/jsonAdapter";
interface ToolPageProps {
diff --git a/src/containers/ConverterLayout/options.ts b/src/layout/ConverterLayout/options.ts
similarity index 100%
rename from src/containers/ConverterLayout/options.ts
rename to src/layout/ConverterLayout/options.ts
diff --git a/src/containers/Landing/FAQ.tsx b/src/layout/Landing/FAQ.tsx
similarity index 100%
rename from src/containers/Landing/FAQ.tsx
rename to src/layout/Landing/FAQ.tsx
diff --git a/src/containers/Landing/Features.tsx b/src/layout/Landing/Features.tsx
similarity index 100%
rename from src/containers/Landing/Features.tsx
rename to src/layout/Landing/Features.tsx
diff --git a/src/containers/Landing/HeroPreview.tsx b/src/layout/Landing/HeroPreview.tsx
similarity index 100%
rename from src/containers/Landing/HeroPreview.tsx
rename to src/layout/Landing/HeroPreview.tsx
diff --git a/src/containers/Landing/HeroSection.tsx b/src/layout/Landing/HeroSection.tsx
similarity index 100%
rename from src/containers/Landing/HeroSection.tsx
rename to src/layout/Landing/HeroSection.tsx
diff --git a/src/containers/Landing/LovedBy.tsx b/src/layout/Landing/LovedBy.tsx
similarity index 100%
rename from src/containers/Landing/LovedBy.tsx
rename to src/layout/Landing/LovedBy.tsx
diff --git a/src/containers/Landing/Section1.tsx b/src/layout/Landing/Section1.tsx
similarity index 100%
rename from src/containers/Landing/Section1.tsx
rename to src/layout/Landing/Section1.tsx
diff --git a/src/containers/Landing/SeePremium.tsx b/src/layout/Landing/SeePremium.tsx
similarity index 100%
rename from src/containers/Landing/SeePremium.tsx
rename to src/layout/Landing/SeePremium.tsx
diff --git a/src/layout/Footer.tsx b/src/layout/PageLayout/Footer.tsx
similarity index 98%
rename from src/layout/Footer.tsx
rename to src/layout/PageLayout/Footer.tsx
index 6a7bf9cd..c539d0e9 100644
--- a/src/layout/Footer.tsx
+++ b/src/layout/PageLayout/Footer.tsx
@@ -4,7 +4,7 @@ import { Anchor, Container, Divider, Flex, Stack, Text, ThemeIcon } from "@manti
import dayjs from "dayjs";
import { FaDiscord, FaGithub, FaLinkedin } from "react-icons/fa";
import { FaXTwitter } from "react-icons/fa6";
-import { JSONCrackLogo } from "./JsonCrackLogo";
+import { JSONCrackLogo } from "../JsonCrackLogo";
export const Footer = () => {
return (
diff --git a/src/layout/Navbar.tsx b/src/layout/PageLayout/Navbar.tsx
similarity index 98%
rename from src/layout/Navbar.tsx
rename to src/layout/PageLayout/Navbar.tsx
index 15482d6c..cf19dbdb 100644
--- a/src/layout/Navbar.tsx
+++ b/src/layout/PageLayout/Navbar.tsx
@@ -3,7 +3,7 @@ import Link from "next/link";
import { Button, Menu, type MenuItemProps, Text, Stack } from "@mantine/core";
import styled from "styled-components";
import { LuChevronDown } from "react-icons/lu";
-import { JSONCrackLogo } from "./JsonCrackLogo";
+import { JSONCrackLogo } from "../JsonCrackLogo";
const StyledNavbarWrapper = styled.div`
z-index: 3;
diff --git a/src/layout/Layout.tsx b/src/layout/PageLayout/index.tsx
similarity index 76%
rename from src/layout/Layout.tsx
rename to src/layout/PageLayout/index.tsx
index 28321116..46599bf4 100644
--- a/src/layout/Layout.tsx
+++ b/src/layout/PageLayout/index.tsx
@@ -11,12 +11,10 @@ const inter = Inter({
const StyledLayoutWrapper = styled.div`
background: #fff;
- /* background-image: radial-gradient(#ededed 2px, #ffffff 2px); */
- /* background-size: 40px 40px; */
font-family: ${inter.style.fontFamily};
`;
-const Layout = ({ children }: React.PropsWithChildren) => {
+const PageLayout = ({ children }: React.PropsWithChildren) => {
return (
<ThemeProvider theme={lightTheme}>
<StyledLayoutWrapper>
@@ -28,4 +26,4 @@ const Layout = ({ children }: React.PropsWithChildren) => {
);
};
-export default Layout;
+export default PageLayout;
diff --git a/src/containers/TypeLayout/PageLinks.tsx b/src/layout/TypeLayout/PageLinks.tsx
similarity index 100%
rename from src/containers/TypeLayout/PageLinks.tsx
rename to src/layout/TypeLayout/PageLinks.tsx
diff --git a/src/containers/TypeLayout/TypegenWrapper.tsx b/src/layout/TypeLayout/TypegenWrapper.tsx
similarity index 96%
rename from src/containers/TypeLayout/TypegenWrapper.tsx
rename to src/layout/TypeLayout/TypegenWrapper.tsx
index febfc6b4..f6f07e1a 100644
--- a/src/containers/TypeLayout/TypegenWrapper.tsx
+++ b/src/layout/TypeLayout/TypegenWrapper.tsx
@@ -4,9 +4,9 @@ import { Editor } from "@monaco-editor/react";
import { NextSeo } from "next-seo";
import { LuCheck, LuXCircle } from "react-icons/lu";
import { SEO } from "src/constants/seo";
-import { editorOptions } from "src/containers/ConverterLayout/options";
import { type FileFormat, formats, type TypeLanguage, typeOptions } from "src/enums/file.enum";
-import Layout from "src/layout/Layout";
+import { editorOptions } from "src/layout/ConverterLayout/options";
+import Layout from "src/layout/PageLayout";
import { generateType } from "src/lib/utils/generateType";
import { PageLinks } from "./PageLinks";
diff --git a/src/pages/404.tsx b/src/pages/404.tsx
index 7441a714..19f59107 100644
--- a/src/pages/404.tsx
+++ b/src/pages/404.tsx
@@ -3,7 +3,7 @@ import Link from "next/link";
import { Button, Stack, Text, Title } from "@mantine/core";
import { NextSeo } from "next-seo";
import { SEO } from "src/constants/seo";
-import Layout from "src/layout/Layout";
+import Layout from "src/layout/PageLayout";
const NotFound = () => {
return (
diff --git a/src/pages/_error.tsx b/src/pages/_error.tsx
index 390ef7d6..8a927a36 100644
--- a/src/pages/_error.tsx
+++ b/src/pages/_error.tsx
@@ -3,7 +3,7 @@ import { useRouter } from "next/router";
import { Button, Stack, Text, Title } from "@mantine/core";
import { NextSeo } from "next-seo";
import { SEO } from "src/constants/seo";
-import Layout from "src/layout/Layout";
+import Layout from "src/layout/PageLayout";
const Custom500 = () => {
const router = useRouter();
diff --git a/src/pages/converter/csv-to-json.tsx b/src/pages/converter/csv-to-json.tsx
index daf4a360..241515d6 100644
--- a/src/pages/converter/csv-to-json.tsx
+++ b/src/pages/converter/csv-to-json.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.CSV} to={FileFormat.JSON} />;
diff --git a/src/pages/converter/csv-to-xml.tsx b/src/pages/converter/csv-to-xml.tsx
index c214f64f..1d7d3f6c 100644
--- a/src/pages/converter/csv-to-xml.tsx
+++ b/src/pages/converter/csv-to-xml.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.CSV} to={FileFormat.XML} />;
diff --git a/src/pages/converter/csv-to-yaml.tsx b/src/pages/converter/csv-to-yaml.tsx
index 318b8d4f..ede10658 100644
--- a/src/pages/converter/csv-to-yaml.tsx
+++ b/src/pages/converter/csv-to-yaml.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.CSV} to={FileFormat.YAML} />;
diff --git a/src/pages/converter/json-to-csv.tsx b/src/pages/converter/json-to-csv.tsx
index 8f31fb3e..62bd8ec9 100644
--- a/src/pages/converter/json-to-csv.tsx
+++ b/src/pages/converter/json-to-csv.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.JSON} to={FileFormat.CSV} />;
diff --git a/src/pages/converter/json-to-xml.tsx b/src/pages/converter/json-to-xml.tsx
index b58f62b8..a0b776db 100644
--- a/src/pages/converter/json-to-xml.tsx
+++ b/src/pages/converter/json-to-xml.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.JSON} to={FileFormat.XML} />;
diff --git a/src/pages/converter/json-to-yaml.tsx b/src/pages/converter/json-to-yaml.tsx
index 1b2177ec..84d7ddb5 100644
--- a/src/pages/converter/json-to-yaml.tsx
+++ b/src/pages/converter/json-to-yaml.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.JSON} to={FileFormat.YAML} />;
diff --git a/src/pages/converter/xml-to-csv.tsx b/src/pages/converter/xml-to-csv.tsx
index 813ab422..dc847aa2 100644
--- a/src/pages/converter/xml-to-csv.tsx
+++ b/src/pages/converter/xml-to-csv.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.XML} to={FileFormat.CSV} />;
diff --git a/src/pages/converter/xml-to-json.tsx b/src/pages/converter/xml-to-json.tsx
index 71d9223f..932fc529 100644
--- a/src/pages/converter/xml-to-json.tsx
+++ b/src/pages/converter/xml-to-json.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.XML} to={FileFormat.JSON} />;
diff --git a/src/pages/converter/xml-to-yaml.tsx b/src/pages/converter/xml-to-yaml.tsx
index c5718c89..45b06e36 100644
--- a/src/pages/converter/xml-to-yaml.tsx
+++ b/src/pages/converter/xml-to-yaml.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.XML} to={FileFormat.YAML} />;
diff --git a/src/pages/converter/yaml-to-csv.tsx b/src/pages/converter/yaml-to-csv.tsx
index cdf404f2..d5357b76 100644
--- a/src/pages/converter/yaml-to-csv.tsx
+++ b/src/pages/converter/yaml-to-csv.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.YAML} to={FileFormat.CSV} />;
diff --git a/src/pages/converter/yaml-to-json.tsx b/src/pages/converter/yaml-to-json.tsx
index 5b9b4f23..9500c1ad 100644
--- a/src/pages/converter/yaml-to-json.tsx
+++ b/src/pages/converter/yaml-to-json.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.YAML} to={FileFormat.JSON} />;
diff --git a/src/pages/converter/yaml-to-xml.tsx b/src/pages/converter/yaml-to-xml.tsx
index fc7e9972..d029e9c6 100644
--- a/src/pages/converter/yaml-to-xml.tsx
+++ b/src/pages/converter/yaml-to-xml.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { ToolPage } from "src/containers/ConverterLayout/ToolPage";
import { FileFormat } from "src/enums/file.enum";
+import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
const Page = () => {
return <ToolPage from={FileFormat.YAML} to={FileFormat.XML} />;
diff --git a/src/pages/docs.tsx b/src/pages/docs.tsx
index b427a4e6..f9938ffb 100644
--- a/src/pages/docs.tsx
+++ b/src/pages/docs.tsx
@@ -4,7 +4,7 @@ import { CodeHighlight } from "@mantine/code-highlight";
import styled from "styled-components";
import { NextSeo } from "next-seo";
import { SEO } from "src/constants/seo";
-import Layout from "src/layout/Layout";
+import Layout from "src/layout/PageLayout";
const StyledFrame = styled.iframe`
border: none;
diff --git a/src/pages/editor.tsx b/src/pages/editor.tsx
index a9f7ac3e..532e9f1f 100644
--- a/src/pages/editor.tsx
+++ b/src/pages/editor.tsx
@@ -5,17 +5,20 @@ import { useMantineColorScheme } from "@mantine/core";
import "@mantine/dropzone/styles.css";
import styled, { ThemeProvider } from "styled-components";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
+import { Allotment } from "allotment";
+import "allotment/dist/style.css";
import { NextSeo } from "next-seo";
import { SEO } from "src/constants/seo";
import { darkTheme, lightTheme } from "src/constants/theme";
-import { Editor } from "src/containers/Editor";
-import { BottomBar } from "src/containers/Editor/components/BottomBar";
-import { Toolbar } from "src/containers/Toolbar";
+import { BottomBar } from "src/features/editor/BottomBar";
+import { FullscreenDropzone } from "src/features/editor/FullscreenDropzone";
+import { Toolbar } from "src/features/editor/Toolbar";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import useConfig from "src/store/useConfig";
import useFile from "src/store/useFile";
-const ModalController = dynamic(() => import("src/layout/ModalController"));
-const ExternalMode = dynamic(() => import("src/layout/ExternalMode"));
+const ModalController = dynamic(() => import("src/features/editor/ModalController"));
+const ExternalMode = dynamic(() => import("src/features/editor/ExternalMode"));
const queryClient = new QueryClient({
defaultOptions: {
@@ -41,11 +44,31 @@ export const StyledEditorWrapper = styled.div`
overflow: hidden;
`;
+export const StyledEditor = styled(Allotment)`
+ position: relative !important;
+ display: flex;
+ background: ${({ theme }) => theme.BACKGROUND_SECONDARY};
+ height: calc(100vh - 67px);
+
+ @media only screen and (max-width: 320px) {
+ height: 100vh;
+ }
+`;
+
+const TextEditor = dynamic(() => import("src/features/editor/TextEditor"), {
+ ssr: false,
+});
+
+const LiveEditor = dynamic(() => import("src/features/editor/LiveEditor"), {
+ ssr: false,
+});
+
const EditorPage = () => {
const { query, isReady } = useRouter();
const { setColorScheme } = useMantineColorScheme();
const checkEditorSession = useFile(state => state.checkEditorSession);
const darkmodeEnabled = useConfig(state => state.darkmodeEnabled);
+ const fullscreen = useGraph(state => state.fullscreen);
React.useEffect(() => {
if (isReady) checkEditorSession(query?.json);
@@ -71,7 +94,20 @@ const EditorPage = () => {
<StyledPageWrapper>
<Toolbar />
<StyledEditorWrapper>
- <Editor />
+ <StyledEditor proportionalLayout={false}>
+ <Allotment.Pane
+ preferredSize={450}
+ minSize={fullscreen ? 0 : 300}
+ maxSize={800}
+ visible={!fullscreen}
+ >
+ <TextEditor />
+ </Allotment.Pane>
+ <Allotment.Pane minSize={0}>
+ <LiveEditor />
+ </Allotment.Pane>
+ </StyledEditor>
+ <FullscreenDropzone />
</StyledEditorWrapper>
</StyledPageWrapper>
<BottomBar />
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 19de3a3c..59621bc1 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -2,14 +2,14 @@ import React from "react";
import type { InferGetStaticPropsType, GetStaticProps } from "next";
import { NextSeo } from "next-seo";
import { SEO } from "src/constants/seo";
-import { FAQ } from "src/containers/Landing/FAQ";
-import { Features } from "src/containers/Landing/Features";
-import { HeroPreview } from "src/containers/Landing/HeroPreview";
-import { HeroSection } from "src/containers/Landing/HeroSection";
-import { LovedBy } from "src/containers/Landing/LovedBy";
-import { Section1 } from "src/containers/Landing/Section1";
-import { SeePremium } from "src/containers/Landing/SeePremium";
-import Layout from "src/layout/Layout";
+import { FAQ } from "src/layout/Landing/FAQ";
+import { Features } from "src/layout/Landing/Features";
+import { HeroPreview } from "src/layout/Landing/HeroPreview";
+import { HeroSection } from "src/layout/Landing/HeroSection";
+import { LovedBy } from "src/layout/Landing/LovedBy";
+import { Section1 } from "src/layout/Landing/Section1";
+import { SeePremium } from "src/layout/Landing/SeePremium";
+import Layout from "src/layout/PageLayout";
export const HomePage = (props: InferGetStaticPropsType<typeof getStaticProps>) => {
return (
diff --git a/src/pages/legal/privacy.tsx b/src/pages/legal/privacy.tsx
index 9e17666e..b7762e10 100644
--- a/src/pages/legal/privacy.tsx
+++ b/src/pages/legal/privacy.tsx
@@ -3,7 +3,7 @@ import { Box, Container, Paper, Stack, Text, Title } from "@mantine/core";
import { NextSeo } from "next-seo";
import { SEO } from "src/constants/seo";
import privacy from "src/data/privacy.json";
-import Layout from "src/layout/Layout";
+import Layout from "src/layout/PageLayout";
const Privacy = () => {
return (
diff --git a/src/pages/legal/terms.tsx b/src/pages/legal/terms.tsx
index ca8ab017..1a2f4532 100644
--- a/src/pages/legal/terms.tsx
+++ b/src/pages/legal/terms.tsx
@@ -3,7 +3,7 @@ import { Box, Container, Paper, Stack, Text, Title } from "@mantine/core";
import { NextSeo } from "next-seo";
import { SEO } from "src/constants/seo";
import terms from "src/data/terms.json";
-import Layout from "src/layout/Layout";
+import Layout from "src/layout/PageLayout";
const Terms = () => {
return (
diff --git a/src/pages/tools/json-schema.tsx b/src/pages/tools/json-schema.tsx
index 0072203a..bdacd759 100644
--- a/src/pages/tools/json-schema.tsx
+++ b/src/pages/tools/json-schema.tsx
@@ -3,9 +3,9 @@ import { Box, Button, Container, Flex, Paper, Title, Text } from "@mantine/core"
import { Editor, type OnMount } from "@monaco-editor/react";
import { JSONSchemaFaker } from "json-schema-faker";
import { LuCheck, LuXCircle } from "react-icons/lu";
-import { editorOptions } from "src/containers/ConverterLayout/options";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import Layout from "src/layout/Layout";
+import { editorOptions } from "src/layout/ConverterLayout/options";
+import Layout from "src/layout/PageLayout";
import { generateType } from "src/lib/utils/generateType";
import { jsonToContent } from "src/lib/utils/jsonAdapter";
diff --git a/src/pages/type/csv-to-go.tsx b/src/pages/type/csv-to-go.tsx
index 9da125d4..ad5797cb 100644
--- a/src/pages/type/csv-to-go.tsx
+++ b/src/pages/type/csv-to-go.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.CSV} to={TypeLanguage.Go} />;
diff --git a/src/pages/type/csv-to-kotlin.tsx b/src/pages/type/csv-to-kotlin.tsx
index 128954f7..fa6ae431 100644
--- a/src/pages/type/csv-to-kotlin.tsx
+++ b/src/pages/type/csv-to-kotlin.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.CSV} to={TypeLanguage.Kotlin} />;
diff --git a/src/pages/type/csv-to-rust.tsx b/src/pages/type/csv-to-rust.tsx
index 6bbf0a2e..9fa67f31 100644
--- a/src/pages/type/csv-to-rust.tsx
+++ b/src/pages/type/csv-to-rust.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.CSV} to={TypeLanguage.Rust} />;
diff --git a/src/pages/type/csv-to-typescript.tsx b/src/pages/type/csv-to-typescript.tsx
index c43b92e3..94cc5df8 100644
--- a/src/pages/type/csv-to-typescript.tsx
+++ b/src/pages/type/csv-to-typescript.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.CSV} to={TypeLanguage.TypeScript} />;
diff --git a/src/pages/type/json-to-go.tsx b/src/pages/type/json-to-go.tsx
index 9e8c9e44..2ff24a63 100644
--- a/src/pages/type/json-to-go.tsx
+++ b/src/pages/type/json-to-go.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.JSON} to={TypeLanguage.Go} />;
diff --git a/src/pages/type/json-to-kotlin.tsx b/src/pages/type/json-to-kotlin.tsx
index a1be4797..368fa915 100644
--- a/src/pages/type/json-to-kotlin.tsx
+++ b/src/pages/type/json-to-kotlin.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.JSON} to={TypeLanguage.Kotlin} />;
diff --git a/src/pages/type/json-to-rust.tsx b/src/pages/type/json-to-rust.tsx
index 9cafb3c6..4934d17f 100644
--- a/src/pages/type/json-to-rust.tsx
+++ b/src/pages/type/json-to-rust.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.JSON} to={TypeLanguage.Rust} />;
diff --git a/src/pages/type/json-to-typescript.tsx b/src/pages/type/json-to-typescript.tsx
index c35f51fd..6407d56a 100644
--- a/src/pages/type/json-to-typescript.tsx
+++ b/src/pages/type/json-to-typescript.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.JSON} to={TypeLanguage.TypeScript} />;
diff --git a/src/pages/type/xml-to-go.tsx b/src/pages/type/xml-to-go.tsx
index 9a3fd19a..ef987aa0 100644
--- a/src/pages/type/xml-to-go.tsx
+++ b/src/pages/type/xml-to-go.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.XML} to={TypeLanguage.Go} />;
diff --git a/src/pages/type/xml-to-kotlin.tsx b/src/pages/type/xml-to-kotlin.tsx
index 540f1b19..42c552de 100644
--- a/src/pages/type/xml-to-kotlin.tsx
+++ b/src/pages/type/xml-to-kotlin.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.XML} to={TypeLanguage.Kotlin} />;
diff --git a/src/pages/type/xml-to-rust.tsx b/src/pages/type/xml-to-rust.tsx
index 03804b2d..d6dc1da8 100644
--- a/src/pages/type/xml-to-rust.tsx
+++ b/src/pages/type/xml-to-rust.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.XML} to={TypeLanguage.Rust} />;
diff --git a/src/pages/type/xml-to-typescript.tsx b/src/pages/type/xml-to-typescript.tsx
index a4a00202..2eef55a7 100644
--- a/src/pages/type/xml-to-typescript.tsx
+++ b/src/pages/type/xml-to-typescript.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.XML} to={TypeLanguage.TypeScript} />;
diff --git a/src/pages/type/yaml-to-go.tsx b/src/pages/type/yaml-to-go.tsx
index ec0956bd..2220ac53 100644
--- a/src/pages/type/yaml-to-go.tsx
+++ b/src/pages/type/yaml-to-go.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.YAML} to={TypeLanguage.Go} />;
diff --git a/src/pages/type/yaml-to-kotlin.tsx b/src/pages/type/yaml-to-kotlin.tsx
index 99c2faeb..d135bc68 100644
--- a/src/pages/type/yaml-to-kotlin.tsx
+++ b/src/pages/type/yaml-to-kotlin.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.YAML} to={TypeLanguage.Kotlin} />;
diff --git a/src/pages/type/yaml-to-rust.tsx b/src/pages/type/yaml-to-rust.tsx
index e54e0fcb..e862b9b6 100644
--- a/src/pages/type/yaml-to-rust.tsx
+++ b/src/pages/type/yaml-to-rust.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.YAML} to={TypeLanguage.Rust} />;
diff --git a/src/pages/type/yaml-to-typescript.tsx b/src/pages/type/yaml-to-typescript.tsx
index 5af7c04a..cee24343 100644
--- a/src/pages/type/yaml-to-typescript.tsx
+++ b/src/pages/type/yaml-to-typescript.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { TypegenWrapper } from "src/containers/TypeLayout/TypegenWrapper";
import { FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
const TypePage = () => {
return <TypegenWrapper from={FileFormat.YAML} to={TypeLanguage.TypeScript} />;
diff --git a/src/pages/widget.tsx b/src/pages/widget.tsx
index 0bfec74f..d8d7b179 100644
--- a/src/pages/widget.tsx
+++ b/src/pages/widget.tsx
@@ -6,8 +6,8 @@ import { ThemeProvider } from "styled-components";
import { NextSeo } from "next-seo";
import toast from "react-hot-toast";
import { darkTheme, lightTheme } from "src/constants/theme";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
-import { Toolbar } from "src/containers/Toolbar";
+import { Toolbar } from "src/features/editor/Toolbar";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
import useFile from "src/store/useFile";
import type { LayoutDirection } from "src/types/graph";
@@ -22,7 +22,7 @@ interface EmbedMessage {
}
const GraphView = dynamic(
- () => import("src/containers/Editor/components/views/GraphView").then(c => c.GraphView),
+ () => import("src/features/editor/views/GraphView").then(c => c.GraphView),
{
ssr: false,
}
diff --git a/src/store/useConfig.ts b/src/store/useConfig.ts
index 60bc8c0a..d026e37f 100644
--- a/src/store/useConfig.ts
+++ b/src/store/useConfig.ts
@@ -1,7 +1,7 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
import { ViewMode } from "src/enums/viewMode.enum";
-import useGraph from "../containers/Editor/components/views/GraphView/stores/useGraph";
+import useGraph from "../features/editor/views/GraphView/stores/useGraph";
const initialStates = {
darkmodeEnabled: false,
diff --git a/src/store/useFile.ts b/src/store/useFile.ts
index 9d4c35ee..e4f99d0f 100644
--- a/src/store/useFile.ts
+++ b/src/store/useFile.ts
@@ -5,7 +5,7 @@ import { create } from "zustand";
import { FileFormat } from "src/enums/file.enum";
import { isIframe } from "src/lib/utils/helpers";
import { contentToJson, jsonToContent } from "src/lib/utils/jsonAdapter";
-import useGraph from "../containers/Editor/components/views/GraphView/stores/useGraph";
+import useGraph from "../features/editor/views/GraphView/stores/useGraph";
import useConfig from "./useConfig";
import useJson from "./useJson";
diff --git a/src/store/useJson.ts b/src/store/useJson.ts
index ba1e95a8..2a13fadc 100644
--- a/src/store/useJson.ts
+++ b/src/store/useJson.ts
@@ -1,5 +1,5 @@
import { create } from "zustand";
-import useGraph from "src/containers/Editor/components/views/GraphView/stores/useGraph";
+import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
interface JsonActions {
setJson: (json: string) => void;
diff --git a/src/store/useModal.ts b/src/store/useModal.ts
index c40f3967..d58e123c 100644
--- a/src/store/useModal.ts
+++ b/src/store/useModal.ts
@@ -1,5 +1,5 @@
import { create } from "zustand";
-import type { Modal } from "src/containers/Modals";
+import type { Modal } from "src/features/modals";
type ModalState = {
[key in Modal]: boolean;