From 18f44a8658a4c84a1d39500fed9cdeb6fba53e77 Mon Sep 17 00:00:00 2001 From: Jonson Petard <41122242+greenhat616@users.noreply.github.com> Date: Wed, 28 Feb 2024 21:31:47 +0800 Subject: [PATCH] chore: merge from `upstream/main` (#1) * chore(deps): update dependency @types/react to v18.2.60 * chore(deps): update lint packages to v19 (#498) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(tray): use base64 encoded id to fix item not found issue * fix(deps): update dependency @emotion/react to v11.11.4 * chore(manifest): update manifest [skip ci] * chore(deps): update dependency @commitlint/cli to v19.0.1 * fix(deps): update rust crate tauri to v1.6.1 (#504) * fix(deps): update rust crate open to v5.0.2 * feat: add MDYSwitch & replace all Switches with MDYSwitch * feat: MDYSwitch support loading prop * refactor(single-instance): refactor single instance check (#499) * fix: deps conflict * refactor(single-instance): remove related old single instance check code * fix: lint * refactor: improve ux --------- Co-authored-by: Jonson Petard * chore: remove console and debugger when not in dev mode * fix: MDYSwitch switchBase padding value * feat: refactor GuardStatus & support loading status * fix: line breaks typos --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: keiko233 Co-authored-by: 403F <4o3f@proton.me> Co-authored-by: keiko233 --- backend/Cargo.lock | 186 +++-- backend/sysproxy-rs/Cargo.toml | 2 +- backend/sysproxy-rs/src/windows.rs | 6 +- backend/tauri/Cargo.toml | 1 + backend/tauri/src/core/tasks/jobs/logger.rs | 1 + backend/tauri/src/core/tray/proxies.rs | 56 +- backend/tauri/src/main.rs | 25 +- backend/tauri/src/utils/dirs.rs | 22 +- locales/zh.json | 2 +- manifest/version.json | 4 +- package.json | 8 +- pnpm-lock.yaml | 678 ++++++------------ src/components/common/mdy-switch.scss | 15 + src/components/common/mdy-switch.tsx | 89 +++ src/components/profile/profile-viewer.tsx | 6 +- src/components/setting/mods/guard-state.tsx | 52 +- src/components/setting/mods/layout-viewer.tsx | 19 +- src/components/setting/mods/misc-viewer.tsx | 8 +- .../setting/mods/sysproxy-viewer.tsx | 4 +- src/components/setting/setting-clash.tsx | 46 +- src/components/setting/setting-system.tsx | 64 +- src/components/setting/setting-verge.tsx | 15 +- vite.config.ts | 52 +- 23 files changed, 651 insertions(+), 710 deletions(-) create mode 100644 src/components/common/mdy-switch.scss create mode 100644 src/components/common/mdy-switch.tsx diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 0369865b2b..e7573a9096 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -41,9 +41,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713b3834d76b85304d4d525563c1276e2e30dc97cc67bfb4585a4a29fc2c89f" +checksum = "8b79b82693f705137f8fb9b37871d99e4f9a7df12b917eed79c3d3954830a60b" dependencies = [ "cfg-if", "getrandom 0.2.12", @@ -258,7 +258,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -293,7 +293,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -405,7 +405,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -483,9 +483,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "serde", @@ -575,9 +575,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3286b845d0fccbdd15af433f61c5970e711987036cb468f437ff6badd70f4e24" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" dependencies = [ "libc", ] @@ -678,6 +678,7 @@ dependencies = [ "async-trait", "auto-launch", "backon", + "base64 0.21.7", "chrono", "ctrlc", "deelevate", @@ -691,7 +692,7 @@ dependencies = [ "log", "nanoid", "once_cell", - "open 5.0.1", + "open 5.0.2", "parking_lot", "port_scanner", "reqwest", @@ -802,7 +803,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f76990911f2267d837d9d0ad060aa63aaad170af40904b29461734c339030d4d" dependencies = [ "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -976,17 +977,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] name = "ctor" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" +checksum = "ad291aa74992b9b7a7e88c38acbbf6ad7e107f1d90ee8775b7bc1fc3394f485c" dependencies = [ "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1020,7 +1021,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1031,7 +1032,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1291,7 +1292,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1484,7 +1485,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1602,7 +1603,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -1732,15 +1733,16 @@ dependencies = [ [[package]] name = "generator" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +checksum = "b5b25e5b3e733153bcab35ee4671b46604b42516163cae442d1601cb716f2ac5" dependencies = [ "cc", + "cfg-if", "libc", "log", "rustversion", - "windows 0.48.0", + "windows 0.53.0", ] [[package]] @@ -2020,7 +2022,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.9", + "ahash 0.8.10", ] [[package]] @@ -2070,9 +2072,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" [[package]] name = "hex" @@ -2390,7 +2392,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c416c05ba2a10240e022887617af3128fccdbf69713214da0fc81a5690d00df7" dependencies = [ - "ahash 0.8.9", + "ahash 0.8.10", "once_cell", "regex", ] @@ -3232,9 +3234,9 @@ dependencies = [ [[package]] name = "open" -version = "5.0.1" +version = "5.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90878fb664448b54c4e592455ad02831e23a3f7e157374a8b95654731aac7349" +checksum = "eedff767bc49d336bff300224f73307ae36963c843e38dc9312a22171b012cbc" dependencies = [ "is-wsl", "libc", @@ -3264,7 +3266,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -3480,7 +3482,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -3618,7 +3620,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -3665,7 +3667,7 @@ checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -3955,9 +3957,9 @@ checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "rayon" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" dependencies = [ "either", "rayon-core", @@ -4010,7 +4012,7 @@ checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4225,7 +4227,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml 0.8.26", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4496,7 +4498,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4519,7 +4521,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4570,7 +4572,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -4924,9 +4926,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" dependencies = [ "proc-macro2", "quote", @@ -4974,7 +4976,7 @@ dependencies = [ "interfaces", "iptools", "thiserror", - "windows 0.52.0", + "windows 0.54.0", "winreg 0.52.0", ] @@ -5104,9 +5106,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tauri" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da520ff07c0745199204f7a7a62a8c6ee1666313b792b051ca170eca04649aa" +checksum = "f078117725e36d55d29fafcbb4b1e909073807ca328ae8deb8c0b3843aac0fed" dependencies = [ "anyhow", "base64 0.21.7", @@ -5262,9 +5264,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a561ae38c6b27510c77a3ab4cf65bebe18fba51ca4569e023fb9e194ff4995fb" +checksum = "067c56fc153b3caf406d7cd6de4486c80d1d66c0f414f39e94cb2f5543f6445f" dependencies = [ "cocoa 0.24.1", "gtk", @@ -5430,7 +5432,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -5532,7 +5534,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -5699,7 +5701,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -6084,7 +6086,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", "wasm-bindgen-shared", ] @@ -6118,7 +6120,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6357,15 +6359,6 @@ dependencies = [ "windows_x86_64_msvc 0.39.0", ] -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows" version = "0.51.1" @@ -6386,6 +6379,26 @@ dependencies = [ "windows-targets 0.52.3", ] +[[package]] +name = "windows" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" +dependencies = [ + "windows-core 0.53.0", + "windows-targets 0.52.3", +] + +[[package]] +name = "windows" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" +dependencies = [ + "windows-core 0.54.0", + "windows-targets 0.52.3", +] + [[package]] name = "windows-bindgen" version = "0.39.0" @@ -6414,6 +6427,26 @@ dependencies = [ "windows-targets 0.52.3", ] +[[package]] +name = "windows-core" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" +dependencies = [ + "windows-result", + "windows-targets 0.52.3", +] + +[[package]] +name = "windows-core" +version = "0.54.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" +dependencies = [ + "windows-result", + "windows-targets 0.52.3", +] + [[package]] name = "windows-implement" version = "0.39.0" @@ -6430,6 +6463,15 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" +[[package]] +name = "windows-result" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +dependencies = [ + "windows-targets 0.52.3", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -6866,9 +6908,9 @@ dependencies = [ [[package]] name = "zbus" -version = "3.15.1" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5acecd3f8422f198b1a2f954bcc812fe89f3fa4281646f3da1da7925db80085d" +checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" dependencies = [ "async-broadcast", "async-executor", @@ -6907,9 +6949,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.15.1" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2207eb71efebda17221a579ca78b45c4c5f116f074eb745c3a172e688ccf89f5" +checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6947,7 +6989,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.51", ] [[package]] @@ -7010,9 +7052,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.15.1" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b4fcf3660d30fc33ae5cd97e2017b23a96e85afd7a1dd014534cd0bf34ba67" +checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" dependencies = [ "byteorder", "enumflags2", @@ -7024,9 +7066,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.15.1" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0277758a8a0afc0e573e80ed5bfd9d9c2b48bd3108ffe09384f9f738c83f4a55" +checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7037,9 +7079,9 @@ dependencies = [ [[package]] name = "zvariant_utils" -version = "1.1.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00bedb16a193cc12451873fee2a1bc6550225acece0e36f333e68326c73c8172" +checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" dependencies = [ "proc-macro2", "quote", diff --git a/backend/sysproxy-rs/Cargo.toml b/backend/sysproxy-rs/Cargo.toml index 5f7b4e23c2..9cdae4013a 100644 --- a/backend/sysproxy-rs/Cargo.toml +++ b/backend/sysproxy-rs/Cargo.toml @@ -20,7 +20,7 @@ iptools = "0.2.5" winreg = { version = "0.52", features = ["transactions"] } [target.'cfg(target_os = "windows")'.dependencies.windows] -version = "0.52" +version = "0.54" features = [ "Win32_Networking_WinInet", # "Win32_Networking_WinHttp", diff --git a/backend/sysproxy-rs/src/windows.rs b/backend/sysproxy-rs/src/windows.rs index 995d1c6631..618d909bce 100644 --- a/backend/sysproxy-rs/src/windows.rs +++ b/backend/sysproxy-rs/src/windows.rs @@ -48,7 +48,7 @@ fn unset_proxy() -> Result<()> { dwSize: size_of::() as u32, dwOptionCount: 1, dwOptionError: 0, - pOptions: p_opts.as_mut_ptr() as *mut INTERNET_PER_CONN_OPTIONW, + pOptions: p_opts.as_mut_ptr(), pszConnection: PWSTR::null(), }; let res = apply(&opts); @@ -83,7 +83,7 @@ fn set_auto_proxy(url: &str) -> Result<()> { dwSize: size_of::() as u32, dwOptionCount: 2, dwOptionError: 0, - pOptions: p_opts.as_mut_ptr() as *mut INTERNET_PER_CONN_OPTIONW, + pOptions: p_opts.as_mut_ptr(), pszConnection: PWSTR::null(), }; @@ -133,7 +133,7 @@ fn set_global_proxy(server: String, bypass: String) -> Result<()> { dwSize: size_of::() as u32, dwOptionCount: 3, dwOptionError: 0, - pOptions: p_opts.as_mut_ptr() as *mut INTERNET_PER_CONN_OPTIONW, + pOptions: p_opts.as_mut_ptr(), pszConnection: PWSTR::null(), }; diff --git a/backend/tauri/Cargo.toml b/backend/tauri/Cargo.toml index d686d7d284..5ba8348ec6 100644 --- a/backend/tauri/Cargo.toml +++ b/backend/tauri/Cargo.toml @@ -82,6 +82,7 @@ tracing-log = { version = "0.2" } tracing-appender = { version = "0.2", features = ["parking_lot"] } single-instance = "0.3.3" tauri-plugin-deep-link = { path = "../tauri-plugin-deep-link", version = "0.1.2" } +base64 = "0.21" [target.'cfg(windows)'.dependencies] deelevate = "0.2.0" diff --git a/backend/tauri/src/core/tasks/jobs/logger.rs b/backend/tauri/src/core/tasks/jobs/logger.rs index 02823afe83..2600918c56 100644 --- a/backend/tauri/src/core/tasks/jobs/logger.rs +++ b/backend/tauri/src/core/tasks/jobs/logger.rs @@ -31,6 +31,7 @@ pub fn clear_logs() -> Result<()> { let minutes = { let verge = Config::verge(); let verge = verge.data(); + #[allow(deprecated)] verge.auto_log_clean.unwrap_or(0) }; if minutes == 0 { diff --git a/backend/tauri/src/core/tray/proxies.rs b/backend/tauri/src/core/tray/proxies.rs index 0fab812b48..f8d2519bfe 100644 --- a/backend/tauri/src/core/tray/proxies.rs +++ b/backend/tauri/src/core/tray/proxies.rs @@ -2,6 +2,8 @@ use crate::core::{ clash::proxies::{Proxies, ProxiesGuard, ProxiesGuardExt}, handle::Handle, }; +use anyhow::Context; +use base64::{engine::general_purpose::STANDARD as base64_standard, Engine as _}; use indexmap::IndexMap; use tauri::SystemTrayMenu; use tracing::{debug, error, warn}; @@ -135,6 +137,7 @@ fn diff_proxies(old_proxies: &TrayProxies, new_proxies: &TrayProxies) -> TrayUpd TrayUpdateType::Part(actions) } } + #[instrument] pub async fn proxies_updated_receiver() { let (mut rx, mut tray_proxies_holder) = { @@ -198,13 +201,19 @@ pub fn setup_proxies() { mod platform_impl { use super::{ProxySelectAction, TrayProxyItem}; use crate::core::{clash::proxies::ProxiesGuard, handle::Handle}; + use base64::{engine::general_purpose::STANDARD as base64_standard, Engine as _}; use tauri::{CustomMenuItem, SystemTrayMenu, SystemTraySubmenu}; use tracing::warn; + pub fn generate_group_selector(group_name: &str, group: &TrayProxyItem) -> SystemTraySubmenu { let mut group_menu = SystemTrayMenu::new(); for item in group.all.iter() { let mut sub_item = CustomMenuItem::new( - format!("select_proxy_{}_{}", group_name, item), + format!( + "select_proxy_{}_{}", + base64_standard.encode(group_name), + base64_standard.encode(item) + ), item.clone(), ); if let Some(now) = group.current.clone() { @@ -252,8 +261,16 @@ mod platform_impl { .unwrap() .tray_handle(); for action in actions { - let from = format!("select_proxy_{}_{}", action.0, action.1); - let to = format!("select_proxy_{}_{}", action.0, action.2); + let from = format!( + "select_proxy_{}_{}", + base64_standard.encode(&action.0), + base64_standard.encode(&action.1) + ); + let to = format!( + "select_proxy_{}_{}", + base64_standard.encode(&action.0), + base64_standard.encode(&action.2) + ); match tray.try_get_item(&from) { Some(item) => { @@ -294,17 +311,24 @@ pub fn on_system_tray_event(event: &str) { if parts.len() != 4 { return; // bypass invalid event } - let group = parts[2].to_owned(); - let name = parts[3].to_owned(); - tauri::async_runtime::spawn(async move { - match ProxiesGuard::global().select_proxy(&group, &name).await { - Ok(_) => { - debug!("select proxy success: {} {}", group, name); - } - Err(e) => { - warn!("select proxy failed, {} {}, cause: {:?}", group, name, e); - // TODO: add a error dialog or notification - } - } - }); + + let wrapper = move || -> anyhow::Result<()> { + let group = String::from_utf8(base64_standard.decode(parts[2])?)?; + let name = String::from_utf8(base64_standard.decode(parts[3])?)?; + tauri::async_runtime::block_on(async move { + ProxiesGuard::global() + .select_proxy(&group, &name) + .await + .with_context(|| format!("select proxy failed, {} {}, cause: ", group, name))?; + + debug!("select proxy success: {} {}", group, name); + Ok::<(), anyhow::Error>(()) + })?; + Ok(()) + }; + + if let Err(e) = wrapper() { + // TODO: add a error dialog or notification + error!("on_system_tray_event failed: {:?}", e); + } } diff --git a/backend/tauri/src/main.rs b/backend/tauri/src/main.rs index f1f1614487..8f58382e48 100644 --- a/backend/tauri/src/main.rs +++ b/backend/tauri/src/main.rs @@ -14,6 +14,7 @@ use crate::{ config::Config, utils::{init, resolve}, }; +use anyhow::Context; use tauri::{api, Manager, SystemTray}; rust_i18n::i18n!("../../locales"); @@ -48,17 +49,16 @@ fn main() -> std::io::Result<()> { // Should be in first place in order prevent single instance check block everything tauri_plugin_deep_link::prepare("moe.elaina.clash.nyanpasu"); - #[cfg(not(feature = "verge-dev"))] - let instance_id = "clash-nyanpasu"; - #[cfg(feature = "verge-dev")] - let instance_id = "clash-nyanpasu-dev"; - // 单例检测 - let instance = single_instance::SingleInstance::new(instance_id).unwrap(); - if !instance.is_single() { - println!("app exists"); - return Ok(()); - } + let single_instance_result: anyhow::Result<()> = + single_instance::SingleInstance::new(utils::dirs::APP_NAME) + .context("failed to create single instance") + .map(|instance| { + if !instance.is_single() { + println!("app exists"); + std::process::exit(0); + } + }); // Use system locale as default let locale = { @@ -80,6 +80,11 @@ fn main() -> std::io::Result<()> { let verge = { Config::verge().latest().language.clone().unwrap() }; rust_i18n::set_locale(verge.as_str()); + // show a dialog to print the single instance error + if let Err(e) = single_instance_result { + utils::dialog::panic_dialog(&format!("{:?}", e)); + } + #[allow(unused_mut)] let mut builder = tauri::Builder::default() .system_tray(SystemTray::new()) diff --git a/backend/tauri/src/utils/dirs.rs b/backend/tauri/src/utils/dirs.rs index c5de001a36..e5bfeb1c9e 100644 --- a/backend/tauri/src/utils/dirs.rs +++ b/backend/tauri/src/utils/dirs.rs @@ -7,13 +7,13 @@ use tauri::{ }; #[cfg(not(feature = "verge-dev"))] -static OLD_APP_DIR: &str = "clash-verge"; +const PREVIOUS_APP_NAME: &str = "clash-verge"; #[cfg(feature = "verge-dev")] -static OLD_APP_DIR: &str = "clash-verge-dev"; +const PREVIOUS_APP_NAME: &str = "clash-verge-dev"; #[cfg(not(feature = "verge-dev"))] -static APP_DIR: &str = "clash-nyanpasu"; +pub const APP_NAME: &str = "clash-nyanpasu"; #[cfg(feature = "verge-dev")] -static APP_DIR: &str = "clash-nyanpasu-dev"; +pub const APP_NAME: &str = "clash-nyanpasu-dev"; static CLASH_CONFIG: &str = "config.yaml"; static VERGE_CONFIG: &str = "verge.yaml"; @@ -64,14 +64,16 @@ pub fn old_app_home_dir() -> Result { Ok(home_dir() .ok_or(anyhow::anyhow!("failed to check old app home dir"))? .join(".config") - .join(OLD_APP_DIR)) + .join(PREVIOUS_APP_NAME)) } else { let app_exe = current_exe()?; let app_exe = dunce::canonicalize(app_exe)?; let app_dir = app_exe .parent() .ok_or(anyhow::anyhow!("failed to check the old portable app dir"))?; - Ok(PathBuf::from(app_dir).join(".config").join(OLD_APP_DIR)) + Ok(PathBuf::from(app_dir) + .join(".config") + .join(PREVIOUS_APP_NAME)) } } @@ -79,7 +81,7 @@ pub fn old_app_home_dir() -> Result { Ok(home_dir() .ok_or(anyhow::anyhow!("failed to get the app home dir"))? .join(".config") - .join(OLD_APP_DIR)) + .join(PREVIOUS_APP_NAME)) } /// get the verge app home dir @@ -92,14 +94,14 @@ pub fn app_home_dir() -> Result { Ok(home_dir() .ok_or(anyhow::anyhow!("failed to get app home dir"))? .join(".config") - .join(APP_DIR)) + .join(APP_NAME)) } else { let app_exe = current_exe()?; let app_exe = dunce::canonicalize(app_exe)?; let app_dir = app_exe .parent() .ok_or(anyhow::anyhow!("failed to get the portable app dir"))?; - Ok(PathBuf::from(app_dir).join(".config").join(APP_DIR)) + Ok(PathBuf::from(app_dir).join(".config").join(APP_NAME)) } } @@ -107,7 +109,7 @@ pub fn app_home_dir() -> Result { Ok(home_dir() .ok_or(anyhow::anyhow!("failed to get the app home dir"))? .join(".config") - .join(APP_DIR)) + .join(APP_NAME)) } /// get the resources dir diff --git a/locales/zh.json b/locales/zh.json index aa74fc5e95..c2684aaa0d 100644 --- a/locales/zh.json +++ b/locales/zh.json @@ -32,6 +32,6 @@ }, "dialog": { "panic": "请将此问题汇报到 Github 问题追踪器", - "migrate": "检测到旧版本配置文件\\n是否迁移到新版本?\\n警告: 此操作会覆盖掉现有配置文件" + "migrate": "检测到旧版本配置文件\n是否迁移到新版本?\n警告: 此操作会覆盖掉现有配置文件" } } diff --git a/manifest/version.json b/manifest/version.json index 2c71fe4c27..ec3b2b6b59 100644 --- a/manifest/version.json +++ b/manifest/version.json @@ -2,7 +2,7 @@ "manifest_version": 1, "latest": { "mihomo": "v1.18.1", - "mihomo_alpha": "alpha-e582941", + "mihomo_alpha": "alpha-f0bc685", "clash_rs": "v0.1.14", "clash_premium": "2023-09-05-gdcc8d87" }, @@ -36,5 +36,5 @@ "darwin-x64": "clash-darwin-amd64-n{}.gz" } }, - "updated_at": "2024-02-26T22:25:41.397Z" + "updated_at": "2024-02-27T22:25:45.188Z" } diff --git a/package.json b/package.json index d41154260e..981d19b0d7 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "@dnd-kit/core": "6.1.0", "@dnd-kit/sortable": "8.0.0", "@dnd-kit/utilities": "3.2.2", - "@emotion/react": "11.11.3", + "@emotion/react": "11.11.4", "@emotion/styled": "11.11.0", "@juggle/resize-observer": "3.4.0", "@mui/icons-material": "5.15.11", @@ -96,13 +96,13 @@ }, "devDependencies": { "@actions/github": "6.0.0", - "@commitlint/cli": "18.6.1", - "@commitlint/config-conventional": "18.6.2", + "@commitlint/cli": "19.0.1", + "@commitlint/config-conventional": "19.0.0", "@tauri-apps/cli": "1.5.10", "@types/fs-extra": "11.0.4", "@types/js-cookie": "3.0.6", "@types/lodash-es": "4.17.12", - "@types/react": "18.2.59", + "@types/react": "18.2.60", "@types/react-dom": "18.2.19", "@types/react-transition-group": "4.4.10", "@typescript-eslint/eslint-plugin": "7.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bee9f9f3ec..7b779c7d3f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,26 +18,26 @@ dependencies: specifier: 3.2.2 version: 3.2.2(react@18.2.0) '@emotion/react': - specifier: 11.11.3 - version: 11.11.3(@types/react@18.2.59)(react@18.2.0) + specifier: 11.11.4 + version: 11.11.4(@types/react@18.2.60)(react@18.2.0) '@emotion/styled': specifier: 11.11.0 - version: 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.59)(react@18.2.0) + version: 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.60)(react@18.2.0) '@juggle/resize-observer': specifier: 3.4.0 version: 3.4.0 '@mui/icons-material': specifier: 5.15.11 - version: 5.15.11(@mui/material@5.15.11)(@types/react@18.2.59)(react@18.2.0) + version: 5.15.11(@mui/material@5.15.11)(@types/react@18.2.60)(react@18.2.0) '@mui/lab': specifier: 5.0.0-alpha.166 - version: 5.0.0-alpha.166(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@mui/material@5.15.11)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) + version: 5.0.0-alpha.166(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@mui/material@5.15.11)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) '@mui/material': specifier: 5.15.11 - version: 5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) + version: 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) '@mui/x-data-grid': specifier: 6.19.5 - version: 6.19.5(@mui/material@5.15.11)(@mui/system@5.15.11)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) + version: 6.19.5(@mui/material@5.15.11)(@mui/system@5.15.11)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) '@tauri-apps/api': specifier: 1.5.3 version: 1.5.3 @@ -64,7 +64,7 @@ dependencies: version: 0.46.0 mui-color-input: specifier: 2.0.3 - version: 2.0.3(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@mui/material@5.15.11)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) + version: 2.0.3(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@mui/material@5.15.11)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) react: specifier: 18.2.0 version: 18.2.0 @@ -104,11 +104,11 @@ devDependencies: specifier: 6.0.0 version: 6.0.0 '@commitlint/cli': - specifier: 18.6.1 - version: 18.6.1(@types/node@18.19.0)(typescript@5.3.3) + specifier: 19.0.1 + version: 19.0.1(@types/node@18.19.0)(typescript@5.3.3) '@commitlint/config-conventional': - specifier: 18.6.2 - version: 18.6.2 + specifier: 19.0.0 + version: 19.0.0 '@tauri-apps/cli': specifier: 1.5.10 version: 1.5.10 @@ -122,8 +122,8 @@ devDependencies: specifier: 4.17.12 version: 4.17.12 '@types/react': - specifier: 18.2.59 - version: 18.2.59 + specifier: 18.2.60 + version: 18.2.60 '@types/react-dom': specifier: 18.2.19 version: 18.2.19 @@ -530,47 +530,44 @@ packages: '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 - /@commitlint/cli@18.6.1(@types/node@18.19.0)(typescript@5.3.3): - resolution: {integrity: sha512-5IDE0a+lWGdkOvKH892HHAZgbAjcj1mT5QrfA/SVbLJV/BbBMGyKN0W5mhgjekPJJwEQdVNvhl9PwUacY58Usw==} + /@commitlint/cli@19.0.1(@types/node@18.19.0)(typescript@5.3.3): + resolution: {integrity: sha512-6D+KT/RasFPF92M549I3lABSBWXAdmKvBfxtYWlWO5JdYFSK+B6jY6XyE/hN/DNSYvwwcuNk+CzbqQcy+EbrCw==} engines: {node: '>=v18'} hasBin: true dependencies: - '@commitlint/format': 18.6.1 - '@commitlint/lint': 18.6.1 - '@commitlint/load': 18.6.1(@types/node@18.19.0)(typescript@5.3.3) - '@commitlint/read': 18.6.1 - '@commitlint/types': 18.6.1 - execa: 5.1.1 - lodash.isfunction: 3.0.9 - resolve-from: 5.0.0 - resolve-global: 1.0.0 + '@commitlint/format': 19.0.0 + '@commitlint/lint': 19.0.0 + '@commitlint/load': 19.0.1(@types/node@18.19.0)(typescript@5.3.3) + '@commitlint/read': 19.0.0 + '@commitlint/types': 19.0.0 + execa: 8.0.1 yargs: 17.7.2 transitivePeerDependencies: - '@types/node' - typescript dev: true - /@commitlint/config-conventional@18.6.2: - resolution: {integrity: sha512-PcgSYg1AKGQIwDQKbaHtJsfqYy4uJTC7crLVZ83lfjcPaec4Pry2vLeaWej7ao2KsT20l9dWoMPpEGg8LWdUuA==} + /@commitlint/config-conventional@19.0.0: + resolution: {integrity: sha512-d8lPm+slPUdA8Zof2Y36RqAm/MmAYx/QQIEd2gKbpfLThQK1oYLs+0C3sMPD+4LIq2kh4cnbV9WnPA0P5sN8Ig==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.0 conventional-changelog-conventionalcommits: 7.0.2 dev: true - /@commitlint/config-validator@18.6.1: - resolution: {integrity: sha512-05uiToBVfPhepcQWE1ZQBR/Io3+tb3gEotZjnI4tTzzPk16NffN6YABgwFQCLmzZefbDcmwWqJWc2XT47q7Znw==} + /@commitlint/config-validator@19.0.0: + resolution: {integrity: sha512-oxJ2k+jBPRyWzv1ixfxwGZO5DJ1S+v3D8u/QESMwuPh3kQmeOYBRxGI+5FDWMwiVSHpztlhvvxDAU9SFXeMqUA==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.0 ajv: 8.12.0 dev: true - /@commitlint/ensure@18.6.1: - resolution: {integrity: sha512-BPm6+SspyxQ7ZTsZwXc7TRQL5kh5YWt3euKmEIBZnocMFkJevqs3fbLRb8+8I/cfbVcAo4mxRlpTPfz8zX7SnQ==} + /@commitlint/ensure@19.0.0: + resolution: {integrity: sha512-G0avCIwjKplTP1Oc9MlDhsYqi1yOWORtJSBpyMbQEnalQAW1tuRxG4LOLRZVKfFqlDWs2SfVQPN0Uw51Ge0f6w==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.0 lodash.camelcase: 4.3.0 lodash.kebabcase: 4.1.1 lodash.snakecase: 4.1.1 @@ -578,121 +575,119 @@ packages: lodash.upperfirst: 4.3.1 dev: true - /@commitlint/execute-rule@18.6.1: - resolution: {integrity: sha512-7s37a+iWyJiGUeMFF6qBlyZciUkF8odSAnHijbD36YDctLhGKoYltdvuJ/AFfRm6cBLRtRk9cCVPdsEFtt/2rg==} + /@commitlint/execute-rule@19.0.0: + resolution: {integrity: sha512-mtsdpY1qyWgAO/iOK0L6gSGeR7GFcdW7tIjcNFxcWkfLDF5qVbPHKuGATFqRMsxcO8OUKNj0+3WOHB7EHm4Jdw==} engines: {node: '>=v18'} dev: true - /@commitlint/format@18.6.1: - resolution: {integrity: sha512-K8mNcfU/JEFCharj2xVjxGSF+My+FbUHoqR+4GqPGrHNqXOGNio47ziiR4HQUPKtiNs05o8/WyLBoIpMVOP7wg==} + /@commitlint/format@19.0.0: + resolution: {integrity: sha512-36P4/2tpGSGQsYoSZEso5fTSTaMSArIK9fszy+5B8hwwAvOfnD4kQtrwfMhiXnf7PCgeX2lx5Jma+pY3Bq326A==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 - chalk: 4.1.2 + '@commitlint/types': 19.0.0 + chalk: 5.3.0 dev: true - /@commitlint/is-ignored@18.6.1: - resolution: {integrity: sha512-MOfJjkEJj/wOaPBw5jFjTtfnx72RGwqYIROABudOtJKW7isVjFe9j0t8xhceA02QebtYf4P/zea4HIwnXg8rvA==} + /@commitlint/is-ignored@19.0.0: + resolution: {integrity: sha512-5b2nIrl8GEjzYAnOK2ZAUxBXvUonYrp3+8kJkUMl8QOtjt2O1gsd71jar7UtoDEqTWJhc+n7lG6lQYMXtcQJAw==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.0 semver: 7.6.0 dev: true - /@commitlint/lint@18.6.1: - resolution: {integrity: sha512-8WwIFo3jAuU+h1PkYe5SfnIOzp+TtBHpFr4S8oJWhu44IWKuVx6GOPux3+9H1iHOan/rGBaiacicZkMZuluhfQ==} + /@commitlint/lint@19.0.0: + resolution: {integrity: sha512-rAAisSpxhA+z4uhsveSt1CuTB+Jld5d7zyNSEK2UWjQaOxicwDP+LFiOdM32n/vwsLlOJqhrInA50UcbRSVaGg==} engines: {node: '>=v18'} dependencies: - '@commitlint/is-ignored': 18.6.1 - '@commitlint/parse': 18.6.1 - '@commitlint/rules': 18.6.1 - '@commitlint/types': 18.6.1 + '@commitlint/is-ignored': 19.0.0 + '@commitlint/parse': 19.0.0 + '@commitlint/rules': 19.0.0 + '@commitlint/types': 19.0.0 dev: true - /@commitlint/load@18.6.1(@types/node@18.19.0)(typescript@5.3.3): - resolution: {integrity: sha512-p26x8734tSXUHoAw0ERIiHyW4RaI4Bj99D8YgUlVV9SedLf8hlWAfyIFhHRIhfPngLlCe0QYOdRKYFt8gy56TA==} + /@commitlint/load@19.0.1(@types/node@18.19.0)(typescript@5.3.3): + resolution: {integrity: sha512-5w5RHhtidRPMRm8ktph+NKypt1Wu5Z2jbU1Lc+1IS9Azy83JWRBQ9xKBbW9gF66R/TwHF0v6Jy8KOqRS8I/GgA==} engines: {node: '>=v18'} dependencies: - '@commitlint/config-validator': 18.6.1 - '@commitlint/execute-rule': 18.6.1 - '@commitlint/resolve-extends': 18.6.1 - '@commitlint/types': 18.6.1 - chalk: 4.1.2 + '@commitlint/config-validator': 19.0.0 + '@commitlint/execute-rule': 19.0.0 + '@commitlint/resolve-extends': 19.0.1 + '@commitlint/types': 19.0.0 + chalk: 5.3.0 cosmiconfig: 8.3.6(typescript@5.3.3) cosmiconfig-typescript-loader: 5.0.0(@types/node@18.19.0)(cosmiconfig@8.3.6)(typescript@5.3.3) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 - resolve-from: 5.0.0 transitivePeerDependencies: - '@types/node' - typescript dev: true - /@commitlint/message@18.6.1: - resolution: {integrity: sha512-VKC10UTMLcpVjMIaHHsY1KwhuTQtdIKPkIdVEwWV+YuzKkzhlI3aNy6oo1eAN6b/D2LTtZkJe2enHmX0corYRw==} + /@commitlint/message@19.0.0: + resolution: {integrity: sha512-c9czf6lU+9oF9gVVa2lmKaOARJvt4soRsVmbR7Njwp9FpbBgste5i7l/2l5o8MmbwGh4yE1snfnsy2qyA2r/Fw==} engines: {node: '>=v18'} dev: true - /@commitlint/parse@18.6.1: - resolution: {integrity: sha512-eS/3GREtvVJqGZrwAGRwR9Gdno3YcZ6Xvuaa+vUF8j++wsmxrA2En3n0ccfVO2qVOLJC41ni7jSZhQiJpMPGOQ==} + /@commitlint/parse@19.0.0: + resolution: {integrity: sha512-/2hT08V/2Lh+aQ5cSAw5vO74FlA3LJGYzLfsNMcx6aW8Kmrsa9W7chNNY5hMWbucCF92s/JE3eVIHnzoEBKTTA==} engines: {node: '>=v18'} dependencies: - '@commitlint/types': 18.6.1 + '@commitlint/types': 19.0.0 conventional-changelog-angular: 7.0.0 conventional-commits-parser: 5.0.0 dev: true - /@commitlint/read@18.6.1: - resolution: {integrity: sha512-ia6ODaQFzXrVul07ffSgbZGFajpe8xhnDeLIprLeyfz3ivQU1dIoHp7yz0QIorZ6yuf4nlzg4ZUkluDrGN/J/w==} + /@commitlint/read@19.0.0: + resolution: {integrity: sha512-AbK/fQjWrXGAAHl+KeOtZtWJryhzkTnynhkABF4IUFZqK71JSviSIPHYuUQjdwNrD0PJGs5f19ORjY8LOXP08w==} engines: {node: '>=v18'} dependencies: - '@commitlint/top-level': 18.6.1 - '@commitlint/types': 18.6.1 - git-raw-commits: 2.0.11 + '@commitlint/top-level': 19.0.0 + '@commitlint/types': 19.0.0 + git-raw-commits: 4.0.0 minimist: 1.2.8 dev: true - /@commitlint/resolve-extends@18.6.1: - resolution: {integrity: sha512-ifRAQtHwK+Gj3Bxj/5chhc4L2LIc3s30lpsyW67yyjsETR6ctHAHRu1FSpt0KqahK5xESqoJ92v6XxoDRtjwEQ==} + /@commitlint/resolve-extends@19.0.1: + resolution: {integrity: sha512-U5BRCNEiib0I06e6utNzBXZRu/t/bzlqVljS5kaNwggPN1VS+Kvuks8fY97j85B8sifHXU5dhUICPRKP8Oj31A==} engines: {node: '>=v18'} dependencies: - '@commitlint/config-validator': 18.6.1 - '@commitlint/types': 18.6.1 - import-fresh: 3.3.0 + '@commitlint/config-validator': 19.0.0 + '@commitlint/types': 19.0.0 + global-directory: 4.0.1 + import-meta-resolve: 4.0.0 lodash.mergewith: 4.6.2 - resolve-from: 5.0.0 - resolve-global: 1.0.0 dev: true - /@commitlint/rules@18.6.1: - resolution: {integrity: sha512-kguM6HxZDtz60v/zQYOe0voAtTdGybWXefA1iidjWYmyUUspO1zBPQEmJZ05/plIAqCVyNUTAiRPWIBKLCrGew==} + /@commitlint/rules@19.0.0: + resolution: {integrity: sha512-uwb5Ro5vvJlEjnWPezL3AcdlbLdJz24SD5VembgA6IXqqunphZr5LFsQL1z5efP7p3MUdJEXFynIx8o62+j2lA==} engines: {node: '>=v18'} dependencies: - '@commitlint/ensure': 18.6.1 - '@commitlint/message': 18.6.1 - '@commitlint/to-lines': 18.6.1 - '@commitlint/types': 18.6.1 - execa: 5.1.1 + '@commitlint/ensure': 19.0.0 + '@commitlint/message': 19.0.0 + '@commitlint/to-lines': 19.0.0 + '@commitlint/types': 19.0.0 + execa: 8.0.1 dev: true - /@commitlint/to-lines@18.6.1: - resolution: {integrity: sha512-Gl+orGBxYSNphx1+83GYeNy5N0dQsHBQ9PJMriaLQDB51UQHCVLBT/HBdOx5VaYksivSf5Os55TLePbRLlW50Q==} + /@commitlint/to-lines@19.0.0: + resolution: {integrity: sha512-vkxWo+VQU5wFhiP9Ub9Sre0FYe019JxFikrALVoD5UGa8/t3yOJEpEhxC5xKiENKKhUkTpEItMTRAjHw2SCpZw==} engines: {node: '>=v18'} dev: true - /@commitlint/top-level@18.6.1: - resolution: {integrity: sha512-HyiHQZUTf0+r0goTCDs/bbVv/LiiQ7AVtz6KIar+8ZrseB9+YJAIo8HQ2IC2QT1y3N1lbW6OqVEsTHjbT6hGSw==} + /@commitlint/top-level@19.0.0: + resolution: {integrity: sha512-KKjShd6u1aMGNkCkaX4aG1jOGdn7f8ZI8TR1VEuNqUOjWTOdcDSsmglinglJ18JTjuBX5I1PtjrhQCRcixRVFQ==} engines: {node: '>=v18'} dependencies: - find-up: 5.0.0 + find-up: 7.0.0 dev: true - /@commitlint/types@18.6.1: - resolution: {integrity: sha512-gwRLBLra/Dozj2OywopeuHj2ac26gjGkz2cZ+86cTJOdtWfiRRr4+e77ZDAGc6MDWxaWheI+mAV5TLWWRwqrFg==} + /@commitlint/types@19.0.0: + resolution: {integrity: sha512-qLjLUdYXKi0TIavONrjBkxrElp7KguqDbvzIRbqTdJBV/cAAr8QEhHe1qUq8OcCM3gFWTlUrDz3ISZbkRoGsAg==} engines: {node: '>=v18'} dependencies: - chalk: 4.1.2 + chalk: 5.3.0 dev: true /@csstools/css-parser-algorithms@2.5.0(@csstools/css-tokenizer@2.2.3): @@ -831,8 +826,8 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: false - /@emotion/react@11.11.3(@types/react@18.2.59)(react@18.2.0): - resolution: {integrity: sha512-Cnn0kuq4DoONOMcnoVsTOR8E+AdnKFf//6kUWc4LCdnxj31pZWn7rIULd6Y7/Js1PiPHzn7SKCM9vB/jBni8eA==} + /@emotion/react@11.11.4(@types/react@18.2.60)(react@18.2.0): + resolution: {integrity: sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==} peerDependencies: '@types/react': '*' react: '>=16.8.0' @@ -840,14 +835,14 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.23.8 + '@babel/runtime': 7.23.9 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.3 '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 - '@types/react': 18.2.59 + '@types/react': 18.2.60 hoist-non-react-statics: 3.3.2 react: 18.2.0 dev: false @@ -866,7 +861,7 @@ packages: resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==} dev: false - /@emotion/styled@11.11.0(@emotion/react@11.11.3)(@types/react@18.2.59)(react@18.2.0): + /@emotion/styled@11.11.0(@emotion/react@11.11.4)(@types/react@18.2.60)(react@18.2.0): resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} peerDependencies: '@emotion/react': ^11.0.0-rc.0 @@ -879,11 +874,11 @@ packages: '@babel/runtime': 7.23.8 '@emotion/babel-plugin': 11.11.0 '@emotion/is-prop-valid': 1.2.1 - '@emotion/react': 11.11.3(@types/react@18.2.59)(react@18.2.0) + '@emotion/react': 11.11.4(@types/react@18.2.60)(react@18.2.0) '@emotion/serialize': 1.1.3 '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 - '@types/react': 18.2.59 + '@types/react': 18.2.60 react: 18.2.0 dev: false @@ -1250,7 +1245,7 @@ packages: resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} dev: false - /@mui/base@5.0.0-beta.37(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0): + /@mui/base@5.0.0-beta.37(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-/o3anbb+DeCng8jNsd3704XtmmLDZju1Fo8R2o7ugrVtPQ/QpcqddwKNzKPZwa0J5T8YNW3ZVuHyQgbTnQLisQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1263,10 +1258,10 @@ packages: dependencies: '@babel/runtime': 7.23.9 '@floating-ui/react-dom': 2.0.8(react-dom@18.2.0)(react@18.2.0) - '@mui/types': 7.2.13(@types/react@18.2.59) - '@mui/utils': 5.15.11(@types/react@18.2.59)(react@18.2.0) + '@mui/types': 7.2.13(@types/react@18.2.60) + '@mui/utils': 5.15.11(@types/react@18.2.60)(react@18.2.0) '@popperjs/core': 2.11.8 - '@types/react': 18.2.59 + '@types/react': 18.2.60 clsx: 2.1.0 prop-types: 15.8.1 react: 18.2.0 @@ -1277,7 +1272,7 @@ packages: resolution: {integrity: sha512-JVrJ9Jo4gyU707ujnRzmE8ABBWpXd6FwL9GYULmwZRtfPg89ggXs/S3MStQkpJ1JRWfdLL6S5syXmgQGq5EDAw==} dev: false - /@mui/icons-material@5.15.11(@mui/material@5.15.11)(@types/react@18.2.59)(react@18.2.0): + /@mui/icons-material@5.15.11(@mui/material@5.15.11)(@types/react@18.2.60)(react@18.2.0): resolution: {integrity: sha512-R5ZoQqnKpd+5Ew7mBygTFLxgYsQHPhgR3TDXSgIHYIjGzYuyPLmGLSdcPUoMdi6kxiYqHlpPj4NJxlbaFD0UHA==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1289,12 +1284,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.9 - '@mui/material': 5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.59 + '@mui/material': 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.60 react: 18.2.0 dev: false - /@mui/lab@5.0.0-alpha.166(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@mui/material@5.15.11)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0): + /@mui/lab@5.0.0-alpha.166(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@mui/material@5.15.11)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-a+0yorrgxLIgfKhShVKQk0/5CnB4KBhMQ64SvEB+CsvKAKKJzjIU43m2nMqdBbWzfnEuj6wR9vQ9kambdn3ZKA==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1313,21 +1308,21 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.9 - '@emotion/react': 11.11.3(@types/react@18.2.59)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.59)(react@18.2.0) - '@mui/base': 5.0.0-beta.37(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) - '@mui/material': 5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) - '@mui/system': 5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react@18.2.0) - '@mui/types': 7.2.13(@types/react@18.2.59) - '@mui/utils': 5.15.11(@types/react@18.2.59)(react@18.2.0) - '@types/react': 18.2.59 + '@emotion/react': 11.11.4(@types/react@18.2.60)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.60)(react@18.2.0) + '@mui/base': 5.0.0-beta.37(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) + '@mui/material': 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) + '@mui/system': 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react@18.2.0) + '@mui/types': 7.2.13(@types/react@18.2.60) + '@mui/utils': 5.15.11(@types/react@18.2.60)(react@18.2.0) + '@types/react': 18.2.60 clsx: 2.1.0 prop-types: 15.8.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@mui/material@5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0): + /@mui/material@5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-FA3eEuEZaDaxgN3CgfXezMWbCZ4VCeU/sv0F0/PK5n42qIgsPVD6q+j71qS7/62sp6wRFMHtDMpXRlN+tT/7NA==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1345,14 +1340,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.9 - '@emotion/react': 11.11.3(@types/react@18.2.59)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.59)(react@18.2.0) - '@mui/base': 5.0.0-beta.37(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) + '@emotion/react': 11.11.4(@types/react@18.2.60)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.60)(react@18.2.0) + '@mui/base': 5.0.0-beta.37(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) '@mui/core-downloads-tracker': 5.15.11 - '@mui/system': 5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react@18.2.0) - '@mui/types': 7.2.13(@types/react@18.2.59) - '@mui/utils': 5.15.11(@types/react@18.2.59)(react@18.2.0) - '@types/react': 18.2.59 + '@mui/system': 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react@18.2.0) + '@mui/types': 7.2.13(@types/react@18.2.60) + '@mui/utils': 5.15.11(@types/react@18.2.60)(react@18.2.0) + '@types/react': 18.2.60 '@types/react-transition-group': 4.4.10 clsx: 2.1.0 csstype: 3.1.3 @@ -1363,7 +1358,7 @@ packages: react-transition-group: 4.4.5(react-dom@18.2.0)(react@18.2.0) dev: false - /@mui/private-theming@5.15.11(@types/react@18.2.59)(react@18.2.0): + /@mui/private-theming@5.15.11(@types/react@18.2.60)(react@18.2.0): resolution: {integrity: sha512-jY/696SnSxSzO1u86Thym7ky5T9CgfidU3NFJjguldqK4f3Z5S97amZ6nffg8gTD0HBjY9scB+4ekqDEUmxZOA==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1374,13 +1369,13 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.9 - '@mui/utils': 5.15.11(@types/react@18.2.59)(react@18.2.0) - '@types/react': 18.2.59 + '@mui/utils': 5.15.11(@types/react@18.2.60)(react@18.2.0) + '@types/react': 18.2.60 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/styled-engine@5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0): + /@mui/styled-engine@5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(react@18.2.0): resolution: {integrity: sha512-So21AhAngqo07ces4S/JpX5UaMU2RHXpEA6hNzI6IQjd/1usMPxpgK8wkGgTe3JKmC2KDmH8cvoycq5H3Ii7/w==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1395,14 +1390,14 @@ packages: dependencies: '@babel/runtime': 7.23.9 '@emotion/cache': 11.11.0 - '@emotion/react': 11.11.3(@types/react@18.2.59)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.59)(react@18.2.0) + '@emotion/react': 11.11.4(@types/react@18.2.60)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.60)(react@18.2.0) csstype: 3.1.3 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/system@5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react@18.2.0): + /@mui/system@5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react@18.2.0): resolution: {integrity: sha512-9j35suLFq+MgJo5ktVSHPbkjDLRMBCV17NMBdEQurh6oWyGnLM4uhU4QGZZQ75o0vuhjJghOCA1jkO3+79wKsA==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1419,20 +1414,20 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.9 - '@emotion/react': 11.11.3(@types/react@18.2.59)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.59)(react@18.2.0) - '@mui/private-theming': 5.15.11(@types/react@18.2.59)(react@18.2.0) - '@mui/styled-engine': 5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0) - '@mui/types': 7.2.13(@types/react@18.2.59) - '@mui/utils': 5.15.11(@types/react@18.2.59)(react@18.2.0) - '@types/react': 18.2.59 + '@emotion/react': 11.11.4(@types/react@18.2.60)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.60)(react@18.2.0) + '@mui/private-theming': 5.15.11(@types/react@18.2.60)(react@18.2.0) + '@mui/styled-engine': 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(react@18.2.0) + '@mui/types': 7.2.13(@types/react@18.2.60) + '@mui/utils': 5.15.11(@types/react@18.2.60)(react@18.2.0) + '@types/react': 18.2.60 clsx: 2.1.0 csstype: 3.1.3 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/types@7.2.13(@types/react@18.2.59): + /@mui/types@7.2.13(@types/react@18.2.60): resolution: {integrity: sha512-qP9OgacN62s+l8rdDhSFRe05HWtLLJ5TGclC9I1+tQngbssu0m2dmFZs+Px53AcOs9fD7TbYd4gc9AXzVqO/+g==} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -1440,10 +1435,10 @@ packages: '@types/react': optional: true dependencies: - '@types/react': 18.2.59 + '@types/react': 18.2.60 dev: false - /@mui/utils@5.15.11(@types/react@18.2.59)(react@18.2.0): + /@mui/utils@5.15.11(@types/react@18.2.60)(react@18.2.0): resolution: {integrity: sha512-D6bwqprUa9Stf8ft0dcMqWyWDKEo7D+6pB1k8WajbqlYIRA8J8Kw9Ra7PSZKKePGBGWO+/xxrX1U8HpG/aXQCw==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1455,13 +1450,13 @@ packages: dependencies: '@babel/runtime': 7.23.9 '@types/prop-types': 15.7.11 - '@types/react': 18.2.59 + '@types/react': 18.2.60 prop-types: 15.8.1 react: 18.2.0 react-is: 18.2.0 dev: false - /@mui/utils@5.15.9(@types/react@18.2.59)(react@18.2.0): + /@mui/utils@5.15.9(@types/react@18.2.60)(react@18.2.0): resolution: {integrity: sha512-yDYfr61bCYUz1QtwvpqYy/3687Z8/nS4zv7lv/ih/6ZFGMl1iolEvxRmR84v2lOYxlds+kq1IVYbXxDKh8Z9sg==} engines: {node: '>=12.0.0'} peerDependencies: @@ -1473,13 +1468,13 @@ packages: dependencies: '@babel/runtime': 7.23.9 '@types/prop-types': 15.7.11 - '@types/react': 18.2.59 + '@types/react': 18.2.60 prop-types: 15.8.1 react: 18.2.0 react-is: 18.2.0 dev: false - /@mui/x-data-grid@6.19.5(@mui/material@5.15.11)(@mui/system@5.15.11)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0): + /@mui/x-data-grid@6.19.5(@mui/material@5.15.11)(@mui/system@5.15.11)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-jV1ZqwyFslKqFScSn4t+xc/tNxLHOeJjz3HoeK+Wdf5t3bPM69pg/jLeg8TmOkAUY62JmQKCLVmcGWiR3AqUKQ==} engines: {node: '>=14.0.0'} peerDependencies: @@ -1489,9 +1484,9 @@ packages: react-dom: ^17.0.0 || ^18.0.0 dependencies: '@babel/runtime': 7.23.9 - '@mui/material': 5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) - '@mui/system': 5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react@18.2.0) - '@mui/utils': 5.15.9(@types/react@18.2.59)(react@18.2.0) + '@mui/material': 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) + '@mui/system': 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react@18.2.0) + '@mui/utils': 5.15.9(@types/react@18.2.60)(react@18.2.0) clsx: 2.1.0 prop-types: 15.8.1 react: 18.2.0 @@ -2072,20 +2067,12 @@ packages: resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==} dev: true - /@types/minimist@1.2.5: - resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} - dev: true - /@types/node@18.19.0: resolution: {integrity: sha512-667KNhaD7U29mT5wf+TZUnrzPrlL2GNQ5N0BMjO2oNULhBxX0/FKCkm6JMu0Jh7Z+1LwUlR21ekd7KhIboNFNw==} dependencies: undici-types: 5.26.5 dev: true - /@types/normalize-package-data@2.4.4: - resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} - dev: true - /@types/parse-json@4.0.0: resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==} dev: false @@ -2096,16 +2083,16 @@ packages: /@types/react-dom@18.2.19: resolution: {integrity: sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA==} dependencies: - '@types/react': 18.2.59 + '@types/react': 18.2.60 dev: true /@types/react-transition-group@4.4.10: resolution: {integrity: sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==} dependencies: - '@types/react': 18.2.59 + '@types/react': 18.2.60 - /@types/react@18.2.59: - resolution: {integrity: sha512-DE+F6BYEC8VtajY85Qr7mmhTd/79rJKIHCg99MU9SWPB4xvLb6D1za2vYflgZfmPqQVEr6UqJTnLXEwzpVPuOg==} + /@types/react@18.2.60: + resolution: {integrity: sha512-dfiPj9+k20jJrLGOu9Nf6eqxm2EyJRrq2NvwOFsfbb7sFExZ9WELPs67UImHj3Ayxg8ruTtKtNnbjaF8olPq0A==} dependencies: '@types/prop-types': 15.7.11 '@types/scheduler': 0.16.2 @@ -2476,11 +2463,6 @@ packages: is-shared-array-buffer: 1.0.2 dev: true - /arrify@1.0.1: - resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} - engines: {node: '>=0.10.0'} - dev: true - /astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} @@ -2641,20 +2623,6 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - /camelcase-keys@6.2.2: - resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} - engines: {node: '>=8'} - dependencies: - camelcase: 5.3.1 - map-obj: 4.3.0 - quick-lru: 4.0.1 - dev: true - - /camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - dev: true - /camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} @@ -2923,9 +2891,9 @@ packages: /csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - /dargs@7.0.0: - resolution: {integrity: sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg==} - engines: {node: '>=8'} + /dargs@8.1.0: + resolution: {integrity: sha512-wAV9QHOsNbwnWdNW2FYvE1P56wtgSbM+3SZcdGiWQILwVjACCXDCI3Ai8QlCjMDB8YK5zySiXZYBiwGmNY3lnw==} + engines: {node: '>=12'} dev: true /data-uri-to-buffer@4.0.0: @@ -2960,19 +2928,6 @@ packages: ms: 2.1.2 dev: true - /decamelize-keys@1.1.1: - resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} - engines: {node: '>=0.10.0'} - dependencies: - decamelize: 1.2.0 - map-obj: 1.0.1 - dev: true - - /decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - dev: true - /dedent@1.5.1: resolution: {integrity: sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==} peerDependencies: @@ -3704,14 +3659,6 @@ packages: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} dev: false - /find-up@4.1.0: - resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} - engines: {node: '>=8'} - dependencies: - locate-path: 5.0.0 - path-exists: 4.0.0 - dev: true - /find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} @@ -3720,6 +3667,15 @@ packages: path-exists: 4.0.0 dev: true + /find-up@7.0.0: + resolution: {integrity: sha512-YyZM99iHrqLKjmt4LJDj58KI+fYyufRLBSYcqycxf//KpBk9FoewoGX0450m9nB44qrZnovzC2oeP5hUibxc/g==} + engines: {node: '>=18'} + dependencies: + locate-path: 7.2.0 + path-exists: 5.0.0 + unicorn-magic: 0.1.0 + dev: true + /flat-cache@3.2.0: resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} engines: {node: ^10.12.0 || >=12.0.0} @@ -3890,16 +3846,14 @@ packages: resolve-pkg-maps: 1.0.0 dev: true - /git-raw-commits@2.0.11: - resolution: {integrity: sha512-VnctFhw+xfj8Va1xtfEqCUD2XDrbAPSJx+hSrE5K7fGdjZruW7XV+QOrN7LF/RJyvspRiD2I0asWsxFp0ya26A==} - engines: {node: '>=10'} + /git-raw-commits@4.0.0: + resolution: {integrity: sha512-ICsMM1Wk8xSGMowkOmPrzo2Fgmfo4bMHLNX6ytHjajRJUqvHOw/TFapQ+QG75c3X/tTDDhOSRPGC52dDbNM8FQ==} + engines: {node: '>=16'} hasBin: true dependencies: - dargs: 7.0.0 - lodash: 4.17.21 - meow: 8.1.2 - split2: 3.2.2 - through2: 4.0.2 + dargs: 8.1.0 + meow: 12.1.1 + split2: 4.2.0 dev: true /glob-parent@5.1.2: @@ -3939,11 +3893,11 @@ packages: path-is-absolute: 1.0.1 dev: true - /global-dirs@0.1.1: - resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} - engines: {node: '>=4'} + /global-directory@4.0.1: + resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} + engines: {node: '>=18'} dependencies: - ini: 1.3.8 + ini: 4.1.1 dev: true /global-modules@2.0.0: @@ -4015,11 +3969,6 @@ packages: resolution: {integrity: sha512-t2JXKaehnMb9paaYA7J0BX8QQAY8lwfQ9Gjf4pg/mk4krt+cmwmU652HOoWonf+7+EQV97ARPMhhVgU1ra2GhA==} dev: false - /hard-rejection@2.1.0: - resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} - engines: {node: '>=6'} - dev: true - /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: true @@ -4068,17 +4017,6 @@ packages: react-is: 16.13.1 dev: false - /hosted-git-info@2.8.9: - resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - dev: true - - /hosted-git-info@4.1.0: - resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} - engines: {node: '>=10'} - dependencies: - lru-cache: 6.0.0 - dev: true - /html-parse-stringify@3.0.1: resolution: {integrity: sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==} dependencies: @@ -4161,16 +4099,15 @@ packages: parent-module: 1.0.1 resolve-from: 4.0.0 + /import-meta-resolve@4.0.0: + resolution: {integrity: sha512-okYUR7ZQPH+efeuMJGlq4f8ubUgO50kByRPyt/Cy1Io4PSRsPjxME+YlVaCOx+NIToW7hCsZNFJyTPFFKepRSA==} + dev: true + /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} dev: true - /indent-string@4.0.0: - resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} - engines: {node: '>=8'} - dev: true - /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} dependencies: @@ -4186,6 +4123,11 @@ packages: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} dev: true + /ini@4.1.1: + resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dev: true + /internal-slot@1.0.6: resolution: {integrity: sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg==} engines: {node: '>= 0.4'} @@ -4355,11 +4297,6 @@ packages: engines: {node: '>=8'} dev: true - /is-plain-obj@1.1.0: - resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} - engines: {node: '>=0.10.0'} - dev: true - /is-plain-object@5.0.0: resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==} engines: {node: '>=0.10.0'} @@ -4623,13 +4560,6 @@ packages: wrap-ansi: 9.0.0 dev: true - /locate-path@5.0.0: - resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} - engines: {node: '>=8'} - dependencies: - p-locate: 4.1.0 - dev: true - /locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} @@ -4637,6 +4567,13 @@ packages: p-locate: 5.0.0 dev: true + /locate-path@7.2.0: + resolution: {integrity: sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + p-locate: 6.0.0 + dev: true + /lodash-es@4.17.21: resolution: {integrity: sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==} dev: false @@ -4645,10 +4582,6 @@ packages: resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==} dev: true - /lodash.isfunction@3.0.9: - resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} - dev: true - /lodash.isplainobject@4.0.6: resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==} dev: true @@ -4687,6 +4620,7 @@ packages: /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: false /log-update@6.0.0: resolution: {integrity: sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==} @@ -4729,16 +4663,6 @@ packages: yallist: 4.0.0 dev: true - /map-obj@1.0.1: - resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} - engines: {node: '>=0.10.0'} - dev: true - - /map-obj@4.3.0: - resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} - engines: {node: '>=8'} - dev: true - /mathml-tag-names@2.1.3: resolution: {integrity: sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==} dev: true @@ -4762,23 +4686,6 @@ packages: engines: {node: '>=18'} dev: true - /meow@8.1.2: - resolution: {integrity: sha512-r85E3NdZ+mpYk1C6RjPFEMSE+s1iZMuHtsHAqY0DT3jZczl0diWUZ8g6oU7h0M9cD2EL+PzaYghhCLzR0ZNn5Q==} - engines: {node: '>=10'} - dependencies: - '@types/minimist': 1.2.5 - camelcase-keys: 6.2.2 - decamelize-keys: 1.1.1 - hard-rejection: 2.1.0 - minimist-options: 4.1.0 - normalize-package-data: 3.0.3 - read-pkg-up: 7.0.1 - redent: 3.0.0 - trim-newlines: 3.0.1 - type-fest: 0.18.1 - yargs-parser: 20.2.9 - dev: true - /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} dev: true @@ -4818,11 +4725,6 @@ packages: engines: {node: '>=12'} dev: true - /min-indent@1.0.1: - resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} - engines: {node: '>=4'} - dev: true - /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: @@ -4836,15 +4738,6 @@ packages: brace-expansion: 2.0.1 dev: true - /minimist-options@4.1.0: - resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} - engines: {node: '>= 6'} - dependencies: - arrify: 1.0.1 - is-plain-obj: 1.1.0 - kind-of: 6.0.3 - dev: true - /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: true @@ -4866,7 +4759,7 @@ packages: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true - /mui-color-input@2.0.3(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@mui/material@5.15.11)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0): + /mui-color-input@2.0.3(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@mui/material@5.15.11)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-rAd040qQ0Y+8dk4gE8kkCiJ/vCgA0j4vv1quJ43BfORTFE3uHarHj0xY1Vo9CPbojtx1f5vW+CjckYPRIZPIRg==} peerDependencies: '@emotion/react': ^11.5.0 @@ -4880,10 +4773,10 @@ packages: optional: true dependencies: '@ctrl/tinycolor': 4.0.3 - '@emotion/react': 11.11.3(@types/react@18.2.59)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.59)(react@18.2.0) - '@mui/material': 5.15.11(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.59)(react-dom@18.2.0)(react@18.2.0) - '@types/react': 18.2.59 + '@emotion/react': 11.11.4(@types/react@18.2.60)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.60)(react@18.2.0) + '@mui/material': 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.60)(react-dom@18.2.0)(react@18.2.0) + '@types/react': 18.2.60 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false @@ -4935,25 +4828,6 @@ packages: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} dev: true - /normalize-package-data@2.5.0: - resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} - dependencies: - hosted-git-info: 2.8.9 - resolve: 1.22.8 - semver: 5.7.2 - validate-npm-package-license: 3.0.4 - dev: true - - /normalize-package-data@3.0.3: - resolution: {integrity: sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==} - engines: {node: '>=10'} - dependencies: - hosted-git-info: 4.1.0 - is-core-module: 2.13.1 - semver: 7.6.0 - validate-npm-package-license: 3.0.4 - dev: true - /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -5105,13 +4979,6 @@ packages: type-check: 0.4.0 dev: true - /p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - dependencies: - p-try: 2.2.0 - dev: true - /p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} @@ -5119,11 +4986,11 @@ packages: yocto-queue: 0.1.0 dev: true - /p-locate@4.1.0: - resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} - engines: {node: '>=8'} + /p-limit@4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: - p-limit: 2.3.0 + yocto-queue: 1.0.0 dev: true /p-locate@5.0.0: @@ -5133,16 +5000,18 @@ packages: p-limit: 3.1.0 dev: true + /p-locate@6.0.0: + resolution: {integrity: sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + p-limit: 4.0.0 + dev: true + /p-timeout@4.1.0: resolution: {integrity: sha512-+/wmHtzJuWii1sXn3HCuH/FTwGhrp4tmJTxSKJbfS+vkipci6osxXM5mY0jUiRzWKMTgUT8l7HFbeSwZAynqHw==} engines: {node: '>=10'} dev: true - /p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - dev: true - /parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -5163,6 +5032,11 @@ packages: engines: {node: '>=8'} dev: true + /path-exists@5.0.0: + resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} @@ -5347,11 +5221,6 @@ packages: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true - /quick-lru@4.0.1: - resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} - engines: {node: '>=8'} - dev: true - /react-dom@18.2.0(react@18.2.0): resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} peerDependencies: @@ -5481,34 +5350,6 @@ packages: npm-normalize-package-bin: 3.0.1 dev: true - /read-pkg-up@7.0.1: - resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} - engines: {node: '>=8'} - dependencies: - find-up: 4.1.0 - read-pkg: 5.2.0 - type-fest: 0.8.1 - dev: true - - /read-pkg@5.2.0: - resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} - engines: {node: '>=8'} - dependencies: - '@types/normalize-package-data': 2.4.4 - normalize-package-data: 2.5.0 - parse-json: 5.2.0 - type-fest: 0.6.0 - dev: true - - /readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - dev: true - /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -5533,14 +5374,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /redent@3.0.0: - resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} - engines: {node: '>=8'} - dependencies: - indent-string: 4.0.0 - strip-indent: 3.0.0 - dev: true - /reflect.getprototypeof@1.0.4: resolution: {integrity: sha512-ECkTw8TmJwW60lOTR+ZkODISW6RQ8+2CL3COqtiJKLd6MmB45hN51HprHFziKLGkAuTGQhBb91V8cy+KHlaCjw==} engines: {node: '>= 0.4'} @@ -5593,13 +5426,6 @@ packages: engines: {node: '>=8'} dev: true - /resolve-global@1.0.0: - resolution: {integrity: sha512-zFa12V4OLtT5XUX/Q4VLvTfBf+Ok0SPc1FNGM/z9ctUdiU618qwKpWnd0CHs3+RqROfyEg/DhuHbMWYqcgljEw==} - engines: {node: '>=8'} - dependencies: - global-dirs: 0.1.1 - dev: true - /resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} dev: true @@ -5701,10 +5527,6 @@ packages: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} dev: false - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: true - /safe-compare@1.1.4: resolution: {integrity: sha512-b9wZ986HHCo/HbKrRpBJb2kqXMK9CEWIE1egeEvZsYn69ay3kdfl9nG3RyOcR+jInTDf7a86WQ1d4VJX7goSSQ==} dependencies: @@ -5745,11 +5567,6 @@ packages: engines: {node: '>=0.10.0'} dev: false - /semver@5.7.2: - resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} - hasBin: true - dev: true - /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true @@ -5884,34 +5701,6 @@ packages: engines: {node: '>=0.10.0'} dev: false - /spdx-correct@3.2.0: - resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} - dependencies: - spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.16 - dev: true - - /spdx-exceptions@2.3.0: - resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} - dev: true - - /spdx-expression-parse@3.0.1: - resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - dependencies: - spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.16 - dev: true - - /spdx-license-ids@3.0.16: - resolution: {integrity: sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==} - dev: true - - /split2@3.2.2: - resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} - dependencies: - readable-stream: 3.6.2 - dev: true - /split2@4.2.0: resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} engines: {node: '>= 10.x'} @@ -5988,12 +5777,6 @@ packages: es-abstract: 1.22.3 dev: true - /string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - dependencies: - safe-buffer: 5.2.1 - dev: true - /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} @@ -6023,13 +5806,6 @@ packages: engines: {node: '>=12'} dev: true - /strip-indent@3.0.0: - resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} - engines: {node: '>=8'} - dependencies: - min-indent: 1.0.1 - dev: true - /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -6248,12 +6024,6 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /through2@4.0.2: - resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} - dependencies: - readable-stream: 3.6.2 - dev: true - /through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} dev: true @@ -6278,11 +6048,6 @@ packages: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true - /trim-newlines@3.0.1: - resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} - engines: {node: '>=8'} - dev: true - /ts-api-utils@1.0.3(typescript@5.3.3): resolution: {integrity: sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg==} engines: {node: '>=16.13.0'} @@ -6327,26 +6092,11 @@ packages: prelude-ls: 1.2.1 dev: true - /type-fest@0.18.1: - resolution: {integrity: sha512-OIAYXk8+ISY+qTOwkHtKqzAuxchoMiD9Udx+FSGQDuiRR+PJKJHc2NJAXlbhkGwTt/4/nKZxELY1w3ReWOL8mw==} - engines: {node: '>=10'} - dev: true - /type-fest@0.20.2: resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} engines: {node: '>=10'} dev: true - /type-fest@0.6.0: - resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} - engines: {node: '>=8'} - dev: true - - /type-fest@0.8.1: - resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} - engines: {node: '>=8'} - dev: true - /type-fest@3.13.1: resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} engines: {node: '>=14.16'} @@ -6416,6 +6166,11 @@ packages: '@fastify/busboy': 2.1.0 dev: true + /unicorn-magic@0.1.0: + resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} + engines: {node: '>=18'} + dev: true + /universal-user-agent@6.0.0: resolution: {integrity: sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==} dev: true @@ -6459,13 +6214,6 @@ packages: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true - /validate-npm-package-license@3.0.4: - resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} - dependencies: - spdx-correct: 3.2.0 - spdx-expression-parse: 3.0.1 - dev: true - /vite-plugin-monaco-editor-new@1.1.3(monaco-editor@0.46.0): resolution: {integrity: sha512-VprhuvcbxjMlhdJBlbSiXR9SR/TolRyTn9+2XKd5RnXdyv7e6R8UooLFmXtcBUgXZQ9hzGlJmOZ8m4/WrNss0w==} peerDependencies: @@ -6673,11 +6421,6 @@ packages: engines: {node: '>= 14'} dev: true - /yargs-parser@20.2.9: - resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==} - engines: {node: '>=10'} - dev: true - /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} @@ -6700,3 +6443,8 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true + + /yocto-queue@1.0.0: + resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + engines: {node: '>=12.20'} + dev: true diff --git a/src/components/common/mdy-switch.scss b/src/components/common/mdy-switch.scss new file mode 100644 index 0000000000..db1a215f03 --- /dev/null +++ b/src/components/common/mdy-switch.scss @@ -0,0 +1,15 @@ +.MDYSwitch-container { + position: relative; + + .MDYSwitch-CircularProgress { + position: absolute; + top: 8px; + left: 8px; + z-index: 1; + + &.checked { + right: 8px; + left: unset; + } + } +} diff --git a/src/components/common/mdy-switch.tsx b/src/components/common/mdy-switch.tsx new file mode 100644 index 0000000000..28f94efe46 --- /dev/null +++ b/src/components/common/mdy-switch.tsx @@ -0,0 +1,89 @@ +import { styled } from "@mui/material/styles"; +import Switch, { SwitchProps } from "@mui/material/Switch"; +import CircularProgress from "@mui/material/CircularProgress"; +import "./mdy-switch.scss"; + +interface MDYSwitchProps extends SwitchProps { + loading?: boolean; +} + +const MDYSwitch = styled((props: MDYSwitchProps) => { + const { loading = false, checked, disabled, ...nativeProps } = props; + + return ( +
+ {loading && ( + + )} + +
+ ); +})(({ theme, checked, loading, disabled }) => ({ + height: "32px", + padding: 0, + margin: 0, + borderRadius: 24, + opacity: loading || disabled ? 0.5 : 1, + "& .MuiSwitch-track": { + borderRadius: 24, + opacity: checked + ? "1 !important" + : theme.palette.mode === "dark" + ? "0.3 !important" + : "0.7 !important", + backgroundColor: checked + ? theme.palette.primary.main + : theme.palette.mode === "dark" + ? theme.palette.grey.A700 + : theme.palette.grey.A200, + "&::before": { + content: '""', + border: `solid 2px ${theme.palette.grey.A700}`, + width: "100%", + height: "100%", + opacity: checked ? 0 : 1, + position: "absolute", + borderRadius: "inherit", + boxSizing: "border-box", + transitionProperty: "opacity, background-color", + transitionTimingFunction: "linear", + transitionDuration: "67ms", + }, + }, + "& .MuiSwitch-switchBase": { + padding: "6px", + }, + "& .MuiSwitch-thumb": { + boxShadow: "none", + width: loading ? 24 : 16, + height: loading ? 24 : 16, + margin: loading ? -2 : 3, + color: checked + ? theme.palette.getContrastText(theme.palette.primary.main) + : theme.palette.mode === "dark" + ? theme.palette.grey.A200 + : theme.palette.grey.A700, + opacity: checked ? 1 : 0.7, + }, + "& .Mui-checked": { + "&.MuiSwitch-switchBase": { + padding: "6px 9px 6px 12px", + }, + "& .MuiSwitch-thumb": { + width: 24, + height: 24, + margin: -2, + }, + }, +})); + +export default MDYSwitch; diff --git a/src/components/profile/profile-viewer.tsx b/src/components/profile/profile-viewer.tsx index d6fef050d2..7e3f60f2f5 100644 --- a/src/components/profile/profile-viewer.tsx +++ b/src/components/profile/profile-viewer.tsx @@ -8,7 +8,6 @@ import { InputLabel, MenuItem, Select, - Switch, TextField, styled, } from "@mui/material"; @@ -24,6 +23,7 @@ import { import { Controller, useForm } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { FileInput } from "./file-input"; +import MDYSwitch from "../common/mdy-switch"; interface Props { onChange: () => void; @@ -259,7 +259,7 @@ export const ProfileViewer = forwardRef( render={({ field }) => ( {t("Use System Proxy")} - + )} /> @@ -270,7 +270,7 @@ export const ProfileViewer = forwardRef( render={({ field }) => ( {t("Use Clash Proxy")} - + )} /> diff --git a/src/components/setting/mods/guard-state.tsx b/src/components/setting/mods/guard-state.tsx index 5ab8e99186..73d190a98d 100644 --- a/src/components/setting/mods/guard-state.tsx +++ b/src/components/setting/mods/guard-state.tsx @@ -4,11 +4,11 @@ import noop from "@/utils/noop"; interface Props { value?: Value; valueProps?: string; + loading?: boolean; onChangeProps?: string; waitTime?: number; - onChange?: (value: Value) => void; onFormat?: (...args: any[]) => Value; - onGuard?: (value: Value, oldValue: Value) => Promise; + onGuard?: (value: Value) => Promise; onCatch?: (error: Error) => void; children: ReactNode; } @@ -18,68 +18,30 @@ export function GuardState(props: Props) { value, children, valueProps = "value", + loading, onChangeProps = "onChange", - waitTime = 0, // debounce wait time default 0 onGuard = noop, onCatch = noop, - onChange = noop, onFormat = (v: T) => v, } = props; - const lockRef = useRef(false); - const saveRef = useRef(value); - const lastRef = useRef(0); - const timeRef = useRef(); - if (!isValidElement(children)) { return children as any; } - const childProps = { ...children.props }; + const childProps = { ...children.props, loading }; childProps[valueProps] = value; - childProps[onChangeProps] = async (...args: any[]) => { - // 多次操作无效 - if (lockRef.current) return; - - lockRef.current = true; + childProps[onChangeProps] = async (...args: any[]) => { try { const newValue = (onFormat as any)(...args); - // 先在ui上响应操作 - onChange(newValue); - - const now = Date.now(); - // save the old value - if (waitTime <= 0 || now - lastRef.current >= waitTime) { - saveRef.current = value; - } - - lastRef.current = now; - - if (waitTime <= 0) { - await onGuard(newValue, value!); - } else { - // debounce guard - clearTimeout(timeRef.current); - - timeRef.current = setTimeout(async () => { - try { - await onGuard(newValue, saveRef.current!); - } catch (err: any) { - // 状态回退 - onChange(saveRef.current!); - onCatch(err); - } - }, waitTime); - } + await onGuard(newValue); } catch (err: any) { - // 状态回退 - onChange(saveRef.current!); onCatch(err); } - lockRef.current = false; }; + return cloneElement(children, childProps); } diff --git a/src/components/setting/mods/layout-viewer.tsx b/src/components/setting/mods/layout-viewer.tsx index e7bc45e89a..7d522afc42 100644 --- a/src/components/setting/mods/layout-viewer.tsx +++ b/src/components/setting/mods/layout-viewer.tsx @@ -2,11 +2,12 @@ import { BaseDialog, DialogRef } from "@/components/base"; import { pageTransitionVariants } from "@/components/layout/page-transition"; import { NotificationType, useNotification } from "@/hooks/use-notification"; import { useVerge } from "@/hooks/use-verge"; -import { List, MenuItem, Select, Switch } from "@mui/material"; +import { List, MenuItem, Select } from "@mui/material"; import { forwardRef, useImperativeHandle, useState } from "react"; import { useTranslation } from "react-i18next"; import { GuardState } from "./guard-state"; import { SettingItem } from "./setting-comp"; +import MDYSwitch from "@/components/common/mdy-switch"; export const LayoutViewer = forwardRef((props, ref) => { const { t } = useTranslation(); @@ -14,6 +15,11 @@ export const LayoutViewer = forwardRef((props, ref) => { const [open, setOpen] = useState(false); + const [loading, setLoading] = useState({ + theme_blur: false, + traffic_graph: false, + }); + useImperativeHandle(ref, () => ({ open: () => setOpen(true), close: () => setOpen(false), @@ -48,10 +54,10 @@ export const LayoutViewer = forwardRef((props, ref) => { valueProps="checked" onCatch={onError} onFormat={onSwitchFormat} - onChange={(e) => onChangeData({ theme_blur: e })} onGuard={(e) => patchVerge({ theme_blur: e })} + loading={loading["theme_blur"]} > - + @@ -61,10 +67,10 @@ export const LayoutViewer = forwardRef((props, ref) => { valueProps="checked" onCatch={onError} onFormat={onSwitchFormat} - onChange={(e) => onChangeData({ traffic_graph: e })} onGuard={(e) => patchVerge({ traffic_graph: e })} + loading={loading["traffic_graph"]} > - + @@ -74,10 +80,9 @@ export const LayoutViewer = forwardRef((props, ref) => { valueProps="checked" onCatch={onError} onFormat={onSwitchFormat} - onChange={(e) => onChangeData({ enable_memory_usage: e })} onGuard={(e) => patchVerge({ enable_memory_usage: e })} > - + {/* TODO: 将 select 单独开一个 Modal 以符合 Material Design 的设计 */} diff --git a/src/components/setting/mods/misc-viewer.tsx b/src/components/setting/mods/misc-viewer.tsx index 5d1a3c679a..9a18d9c043 100644 --- a/src/components/setting/mods/misc-viewer.tsx +++ b/src/components/setting/mods/misc-viewer.tsx @@ -1,4 +1,5 @@ import { BaseDialog, DialogRef } from "@/components/base"; +import MDYSwitch from "@/components/common/mdy-switch"; import { NotificationType, useNotification } from "@/hooks/use-notification"; import { useVerge } from "@/hooks/use-verge"; import { @@ -7,7 +8,6 @@ import { ListItemText, MenuItem, Select, - Switch, TextField, } from "@mui/material"; import { useLockFn } from "ahooks"; @@ -98,7 +98,7 @@ export const MiscViewer = forwardRef((props, ref) => { - @@ -109,7 +109,7 @@ export const MiscViewer = forwardRef((props, ref) => { - @@ -120,7 +120,7 @@ export const MiscViewer = forwardRef((props, ref) => { - diff --git a/src/components/setting/mods/sysproxy-viewer.tsx b/src/components/setting/mods/sysproxy-viewer.tsx index fc22229644..fa5a092b7d 100644 --- a/src/components/setting/mods/sysproxy-viewer.tsx +++ b/src/components/setting/mods/sysproxy-viewer.tsx @@ -1,4 +1,5 @@ import { BaseDialog, DialogRef } from "@/components/base"; +import MDYSwitch from "@/components/common/mdy-switch"; import { NotificationType, useNotification } from "@/hooks/use-notification"; import { useVerge } from "@/hooks/use-verge"; import { getSystemProxy } from "@/services/cmds"; @@ -8,7 +9,6 @@ import { List, ListItem, ListItemText, - Switch, TextField, Typography, styled, @@ -101,7 +101,7 @@ export const SysproxyViewer = forwardRef((props, ref) => { - { const { enable_random_port = false, verge_mixed_port } = verge ?? {}; + const [loading, setLoading] = useState({ + ipv6: false, + "allow-lan": false, + "log-level": false, + }); + + const patchClashWithLoading = async (value: Partial) => { + try { + setLoading((prevLoading) => ({ + ...prevLoading, + ...Object.fromEntries(Object.keys(value).map((key) => [key, true])), + })); + + await patchClash(value); + } finally { + setLoading((prevLoading) => ({ + ...prevLoading, + ...Object.fromEntries(Object.keys(value).map((key) => [key, false])), + })); + } + }; + const webRef = useRef(null); const fieldRef = useRef(null); const portRef = useRef(null); @@ -47,9 +69,7 @@ const SettingClash = ({ onError }: Props) => { const coreRef = useRef(null); const onSwitchFormat = (_e: any, value: boolean) => value; - const onChangeData = (patch: Partial) => { - mutateClash((old) => ({ ...(old! || {}), ...patch }), false); - }; + const onChangeVerge = (patch: Partial) => { mutateVerge({ ...verge, ...patch }, false); }; @@ -68,10 +88,10 @@ const SettingClash = ({ onError }: Props) => { valueProps="checked" onCatch={onError} onFormat={onSwitchFormat} - onChange={(e) => onChangeData({ "allow-lan": e })} - onGuard={(e) => patchClash({ "allow-lan": e })} + onGuard={(e) => patchClashWithLoading({ "allow-lan": e })} + loading={loading["allow-lan"]} > - + @@ -81,10 +101,10 @@ const SettingClash = ({ onError }: Props) => { valueProps="checked" onCatch={onError} onFormat={onSwitchFormat} - onChange={(e) => onChangeData({ ipv6: e })} - onGuard={(e) => patchClash({ ipv6: e })} + onGuard={(e) => patchClashWithLoading({ ipv6: e })} + loading={loading["ipv6"]} > - + @@ -94,8 +114,8 @@ const SettingClash = ({ onError }: Props) => { value={logLevel === "warn" ? "warning" : logLevel ?? "info"} onCatch={onError} onFormat={(e: any) => e.target.value} - onChange={(e) => onChangeData({ "log-level": e })} - onGuard={(e) => patchClash({ "log-level": e })} + onGuard={(e) => patchClashWithLoading({ "log-level": e })} + loading={loading["log-level"]} > div": { py: "7.5px" } }}> 中文 @@ -106,8 +107,8 @@ const SettingVerge = ({ onError }: Props) => { onChangeData({ theme_mode: e })} onGuard={(e) => patchVerge({ theme_mode: e })} + loading={loading["theme_mode"]} > diff --git a/vite.config.ts b/vite.config.ts index e3e301b1ea..a6a87336fc 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,29 +5,33 @@ import monaco from "vite-plugin-monaco-editor"; import svgr from "vite-plugin-svgr"; // https://vitejs.dev/config/ -export default defineConfig({ - root: "src", - server: { port: 3000 }, - plugins: [ - svgr(), - react(), - monaco({ languageWorkers: ["editorWorkerService", "typescript"] }), - ], - esbuild: { - drop: ["console", "debugger"], - }, - build: { - outDir: "../dist", - emptyOutDir: true, - }, - resolve: { - alias: { - "@": path.resolve("./src"), - "@root": path.resolve("."), +export default defineConfig(({ command }) => { + const isDev = command === "serve"; + + return { + root: "src", + server: { port: 3000 }, + plugins: [ + svgr(), + react(), + monaco({ languageWorkers: ["editorWorkerService", "typescript"] }), + ], + esbuild: { + drop: isDev ? undefined : ["console", "debugger"], + }, + build: { + outDir: "../dist", + emptyOutDir: true, + }, + resolve: { + alias: { + "@": path.resolve("./src"), + "@root": path.resolve("."), + }, + }, + define: { + OS_PLATFORM: `"${process.platform}"`, + WIN_PORTABLE: !!process.env.VITE_WIN_PORTABLE, }, - }, - define: { - OS_PLATFORM: `"${process.platform}"`, - WIN_PORTABLE: !!process.env.VITE_WIN_PORTABLE, - }, + }; });