From 1d79cee804cc6134749ec413195ca1ff14892421 Mon Sep 17 00:00:00 2001 From: samet Date: Mon, 5 Feb 2024 10:09:15 +0300 Subject: [PATCH] repositoryfilters hook --- components/repositories/Repositories.tsx | 122 +++-------- hooks/useRepositoryFilters.ts | 98 +++++++++ lib/utils.ts | 19 ++ package-lock.json | 248 +++++++++++++---------- package.json | 32 +-- 5 files changed, 304 insertions(+), 215 deletions(-) create mode 100644 hooks/useRepositoryFilters.ts diff --git a/components/repositories/Repositories.tsx b/components/repositories/Repositories.tsx index 3a95762..b318aa4 100644 --- a/components/repositories/Repositories.tsx +++ b/components/repositories/Repositories.tsx @@ -1,35 +1,31 @@ "use client"; -import { useContext, useMemo, useState } from "react"; +import { useContext, useMemo } from "react"; import { GithubContext } from "@/app/context/GithubContext"; import { Box } from "@radix-ui/themes"; -import { sortByKeyAscending, sortByKeyDescending } from "@/lib/utils/sort"; import FilterBar from "./FilterBar"; import ReposCard from "./ReposCard"; import { VList } from "virtua"; import Loading from "@/app/loading"; - -type SetSelectedFunction = (value: string) => void; +import { useRepositoryFilters } from "@/hooks/useRepositoryFilters"; +import { extractUniqueValues } from "@/lib/utils"; export default function Repositories() { const { repos, loading } = useContext(GithubContext); - const [sort, setSort] = useState("Stars Descending"); - const [filterValue, setFilterValue] = useState(""); - const [selectedTopic, setSelectedTopic] = useState(""); - const [selectedLanguage, setSelectedLanguage] = useState(""); - const [selectedFilter, setSelectedFilter] = useState("All"); - const [selectedLicense, setSelectedLicense] = useState(""); - - const handleFilterClick = ( - value: string, - setSelectedFunction: SetSelectedFunction, - selectedValue: string, - ): void => { - setSelectedFunction(value); - // Reset filter if the same value is clicked again - if (value === selectedValue) { - setSelectedFunction(""); - } - }; + const { + sort, + setSort, + setFilterValue, + selectedTopic, + setSelectedTopic, + selectedLanguage, + setSelectedLanguage, + selectedFilter, + setSelectedFilter, + selectedLicense, + setSelectedLicense, + handleFilterClick, + filteredAndSortedRepos, + } = useRepositoryFilters(repos); const handleTopicClick = (topic: string): void => { handleFilterClick(topic, setSelectedTopic, selectedTopic); @@ -43,81 +39,15 @@ export default function Repositories() { handleFilterClick(license, setSelectedLicense, selectedLicense); }; - const filteredAndSortedRepos = useMemo(() => { - const filteredRepos = repos - ? repos.filter((repo: any) => { - if (selectedTopic) { - return repo.topics.includes(selectedTopic); - } - if (selectedLanguage) { - return repo.language === selectedLanguage; - } - if (selectedLicense) { - return repo.license?.spdx_id === selectedLicense; - } - - const nameMatches = repo.name - .toLowerCase() - .includes(filterValue.toLowerCase()); - const isForked = repo.fork; - const isNotForked = !repo.fork; - - switch (selectedFilter) { - case "All": - return nameMatches; - case "Forked": - return nameMatches && isForked; - case "Not Forked": - return nameMatches && isNotForked; - default: - return nameMatches; - } - }) - : []; - - switch (sort) { - case "Created Ascending": - return sortByKeyAscending(filteredRepos, "created_at"); - case "Created Descending": - return sortByKeyDescending(filteredRepos, "created_at"); - case "Updated Ascending": - return sortByKeyAscending(filteredRepos, "pushed_at"); - case "Updated Descending": - return sortByKeyDescending(filteredRepos, "pushed_at"); - case "Stars Ascending": - return sortByKeyAscending(filteredRepos, "stargazers_count"); - default: - return sortByKeyDescending(filteredRepos, "stargazers_count"); - } - }, [ - repos, - sort, - selectedTopic, - selectedLanguage, - selectedLicense, - filterValue, - selectedFilter, - ]); - - const uniqueLanguages = useMemo(() => { - const languagesSet = new Set(); - filteredAndSortedRepos.forEach((repo: GitHubRepo) => { - if (repo.language) { - languagesSet.add(repo.language); - } - }); - return Array.from(languagesSet); - }, [filteredAndSortedRepos]); + const uniqueLanguages = useMemo( + () => extractUniqueValues(filteredAndSortedRepos, "language"), + [filteredAndSortedRepos], + ); - const uniqueLicenses = useMemo(() => { - const licenseSet = new Set(); - filteredAndSortedRepos.forEach((repo: GitHubRepo) => { - if (repo.license?.spdx_id) { - licenseSet.add(repo.license.spdx_id); - } - }); - return Array.from(licenseSet); - }, [filteredAndSortedRepos]); + const uniqueLicenses = useMemo( + () => extractUniqueValues(filteredAndSortedRepos, "license", "spdx_id"), + [filteredAndSortedRepos], + ); const uniqueTopics = useMemo(() => { const topicSet = new Set(); diff --git a/hooks/useRepositoryFilters.ts b/hooks/useRepositoryFilters.ts new file mode 100644 index 0000000..3099b6a --- /dev/null +++ b/hooks/useRepositoryFilters.ts @@ -0,0 +1,98 @@ +// hooks/useRepositoryFilters.ts +import { useState, useMemo } from "react"; +import { sortByKeyAscending, sortByKeyDescending } from "@/lib/utils/sort"; + +type SetSelectedFunction = (value: string) => void; + +export const useRepositoryFilters = (repos: GitHubRepo[]) => { + const [sort, setSort] = useState("Stars Descending"); + const [filterValue, setFilterValue] = useState(""); + const [selectedTopic, setSelectedTopic] = useState(""); + const [selectedLanguage, setSelectedLanguage] = useState(""); + const [selectedFilter, setSelectedFilter] = useState("All"); + const [selectedLicense, setSelectedLicense] = useState(""); + + const handleFilterClick = ( + value: string, + setSelectedFunction: SetSelectedFunction, + selectedValue: string, + ): void => { + setSelectedFunction(value); + if (value === selectedValue) { + setSelectedFunction(""); + } + }; + + const filteredAndSortedRepos = useMemo(() => { + const filteredRepos = repos + ? repos.filter((repo: any) => { + if (selectedTopic) { + return repo.topics.includes(selectedTopic); + } + if (selectedLanguage) { + return repo.language === selectedLanguage; + } + if (selectedLicense) { + return repo.license?.spdx_id === selectedLicense; + } + + const nameMatches = repo.name + .toLowerCase() + .includes(filterValue.toLowerCase()); + const isForked = repo.fork; + const isNotForked = !repo.fork; + + switch (selectedFilter) { + case "All": + return nameMatches; + case "Forked": + return nameMatches && isForked; + case "Not Forked": + return nameMatches && isNotForked; + default: + return nameMatches; + } + }) + : []; + + switch (sort) { + case "Created Ascending": + return sortByKeyAscending(filteredRepos, "created_at"); + case "Created Descending": + return sortByKeyDescending(filteredRepos, "created_at"); + case "Updated Ascending": + return sortByKeyAscending(filteredRepos, "pushed_at"); + case "Updated Descending": + return sortByKeyDescending(filteredRepos, "pushed_at"); + case "Stars Ascending": + return sortByKeyAscending(filteredRepos, "stargazers_count"); + default: + return sortByKeyDescending(filteredRepos, "stargazers_count"); + } + }, [ + repos, + sort, + selectedTopic, + selectedLanguage, + selectedLicense, + filterValue, + selectedFilter, + ]); + + return { + sort, + setSort, + filterValue, + setFilterValue, + selectedTopic, + setSelectedTopic, + selectedLanguage, + setSelectedLanguage, + selectedFilter, + setSelectedFilter, + selectedLicense, + setSelectedLicense, + handleFilterClick, + filteredAndSortedRepos, + }; +}; diff --git a/lib/utils.ts b/lib/utils.ts index 99d4288..33d75c6 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -97,3 +97,22 @@ export function formatNumber(number: number) { return number; } } + +export const extractUniqueValues = ( + items: T[], + key: K, + subKey?: Extract, +): string[] => { + const uniqueSet = new Set(); + items.forEach((item) => { + const value = item[key]; + if (typeof value === "object" && value !== null && subKey !== undefined) { + if (typeof subKey === "string" && subKey in value) { + uniqueSet.add(String(value[subKey])); + } + } else if (typeof value === "string") { + uniqueSet.add(value); + } + }); + return Array.from(uniqueSet); +}; diff --git a/package-lock.json b/package-lock.json index 062cded..5a40082 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,39 +11,39 @@ "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", "@hookform/resolvers": "^3.3.4", - "@mui/material": "^5.15.5", - "@mui/x-charts": "^6.19.1", - "@mui/x-data-grid": "^6.19.2", + "@mui/material": "^5.15.7", + "@mui/x-charts": "^6.19.3", + "@mui/x-data-grid": "^6.19.3", "@next/third-parties": "^14.1.0", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-select": "^2.0.0", "@radix-ui/themes": "^2.0.3", - "@tanstack/react-table": "^8.11.7", + "@tanstack/react-table": "^8.11.8", "@uiw/react-markdown-preview": "^5.0.7", "@vercel/analytics": "^1.1.2", - "@vercel/speed-insights": "^1.0.5", + "@vercel/speed-insights": "^1.0.9", "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "cmdk": "^0.2.1", - "date-fns": "^3.3.0", + "date-fns": "^3.3.1", "install": "^0.13.0", "lodash": "^4.17.21", - "lucide-react": "^0.312.0", + "lucide-react": "^0.321.0", "next": "14.1.0", "next-themes": "^0.2.1", - "npm": "^10.3.0", + "npm": "^10.4.0", "octokit": "^3.1.2", "react": "^18.2.0", "react-day-picker": "^8.10.0", "react-dom": "^18.2.0", - "react-hook-form": "^7.49.3", + "react-hook-form": "^7.50.0", "react-icons": "^5.0.1", "react-json-view-lite": "^1.2.1", - "sonner": "^1.3.1", + "sonner": "^1.4.0", "tailwind-merge": "^2.2.1", "tailwindcss-animate": "^1.0.7", - "vaul": "^0.8.7", - "virtua": "^0.21.0", + "vaul": "^0.9.0", + "virtua": "^0.23.3", "zod": "^3.22.4" }, "devDependencies": { @@ -56,7 +56,7 @@ "eslint": "^8.56.0", "eslint-config-next": "14.1.0", "postcss": "^8.4.33", - "prettier": "^3.2.4", + "prettier": "^3.2.5", "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.4.1", "typescript": "^5.3.3" @@ -855,9 +855,9 @@ } }, "node_modules/@mui/x-charts": { - "version": "6.19.1", - "resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-6.19.1.tgz", - "integrity": "sha512-7FJFwL+6o0Qt7RcQCeDeGL5aPzMpX8Dyh7+IOoNoaLiIHVNssAYh4D3uD2mKpZ+pcW6SE54aE5WM1SWDEC8TQA==", + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@mui/x-charts/-/x-charts-6.19.3.tgz", + "integrity": "sha512-VxF+mHXtmR2LxalH2KRzF4gLT6KFDbYMvis6rkcyr+w6J17KBxMsEGx8V0nn1CIEslzcSXgbv41jIzodhiFyMQ==", "dependencies": { "@babel/runtime": "^7.23.2", "@mui/base": "^5.0.0-beta.22", @@ -890,9 +890,9 @@ } }, "node_modules/@mui/x-data-grid": { - "version": "6.19.2", - "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-6.19.2.tgz", - "integrity": "sha512-+wizP1jEzCKB5BSQ6OD5TP6RspEbWmFWcxi1XBgKrzryUZii1o4G2BW1+d/n4p3xETCUMKRkYfItrOJGlM/dBw==", + "version": "6.19.3", + "resolved": "https://registry.npmjs.org/@mui/x-data-grid/-/x-data-grid-6.19.3.tgz", + "integrity": "sha512-RHt+MhTgvpXTWY0MYvzSNLF8npo+mlmWuTO+qKRt42Zj634IlUYDwW5jjQ9fWZnIpWJLunw253KqHoAlSAOXaw==", "dependencies": { "@babel/runtime": "^7.23.2", "@mui/utils": "^5.14.16", @@ -2787,11 +2787,11 @@ } }, "node_modules/@tanstack/react-table": { - "version": "8.11.7", - "resolved": "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.11.7.tgz", - "integrity": "sha512-ZbzfMkLjxUTzNPBXJYH38pv2VpC9WUA+Qe5USSHEBz0dysDTv4z/ARI3csOed/5gmlmrPzVUN3UXGuUMbod3Jg==", + "version": "8.11.8", + "resolved": "https://registry.npmjs.org/@tanstack/react-table/-/react-table-8.11.8.tgz", + "integrity": "sha512-NEwvIq4iSiDQozEyvbdiSdCOiLa+g5xHmdEnvwDb98FObcK6YkBOkRrs/CNqrKdDy+/lqoIllIWHk+M80GW6+g==", "dependencies": { - "@tanstack/table-core": "8.11.7" + "@tanstack/table-core": "8.11.8" }, "engines": { "node": ">=12" @@ -2806,9 +2806,9 @@ } }, "node_modules/@tanstack/table-core": { - "version": "8.11.7", - "resolved": "https://registry.npmjs.org/@tanstack/table-core/-/table-core-8.11.7.tgz", - "integrity": "sha512-N3ksnkbPbsF3PjubuZCB/etTqvctpXWRHIXTmYfJFnhynQKjeZu8BCuHvdlLPpumKbA+bjY4Ay9AELYLOXPWBg==", + "version": "8.11.8", + "resolved": "https://registry.npmjs.org/@tanstack/table-core/-/table-core-8.11.8.tgz", + "integrity": "sha512-DECHvtq4YW4U/gqg6etup7ydt/RB1Bi1pJaMpHUXl65ooW1d71Nv7BzD66rUdHrBSNdyiW3PLTPUQlpXjAgDeA==", "engines": { "node": ">=12" }, @@ -2890,9 +2890,9 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/node": { - "version": "20.11.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.15.tgz", - "integrity": "sha512-gscmuADZfvNULx1eyirVbr3kVOVZtpQtzKMCZpeSZcN6MfbkRXAR4s9/gsQ4CzxLHw6EStDtKLNtSDL3vbq05A==", + "version": "20.11.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", + "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", "dependencies": { "undici-types": "~5.26.4" } @@ -2913,9 +2913,9 @@ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==" }, "node_modules/@types/react": { - "version": "18.2.50", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.50.tgz", - "integrity": "sha512-y0XIDJkqp9HynS1VBktZG9mUziHTK5WZTAFDP/UfzSq+poV1drUKsr4VkjMyHTbqMz26BwgLZVYdx/EgPm7EkQ==", + "version": "18.2.53", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.53.tgz", + "integrity": "sha512-52IHsMDT8qATp9B9zoOyobW8W3/0QhaJQTw1HwRj0UY2yBpCAQ7+S/CqHYQ8niAm3p4ji+rWUQ9UCib0GxQ60w==", "dependencies": { "@types/prop-types": "*", "@types/scheduler": "*", @@ -3283,13 +3283,16 @@ } }, "node_modules/array-buffer-byte-length": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", - "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", + "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "is-array-buffer": "^3.0.1" + "call-bind": "^1.0.5", + "is-array-buffer": "^3.0.4" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3323,6 +3326,25 @@ "node": ">=8" } }, + "node_modules/array.prototype.filter": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array.prototype.filter/-/array.prototype.filter-1.0.3.tgz", + "integrity": "sha512-VizNcj/RGJiUyQBgzwxzE5oHdeuXY5hSbbmKMlphj1cy1Vl7Pn2asCGbSrru6hSQjmCzqTBPVWAF/whmEOVHbw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "es-abstract": "^1.22.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array.prototype.findlastindex": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.3.tgz", @@ -3558,7 +3580,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3659,9 +3680,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001582", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001582.tgz", - "integrity": "sha512-vsJG3V5vgfduaQGVxL53uSX/HUzxyr2eA8xCo36OLal7sRcSZbibJtLeh0qja4sFOr/QQGt4opB4tOy+eOgAxg==", + "version": "1.0.30001583", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001583.tgz", + "integrity": "sha512-acWTYaha8xfhA/Du/z4sNZjHUWjkiuoAi2LM+T/aL+kemKQgPT1xBb/YKjlQ0Qo8gvbHsGNplrEJ+9G3gL7i4Q==", "funding": [ { "type": "opencollective", @@ -3690,7 +3711,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -4101,8 +4121,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/convert-source-map": { "version": "1.9.0", @@ -4441,9 +4460,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.653", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.653.tgz", - "integrity": "sha512-wA2A2LQCqnEwQAvwADQq3KpMpNwgAUBnRmrFgRzHnPhbQUFArTR32Ab46f4p0MovDLcg4uqd4nCsN2hTltslpA==", + "version": "1.4.656", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.656.tgz", + "integrity": "sha512-9AQB5eFTHyR3Gvt2t/NwR0le2jBSUNwCnMbUCejFWHD+so4tH40/dRLgoE+jxlPeWS43XJewyvCv+I8LPMl49Q==", "dev": true }, "node_modules/emoji-regex": { @@ -4536,6 +4555,21 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", + "dev": true + }, + "node_modules/es-errors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.1.0.tgz", + "integrity": "sha512-ka/z/Hxav2YGgkzSwOp1ugbUk6fgIX5gI69PfRHCvODD+LuVOnV1jHPBWXBNPZqX0O900p2I+IdM9sEbac0BNA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-iterator-helpers": { "version": "1.0.15", "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.15.tgz", @@ -5250,16 +5284,20 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.3.tgz", + "integrity": "sha512-JIcZczvcMVE7AUOP+X72bh8HqHBRxFdz5PDHYtNG/lE3yk9b3KZBJlwFcTyPYjg3L4RLLmZJzvjxhaZVapxFrQ==", "dev": true, "dependencies": { + "es-errors": "^1.0.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" }, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5445,7 +5483,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } @@ -5487,12 +5524,12 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", "dev": true, "dependencies": { - "has-symbols": "^1.0.2" + "has-symbols": "^1.0.3" }, "engines": { "node": ">= 0.4" @@ -5939,14 +5976,16 @@ } }, "node_modules/is-array-buffer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", - "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", + "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", "dev": true, "dependencies": { "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.0", - "is-typed-array": "^1.1.10" + "get-intrinsic": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6253,12 +6292,12 @@ } }, "node_modules/is-typed-array": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz", - "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==", + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", + "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", "dev": true, "dependencies": { - "which-typed-array": "^1.1.11" + "which-typed-array": "^1.1.14" }, "engines": { "node": ">= 0.4" @@ -6600,9 +6639,9 @@ } }, "node_modules/lucide-react": { - "version": "0.312.0", - "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.312.0.tgz", - "integrity": "sha512-3UZsqyswRXjW4t+nw+InICewSimjPKHuSxiFYqTshv9xkK3tPPntXk/lvXc9pKlXIxm3v9WKyoxcrB6YHhP+dg==", + "version": "0.321.0", + "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.321.0.tgz", + "integrity": "sha512-Fi9VahIna6642U+2nAGSjnXwUBV3WyfFFPQq4yi3w30jtqxDLfSyiYCtCYCYQZ2KWNZc1MDI+rcsa0t+ChdYpw==", "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0" } @@ -6819,9 +6858,9 @@ } }, "node_modules/mdast-util-phrasing": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.0.0.tgz", - "integrity": "sha512-xadSsJayQIucJ9n053dfQwVu1kuXg7jCTdYsMK8rqzKZh52nLfSH/k0sAxE0u+pj/zKZX+o5wB+ML5mRayOxFA==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", "dependencies": { "@types/mdast": "^4.0.0", "unist-util-is": "^6.0.0" @@ -7441,7 +7480,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -10237,15 +10275,16 @@ } }, "node_modules/object.groupby": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.1.tgz", - "integrity": "sha512-HqaQtqLnp/8Bn4GL16cj+CUYbnpe1bh0TtEaWvybszDG4tgxCJuRpV8VGuvNaI1fAnI4lUJzDG55MXcOH4JZcQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.2.tgz", + "integrity": "sha512-bzBq58S+x+uo0VjurFT0UktpKHOZmv4/xePiOA1nbB9pMqpGK7rUPNgf+1YC+7mE+0HzhTMqNUuCqvKhj6FnBw==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1" + "array.prototype.filter": "^1.0.3", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.0.0" } }, "node_modules/object.hasown": { @@ -10663,9 +10702,9 @@ } }, "node_modules/prettier": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", - "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -11000,15 +11039,16 @@ } }, "node_modules/reflect.getprototypeof": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.4.tgz", - "integrity": "sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.5.tgz", + "integrity": "sha512-62wgfC8dJWrmxv44CA36pLDnP6KKl3Vhxb7PL+8+qrrFMMoJij4vgiMP8zV4O8+CBMXY1mHxI5fITGHXFHVmQQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "get-intrinsic": "^1.2.1", + "call-bind": "^1.0.5", + "define-properties": "^1.2.1", + "es-abstract": "^1.22.3", + "es-errors": "^1.0.0", + "get-intrinsic": "^1.2.3", "globalthis": "^1.0.3", "which-builtin-type": "^1.1.3" }, @@ -11815,7 +11855,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -11902,8 +11941,7 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" }, "node_modules/thenify": { "version": "3.3.1", @@ -12326,9 +12364,9 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/vaul": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/vaul/-/vaul-0.8.9.tgz", - "integrity": "sha512-gpmtmZRWDPP6niQh14JfRIFUYZVyfvAWyA/7rUINOfNlO/2K7uEvI5rLXEXkxZIRFyUZj+TPHLFMirkegPHjrw==", + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/vaul/-/vaul-0.9.0.tgz", + "integrity": "sha512-bZSySGbAHiTXmZychprnX/dE0EsSige88xtyyL3/MCRbrFotRPQZo7UdydGXZWw+CKbNOw5Ow8gwAo93/nB/Cg==", "dependencies": { "@radix-ui/react-dialog": "^1.0.4" }, @@ -12378,12 +12416,13 @@ } }, "node_modules/virtua": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/virtua/-/virtua-0.21.1.tgz", - "integrity": "sha512-6CRxablXTLvnFHIIXKRgcxn0oVoXjKQRxchXzx8sWywg+DtQ7wHZBSrJ6WTN3YzXOLP9ZJt4zs5SmsaCTQbUhA==", + "version": "0.23.3", + "resolved": "https://registry.npmjs.org/virtua/-/virtua-0.23.3.tgz", + "integrity": "sha512-B9jKatcits94r5K2wwEA5y7a/Ht2I6kl1yBzy/rmhAEvanG9x/6n2CCer/oa5L0pTabY4TiaZsfVms2RVlJ4Rw==", "peerDependencies": { "react": ">=16.14.0", "react-dom": ">=16.14.0", + "solid-js": ">=1.0", "vue": ">=3.2" }, "peerDependenciesMeta": { @@ -12393,6 +12432,9 @@ "react-dom": { "optional": true }, + "solid-js": { + "optional": true + }, "vue": { "optional": true } @@ -12479,16 +12521,16 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", - "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.4", + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "has-tostringtag": "^1.0.1" }, "engines": { "node": ">= 0.4" diff --git a/package.json b/package.json index 436343f..4dfa7b1 100644 --- a/package.json +++ b/package.json @@ -12,54 +12,54 @@ "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", "@hookform/resolvers": "^3.3.4", - "@mui/material": "^5.15.5", - "@mui/x-charts": "^6.19.1", - "@mui/x-data-grid": "^6.19.2", + "@mui/material": "^5.15.7", + "@mui/x-charts": "^6.19.3", + "@mui/x-data-grid": "^6.19.3", "@next/third-parties": "^14.1.0", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-select": "^2.0.0", "@radix-ui/themes": "^2.0.3", - "@tanstack/react-table": "^8.11.7", + "@tanstack/react-table": "^8.11.8", "@uiw/react-markdown-preview": "^5.0.7", "@vercel/analytics": "^1.1.2", - "@vercel/speed-insights": "^1.0.5", + "@vercel/speed-insights": "^1.0.9", "class-variance-authority": "^0.7.0", "clsx": "^2.1.0", "cmdk": "^0.2.1", - "date-fns": "^3.3.0", + "date-fns": "^3.3.1", "install": "^0.13.0", "lodash": "^4.17.21", - "lucide-react": "^0.312.0", + "lucide-react": "^0.321.0", "next": "14.1.0", "next-themes": "^0.2.1", - "npm": "^10.3.0", + "npm": "^10.4.0", "octokit": "^3.1.2", "react": "^18.2.0", "react-day-picker": "^8.10.0", "react-dom": "^18.2.0", - "react-hook-form": "^7.49.3", + "react-hook-form": "^7.50.0", "react-icons": "^5.0.1", "react-json-view-lite": "^1.2.1", - "sonner": "^1.3.1", + "sonner": "^1.4.0", "tailwind-merge": "^2.2.1", "tailwindcss-animate": "^1.0.7", - "vaul": "^0.8.7", - "virtua": "^0.21.0", + "vaul": "^0.9.0", + "virtua": "^0.23.3", "zod": "^3.22.4" }, "devDependencies": { "@types/lodash": "^4.14.202", - "@types/node": "^20.11.14", - "@types/react": "^18.2.50", + "@types/node": "^20.11.16", + "@types/react": "^18.2.53", "@types/react-dom": "^18.2.18", "@types/react-window": "^1.8.8", "autoprefixer": "^10.4.17", "eslint": "^8.56.0", "eslint-config-next": "14.1.0", "postcss": "^8.4.33", - "prettier": "^3.2.4", + "prettier": "^3.2.5", "prettier-plugin-tailwindcss": "^0.5.11", "tailwindcss": "^3.4.1", "typescript": "^5.3.3" } -} +} \ No newline at end of file