Skip to content

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

remove absolute imports

AykutSaracdd764638a5e6
diff --git a/src/features/editor/BottomBar.tsx b/src/features/editor/BottomBar.tsx
index 7a7ea755..171720bb 100644
--- a/src/features/editor/BottomBar.tsx
+++ b/src/features/editor/BottomBar.tsx
@@ -12,9 +12,9 @@ import {
VscSync,
VscSyncIgnored,
} from "react-icons/vsc";
-import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
-import useConfig from "src/store/useConfig";
-import useFile from "src/store/useFile";
+import useConfig from "../../store/useConfig";
+import useFile from "../../store/useFile";
+import useGraph from "./views/GraphView/stores/useGraph";
const StyledBottomBar = styled.div`
position: relative;
diff --git a/src/features/editor/FullscreenDropzone.tsx b/src/features/editor/FullscreenDropzone.tsx
index 502751dc..812e6560 100644
--- a/src/features/editor/FullscreenDropzone.tsx
+++ b/src/features/editor/FullscreenDropzone.tsx
@@ -3,8 +3,8 @@ import { Group, Text } from "@mantine/core";
import { Dropzone } from "@mantine/dropzone";
import toast from "react-hot-toast";
import { VscCircleSlash, VscFiles } from "react-icons/vsc";
-import { FileFormat } from "src/enums/file.enum";
-import useFile from "src/store/useFile";
+import { FileFormat } from "../../enums/file.enum";
+import useFile from "../../store/useFile";
export const FullscreenDropzone = () => {
const setContents = useFile(state => state.setContents);
diff --git a/src/features/editor/LiveEditor.tsx b/src/features/editor/LiveEditor.tsx
index 138ba8cf..aac14268 100644
--- a/src/features/editor/LiveEditor.tsx
+++ b/src/features/editor/LiveEditor.tsx
@@ -1,9 +1,9 @@
import React from "react";
import { useSessionStorage } from "@mantine/hooks";
import styled from "styled-components";
-import { ViewMode } from "src/enums/viewMode.enum";
-import { GraphView } from "src/features/editor/views/GraphView";
-import { TreeView } from "src/features/editor/views/TreeView";
+import { ViewMode } from "../../enums/viewMode.enum";
+import { GraphView } from "./views/GraphView";
+import { TreeView } from "./views/TreeView";
const StyledLiveEditor = styled.div`
position: relative;
diff --git a/src/features/editor/TextEditor.tsx b/src/features/editor/TextEditor.tsx
index 39d36f70..f09ac78f 100644
--- a/src/features/editor/TextEditor.tsx
+++ b/src/features/editor/TextEditor.tsx
@@ -2,8 +2,8 @@ import React, { useCallback } from "react";
import { LoadingOverlay } from "@mantine/core";
import styled from "styled-components";
import Editor, { type EditorProps, loader, type OnMount, useMonaco } from "@monaco-editor/react";
-import useConfig from "src/store/useConfig";
-import useFile from "src/store/useFile";
+import useConfig from "../../store/useConfig";
+import useFile from "../../store/useFile";
loader.config({
paths: {
diff --git a/src/features/editor/Toolbar/FileMenu.tsx b/src/features/editor/Toolbar/FileMenu.tsx
index 7c7d9023..38889902 100644
--- a/src/features/editor/Toolbar/FileMenu.tsx
+++ b/src/features/editor/Toolbar/FileMenu.tsx
@@ -2,8 +2,8 @@ import React from "react";
import { Flex, Menu } from "@mantine/core";
import { event as gaEvent } from "nextjs-google-analytics";
import { CgChevronDown } from "react-icons/cg";
-import useFile from "src/store/useFile";
-import useModal from "src/store/useModal";
+import useFile from "../../../store/useFile";
+import useModal from "../../../store/useModal";
import { StyledToolElement } from "./styles";
export const FileMenu = () => {
diff --git a/src/features/editor/Toolbar/Logo.tsx b/src/features/editor/Toolbar/Logo.tsx
index 515f5575..04eafdf5 100644
--- a/src/features/editor/Toolbar/Logo.tsx
+++ b/src/features/editor/Toolbar/Logo.tsx
@@ -1,5 +1,5 @@
import React from "react";
-import { JSONCrackLogo } from "src/layout/JsonCrackLogo";
+import { JSONCrackLogo } from "../../../layout/JsonCrackLogo";
import { StyledToolElement } from "./styles";
export const Logo = () => {
diff --git a/src/features/editor/Toolbar/OptionsMenu.tsx b/src/features/editor/Toolbar/OptionsMenu.tsx
index 6c605145..31b777c3 100644
--- a/src/features/editor/Toolbar/OptionsMenu.tsx
+++ b/src/features/editor/Toolbar/OptionsMenu.tsx
@@ -3,7 +3,7 @@ import { Menu, Text, Flex } from "@mantine/core";
import { event as gaEvent } from "nextjs-google-analytics";
import { BsCheck2 } from "react-icons/bs";
import { MdSettings } from "react-icons/md";
-import useConfig from "src/store/useConfig";
+import useConfig from "../../../store/useConfig";
import { StyledToolElement } from "./styles";
export const OptionsMenu = () => {
diff --git a/src/features/editor/Toolbar/SearchInput.tsx b/src/features/editor/Toolbar/SearchInput.tsx
index ff984fb3..3cbe3449 100644
--- a/src/features/editor/Toolbar/SearchInput.tsx
+++ b/src/features/editor/Toolbar/SearchInput.tsx
@@ -2,7 +2,7 @@ import React from "react";
import { Flex, Text, TextInput } from "@mantine/core";
import { getHotkeyHandler } from "@mantine/hooks";
import { AiOutlineSearch } from "react-icons/ai";
-import { useFocusNode } from "src/hooks/useFocusNode";
+import { useFocusNode } from "../../../hooks/useFocusNode";
export const SearchInput = () => {
const [searchValue, setValue, skip, nodeCount, currentNode] = useFocusNode();
diff --git a/src/features/editor/Toolbar/ToolsMenu.tsx b/src/features/editor/Toolbar/ToolsMenu.tsx
index 5e973a67..9da686c9 100644
--- a/src/features/editor/Toolbar/ToolsMenu.tsx
+++ b/src/features/editor/Toolbar/ToolsMenu.tsx
@@ -8,10 +8,10 @@ import { FaRandom } from "react-icons/fa";
import { MdFilterListAlt } from "react-icons/md";
import { SiJsonwebtokens } from "react-icons/si";
import { VscSearchFuzzy, VscJson, VscGroupByRefType } from "react-icons/vsc";
-import { jsonToContent } from "src/lib/utils/jsonAdapter";
-import useFile from "src/store/useFile";
-import useJson from "src/store/useJson";
-import useModal from "src/store/useModal";
+import { jsonToContent } from "../../../lib/utils/jsonAdapter";
+import useFile from "../../../store/useFile";
+import useJson from "../../../store/useJson";
+import useModal from "../../../store/useModal";
import { StyledToolElement } from "./styles";
export const ToolsMenu = () => {
diff --git a/src/features/editor/Toolbar/ViewMenu.tsx b/src/features/editor/Toolbar/ViewMenu.tsx
index fd8f15e1..48a777ec 100644
--- a/src/features/editor/Toolbar/ViewMenu.tsx
+++ b/src/features/editor/Toolbar/ViewMenu.tsx
@@ -7,10 +7,10 @@ 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 { ViewMode } from "src/enums/viewMode.enum";
-import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
-import useToggleHide from "src/hooks/useToggleHide";
-import type { LayoutDirection } from "src/types/graph";
+import { ViewMode } from "../../../enums/viewMode.enum";
+import useToggleHide from "../../../hooks/useToggleHide";
+import type { LayoutDirection } from "../../../types/graph";
+import useGraph from "../views/GraphView/stores/useGraph";
import { StyledToolElement } from "./styles";
const StyledFlowIcon = styled(TiFlowMerge)<{ rotate: number }>`
diff --git a/src/features/editor/Toolbar/ZoomMenu.tsx b/src/features/editor/Toolbar/ZoomMenu.tsx
index d616d8b6..b8815e54 100644
--- a/src/features/editor/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/features/editor/views/GraphView/stores/useGraph";
+import useGraph from "../views/GraphView/stores/useGraph";
import { StyledToolElement } from "./styles";
export const ZoomMenu = () => {
diff --git a/src/features/editor/Toolbar/index.tsx b/src/features/editor/Toolbar/index.tsx
index 696aee14..8c5d8d60 100644
--- a/src/features/editor/Toolbar/index.tsx
+++ b/src/features/editor/Toolbar/index.tsx
@@ -6,14 +6,14 @@ import toast from "react-hot-toast";
import { AiOutlineFullscreen } from "react-icons/ai";
import { FaGithub } from "react-icons/fa6";
import { FiDownload } from "react-icons/fi";
-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";
+import { type FileFormat, formats } from "../../../enums/file.enum";
+import { JSONCrackLogo } from "../../../layout/JsonCrackLogo";
+import useFile from "../../../store/useFile";
+import useModal from "../../../store/useModal";
import { FileMenu } from "./FileMenu";
import { Logo } from "./Logo";
import { OptionsMenu } from "./OptionsMenu";
+import { SearchInput } from "./SearchInput";
import { ToolsMenu } from "./ToolsMenu";
import { ViewMenu } from "./ViewMenu";
import { ZoomMenu } from "./ZoomMenu";
diff --git a/src/features/editor/views/GraphView/CustomNode/ObjectNode.tsx b/src/features/editor/views/GraphView/CustomNode/ObjectNode.tsx
index 3a96d5ae..a60578f5 100644
--- a/src/features/editor/views/GraphView/CustomNode/ObjectNode.tsx
+++ b/src/features/editor/views/GraphView/CustomNode/ObjectNode.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { NODE_DIMENSIONS } from "src/constants/graph";
-import type { CustomNodeProps } from "src/features/editor/views/GraphView/CustomNode";
+import type { CustomNodeProps } from ".";
+import { NODE_DIMENSIONS } from "../../../../../constants/graph";
import { TextRenderer } from "./TextRenderer";
import * as Styled from "./styles";
diff --git a/src/features/editor/views/GraphView/CustomNode/TextNode.tsx b/src/features/editor/views/GraphView/CustomNode/TextNode.tsx
index 48d09723..78143fa8 100644
--- a/src/features/editor/views/GraphView/CustomNode/TextNode.tsx
+++ b/src/features/editor/views/GraphView/CustomNode/TextNode.tsx
@@ -1,11 +1,11 @@
import React, { useMemo } from "react";
import styled from "styled-components";
import { MdLink, MdLinkOff } from "react-icons/md";
-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 type { CustomNodeProps } from ".";
+import useToggleHide from "../../../../../hooks/useToggleHide";
+import useConfig from "../../../../../store/useConfig";
+import { isContentImage } from "../lib/utils/calculateNodeSize";
+import useGraph from "../stores/useGraph";
import { TextRenderer } from "./TextRenderer";
import * as Styled from "./styles";
diff --git a/src/features/editor/views/GraphView/CustomNode/index.tsx b/src/features/editor/views/GraphView/CustomNode/index.tsx
index fed88b83..68448794 100644
--- a/src/features/editor/views/GraphView/CustomNode/index.tsx
+++ b/src/features/editor/views/GraphView/CustomNode/index.tsx
@@ -2,9 +2,9 @@ import React from "react";
import { useComputedColorScheme } from "@mantine/core";
import type { NodeProps } from "reaflow";
import { Node } from "reaflow";
-import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
-import useModal from "src/store/useModal";
-import type { NodeData } from "src/types/graph";
+import useModal from "../../../../../store/useModal";
+import type { NodeData } from "../../../../../types/graph";
+import useGraph from "../stores/useGraph";
import { ObjectNode } from "./ObjectNode";
import { TextNode } from "./TextNode";
diff --git a/src/features/editor/views/GraphView/CustomNode/styles.tsx b/src/features/editor/views/GraphView/CustomNode/styles.tsx
index fe9162a5..882e385b 100644
--- a/src/features/editor/views/GraphView/CustomNode/styles.tsx
+++ b/src/features/editor/views/GraphView/CustomNode/styles.tsx
@@ -1,7 +1,7 @@
import type { DefaultTheme } from "styled-components";
import styled from "styled-components";
import { LinkItUrl } from "react-linkify-it";
-import { NODE_DIMENSIONS } from "src/constants/graph";
+import { NODE_DIMENSIONS } from "../../../../../constants/graph";
type TextColorFn = {
theme: DefaultTheme;
diff --git a/src/features/editor/views/GraphView/NotSupported.tsx b/src/features/editor/views/GraphView/NotSupported.tsx
index 5f8aab55..9e992d58 100644
--- a/src/features/editor/views/GraphView/NotSupported.tsx
+++ b/src/features/editor/views/GraphView/NotSupported.tsx
@@ -2,7 +2,7 @@ import React from "react";
import Link from "next/link";
import { Button, Text } from "@mantine/core";
import styled from "styled-components";
-import { UpgradeContent } from "src/features/modals/UpgradeModal";
+import { UpgradeContent } from "../../../modals/UpgradeModal";
const StyledNotSupported = styled.div`
position: relative;
diff --git a/src/features/editor/views/GraphView/index.tsx b/src/features/editor/views/GraphView/index.tsx
index 2a8ccfb5..f847e439 100644
--- a/src/features/editor/views/GraphView/index.tsx
+++ b/src/features/editor/views/GraphView/index.tsx
@@ -6,12 +6,12 @@ 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/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 useToggleHide from "../../../../hooks/useToggleHide";
+import useConfig from "../../../../store/useConfig";
import { CustomEdge } from "./CustomEdge";
+import { CustomNode } from "./CustomNode";
import { NotSupported } from "./NotSupported";
+import useGraph from "./stores/useGraph";
const StyledEditorWrapper = styled.div<{ $widget: boolean; $showRulers: boolean }>`
position: absolute;
diff --git a/src/features/editor/views/GraphView/lib/jsonParser.ts b/src/features/editor/views/GraphView/lib/jsonParser.ts
index 68eb6316..aaa6382b 100644
--- a/src/features/editor/views/GraphView/lib/jsonParser.ts
+++ b/src/features/editor/views/GraphView/lib/jsonParser.ts
@@ -1,5 +1,5 @@
import { parseTree } from "jsonc-parser";
-import type { EdgeData, NodeData } from "src/types/graph";
+import type { EdgeData, NodeData } from "../../../../../types/graph";
import { addEdgeToGraph } from "./utils/addEdgeToGraph";
import { addNodeToGraph } from "./utils/addNodeToGraph";
import { getNodePath } from "./utils/getNodePath";
diff --git a/src/features/editor/views/GraphView/lib/utils/addNodeToGraph.ts b/src/features/editor/views/GraphView/lib/utils/addNodeToGraph.ts
index 0375090e..896c4684 100644
--- a/src/features/editor/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/features/editor/views/GraphView/lib/jsonParser";
-import { calculateNodeSize } from "src/features/editor/views/GraphView/lib/utils/calculateNodeSize";
+import type { Graph } from "../jsonParser";
+import { calculateNodeSize } from "./calculateNodeSize";
type Props = {
graph: Graph;
diff --git a/src/features/editor/views/GraphView/lib/utils/calculateNodeSize.ts b/src/features/editor/views/GraphView/lib/utils/calculateNodeSize.ts
index b0dd876d..16aa81fe 100644
--- a/src/features/editor/views/GraphView/lib/utils/calculateNodeSize.ts
+++ b/src/features/editor/views/GraphView/lib/utils/calculateNodeSize.ts
@@ -1,5 +1,5 @@
-import { NODE_DIMENSIONS } from "src/constants/graph";
-import useConfig from "src/store/useConfig";
+import { NODE_DIMENSIONS } from "../../../../../../constants/graph";
+import useConfig from "../../../../../../store/useConfig";
type Text = string | [string, string][];
type Size = { width: number; height: number };
diff --git a/src/features/editor/views/GraphView/lib/utils/getChildrenEdges.ts b/src/features/editor/views/GraphView/lib/utils/getChildrenEdges.ts
index 157a0f27..04ef0679 100644
--- a/src/features/editor/views/GraphView/lib/utils/getChildrenEdges.ts
+++ b/src/features/editor/views/GraphView/lib/utils/getChildrenEdges.ts
@@ -1,4 +1,4 @@
-import type { NodeData, EdgeData } from "src/types/graph";
+import type { NodeData, EdgeData } from "../../../../../../types/graph";
export const getChildrenEdges = (nodes: NodeData[], edges: EdgeData[]): EdgeData[] => {
const nodeIds = nodes.map(node => node.id);
diff --git a/src/features/editor/views/GraphView/lib/utils/getNodePath.ts b/src/features/editor/views/GraphView/lib/utils/getNodePath.ts
index 326b3477..cd3993b9 100644
--- a/src/features/editor/views/GraphView/lib/utils/getNodePath.ts
+++ b/src/features/editor/views/GraphView/lib/utils/getNodePath.ts
@@ -1,4 +1,4 @@
-import type { NodeData, EdgeData } from "src/types/graph";
+import type { NodeData, EdgeData } from "../../../../../../types/graph";
export function getNodePath(nodes: NodeData[], edges: EdgeData[], nodeId: string) {
// eslint-disable-next-line @typescript-eslint/no-var-requires
diff --git a/src/features/editor/views/GraphView/lib/utils/getOutgoers.ts b/src/features/editor/views/GraphView/lib/utils/getOutgoers.ts
index 14f3cb3f..5dee2150 100644
--- a/src/features/editor/views/GraphView/lib/utils/getOutgoers.ts
+++ b/src/features/editor/views/GraphView/lib/utils/getOutgoers.ts
@@ -1,4 +1,4 @@
-import type { NodeData, EdgeData } from "src/types/graph";
+import type { NodeData, EdgeData } from "../../../../../../types/graph";
type Outgoers = [NodeData[], string[]];
diff --git a/src/features/editor/views/GraphView/lib/utils/traverse.ts b/src/features/editor/views/GraphView/lib/utils/traverse.ts
index 8ce490d5..de16de40 100644
--- a/src/features/editor/views/GraphView/lib/utils/traverse.ts
+++ b/src/features/editor/views/GraphView/lib/utils/traverse.ts
@@ -1,8 +1,8 @@
import type { Node, NodeType } from "jsonc-parser";
-import type { Graph, States } from "src/features/editor/views/GraphView/lib/jsonParser";
-import { calculateNodeSize } from "src/features/editor/views/GraphView/lib/utils/calculateNodeSize";
+import type { States, Graph } from "../jsonParser";
import { addEdgeToGraph } from "./addEdgeToGraph";
import { addNodeToGraph } from "./addNodeToGraph";
+import { calculateNodeSize } from "./calculateNodeSize";
type PrimitiveOrNullType = "boolean" | "string" | "number" | "null";
diff --git a/src/features/editor/views/GraphView/stores/useGraph.ts b/src/features/editor/views/GraphView/stores/useGraph.ts
index 8ab1c851..be430b02 100644
--- a/src/features/editor/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/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";
+import type { EdgeData, NodeData } from "../../../../../types/graph";
+import { parser } from "../lib/jsonParser";
+import { getChildrenEdges } from "../lib/utils/getChildrenEdges";
+import { getOutgoers } from "../lib/utils/getOutgoers";
export interface Graph {
viewPort: ViewPort | null;
diff --git a/src/features/editor/views/TreeView/Value.tsx b/src/features/editor/views/TreeView/Value.tsx
index 1e3c65f1..0046a9b8 100644
--- a/src/features/editor/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/features/editor/views/GraphView/CustomNode/TextRenderer";
+import { TextRenderer } from "../GraphView/CustomNode/TextRenderer";
type TextColorFn = {
theme: DefaultTheme;
diff --git a/src/features/editor/views/TreeView/index.tsx b/src/features/editor/views/TreeView/index.tsx
index 470e47f3..57e78a9f 100644
--- a/src/features/editor/views/TreeView/index.tsx
+++ b/src/features/editor/views/TreeView/index.tsx
@@ -1,7 +1,7 @@
import React from "react";
import { useTheme } from "styled-components";
import { JSONTree } from "react-json-tree";
-import useJson from "src/store/useJson";
+import useJson from "../../../../store/useJson";
import { Label } from "./Label";
import { Value } from "./Value";
diff --git a/src/features/modals/ImportModal/index.tsx b/src/features/modals/ImportModal/index.tsx
index f0c311d8..9e44fc6a 100644
--- a/src/features/modals/ImportModal/index.tsx
+++ b/src/features/modals/ImportModal/index.tsx
@@ -5,8 +5,8 @@ import { Dropzone } from "@mantine/dropzone";
import { event as gaEvent } from "nextjs-google-analytics";
import toast from "react-hot-toast";
import { AiOutlineUpload } from "react-icons/ai";
-import type { FileFormat } from "src/enums/file.enum";
-import useFile from "src/store/useFile";
+import type { FileFormat } from "../../../enums/file.enum";
+import useFile from "../../../store/useFile";
export const ImportModal = ({ opened, onClose }: ModalProps) => {
const [url, setURL] = React.useState("");
diff --git a/src/features/modals/JPathModal/index.tsx b/src/features/modals/JPathModal/index.tsx
index 9f61ada6..46318666 100644
--- a/src/features/modals/JPathModal/index.tsx
+++ b/src/features/modals/JPathModal/index.tsx
@@ -5,8 +5,8 @@ import { JSONPath } from "jsonpath-plus";
import { event as gaEvent } from "nextjs-google-analytics";
import toast from "react-hot-toast";
import { VscLinkExternal } from "react-icons/vsc";
-import useFile from "src/store/useFile";
-import useJson from "src/store/useJson";
+import useFile from "../../../store/useFile";
+import useJson from "../../../store/useJson";
export const JPathModal = ({ opened, onClose }: ModalProps) => {
const getJson = useJson(state => state.getJson);
diff --git a/src/features/modals/JQModal/index.tsx b/src/features/modals/JQModal/index.tsx
index 592c6293..1989265c 100644
--- a/src/features/modals/JQModal/index.tsx
+++ b/src/features/modals/JQModal/index.tsx
@@ -2,7 +2,7 @@ import React from "react";
import type { ModalProps } from "@mantine/core";
import { Stack, Modal, Button, Text, Anchor, Group, TextInput } from "@mantine/core";
import { VscLinkExternal } from "react-icons/vsc";
-import useJsonQuery from "src/hooks/useJsonQuery";
+import useJsonQuery from "../../../hooks/useJsonQuery";
export const JQModal = ({ opened, onClose }: ModalProps) => {
const { updateJson } = useJsonQuery();
diff --git a/src/features/modals/JWTModal/index.tsx b/src/features/modals/JWTModal/index.tsx
index 4e8c7420..66598d36 100644
--- a/src/features/modals/JWTModal/index.tsx
+++ b/src/features/modals/JWTModal/index.tsx
@@ -3,7 +3,7 @@ import type { ModalProps } from "@mantine/core";
import { Modal, Button, Textarea, Group } from "@mantine/core";
import { decode } from "jsonwebtoken";
import { event as gaEvent } from "nextjs-google-analytics";
-import useFile from "src/store/useFile";
+import useFile from "../../../store/useFile";
export const JWTModal = ({ opened, onClose }: ModalProps) => {
const setContents = useFile(state => state.setContents);
diff --git a/src/features/modals/ModalController.tsx b/src/features/modals/ModalController.tsx
index 788c398b..dc557fc3 100644
--- a/src/features/modals/ModalController.tsx
+++ b/src/features/modals/ModalController.tsx
@@ -1,7 +1,7 @@
import React from "react";
import type { ModalProps } from "@mantine/core";
-import * as ModalComponents from "src/features/modals";
-import useModal from "src/store/useModal";
+import * as ModalComponents from "../../features/modals";
+import useModal from "../../store/useModal";
const modalNames = Object.keys(ModalComponents);
const modals = Object.freeze(modalNames) as Extract<keyof typeof ModalComponents, string>[];
diff --git a/src/features/modals/NodeModal/index.tsx b/src/features/modals/NodeModal/index.tsx
index 40b0c327..bf301a69 100644
--- a/src/features/modals/NodeModal/index.tsx
+++ b/src/features/modals/NodeModal/index.tsx
@@ -3,8 +3,8 @@ import type { ModalProps } from "@mantine/core";
import { Modal, Stack, Text, ScrollArea, Button } from "@mantine/core";
import { CodeHighlight } from "@mantine/code-highlight";
import { event as gaEvent } from "nextjs-google-analytics";
-import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
-import useModal from "src/store/useModal";
+import useModal from "../../../store/useModal";
+import useGraph from "../../editor/views/GraphView/stores/useGraph";
const dataToString = (data: any) => {
const text = Array.isArray(data) ? Object.fromEntries(data) : data;
diff --git a/src/features/modals/SchemaModal/index.tsx b/src/features/modals/SchemaModal/index.tsx
index a1b08e4c..f3f87736 100644
--- a/src/features/modals/SchemaModal/index.tsx
+++ b/src/features/modals/SchemaModal/index.tsx
@@ -6,9 +6,9 @@ import { event as gaEvent } from "nextjs-google-analytics";
import { toast } from "react-hot-toast";
import { FaChevronDown } from "react-icons/fa";
import { VscLinkExternal } from "react-icons/vsc";
-import { FileFormat } from "src/enums/file.enum";
-import useConfig from "src/store/useConfig";
-import useFile from "src/store/useFile";
+import { FileFormat } from "../../../enums/file.enum";
+import useConfig from "../../../store/useConfig";
+import useFile from "../../../store/useFile";
export const SchemaModal = ({ opened, onClose }: ModalProps) => {
const setContents = useFile(state => state.setContents);
diff --git a/src/features/modals/TypeModal/index.tsx b/src/features/modals/TypeModal/index.tsx
index 36d0f982..6197783d 100644
--- a/src/features/modals/TypeModal/index.tsx
+++ b/src/features/modals/TypeModal/index.tsx
@@ -3,7 +3,7 @@ import type { ModalProps } from "@mantine/core";
import { Stack, Modal, Select, ScrollArea } from "@mantine/core";
import { CodeHighlight } from "@mantine/code-highlight";
import { event as gaEvent } from "nextjs-google-analytics";
-import useJson from "src/store/useJson";
+import useJson from "../../../store/useJson";
enum Language {
TypeScript = "typescript",
@@ -74,7 +74,7 @@ export const TypeModal = ({ opened, onClose }: ModalProps) => {
if (opened) {
try {
if (selectedType === Language.Go) {
- import("src/lib/utils/json2go").then(jtg => {
+ import("../../../lib/utils/json2go").then(jtg => {
import("gofmt.js").then(gofmt => {
const types = jtg.default(getJson());
setType(gofmt.default(types.go));
diff --git a/src/features/modals/UpgradeModal/index.tsx b/src/features/modals/UpgradeModal/index.tsx
index 7fda687c..15fb50f7 100644
--- a/src/features/modals/UpgradeModal/index.tsx
+++ b/src/features/modals/UpgradeModal/index.tsx
@@ -16,8 +16,8 @@ import {
} from "@mantine/core";
import Cookie from "js-cookie";
import { LuCheck } from "react-icons/lu";
-import { Logo } from "src/features/editor/Toolbar/Logo";
-import useConfig from "src/store/useConfig";
+import useConfig from "../../../store/useConfig";
+import { Logo } from "../../editor/Toolbar/Logo";
export const UpgradeContent = (props: FlexProps) => {
const darkmodeEnabled = useConfig(state => state.darkmodeEnabled);
diff --git a/src/hooks/useFocusNode.ts b/src/hooks/useFocusNode.ts
index 28d672c4..efddeda0 100644
--- a/src/hooks/useFocusNode.ts
+++ b/src/hooks/useFocusNode.ts
@@ -1,8 +1,8 @@
import React from "react";
import { useDebouncedValue } from "@mantine/hooks";
import { event as gaEvent } from "nextjs-google-analytics";
-import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
-import { searchQuery, cleanupHighlight, highlightMatchedNodes } from "src/lib/utils/search";
+import useGraph from "../features/editor/views/GraphView/stores/useGraph";
+import { cleanupHighlight, searchQuery, highlightMatchedNodes } from "../lib/utils/search";
export const useFocusNode = () => {
const viewPort = useGraph(state => state.viewPort);
diff --git a/src/hooks/useJsonQuery.ts b/src/hooks/useJsonQuery.ts
index aef88dab..26f03dcf 100644
--- a/src/hooks/useJsonQuery.ts
+++ b/src/hooks/useJsonQuery.ts
@@ -1,6 +1,6 @@
import toast from "react-hot-toast";
-import useFile from "src/store/useFile";
-import useJson from "src/store/useJson";
+import useFile from "../store/useFile";
+import useJson from "../store/useJson";
const useJsonQuery = () => {
const getJson = useJson(state => state.getJson);
diff --git a/src/hooks/useToggleHide.ts b/src/hooks/useToggleHide.ts
index 690d75b6..04beb581 100644
--- a/src/hooks/useToggleHide.ts
+++ b/src/hooks/useToggleHide.ts
@@ -1,5 +1,5 @@
import React from "react";
-import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
+import useGraph from "../features/editor/views/GraphView/stores/useGraph";
const useToggleHide = () => {
const getCollapsedNodeIds = useGraph(state => state.getCollapsedNodeIds);
diff --git a/src/layout/ConverterLayout/PageLinks.tsx b/src/layout/ConverterLayout/PageLinks.tsx
index 1b641802..abb8ca2f 100644
--- a/src/layout/ConverterLayout/PageLinks.tsx
+++ b/src/layout/ConverterLayout/PageLinks.tsx
@@ -2,7 +2,7 @@ import React from "react";
import Link from "next/link";
import { Anchor, Button, Flex, List, SimpleGrid, Stack } from "@mantine/core";
import { FaArrowRightLong } from "react-icons/fa6";
-import { formats } from "src/enums/file.enum";
+import { formats } from "../../enums/file.enum";
const languages = formats.map(format => format.label);
diff --git a/src/layout/ConverterLayout/ToolPage.tsx b/src/layout/ConverterLayout/ToolPage.tsx
index 6e0e341a..6b26f6ff 100644
--- a/src/layout/ConverterLayout/ToolPage.tsx
+++ b/src/layout/ConverterLayout/ToolPage.tsx
@@ -3,12 +3,12 @@ import { Box, Container, Flex, Paper, Text, Title } from "@mantine/core";
import { Editor } from "@monaco-editor/react";
import { NextSeo } from "next-seo";
import { LuCheck, LuCircleX } from "react-icons/lu";
-import { SEO } from "src/constants/seo";
-import { type FileFormat, formats } from "src/enums/file.enum";
-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";
+import { SEO } from "../../constants/seo";
+import { type FileFormat, formats } from "../../enums/file.enum";
+import { contentToJson, jsonToContent } from "../../lib/utils/jsonAdapter";
+import Layout from "../PageLayout";
+import { PageLinks } from "./PageLinks";
+import { editorOptions } from "./options";
interface ToolPageProps {
from: FileFormat;
diff --git a/src/layout/Landing/FAQ.tsx b/src/layout/Landing/FAQ.tsx
index d8077928..9ac833cd 100644
--- a/src/layout/Landing/FAQ.tsx
+++ b/src/layout/Landing/FAQ.tsx
@@ -1,6 +1,6 @@
import React from "react";
import { Container, Title, Accordion } from "@mantine/core";
-import Questions from "src/data/faq.json";
+import Questions from "../../data/faq.json";
export const FAQ = () => {
return (
diff --git a/src/layout/PageLayout/index.tsx b/src/layout/PageLayout/index.tsx
index 46599bf4..476e4b45 100644
--- a/src/layout/PageLayout/index.tsx
+++ b/src/layout/PageLayout/index.tsx
@@ -1,7 +1,7 @@
import React from "react";
import { Inter } from "next/font/google";
import styled, { ThemeProvider } from "styled-components";
-import { lightTheme } from "src/constants/theme";
+import { lightTheme } from "../../constants/theme";
import { Footer } from "./Footer";
import { Navbar } from "./Navbar";
diff --git a/src/layout/TypeLayout/PageLinks.tsx b/src/layout/TypeLayout/PageLinks.tsx
index c71b87d9..b9a3c69a 100644
--- a/src/layout/TypeLayout/PageLinks.tsx
+++ b/src/layout/TypeLayout/PageLinks.tsx
@@ -2,7 +2,7 @@ import React from "react";
import Link from "next/link";
import { Anchor, Button, Flex, List, SimpleGrid, Stack } from "@mantine/core";
import { FaArrowRightLong } from "react-icons/fa6";
-import { formats, TypeLanguage, typeOptions } from "src/enums/file.enum";
+import { formats, TypeLanguage, typeOptions } from "../../enums/file.enum";
type MappedCombinations = {
[language: string]: string[]; // Maps each language to an array of programming languages
diff --git a/src/layout/TypeLayout/TypegenWrapper.tsx b/src/layout/TypeLayout/TypegenWrapper.tsx
index aafee7e5..d73209c6 100644
--- a/src/layout/TypeLayout/TypegenWrapper.tsx
+++ b/src/layout/TypeLayout/TypegenWrapper.tsx
@@ -3,11 +3,11 @@ import { Box, Container, Flex, Paper, Title, Text } from "@mantine/core";
import { Editor } from "@monaco-editor/react";
import { NextSeo } from "next-seo";
import { LuCheck, LuCircleX } from "react-icons/lu";
-import { SEO } from "src/constants/seo";
-import { type FileFormat, formats, type TypeLanguage, typeOptions } from "src/enums/file.enum";
-import { editorOptions } from "src/layout/ConverterLayout/options";
-import Layout from "src/layout/PageLayout";
-import { generateType } from "src/lib/utils/generateType";
+import { SEO } from "../../constants/seo";
+import { type FileFormat, formats, type TypeLanguage, typeOptions } from "../../enums/file.enum";
+import { editorOptions } from "../../layout/ConverterLayout/options";
+import Layout from "../../layout/PageLayout";
+import { generateType } from "../../lib/utils/generateType";
import { PageLinks } from "./PageLinks";
interface ConverterPagesProps {
diff --git a/src/lib/utils/generateType.ts b/src/lib/utils/generateType.ts
index c8eeaf1f..70919b24 100644
--- a/src/lib/utils/generateType.ts
+++ b/src/lib/utils/generateType.ts
@@ -1,4 +1,4 @@
-import { type FileFormat, TypeLanguage } from "src/enums/file.enum";
+import { type FileFormat, TypeLanguage } from "../../enums/file.enum";
import { contentToJson } from "./jsonAdapter";
export const generateType = async (input: string, format: FileFormat, output: TypeLanguage) => {
@@ -7,7 +7,7 @@ export const generateType = async (input: string, format: FileFormat, output: Ty
const jsonString = JSON.stringify(inputToJson);
if (output === TypeLanguage.Go) {
- const json2go = await import("src/lib/utils/json2go.js");
+ const json2go = await import("../../lib/utils/json2go.js");
const gofmt = await import("gofmt.js");
const types = json2go.default(jsonString);
diff --git a/src/lib/utils/jsonAdapter.ts b/src/lib/utils/jsonAdapter.ts
index 457f5eb4..2edc10db 100644
--- a/src/lib/utils/jsonAdapter.ts
+++ b/src/lib/utils/jsonAdapter.ts
@@ -1,4 +1,4 @@
-import { FileFormat } from "src/enums/file.enum";
+import { FileFormat } from "../../enums/file.enum";
const keyExists = (obj: object, key: string) => {
if (!obj || (typeof obj !== "object" && !Array.isArray(obj))) {
diff --git a/src/pages/404.tsx b/src/pages/404.tsx
index 19f59107..8233c26b 100644
--- a/src/pages/404.tsx
+++ b/src/pages/404.tsx
@@ -2,8 +2,8 @@ import React from "react";
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/PageLayout";
+import { SEO } from "../constants/seo";
+import Layout from "../layout/PageLayout";
const NotFound = () => {
return (
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 73a4107a..f86db5aa 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -7,9 +7,9 @@ import { ThemeProvider } from "styled-components";
import { NextSeo, SoftwareAppJsonLd } from "next-seo";
import { GoogleAnalytics } from "nextjs-google-analytics";
import { Toaster } from "react-hot-toast";
-import GlobalStyle from "src/constants/globalStyle";
-import { SEO } from "src/constants/seo";
-import { lightTheme } from "src/constants/theme";
+import GlobalStyle from "../constants/globalStyle";
+import { SEO } from "../constants/seo";
+import { lightTheme } from "../constants/theme";
const theme = createTheme({
autoContrast: true,
diff --git a/src/pages/_error.tsx b/src/pages/_error.tsx
index 8a927a36..dda89b67 100644
--- a/src/pages/_error.tsx
+++ b/src/pages/_error.tsx
@@ -2,8 +2,8 @@ import React from "react";
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/PageLayout";
+import { SEO } from "../constants/seo";
+import Layout from "../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 241515d6..3844c8b1 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 1d7d3f6c..71757f65 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 ede10658..6b78202b 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 62bd8ec9..bec6acee 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 a0b776db..62245e3e 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 84d7ddb5..0f420c2b 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 dc847aa2..bf95d794 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 932fc529..d3a0206a 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 45b06e36..b626ce03 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 d5357b76..aedf6604 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 9500c1ad..6dee1e87 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 d029e9c6..ea091e35 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 { FileFormat } from "src/enums/file.enum";
-import { ToolPage } from "src/layout/ConverterLayout/ToolPage";
+import { FileFormat } from "../../enums/file.enum";
+import { ToolPage } from "../../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 f9938ffb..117c4cdd 100644
--- a/src/pages/docs.tsx
+++ b/src/pages/docs.tsx
@@ -3,8 +3,8 @@ import { Group, Paper, Stack, Text, Title } from "@mantine/core";
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/PageLayout";
+import { SEO } from "../constants/seo";
+import Layout from "../layout/PageLayout";
const StyledFrame = styled.iframe`
border: none;
diff --git a/src/pages/editor.tsx b/src/pages/editor.tsx
index 84cd6d74..28f7ccab 100644
--- a/src/pages/editor.tsx
+++ b/src/pages/editor.tsx
@@ -9,18 +9,18 @@ import { Allotment } from "allotment";
import "allotment/dist/style.css";
import Cookie from "js-cookie";
import { NextSeo } from "next-seo";
-import { SEO } from "src/constants/seo";
-import { darkTheme, lightTheme } from "src/constants/theme";
-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";
-import useModal from "src/store/useModal";
+import { SEO } from "../constants/seo";
+import { darkTheme, lightTheme } from "../constants/theme";
+import { BottomBar } from "../features/editor/BottomBar";
+import { FullscreenDropzone } from "../features/editor/FullscreenDropzone";
+import { Toolbar } from "../features/editor/Toolbar";
+import useGraph from "../features/editor/views/GraphView/stores/useGraph";
+import useConfig from "../store/useConfig";
+import useFile from "../store/useFile";
+import useModal from "../store/useModal";
-const ModalController = dynamic(() => import("src/features/modals/ModalController"));
-const ExternalMode = dynamic(() => import("src/features/editor/ExternalMode"));
+const ModalController = dynamic(() => import("../features/modals/ModalController"));
+const ExternalMode = dynamic(() => import("../features/editor/ExternalMode"));
const queryClient = new QueryClient({
defaultOptions: {
@@ -57,11 +57,11 @@ export const StyledEditor = styled(Allotment)`
}
`;
-const TextEditor = dynamic(() => import("src/features/editor/TextEditor"), {
+const TextEditor = dynamic(() => import("../features/editor/TextEditor"), {
ssr: false,
});
-const LiveEditor = dynamic(() => import("src/features/editor/LiveEditor"), {
+const LiveEditor = dynamic(() => import("../features/editor/LiveEditor"), {
ssr: false,
});
diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index e2a6c9b3..9d454706 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -1,16 +1,16 @@
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/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 { Section2 } from "src/layout/Landing/Section2";
-import { Section3 } from "src/layout/Landing/Section3";
-import Layout from "src/layout/PageLayout";
+import { SEO } from "../constants/seo";
+import { FAQ } from "../layout/Landing/FAQ";
+import { Features } from "../layout/Landing/Features";
+import { HeroPreview } from "../layout/Landing/HeroPreview";
+import { HeroSection } from "../layout/Landing/HeroSection";
+import { LovedBy } from "../layout/Landing/LovedBy";
+import { Section1 } from "../layout/Landing/Section1";
+import { Section2 } from "../layout/Landing/Section2";
+import { Section3 } from "../layout/Landing/Section3";
+import Layout from "../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 b7762e10..56469619 100644
--- a/src/pages/legal/privacy.tsx
+++ b/src/pages/legal/privacy.tsx
@@ -1,9 +1,9 @@
import React from "react";
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/PageLayout";
+import { SEO } from "../../constants/seo";
+import privacy from "../../data/privacy.json";
+import Layout from "../../layout/PageLayout";
const Privacy = () => {
return (
diff --git a/src/pages/legal/terms.tsx b/src/pages/legal/terms.tsx
index 1a2f4532..addd1f9b 100644
--- a/src/pages/legal/terms.tsx
+++ b/src/pages/legal/terms.tsx
@@ -1,9 +1,9 @@
import React from "react";
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/PageLayout";
+import { SEO } from "../../constants/seo";
+import terms from "../../data/terms.json";
+import Layout from "../../layout/PageLayout";
const Terms = () => {
return (
diff --git a/src/pages/tools/json-schema.tsx b/src/pages/tools/json-schema.tsx
index 2cf6742d..de347d15 100644
--- a/src/pages/tools/json-schema.tsx
+++ b/src/pages/tools/json-schema.tsx
@@ -4,12 +4,12 @@ import { Editor, type OnMount } from "@monaco-editor/react";
import { JSONSchemaFaker } from "json-schema-faker";
import { NextSeo } from "next-seo";
import { LuCheck, LuCircleX } from "react-icons/lu";
-import { SEO } from "src/constants/seo";
-import { FileFormat, TypeLanguage } from "src/enums/file.enum";
-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";
+import { SEO } from "../../constants/seo";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { editorOptions } from "../../layout/ConverterLayout/options";
+import Layout from "../../layout/PageLayout";
+import { generateType } from "../../lib/utils/generateType";
+import { jsonToContent } from "../../lib/utils/jsonAdapter";
const JSONSchemaTool = () => {
const monacoRef = React.useRef<Parameters<OnMount>[1] | null>(null);
diff --git a/src/pages/type/csv-to-go.tsx b/src/pages/type/csv-to-go.tsx
index ad5797cb..dd88ac4f 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 fa6ae431..8f1a9f77 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 9fa67f31..5d1150a2 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 94cc5df8..9f060c6b 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 2ff24a63..aa3bbd07 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 368fa915..e9525c2c 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 4934d17f..c3db01cb 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 6407d56a..8e99f2b9 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 ef987aa0..a944d69d 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 42c552de..1556a572 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 d6dc1da8..3c97a002 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 2eef55a7..88386e81 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 2220ac53..ea464c75 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 d135bc68..376be879 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 e862b9b6..f79ce9c0 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 cee24343..c7456d1e 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 { FileFormat, TypeLanguage } from "src/enums/file.enum";
-import { TypegenWrapper } from "src/layout/TypeLayout/TypegenWrapper";
+import { FileFormat, TypeLanguage } from "../../enums/file.enum";
+import { TypegenWrapper } from "../../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 d8d7b179..42b578cd 100644
--- a/src/pages/widget.tsx
+++ b/src/pages/widget.tsx
@@ -5,11 +5,11 @@ import { useMantineColorScheme } from "@mantine/core";
import { ThemeProvider } from "styled-components";
import { NextSeo } from "next-seo";
import toast from "react-hot-toast";
-import { darkTheme, lightTheme } from "src/constants/theme";
-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";
+import { darkTheme, lightTheme } from "../constants/theme";
+import { Toolbar } from "../features/editor/Toolbar";
+import useGraph from "../features/editor/views/GraphView/stores/useGraph";
+import useFile from "../store/useFile";
+import type { LayoutDirection } from "../types/graph";
interface EmbedMessage {
data: {
@@ -22,7 +22,7 @@ interface EmbedMessage {
}
const GraphView = dynamic(
- () => import("src/features/editor/views/GraphView").then(c => c.GraphView),
+ () => import("../features/editor/views/GraphView").then(c => c.GraphView),
{
ssr: false,
}
diff --git a/src/store/useFile.ts b/src/store/useFile.ts
index e30edf90..9b2f1101 100644
--- a/src/store/useFile.ts
+++ b/src/store/useFile.ts
@@ -2,10 +2,10 @@ import debounce from "lodash.debounce";
import { event as gaEvent } from "nextjs-google-analytics";
import { toast } from "react-hot-toast";
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 { FileFormat } from "../enums/file.enum";
import useGraph from "../features/editor/views/GraphView/stores/useGraph";
+import { isIframe } from "../lib/utils/helpers";
+import { contentToJson, jsonToContent } from "../lib/utils/jsonAdapter";
import useConfig from "./useConfig";
import useJson from "./useJson";
diff --git a/src/store/useJson.ts b/src/store/useJson.ts
index 2a13fadc..641bfdb8 100644
--- a/src/store/useJson.ts
+++ b/src/store/useJson.ts
@@ -1,5 +1,5 @@
import { create } from "zustand";
-import useGraph from "src/features/editor/views/GraphView/stores/useGraph";
+import useGraph from "../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 cb6b8613..b035dbd1 100644
--- a/src/store/useModal.ts
+++ b/src/store/useModal.ts
@@ -1,5 +1,5 @@
import { create } from "zustand";
-import { type Modal, modalComponents } from "src/features/modals/ModalController";
+import { type Modal, modalComponents } from "../features/modals/ModalController";
interface ModalActions {
setVisible: (name: Modal, open: boolean) => void;
diff --git a/src/types/styled.d.ts b/src/types/styled.d.ts
index 35ffe3d6..35b176b9 100644
--- a/src/types/styled.d.ts
+++ b/src/types/styled.d.ts
@@ -1,5 +1,5 @@
import "styled-components";
-import type theme from "src/constants/theme";
+import type theme from "../constants/theme";
type CustomTheme = typeof theme;
diff --git a/tsconfig.json b/tsconfig.json
index f0c1a626..b32b4187 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,6 +1,5 @@
{
"compilerOptions": {
- "baseUrl": ".",
"target": "ES6",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,