diff --git a/package-lock.json b/package-lock.json index 47a457b..0f8e651 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1041,9 +1041,9 @@ } }, "node_modules/@mantine/core": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.5.0.tgz", - "integrity": "sha512-0Qfn4oLCs6Qrli+JK6Q325xhNblVEPSKOB4sDMUkvKYUlCt/2lsIhwUXarVBgiIV3X+rKccf0/LcEWmpn/dYuw==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.5.1.tgz", + "integrity": "sha512-V7apuQuRubqxTRXb1uxOM43K7tkLRzpbb1ONJ/sj8QRp/26bShkdYp7EVuSKyrQ8DQ5EGYyBBGyzBOQARh41gA==", "dependencies": { "@floating-ui/react": "^0.24.8", "clsx": "2.0.0", @@ -1053,15 +1053,15 @@ "type-fest": "^3.13.1" }, "peerDependencies": { - "@mantine/hooks": "7.5.0", + "@mantine/hooks": "7.5.1", "react": "^18.2.0", "react-dom": "^18.2.0" } }, "node_modules/@mantine/hooks": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.5.0.tgz", - "integrity": "sha512-KCL/RRMO+9HRIaNww3RIykifWL9XHovnANAyaCU2YUHOPyGCLSXs1UfFxsKNU71HaZ7cHwqSd7J0rR8JpVYLxw==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.5.1.tgz", + "integrity": "sha512-LfrEOkX8U2KbkYAU5BMA7FPbMva/TSd65c45W35wHSx3iqYMsoPN9+Ll1zc/HT0XNFp73jGet9cU7VREbAl0/A==", "peerDependencies": { "react": "^18.2.0" } @@ -1271,20 +1271,20 @@ ] }, "node_modules/@tabler/icons": { - "version": "2.46.0", - "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-2.46.0.tgz", - "integrity": "sha512-Q5G8Pj5IO+Uhc6pszpu5/hGYY018JwEzzvmuqr+gKJtfIvAHA3umpwUilMRLEy89p+WCP+YsDhicMhfBCCv1qA==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/@tabler/icons/-/icons-2.47.0.tgz", + "integrity": "sha512-4w5evLh+7FUUiA1GucvGj2ReX2TvOjEr4ejXdwL/bsjoSkof6r1gQmzqI+VHrE2CpJpB3al7bCTulOkFa/RcyA==", "funding": { "type": "github", "url": "https://github.com/sponsors/codecalm" } }, "node_modules/@tabler/icons-react": { - "version": "2.46.0", - "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-2.46.0.tgz", - "integrity": "sha512-X8MRxuslIOFqMjAo+GvUZDpjlOwNYNJTuOsHXf/NBvVI6ygqUf0FUNsDLLA5fQ6k6KtRwxMlgGB+eR8ZG1UP0g==", + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/@tabler/icons-react/-/icons-react-2.47.0.tgz", + "integrity": "sha512-iqly2FvCF/qUbgmvS8E40rVeYY7laltc5GUjRxQj59DuX0x/6CpKHTXt86YlI2whg4czvd/c8Ce8YR08uEku0g==", "dependencies": { - "@tabler/icons": "2.46.0", + "@tabler/icons": "2.47.0", "prop-types": "^15.7.2" }, "funding": { @@ -1367,9 +1367,9 @@ "devOptional": true }, "node_modules/@types/react": { - "version": "18.2.48", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.48.tgz", - "integrity": "sha512-qboRCl6Ie70DQQG9hhNREz81jqC1cs9EVNcjQ1AU+jH6NFfSAhVVbrrY/+nSF+Bsk4AOwm9Qa61InvMCyV+H3w==", + "version": "18.2.51", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.51.tgz", + "integrity": "sha512-XeoMaU4CzyjdRr3c4IQQtiH7Rpo18V07rYZUucEZQwOUEtGgTXv7e6igQiQ+xnV6MbMe1qjEmKdgMNnfppnXfg==", "devOptional": true, "dependencies": { "@types/prop-types": "*", @@ -1849,9 +1849,9 @@ } }, "node_modules/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==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz", + "integrity": "sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg==", "dev": true, "engines": { "node": ">= 0.4" @@ -1961,9 +1961,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001581", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz", - "integrity": "sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==", + "version": "1.0.30001582", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001582.tgz", + "integrity": "sha512-vsJG3V5vgfduaQGVxL53uSX/HUzxyr2eA8xCo36OLal7sRcSZbibJtLeh0qja4sFOr/QQGt4opB4tOy+eOgAxg==", "dev": true, "funding": [ { @@ -2198,9 +2198,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.650", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.650.tgz", - "integrity": "sha512-sYSQhJCJa4aGA1wYol5cMQgekDBlbVfTRavlGZVr3WZpDdOPcp6a6xUnFfrt8TqZhsBYYbDxJZCjGfHuGupCRQ==", + "version": "1.4.654", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.654.tgz", + "integrity": "sha512-hjfFa+Vj4WGLRVTlCQa+IivBkpcp+boGxMQfusOC/me5Y5NfU4wX7wyw+K9p8Cw4tl0BVIZGH2n7y/jMc3w4pg==", "dev": true }, "node_modules/es-abstract": { @@ -3165,12 +3165,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" @@ -3192,9 +3192,9 @@ } }, "node_modules/ignore": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", - "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -3550,12 +3550,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" @@ -3746,24 +3746,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lodash.debounce": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", - "dev": true - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==", - "dev": true - }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -4200,9 +4188,9 @@ } }, "node_modules/postcss-preset-mantine": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/postcss-preset-mantine/-/postcss-preset-mantine-1.12.3.tgz", - "integrity": "sha512-cCwowf20mIyRXnV1cSVoMGfhYgy8ZqFJWsEJthdMZ3n7LijjucE9l/HO47gv5gAtr9nY1MkaEkpWS7ulhSTbSg==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/postcss-preset-mantine/-/postcss-preset-mantine-1.13.0.tgz", + "integrity": "sha512-1bv/mQz2K+/FixIMxYd83BYH7PusDZaI7LpUtKbb1l/5N5w6t1p/V9ONHfRJeeAZyfa6Xc+AtR+95VKdFXRH1g==", "dev": true, "dependencies": { "postcss-mixins": "^9.0.4", @@ -5237,9 +5225,9 @@ } }, "node_modules/vite-plugin-checker": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/vite-plugin-checker/-/vite-plugin-checker-0.6.2.tgz", - "integrity": "sha512-YvvvQ+IjY09BX7Ab+1pjxkELQsBd4rPhWNw8WLBeFVxu/E7O+n6VYAqNsKdK/a2luFlX/sMpoWdGFfg4HvwdJQ==", + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/vite-plugin-checker/-/vite-plugin-checker-0.6.4.tgz", + "integrity": "sha512-2zKHH5oxr+ye43nReRbC2fny1nyARwhxdm0uNYp/ERy4YvU9iZpNOsueoi/luXw5gnpqRSvjcEPxXbS153O2wA==", "dev": true, "dependencies": { "@babel/code-frame": "^7.12.13", @@ -5249,8 +5237,6 @@ "commander": "^8.0.0", "fast-glob": "^3.2.7", "fs-extra": "^11.1.0", - "lodash.debounce": "^4.0.8", - "lodash.pick": "^4.4.0", "npm-run-path": "^4.0.1", "semver": "^7.5.0", "strip-ansi": "^6.0.0", @@ -5529,16 +5515,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/src/App.tsx b/src/App.tsx index 978b0c2..f951b54 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,12 +2,15 @@ import React from "react"; import s from "./App.module.css"; import { useImmer } from "use-immer"; import { AppShell, Button, Group, Stack } from "@mantine/core"; -import { Data } from "./components/scripts"; -import { Files, FileUploads, PopulatedFiles } from "./components/FileUploads"; -import { FormUi } from "./components/FormUi"; -import { Navigation } from "./components/Navigation"; -import { Header } from "./components/Header"; -import { Footer } from "./components/Footer"; +import type { Data } from "./components/scripts/types"; +import FileUploads, { + Files, + PopulatedFiles, +} from "./components/FileUploads/FileUploads"; +import FormUi from "./components/FormUi/FormUi"; +import Navigation from "./components/Navigation/Navigation"; +import Header from "./components/Header/Header"; +import Footer from "./components/Footer/Footer"; import { IconBrandGithub } from "@tabler/icons-react"; export default function App() { diff --git a/src/components/FileUploads/FileUploads.tsx b/src/components/FileUploads/FileUploads.tsx index 2b06869..3305769 100644 --- a/src/components/FileUploads/FileUploads.tsx +++ b/src/components/FileUploads/FileUploads.tsx @@ -1,8 +1,9 @@ import React from "react"; -import { Updater } from "use-immer"; +import type { Updater } from "use-immer"; import { FileInput, Stack, LoadingOverlay } from "@mantine/core"; import { IconUpload } from "@tabler/icons-react"; -import { Data, parseData, binToHexString } from "../scripts"; +import { parseData, binToHexString } from "../scripts/scripts"; +import type { Data } from "../scripts/types"; export interface Files { setupSctContainer: FileContainer; @@ -30,7 +31,11 @@ export interface FileUploadsProps { setData: Updater; } -export function FileUploads({ files, setFiles, setData }: FileUploadsProps) { +export default function FileUploads({ + files, + setFiles, + setData, +}: FileUploadsProps) { React.useEffect(() => { if ( files.setupSctContainer.file && diff --git a/src/components/FileUploads/index.ts b/src/components/FileUploads/index.ts deleted file mode 100644 index 6ef2385..0000000 --- a/src/components/FileUploads/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./FileUploads"; diff --git a/src/components/Footer/Footer.tsx b/src/components/Footer/Footer.tsx index b3a8154..53e48d3 100644 --- a/src/components/Footer/Footer.tsx +++ b/src/components/Footer/Footer.tsx @@ -3,16 +3,15 @@ import s from "./Footer.module.css"; import { Button, Group, TextInput, FileButton } from "@mantine/core"; import { IconDownload, IconUpload } from "@tabler/icons-react"; import { saveAs } from "file-saver"; -import { Updater } from "use-immer"; +import type { Updater } from "use-immer"; import { - Data, - Suppression, validateByteInput, calculateJsonChecksum, downloadModifiedFiles, version, -} from "../scripts"; -import { PopulatedFiles } from "../FileUploads"; +} from "../scripts/scripts"; +import type { Data, Suppression } from "../scripts/types"; +import type { PopulatedFiles } from "../FileUploads/FileUploads"; interface FooterProps { files: PopulatedFiles; @@ -21,7 +20,7 @@ interface FooterProps { currentFormIndex: number; } -export function Footer({ +export default function Footer({ files, currentFormIndex, data, diff --git a/src/components/Footer/index.ts b/src/components/Footer/index.ts deleted file mode 100644 index 5fca53f..0000000 --- a/src/components/Footer/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./Footer"; diff --git a/src/components/FormUi/FormUi.tsx b/src/components/FormUi/FormUi.tsx index 3347356..51721eb 100644 --- a/src/components/FormUi/FormUi.tsx +++ b/src/components/FormUi/FormUi.tsx @@ -1,6 +1,6 @@ import React from "react"; import s from "./FormUi.module.css"; -import { Updater } from "use-immer"; +import type { Updater } from "use-immer"; import { Table, TextInput, @@ -11,8 +11,9 @@ import { Group, } from "@mantine/core"; import { useDebouncedState } from "@mantine/hooks"; -import { Data, FormChildren, validateByteInput } from "../scripts"; -import { SearchUi } from "./SearchUi"; +import type { Data, FormChildren } from "../scripts/types"; +import { validateByteInput } from "../scripts/scripts"; +import SearchUi from "./SearchUi/SearchUi"; interface SuppressionChipProps { suppressionOffset: string; @@ -278,7 +279,7 @@ interface FormUiProps { setCurrentFormIndex: React.Dispatch>; } -export function FormUi({ +export default function FormUi({ data, setData, currentFormIndex, diff --git a/src/components/FormUi/SearchUi/SearchUi.tsx b/src/components/FormUi/SearchUi/SearchUi.tsx index bd3701c..c33e2ec 100644 --- a/src/components/FormUi/SearchUi/SearchUi.tsx +++ b/src/components/FormUi/SearchUi/SearchUi.tsx @@ -1,6 +1,6 @@ import s from "../FormUi.module.css"; import { useFocusTrap } from "@mantine/hooks"; -import { Data } from "../../scripts"; +import type { Data } from "../../scripts/types"; import { Stack, Table, TextInput } from "@mantine/core"; import { IconSearch } from "@tabler/icons-react"; @@ -11,7 +11,7 @@ interface SearchUiProps { setSearch: (newValue: string) => void; } -export function SearchUi({ +export default function SearchUi({ data, handleRefClick, search, diff --git a/src/components/FormUi/SearchUi/index.ts b/src/components/FormUi/SearchUi/index.ts deleted file mode 100644 index 0424967..0000000 --- a/src/components/FormUi/SearchUi/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./SearchUi"; diff --git a/src/components/FormUi/index.ts b/src/components/FormUi/index.ts deleted file mode 100644 index 8329551..0000000 --- a/src/components/FormUi/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./FormUi"; diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 867a722..4c54236 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -1,7 +1,7 @@ import React from "react"; import { Group } from "@mantine/core"; import s from "./Header.module.css"; -import { Data } from "../scripts"; +import type { Data } from "../scripts/types"; interface HeaderProps { data: Data; @@ -9,7 +9,7 @@ interface HeaderProps { setCurrentFormIndex: React.Dispatch>; } -export function Header({ +export default function Header({ data, currentFormIndex, setCurrentFormIndex, diff --git a/src/components/Header/index.ts b/src/components/Header/index.ts deleted file mode 100644 index 9e08a64..0000000 --- a/src/components/Header/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./Header"; diff --git a/src/components/Navigation/Navigation.tsx b/src/components/Navigation/Navigation.tsx index 0cfb75b..1005b3f 100644 --- a/src/components/Navigation/Navigation.tsx +++ b/src/components/Navigation/Navigation.tsx @@ -1,7 +1,7 @@ import React from "react"; import s from "./Navigation.module.css"; import { NavLink, AppShell, ScrollArea } from "@mantine/core"; -import { Data } from "../scripts"; +import type { Data } from "../scripts/types"; interface NavigationProps { data: Data; @@ -9,7 +9,7 @@ interface NavigationProps { setCurrentFormIndex: React.Dispatch>; } -export const Navigation = React.memo( +const Navigation = React.memo( function Navigation({ data, currentFormIndex, @@ -60,3 +60,5 @@ export const Navigation = React.memo( (oldProps: NavigationProps, newProps: NavigationProps) => oldProps.currentFormIndex === newProps.currentFormIndex ); + +export default Navigation; diff --git a/src/components/Navigation/index.ts b/src/components/Navigation/index.ts deleted file mode 100644 index 8953bdf..0000000 --- a/src/components/Navigation/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./Navigation"; diff --git a/src/components/scripts/index.ts b/src/components/scripts/index.ts deleted file mode 100644 index 1fceadf..0000000 --- a/src/components/scripts/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./types"; -export * from "./scripts"; diff --git a/src/components/scripts/scripts.ts b/src/components/scripts/scripts.ts index 214c84e..73f85a4 100644 --- a/src/components/scripts/scripts.ts +++ b/src/components/scripts/scripts.ts @@ -1,7 +1,7 @@ import { saveAs } from "file-saver"; -import { PopulatedFiles } from "../FileUploads"; +import type { PopulatedFiles } from "../FileUploads/FileUploads"; import sha256 from "crypto-js/sha256"; -import { +import type { Data, Forms, Form,