Skip to content

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

fix: lint & upgrade monaco editor

AykutSarac9e8cee534cc9
diff --git a/package.json b/package.json
index 91147b15..81796e13 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
"@mantine/code-highlight": "^7.3.2",
"@mantine/core": "^7.3.2",
"@mantine/hooks": "^7.3.2",
- "@monaco-editor/react": "^4.5.2",
+ "@monaco-editor/react": "^4.6.0",
"@sentry/nextjs": "^7.91.0",
"@supabase/auth-helpers-nextjs": "^0.8.1",
"@supabase/auth-helpers-react": "^0.4.2",
@@ -30,6 +30,7 @@
"html-to-image": "^1.11.11",
"jq-in-the-browser": "^0.7.2",
"jq-web": "^0.5.1",
+ "js-yaml": "^4.1.0",
"json-2-csv": "^5.0.1",
"json-to-ts": "^1.7.0",
"jsonc-parser": "^3.2.0",
@@ -58,6 +59,7 @@
"devDependencies": {
"@next/bundle-analyzer": "^13.4.12",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
+ "@types/js-yaml": "^4.0.9",
"@types/jsonwebtoken": "^9.0.5",
"@types/jxon": "^2.0.5",
"@types/lodash.debounce": "^4.0.9",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a1cbb56b..898919f8 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -15,8 +15,8 @@ dependencies:
specifier: ^7.3.2
version: 7.3.2([email protected])
'@monaco-editor/react':
- specifier: ^4.5.2
+ specifier: ^4.6.0
'@sentry/nextjs':
specifier: ^7.91.0
@@ -53,6 +53,9 @@ dependencies:
jq-web:
specifier: ^0.5.1
version: 0.5.1
+ js-yaml:
+ specifier: ^4.1.0
+ version: 4.1.0
json-2-csv:
specifier: ^5.0.1
version: 5.0.1
@@ -133,6 +136,9 @@ devDependencies:
'@trivago/prettier-plugin-sort-imports':
specifier: ^4.3.0
version: 4.3.0([email protected])
+ '@types/js-yaml':
+ specifier: ^4.0.9
+ version: 4.0.9
'@types/jsonwebtoken':
specifier: ^9.0.5
version: 9.0.5
@@ -557,8 +563,8 @@ packages:
state-local: 1.0.7
dev: false
- resolution: {integrity: sha512-emcWu6vg1OpXPiYll4aPOaXe8bwYB4UaaNTwtArFLgMoNGBzRZb2Xn0Bra2HMIFM7QLgs7fCGunHO5LkfT2LBA==}
+ resolution: {integrity: sha512-RFkU9/i7cN2bsq/iTkurMWOEErmYcY6JiQI3Jn+WeR/FGISH8JbHERjpS9oRuSOPvDMJI0Z8nJeKkbOs9sBYQw==}
peerDependencies:
monaco-editor: '>= 0.25.0 < 1'
react: ^16.8.0 || ^17.0.0 || ^18.0.0
@@ -1064,6 +1070,10 @@ packages:
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
dev: false
+ resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==}
+ dev: true
+
resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==}
dev: true
@@ -1273,7 +1283,6 @@ packages:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
- dev: true
resolution: {integrity: sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==}
@@ -3010,7 +3019,6 @@ packages:
hasBin: true
dependencies:
argparse: 2.0.1
- dev: true
resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==}
diff --git a/src/components/MonacoEditor/index.tsx b/src/components/MonacoEditor/index.tsx
index 1e05c93f..2287ae93 100644
--- a/src/components/MonacoEditor/index.tsx
+++ b/src/components/MonacoEditor/index.tsx
@@ -44,6 +44,7 @@ export const MonacoEditor = () => {
...(jsonSchema && {
schemas: [
{
+ uri: "http://myserver/foo-schema.json",
fileMatch: ["*"],
schema: jsonSchema,
},
diff --git a/src/containers/Editor/BottomBar.tsx b/src/containers/Editor/BottomBar.tsx
index b0a7698d..15dc3cd0 100644
--- a/src/containers/Editor/BottomBar.tsx
+++ b/src/containers/Editor/BottomBar.tsx
@@ -1,8 +1,8 @@
import React from "react";
import Head from "next/head";
import { useRouter } from "next/router";
-import styled from "styled-components";
import { Flex, Popover, Text } from "@mantine/core";
+import styled from "styled-components";
import toast from "react-hot-toast";
import {
AiOutlineCloudSync,
@@ -153,11 +153,6 @@ export const BottomBar = () => {
user,
]);
- const handleLoginClick = () => {
- if (user) return setVisible("account")(true);
- else setVisible("login")(true);
- };
-
const setPrivate = async () => {
try {
if (!query.json) return handleSaveJson();
diff --git a/src/containers/Editor/JsonEditor.tsx b/src/containers/Editor/JsonEditor.tsx
index 3ee3b439..ac2e0fec 100644
--- a/src/containers/Editor/JsonEditor.tsx
+++ b/src/containers/Editor/JsonEditor.tsx
@@ -1,7 +1,7 @@
import React from "react";
-import styled from "styled-components";
import { ActionIcon, TextInput, Loader, Tooltip } from "@mantine/core";
import { getHotkeyHandler, useSessionStorage } from "@mantine/hooks";
+import styled from "styled-components";
import { toast } from "react-hot-toast";
import { GoDependabot } from "react-icons/go";
import { VscClose, VscQuestion } from "react-icons/vsc";
diff --git a/src/containers/Editor/LiveEditor.tsx b/src/containers/Editor/LiveEditor.tsx
index 0ae94d25..f8e4f9bd 100644
--- a/src/containers/Editor/LiveEditor.tsx
+++ b/src/containers/Editor/LiveEditor.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import styled from "styled-components";
import { Menu, Text } from "@mantine/core";
+import styled from "styled-components";
import { firaMono } from "src/constants/fonts";
import { Graph } from "src/containers/Views/GraphView";
import { TreeView } from "src/containers/Views/TreeView";
diff --git a/src/containers/Modals/ImportModal/index.tsx b/src/containers/Modals/ImportModal/index.tsx
index 2db94b24..17ae4acc 100644
--- a/src/containers/Modals/ImportModal/index.tsx
+++ b/src/containers/Modals/ImportModal/index.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import styled from "styled-components";
import { Modal, Group, Button, TextInput, Stack, Divider, ModalProps } from "@mantine/core";
+import styled from "styled-components";
import toast from "react-hot-toast";
import { AiOutlineUpload } from "react-icons/ai";
import useFile from "src/store/useFile";
diff --git a/src/containers/Modals/NodeModal/index.tsx b/src/containers/Modals/NodeModal/index.tsx
index 2fd48b85..92e9878d 100644
--- a/src/containers/Modals/NodeModal/index.tsx
+++ b/src/containers/Modals/NodeModal/index.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { CodeHighlight } from "@mantine/code-highlight";
import { Modal, Stack, Text, ScrollArea, ModalProps, Button } from "@mantine/core";
+import { CodeHighlight } from "@mantine/code-highlight";
import Editor from "@monaco-editor/react";
import { VscLock } from "react-icons/vsc";
import { isIframe } from "src/lib/utils/widget";
diff --git a/src/containers/Modals/TypeModal/index.tsx b/src/containers/Modals/TypeModal/index.tsx
index e9f7d443..421e096d 100644
--- a/src/containers/Modals/TypeModal/index.tsx
+++ b/src/containers/Modals/TypeModal/index.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import { CodeHighlight } from "@mantine/code-highlight";
import { Stack, Modal, ModalProps, ScrollArea, Select } from "@mantine/core";
+import { CodeHighlight } from "@mantine/code-highlight";
import useJson from "src/store/useJson";
enum Language {
diff --git a/src/containers/Views/GraphView/CustomNode/TextRenderer.tsx b/src/containers/Views/GraphView/CustomNode/TextRenderer.tsx
index 35c5fa97..9ba6ca80 100644
--- a/src/containers/Views/GraphView/CustomNode/TextRenderer.tsx
+++ b/src/containers/Views/GraphView/CustomNode/TextRenderer.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import styled from "styled-components";
import { ColorSwatch } from "@mantine/core";
+import styled from "styled-components";
import * as Styled from "./styles";
const StyledRow = styled.span`
diff --git a/src/containers/Views/GraphView/PremiumView.tsx b/src/containers/Views/GraphView/PremiumView.tsx
index 16d13fc7..9b14dade 100644
--- a/src/containers/Views/GraphView/PremiumView.tsx
+++ b/src/containers/Views/GraphView/PremiumView.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import styled from "styled-components";
import { Button, Image, List, ThemeIcon, Title } from "@mantine/core";
+import styled from "styled-components";
import { BsCheck } from "react-icons/bs";
import { paymentURL } from "src/constants/data";
diff --git a/src/layout/ExternalMode/index.tsx b/src/layout/ExternalMode/index.tsx
index 29775504..919f0085 100644
--- a/src/layout/ExternalMode/index.tsx
+++ b/src/layout/ExternalMode/index.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import styled from "styled-components";
import { Anchor, Button, Group, Modal, Text } from "@mantine/core";
+import styled from "styled-components";
import { VscCode } from "react-icons/vsc";
const StyledAlert = styled.div`
diff --git a/src/layout/Loading/index.tsx b/src/layout/Loading/index.tsx
index 05df7eed..9791fb17 100644
--- a/src/layout/Loading/index.tsx
+++ b/src/layout/Loading/index.tsx
@@ -1,6 +1,6 @@
import React from "react";
-import styled, { keyframes } from "styled-components";
import { Center, Image, Stack } from "@mantine/core";
+import styled, { keyframes } from "styled-components";
import { JSONCrackLogo } from "../JsonCrackLogo";
interface LoadingProps {
diff --git a/src/pages/404.tsx b/src/pages/404.tsx
index e61b7516..d9a5d169 100644
--- a/src/pages/404.tsx
+++ b/src/pages/404.tsx
@@ -1,8 +1,8 @@
import React from "react";
import Head from "next/head";
import { useRouter } from "next/router";
-import styled from "styled-components";
import { Button, Text, Title } from "@mantine/core";
+import styled from "styled-components";
import Layout from "src/layout/Layout";
const StyledNotFound = styled.div`
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 673388a3..b03c7ae1 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -2,7 +2,7 @@ import React from "react";
import type { AppProps } from "next/app";
import dynamic from "next/dynamic";
import { useRouter } from "next/router";
-import { MantineProvider, createTheme, ColorSchemeScript } from "@mantine/core";
+import { MantineProvider, createTheme } from "@mantine/core";
import "@mantine/core/styles.css";
import "@mantine/code-highlight/styles.css";
import { ThemeProvider } from "styled-components";
diff --git a/src/pages/_error.tsx b/src/pages/_error.tsx
index 1db40788..5246e70c 100644
--- a/src/pages/_error.tsx
+++ b/src/pages/_error.tsx
@@ -1,7 +1,7 @@
import React from "react";
import { useRouter } from "next/router";
-import styled from "styled-components";
import { Button } from "@mantine/core";
+import styled from "styled-components";
const StyledNotFound = styled.div`
display: flex;
diff --git a/src/pages/docs.tsx b/src/pages/docs.tsx
index 2ef93e75..4a4fb365 100644
--- a/src/pages/docs.tsx
+++ b/src/pages/docs.tsx
@@ -1,8 +1,8 @@
import React from "react";
import Head from "next/head";
-import styled from "styled-components";
-import { CodeHighlight } from "@mantine/code-highlight";
import { Group, Paper, Stack, Text, Title } from "@mantine/core";
+import { CodeHighlight } from "@mantine/code-highlight";
+import styled from "styled-components";
import Layout from "src/layout/Layout";
const StyledFrame = styled.iframe`
diff --git a/src/pages/widget.tsx b/src/pages/widget.tsx
index 40b7fddc..42e6f600 100644
--- a/src/pages/widget.tsx
+++ b/src/pages/widget.tsx
@@ -2,7 +2,7 @@ import React from "react";
import dynamic from "next/dynamic";
import Head from "next/head";
import { useRouter } from "next/router";
-import { MantineProvider, useMantineColorScheme } from "@mantine/core";
+import { MantineProvider } from "@mantine/core";
import { ThemeProvider } from "styled-components";
import toast from "react-hot-toast";
import { darkTheme, lightTheme } from "src/constants/theme";
@@ -28,7 +28,6 @@ const WidgetPage = () => {
const setContents = useFile(state => state.setContents);
const setDirection = useGraph(state => state.setDirection);
const clearGraph = useGraph(state => state.clearGraph);
- const { setColorScheme } = useMantineColorScheme();
React.useEffect(() => {
if (isReady) {
@@ -44,7 +43,6 @@ const WidgetPage = () => {
if (!event.data?.json) return;
if (event.data?.options?.theme === "light" || event.data?.options?.theme === "dark") {
setTheme(event.data.options.theme);
- setColorScheme(event.data.options.theme);
}
setContents({ contents: event.data.json, hasChanges: false });
diff --git a/src/store/useFile.ts b/src/store/useFile.ts
index 78bd1a41..93b37f67 100644
--- a/src/store/useFile.ts
+++ b/src/store/useFile.ts
@@ -26,7 +26,7 @@ interface JsonActions {
getContents: () => string;
getFormat: () => FileFormat;
getHasChanges: () => boolean;
- setError: (error: object | null) => void;
+ setError: (error: string | null) => void;
setHasChanges: (hasChanges: boolean) => void;
setContents: (data: SetContents) => void;
fetchFile: (fileId: string) => void;