diff --git a/.gitignore b/.gitignore index 39797345..fc89a0bb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,15 @@ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies -/node_modules -/.pnp +node_modules +.pnp .pnp.js # testing -/coverage +coverage # production -/dist +dist # misc .DS_Store @@ -22,3 +22,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* src-tauri/.cargo/config.toml + +.swc/ diff --git a/.vscode/settings.json b/.vscode/settings.json index 2c63c085..15d38358 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,2 +1,3 @@ { + "references.preferredLocation": "view" } diff --git a/package.json b/package.json index 32a23c13..dfc9353e 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "@mattjennings/react-modal-stack": "^1.0.4", "@mdi/js": "^7.4.47", "@mdi/react": "^1.6.1", - "@mui/material": "^6.1.3", "@originjs/vite-plugin-commonjs": "^1.0.3", "@rollup/plugin-replace": "^6.0.1", "@spacebarchat/spacebar-api-types": "0.37.51", @@ -35,6 +34,7 @@ "@types/react-measure": "^2.0.12", "@types/react-portal": "^4.0.7", "@uidotdev/usehooks": "^2.4.1", + "@vitejs/plugin-react-swc": "^3.7.1", "classnames": "^2.5.1", "csstype": "^3.1.3", "dayjs": "^1.11.13", @@ -75,6 +75,7 @@ }, "devDependencies": { "@craco/craco": "^7.1.0", + "@swc/plugin-styled-components": "^3.0.3", "@tauri-apps/cli": "2.0.2", "@types/jest": "^29.5.13", "@types/loadable__component": "^5.13.9", @@ -90,8 +91,9 @@ "@vitejs/plugin-react": "^4.3.2", "cross-env": "^7.0.3", "eslint": "^8.57.1", - "eslint-plugin-react-hooks": "^4.6.2", + "eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-refresh": "^0.4.12", + "source-map-explorer": "^2.5.3", "typescript": "^5.6.3", "vite": "^5.4.8", "vite-plugin-chunk-split": "^0.5.0", @@ -108,12 +110,14 @@ "url": "git+https://github.com/spacebarchat/client.git" }, "scripts": { + "dev": "cross-env VITE_ENV_DEV=true vite --open", + "preview": "vite preview", + "analyze": "source-map-explorer 'dist/asset/*.js'", "build": "tsc && vite build", + "build:dev": "tsc && cross-env VITE_ENV_DEV=true vite build", "ci:prebuild": "node scripts/tauri-version.js", - "dev": "vite", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint:fix": "pnpx prettier . --write", - "preview": "vite preview", "tauri:dev": "pnpm run ci:prebuild && tauri dev", "tauri:build": "pnpm run ci:prebuild && tauri build", "tauri:android:dev": "pnpm run ci:prebuild && tauri android dev", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c628592b..deb8b73d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -38,9 +38,6 @@ importers: '@mdi/react': specifier: ^1.6.1 version: 1.6.1 - '@mui/material': - specifier: ^6.1.3 - version: 6.1.3(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@originjs/vite-plugin-commonjs': specifier: ^1.0.3 version: 1.0.3 @@ -101,6 +98,9 @@ importers: '@uidotdev/usehooks': specifier: ^2.4.1 version: 2.4.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@vitejs/plugin-react-swc': + specifier: ^3.7.1 + version: 3.7.1(vite@5.4.8(@types/node@22.7.5)(terser@5.34.1)) classnames: specifier: ^2.5.1 version: 2.5.1 @@ -215,7 +215,10 @@ importers: devDependencies: '@craco/craco': specifier: ^7.1.0 - version: 7.1.0(@types/node@22.7.5)(postcss@8.4.47)(react-scripts@5.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(@types/babel__core@7.20.5)(eslint@8.57.1)(react@18.3.1)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3))(type-fest@4.26.1)(typescript@5.6.3))(typescript@5.6.3) + version: 7.1.0(@swc/core@1.7.35)(@types/node@22.7.5)(postcss@8.4.47)(react-scripts@5.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(@swc/core@1.7.35)(@types/babel__core@7.20.5)(eslint@8.57.1)(react@18.3.1)(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3))(type-fest@4.26.1)(typescript@5.6.3))(typescript@5.6.3) + '@swc/plugin-styled-components': + specifier: ^3.0.3 + version: 3.0.3 '@tauri-apps/cli': specifier: 2.0.2 version: 2.0.2 @@ -262,11 +265,14 @@ importers: specifier: ^8.57.1 version: 8.57.1 eslint-plugin-react-hooks: - specifier: ^4.6.2 - version: 4.6.2(eslint@8.57.1) + specifier: ^5.1.0 + version: 5.1.0(eslint@8.57.1) eslint-plugin-react-refresh: specifier: ^0.4.12 version: 0.4.12(eslint@8.57.1) + source-map-explorer: + specifier: ^2.5.3 + version: 2.5.3 typescript: specifier: ^5.6.3 version: 5.6.3 @@ -1835,86 +1841,6 @@ packages: '@mdi/react@1.6.1': resolution: {integrity: sha512-4qZeDcluDFGFTWkHs86VOlHkm6gnKaMql13/gpIcUQ8kzxHgpj31NuCkD8abECVfbULJ3shc7Yt4HJ6Wu6SN4w==} - '@mui/core-downloads-tracker@6.1.3': - resolution: {integrity: sha512-ajMUgdfhTb++rwqj134Cq9f4SRN8oXUqMRnY72YBnXiXai3olJLLqETheRlq3MM8wCKrbq7g6j7iWL1VvP44VQ==} - - '@mui/material@6.1.3': - resolution: {integrity: sha512-loV5MBoMKLrK80JeWINmQ1A4eWoLv51O2dBPLJ260IAhupkB3Wol8lEQTEvvR2vO3o6xRHuXe1WaQEP6N3riqg==} - engines: {node: '>=14.0.0'} - peerDependencies: - '@emotion/react': ^11.5.0 - '@emotion/styled': ^11.3.0 - '@mui/material-pigment-css': ^6.1.3 - '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - '@emotion/react': - optional: true - '@emotion/styled': - optional: true - '@mui/material-pigment-css': - optional: true - '@types/react': - optional: true - - '@mui/private-theming@6.1.3': - resolution: {integrity: sha512-XK5OYCM0x7gxWb/WBEySstBmn+dE3YKX7U7jeBRLm6vHU5fGUd7GiJWRirpivHjOK9mRH6E1MPIVd+ze5vguKQ==} - engines: {node: '>=14.0.0'} - peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@mui/styled-engine@6.1.3': - resolution: {integrity: sha512-i4yh9m+eMZE3cNERpDhVr6Wn73Yz6C7MH0eE2zZvw8d7EFkIJlCQNZd1xxGZqarD2DDq2qWHcjIOucWGhxACtA==} - engines: {node: '>=14.0.0'} - peerDependencies: - '@emotion/react': ^11.4.1 - '@emotion/styled': ^11.3.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - '@emotion/react': - optional: true - '@emotion/styled': - optional: true - - '@mui/system@6.1.3': - resolution: {integrity: sha512-ILaD9UsLTBLjMcep3OumJMXh1PYr7aqnkHm/L47bH46+YmSL1zWAX6tWG8swEQROzW2GvYluEMp5FreoxOOC6w==} - engines: {node: '>=14.0.0'} - peerDependencies: - '@emotion/react': ^11.5.0 - '@emotion/styled': ^11.3.0 - '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - '@emotion/react': - optional: true - '@emotion/styled': - optional: true - '@types/react': - optional: true - - '@mui/types@7.2.18': - resolution: {integrity: sha512-uvK9dWeyCJl/3ocVnTOS6nlji/Knj8/tVqVX03UVTpdmTJYu/s4jtDd9Kvv0nRGE0CUSNW1UYAci7PYypjealg==} - peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - - '@mui/utils@6.1.3': - resolution: {integrity: sha512-4JBpLkjprlKjN10DGb1aiy/ii9TKbQ601uSHtAmYFAS879QZgAD7vRnv/YBE4iBbc7NXzFgbQMCOFrupXWekIA==} - engines: {node: '>=14.0.0'} - peerDependencies: - '@types/react': ^17.0.0 || ^18.0.0 || ^19.0.0 - react: ^17.0.0 || ^18.0.0 || ^19.0.0 - peerDependenciesMeta: - '@types/react': - optional: true - '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} @@ -1963,9 +1889,6 @@ packages: webpack-plugin-serve: optional: true - '@popperjs/core@2.11.8': - resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} - '@react-native-community/cli-clean@14.1.0': resolution: {integrity: sha512-/C4j1yntLo6faztNgZnsDtgpGqa6j0+GYrxOY8LqaKAN03OCnoeUUKO6w78dycbYSGglc1xjJg2RZI/M2oF2AA==} @@ -2447,6 +2370,84 @@ packages: resolution: {integrity: sha512-DOBOK255wfQxguUta2INKkzPj6AIS6iafZYiYmHn6W3pHlycSRRlvWKCfLDG10fXfLWqE3DJHgRUOyJYmARa7g==} engines: {node: '>=10'} + '@swc/core-darwin-arm64@1.7.35': + resolution: {integrity: sha512-BQSSozVxjxS+SVQz6e3GC/+OBWGIK3jfe52pWdANmycdjF3ch7lrCKTHTU7eHwyoJ96mofszPf5AsiVJF34Fwg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + + '@swc/core-darwin-x64@1.7.35': + resolution: {integrity: sha512-44TYdKN/EWtkU88foXR7IGki9JzhEJzaFOoPevfi9Xe7hjAD/x2+AJOWWqQNzDPMz9+QewLdUVLyR6s5okRgtg==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + + '@swc/core-linux-arm-gnueabihf@1.7.35': + resolution: {integrity: sha512-ccfA5h3zxwioD+/z/AmYtkwtKz9m4rWTV7RoHq6Jfsb0cXHrd6tbcvgqRWXra1kASlE+cDWsMtEZygs9dJRtUQ==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + + '@swc/core-linux-arm64-gnu@1.7.35': + resolution: {integrity: sha512-hx65Qz+G4iG/IVtxJKewC5SJdki8PAPFGl6gC/57Jb0+jA4BIoGLD/J3Q3rCPeoHfdqpkCYpahtyUq8CKx41Jg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/core-linux-arm64-musl@1.7.35': + resolution: {integrity: sha512-kL6tQL9No7UEoEvDRuPxzPTpxrvbwYteNRbdChSSP74j13/55G2/2hLmult5yFFaWuyoyU/2lvzjRL/i8OLZxg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/core-linux-x64-gnu@1.7.35': + resolution: {integrity: sha512-Ke4rcLQSwCQ2LHdJX1FtnqmYNQ3IX6BddKlUtS7mcK13IHkQzZWp0Dcu6MgNA3twzb/dBpKX5GLy07XdGgfmyw==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/core-linux-x64-musl@1.7.35': + resolution: {integrity: sha512-T30tlLnz0kYyDFyO5RQF5EQ4ENjW9+b56hEGgFUYmfhFhGA4E4V67iEx7KIG4u0whdPG7oy3qjyyIeTb7nElEw==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/core-win32-arm64-msvc@1.7.35': + resolution: {integrity: sha512-CfM/k8mvtuMyX+okRhemfLt784PLS0KF7Q9djA8/Dtavk0L5Ghnq+XsGltO3d8B8+XZ7YOITsB14CrjehzeHsg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + + '@swc/core-win32-ia32-msvc@1.7.35': + resolution: {integrity: sha512-ATB3uuH8j/RmS64EXQZJSbo2WXfRNpTnQszHME/sGaexsuxeijrp3DTYSFAA3R2Bu6HbIIX6jempe1Au8I3j+A==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + + '@swc/core-win32-x64-msvc@1.7.35': + resolution: {integrity: sha512-iDGfQO1571NqWUXtLYDhwIELA/wadH42ioGn+J9R336nWx40YICzy9UQyslWRhqzhQ5kT+QXAW/MoCWc058N6Q==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + + '@swc/core@1.7.35': + resolution: {integrity: sha512-3cUteCTbr2r5jqfgx0r091sfq5Mgh6F1SQh8XAOnSvtKzwv2bC31mvBHVAieD1uPa2kHJhLav20DQgXOhpEitw==} + engines: {node: '>=10'} + peerDependencies: + '@swc/helpers': '*' + peerDependenciesMeta: + '@swc/helpers': + optional: true + + '@swc/counter@0.1.3': + resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} + + '@swc/plugin-styled-components@3.0.3': + resolution: {integrity: sha512-IeEaH6aFaYav0L/AyLeblhrO+e8FCS/HwIMJfxo0z2edq9JNzRiCkTI5z1q5vObSRT+T51fkiBZiyqby3D8VSQ==} + + '@swc/types@0.1.13': + resolution: {integrity: sha512-JL7eeCk6zWCbiYQg2xQSdLXQJl8Qoc9rXmG2cEKvHe3CKwMHwHGpfOb8frzNLmbycOo6I51qxnLnn9ESf4I20Q==} + '@tauri-apps/api@2.0.2': resolution: {integrity: sha512-3wSwmG+1kr6WrgAFKK5ijkNFPp8TT3FLj3YHUb5EwMO+3FxX4uWlfSWkeeBy+Kc1RsKzugtYLuuya+98Flj+3w==} @@ -2756,9 +2757,6 @@ packages: '@types/react-syntax-highlighter@15.5.13': resolution: {integrity: sha512-uLGJ87j6Sz8UaBAooU0T6lWJ0dBmjZgN1PZTrj05TNql2/XpC6+4HhMT5syIdFUUt+FASfCeLLv4kBygNU+8qA==} - '@types/react-transition-group@4.4.11': - resolution: {integrity: sha512-RM05tAniPZ5DZPzzNFP+DmrcOdD0efDUxMy3145oljWSl3x9ZV5vhme98gTxFrj2lhXvmGNnUiuDyJgY9IKkNA==} - '@types/react-virtualized@9.21.30': resolution: {integrity: sha512-4l2TFLQ8BCjNDQlvH85tU6gctuZoEdgYzENQyZHpgTHU7hoLzYgPSOALMAeA58LOWua8AzC6wBivPj1lfl6JgQ==} @@ -2953,6 +2951,11 @@ packages: '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + '@vitejs/plugin-react-swc@3.7.1': + resolution: {integrity: sha512-vgWOY0i1EROUK0Ctg1hwhtC3SdcDjZcdit4Ups4aPkDcB1jYhmo+RMYWY87cmXMhvtD5uf8lV89j2w16vkdSVg==} + peerDependencies: + vite: ^4 || ^5 + '@vitejs/plugin-react@4.3.2': resolution: {integrity: sha512-hieu+o05v4glEBucTcKMK3dlES0OeJlD9YVOAPraVMOInBCwzumaIFiUjr4bHK7NPgnAHgiskUoceKercrN8vg==} engines: {node: ^14.18.0 || >=16.0.0} @@ -3413,6 +3416,11 @@ packages: bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + btoa@1.2.1: + resolution: {integrity: sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==} + engines: {node: '>= 0.4.0'} + hasBin: true + buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} @@ -3598,10 +3606,6 @@ packages: resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} engines: {node: '>=6'} - clsx@2.1.1: - resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} - engines: {node: '>=6'} - co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} @@ -4528,6 +4532,12 @@ packages: peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + eslint-plugin-react-hooks@5.1.0: + resolution: {integrity: sha512-mpJRtPgHN2tNAvZ35AMfqeB3Xqeo273QxrHJsbBEPWODRM4r0yB6jfoROqKEYrOn27UtRPpcpHc2UqyBSuUNTw==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 + eslint-plugin-react-refresh@0.4.12: resolution: {integrity: sha512-9neVjoGv20FwYtCP6CB1dzR1vr57ZDNOXst21wd2xJ/cTlM2xLq0GWVlSNTdMn/4BtP6cHYBMCSp1wFBJ9jBsg==} peerDependencies: @@ -4571,6 +4581,7 @@ packages: eslint@8.57.1: resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true espree@9.6.1: @@ -4903,6 +4914,7 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported global-modules@2.0.0: resolution: {integrity: sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==} @@ -5156,6 +5168,7 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.3: resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} @@ -7318,12 +7331,6 @@ packages: peerDependencies: react: '>= 0.14.0' - react-transition-group@4.4.5: - resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==} - peerDependencies: - react: '>=16.6.0' - react-dom: '>=16.6.0' - react-use-error-boundary@3.0.0: resolution: {integrity: sha512-5urkfyU3ZzInEMSHe1gxtDzlQAHs0krTt0V6h8H2L5nXhDKq3OYXnCs9lGHDkEkYvLmsphw8ap5g8uYfvrkJng==} peerDependencies: @@ -7519,6 +7526,7 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rollup-plugin-terser@7.0.2: @@ -7733,6 +7741,11 @@ packages: source-list-map@2.0.1: resolution: {integrity: sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==} + source-map-explorer@2.5.3: + resolution: {integrity: sha512-qfUGs7UHsOBE5p/lGfQdaAj/5U/GWYBw2imEpD6UQNkqElYonkow8t+HBL1qqIl3CuGZx7n8/CQo4x1HwSHhsg==} + engines: {node: '>=12'} + hasBin: true + source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -8008,6 +8021,10 @@ packages: resolution: {integrity: sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==} engines: {node: '>=6.0.0'} + temp@0.9.4: + resolution: {integrity: sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==} + engines: {node: '>=6.0.0'} + tempy@0.6.0: resolution: {integrity: sha512-G13vtMYPT/J8A4X2SjdtBTphZlrp1gKv6hZiOjw14RCWg6GbHuQBGtjlx75xLbYV/wEc0D7G5K4rxKP/cXk8Bw==} engines: {node: '>=10'} @@ -8605,6 +8622,7 @@ packages: workbox-google-analytics@6.6.0: resolution: {integrity: sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==} + deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained workbox-navigation-preload@6.6.0: resolution: {integrity: sha512-utNEWG+uOfXdaZmvhshrh7KzhDu/1iMHyQOV6Aqup8Mm78D286ugu5k9MFD9SzBT5TcwgwSORVvInaXWbvKz9Q==} @@ -10715,14 +10733,14 @@ snapshots: '@bcoe/v8-coverage@0.2.3': {} - '@craco/craco@7.1.0(@types/node@22.7.5)(postcss@8.4.47)(react-scripts@5.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(@types/babel__core@7.20.5)(eslint@8.57.1)(react@18.3.1)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3))(type-fest@4.26.1)(typescript@5.6.3))(typescript@5.6.3)': + '@craco/craco@7.1.0(@swc/core@1.7.35)(@types/node@22.7.5)(postcss@8.4.47)(react-scripts@5.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(@swc/core@1.7.35)(@types/babel__core@7.20.5)(eslint@8.57.1)(react@18.3.1)(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3))(type-fest@4.26.1)(typescript@5.6.3))(typescript@5.6.3)': dependencies: autoprefixer: 10.4.17(postcss@8.4.47) cosmiconfig: 7.1.0 - cosmiconfig-typescript-loader: 1.0.9(@types/node@22.7.5)(cosmiconfig@7.1.0)(typescript@5.6.3) + cosmiconfig-typescript-loader: 1.0.9(@swc/core@1.7.35)(@types/node@22.7.5)(cosmiconfig@7.1.0)(typescript@5.6.3) cross-spawn: 7.0.3 lodash: 4.17.21 - react-scripts: 5.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(@types/babel__core@7.20.5)(eslint@8.57.1)(react@18.3.1)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3))(type-fest@4.26.1)(typescript@5.6.3) + react-scripts: 5.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(@swc/core@1.7.35)(@types/babel__core@7.20.5)(eslint@8.57.1)(react@18.3.1)(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3))(type-fest@4.26.1)(typescript@5.6.3) semver: 7.6.0 webpack-merge: 5.10.0 transitivePeerDependencies: @@ -11109,7 +11127,7 @@ snapshots: jest-util: 28.1.3 slash: 3.0.0 - '@jest/core@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3))': + '@jest/core@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3))': dependencies: '@jest/console': 27.5.1 '@jest/reporters': 27.5.1 @@ -11123,7 +11141,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 27.5.1 - jest-config: 27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) + jest-config: 27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) jest-haste-map: 27.5.1 jest-message-util: 27.5.1 jest-regex-util: 27.5.1 @@ -11374,83 +11392,6 @@ snapshots: dependencies: prop-types: 15.8.1 - '@mui/core-downloads-tracker@6.1.3': {} - - '@mui/material@6.1.3(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.25.7 - '@mui/core-downloads-tracker': 6.1.3 - '@mui/system': 6.1.3(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1) - '@mui/types': 7.2.18(@types/react@18.3.11) - '@mui/utils': 6.1.3(@types/react@18.3.11)(react@18.3.1) - '@popperjs/core': 2.11.8 - '@types/react-transition-group': 4.4.11 - clsx: 2.1.1 - csstype: 3.1.3 - prop-types: 15.8.1 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-is: 18.3.1 - react-transition-group: 4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - optionalDependencies: - '@emotion/react': 11.13.3(@types/react@18.3.11)(react@18.3.1) - '@emotion/styled': 11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1) - '@types/react': 18.3.11 - - '@mui/private-theming@6.1.3(@types/react@18.3.11)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.25.7 - '@mui/utils': 6.1.3(@types/react@18.3.11)(react@18.3.1) - prop-types: 15.8.1 - react: 18.3.1 - optionalDependencies: - '@types/react': 18.3.11 - - '@mui/styled-engine@6.1.3(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(react@18.3.1)': - dependencies: - '@babel/runtime': 7.25.7 - '@emotion/cache': 11.13.1 - '@emotion/serialize': 1.3.2 - '@emotion/sheet': 1.4.0 - csstype: 3.1.3 - prop-types: 15.8.1 - react: 18.3.1 - optionalDependencies: - '@emotion/react': 11.13.3(@types/react@18.3.11)(react@18.3.1) - '@emotion/styled': 11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1) - - '@mui/system@6.1.3(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.25.7 - '@mui/private-theming': 6.1.3(@types/react@18.3.11)(react@18.3.1) - '@mui/styled-engine': 6.1.3(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@emotion/styled@11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1))(react@18.3.1) - '@mui/types': 7.2.18(@types/react@18.3.11) - '@mui/utils': 6.1.3(@types/react@18.3.11)(react@18.3.1) - clsx: 2.1.1 - csstype: 3.1.3 - prop-types: 15.8.1 - react: 18.3.1 - optionalDependencies: - '@emotion/react': 11.13.3(@types/react@18.3.11)(react@18.3.1) - '@emotion/styled': 11.13.0(@emotion/react@11.13.3(@types/react@18.3.11)(react@18.3.1))(@types/react@18.3.11)(react@18.3.1) - '@types/react': 18.3.11 - - '@mui/types@7.2.18(@types/react@18.3.11)': - optionalDependencies: - '@types/react': 18.3.11 - - '@mui/utils@6.1.3(@types/react@18.3.11)(react@18.3.1)': - dependencies: - '@babel/runtime': 7.25.7 - '@mui/types': 7.2.18(@types/react@18.3.11) - '@types/prop-types': 15.7.13 - clsx: 2.1.1 - prop-types: 15.8.1 - react: 18.3.1 - react-is: 18.3.1 - optionalDependencies: - '@types/react': 18.3.11 - '@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1': dependencies: eslint-scope: 5.1.1 @@ -11474,7 +11415,7 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@pmmmwh/react-refresh-webpack-plugin@0.5.15(react-refresh@0.11.0)(type-fest@4.26.1)(webpack-dev-server@4.15.2(webpack@5.95.0))(webpack@5.95.0)': + '@pmmmwh/react-refresh-webpack-plugin@0.5.15(react-refresh@0.11.0)(type-fest@4.26.1)(webpack-dev-server@4.15.2(webpack@5.95.0(@swc/core@1.7.35)))(webpack@5.95.0(@swc/core@1.7.35))': dependencies: ansi-html: 0.0.9 core-js-pure: 3.38.1 @@ -11484,12 +11425,10 @@ snapshots: react-refresh: 0.11.0 schema-utils: 4.2.0 source-map: 0.7.4 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) optionalDependencies: type-fest: 4.26.1 - webpack-dev-server: 4.15.2(webpack@5.95.0) - - '@popperjs/core@2.11.8': {} + webpack-dev-server: 4.15.2(webpack@5.95.0(@swc/core@1.7.35)) '@react-native-community/cli-clean@14.1.0': dependencies: @@ -12139,6 +12078,62 @@ snapshots: transitivePeerDependencies: - supports-color + '@swc/core-darwin-arm64@1.7.35': + optional: true + + '@swc/core-darwin-x64@1.7.35': + optional: true + + '@swc/core-linux-arm-gnueabihf@1.7.35': + optional: true + + '@swc/core-linux-arm64-gnu@1.7.35': + optional: true + + '@swc/core-linux-arm64-musl@1.7.35': + optional: true + + '@swc/core-linux-x64-gnu@1.7.35': + optional: true + + '@swc/core-linux-x64-musl@1.7.35': + optional: true + + '@swc/core-win32-arm64-msvc@1.7.35': + optional: true + + '@swc/core-win32-ia32-msvc@1.7.35': + optional: true + + '@swc/core-win32-x64-msvc@1.7.35': + optional: true + + '@swc/core@1.7.35': + dependencies: + '@swc/counter': 0.1.3 + '@swc/types': 0.1.13 + optionalDependencies: + '@swc/core-darwin-arm64': 1.7.35 + '@swc/core-darwin-x64': 1.7.35 + '@swc/core-linux-arm-gnueabihf': 1.7.35 + '@swc/core-linux-arm64-gnu': 1.7.35 + '@swc/core-linux-arm64-musl': 1.7.35 + '@swc/core-linux-x64-gnu': 1.7.35 + '@swc/core-linux-x64-musl': 1.7.35 + '@swc/core-win32-arm64-msvc': 1.7.35 + '@swc/core-win32-ia32-msvc': 1.7.35 + '@swc/core-win32-x64-msvc': 1.7.35 + + '@swc/counter@0.1.3': {} + + '@swc/plugin-styled-components@3.0.3': + dependencies: + '@swc/counter': 0.1.3 + + '@swc/types@0.1.13': + dependencies: + '@swc/counter': 0.1.3 + '@tauri-apps/api@2.0.2': {} '@tauri-apps/cli-darwin-arm64@2.0.2': @@ -12464,10 +12459,6 @@ snapshots: dependencies: '@types/react': 18.3.11 - '@types/react-transition-group@4.4.11': - dependencies: - '@types/react': 18.3.11 - '@types/react-virtualized@9.21.30': dependencies: '@types/prop-types': 15.7.11 @@ -12723,6 +12714,13 @@ snapshots: '@ungap/structured-clone@1.2.0': {} + '@vitejs/plugin-react-swc@3.7.1(vite@5.4.8(@types/node@22.7.5)(terser@5.34.1))': + dependencies: + '@swc/core': 1.7.35 + vite: 5.4.8(@types/node@22.7.5)(terser@5.34.1) + transitivePeerDependencies: + - '@swc/helpers' + '@vitejs/plugin-react@4.3.2(vite@5.4.8(@types/node@22.7.5)(terser@5.34.1))': dependencies: '@babel/core': 7.25.2 @@ -13098,14 +13096,14 @@ snapshots: transitivePeerDependencies: - supports-color - babel-loader@8.4.1(@babel/core@7.25.7)(webpack@5.95.0): + babel-loader@8.4.1(@babel/core@7.25.7)(webpack@5.95.0(@swc/core@1.7.35)): dependencies: '@babel/core': 7.25.7 find-cache-dir: 3.3.2 loader-utils: 2.0.4 make-dir: 3.1.0 schema-utils: 2.7.1 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) babel-plugin-istanbul@6.1.1: dependencies: @@ -13334,6 +13332,8 @@ snapshots: dependencies: node-int64: 0.4.0 + btoa@1.2.1: {} + buffer-from@1.1.2: {} buffer@5.7.1: @@ -13518,8 +13518,6 @@ snapshots: clsx@1.2.1: {} - clsx@2.1.1: {} - co@4.6.0: {} coa@2.0.2: @@ -13631,11 +13629,11 @@ snapshots: core-util-is@1.0.3: {} - cosmiconfig-typescript-loader@1.0.9(@types/node@22.7.5)(cosmiconfig@7.1.0)(typescript@5.6.3): + cosmiconfig-typescript-loader@1.0.9(@swc/core@1.7.35)(@types/node@22.7.5)(cosmiconfig@7.1.0)(typescript@5.6.3): dependencies: '@types/node': 22.7.5 cosmiconfig: 7.1.0 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.6.3) + ts-node: 10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3) typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -13714,7 +13712,7 @@ snapshots: postcss: 8.4.47 postcss-selector-parser: 6.1.2 - css-loader@6.11.0(webpack@5.95.0): + css-loader@6.11.0(webpack@5.95.0(@swc/core@1.7.35)): dependencies: icss-utils: 5.1.0(postcss@8.4.47) postcss: 8.4.47 @@ -13725,9 +13723,9 @@ snapshots: postcss-value-parser: 4.2.0 semver: 7.6.3 optionalDependencies: - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) - css-minimizer-webpack-plugin@3.4.1(webpack@5.95.0): + css-minimizer-webpack-plugin@3.4.1(webpack@5.95.0(@swc/core@1.7.35)): dependencies: cssnano: 5.1.15(postcss@8.4.47) jest-worker: 27.5.1 @@ -13735,7 +13733,7 @@ snapshots: schema-utils: 4.2.0 serialize-javascript: 6.0.2 source-map: 0.6.1 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) css-prefers-color-scheme@6.0.3(postcss@8.4.47): dependencies: @@ -14369,7 +14367,7 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(eslint@8.57.1)(jest@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)))(typescript@5.6.3): + eslint-config-react-app@7.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(eslint@8.57.1)(jest@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)))(typescript@5.6.3): dependencies: '@babel/core': 7.25.7 '@babel/eslint-parser': 7.25.7(@babel/core@7.25.7)(eslint@8.57.1) @@ -14381,7 +14379,7 @@ snapshots: eslint: 8.57.1 eslint-plugin-flowtype: 8.0.3(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(eslint@8.57.1) eslint-plugin-import: 2.31.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1) - eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(jest@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)))(typescript@5.6.3) + eslint-plugin-jest: 25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(jest@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)))(typescript@5.6.3) eslint-plugin-jsx-a11y: 6.10.0(eslint@8.57.1) eslint-plugin-react: 7.37.1(eslint@8.57.1) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.1) @@ -14451,13 +14449,13 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(jest@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)))(typescript@5.6.3): + eslint-plugin-jest@25.7.0(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(jest@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)))(typescript@5.6.3): dependencies: '@typescript-eslint/experimental-utils': 5.62.0(eslint@8.57.1)(typescript@5.6.3) eslint: 8.57.1 optionalDependencies: '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.6.3))(eslint@8.57.1)(typescript@5.6.3) - jest: 27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) + jest: 27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) transitivePeerDependencies: - supports-color - typescript @@ -14486,6 +14484,10 @@ snapshots: dependencies: eslint: 8.57.1 + eslint-plugin-react-hooks@5.1.0(eslint@8.57.1): + dependencies: + eslint: 8.57.1 + eslint-plugin-react-refresh@0.4.12(eslint@8.57.1): dependencies: eslint: 8.57.1 @@ -14534,7 +14536,7 @@ snapshots: eslint-visitor-keys@3.4.3: {} - eslint-webpack-plugin@3.2.0(eslint@8.57.1)(webpack@5.95.0): + eslint-webpack-plugin@3.2.0(eslint@8.57.1)(webpack@5.95.0(@swc/core@1.7.35)): dependencies: '@types/eslint': 8.56.12 eslint: 8.57.1 @@ -14542,7 +14544,7 @@ snapshots: micromatch: 4.0.8 normalize-path: 3.0.0 schema-utils: 4.2.0 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) eslint@8.57.1: dependencies: @@ -14734,11 +14736,11 @@ snapshots: dependencies: flat-cache: 3.2.0 - file-loader@6.2.0(webpack@5.95.0): + file-loader@6.2.0(webpack@5.95.0(@swc/core@1.7.35)): dependencies: loader-utils: 2.0.4 schema-utils: 3.3.0 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) filelist@1.0.4: dependencies: @@ -14827,7 +14829,7 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@6.5.3(eslint@8.57.1)(typescript@5.6.3)(webpack@5.95.0): + fork-ts-checker-webpack-plugin@6.5.3(eslint@8.57.1)(typescript@5.6.3)(webpack@5.95.0(@swc/core@1.7.35)): dependencies: '@babel/code-frame': 7.25.7 '@types/json-schema': 7.0.15 @@ -14843,7 +14845,7 @@ snapshots: semver: 7.6.3 tapable: 1.1.3 typescript: 5.6.3 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) optionalDependencies: eslint: 8.57.1 @@ -15111,7 +15113,7 @@ snapshots: html-url-attributes@3.0.0: {} - html-webpack-plugin@5.6.0(webpack@5.95.0): + html-webpack-plugin@5.6.0(webpack@5.95.0(@swc/core@1.7.35)): dependencies: '@types/html-minifier-terser': 6.1.0 html-minifier-terser: 6.1.0 @@ -15119,7 +15121,7 @@ snapshots: pretty-error: 4.0.0 tapable: 2.2.1 optionalDependencies: - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) htmlparser2@6.1.0: dependencies: @@ -15535,16 +15537,16 @@ snapshots: transitivePeerDependencies: - supports-color - jest-cli@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)): + jest-cli@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)): dependencies: - '@jest/core': 27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) + '@jest/core': 27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.2.0 - jest-config: 27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) + jest-config: 27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) jest-util: 27.5.1 jest-validate: 27.5.1 prompts: 2.4.2 @@ -15556,7 +15558,7 @@ snapshots: - ts-node - utf-8-validate - jest-config@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)): + jest-config@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)): dependencies: '@babel/core': 7.25.7 '@jest/test-sequencer': 27.5.1 @@ -15583,7 +15585,7 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.6.3) + ts-node: 10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3) transitivePeerDependencies: - bufferutil - canvas @@ -15920,11 +15922,11 @@ snapshots: leven: 3.1.0 pretty-format: 29.7.0 - jest-watch-typeahead@1.1.0(jest@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3))): + jest-watch-typeahead@1.1.0(jest@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3))): dependencies: ansi-escapes: 4.3.2 chalk: 4.1.2 - jest: 27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) + jest: 27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) jest-regex-util: 28.0.2 jest-watcher: 28.1.3 slash: 4.0.0 @@ -15977,11 +15979,11 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)): + jest@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)): dependencies: - '@jest/core': 27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) + '@jest/core': 27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) import-local: 3.2.0 - jest-cli: 27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) + jest-cli: 27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) transitivePeerDependencies: - bufferutil - canvas @@ -16855,11 +16857,11 @@ snapshots: min-indent@1.0.1: {} - mini-css-extract-plugin@2.9.1(webpack@5.95.0): + mini-css-extract-plugin@2.9.1(webpack@5.95.0(@swc/core@1.7.35)): dependencies: schema-utils: 4.2.0 tapable: 2.2.1 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) minimalistic-assert@1.0.1: {} @@ -17381,21 +17383,21 @@ snapshots: postcss: 8.4.47 postcss-value-parser: 4.2.0 - postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)): + postcss-load-config@4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)): dependencies: lilconfig: 3.1.2 yaml: 2.5.1 optionalDependencies: postcss: 8.4.47 - ts-node: 10.9.2(@types/node@22.7.5)(typescript@5.6.3) + ts-node: 10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3) - postcss-loader@6.2.1(postcss@8.4.47)(webpack@5.95.0): + postcss-loader@6.2.1(postcss@8.4.47)(webpack@5.95.0(@swc/core@1.7.35)): dependencies: cosmiconfig: 7.1.0 klona: 2.0.6 postcss: 8.4.47 semver: 7.6.3 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) postcss-logical@5.0.4(postcss@8.4.47): dependencies: @@ -17799,7 +17801,7 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - react-dev-utils@12.0.1(eslint@8.57.1)(typescript@5.6.3)(webpack@5.95.0): + react-dev-utils@12.0.1(eslint@8.57.1)(typescript@5.6.3)(webpack@5.95.0(@swc/core@1.7.35)): dependencies: '@babel/code-frame': 7.25.7 address: 1.2.2 @@ -17810,7 +17812,7 @@ snapshots: escape-string-regexp: 4.0.0 filesize: 8.0.7 find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.57.1)(typescript@5.6.3)(webpack@5.95.0) + fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.57.1)(typescript@5.6.3)(webpack@5.95.0(@swc/core@1.7.35)) global-modules: 2.0.0 globby: 11.1.0 gzip-size: 6.0.0 @@ -17825,7 +17827,7 @@ snapshots: shell-quote: 1.8.1 strip-ansi: 6.0.1 text-table: 0.2.0 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) optionalDependencies: typescript: 5.6.3 transitivePeerDependencies: @@ -18006,56 +18008,56 @@ snapshots: '@remix-run/router': 1.19.2 react: 18.3.1 - react-scripts@5.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(@types/babel__core@7.20.5)(eslint@8.57.1)(react@18.3.1)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3))(type-fest@4.26.1)(typescript@5.6.3): + react-scripts@5.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(@swc/core@1.7.35)(@types/babel__core@7.20.5)(eslint@8.57.1)(react@18.3.1)(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3))(type-fest@4.26.1)(typescript@5.6.3): dependencies: '@babel/core': 7.25.7 - '@pmmmwh/react-refresh-webpack-plugin': 0.5.15(react-refresh@0.11.0)(type-fest@4.26.1)(webpack-dev-server@4.15.2(webpack@5.95.0))(webpack@5.95.0) + '@pmmmwh/react-refresh-webpack-plugin': 0.5.15(react-refresh@0.11.0)(type-fest@4.26.1)(webpack-dev-server@4.15.2(webpack@5.95.0(@swc/core@1.7.35)))(webpack@5.95.0(@swc/core@1.7.35)) '@svgr/webpack': 5.5.0 babel-jest: 27.5.1(@babel/core@7.25.7) - babel-loader: 8.4.1(@babel/core@7.25.7)(webpack@5.95.0) + babel-loader: 8.4.1(@babel/core@7.25.7)(webpack@5.95.0(@swc/core@1.7.35)) babel-plugin-named-asset-import: 0.3.8(@babel/core@7.25.7) babel-preset-react-app: 10.0.1 bfj: 7.1.0 browserslist: 4.24.0 camelcase: 6.3.0 case-sensitive-paths-webpack-plugin: 2.4.0 - css-loader: 6.11.0(webpack@5.95.0) - css-minimizer-webpack-plugin: 3.4.1(webpack@5.95.0) + css-loader: 6.11.0(webpack@5.95.0(@swc/core@1.7.35)) + css-minimizer-webpack-plugin: 3.4.1(webpack@5.95.0(@swc/core@1.7.35)) dotenv: 10.0.0 dotenv-expand: 5.1.0 eslint: 8.57.1 - eslint-config-react-app: 7.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(eslint@8.57.1)(jest@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)))(typescript@5.6.3) - eslint-webpack-plugin: 3.2.0(eslint@8.57.1)(webpack@5.95.0) - file-loader: 6.2.0(webpack@5.95.0) + eslint-config-react-app: 7.0.1(@babel/plugin-syntax-flow@7.25.7(@babel/core@7.23.9))(@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.23.9))(eslint@8.57.1)(jest@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)))(typescript@5.6.3) + eslint-webpack-plugin: 3.2.0(eslint@8.57.1)(webpack@5.95.0(@swc/core@1.7.35)) + file-loader: 6.2.0(webpack@5.95.0(@swc/core@1.7.35)) fs-extra: 10.1.0 - html-webpack-plugin: 5.6.0(webpack@5.95.0) + html-webpack-plugin: 5.6.0(webpack@5.95.0(@swc/core@1.7.35)) identity-obj-proxy: 3.0.0 - jest: 27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) + jest: 27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) jest-resolve: 27.5.1 - jest-watch-typeahead: 1.1.0(jest@27.5.1(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3))) - mini-css-extract-plugin: 2.9.1(webpack@5.95.0) + jest-watch-typeahead: 1.1.0(jest@27.5.1(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3))) + mini-css-extract-plugin: 2.9.1(webpack@5.95.0(@swc/core@1.7.35)) postcss: 8.4.47 postcss-flexbugs-fixes: 5.0.2(postcss@8.4.47) - postcss-loader: 6.2.1(postcss@8.4.47)(webpack@5.95.0) + postcss-loader: 6.2.1(postcss@8.4.47)(webpack@5.95.0(@swc/core@1.7.35)) postcss-normalize: 10.0.1(browserslist@4.24.0)(postcss@8.4.47) postcss-preset-env: 7.8.3(postcss@8.4.47) prompts: 2.4.2 react: 18.3.1 react-app-polyfill: 3.0.0 - react-dev-utils: 12.0.1(eslint@8.57.1)(typescript@5.6.3)(webpack@5.95.0) + react-dev-utils: 12.0.1(eslint@8.57.1)(typescript@5.6.3)(webpack@5.95.0(@swc/core@1.7.35)) react-refresh: 0.11.0 resolve: 1.22.8 resolve-url-loader: 4.0.0 - sass-loader: 12.6.0(webpack@5.95.0) + sass-loader: 12.6.0(webpack@5.95.0(@swc/core@1.7.35)) semver: 7.6.3 - source-map-loader: 3.0.2(webpack@5.95.0) - style-loader: 3.3.4(webpack@5.95.0) - tailwindcss: 3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) - terser-webpack-plugin: 5.3.10(webpack@5.95.0) - webpack: 5.95.0 - webpack-dev-server: 4.15.2(webpack@5.95.0) - webpack-manifest-plugin: 4.1.1(webpack@5.95.0) - workbox-webpack-plugin: 6.6.0(@types/babel__core@7.20.5)(webpack@5.95.0) + source-map-loader: 3.0.2(webpack@5.95.0(@swc/core@1.7.35)) + style-loader: 3.3.4(webpack@5.95.0(@swc/core@1.7.35)) + tailwindcss: 3.4.13(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) + terser-webpack-plugin: 5.3.10(@swc/core@1.7.35)(webpack@5.95.0(@swc/core@1.7.35)) + webpack: 5.95.0(@swc/core@1.7.35) + webpack-dev-server: 4.15.2(webpack@5.95.0(@swc/core@1.7.35)) + webpack-manifest-plugin: 4.1.1(webpack@5.95.0(@swc/core@1.7.35)) + workbox-webpack-plugin: 6.6.0(@types/babel__core@7.20.5)(webpack@5.95.0(@swc/core@1.7.35)) optionalDependencies: fsevents: 2.3.3 typescript: 5.6.3 @@ -18139,15 +18141,6 @@ snapshots: react: 18.3.1 refractor: 3.6.0 - react-transition-group@4.4.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1): - dependencies: - '@babel/runtime': 7.25.7 - dom-helpers: 5.2.1 - loose-envify: 1.4.0 - prop-types: 15.8.1 - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - react-use-error-boundary@3.0.0(react@18.3.1): dependencies: react: 18.3.1 @@ -18446,11 +18439,11 @@ snapshots: sanitize.css@13.0.0: {} - sass-loader@12.6.0(webpack@5.95.0): + sass-loader@12.6.0(webpack@5.95.0(@swc/core@1.7.35)): dependencies: klona: 2.0.6 neo-async: 2.6.2 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) sax@1.2.4: {} @@ -18633,16 +18626,31 @@ snapshots: source-list-map@2.0.1: {} + source-map-explorer@2.5.3: + dependencies: + btoa: 1.2.1 + chalk: 4.1.2 + convert-source-map: 1.9.0 + ejs: 3.1.10 + escape-html: 1.0.3 + glob: 7.2.3 + gzip-size: 6.0.0 + lodash: 4.17.21 + open: 7.4.2 + source-map: 0.7.4 + temp: 0.9.4 + yargs: 16.2.0 + source-map-js@1.0.2: {} source-map-js@1.2.1: {} - source-map-loader@3.0.2(webpack@5.95.0): + source-map-loader@3.0.2(webpack@5.95.0(@swc/core@1.7.35)): dependencies: abab: 2.0.6 iconv-lite: 0.6.3 source-map-js: 1.2.1 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) source-map-support@0.5.21: dependencies: @@ -18827,9 +18835,9 @@ snapshots: strnum@1.0.5: {} - style-loader@3.3.4(webpack@5.95.0): + style-loader@3.3.4(webpack@5.95.0(@swc/core@1.7.35)): dependencies: - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) style-to-object@1.0.5: dependencies: @@ -18928,7 +18936,7 @@ snapshots: tabbable@6.2.0: {} - tailwindcss@3.4.13(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)): + tailwindcss@3.4.13(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -18947,7 +18955,7 @@ snapshots: postcss: 8.4.47 postcss-import: 15.1.0(postcss@8.4.47) postcss-js: 4.0.1(postcss@8.4.47) - postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3)) + postcss-load-config: 4.0.2(postcss@8.4.47)(ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3)) postcss-nested: 6.2.0(postcss@8.4.47) postcss-selector-parser: 6.1.2 resolve: 1.22.8 @@ -18965,6 +18973,11 @@ snapshots: dependencies: rimraf: 2.6.3 + temp@0.9.4: + dependencies: + mkdirp: 0.5.6 + rimraf: 2.6.3 + tempy@0.6.0: dependencies: is-stream: 2.0.1 @@ -18977,14 +18990,16 @@ snapshots: ansi-escapes: 4.3.2 supports-hyperlinks: 2.3.0 - terser-webpack-plugin@5.3.10(webpack@5.95.0): + terser-webpack-plugin@5.3.10(@swc/core@1.7.35)(webpack@5.95.0(@swc/core@1.7.35)): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.34.1 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) + optionalDependencies: + '@swc/core': 1.7.35 terser@5.28.1: dependencies: @@ -19074,7 +19089,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@types/node@22.7.5)(typescript@5.6.3): + ts-node@10.9.2(@swc/core@1.7.35)(@types/node@22.7.5)(typescript@5.6.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 @@ -19091,6 +19106,8 @@ snapshots: typescript: 5.6.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + optionalDependencies: + '@swc/core': 1.7.35 tsconfig-paths@3.15.0: dependencies: @@ -19425,16 +19442,16 @@ snapshots: webidl-conversions@6.1.0: {} - webpack-dev-middleware@5.3.4(webpack@5.95.0): + webpack-dev-middleware@5.3.4(webpack@5.95.0(@swc/core@1.7.35)): dependencies: colorette: 2.0.20 memfs: 3.5.3 mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 4.2.0 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) - webpack-dev-server@4.15.2(webpack@5.95.0): + webpack-dev-server@4.15.2(webpack@5.95.0(@swc/core@1.7.35)): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -19464,20 +19481,20 @@ snapshots: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack-dev-middleware: 5.3.4(webpack@5.95.0) + webpack-dev-middleware: 5.3.4(webpack@5.95.0(@swc/core@1.7.35)) ws: 8.18.0 optionalDependencies: - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) transitivePeerDependencies: - bufferutil - debug - supports-color - utf-8-validate - webpack-manifest-plugin@4.1.1(webpack@5.95.0): + webpack-manifest-plugin@4.1.1(webpack@5.95.0(@swc/core@1.7.35)): dependencies: tapable: 2.2.1 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) webpack-sources: 2.3.1 webpack-merge@5.10.0: @@ -19498,7 +19515,7 @@ snapshots: webpack-sources@3.2.3: {} - webpack@5.95.0: + webpack@5.95.0(@swc/core@1.7.35): dependencies: '@types/estree': 1.0.6 '@webassemblyjs/ast': 1.12.1 @@ -19520,7 +19537,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(webpack@5.95.0) + terser-webpack-plugin: 5.3.10(@swc/core@1.7.35)(webpack@5.95.0(@swc/core@1.7.35)) watchpack: 2.4.2 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -19721,12 +19738,12 @@ snapshots: workbox-sw@6.6.0: {} - workbox-webpack-plugin@6.6.0(@types/babel__core@7.20.5)(webpack@5.95.0): + workbox-webpack-plugin@6.6.0(@types/babel__core@7.20.5)(webpack@5.95.0(@swc/core@1.7.35)): dependencies: fast-json-stable-stringify: 2.1.0 pretty-bytes: 5.6.0 upath: 1.2.0 - webpack: 5.95.0 + webpack: 5.95.0(@swc/core@1.7.35) webpack-sources: 1.4.3 workbox-build: 6.6.0(@types/babel__core@7.20.5) transitivePeerDependencies: diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index f7ac2c74..da900ecf 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -492,9 +492,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" [[package]] name = "byteorder" @@ -580,9 +580,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.23" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbb537bb4a30b90362caddba8f360c0a56bc13d3a5570028e7197204cb54a17" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "shlex", ] @@ -1279,24 +1279,24 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1305,9 +1305,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -1324,9 +1324,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -1335,21 +1335,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-io", @@ -1514,9 +1514,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gio" @@ -1677,9 +1677,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "heck" @@ -1761,15 +1761,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -1883,12 +1883,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.0", "serde", ] @@ -1912,9 +1912,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "itoa" @@ -1975,9 +1975,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2347,7 +2347,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ "malloc_buf", - "objc_exception", ] [[package]] @@ -2366,6 +2365,9 @@ name = "objc-sys" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" +dependencies = [ + "cc", +] [[package]] name = "objc2" @@ -2393,6 +2395,30 @@ dependencies = [ "objc2-quartz-core", ] +[[package]] +name = "objc2-cloud-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-contacts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + [[package]] name = "objc2-core-data" version = "0.2.2" @@ -2417,6 +2443,18 @@ dependencies = [ "objc2-metal", ] +[[package]] +name = "objc2-core-location" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" +dependencies = [ + "block2", + "objc2", + "objc2-contacts", + "objc2-foundation", +] + [[package]] name = "objc2-encode" version = "4.0.3" @@ -2435,6 +2473,18 @@ dependencies = [ "objc2", ] +[[package]] +name = "objc2-link-presentation" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" +dependencies = [ + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", +] + [[package]] name = "objc2-metal" version = "0.2.2" @@ -2461,12 +2511,71 @@ dependencies = [ ] [[package]] -name = "objc_exception" -version = "0.1.2" +name = "objc2-symbols" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "cc", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-ui-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-cloud-kit", + "objc2-core-data", + "objc2-core-image", + "objc2-core-location", + "objc2-foundation", + "objc2-link-presentation", + "objc2-quartz-core", + "objc2-symbols", + "objc2-uniform-type-identifiers", + "objc2-user-notifications", +] + +[[package]] +name = "objc2-uniform-type-identifiers" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" +dependencies = [ + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-user-notifications" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-core-location", + "objc2-foundation", +] + +[[package]] +name = "objc2-web-kit" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68bc69301064cebefc6c4c90ce9cba69225239e4b8ff99d445a2b5563797da65" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-app-kit", + "objc2-foundation", ] [[package]] @@ -2480,21 +2589,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "option-ext" @@ -2753,7 +2859,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ "base64 0.22.1", - "indexmap 2.5.0", + "indexmap 2.6.0", "quick-xml 0.32.0", "serde", "time", @@ -2787,12 +2893,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "powerfmt" version = "0.2.0" @@ -2866,9 +2966,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -3259,9 +3359,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", "ring", @@ -3273,19 +3373,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -3469,15 +3568,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -3487,9 +3586,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", @@ -3791,9 +3890,9 @@ dependencies = [ [[package]] name = "tao" -version = "0.30.2" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e48d7c56b3f7425d061886e8ce3b6acfab1993682ed70bef50fd133d721ee6" +checksum = "a0dbbebe82d02044dfa481adca1550d6dd7bd16e086bc34fa0fbecceb5a63751" dependencies = [ "bitflags 2.6.0", "cocoa", @@ -3864,9 +3963,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5920aad0804ea5e86808d4b6e8753d3bcbae7efc8f4e41a4da00b45427559868" +checksum = "44438500b50708bfc1e6083844e135d1b516325aae58710dcd8fb67e050ae87c" dependencies = [ "anyhow", "bytes", @@ -4123,9 +4222,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af12ad1af974b274ef1d32a94e6eba27a312b429ef28fcb98abc710df7f9151d" +checksum = "c8f437293d6f5e5dce829250f4dbdce4e0b52905e297a6689cc2963eb53ac728" dependencies = [ "dpi", "gtk", @@ -4142,9 +4241,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e45e88aa0b11b302d836e6ea3e507a6359044c4a8bc86b865ba99868c695753d" +checksum = "1431602bcc71f2f840ad623915c9842ecc32999b867c4a787d975a17a9625cc6" dependencies = [ "gtk", "http", @@ -4399,7 +4498,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -4412,7 +4511,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -4458,9 +4557,9 @@ dependencies = [ [[package]] name = "tray-icon" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "533fc2d4105e0e3d96ce1c71f2d308c9fbbe2ef9c587cab63dd627ab5bde218f" +checksum = "7c92af36a182b46206723bdf8a7942e20838cde1cf062e5b97854d57eb01763b" dependencies = [ "core-graphics", "crossbeam-channel", @@ -4549,9 +4648,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" @@ -4697,9 +4796,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -4708,9 +4807,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -4723,9 +4822,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -4735,9 +4834,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4745,9 +4844,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -4758,9 +4857,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" @@ -4777,9 +4876,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -5309,14 +5408,12 @@ dependencies = [ [[package]] name = "wry" -version = "0.44.1" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "440600584cfbd8b0d28eace95c1f2c253db05dae43780b79380aa1e868f04c73" +checksum = "2f8c948dc5f7c23bd93ba03b85b7f679852589bb78e150424d993171e4ef7b73" dependencies = [ "base64 0.22.1", - "block", - "cocoa", - "core-graphics", + "block2", "crossbeam-channel", "dpi", "dunce", @@ -5329,8 +5426,11 @@ dependencies = [ "kuchikiki", "libc", "ndk", - "objc", - "objc_id", + "objc2", + "objc2-app-kit", + "objc2-foundation", + "objc2-ui-kit", + "objc2-web-kit", "once_cell", "percent-encoding", "raw-window-handle", @@ -5499,7 +5599,7 @@ dependencies = [ "crc32fast", "crossbeam-utils", "displaydoc", - "indexmap 2.5.0", + "indexmap 2.6.0", "memchr", "thiserror", ] diff --git a/src/App.tsx b/src/App.tsx index 056c65e7..7f1e4bc2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,27 +1,26 @@ -import { observer } from "mobx-react-lite"; -import React from "react"; -import { Route, Routes, useNavigate } from "react-router-dom"; -import { AuthenticationGuard } from "./components/guards/AuthenticationGuard"; -import LoginPage from "./pages/LoginPage"; -import NotFoundPage from "./pages/NotFound"; -import RegistrationPage from "./pages/RegistrationPage"; - +import { bannerController } from "@/controllers/banners"; import { getTauriVersion, getVersion } from "@tauri-apps/api/app"; import { arch, locale, platform, version } from "@tauri-apps/plugin-os"; import { useNetworkState } from "@uidotdev/usehooks"; import { reaction } from "mobx"; +import { observer } from "mobx-react-lite"; +import React from "react"; +import { Route, Routes, useNavigate } from "react-router-dom"; import ErrorBoundary from "./components/ErrorBoundary"; import Loader from "./components/Loader"; -import { UnauthenticatedGuard } from "./components/guards/UnauthenticatedGuard"; import useLogger from "./hooks/useLogger"; import AppPage from "./pages/AppPage"; +import LoginPage from "./pages/LoginPage"; import LogoutPage from "./pages/LogoutPage"; +import NotFoundPage from "./pages/NotFound"; +import RegistrationPage from "./pages/RegistrationPage"; import ChannelPage from "./pages/subpages/ChannelPage"; import { Globals } from "./utils/Globals"; // @ts-expect-error no types import FPSStats from "react-fps-stats"; -import { bannerController } from "./controllers/banners"; +import AuthenticationGuard from "./components/AuthenticationGuard"; import { useAppStore } from "./hooks/useAppStore"; +import InvitePage from "./pages/InvitePage"; import { isTauri } from "./utils/Utils"; function App() { @@ -69,7 +68,7 @@ function App() { }; }; - isTauri && loadAsyncGlobals(); + if (isTauri) loadAsyncGlobals(); Globals.load(); app.loadSettings(); @@ -104,9 +103,16 @@ function App() { path="/channels/:guildId/:channelId?" element={} /> - } /> - } /> + } + /> + } + /> } /> + } /> } /> diff --git a/src/components/AuthComponents.tsx b/src/components/AuthComponents.tsx index 38cee908..ecd5f06f 100644 --- a/src/components/AuthComponents.tsx +++ b/src/components/AuthComponents.tsx @@ -1,6 +1,6 @@ +import Container from "@components/Container"; import styled from "styled-components"; import Button from "./Button"; -import Container from "./Container"; export const Wrapper = styled(Container)` display: flex; diff --git a/src/components/AuthenticationGuard.tsx b/src/components/AuthenticationGuard.tsx new file mode 100644 index 00000000..d9d3a4df --- /dev/null +++ b/src/components/AuthenticationGuard.tsx @@ -0,0 +1,29 @@ +import { useAppStore } from "@hooks/useAppStore"; +import { LoadingSuspense } from "@pages/LoadingPage"; +import { Navigate } from "react-router-dom"; + +interface Props { + component: React.FC; + requireUnauthenticated?: boolean; +} + +export default function AuthenticationGuard({ component, requireUnauthenticated }: Props) { + const app = useAppStore(); + + // if we need the user to be logged in, and there isn't a token, go to login page + if (!requireUnauthenticated && !app.token) { + return ; + } + + // if we need the user to be logged out to access the page, but there is a token, go to the app page + if (requireUnauthenticated && app.token) { + return ; + } + + const Component = component; + return ( + + + + ); +} diff --git a/src/components/Avatar.tsx b/src/components/Avatar.tsx index 0a22f9f7..00bd5c90 100644 --- a/src/components/Avatar.tsx +++ b/src/components/Avatar.tsx @@ -1,12 +1,11 @@ +import Container from "@components/Container"; +import { useAppStore } from "@hooks/useAppStore"; import { PresenceUpdateStatus } from "@spacebarchat/spacebar-api-types/v9"; +import { AccountStore } from "@stores"; +import { Presence, User } from "@structures"; import { observer } from "mobx-react-lite"; import React, { useRef } from "react"; import styled from "styled-components"; -import { useAppStore } from "../hooks/useAppStore"; -import AccountStore from "../stores/AccountStore"; -import Presence from "../stores/objects/Presence"; -import User from "../stores/objects/User"; -import Container from "./Container"; const Wrapper = styled(Container)<{ size: number; hasClick?: boolean }>` background-color: transparent; diff --git a/src/components/ChannelHeader.tsx b/src/components/ChannelHeader.tsx index b6bf3b5b..8361eed4 100644 --- a/src/components/ChannelHeader.tsx +++ b/src/components/ChannelHeader.tsx @@ -1,11 +1,10 @@ +import { Floating, FloatingTrigger } from "@components/floating"; +import { useAppStore } from "@hooks/useAppStore"; import { observer } from "mobx-react-lite"; import React, { useEffect } from "react"; import styled from "styled-components"; -import { useAppStore } from "../hooks/useAppStore"; import Icon, { IconProps } from "./Icon"; import { SectionHeader } from "./SectionHeader"; -import Floating from "./floating/Floating"; -import FloatingTrigger from "./floating/FloatingTrigger"; const Wrapper = styled(SectionHeader)` background-color: var(--background-secondary); diff --git a/src/components/ChannelList/ChannelList.tsx b/src/components/ChannelList/ChannelList.tsx index fec30776..6d65e781 100644 --- a/src/components/ChannelList/ChannelList.tsx +++ b/src/components/ChannelList/ChannelList.tsx @@ -1,8 +1,8 @@ +import { useAppStore } from "@hooks/useAppStore"; import { ChannelType } from "@spacebarchat/spacebar-api-types/v9"; import { observer } from "mobx-react-lite"; import { AutoSizer, List, ListRowProps } from "react-virtualized"; import styled from "styled-components"; -import { useAppStore } from "../../hooks/useAppStore"; import ChannelListItem from "./ChannelListItem"; const Container = styled.div` diff --git a/src/components/ChannelList/ChannelListItem.tsx b/src/components/ChannelList/ChannelListItem.tsx index 5a18378f..351c9860 100644 --- a/src/components/ChannelList/ChannelListItem.tsx +++ b/src/components/ChannelList/ChannelListItem.tsx @@ -1,16 +1,15 @@ +import { modalController } from "@/controllers/modals"; +import { Floating, FloatingTrigger } from "@components/floating"; +import Icon from "@components/Icon"; +import SidebarPill from "@components/SidebarPill"; +import { ContextMenuContext } from "@contexts/ContextMenuContext"; +import { useAppStore } from "@hooks/useAppStore"; +import { Channel } from "@structures"; +import { Permissions } from "@utils"; import { observer } from "mobx-react-lite"; import React, { useContext, useEffect } from "react"; import { useNavigate } from "react-router-dom"; import styled from "styled-components"; -import { ContextMenuContext } from "../../contexts/ContextMenuContext"; -import { modalController } from "../../controllers/modals"; -import { useAppStore } from "../../hooks/useAppStore"; -import Channel from "../../stores/objects/Channel"; -import { Permissions } from "../../utils/Permissions"; -import Icon from "../Icon"; -import SidebarPill from "../SidebarPill"; -import Floating from "../floating/Floating"; -import FloatingTrigger from "../floating/FloatingTrigger"; const ListItem = styled.div<{ isCategory?: boolean }>` padding: ${(props) => (props.isCategory ? "16px 8px 0 0" : "1px 8px 0 0")}; @@ -90,7 +89,7 @@ function ChannelListItem({ channel, isCategory, active }: Props) { alignItems: "center", }} > - + {channel.channelIcon && !isCategory && ( (); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(false); + + useEffect(() => { + app.rest + .get(Routes.invite(code), { + wuth_counts: true, + with_expiration: true, + }) + .then((r) => { + setData(r); + setLoading(false); + logger.debug(`Resolved invite: `, r); + }) + .catch((e) => { + logger.error(`Error fetching invite: `, e); + setError(true); + setLoading(false); + }); + }, []); + + return ( + + {loading && ( + +
Resolving Invite
+
+ )} + + {error && ( + +
{isSelf ? "You sent an invite, but..." : "You received an invite, but..."}
+ + +
+ + Invalid Invite + Try sending a new invite! + + + + + )} + + {data && ( + + {data.guild!.splash && ( + + + + )} +
+ {isSelf ? "You sent an invite to join a guild" : "You've been invited to join a guild"} +
+ + +
+ + {data.guild!.name} + + + + + {/* @ts-expect-error the server is incorrect here */} + {(data.guild!.presence_count || 0).toLocaleString()} Online + + + + + + {/* @ts-expect-error the server is incorrect here */} + {(data.guild!.member_count || 0).toLocaleString()} Members + + + + + + Join + + + )} + + ); +} + +export default InviteEmbed; diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx index e4cbc66c..3de568fc 100644 --- a/src/components/Loader.tsx +++ b/src/components/Loader.tsx @@ -1,9 +1,9 @@ +import { useAppStore } from "@hooks/useAppStore"; +import LoadingPage from "@pages/LoadingPage"; import { invoke } from "@tauri-apps/api/core"; +import { isTauri } from "@utils"; import { observer } from "mobx-react-lite"; import React from "react"; -import { useAppStore } from "../hooks/useAppStore"; -import LoadingPage from "../pages/LoadingPage"; -import { isTauri } from "../utils/Utils"; interface Props { children: React.ReactNode; diff --git a/src/components/MemberList/MemberList.tsx b/src/components/MemberList/MemberList.tsx index 0246c256..de7550f1 100644 --- a/src/components/MemberList/MemberList.tsx +++ b/src/components/MemberList/MemberList.tsx @@ -1,10 +1,10 @@ +import ListSection from "@components/ListSection"; +import { useAppStore } from "@hooks/useAppStore"; +import { GuildMemberListStore } from "@stores"; import { autorun } from "mobx"; import { observer } from "mobx-react-lite"; import React from "react"; import styled from "styled-components"; -import { useAppStore } from "../../hooks/useAppStore"; -import GuildMemberListStore from "../../stores/GuildMemberListStore"; -import ListSection from "../ListSection"; import MemberListItem from "./MemberListItem"; const Container = styled.div` diff --git a/src/components/MemberList/MemberListItem.tsx b/src/components/MemberList/MemberListItem.tsx index dca1ce0f..8fc89c51 100644 --- a/src/components/MemberList/MemberListItem.tsx +++ b/src/components/MemberList/MemberListItem.tsx @@ -1,13 +1,12 @@ +import Avatar from "@components/Avatar"; +import { Floating, FloatingTrigger } from "@components/floating"; +import { ContextMenuContext } from "@contexts/ContextMenuContext"; +import { useAppStore } from "@hooks/useAppStore"; import { PresenceUpdateStatus } from "@spacebarchat/spacebar-api-types/v9"; +import { GuildMember } from "@structures"; import { observer } from "mobx-react-lite"; import { useContext } from "react"; import styled from "styled-components"; -import { ContextMenuContext } from "../../contexts/ContextMenuContext"; -import { useAppStore } from "../../hooks/useAppStore"; -import GuildMember from "../../stores/objects/GuildMember"; -import Avatar from "../Avatar"; -import Floating from "../floating/Floating"; -import FloatingTrigger from "../floating/FloatingTrigger"; const ListItem = styled(FloatingTrigger)<{ isCategory?: boolean }>` padding: ${(props) => (props.isCategory ? "16px 8px 0 0" : "1px 8px 0 0")}; diff --git a/src/components/SectionTitle.tsx b/src/components/SectionTitle.tsx index 6026bacc..0ac5897f 100644 --- a/src/components/SectionTitle.tsx +++ b/src/components/SectionTitle.tsx @@ -13,6 +13,7 @@ const Text = styled.h2` flex: 1; `; +// eslint-disable-next-line @typescript-eslint/no-empty-object-type interface Props {} function SectionTitle({ children }: React.PropsWithChildren) { diff --git a/src/components/SidebarAction.tsx b/src/components/SidebarAction.tsx index 95d084fd..919e5150 100644 --- a/src/components/SidebarAction.tsx +++ b/src/components/SidebarAction.tsx @@ -1,11 +1,10 @@ +import Container from "@components/Container"; +import { Floating, FloatingTrigger } from "@components/floating"; +import { GuildSidebarListItem } from "@components/GuildItem"; +import Icon, { IconProps } from "@components/Icon"; +import SidebarPill, { PillType } from "@components/SidebarPill"; import React from "react"; import styled from "styled-components"; -import Container from "./Container"; -import { GuildSidebarListItem } from "./GuildItem"; -import Icon, { IconProps } from "./Icon"; -import SidebarPill, { PillType } from "./SidebarPill"; -import Floating from "./floating/Floating"; -import FloatingTrigger from "./floating/FloatingTrigger"; const Wrapper = styled(Container)<{ margin?: boolean; diff --git a/src/components/SidebarPill.tsx b/src/components/SidebarPill.tsx index 01fa6234..3b32b705 100644 --- a/src/components/SidebarPill.tsx +++ b/src/components/SidebarPill.tsx @@ -1,5 +1,5 @@ +import Container from "@components/Container"; import styled from "styled-components"; -import Container from "./Container"; export type PillType = "none" | "unread" | "hover" | "active"; diff --git a/src/components/Tooltip.tsx b/src/components/Tooltip.tsx index 400279d4..c865de46 100644 --- a/src/components/Tooltip.tsx +++ b/src/components/Tooltip.tsx @@ -1,5 +1,5 @@ +import { FloatingProps } from "@components/floating"; import styled from "styled-components"; -import { FloatingProps } from "./floating/Floating"; const Container = styled.div` background-color: var(--background-tertiary); diff --git a/src/components/UserPanel.tsx b/src/components/UserPanel.tsx index d7954d26..3a08dcb6 100644 --- a/src/components/UserPanel.tsx +++ b/src/components/UserPanel.tsx @@ -1,12 +1,11 @@ +import { modalController } from "@/controllers/modals"; +import { Floating, FloatingTrigger } from "@components/floating"; +import { useAppStore } from "@hooks/useAppStore"; import { observer } from "mobx-react-lite"; import styled from "styled-components"; -import { modalController } from "../controllers/modals"; -import { useAppStore } from "../hooks/useAppStore"; import Avatar from "./Avatar"; import Icon from "./Icon"; import IconButton from "./IconButton"; -import Floating from "./floating/Floating"; -import FloatingTrigger from "./floating/FloatingTrigger"; const Section = styled.section` flex: 0 0 auto; diff --git a/src/components/banners/OfflineBanner.tsx b/src/components/banners/OfflineBanner.tsx index f6927f45..efec1177 100644 --- a/src/components/banners/OfflineBanner.tsx +++ b/src/components/banners/OfflineBanner.tsx @@ -1,5 +1,5 @@ +import Icon from "@components/Icon"; import styled from "styled-components"; -import Icon from "../Icon"; const Wrapper = styled.div` display: flex; diff --git a/src/components/banners/index.ts b/src/components/banners/index.ts new file mode 100644 index 00000000..852e51f7 --- /dev/null +++ b/src/components/banners/index.ts @@ -0,0 +1 @@ +export { default as OfflineBanner } from "./OfflineBanner"; diff --git a/src/components/contextMenus/ChannelContextMenu.tsx b/src/components/contextMenus/ChannelContextMenu.tsx index 1e95650c..7b359c08 100644 --- a/src/components/contextMenus/ChannelContextMenu.tsx +++ b/src/components/contextMenus/ChannelContextMenu.tsx @@ -1,7 +1,7 @@ // loosely based on https://github.com/revoltchat/frontend/blob/master/components/app/menus/UserContextMenu.tsx -import { modalController } from "../../controllers/modals"; -import Channel from "../../stores/objects/Channel"; +import { modalController } from "@/controllers/modals"; +import Channel from "@structures/Channel"; import { ContextMenu, ContextMenuButton, ContextMenuDivider } from "./ContextMenu"; interface MenuProps { diff --git a/src/components/contextMenus/ChannelMentionContextMenu.tsx b/src/components/contextMenus/ChannelMentionContextMenu.tsx index dcbe99d4..bfb834b7 100644 --- a/src/components/contextMenus/ChannelMentionContextMenu.tsx +++ b/src/components/contextMenus/ChannelMentionContextMenu.tsx @@ -1,6 +1,6 @@ // loosely based on https://github.com/revoltchat/frontend/blob/master/components/app/menus/UserContextMenu.tsx -import Channel from "../../stores/objects/Channel"; +import Channel from "@structures/Channel"; import { ContextMenu, ContextMenuButton, ContextMenuDivider } from "./ContextMenu"; interface MenuProps { diff --git a/src/components/contextMenus/ContextMenu.tsx b/src/components/contextMenus/ContextMenu.tsx index 14cca102..d7f41ef5 100644 --- a/src/components/contextMenus/ContextMenu.tsx +++ b/src/components/contextMenus/ContextMenu.tsx @@ -1,9 +1,9 @@ // modified from https://github.com/revoltchat/frontend/blob/master/components/app/menus/ContextMenu.tsx // changed some styling +import Icon, { IconProps } from "@components/Icon"; import { ComponentProps } from "react"; import styled from "styled-components"; -import Icon, { IconProps } from "../Icon"; export const ContextMenu = styled.div` display: flex; diff --git a/src/components/contextMenus/GuildContextMenu.tsx b/src/components/contextMenus/GuildContextMenu.tsx index a0aad1c8..6887db15 100644 --- a/src/components/contextMenus/GuildContextMenu.tsx +++ b/src/components/contextMenus/GuildContextMenu.tsx @@ -1,10 +1,10 @@ // loosely based on https://github.com/revoltchat/frontend/blob/master/components/app/menus/UserContextMenu.tsx +import { modalController } from "@/controllers/modals"; +import { useAppStore } from "@hooks/useAppStore"; +import useLogger from "@hooks/useLogger"; import { ChannelType } from "@spacebarchat/spacebar-api-types/v9"; -import { modalController } from "../../controllers/modals"; -import { useAppStore } from "../../hooks/useAppStore"; -import useLogger from "../../hooks/useLogger"; -import Guild from "../../stores/objects/Guild"; +import { Guild } from "@structures"; import { ContextMenu, ContextMenuButton, ContextMenuDivider } from "./ContextMenu"; interface MenuProps { diff --git a/src/components/contextMenus/MessageContextMenu.tsx b/src/components/contextMenus/MessageContextMenu.tsx index 20303747..f619ff63 100644 --- a/src/components/contextMenus/MessageContextMenu.tsx +++ b/src/components/contextMenus/MessageContextMenu.tsx @@ -1,6 +1,6 @@ -import { modalController } from "../../controllers/modals"; -import { useAppStore } from "../../hooks/useAppStore"; -import Message from "../../stores/objects/Message"; +import { modalController } from "@/controllers/modals"; +import { useAppStore } from "@hooks/useAppStore"; +import { Message } from "@structures"; import { ContextMenu, ContextMenuButton, ContextMenuDivider } from "./ContextMenu"; interface MenuProps { diff --git a/src/components/contextMenus/UserContextMenu.tsx b/src/components/contextMenus/UserContextMenu.tsx index 798e8754..829a1a22 100644 --- a/src/components/contextMenus/UserContextMenu.tsx +++ b/src/components/contextMenus/UserContextMenu.tsx @@ -1,9 +1,8 @@ // loosely based on https://github.com/revoltchat/frontend/blob/master/components/app/menus/UserContextMenu.tsx -import { modalController } from "../../controllers/modals"; -import { useAppStore } from "../../hooks/useAppStore"; -import GuildMember from "../../stores/objects/GuildMember"; -import User from "../../stores/objects/User"; +import { modalController } from "@/controllers/modals"; +import { useAppStore } from "@hooks/useAppStore"; +import { GuildMember, User } from "@structures"; import { ContextMenu, ContextMenuButton, ContextMenuDivider } from "./ContextMenu"; interface MenuProps { diff --git a/src/components/contextMenus/index.ts b/src/components/contextMenus/index.ts new file mode 100644 index 00000000..cdf26642 --- /dev/null +++ b/src/components/contextMenus/index.ts @@ -0,0 +1,6 @@ +export { default as ChannelContextMenu } from "./ChannelContextMenu"; +export { default as ChannelMentionContextMenu } from "./ChannelMentionContextMenu"; +export * from "./ContextMenu"; +export { default as GuildContextMenu } from "./GuildContextMenu"; +export { default as MessageContextMenu } from "./MessageContextMenu"; +export { default as UserContextMenu } from "./UserContextMenu"; diff --git a/src/components/floating/Floating.tsx b/src/components/floating/Floating.tsx index dc8d6551..61945586 100644 --- a/src/components/floating/Floating.tsx +++ b/src/components/floating/Floating.tsx @@ -1,11 +1,9 @@ +import Tooltip from "@components/Tooltip"; +import { FloatingContext } from "@contexts/FloatingContext"; import { FloatingArrow, FloatingPortal, Placement } from "@floating-ui/react"; +import useFloating from "@hooks/useFloating"; +import { Guild, GuildMember, User } from "@structures"; import { motion } from "framer-motion"; -import { FloatingContext } from "../../contexts/FloatingContext"; -import useFloating from "../../hooks/useFloating"; -import Guild from "../../stores/objects/Guild"; -import GuildMember from "../../stores/objects/GuildMember"; -import User from "../../stores/objects/User"; -import Tooltip from "../Tooltip"; import GuildMenuPopout from "./GuildMenuPopout"; import UserProfilePopout from "./UserProfilePopout"; diff --git a/src/components/floating/FloatingContent.tsx b/src/components/floating/FloatingContent.tsx index 7a72a9e6..ddaf3297 100644 --- a/src/components/floating/FloatingContent.tsx +++ b/src/components/floating/FloatingContent.tsx @@ -1,7 +1,7 @@ import { FloatingFocusManager, FloatingPortal, useMergeRefs } from "@floating-ui/react"; +import useFloatingContext from "@hooks/useFloatingContext"; import { motion } from "framer-motion"; import React from "react"; -import useFloatingContext from "../../hooks/useFloatingContext"; export default React.forwardRef>(function PopoverContent( { style, ...props }, diff --git a/src/components/floating/FloatingTrigger.tsx b/src/components/floating/FloatingTrigger.tsx index 88c728ce..f47c8d01 100644 --- a/src/components/floating/FloatingTrigger.tsx +++ b/src/components/floating/FloatingTrigger.tsx @@ -1,6 +1,6 @@ import { useMergeRefs } from "@floating-ui/react"; +import useFloatingContext from "@hooks/useFloatingContext"; import React from "react"; -import useFloatingContext from "../../hooks/useFloatingContext"; interface PopoverTriggerProps { children: React.ReactNode; diff --git a/src/components/floating/GuildMenuPopout.tsx b/src/components/floating/GuildMenuPopout.tsx index 5177e524..22c50284 100644 --- a/src/components/floating/GuildMenuPopout.tsx +++ b/src/components/floating/GuildMenuPopout.tsx @@ -1,11 +1,11 @@ +import useLogger from "@hooks/useLogger"; import styled from "styled-components"; -import useLogger from "../../hooks/useLogger"; +import { modalController } from "@/controllers/modals"; +import { ContextMenu, ContextMenuButton, ContextMenuDivider } from "@components/contextMenus/ContextMenu"; +import { useAppStore } from "@hooks/useAppStore"; +import { Permissions } from "@utils"; import React, { useEffect } from "react"; -import { modalController } from "../../controllers/modals"; -import { useAppStore } from "../../hooks/useAppStore"; -import { Permissions } from "../../utils/Permissions"; -import { ContextMenu, ContextMenuButton, ContextMenuDivider } from "../contextMenus/ContextMenu"; const CustomContextMenu = styled(ContextMenu)` width: 200px; diff --git a/src/components/floating/UserProfilePopout.tsx b/src/components/floating/UserProfilePopout.tsx index af8aff65..6705f908 100644 --- a/src/components/floating/UserProfilePopout.tsx +++ b/src/components/floating/UserProfilePopout.tsx @@ -1,16 +1,14 @@ +import Avatar from "@components/Avatar"; +import { HorizontalDivider } from "@components/Divider"; +import useLogger from "@hooks/useLogger"; +import { GuildMember, User } from "@structures"; +import { REST, Snowflake } from "@utils"; import styled from "styled-components"; -import useLogger from "../../hooks/useLogger"; -import GuildMember from "../../stores/objects/GuildMember"; -import User from "../../stores/objects/User"; -import Snowflake from "../../utils/Snowflake"; -import Avatar from "../Avatar"; -import { HorizontalDivider } from "../Divider"; +import SpacebarLogoBlue from "@assets/images/logo/Spacebar_Icon.svg?react"; +import { useAppStore } from "@hooks/useAppStore"; import { CDNRoutes, ImageFormat } from "@spacebarchat/spacebar-api-types/v9"; import dayjs from "dayjs"; -import SpacebarLogoBlue from "../../assets/images/logo/Spacebar_Icon.svg?react"; -import { useAppStore } from "../../hooks/useAppStore"; -import REST from "../../utils/REST"; import Floating from "./Floating"; import FloatingTrigger from "./FloatingTrigger"; diff --git a/src/components/floating/index.ts b/src/components/floating/index.ts new file mode 100644 index 00000000..b057ed95 --- /dev/null +++ b/src/components/floating/index.ts @@ -0,0 +1,6 @@ +export * from "./Floating"; +export { default as Floating } from "./Floating"; +export { default as FloatingContent } from "./FloatingContent"; +export { default as FloatingTrigger } from "./FloatingTrigger"; +export { default as GuildMenuPopout } from "./GuildMenuPopout"; +export { default as UserProfilePopout } from "./UserProfilePopout"; diff --git a/src/components/guards/AuthenticationGuard.tsx b/src/components/guards/AuthenticationGuard.tsx deleted file mode 100644 index ffd164ff..00000000 --- a/src/components/guards/AuthenticationGuard.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { Navigate } from "react-router-dom"; -import { useAppStore } from "../../hooks/useAppStore"; -import { LoadingSuspense } from "../../pages/LoadingPage"; - -interface Props { - component: React.FC; -} - -export const AuthenticationGuard = ({ component }: Props) => { - const app = useAppStore(); - - if (!app.token) { - return ; - } - - const Component = component; - return ( - - - - ); -}; diff --git a/src/components/guards/UnauthenticatedGuard.tsx b/src/components/guards/UnauthenticatedGuard.tsx deleted file mode 100644 index 45eefb14..00000000 --- a/src/components/guards/UnauthenticatedGuard.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { Navigate } from "react-router-dom"; -import { useAppStore } from "../../hooks/useAppStore"; -import { LoadingSuspense } from "../../pages/LoadingPage"; - -interface Props { - component: React.FC; -} - -export const UnauthenticatedGuard = ({ component }: Props) => { - const app = useAppStore(); - - if (app.token) { - return ; - } - - const Component = component; - return ( - - - - ); -}; diff --git a/src/components/index.ts b/src/components/index.ts new file mode 100644 index 00000000..0427a54d --- /dev/null +++ b/src/components/index.ts @@ -0,0 +1,31 @@ +// export * from "./AuthComponents" +export { default as Avatar } from "./Avatar"; +export { default as Button } from "./Button"; +export { default as ChannelHeader } from "./ChannelHeader"; +export { default as ChannelSidebar } from "./ChannelSidebar"; +export { default as Container } from "./Container"; +export * from "./Divider"; +export { default as DOBInput } from "./DOBInput"; +export { default as ErrorBoundary } from "./ErrorBoundary"; +// export * from "./FormComponents"; +export * from "./banners"; +export * from "./contextMenus"; +export * from "./floating"; +export { default as GuildItem } from "./GuildItem"; +export { default as HCaptcha } from "./HCaptcha"; +export { default as Icon } from "./Icon"; +export { default as IconButton } from "./IconButton"; +export { default as InviteEmbed } from "./InviteEmbed"; +export { default as Link } from "./Link"; +export { default as ListSection } from "./ListSection"; +export { default as Loader } from "./Loader"; +export * from "./markdown"; +export * from "./media"; +export * from "./SectionHeader"; +export { default as SectionTitle } from "./SectionTitle"; +export { default as SidebarAction } from "./SidebarAction"; +export { default as SidebarPill } from "./SidebarPill"; +export { default as SwipeableLayout } from "./SwipeableLayout"; +export { default as Text } from "./Text"; +export { default as Tooltip } from "./Tooltip"; +export { default as UserPanel } from "./UserPanel"; diff --git a/src/components/markdown/MarkdownRenderer.tsx b/src/components/markdown/MarkdownRenderer.tsx index 9269bfc3..f9e4081f 100644 --- a/src/components/markdown/MarkdownRenderer.tsx +++ b/src/components/markdown/MarkdownRenderer.tsx @@ -1,3 +1,4 @@ +import Link from "@components/Link"; import { FormattingPatterns } from "@spacebarchat/spacebar-api-types/v9"; import Marked, { ReactRenderer } from "marked-react"; import React from "react"; @@ -5,12 +6,11 @@ import reactStringReplace from "react-string-replace"; import { Prism as SyntaxHighlighter } from "react-syntax-highlighter"; import { materialDark } from "react-syntax-highlighter/dist/cjs/styles/prism"; import styled from "styled-components"; -import CodeBlock from "../Codeblock"; -import Link from "../Link"; -import Spoiler from "../Spoiler"; +import CodeBlock from "./components/Codeblock"; +import Mention from "./components/Mention"; +import Spoiler from "./components/Spoiler"; +import Timestamp from "./components/Timestamp"; import { MarkdownProps } from "./Markdown"; -import Mention from "./Mention"; -import Timestamp from "./Timestamp"; const Container = styled.div` // remove the excessive left padding, and margin in lists diff --git a/src/components/Codeblock.tsx b/src/components/markdown/components/Codeblock.tsx similarity index 88% rename from src/components/Codeblock.tsx rename to src/components/markdown/components/Codeblock.tsx index b5cb703f..3e9b7ee2 100644 --- a/src/components/Codeblock.tsx +++ b/src/components/markdown/components/Codeblock.tsx @@ -1,10 +1,10 @@ // adapted from Revite // https://github.com/revoltchat/revite/blob/fe63c6633f32b54aa1989cb34627e72bb3377efd/src/components/markdown/plugins/Codeblock.tsx +import Floating from "@components/floating/Floating"; +import FloatingTrigger from "@components/floating/FloatingTrigger"; import React from "react"; import styled from "styled-components"; -import Floating from "./floating/Floating"; -import FloatingTrigger from "./floating/FloatingTrigger"; const Actions = styled.div` position: absolute; @@ -47,7 +47,7 @@ function CodeBlock(props: Props) { const onCopy = React.useCallback(() => { const text = ref.current?.querySelector("code")?.innerText; - text && navigator.clipboard.writeText(text); + if (text) navigator.clipboard.writeText(text); }, [ref]); return ( diff --git a/src/components/markdown/Mention.tsx b/src/components/markdown/components/Mention.tsx similarity index 88% rename from src/components/markdown/Mention.tsx rename to src/components/markdown/components/Mention.tsx index 43359a04..e3604db4 100644 --- a/src/components/markdown/Mention.tsx +++ b/src/components/markdown/components/Mention.tsx @@ -1,14 +1,11 @@ +import { Floating, FloatingTrigger } from "@components/floating"; +import { ContextMenuContext } from "@contexts/ContextMenuContext"; +import { useAppStore } from "@hooks/useAppStore"; +import { Channel, Role, User } from "@structures"; +import { hexToRGB, rgbToHsl } from "@utils"; import React, { memo } from "react"; import { useNavigate } from "react-router-dom"; import styled from "styled-components"; -import { ContextMenuContext } from "../../contexts/ContextMenuContext"; -import { useAppStore } from "../../hooks/useAppStore"; -import Channel from "../../stores/objects/Channel"; -import Role from "../../stores/objects/Role"; -import User from "../../stores/objects/User"; -import { hexToRGB, rgbToHsl } from "../../utils/Utils"; -import Floating from "../floating/Floating"; -import FloatingTrigger from "../floating/FloatingTrigger"; const MentionText = styled.span<{ color?: string; withHover?: boolean }>` padding: 0 2px; diff --git a/src/components/Spoiler.tsx b/src/components/markdown/components/Spoiler.tsx similarity index 100% rename from src/components/Spoiler.tsx rename to src/components/markdown/components/Spoiler.tsx diff --git a/src/components/markdown/Timestamp.tsx b/src/components/markdown/components/Timestamp.tsx similarity index 91% rename from src/components/markdown/Timestamp.tsx rename to src/components/markdown/components/Timestamp.tsx index 7295c8b4..51b0429f 100644 --- a/src/components/markdown/Timestamp.tsx +++ b/src/components/markdown/components/Timestamp.tsx @@ -1,8 +1,7 @@ +import { Floating, FloatingTrigger } from "@components/floating"; import dayjs from "dayjs"; import { memo } from "react"; import styled from "styled-components"; -import Floating from "../floating/Floating"; -import FloatingTrigger from "../floating/FloatingTrigger"; const Container = styled.div` background-color: hsl(var(--background-tertiary-hsl) / 0.3); diff --git a/src/components/markdown/components/index.ts b/src/components/markdown/components/index.ts new file mode 100644 index 00000000..c83b8257 --- /dev/null +++ b/src/components/markdown/components/index.ts @@ -0,0 +1,4 @@ +export * from "./Codeblock"; +export * from "./Mention"; +export * from "./Spoiler"; +export * from "./Timestamp"; diff --git a/src/components/markdown/index.ts b/src/components/markdown/index.ts new file mode 100644 index 00000000..d8deac2c --- /dev/null +++ b/src/components/markdown/index.ts @@ -0,0 +1,4 @@ +export * from "./components"; +export { default as Markdown } from "./Markdown"; +export type { MarkdownProps } from "./Markdown"; +export { default as MarkdownRenderer } from "./MarkdownRenderer"; diff --git a/src/components/markdown/style.css b/src/components/markdown/style.css deleted file mode 100644 index a73f978b..00000000 --- a/src/components/markdown/style.css +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Synthwave '84 Theme originally by Robb Owen [@Robb0wen] for Visual Studio Code - * Demo: https://marc.dev/demo/prism-synthwave84 - * - * Ported for PrismJS by Marc Backes [@themarcba] - */ - -code[class*="language-"], -pre[class*="language-"] { - color: #f92aad; - text-shadow: - 0 0 2px #100c0f, - 0 0 5px #dc078e33, - 0 0 10px #fff3; - background: none; - font-family: var(--font-family-code); - font-size: 1em; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - - -moz-tab-size: 4; - -o-tab-size: 4; - tab-size: 4; - - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} - -/* Code blocks */ -pre[class*="language-"] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; -} - -:not(pre) > code[class*="language-"], -pre[class*="language-"] { - background-color: transparent !important; - background-image: linear-gradient(to bottom, #2a2139 75%, #34294f); -} - -/* Inline code */ -:not(pre) > code[class*="language-"] { - padding: 0.1em; - border-radius: 0.3em; - white-space: normal; -} - -.token.comment, -.token.block-comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: #8e8e8e; -} - -.token.punctuation { - color: #ccc; -} - -.token.tag, -.token.attr-name, -.token.namespace, -.token.number, -.token.unit, -.token.hexcode, -.token.deleted { - color: #e2777a; -} - -.token.property, -.token.selector { - color: #72f1b8; - text-shadow: - 0 0 2px #100c0f, - 0 0 10px #257c5575, - 0 0 35px #21272475; -} - -.token.function-name { - color: #6196cc; -} - -.token.boolean, -.token.selector .token.id, -.token.function { - color: #fdfdfd; - text-shadow: - 0 0 2px #001716, - 0 0 3px #03edf975, - 0 0 5px #03edf975, - 0 0 8px #03edf975; -} - -.token.class-name { - color: #fff5f6; - text-shadow: - 0 0 2px #000, - 0 0 10px #fc1f2c75, - 0 0 5px #fc1f2c75, - 0 0 25px #fc1f2c75; -} - -.token.constant, -.token.symbol { - color: #f92aad; - text-shadow: - 0 0 2px #100c0f, - 0 0 5px #dc078e33, - 0 0 10px #fff3; -} - -.token.important, -.token.atrule, -.token.keyword, -.token.selector .token.class, -.token.builtin { - color: #f4eee4; - text-shadow: - 0 0 2px #393a33, - 0 0 8px #f39f0575, - 0 0 2px #f39f0575; -} - -.token.string, -.token.char, -.token.attr-value, -.token.regex, -.token.variable { - color: #f87c32; -} - -.token.operator, -.token.entity, -.token.url { - color: #67cdcc; -} - -.token.important, -.token.bold { - font-weight: bold; -} - -.token.italic { - font-style: italic; -} - -.token.entity { - cursor: help; -} - -.token.inserted { - color: green; -} diff --git a/src/components/media/Audio.tsx b/src/components/media/Audio.tsx index c2893c73..f5cfeca3 100644 --- a/src/components/media/Audio.tsx +++ b/src/components/media/Audio.tsx @@ -1,8 +1,8 @@ +import Icon from "@components/Icon"; +import Link from "@components/Link"; import { APIAttachment } from "@spacebarchat/spacebar-api-types/v9"; +import { bytesToSize } from "@utils"; import styled from "styled-components"; -import { bytesToSize } from "../../utils/Utils"; -import Icon from "../Icon"; -import Link from "../Link"; const Container = styled.div` margin-top: 10px; @@ -48,7 +48,7 @@ interface Props { attachment: APIAttachment; } -function Audio({ attachment }: Props) { +export function Audio({ attachment }: Props) { const url = attachment.proxy_url && attachment.proxy_url.length > 0 ? attachment.proxy_url : attachment.url; return ( @@ -68,5 +68,3 @@ function Audio({ attachment }: Props) { ); } - -export default Audio; diff --git a/src/components/media/File.tsx b/src/components/media/File.tsx index 47315f21..b9ba04dc 100644 --- a/src/components/media/File.tsx +++ b/src/components/media/File.tsx @@ -1,6 +1,6 @@ import { APIAttachment } from "@spacebarchat/spacebar-api-types/v9"; +import { bytesToSize } from "@utils"; import styled from "styled-components"; -import { bytesToSize } from "../../utils/Utils"; import Icon from "../Icon"; import Link from "../Link"; @@ -48,7 +48,7 @@ interface Props { attachment: APIAttachment; } -function File({ attachment }: Props) { +export function File({ attachment }: Props) { const url = attachment.proxy_url && attachment.proxy_url.length > 0 ? attachment.proxy_url : attachment.url; return ( @@ -65,5 +65,3 @@ function File({ attachment }: Props) { ); } - -export default File; diff --git a/src/components/media/Video.tsx b/src/components/media/Video.tsx index 5d1c78f0..1daa56e7 100644 --- a/src/components/media/Video.tsx +++ b/src/components/media/Video.tsx @@ -1,8 +1,8 @@ import { APIAttachment } from "@spacebarchat/spacebar-api-types/v9"; +import { calculateImageRatio, calculateScaledDimensions } from "@utils"; import React from "react"; import { PuffLoader } from "react-spinners"; import styled from "styled-components"; -import { calculateImageRatio, calculateScaledDimensions } from "../../utils/Message"; const Container = styled.div` display: flex; @@ -18,7 +18,7 @@ interface Props { attachment: APIAttachment; } -function Video({ attachment }: Props) { +export function Video({ attachment }: Props) { const ref = React.useRef(null); const [isLoading, setLoading] = React.useState(true); const [dimensions, setDimensions] = React.useState({ width: 0, height: 0 }); @@ -72,5 +72,3 @@ function Video({ attachment }: Props) { ); } - -export default Video; diff --git a/src/components/media/index.ts b/src/components/media/index.ts new file mode 100644 index 00000000..e865a532 --- /dev/null +++ b/src/components/media/index.ts @@ -0,0 +1,3 @@ +export * from "./Audio"; +export * from "./File"; +export * from "./Video"; diff --git a/src/components/messaging/Chat.tsx b/src/components/messaging/Chat.tsx index 723992f2..d9fa76cc 100644 --- a/src/components/messaging/Chat.tsx +++ b/src/components/messaging/Chat.tsx @@ -1,12 +1,11 @@ +import MemberList from "@components/MemberList/MemberList"; +import { useAppStore } from "@hooks/useAppStore"; +import useLogger from "@hooks/useLogger"; +import { Channel, Guild } from "@structures"; import { runInAction } from "mobx"; import { observer } from "mobx-react-lite"; import React, { useEffect } from "react"; import styled from "styled-components"; -import { useAppStore } from "../../hooks/useAppStore"; -import useLogger from "../../hooks/useLogger"; -import Channel from "../../stores/objects/Channel"; -import Guild from "../../stores/objects/Guild"; -import MemberList from "../MemberList/MemberList"; import ChatHeader from "./ChatHeader"; import MessageInput from "./MessageInput"; import MessageList from "./MessageList"; diff --git a/src/components/messaging/ChatHeader.tsx b/src/components/messaging/ChatHeader.tsx index 411fb9ee..98c0044f 100644 --- a/src/components/messaging/ChatHeader.tsx +++ b/src/components/messaging/ChatHeader.tsx @@ -1,13 +1,12 @@ +import { Floating, FloatingTrigger } from "@components/floating"; +import Icon from "@components/Icon"; +import { SectionHeader } from "@components/SectionHeader"; +import { useAppStore } from "@hooks/useAppStore"; +import useLogger from "@hooks/useLogger"; import * as Icons from "@mdi/js"; +import { Channel } from "@structures"; import { observer } from "mobx-react-lite"; import styled from "styled-components"; -import { useAppStore } from "../../hooks/useAppStore"; -import useLogger from "../../hooks/useLogger"; -import Channel from "../../stores/objects/Channel"; -import Icon from "../Icon"; -import { SectionHeader } from "../SectionHeader"; -import Floating from "../floating/Floating"; -import FloatingTrigger from "../floating/FloatingTrigger"; const IconButton = styled.button` margin: 0; diff --git a/src/components/messaging/EmbedMedia.tsx b/src/components/messaging/EmbedMedia.tsx index aae58a24..b2612e0c 100644 --- a/src/components/messaging/EmbedMedia.tsx +++ b/src/components/messaging/EmbedMedia.tsx @@ -1,9 +1,9 @@ // adapted from Revite // https://github.com/revoltchat/revite/blob/master/src/components/common/messaging/embed/Embed.tsx +import { modalController } from "@/controllers/modals"; +import Icon from "@components/Icon"; import { APIEmbed, EmbedType } from "@spacebarchat/spacebar-api-types/v9"; -import { modalController } from "../../controllers/modals"; -import Icon from "../Icon"; import styles from "./Embed.module.css"; function getScaledDimensions(originalWidth: number, originalHeight: number, maxWidth: number, maxHeight: number) { diff --git a/src/components/messaging/Message.tsx b/src/components/messaging/Message.tsx index bb5824cf..2cf4e018 100644 --- a/src/components/messaging/Message.tsx +++ b/src/components/messaging/Message.tsx @@ -1,11 +1,11 @@ +import Avatar from "@components/Avatar"; +import InviteEmbed from "@components/InviteEmbed"; +import Markdown from "@components/markdown/MarkdownRenderer"; +import { ContextMenuContext } from "@contexts/ContextMenuContext"; +import { useAppStore } from "@hooks/useAppStore"; +import { MessageLike, QueuedMessageStatus } from "@structures"; import { observer } from "mobx-react-lite"; import { memo, useContext } from "react"; -import { ContextMenuContext } from "../../contexts/ContextMenuContext"; -import { useAppStore } from "../../hooks/useAppStore"; -import { MessageLike } from "../../stores/objects/Message"; -import { QueuedMessageStatus } from "../../stores/objects/QueuedMessage"; -import Avatar from "../Avatar"; -import Markdown from "../markdown/MarkdownRenderer"; import MessageAttachment from "./MessageAttachment"; import MessageAuthor from "./MessageAuthor"; import MessageBase, { MessageContent, MessageContentText, MessageDetails, MessageInfo } from "./MessageBase"; @@ -69,6 +69,10 @@ function Message({ message, header }: Props) { {"embeds" in message && message.embeds?.map((embed, index) => )} {"files" in message && message.files?.length !== 0 && } + {"invites" in message && + message.invites.map((code, index) => ( + + ))} ); diff --git a/src/components/messaging/MessageAttachment.tsx b/src/components/messaging/MessageAttachment.tsx index 55f99f3a..c39397b1 100644 --- a/src/components/messaging/MessageAttachment.tsx +++ b/src/components/messaging/MessageAttachment.tsx @@ -1,11 +1,9 @@ +import { modalController } from "@/controllers/modals"; +import { Audio, File, Video } from "@components/media"; +import useLogger from "@hooks/useLogger"; import { APIAttachment } from "@spacebarchat/spacebar-api-types/v9"; +import { getFileDetails, zoomFit } from "@utils"; import styled from "styled-components"; -import { modalController } from "../../controllers/modals"; -import useLogger from "../../hooks/useLogger"; -import { getFileDetails, zoomFit } from "../../utils/Utils"; -import Audio from "../media/Audio"; -import File from "../media/File"; -import Video from "../media/Video"; const MAX_ATTACHMENT_HEIGHT = 350; diff --git a/src/components/messaging/MessageAuthor.tsx b/src/components/messaging/MessageAuthor.tsx index 73d59202..56275e61 100644 --- a/src/components/messaging/MessageAuthor.tsx +++ b/src/components/messaging/MessageAuthor.tsx @@ -1,14 +1,11 @@ +import { Floating, FloatingTrigger } from "@components/floating"; +import { ContextMenuContext } from "@contexts/ContextMenuContext"; +import { useAppStore } from "@hooks/useAppStore"; +import useLogger from "@hooks/useLogger"; +import { Guild, GuildMember, MessageLike } from "@structures"; import { observer } from "mobx-react-lite"; import React, { useContext } from "react"; import styled from "styled-components"; -import { ContextMenuContext } from "../../contexts/ContextMenuContext"; -import { useAppStore } from "../../hooks/useAppStore"; -import useLogger from "../../hooks/useLogger"; -import Guild from "../../stores/objects/Guild"; -import GuildMember from "../../stores/objects/GuildMember"; -import { MessageLike } from "../../stores/objects/Message"; -import Floating from "../floating/Floating"; -import FloatingTrigger from "../floating/FloatingTrigger"; const Container = styled.div` font-size: 16px; diff --git a/src/components/messaging/MessageBase.tsx b/src/components/messaging/MessageBase.tsx index 527dd2c3..967d39b6 100644 --- a/src/components/messaging/MessageBase.tsx +++ b/src/components/messaging/MessageBase.tsx @@ -1,10 +1,9 @@ +import { Floating, FloatingTrigger } from "@components/floating"; +import { Message, MessageLike } from "@structures"; +import { calendarStrings } from "@utils"; import dayjs from "dayjs"; import { observer } from "mobx-react-lite"; import styled from "styled-components"; -import Message, { MessageLike } from "../../stores/objects/Message"; -import { calendarStrings } from "../../utils/i18n"; -import Floating from "../floating/Floating"; -import FloatingTrigger from "../floating/FloatingTrigger"; interface Props { header?: boolean; @@ -71,6 +70,7 @@ export const MessageContent = styled.div` justify-content: center; padding-right: 48px; word-wrap: anywhere; + flex: 1; `; export const MessageContentText = styled.div<{ sending?: boolean; failed?: boolean }>` diff --git a/src/components/messaging/MessageEmbed.tsx b/src/components/messaging/MessageEmbed.tsx index 11921e2d..9d91a99d 100644 --- a/src/components/messaging/MessageEmbed.tsx +++ b/src/components/messaging/MessageEmbed.tsx @@ -1,16 +1,14 @@ // adapted from Revite // https://github.com/revoltchat/revite/blob/master/src/components/common/messaging/embed/Embed.tsx +import { Markdown, MarkdownRenderer } from "@components/markdown"; import { APIEmbed, EmbedType } from "@spacebarchat/spacebar-api-types/v9"; +import { decimalColorToHex } from "@utils"; import classNames from "classnames"; import React from "react"; -import { decimalColorToHex } from "../../utils/Utils"; -import Markdown from "../markdown/Markdown"; -import MarkdownRenderer from "../markdown/MarkdownRenderer"; import styles from "./Embed.module.css"; import EmbedMedia from "./EmbedMedia"; import { MessageAreaWidthContext } from "./MessageList"; - const LINK_EMBED_MAX_WIDTH = 516; const RICH_EMBED_MAX_WIDTH = 428; const CONTAINER_PADDING = 24; @@ -60,7 +58,7 @@ function MessageEmbed({ embed }: Props) { className={classNames(styles.embed, styles.website)} style={{ borderInlineStartColor: embed.color ? decimalColorToHex(embed.color) : "var(--background-tertiary)", - maxWidth: 432, + maxWidth: 430, }} >
{ if (isTouchscreenDevice) return; - ref.current && ref.current.focus(); + if (ref.current) ref.current.focus(); }, [props.value]); const inputSelected = () => ["TEXTAREA", "INPUT"].includes(document.activeElement?.nodeName ?? ""); diff --git a/src/components/messaging/SystemMessage.tsx b/src/components/messaging/SystemMessage.tsx index 0d7ab692..a6d82b6b 100644 --- a/src/components/messaging/SystemMessage.tsx +++ b/src/components/messaging/SystemMessage.tsx @@ -1,11 +1,11 @@ +import Icon from "@components/Icon"; import * as Icons from "@mdi/js"; import { MessageType } from "@spacebarchat/spacebar-api-types/v9"; +import { MessageLike } from "@structures"; import { observer } from "mobx-react-lite"; import ReactMarkdown from "react-markdown"; import reactStringReplace from "react-string-replace"; import styled from "styled-components"; -import { MessageLike } from "../../stores/objects/Message"; -import Icon from "../Icon"; import MessageBase, { MessageDetails, MessageInfo } from "./MessageBase"; const SystemContent = styled.div` diff --git a/src/components/messaging/TextareaAutosize.tsx b/src/components/messaging/TextareaAutosize.tsx new file mode 100644 index 00000000..ca2c0562 --- /dev/null +++ b/src/components/messaging/TextareaAutosize.tsx @@ -0,0 +1,276 @@ +import { muiDebounce as debounce, ownerWindow, useEnhancedEffect, useForkRef } from "@utils/mui"; +import * as React from "react"; +// import PropTypes from 'prop-types'; +// import { +// unstable_debounce as debounce, +// unstable_useForkRef as useForkRef, +// unstable_useEnhancedEffect as useEnhancedEffect, +// unstable_ownerWindow as ownerWindow, +// } from '@mui/utils'; + +export interface TextareaAutosizeProps + extends Omit, "children" | "rows"> { + ref?: React.Ref; + /** + * Maximum number of rows to display. + */ + maxRows?: string | number; + /** + * Minimum number of rows to display. + * @default 1 + */ + minRows?: string | number; +} + +function getStyleValue(value: string) { + return parseInt(value, 10) || 0; +} + +const styles: { + shadow: React.CSSProperties; +} = { + shadow: { + // Visibility needed to hide the extra text area on iPads + visibility: "hidden", + // Remove from the content flow + position: "absolute", + // Ignore the scrollbar width + overflow: "hidden", + height: 0, + top: 0, + left: 0, + // Create a new layer, increase the isolation of the computed values + transform: "translateZ(0)", + }, +}; + +type TextareaStyles = { + outerHeightStyle: number; + overflowing: boolean; +}; + +function isEmpty(obj: TextareaStyles) { + return ( + obj === undefined || + obj === null || + Object.keys(obj).length === 0 || + (obj.outerHeightStyle === 0 && !obj.overflowing) + ); +} + +/** + * + * Demos: + * + * - [Textarea Autosize](https://mui.com/base-ui/react-textarea-autosize/) + * - [Textarea Autosize](https://mui.com/material-ui/react-textarea-autosize/) + * + * API: + * + * - [TextareaAutosize API](https://mui.com/base-ui/react-textarea-autosize/components-api/#textarea-autosize) + */ +const TextareaAutosize = React.forwardRef(function TextareaAutosize( + props: TextareaAutosizeProps, + forwardedRef: React.ForwardedRef, +) { + const { onChange, maxRows, minRows = 1, style, value, ...other } = props; + + const { current: isControlled } = React.useRef(value != null); + const inputRef = React.useRef(null); + const handleRef = useForkRef(forwardedRef, inputRef); + const heightRef = React.useRef(null); + const shadowRef = React.useRef(null); + + const calculateTextareaStyles = React.useCallback(() => { + const input = inputRef.current!; + + const containerWindow = ownerWindow(input); + const computedStyle = containerWindow.getComputedStyle(input); + + // If input's width is shrunk and it's not visible, don't sync height. + if (computedStyle.width === "0px") { + return { + outerHeightStyle: 0, + overflowing: false, + }; + } + + const inputShallow = shadowRef.current!; + + inputShallow.style.width = computedStyle.width; + inputShallow.value = input.value || props.placeholder || "x"; + if (inputShallow.value.slice(-1) === "\n") { + // Certain fonts which overflow the line height will cause the textarea + // to report a different scrollHeight depending on whether the last line + // is empty. Make it non-empty to avoid this issue. + inputShallow.value += " "; + } + + const boxSizing = computedStyle.boxSizing; + const padding = getStyleValue(computedStyle.paddingBottom) + getStyleValue(computedStyle.paddingTop); + const border = getStyleValue(computedStyle.borderBottomWidth) + getStyleValue(computedStyle.borderTopWidth); + + // The height of the inner content + const innerHeight = inputShallow.scrollHeight; + + // Measure height of a textarea with a single row + inputShallow.value = "x"; + const singleRowHeight = inputShallow.scrollHeight; + + // The height of the outer content + let outerHeight = innerHeight; + + if (minRows) { + outerHeight = Math.max(Number(minRows) * singleRowHeight, outerHeight); + } + if (maxRows) { + outerHeight = Math.min(Number(maxRows) * singleRowHeight, outerHeight); + } + outerHeight = Math.max(outerHeight, singleRowHeight); + + // Take the box sizing into account for applying this value as a style. + const outerHeightStyle = outerHeight + (boxSizing === "border-box" ? padding + border : 0); + const overflowing = Math.abs(outerHeight - innerHeight) <= 1; + + return { outerHeightStyle, overflowing }; + }, [maxRows, minRows, props.placeholder]); + + const syncHeight = React.useCallback(() => { + const textareaStyles = calculateTextareaStyles(); + + if (isEmpty(textareaStyles)) { + return; + } + + const outerHeightStyle = textareaStyles.outerHeightStyle; + const input = inputRef.current!; + if (heightRef.current !== outerHeightStyle) { + heightRef.current = outerHeightStyle; + input.style.height = `${outerHeightStyle}px`; + } + input.style.overflow = textareaStyles.overflowing ? "hidden" : ""; + }, [calculateTextareaStyles]); + + useEnhancedEffect(() => { + const handleResize = () => { + syncHeight(); + }; + // Workaround a "ResizeObserver loop completed with undelivered notifications" error + // in test. + // Note that we might need to use this logic in production per https://github.com/WICG/resize-observer/issues/38 + // Also see https://github.com/mui/mui-x/issues/8733 + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let rAF: any; + const rAFHandleResize = () => { + cancelAnimationFrame(rAF); + rAF = requestAnimationFrame(() => { + handleResize(); + }); + }; + const debounceHandleResize = debounce(handleResize); + const input = inputRef.current!; + const containerWindow = ownerWindow(input); + + containerWindow.addEventListener("resize", debounceHandleResize); + + let resizeObserver: ResizeObserver; + + if (typeof ResizeObserver !== "undefined") { + resizeObserver = new ResizeObserver(process.env.NODE_ENV === "test" ? rAFHandleResize : handleResize); + resizeObserver.observe(input); + } + + return () => { + debounceHandleResize.clear(); + cancelAnimationFrame(rAF); + containerWindow.removeEventListener("resize", debounceHandleResize); + if (resizeObserver) { + resizeObserver.disconnect(); + } + }; + }, [calculateTextareaStyles, syncHeight]); + + useEnhancedEffect(() => { + syncHeight(); + }); + + const handleChange = (event: React.ChangeEvent) => { + if (!isControlled) { + syncHeight(); + } + + if (onChange) { + onChange(event); + } + }; + + return ( + +