✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.
feat: enable ai
AykutSaracadd5fd9b9ac7
diff --git a/package.json b/package.jsonindex caf1765c..75284cb7 100644--- a/package.json+++ b/package.json@@ -14,17 +14,17 @@"analyze": "ANALYZE=true npm run build"},"dependencies": {- "@mantine/code-highlight": "^7.3.2",- "@mantine/core": "^7.3.2",- "@mantine/hooks": "^7.3.2",+ "@mantine/code-highlight": "^7.4.1",+ "@mantine/core": "^7.4.1",+ "@mantine/hooks": "^7.4.1","@monaco-editor/react": "^4.6.0","@sentry/nextjs": "^7.91.0","@supabase/auth-helpers-nextjs": "^0.8.7","@supabase/auth-helpers-react": "^0.4.2",- "@supabase/supabase-js": "^2.39.2",- "@tanstack/react-query": "^4.35.3",- "allotment": "^1.19.3",- "axios": "^1.5.0",+ "@supabase/supabase-js": "^2.39.3",+ "@tanstack/react-query": "^4.36.1",+ "allotment": "^1.19.5",+ "axios": "^1.6.5","dayjs": "^1.11.10","gofmt.js": "^0.0.2","html-to-image": "^1.11.11",@@ -44,6 +44,7 @@"maketypes": "^1.1.2","million": "^2.6.4","next": "13.5.6",+ "pako": "^2.1.0","react": "^18.2.0","react-dom": "^18.2.0","react-ga4": "^2.1.0",@@ -54,9 +55,9 @@"react-simple-typewriter": "^5.0.1","react-zoomable-ui": "^0.11.0","reaflow": "5.2.8",- "styled-components": "^6.1.3",+ "styled-components": "^6.1.8","toml": "^3.0.0",- "use-long-press": "^3.1.5",+ "use-long-press": "^3.2.0","zustand": "^4.4.7"},"devDependencies": {@@ -71,15 +72,16 @@"@types/lodash.unset": "^4.5.9","@types/lodash.update": "^4.10.9","@types/node": "^20.4.7",+ "@types/pako": "^2.0.3","@types/react": "18.2.45","@types/react-dom": "^18.2.18","eslint": "8.56.0","eslint-config-next": "14.0.4","eslint-config-prettier": "^8.10.0",- "eslint-plugin-prettier": "^5.0.0",+ "eslint-plugin-prettier": "^5.1.3","eslint-plugin-unused-imports": "^3.0.0",- "prettier": "^3.1.1",- "ts-node": "^10.9.1",+ "prettier": "^3.2.2",+ "ts-node": "^10.9.2","typescript": "5.3.3"}}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 87204567..a4dee502 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -6,14 +6,14 @@ settings:dependencies:'@mantine/code-highlight':- specifier: ^7.3.2- version: 7.3.2(@mantine/[email protected])(@mantine/[email protected])([email protected])([email protected])+ specifier: ^7.4.1+ version: 7.4.1(@mantine/[email protected])(@mantine/[email protected])([email protected])([email protected])'@mantine/core':- specifier: ^7.3.2- version: 7.3.2(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])+ specifier: ^7.4.1+ version: 7.4.1(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])'@mantine/hooks':- specifier: ^7.3.2- version: 7.3.2([email protected])+ specifier: ^7.4.1+ version: 7.4.1([email protected])'@monaco-editor/react':specifier: ^4.6.0@@ -22,22 +22,22 @@ dependencies:version: 7.91.0([email protected])([email protected])'@supabase/auth-helpers-nextjs':specifier: ^0.8.7- version: 0.8.7(@supabase/[email protected])+ version: 0.8.7(@supabase/[email protected])'@supabase/auth-helpers-react':specifier: ^0.4.2- version: 0.4.2(@supabase/[email protected])+ version: 0.4.2(@supabase/[email protected])'@supabase/supabase-js':- specifier: ^2.39.2- version: 2.39.2+ specifier: ^2.39.3+ version: 2.39.3'@tanstack/react-query':- specifier: ^4.35.3- version: 4.35.3([email protected])([email protected])+ specifier: ^4.36.1+ version: 4.36.1([email protected])([email protected])allotment:- specifier: ^1.19.3- version: 1.19.3([email protected])([email protected])+ specifier: ^1.19.5+ version: 1.19.5([email protected])([email protected])axios:- specifier: ^1.5.0- version: 1.5.0+ specifier: ^1.6.5+ version: 1.6.5dayjs:specifier: ^1.11.10version: 1.11.10@@ -95,6 +95,9 @@ dependencies:next:specifier: 13.5.6+ pako:+ specifier: ^2.1.0+ version: 2.1.0react:specifier: ^18.2.0version: 18.2.0@@ -126,14 +129,14 @@ dependencies:specifier: 5.2.8version: 5.2.8([email protected])([email protected])styled-components:- specifier: ^6.1.3- version: 6.1.3([email protected])([email protected])+ specifier: ^6.1.8+ version: 6.1.8([email protected])([email protected])toml:specifier: ^3.0.0version: 3.0.0use-long-press:- specifier: ^3.1.5- version: 3.1.5([email protected])+ specifier: ^3.2.0+ version: 3.2.0([email protected])zustand:specifier: ^4.4.7version: 4.4.7(@types/[email protected])([email protected])@@ -144,7 +147,7 @@ devDependencies:version: 13.4.12'@trivago/prettier-plugin-sort-imports':specifier: ^4.3.0- version: 4.3.0([email protected])+ version: 4.3.0([email protected])'@types/js-yaml':specifier: ^4.0.9version: 4.0.9@@ -172,6 +175,9 @@ devDependencies:'@types/node':specifier: ^20.4.7version: 20.4.7+ '@types/pako':+ specifier: ^2.0.3+ version: 2.0.3'@types/react':specifier: 18.2.45version: 18.2.45@@ -188,17 +194,17 @@ devDependencies:specifier: ^8.10.0version: 8.10.0([email protected])eslint-plugin-prettier:- specifier: ^5.0.0+ specifier: ^5.1.3eslint-plugin-unused-imports:specifier: ^3.0.0version: 3.0.0([email protected])prettier:- specifier: ^3.1.1- version: 3.1.1+ specifier: ^3.2.2+ version: 3.2.2ts-node:- specifier: ^10.9.1- version: 10.9.1(@types/[email protected])([email protected])+ specifier: ^10.9.2+ version: 10.9.2(@types/[email protected])([email protected])typescript:specifier: 5.3.3version: 5.3.3@@ -645,31 +651,31 @@ packages:call-bind: 1.0.5dev: false- /@mantine/[email protected](@mantine/[email protected])(@mantine/[email protected])([email protected])([email protected]):- resolution: {integrity: sha512-FtpM+lxDpgX1s8jiPdpHtmbRzjfERv6koWiNdkVQxVZQ0YTkigGjGH7mJZHJMKS3ZQJAozCqcGPZE9yICOvMjw==}+ /@mantine/[email protected](@mantine/[email protected])(@mantine/[email protected])([email protected])([email protected]):+ resolution: {integrity: sha512-zfUZuwP2hXnz3BC1H2tH/clc00NS36XQMmkMeVLTKDl8mU3vMiDPxjsODvrieLbat7rUfqaD9mqhJShwCL1D/g==}peerDependencies:- '@mantine/core': 7.3.2- '@mantine/hooks': 7.3.2+ '@mantine/core': 7.4.1+ '@mantine/hooks': 7.4.1react: ^18.2.0react-dom: ^18.2.0dependencies:- '@mantine/core': 7.3.2(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])- '@mantine/hooks': 7.3.2([email protected])+ '@mantine/core': 7.4.1(@mantine/[email protected])(@types/[email protected])([email protected])([email protected])+ '@mantine/hooks': 7.4.1([email protected])clsx: 2.0.0highlight.js: 11.9.0react: 18.2.0react-dom: 18.2.0([email protected])dev: false- /@mantine/[email protected](@mantine/[email protected])(@types/[email protected])([email protected])([email protected]):- resolution: {integrity: sha512-CwAuQogVLcLR7O9e1eOgi3gtk4XX6cnaqevAxzJJpIOIyCnHiQ3cEGINVXyUUjUUipBlvK3sqz3NPGJ2ekLFDQ==}+ /@mantine/[email protected](@mantine/[email protected])(@types/[email protected])([email protected])([email protected]):+ resolution: {integrity: sha512-crz9BemmwR8V/h6db9FgznCp0Ssp6rCUYkBBO4JprpH8NDSEblHyWcZZo43IuA1vZptp8eyrhRNJ4nfe8CAYFQ==}peerDependencies:- '@mantine/hooks': 7.3.2+ '@mantine/hooks': 7.4.1react: ^18.2.0react-dom: ^18.2.0dependencies:'@floating-ui/react': 0.24.8([email protected])([email protected])- '@mantine/hooks': 7.3.2([email protected])+ '@mantine/hooks': 7.4.1([email protected])clsx: 2.0.0react: 18.2.0react-dom: 18.2.0([email protected])@@ -681,8 +687,8 @@ packages:- '@types/react'dev: false- /@mantine/[email protected]([email protected]):- resolution: {integrity: sha512-xgumuuI3PBWXff5N02HCI7PEy25mDEdyXDQklUYK93J6FKwpcosyZnGVitoUrV1gLtYYa9ZudeAWdhHuh/CpOg==}+ /@mantine/[email protected]([email protected]):+ resolution: {integrity: sha512-7gV9YR+xZ1L69MGVaSNwV0gaxIz4bCZuGxXTtnuaamDcO/4YiNDtmvdD7/jC/RTa1iJMnZ6YiYrcPXLOn+8saQ==}peerDependencies:react: ^18.2.0dependencies:@@ -1050,30 +1056,30 @@ packages:- supports-colordev: false- /@supabase/[email protected](@supabase/[email protected]):+ /@supabase/[email protected](@supabase/[email protected]):resolution: {integrity: sha512-iYdOjFo0GkRvha340l8JdCiBiyXQuG9v8jnq7qMJ/2fakrskRgHTCOt7ryWbip1T6BExcWKC8SoJrhCzPOxhhg==}peerDependencies:'@supabase/supabase-js': ^2.19.0dependencies:- '@supabase/auth-helpers-shared': 0.6.3(@supabase/[email protected])- '@supabase/supabase-js': 2.39.2+ '@supabase/auth-helpers-shared': 0.6.3(@supabase/[email protected])+ '@supabase/supabase-js': 2.39.3set-cookie-parser: 2.6.0dev: false- /@supabase/[email protected](@supabase/[email protected]):+ /@supabase/[email protected](@supabase/[email protected]):resolution: {integrity: sha512-zRj1leYMKJVYQeHFvZiUzlmHM+ATWFR/V7Q9F0yXSWEnMcNHL0CKnIBqhkjtSQ2trE+YaoCvFEHjxISppxIZXQ==}peerDependencies:'@supabase/supabase-js': ^2.19.0dependencies:- '@supabase/supabase-js': 2.39.2+ '@supabase/supabase-js': 2.39.3dev: false- /@supabase/[email protected](@supabase/[email protected]):+ /@supabase/[email protected](@supabase/[email protected]):resolution: {integrity: sha512-xYQRLFeFkL4ZfwC7p9VKcarshj3FB2QJMgJPydvOY7J5czJe6xSG5/wM1z63RmAzGbCkKg+dzpq61oeSyWiGBQ==}peerDependencies:'@supabase/supabase-js': ^2.19.0dependencies:- '@supabase/supabase-js': 2.39.2+ '@supabase/supabase-js': 2.39.3jose: 4.15.4dev: false@@ -1102,12 +1108,13 @@ packages:'@supabase/node-fetch': 2.6.15dev: false- /@supabase/[email protected]:- resolution: {integrity: sha512-OxmY2qj+y6+KI4ifTL92j5+WYP+u5/PdThlYxVb0GMcMiMHfA7yIku9yaQNC5/oRdIvhuRpTMG/8/R40eB+8pA==}+ /@supabase/[email protected]:+ resolution: {integrity: sha512-lAp50s2n3FhGJFq+wTSXLNIDPw5Y0Wxrgt44eM5nLSA3jZNUUP3Oq2Ccd1CbZdVntPCWLZvJaU//pAd2NE+QnQ==}dependencies:'@supabase/node-fetch': 2.6.15'@types/phoenix': 1.6.4- ws: 8.15.1+ '@types/ws': 8.5.10+ ws: 8.16.0transitivePeerDependencies:- bufferutil- utf-8-validate@@ -1119,14 +1126,14 @@ packages:'@supabase/node-fetch': 2.6.15dev: false- /@supabase/[email protected]:- resolution: {integrity: sha512-P+raK0epLef7x/s4MOUx6/TM2DX2UqMwbQXcV8PKYBX6xvX/zXARzakHsBrL/W5mA52S1vsRZjR8l7HhEPKmqA==}+ /@supabase/[email protected]:+ resolution: {integrity: sha512-NoltJSaJNKDJNutO5sJPAAi5RIWrn1z2XH+ig1+cHDojT6BTN7TvZPNa3Kq3gFQWfO5H1N9El/bCTZJ3iFW2kQ==}dependencies:'@supabase/functions-js': 2.1.5'@supabase/gotrue-js': 2.62.0'@supabase/node-fetch': 2.6.15'@supabase/postgrest-js': 1.9.0- '@supabase/realtime-js': 2.9.1+ '@supabase/realtime-js': 2.9.3'@supabase/storage-js': 2.5.5transitivePeerDependencies:- bufferutil@@ -1139,12 +1146,12 @@ packages:tslib: 2.6.2dev: false- /@tanstack/[email protected]:- resolution: {integrity: sha512-PS+WEjd9wzKTyNjjQymvcOe1yg8f3wYc6mD+vb6CKyZAKvu4sIJwryfqfBULITKCla7P9C4l5e9RXePHvZOZeQ==}+ /@tanstack/[email protected]:+ resolution: {integrity: sha512-DJSilV5+ytBP1FbFcEJovv4rnnm/CokuVvrBEtW/Va9DvuJ3HksbXUJEpI0aV1KtuL4ZoO9AVE6PyNLzF7tLeA==}dev: false- resolution: {integrity: sha512-UgTPioip/rGG3EQilXfA2j4BJkhEQsR+KAbF+KIuvQ7j4MkgnTCJF01SfRpIRNtQTlEfz/+IL7+jP8WA8bFbsw==}+ resolution: {integrity: sha512-y7ySVHFyyQblPl3J3eQBWpXZkliroki3ARnBKsdJchlgt7yJLRDUcf4B8soufgiYt3pEQIkBWBx1N9/ZPIeUWw==}peerDependencies:react: ^16.8.0 || ^17.0.0 || ^18.0.0react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0@@ -1155,13 +1162,13 @@ packages:react-native:optional: truedependencies:- '@tanstack/query-core': 4.35.3+ '@tanstack/query-core': 4.36.1react: 18.2.0react-dom: 18.2.0([email protected])use-sync-external-store: 1.2.0([email protected])dev: false- /@trivago/[email protected]([email protected]):+ /@trivago/[email protected]([email protected]):resolution: {integrity: sha512-r3n0onD3BTOVUNPhR4lhVK4/pABGpbA7bW3eumZnYdKaHkf1qEC+Mag6DPbGNuuh0eG8AaYj+YqmVHSiGslaTQ==}peerDependencies:'@vue/compiler-sfc': 3.x@@ -1176,7 +1183,7 @@ packages:'@babel/types': 7.17.0javascript-natural-sort: 0.7.1lodash: 4.17.21- prettier: 3.1.1+ prettier: 3.2.2transitivePeerDependencies:- supports-colordev: true@@ -1258,6 +1265,9 @@ packages:/@types/[email protected]:resolution: {integrity: sha512-bUBrPjEry2QUTsnuEjzjbS7voGWCc30W0qzgMf90GPeDGFRakvrz47ju+oqDAKCXLUCe39u57/ORMl/O/04/9g==}++ /@types/[email protected]:+ resolution: {integrity: sha512-bq0hMV9opAcrmE0Byyo0fY3Ew4tgOevJmQ9grUhpXQhYfyLJ1Kqg3P33JT5fdbT2AjeAjR51zqqVjAL/HMkx7Q==}dev: true/@types/[email protected]:@@ -1287,6 +1297,12 @@ packages:resolution: {integrity: sha512-n4sx2bqL0mW1tvDf/loQ+aMX7GQD3lc3fkCMC55VFNDu/vBOabO+LTIeXKM14xK0ppk5TUGcWRjiSpIlUpghKw==}dev: false+ /@types/[email protected]:+ resolution: {integrity: sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==}+ dependencies:+ '@types/node': 20.4.7+ dev: false+resolution: {integrity: sha512-MkgKNnsjC6QwcMdlNAel24jjkEO/0hQaMDLqP4S9zq5HBAUJNQB6y+3DwLjX7b3l2b37eNAxMPLwb3/kh8VKdA==}engines: {node: ^16.0.0 || >=18.0.0}@@ -1390,8 +1406,8 @@ packages:uri-js: 4.4.1dev: true- resolution: {integrity: sha512-StPCZLGPNG9KhXeNCrqTkIK09s7D6+8n0w754SRY8PUvDXFLLovrFFo4ubd82fytRWS5bFntsWA5SX4sODxuiw==}+ resolution: {integrity: sha512-lQDeuqMkEEzITT56NAXNOWxRXycqVyV62w3X7jVZQS9n+cznDx6RLJMD1cnWcRMfCdPUmAj07FAIR69ueytxDQ==}peerDependencies:react: ^17.0.0 || ^18.0.0react-dom: ^17.0.0 || ^18.0.0@@ -1554,10 +1570,10 @@ packages:engines: {node: '>=4'}dev: true- resolution: {integrity: sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==}+ resolution: {integrity: sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==}dependencies:- follow-redirects: 1.15.3+ follow-redirects: 1.15.5form-data: 4.0.0proxy-from-env: 1.1.0transitivePeerDependencies:@@ -2298,8 +2314,8 @@ packages:object.fromentries: 2.0.7dev: true- resolution: {integrity: sha512-AgaZCVuYDXHUGxj/ZGu1u8H8CYgDY3iG6w5kUFw4AzMVXzB7VvbKgYR4nATIN+OvUrghMbiDLeimVjVY5ilq3w==}+ resolution: {integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==}engines: {node: ^14.18.0 || >=16.0.0}peerDependencies:'@types/eslint': '>=8.0.0'@@ -2314,7 +2330,7 @@ packages:dependencies:eslint: 8.56.0eslint-config-prettier: 8.10.0([email protected])- prettier: 3.1.1+ prettier: 3.2.2prettier-linter-helpers: 1.0.0synckit: 0.8.6dev: true@@ -2582,8 +2598,8 @@ packages:resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==}dev: true- resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==}+ resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==}engines: {node: '>=4.0'}peerDependencies:debug: '*'@@ -3830,6 +3846,10 @@ packages:p-limit: 3.1.0dev: true+ resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==}+ dev: false+resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}engines: {node: '>=6'}@@ -3941,8 +3961,8 @@ packages:fast-diff: 1.3.0dev: true- resolution: {integrity: sha512-22UbSzg8luF4UuZtzgiUOfcGM8s4tjBv6dJRT7j275NXsy2jb4aJa4NNveul5x4eqlF1wuhuR2RElK71RvmVaw==}+ resolution: {integrity: sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==}engines: {node: '>=14'}hasBin: truedev: true@@ -4592,8 +4612,8 @@ packages:engines: {node: '>=8'}dev: true- resolution: {integrity: sha512-kLerFjTAABuEZ870O4q4dyT/VCOJC/HA08+VeIGhkiOKkwJLP17HAWHCiqZWnUMV19m3axlOKR/+/EbCbuJAZg==}+ resolution: {integrity: sha512-PQ6Dn+QxlWyEGCKDS71NGsXoVLKfE1c3vApkvDYS5KAK+V8fNWGhbSUEo9Gg2iaID2tjLXegEW3bZDUGpofRWw==}engines: {node: '>= 16'}peerDependencies:react: '>= 16.8.0'@@ -4608,7 +4628,7 @@ packages:react: 18.2.0react-dom: 18.2.0([email protected])shallowequal: 1.1.0- stylis: 4.3.0+ stylis: 4.3.1tslib: 2.5.0dev: false@@ -4630,8 +4650,8 @@ packages:react: 18.2.0dev: false- resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==}+ resolution: {integrity: sha512-EQepAV+wMsIaGVGX1RECzgrcqRRU/0sYOHkeLsZ3fzHaHXZy4DaOOX0vOlGQdlsjkh3mFHAIlVimpwAs4dslyQ==}dev: false@@ -4737,8 +4757,8 @@ packages:tslib: 2.6.2dev: false- resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}+ resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==}hasBin: truepeerDependencies:'@swc/core': '>=1.2.50'@@ -4942,10 +4962,10 @@ packages:use-isomorphic-layout-effect: 1.1.2(@types/[email protected])([email protected])dev: false- resolution: {integrity: sha512-bnwk2SlvLLpeJPkNYSGkc59q5YNV9V/fLDkSOAF2p7Xt0zw3iYHEmgEGkNYkK7zEIEyRFi5CczKsT7MN99UzVQ==}+ resolution: {integrity: sha512-uq5o2qFR1VRjHn8Of7Fl344/AGvgk7C5Mcb4aSb1ZRVp6PkgdXJJLdRrlSTJQVkkQcDuqFbFc3mDX4COg7mRTA==}peerDependencies:- react: ^16.8.0 || ^17.0.0 || ^18.0.0+ react: '>=16.8.0'dependencies:react: 18.2.0dev: false@@ -5124,8 +5144,8 @@ packages:optional: truedev: true- resolution: {integrity: sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==}+ resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==}engines: {node: '>=10.0.0'}peerDependencies:bufferutil: ^4.0.1diff --git a/public/assets/cursor.svg b/public/assets/cursor.svgnew file mode 100644index 00000000..205bea92--- /dev/null+++ b/public/assets/cursor.svg@@ -0,0 +1,10 @@+<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">+ <defs>+ <filter id="shadow" x="0" y="0" width="150%" height="150%">+ <feOffset result="offOut" in="SourceAlpha" dx="1" dy="1" />+ <feGaussianBlur result="blurOut" in="offOut" stdDeviation="1" />+ <feBlend in="SourceGraphic" in2="blurOut" mode="normal" />+ </filter>+ </defs>+ <path d="M5.65376 12.3673H5.46026L5.31717 12.4976L0.500002 16.8829L0.500002 1.19841L11.7841 12.3673H5.65376Z" fill="#000000" stroke="#E2E2E2" stroke-width="1" filter="url(#shadow)" />+</svg>diff --git a/src/components/PromptInput/index.tsx b/src/components/PromptInput/index.tsxindex fd13a988..4c371095 100644--- a/src/components/PromptInput/index.tsx+++ b/src/components/PromptInput/index.tsx@@ -1,28 +1,39 @@import React from "react";-import { ActionIcon, TextInput, Loader, Tooltip } from "@mantine/core";+import { ActionIcon, TextInput, Loader, Tooltip, HoverCard, Flex, Badge } from "@mantine/core";import { getHotkeyHandler } from "@mantine/hooks";import styled from "styled-components";import { FunctionsHttpError } from "@supabase/supabase-js";-import { toast } from "react-hot-toast";+import toast from "react-hot-toast";import { GoDependabot } from "react-icons/go";import { VscClose, VscQuestion } from "react-icons/vsc";import useJsonQuery from "src/hooks/useJsonQuery";import { supabase } from "src/lib/api/supabase";+import useConfig from "src/store/useConfig";import useUser from "src/store/useUser";const StyledPromptInput = styled(TextInput)`- .mantine-Input-input {+ .mantine-TextInput-wrapper {+ margin-bottom: 0;+ }+ .mantine-TextInput-input {font-weight: 500;background: ${({ theme }) => theme.PROMPT_BG};color: ${({ theme }) => theme.PROMPT_TEXT_COLOR};border: none;- border-bottom: 1px solid ${({ theme }) => theme.PROMPT_BORDER_COLOR};+ border-bottom: 1px solid+ ${({ theme, error }) => (error ? theme.DANGER : theme.PROMPT_BORDER_COLOR)};:focus-within {border-color: #15593a;}}+ .mantine-TextInput-error {+ padding: 4px;+ border-bottom: 1px solid ${({ theme }) => theme.DANGER};+ background: #280000;+ }+svg {color: ${({ theme }) => theme.PROMPT_TEXT_COLOR};}@@ -37,10 +48,12 @@ export const PromptInput = () => {const premium = useUser(state => state.premium);const [completing, setCompleting] = React.useState(false);const [prompt, setPrompt] = React.useState("");- const [promptVisible, setPromptVisible] = React.useState(true);+ const promptVisible = useConfig(state => state.aiEnabled);+ const [promptError, setPromptError] = React.useState<string | null>(null);const onSubmit = async () => {try {+ setPromptError(null);setCompleting(true);const jsonModel = await getJsonType();@@ -61,18 +74,19 @@ export const PromptInput = () => {if (match && match[1]) {const extractedString = match[1];updateJson(extractedString);+ toast.success(`${data.credits} credits left for today.`);} else {throw Error("An error occured while parsing result.");}} catch (error: any) {console.error(error);- if (error instanceof Error) toast.error(error.message);+ if (error instanceof Error) setPromptError(error.message);} finally {setCompleting(false);}};- if (!promptVisible) return null;+ if (!promptVisible || !premium) return null;return (<Tooltip.Floating@@ -86,32 +100,56 @@ export const PromptInput = () => {placeholder="Ask JSON Crack AI to transform the data"value={prompt}onChange={e => setPrompt(e.currentTarget.value)}- rightSectionWidth={60}maxLength={200}disabled={!premium || completing}onKeyDown={getHotkeyHandler([["Enter", onSubmit]])}onSubmit={onSubmit}+ error={+ promptError && (+ <Flex align="center" justify="space-between">+ {promptError}+ <ActionIcon+ size="xs"+ variant="transparent"+ title="Close Error"+ onClick={() => setPromptError(null)}+ >+ <VscClose color="red" />+ </ActionIcon>+ </Flex>+ )+ }rightSection={<>- <Tooltip- label="This feature is in the alpha phase, and its results may not always be accurate. Be cautious, as invalid actions still consume a token. We only process the schema of your JSON and do not process your data values."- maw={300}- multiline- withinPortal- fz="xs"- withArrow- >- <ActionIcon variant="transparent">- <VscQuestion />- </ActionIcon>- </Tooltip>- <ActionIcon- variant="transparent"- title="Close"- onClick={() => setPromptVisible(false)}- >- <VscClose />- </ActionIcon>+ <HoverCard withArrow withinPortal>+ <HoverCard.Target>+ <ActionIcon variant="transparent">+ <VscQuestion />+ </ActionIcon>+ </HoverCard.Target>+ <HoverCard.Dropdown maw={300} fz="xs">+ This feature is in the{" "}+ <Badge size="xs" radius={2} variant="light">+ alpha+ </Badge>{" "}+ phase, and its results may not always be accurate. Be cautious, as invalid actions+ still consume a credit. We only process the schema of your data and DO NOT process+ values.+ <br />+ <br />+ You receive <b>10 credits</b> daily, and you have the option to deactivate this+ feature in the settings located at the upper right corner of the editor.+ <br />+ <br />+ Examples:+ <li>+ <code>Retrieve members whose names begin with "M"</code>+ </li>+ <li>+ <code>Retrieve members with age older than 30</code>+ </li>+ </HoverCard.Dropdown>+ </HoverCard></>}leftSection={completing ? <Loader size="xs" /> : <GoDependabot strokeWidth={1} />}diff --git a/src/containers/Editor/JsonEditor.tsx b/src/containers/Editor/JsonEditor.tsxindex da0778f1..68c9e20d 100644--- a/src/containers/Editor/JsonEditor.tsx+++ b/src/containers/Editor/JsonEditor.tsx@@ -1,8 +1,7 @@import React from "react";import styled from "styled-components";import { MonacoEditor } from "src/components/MonacoEditor";--// import { PromptInput } from "src/components/PromptInput";+import { PromptInput } from "src/components/PromptInput";const StyledEditorWrapper = styled.div`display: flex;@@ -14,7 +13,7 @@ const StyledEditorWrapper = styled.div`export const JsonEditor: React.FC = () => {return (<StyledEditorWrapper>- {/* <PromptInput /> */}+ <PromptInput /><MonacoEditor /></StyledEditorWrapper>);diff --git a/src/containers/Editor/LiveEditor.tsx b/src/containers/Editor/LiveEditor.tsxindex f8e4f9bd..19af9625 100644--- a/src/containers/Editor/LiveEditor.tsx+++ b/src/containers/Editor/LiveEditor.tsx@@ -12,6 +12,7 @@ const StyledLiveEditor = styled.div`height: 100%;background: ${({ theme }) => theme.GRID_BG_COLOR};overflow: auto;+ cursor: url("/assets/cursor.svg"), auto;& > ul {margin-top: 0 !important;diff --git a/src/containers/Modals/CloudModal/index.tsx b/src/containers/Modals/CloudModal/index.tsxindex 484e2d26..69e10d73 100644--- a/src/containers/Modals/CloudModal/index.tsx+++ b/src/containers/Modals/CloudModal/index.tsx@@ -20,6 +20,7 @@ import {RingProgress,UnstyledButton,Drawer,+ LoadingOverlay,} from "@mantine/core";import { useQuery } from "@tanstack/react-query";import dayjs from "dayjs";@@ -93,7 +94,8 @@ export const CloudModal: React.FC<ModalProps> = ({ opened, onClose }) => {const getFormat = useFile(state => state.getFormat);const [currentFile, setCurrentFile] = React.useState<File | null>(null);const { isReady, query, replace } = useRouter();- const { data, refetch } = useQuery(["allJson", query], () => documentSvc.getAll(), {++ const { data, isLoading, refetch } = useQuery(["allJson", query], () => documentSvc.getAll(), {enabled: isReady && opened,});@@ -212,7 +214,9 @@ export const CloudModal: React.FC<ModalProps> = ({ opened, onClose }) => {size="xl"onClose={onClose}transitionProps={{ duration: 300, timingFunction: "ease", transition: "slide-right" }}+ pos="relative">+ <LoadingOverlay visible={isLoading} />{data && (<Flex gap="md"><Paper my="lg" withBorder radius="md" p="xs" w="100%">diff --git a/src/containers/Modals/TypeModal/index.tsx b/src/containers/Modals/TypeModal/index.tsxindex 718cdd6d..02dbbc3e 100644--- a/src/containers/Modals/TypeModal/index.tsx+++ b/src/containers/Modals/TypeModal/index.tsx@@ -1,5 +1,5 @@import React from "react";-import { Stack, Modal, ModalProps, ScrollArea, Select } from "@mantine/core";+import { Stack, Modal, ModalProps, Select, LoadingOverlay } from "@mantine/core";import { CodeHighlight } from "@mantine/code-highlight";import useJson from "src/store/useJson";@@ -49,6 +49,7 @@ export const TypeModal: React.FC<ModalProps> = ({ opened, onClose }) => {const getJson = useJson(state => state.getJson);const [type, setType] = React.useState("");const [selectedType, setSelectedType] = React.useState<Language>(Language.TypeScript);+ const [loading, setLoading] = React.useState(false);const editorLanguage = React.useMemo(() => {return typeOptions[typeOptions.findIndex(o => o.value === selectedType)]?.lang;@@ -70,35 +71,41 @@ export const TypeModal: React.FC<ModalProps> = ({ opened, onClose }) => {React.useEffect(() => {if (opened) {- if (selectedType === Language.Go) {- import("src/lib/utils/json2go").then(jtg => {- import("gofmt.js").then(gofmt => {- const types = jtg.default(getJson());- setType(gofmt.default(types.go));+ try {+ setLoading(true);+ if (selectedType === Language.Go) {+ import("src/lib/utils/json2go").then(jtg => {+ import("gofmt.js").then(gofmt => {+ const types = jtg.default(getJson());+ setType(gofmt.default(types.go));+ });});- });- } else {- transformer({ value: getJson() }).then(setType);+ } else {+ transformer({ value: getJson() }).then(setType);+ }+ } catch (error) {+ console.error(error);+ } finally {+ setLoading(false);}}}, [getJson, opened, selectedType, transformer]);return (- <Modal title="Generate Types" size="auto" opened={opened} onClose={onClose} centered>- <Stack>+ <Modal title="Generate Types" size="md" opened={opened} onClose={onClose} centered>+ <Stack pos="relative"><Selectvalue={selectedType}data={typeOptions}onChange={e => setSelectedType(e as Language)}/>- <ScrollArea h={400} offsetScrollbars>- <CodeHighlight- language={editorLanguage}- copyLabel="Copy to clipboard"- copiedLabel="Copied to clipboard"- code={type}- />- </ScrollArea>+ <LoadingOverlay visible={loading} />+ <CodeHighlight+ language={editorLanguage}+ copyLabel="Copy to clipboard"+ copiedLabel="Copied to clipboard"+ code={type}+ /></Stack></Modal>);diff --git a/src/containers/Toolbar/AccountMenu.tsx b/src/containers/Toolbar/AccountMenu.tsxindex b1be43a1..acaae3a6 100644--- a/src/containers/Toolbar/AccountMenu.tsx+++ b/src/containers/Toolbar/AccountMenu.tsx@@ -30,7 +30,7 @@ export const AccountMenu = () => {onClick={() => setVisible("account")(true)}closeMenuOnClick>- <Text size="xs">Account</Text>+ <Text size="xs">{user.user_metadata?.name ?? "Account"}</Text></Menu.Item>) : (<Link href="/sign-in">diff --git a/src/containers/Toolbar/OptionsMenu.tsx b/src/containers/Toolbar/OptionsMenu.tsxindex 4383349a..f01243c7 100644--- a/src/containers/Toolbar/OptionsMenu.tsx+++ b/src/containers/Toolbar/OptionsMenu.tsx@@ -1,17 +1,20 @@import React from "react";-import { Menu, Text, Flex } from "@mantine/core";+import { Menu, Text, Flex, Badge } from "@mantine/core";import { BsCheck2 } from "react-icons/bs";import { MdSettings } from "react-icons/md";import useConfig from "src/store/useConfig";+import useUser from "src/store/useUser";import * as Styles from "./styles";export const OptionsMenu = () => {+ const premium = useUser(state => state.premium);const toggleGestures = useConfig(state => state.toggleGestures);const toggleChildrenCount = useConfig(state => state.toggleChildrenCount);const toggleDarkMode = useConfig(state => state.toggleDarkMode);const toggleRulers = useConfig(state => state.toggleRulers);const toggleCollapseButton = useConfig(state => state.toggleCollapseButton);const toggleImagePreview = useConfig(state => state.toggleImagePreview);+ const toggleAI = useConfig(state => state.toggleAI);const gesturesEnabled = useConfig(state => state.gesturesEnabled);const childrenCountVisible = useConfig(state => state.childrenCountVisible);@@ -19,6 +22,7 @@ export const OptionsMenu = () => {const rulersEnabled = useConfig(state => state.rulersEnabled);const collapseButtonVisible = useConfig(state => state.collapseButtonVisible);const imagePreviewEnabled = useConfig(state => state.imagePreviewEnabled);+ const aiEnabled = useConfig(state => state.aiEnabled);return (<Menu shadow="md" trigger="click" closeOnItemClick={false} withArrow>@@ -66,6 +70,19 @@ export const OptionsMenu = () => {><Text size="xs">Dark Mode</Text></Menu.Item>+ {premium && (+ <Menu.Item+ leftSection={<BsCheck2 opacity={aiEnabled ? 100 : 0} />}+ onClick={() => toggleAI(!aiEnabled)}+ >+ <Text size="xs">+ JSON Crack AI{" "}+ <Badge ml={2} size="xs" variant="light" radius={2}>+ Alpha+ </Badge>+ </Text>+ </Menu.Item>+ )}</Menu.Dropdown></Menu>);diff --git a/src/containers/Toolbar/index.tsx b/src/containers/Toolbar/index.tsxindex 2c99b11f..36c65d6e 100644--- a/src/containers/Toolbar/index.tsx+++ b/src/containers/Toolbar/index.tsx@@ -2,8 +2,8 @@ import React from "react";import { Flex, Group, Select, Text } from "@mantine/core";import toast from "react-hot-toast";import { AiOutlineFullscreen } from "react-icons/ai";+import { AiFillGift } from "react-icons/ai";import { FiDownload } from "react-icons/fi";-import { MdWorkspacePremium } from "react-icons/md";import { SearchInput } from "src/components/SearchInput";import { FileFormat } from "src/enums/file.enum";import { JSONCrackLogo } from "src/layout/JsonCrackLogo";@@ -92,7 +92,7 @@ export const Toolbar: React.FC<{ isWidget?: boolean }> = ({ isWidget = false }){!premium && !isWidget && (<Styles.StyledToolElement onClick={() => setVisible("premium")(true)}><Text display="flex" c="teal" fz="xs" fw="bold" style={{ textAlign: "center", gap: 4 }}>- <MdWorkspacePremium size="18" />+ <AiFillGift size="18" />Get Premium</Text></Styles.StyledToolElement>diff --git a/src/containers/Views/GraphView/index.tsx b/src/containers/Views/GraphView/index.tsxindex 6bbcd861..0f8fdb2c 100644--- a/src/containers/Views/GraphView/index.tsx+++ b/src/containers/Views/GraphView/index.tsx@@ -54,6 +54,10 @@ const StyledEditorWrapper = styled.div<{ $widget: boolean; $showRulers: boolean20px 20px;`};+ .jsoncrack-space {+ cursor: url("/assets/cursor.svg"), auto;+ }+:active {cursor: move;}@@ -205,6 +209,7 @@ export const Graph = ({ isWidget = false }: GraphProps) => {onContextMenu={e => e.preventDefault()}treatTwoFingerTrackPadGesturesLikeTouch={gesturesEnabled}pollForElementResizing+ className="jsoncrack-space"><GraphCanvas isWidget={isWidget} /></Space>diff --git a/src/containers/Views/TreeView/Label.tsx b/src/containers/Views/TreeView/Label.tsxindex 2ae57c30..f9cecace 100644--- a/src/containers/Views/TreeView/Label.tsx+++ b/src/containers/Views/TreeView/Label.tsx@@ -61,7 +61,7 @@ export const Label = ({}}leftSection={<VscEdit size="12" />}>- Click to edit+ Edit</Button></HoverCard.Dropdown></HoverCard>diff --git a/src/store/useConfig.ts b/src/store/useConfig.tsindex 898bd66f..d4fa3ef5 100644--- a/src/store/useConfig.ts+++ b/src/store/useConfig.ts@@ -12,6 +12,7 @@ const initialStates = {gesturesEnabled: false,rulersEnabled: true,viewMode: ViewMode.Graph,+ aiEnabled: true,};export interface ConfigActions {@@ -23,12 +24,14 @@ export interface ConfigActions {toggleGestures: (value: boolean) => void;toggleRulers: (value: boolean) => void;setViewMode: (value: ViewMode) => void;+ toggleAI: (value: boolean) => void;}const useConfig = create(persist<typeof initialStates & ConfigActions>(set => ({...initialStates,+ toggleAI: aiEnabled => set({ aiEnabled }),toggleRulers: rulersEnabled => set({ rulersEnabled }),toggleGestures: gesturesEnabled => set({ gesturesEnabled }),toggleLiveTransform: liveTransformEnabled => set({ liveTransformEnabled }),