diff --git a/package-lock.json b/package-lock.json index 489548d..9774bc1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "graphiql-app-rs-react-2023-q1", "version": "0.0.1", "dependencies": { + "@codemirror/lang-javascript": "^6.1.8", "@emotion/react": "^11.11.0", "@fontsource/inter": "^4.5.15", "@mantine/core": "^6.0.10", @@ -15,6 +16,10 @@ "@mantine/hooks": "^6.0.10", "@mantine/notifications": "^6.0.11", "@tabler/icons-react": "^2.18.0", + "@tanstack/react-query": "^4.29.11", + "@uiw/codemirror-theme-github": "^4.20.2", + "@uiw/react-codemirror": "^4.20.2", + "axios": "^1.4.0", "firebase": "^9.22.0", "i18next": "^22.5.0", "i18next-http-backend": "^2.2.1", @@ -23,7 +28,8 @@ "react-firebase-hooks": "^5.1.1", "react-i18next": "^12.3.1", "react-router-dom": "^6.11.1", - "zod": "^3.21.4" + "zod": "^3.21.4", + "zustand": "^4.3.8" }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.1.1", @@ -521,6 +527,107 @@ "node": ">=6.9.0" } }, + "node_modules/@codemirror/autocomplete": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.7.1.tgz", + "integrity": "sha512-hSxf9S0uB+GV+gBsjY1FZNo53e1FFdzPceRfCfD1gWOnV6o21GfB5J5Wg9G/4h76XZMPrF0A6OCK/Rz5+V1egg==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.6.0", + "@lezer/common": "^1.0.0" + }, + "peerDependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/commands": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.4.tgz", + "integrity": "sha512-42lmDqVH0ttfilLShReLXsDfASKLXzfyC36bzwcqzox9PlHulMcsUOfHXNo2X2aFMVNUoQ7j+d4q5bnfseYoOA==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.2.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/lang-javascript": { + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.1.8.tgz", + "integrity": "sha512-5cIA6IOkslTu1DtldcYnj7hsBm3p+cD37qSaKvW1kV16M6q9ysKvKrveCOWgbrj4+ilSWRL2JtSLudbeB158xg==", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, + "node_modules/@codemirror/language": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.7.0.tgz", + "integrity": "sha512-4SMwe6Fwn57klCUsVN0y4/h/iWT+XIXFEmop2lIHHuWO0ubjCrF3suqSZLyOQlznxkNnNbOOfKe5HQbQGCAmTg==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "node_modules/@codemirror/lint": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.2.1.tgz", + "integrity": "sha512-y1muai5U/uUPAGRyHMx9mHuHLypPcHWxzlZGknp/U5Mdb5Ol8Q5ZLp67UqyTbNFJJ3unVxZ8iX3g1fMN79S1JQ==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/search": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.4.0.tgz", + "integrity": "sha512-zMDgaBXah+nMLK2dHz9GdCnGbQu+oaGRXS1qviqNZkvOCv/whp5XZFyoikLp/23PM9RBcbuKUUISUmQHM1eRHw==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/state": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.2.1.tgz", + "integrity": "sha512-RupHSZ8+OjNT38zU9fKH2sv+Dnlr8Eb8sl4NOnnqz95mCFTZUaiRP8Xv5MeeaG0px2b8Bnfe7YGwCV3nsBhbuw==" + }, + "node_modules/@codemirror/theme-one-dark": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz", + "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/highlight": "^1.0.0" + } + }, + "node_modules/@codemirror/view": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.12.0.tgz", + "integrity": "sha512-xNHvbJBc2v8JuEcIGOck6EUGShpP+TYGCEMVEVQMYxbFXfMhYnoF3znxB/2GgeKR0nrxBs+nhBupiTYQqCp2kw==", + "dependencies": { + "@codemirror/state": "^6.1.4", + "style-mod": "^4.0.0", + "w3c-keyname": "^2.2.4" + } + }, "node_modules/@emotion/babel-plugin": { "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", @@ -1818,6 +1925,36 @@ "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", "dev": true }, + "node_modules/@lezer/common": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.0.2.tgz", + "integrity": "sha512-SVgiGtMnMnW3ActR8SXgsDhw7a0w0ChHSYAyAUxxrOiJ1OqYWEKk/xJd84tTSPo1mo6DXLObAJALNnd0Hrv7Ng==" + }, + "node_modules/@lezer/highlight": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.1.6.tgz", + "integrity": "sha512-cmSJYa2us+r3SePpRCjN5ymCqCPv+zyXmDl0ciWtVaNiORT/MxM7ZgOMQZADD0o51qOaOg24qc/zBViOIwAjJg==", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@lezer/javascript": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.3.tgz", + "integrity": "sha512-k7Eo9z9B1supZ5cCD4ilQv/RZVN30eUQL+gGbr6ybrEY3avBAL5MDiYi2aa23Aj0A79ry4rJRvPAwE2TM8bd+A==", + "dependencies": { + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, + "node_modules/@lezer/lr": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.5.tgz", + "integrity": "sha512-Kye0rxYBi+OdToLUN2tQfeH5VIrpESC6XznuvxmIxbO1lz6M1C90vkjMNYoX1SfbUcuvoPXvLYsBquZ//77zVQ==", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, "node_modules/@mantine/core": { "version": "6.0.11", "resolved": "https://registry.npmjs.org/@mantine/core/-/core-6.0.11.tgz", @@ -2400,6 +2537,41 @@ "react": "^16.5.1 || ^17.0.0 || ^18.0.0" } }, + "node_modules/@tanstack/query-core": { + "version": "4.29.11", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-4.29.11.tgz", + "integrity": "sha512-8C+hF6SFAb/TlFZyS9FItgNwrw4PMa7YeX+KQYe2ZAiEz6uzg6yIr+QBzPkUwZ/L0bXvGd1sufTm3wotoz+GwQ==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, + "node_modules/@tanstack/react-query": { + "version": "4.29.11", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-4.29.11.tgz", + "integrity": "sha512-aLaOAhBnCr12YKPjDsZOc0fAtkyaW7f9KfVfw49oYpfe0H9EPXBUgDBIKJ8qdHF3uGzTVSMcmpiw1Za41BLZlw==", + "dependencies": { + "@tanstack/query-core": "4.29.11", + "use-sync-external-store": "^1.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-native": "*" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, "node_modules/@trivago/prettier-plugin-sort-imports": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.1.1.tgz", @@ -2689,6 +2861,74 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@uiw/codemirror-extensions-basic-setup": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-extensions-basic-setup/-/codemirror-extensions-basic-setup-4.20.2.tgz", + "integrity": "sha512-8oF7ICSEoJVjn9MNKLsY5BaxGsFS/Qh8AMHa/0hZP1fExeI+LKhaaSfHbdRk8RpYE5Ffjtx+tBQfh22YBiv5dQ==", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + }, + "peerDependencies": { + "@codemirror/autocomplete": ">=6.0.0", + "@codemirror/commands": ">=6.0.0", + "@codemirror/language": ">=6.0.0", + "@codemirror/lint": ">=6.0.0", + "@codemirror/search": ">=6.0.0", + "@codemirror/state": ">=6.0.0", + "@codemirror/view": ">=6.0.0" + } + }, + "node_modules/@uiw/codemirror-theme-github": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-theme-github/-/codemirror-theme-github-4.20.2.tgz", + "integrity": "sha512-nSc6Tn3SvTJ4esP0d2wsCKmfG0TyQii01jfnsUjYxthJ9t4RghuxgOa12bLNsd42hsA6JUtugO5TTDv1O1URjg==", + "dependencies": { + "@uiw/codemirror-themes": "4.20.2" + } + }, + "node_modules/@uiw/codemirror-themes": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-themes/-/codemirror-themes-4.20.2.tgz", + "integrity": "sha512-ymETGtpeC7Uq5lH844DQ9pjSHKytFLODWmYUP7CQNZJipHkQ3h0NciQvAXN759Beg9BKyuq7v6wptOrA1GEhAQ==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + }, + "peerDependencies": { + "@codemirror/language": ">=6.0.0", + "@codemirror/state": ">=6.0.0", + "@codemirror/view": ">=6.0.0" + } + }, + "node_modules/@uiw/react-codemirror": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-4.20.2.tgz", + "integrity": "sha512-Rf6i9HgtNnYAVRBb1gfWlhiiOBrEPuIfHLn87cV9XPpjP+YtqZoP6VMMlMq4XFTbZ/E1GIxnSUgJMQToTth0iw==", + "dependencies": { + "@babel/runtime": "^7.18.6", + "@codemirror/commands": "^6.1.0", + "@codemirror/state": "^6.1.1", + "@codemirror/theme-one-dark": "^6.0.0", + "@uiw/codemirror-extensions-basic-setup": "4.20.2", + "codemirror": "^6.0.0" + }, + "peerDependencies": { + "@babel/runtime": ">=7.11.0", + "@codemirror/state": ">=6.0.0", + "@codemirror/theme-one-dark": ">=6.0.0", + "@codemirror/view": ">=6.0.0", + "codemirror": ">=6.0.0", + "react": ">=16.8.0", + "react-dom": ">=16.8.0" + } + }, "node_modules/@vitejs/plugin-react": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.0.0.tgz", @@ -2902,6 +3142,11 @@ "node": ">=8" } }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, "node_modules/available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", @@ -2914,6 +3159,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/axios": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "node_modules/babel-plugin-macros": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", @@ -3187,6 +3442,20 @@ "node": ">=6" } }, + "node_modules/codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, "node_modules/color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -3206,6 +3475,17 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/commander": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", @@ -3241,6 +3521,11 @@ "node": ">=10" } }, + "node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==" + }, "node_modules/cross-fetch": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz", @@ -3326,6 +3611,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", @@ -4127,6 +4420,25 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, "node_modules/for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -4136,6 +4448,19 @@ "is-callable": "^1.1.3" } }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/fs-extra": { "version": "11.1.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", @@ -5408,6 +5733,25 @@ "node": ">=8.6" } }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -5917,6 +6261,11 @@ "pbts": "bin/pbts" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -6644,6 +6993,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/style-mod": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.3.tgz", + "integrity": "sha512-78Jv8kYJdjbvRwwijtCevYADfsI0lGzYJe4mMFdceO8l75DFFDoqBhR1jVDicDRRaX4//g1u9wKeo+ztc2h1Rw==" + }, "node_modules/stylis": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", @@ -6963,6 +7317,14 @@ } } }, + "node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/vite": { "version": "4.3.5", "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.5.tgz", @@ -7271,6 +7633,11 @@ "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==", "dev": true }, + "node_modules/w3c-keyname": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.7.tgz", + "integrity": "sha512-XB8aa62d4rrVfoZYQaYNy3fy+z4nrfy2ooea3/0BnBzXW0tSdZ+lRgjzBZhk0La0H6h8fVyYCxx/qkQcAIuvfg==" + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -7536,6 +7903,29 @@ "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "node_modules/zustand": { + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.3.8.tgz", + "integrity": "sha512-4h28KCkHg5ii/wcFFJ5Fp+k1J3gJoasaIbppdgZFO4BPJnsNxL0mQXBSFgOgAdCdBj35aDTPvdAJReTMntFPGg==", + "dependencies": { + "use-sync-external-store": "1.2.0" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "immer": ">=9.0", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } } }, "dependencies": { @@ -7901,6 +8291,101 @@ "to-fast-properties": "^2.0.0" } }, + "@codemirror/autocomplete": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.7.1.tgz", + "integrity": "sha512-hSxf9S0uB+GV+gBsjY1FZNo53e1FFdzPceRfCfD1gWOnV6o21GfB5J5Wg9G/4h76XZMPrF0A6OCK/Rz5+V1egg==", + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.6.0", + "@lezer/common": "^1.0.0" + } + }, + "@codemirror/commands": { + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.2.4.tgz", + "integrity": "sha512-42lmDqVH0ttfilLShReLXsDfASKLXzfyC36bzwcqzox9PlHulMcsUOfHXNo2X2aFMVNUoQ7j+d4q5bnfseYoOA==", + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.2.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + } + }, + "@codemirror/lang-javascript": { + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/@codemirror/lang-javascript/-/lang-javascript-6.1.8.tgz", + "integrity": "sha512-5cIA6IOkslTu1DtldcYnj7hsBm3p+cD37qSaKvW1kV16M6q9ysKvKrveCOWgbrj4+ilSWRL2JtSLudbeB158xg==", + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/language": "^6.6.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0", + "@lezer/javascript": "^1.0.0" + } + }, + "@codemirror/language": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.7.0.tgz", + "integrity": "sha512-4SMwe6Fwn57klCUsVN0y4/h/iWT+XIXFEmop2lIHHuWO0ubjCrF3suqSZLyOQlznxkNnNbOOfKe5HQbQGCAmTg==", + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "@codemirror/lint": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.2.1.tgz", + "integrity": "sha512-y1muai5U/uUPAGRyHMx9mHuHLypPcHWxzlZGknp/U5Mdb5Ol8Q5ZLp67UqyTbNFJJ3unVxZ8iX3g1fMN79S1JQ==", + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/search": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.4.0.tgz", + "integrity": "sha512-zMDgaBXah+nMLK2dHz9GdCnGbQu+oaGRXS1qviqNZkvOCv/whp5XZFyoikLp/23PM9RBcbuKUUISUmQHM1eRHw==", + "requires": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "@codemirror/state": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.2.1.tgz", + "integrity": "sha512-RupHSZ8+OjNT38zU9fKH2sv+Dnlr8Eb8sl4NOnnqz95mCFTZUaiRP8Xv5MeeaG0px2b8Bnfe7YGwCV3nsBhbuw==" + }, + "@codemirror/theme-one-dark": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/@codemirror/theme-one-dark/-/theme-one-dark-6.1.2.tgz", + "integrity": "sha512-F+sH0X16j/qFLMAfbciKTxVOwkdAS336b7AXTKOZhy8BR3eH/RelsnLgLFINrpST63mmN2OuwUt0W2ndUgYwUA==", + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/highlight": "^1.0.0" + } + }, + "@codemirror/view": { + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.12.0.tgz", + "integrity": "sha512-xNHvbJBc2v8JuEcIGOck6EUGShpP+TYGCEMVEVQMYxbFXfMhYnoF3znxB/2GgeKR0nrxBs+nhBupiTYQqCp2kw==", + "requires": { + "@codemirror/state": "^6.1.4", + "style-mod": "^4.0.0", + "w3c-keyname": "^2.2.4" + } + }, "@emotion/babel-plugin": { "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", @@ -8837,6 +9322,36 @@ } } }, + "@lezer/common": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.0.2.tgz", + "integrity": "sha512-SVgiGtMnMnW3ActR8SXgsDhw7a0w0ChHSYAyAUxxrOiJ1OqYWEKk/xJd84tTSPo1mo6DXLObAJALNnd0Hrv7Ng==" + }, + "@lezer/highlight": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.1.6.tgz", + "integrity": "sha512-cmSJYa2us+r3SePpRCjN5ymCqCPv+zyXmDl0ciWtVaNiORT/MxM7ZgOMQZADD0o51qOaOg24qc/zBViOIwAjJg==", + "requires": { + "@lezer/common": "^1.0.0" + } + }, + "@lezer/javascript": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@lezer/javascript/-/javascript-1.4.3.tgz", + "integrity": "sha512-k7Eo9z9B1supZ5cCD4ilQv/RZVN30eUQL+gGbr6ybrEY3avBAL5MDiYi2aa23Aj0A79ry4rJRvPAwE2TM8bd+A==", + "requires": { + "@lezer/highlight": "^1.1.3", + "@lezer/lr": "^1.3.0" + } + }, + "@lezer/lr": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.5.tgz", + "integrity": "sha512-Kye0rxYBi+OdToLUN2tQfeH5VIrpESC6XznuvxmIxbO1lz6M1C90vkjMNYoX1SfbUcuvoPXvLYsBquZ//77zVQ==", + "requires": { + "@lezer/common": "^1.0.0" + } + }, "@mantine/core": { "version": "6.0.11", "resolved": "https://registry.npmjs.org/@mantine/core/-/core-6.0.11.tgz", @@ -9227,6 +9742,20 @@ "prop-types": "^15.7.2" } }, + "@tanstack/query-core": { + "version": "4.29.11", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-4.29.11.tgz", + "integrity": "sha512-8C+hF6SFAb/TlFZyS9FItgNwrw4PMa7YeX+KQYe2ZAiEz6uzg6yIr+QBzPkUwZ/L0bXvGd1sufTm3wotoz+GwQ==" + }, + "@tanstack/react-query": { + "version": "4.29.11", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-4.29.11.tgz", + "integrity": "sha512-aLaOAhBnCr12YKPjDsZOc0fAtkyaW7f9KfVfw49oYpfe0H9EPXBUgDBIKJ8qdHF3uGzTVSMcmpiw1Za41BLZlw==", + "requires": { + "@tanstack/query-core": "4.29.11", + "use-sync-external-store": "^1.2.0" + } + }, "@trivago/prettier-plugin-sort-imports": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/@trivago/prettier-plugin-sort-imports/-/prettier-plugin-sort-imports-4.1.1.tgz", @@ -9417,6 +9946,51 @@ "eslint-visitor-keys": "^3.3.0" } }, + "@uiw/codemirror-extensions-basic-setup": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-extensions-basic-setup/-/codemirror-extensions-basic-setup-4.20.2.tgz", + "integrity": "sha512-8oF7ICSEoJVjn9MNKLsY5BaxGsFS/Qh8AMHa/0hZP1fExeI+LKhaaSfHbdRk8RpYE5Ffjtx+tBQfh22YBiv5dQ==", + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, + "@uiw/codemirror-theme-github": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-theme-github/-/codemirror-theme-github-4.20.2.tgz", + "integrity": "sha512-nSc6Tn3SvTJ4esP0d2wsCKmfG0TyQii01jfnsUjYxthJ9t4RghuxgOa12bLNsd42hsA6JUtugO5TTDv1O1URjg==", + "requires": { + "@uiw/codemirror-themes": "4.20.2" + } + }, + "@uiw/codemirror-themes": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-themes/-/codemirror-themes-4.20.2.tgz", + "integrity": "sha512-ymETGtpeC7Uq5lH844DQ9pjSHKytFLODWmYUP7CQNZJipHkQ3h0NciQvAXN759Beg9BKyuq7v6wptOrA1GEhAQ==", + "requires": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, + "@uiw/react-codemirror": { + "version": "4.20.2", + "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-4.20.2.tgz", + "integrity": "sha512-Rf6i9HgtNnYAVRBb1gfWlhiiOBrEPuIfHLn87cV9XPpjP+YtqZoP6VMMlMq4XFTbZ/E1GIxnSUgJMQToTth0iw==", + "requires": { + "@babel/runtime": "^7.18.6", + "@codemirror/commands": "^6.1.0", + "@codemirror/state": "^6.1.1", + "@codemirror/theme-one-dark": "^6.0.0", + "@uiw/codemirror-extensions-basic-setup": "4.20.2", + "codemirror": "^6.0.0" + } + }, "@vitejs/plugin-react": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.0.0.tgz", @@ -9570,12 +10144,27 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, "available-typed-arrays": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "dev": true }, + "axios": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.4.0.tgz", + "integrity": "sha512-S4XCWMEmzvo64T9GfvQDOXgYRDJ/wsSZc7Jvdgx5u1sd0JwsuPLqb3SYmusag+edF6ziyMensPVqLTSc1PiSEA==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, "babel-plugin-macros": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz", @@ -9762,6 +10351,20 @@ "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.1.1.tgz", "integrity": "sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA==" }, + "codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "requires": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -9781,6 +10384,14 @@ "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", "dev": true }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, "commander": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", @@ -9810,6 +10421,11 @@ "yaml": "^1.10.0" } }, + "crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==" + }, "cross-fetch": { "version": "3.1.6", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz", @@ -9869,6 +10485,11 @@ "object-keys": "^1.1.1" } }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, "detect-node-es": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/detect-node-es/-/detect-node-es-1.1.0.tgz", @@ -10485,6 +11106,11 @@ "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" + }, "for-each": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", @@ -10494,6 +11120,16 @@ "is-callable": "^1.1.3" } }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, "fs-extra": { "version": "11.1.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", @@ -11401,6 +12037,19 @@ "picomatch": "^2.3.1" } }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, "mimic-fn": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", @@ -11735,6 +12384,11 @@ "long": "^4.0.0" } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "punycode": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", @@ -12199,6 +12853,11 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, + "style-mod": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.3.tgz", + "integrity": "sha512-78Jv8kYJdjbvRwwijtCevYADfsI0lGzYJe4mMFdceO8l75DFFDoqBhR1jVDicDRRaX4//g1u9wKeo+ztc2h1Rw==" + }, "stylis": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", @@ -12400,6 +13059,12 @@ "tslib": "^2.0.0" } }, + "use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "requires": {} + }, "vite": { "version": "4.3.5", "resolved": "https://registry.npmjs.org/vite/-/vite-4.3.5.tgz", @@ -12584,6 +13249,11 @@ "integrity": "sha512-eOpPHogvorZRobNqJGhapa0JdwaxpjVvyBp0QIUMRMSf8ZAlqOdEquKuRmw9Qwu0qXtJIWqFtMkmvJjUZmMjVA==", "dev": true }, + "w3c-keyname": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.7.tgz", + "integrity": "sha512-XB8aa62d4rrVfoZYQaYNy3fy+z4nrfy2ooea3/0BnBzXW0tSdZ+lRgjzBZhk0La0H6h8fVyYCxx/qkQcAIuvfg==" + }, "webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -12781,6 +13451,14 @@ "version": "3.21.4", "resolved": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz", "integrity": "sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==" + }, + "zustand": { + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.3.8.tgz", + "integrity": "sha512-4h28KCkHg5ii/wcFFJ5Fp+k1J3gJoasaIbppdgZFO4BPJnsNxL0mQXBSFgOgAdCdBj35aDTPvdAJReTMntFPGg==", + "requires": { + "use-sync-external-store": "1.2.0" + } } } } diff --git a/package.json b/package.json index 3edc3b0..3f03a00 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ ] }, "dependencies": { + "@codemirror/lang-javascript": "^6.1.8", "@emotion/react": "^11.11.0", "@fontsource/inter": "^4.5.15", "@mantine/core": "^6.0.10", @@ -29,6 +30,10 @@ "@mantine/hooks": "^6.0.10", "@mantine/notifications": "^6.0.11", "@tabler/icons-react": "^2.18.0", + "@tanstack/react-query": "^4.29.11", + "@uiw/codemirror-theme-github": "^4.20.2", + "@uiw/react-codemirror": "^4.20.2", + "axios": "^1.4.0", "firebase": "^9.22.0", "i18next": "^22.5.0", "i18next-http-backend": "^2.2.1", @@ -37,7 +42,8 @@ "react-firebase-hooks": "^5.1.1", "react-i18next": "^12.3.1", "react-router-dom": "^6.11.1", - "zod": "^3.21.4" + "zod": "^3.21.4", + "zustand": "^4.3.8" }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.1.1", diff --git a/src/App.tsx b/src/App.tsx index b976509..ed6b039 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,25 +1,24 @@ import { RouterProvider, createBrowserRouter } from 'react-router-dom'; -import { useAppColorScheme } from '@hooks'; -import { ColorSchemeProvider, MantineProvider } from '@mantine/core'; +import { MantineProvider } from '@mantine/core'; import { Notifications } from '@mantine/notifications'; import { routes } from '@routes'; +import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { theme } from '@theme'; import './i18n'; const router = createBrowserRouter(routes); +const queryClient = new QueryClient(); const App = () => { - const [colorScheme, toggleColorScheme] = useAppColorScheme(); - return ( - - + + - + ); }; diff --git a/src/api/.gitkeep b/src/api/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/api/api.ts b/src/api/api.ts new file mode 100644 index 0000000..b54c760 --- /dev/null +++ b/src/api/api.ts @@ -0,0 +1,17 @@ +import { API_SETTINGS } from '@constants'; +import axios from 'axios'; + +const queryData = async (query: string) => { + const response = await axios({ + method: 'POST', + url: API_SETTINGS.API_BASE_URL, + headers: { + 'Content-Type': 'application/json', + }, + data: JSON.stringify({ query }), + }); + + return response.data; +}; + +export default queryData; diff --git a/src/components/CodeEditor/CodeEditor.styles.tsx b/src/components/CodeEditor/CodeEditor.styles.tsx new file mode 100644 index 0000000..9af9d9d --- /dev/null +++ b/src/components/CodeEditor/CodeEditor.styles.tsx @@ -0,0 +1,22 @@ +import { createStyles } from '@mantine/core'; + +const useStyles = createStyles((theme) => ({ + editor: { + height: '100%', + overflowY: 'auto', + + '.cm-editor': { + height: '100%', + }, + + '.cm-scroller': { + backgroundColor: theme.colors.gray[1], + }, + + '.cm-activeLine': { + backgroundColor: 'transparent', + }, + }, +})); + +export default useStyles; diff --git a/src/components/CodeEditor/CodeEditor.tsx b/src/components/CodeEditor/CodeEditor.tsx new file mode 100644 index 0000000..fb4e637 --- /dev/null +++ b/src/components/CodeEditor/CodeEditor.tsx @@ -0,0 +1,34 @@ +import { javascript } from '@codemirror/lang-javascript'; +import { Box } from '@mantine/core'; +import { githubLight } from '@uiw/codemirror-theme-github'; +import ReactCodeMirror from '@uiw/react-codemirror'; + +import useStyles from './CodeEditor.styles'; + +type CodeEditorType = { + code: string; + isActive: boolean; + onChange?: (code: string) => void; +}; + +const CodeEditor = ({ code, isActive, onChange }: CodeEditorType) => { + const { classes } = useStyles(); + + return ( + + ); +}; + +export default CodeEditor; diff --git a/src/components/EditorTab/EditorTab.styles.tsx b/src/components/EditorTab/EditorTab.styles.tsx index 52217b0..cad4511 100644 --- a/src/components/EditorTab/EditorTab.styles.tsx +++ b/src/components/EditorTab/EditorTab.styles.tsx @@ -3,7 +3,6 @@ import { createStyles } from '@mantine/core'; const useStyles = createStyles((theme) => ({ container: { height: '100%', - gap: theme.spacing.xs, }, box: { @@ -11,6 +10,11 @@ const useStyles = createStyles((theme) => ({ backgroundColor: theme.colors.gray[1], padding: 10, borderRadius: theme.radius.md, + + [theme.fn.smallerThan('xs')]: { + padding: 5, + fontSize: 12, + }, }, })); diff --git a/src/components/EditorTab/EditorTab.tsx b/src/components/EditorTab/EditorTab.tsx index 4d2348f..da95e44 100644 --- a/src/components/EditorTab/EditorTab.tsx +++ b/src/components/EditorTab/EditorTab.tsx @@ -1,15 +1,31 @@ -import { Box, Group } from '@mantine/core'; +import { CodeEditor } from '@components'; +import { useEditor } from '@hooks'; +import { Box, Button, Center, Group, Stack } from '@mantine/core'; import useStyles from './EditorTab.styles'; const EditorTab = () => { const { classes } = useStyles(); + const { query, setQuery, code, onMutate, isLoading } = useEditor(); return ( - - 1 - 2 - + <> +
+ +
+ + + + + + + + + + + ); }; diff --git a/src/components/GraphQlSchemaContent/GraphQlSchemaContent.tsx b/src/components/GraphQlSchemaContent/GraphQlSchemaContent.tsx index f7681d1..3359fb5 100644 --- a/src/components/GraphQlSchemaContent/GraphQlSchemaContent.tsx +++ b/src/components/GraphQlSchemaContent/GraphQlSchemaContent.tsx @@ -8,7 +8,7 @@ interface GraphQlSchemaContentProps { schema: GraphQLSchemaJsToTS; } -interface graphType { +interface GraphType { name: string; result: string[]; } @@ -28,7 +28,7 @@ const GraphQlSchemaContent = ({ schema }: GraphQlSchemaContentProps) => { const { classes, cx } = useStyles(); - const functionOfType = (obj: Type2, res: string[]): graphType => { + const functionOfType = (obj: Type2, res: string[]): GraphType => { const resultArr = [...res, obj.kind]; if (obj.name) { @@ -79,7 +79,7 @@ const GraphQlSchemaContent = ({ schema }: GraphQlSchemaContentProps) => { if (isDisabled) return ( - + {finalResult} ); diff --git a/src/components/index.tsx b/src/components/index.tsx index d2a9546..7ab4b14 100644 --- a/src/components/index.tsx +++ b/src/components/index.tsx @@ -11,3 +11,4 @@ export { default as MemberTag } from './MemberTag/MemberTag'; export { default as RSLink } from './RSLink/RSLink'; export { default as AboutUs } from './AboutUs/AboutUs'; export { default as EditorTab } from './EditorTab/EditorTab'; +export { default as CodeEditor } from './CodeEditor/CodeEditor'; diff --git a/src/constants/apiSettings.ts b/src/constants/apiSettings.ts index 3c5751c..3f26ae6 100644 --- a/src/constants/apiSettings.ts +++ b/src/constants/apiSettings.ts @@ -1,7 +1 @@ -export const API_CREDENTIALS = {}; - export const API_BASE_URL = 'https://countries.trevorblades.com/graphql'; - -export const API_ENDPOINTS = { - TEMP: '/temp', -}; diff --git a/src/helpers/helpers.tsx b/src/helpers/helpers.tsx index c218de3..ac208d2 100644 --- a/src/helpers/helpers.tsx +++ b/src/helpers/helpers.tsx @@ -1,12 +1,9 @@ import { notifications } from '@mantine/notifications'; -import { IconX } from '@tabler/icons-react'; -export const showNotificationsError = (err: unknown) => { +export const showNotificationsError = (errorMessage: unknown) => { return notifications.show({ - title: 'Error', - message: `${err} 🤥`, + message: `${errorMessage} 🤥`, autoClose: 3000, - icon: , color: 'red', }); }; diff --git a/src/hooks/index.ts b/src/hooks/index.ts index fb09932..cdcd487 100644 --- a/src/hooks/index.ts +++ b/src/hooks/index.ts @@ -1,4 +1,3 @@ -export { default as useAppColorScheme } from './useAppColorScheme'; export { default as useAppLanguage } from './useAppLanguage'; export { default as useAppScroll } from './useAppScroll'; -export { default as useGetGraphQL } from './useGetGraphQL'; +export { default as useEditor } from './useEditor'; diff --git a/src/hooks/useAppColorScheme.ts b/src/hooks/useAppColorScheme.ts deleted file mode 100644 index 681a697..0000000 --- a/src/hooks/useAppColorScheme.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { STORAGE_SETTINGS } from '@constants'; -import { ColorScheme } from '@mantine/core'; -import { useLocalStorage } from '@mantine/hooks'; - -type UseAppColorScheme = [ - colorScheme: ColorScheme, - toggleColorScheme: (value?: ColorScheme) => void -]; - -const useAppColorScheme = (): UseAppColorScheme => { - const [colorScheme, setColorScheme] = useLocalStorage({ - key: STORAGE_SETTINGS.KEYS.THEME, - defaultValue: 'light', - getInitialValueInEffect: true, - }); - - const toggleColorScheme = (value?: ColorScheme) => - setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')); - - return [colorScheme, toggleColorScheme]; -}; - -export default useAppColorScheme; diff --git a/src/hooks/useEditor.tsx b/src/hooks/useEditor.tsx new file mode 100644 index 0000000..24e78e5 --- /dev/null +++ b/src/hooks/useEditor.tsx @@ -0,0 +1,30 @@ +import { useEffect, useMemo } from 'react'; + +import queryData from '@api/api'; +import { showNotificationsError } from '@helpers'; +import { useStoreQuery } from '@store'; +import { useMutation } from '@tanstack/react-query'; + +const useEditor = () => { + const query = useStoreQuery((state) => state.query); + const setQuery = useStoreQuery((state) => state.setQuery); + const { data, isLoading, isError, mutate } = useMutation({ mutationFn: queryData }); + + const code = useMemo(() => { + if (typeof data === 'string') return data; + if (!data) return ''; + return JSON.stringify(data, null, ' '); + }, [data]); + + useEffect(() => { + if (isError) showNotificationsError('something'); + }, [isError]); + + const onMutate = () => { + mutate(query); + }; + + return { query, setQuery, code, onMutate, isLoading }; +}; + +export default useEditor; diff --git a/src/hooks/useGetGraphQL.ts b/src/hooks/useGetGraphQL.ts deleted file mode 100644 index a649a28..0000000 --- a/src/hooks/useGetGraphQL.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { useEffect, useState } from 'react'; - -import { API_BASE_URL } from '@constants/apiSettings'; - -const useGetGraphQL = (query: string) => { - const [result, setResult] = useState(null); - - useEffect(() => { - const getQuery = async (query: string) => { - const response = await fetch(API_BASE_URL, { - method: 'POST', - headers: { - 'Content-Type': 'application/json', - }, - body: JSON.stringify({ query }), - }); - - if (!response.ok) { - throw Error('Failed to fetch schema'); - } - - const data = await response.json(); - setResult(data); - }; - - try { - getQuery(query); - } catch (err) { - console.error(err); - } - }, [query]); - - return { result }; -}; - -export default useGetGraphQL; diff --git a/src/layouts/BaseLayout/BaseLayout.tsx b/src/layouts/BaseLayout/BaseLayout.tsx index 36b47aa..921ec69 100644 --- a/src/layouts/BaseLayout/BaseLayout.tsx +++ b/src/layouts/BaseLayout/BaseLayout.tsx @@ -3,12 +3,16 @@ import { Outlet } from 'react-router-dom'; import { Footer, Header } from '@layouts'; import { AppShell, Box, Container, createStyles } from '@mantine/core'; -const useStyles = createStyles({ +const useStyles = createStyles((theme) => ({ container: { flexGrow: 1, height: '100%', + + [theme.fn.smallerThan('xs')]: { + padding: 7, + }, }, -}); +})); const BaseLayout = () => { const { classes } = useStyles(); diff --git a/src/pages/GraphQlPage/GraphQlPage.styles.tsx b/src/pages/GraphQlPage/GraphQlPage.styles.tsx index 03c669d..2bfbdcc 100644 --- a/src/pages/GraphQlPage/GraphQlPage.styles.tsx +++ b/src/pages/GraphQlPage/GraphQlPage.styles.tsx @@ -5,7 +5,8 @@ const useStyles = createStyles((theme) => { return { tabs: { - height: '100%', + height: `calc(100% - ${px(tabsSpacing) * 5}px)`, + maxHeight: 800, }, tab: { diff --git a/src/pages/GraphQlPage/GraphQlPage.tsx b/src/pages/GraphQlPage/GraphQlPage.tsx index 1ca82fc..bfc1ce7 100644 --- a/src/pages/GraphQlPage/GraphQlPage.tsx +++ b/src/pages/GraphQlPage/GraphQlPage.tsx @@ -10,7 +10,6 @@ import useStyles from './GraphQlPage.styles'; const GraphQlPage = () => { const { classes } = useStyles(); - const { t } = useTranslation(); return ( diff --git a/src/store/index.ts b/src/store/index.ts index cb0ff5c..4a6cc1c 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1 +1 @@ -export {}; +export { default as useStoreQuery } from './useStoreQuery'; diff --git a/src/store/useStoreQuery.ts b/src/store/useStoreQuery.ts new file mode 100644 index 0000000..1e5a1aa --- /dev/null +++ b/src/store/useStoreQuery.ts @@ -0,0 +1,19 @@ +import { create } from 'zustand'; + +type StoreQuery = { + query: string; + setQuery: (query: string) => void; +}; + +const defaultQuery = `{ + countries { + name + } +}`; + +const useStoreQuery = create((set) => ({ + query: defaultQuery, + setQuery: (newQuery) => set(() => ({ query: newQuery })), +})); + +export default useStoreQuery; diff --git a/src/theme/theme.ts b/src/theme/theme.ts index 3e87be7..300f84a 100644 --- a/src/theme/theme.ts +++ b/src/theme/theme.ts @@ -24,6 +24,12 @@ const theme: MantineThemeOverride = { globalStyles: (theme) => ({ ['::-webkit-scrollbar']: { width: 12, + height: 12, + + [theme.fn.smallerThan('xs')]: { + width: 7, + height: 7, + }, }, ['::-webkit-scrollbar-track']: {