diff --git a/package.json b/package.json index da57ffe..7a6a886 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fluxy", "private": true, - "version": "0.1.15", + "version": "0.1.16", "type": "module", "scripts": { "install:all": "bun i && cd static && bun i", @@ -18,17 +18,17 @@ }, "dependencies": { "@tauri-apps/api": "^1.6.0", - "alley-components": "^0.3.6", + "alley-components": "^0.3.7", "solid-icons": "^1.1.0", - "solid-js": "^1.9.1" + "solid-js": "^1.9.3" }, "devDependencies": { - "@tauri-apps/cli": "^1.6.2", - "@types/node": "^22.7.4", + "@tauri-apps/cli": "^1.6.3", + "@types/node": "^22.9.0", "cross-env": "^7.0.3", - "sass": "^1.79.4", - "typescript": "^5.6.2", - "vite": "^5.4.8", + "sass": "^1.80.6", + "typescript": "^5.6.3", + "vite": "^5.4.10", "vite-plugin-solid": "^2.10.2" } } diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 263871f..5ac6eda 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -93,9 +93,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arboard" @@ -105,7 +105,7 @@ checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" dependencies = [ "clipboard-win", "core-graphics 0.23.2", - "image 0.25.2", + "image 0.25.5", "log", "objc2", "objc2-app-kit", @@ -124,7 +124,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -271,9 +271,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d" [[package]] name = "byteorder" @@ -289,9 +289,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] @@ -332,9 +332,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.22" +version = "1.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0" +checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" dependencies = [ "shlex", ] @@ -634,7 +634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -644,7 +644,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -677,7 +677,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -688,7 +688,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -709,7 +709,7 @@ checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -722,7 +722,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -784,6 +784,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "dlib" version = "0.5.2" @@ -828,9 +839,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embed-resource" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e24052d7be71f0efb50c201557f6fe7d237cfd5a64fd5bcd7fd8fe32dbbffa" +checksum = "b68b6f9f63a0b6a38bc447d4ce84e2b388f3ec95c99c641c8ff0dd3ef89a6379" dependencies = [ "cc", "memchr", @@ -848,9 +859,9 @@ checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -872,7 +883,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -899,15 +910,15 @@ checksum = "a5d9305ccc6942a704f4335694ecd3de2ea531b114ac2d51f5f843750787a92f" [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "fdeflate" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" +checksum = "07c6f4c64c1d33a3111c4466f7365ebdcc37c5bd1ea0d62aae2e3d722aacbedb" dependencies = [ "simd-adler32", ] @@ -973,6 +984,7 @@ dependencies = [ "salvo", "serde", "serde_json", + "sys-locale", "tauri", "tauri-build", "thiserror", @@ -1017,7 +1029,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -1053,9 +1065,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1068,9 +1080,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1078,15 +1090,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1095,38 +1107,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1304,9 +1316,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gio" @@ -1398,8 +1410,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -1480,7 +1492,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1499,7 +1511,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.5.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1514,9 +1526,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" [[package]] name = "headers" @@ -1584,15 +1596,6 @@ dependencies = [ "digest", ] -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "html-escape" version = "0.2.13" @@ -1680,9 +1683,9 @@ checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -1692,9 +1695,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -1716,9 +1719,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -1743,7 +1746,7 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "log", "rustls", @@ -1761,7 +1764,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.30", + "hyper 0.14.31", "native-tls", "tokio", "tokio-native-tls", @@ -1775,7 +1778,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "native-tls", "tokio", @@ -1785,16 +1788,16 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2", "tokio", @@ -1835,6 +1838,124 @@ dependencies = [ "png", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1843,12 +1964,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1861,7 +1993,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.7", + "regex-automata 0.4.8", "same-file", "walkdir", "winapi-util", @@ -1882,9 +2014,9 @@ dependencies = [ [[package]] name = "image" -version = "0.25.2" +version = "0.25.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" +checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b" dependencies = [ "bytemuck", "byteorder-lite", @@ -1906,12 +2038,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", + "hashbrown 0.15.1", "serde", ] @@ -1944,9 +2076,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "itoa" @@ -2011,9 +2143,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2077,9 +2209,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.159" +version = "0.2.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" [[package]] name = "libloading" @@ -2108,6 +2240,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "local-ip-address" version = "0.6.3" @@ -2607,18 +2745,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -2638,9 +2776,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -2659,7 +2797,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2670,9 +2808,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -2758,9 +2896,9 @@ checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" [[package]] name = "pathdiff" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +checksum = "d61c5ce1153ab5b689d0c074c4e7fc613e942dfb7dd9eea5ab202d2ad91fe361" [[package]] name = "pem" @@ -2785,7 +2923,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.5.0", + "indexmap 2.6.0", ] [[package]] @@ -2892,7 +3030,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -2924,29 +3062,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2967,7 +3105,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ "base64 0.22.1", - "indexmap 2.5.0", + "indexmap 2.6.0", "quick-xml 0.32.0", "serde", "time", @@ -3070,9 +3208,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -3210,9 +3348,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "redox_syscall" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -3230,14 +3368,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -3251,13 +3389,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -3268,9 +3406,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" @@ -3286,7 +3424,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -3316,9 +3454,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", @@ -3329,7 +3467,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls", "hyper-tls 0.6.0", "hyper-util", @@ -3341,7 +3479,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "serde", "serde_json", "serde_urlencoded", @@ -3418,7 +3556,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.79", + "syn 2.0.87", "walkdir", ] @@ -3449,9 +3587,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" dependencies = [ "bitflags 2.6.0", "errno", @@ -3462,9 +3600,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" dependencies = [ "log", "once_cell", @@ -3482,7 +3620,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -3499,19 +3637,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -3526,9 +3663,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -3538,9 +3675,9 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "salvo" -version = "0.72.4" +version = "0.74.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46940b4451d4c4c39a8998ec41671801feb8d75e142c7794cd4826c989f5408" +checksum = "552b76da24853093da265b89150188e8049ccf31550a0294e10df9f7221ec965" dependencies = [ "salvo-jwt-auth", "salvo-proxy", @@ -3550,9 +3687,9 @@ dependencies = [ [[package]] name = "salvo-jwt-auth" -version = "0.72.4" +version = "0.74.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d939878fd6fad9fe3dbc8784d557d2c36c7520330f28322d023f1ffa2395f9f" +checksum = "3d676e397c58e84e6e911c797a4582987042e9776cb38bb3eb8dd7422fc951fd" dependencies = [ "base64 0.22.1", "bytes", @@ -3570,17 +3707,17 @@ dependencies = [ [[package]] name = "salvo-proxy" -version = "0.72.4" +version = "0.74.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda48e01333576e78ca09974cecc507f2ae68c52eebc58debb5a745813216598" +checksum = "f1359d1fde15ace7a41eb3f28a72447f69ec7e6d30cccf8bf05c1deb17925b92" dependencies = [ "fastrand", "futures-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls", "hyper-util", "percent-encoding", - "reqwest 0.12.7", + "reqwest 0.12.9", "salvo_core", "tokio", "tracing", @@ -3588,20 +3725,20 @@ dependencies = [ [[package]] name = "salvo-serde-util" -version = "0.72.4" +version = "0.74.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06ddf5a36d50190f982482af90259a5fe29ec041ad0e61df31410090f2e92ba" +checksum = "3f20345cf0ce993ce5e2b96e9e4783ef4c08cd106dd59c6da6ac6af65a9b59ed" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "salvo-serve-static" -version = "0.72.4" +version = "0.74.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d98c36c37b495d9076b6cf27b87552c44f24fa39c8d38a133dcf9faedb5dcfd" +checksum = "89257488a65b1bc0f610e70260484daa1ec710ebb6c0a4fbc045a56c9bc686d8" dependencies = [ "hex", "mime", @@ -3619,9 +3756,9 @@ dependencies = [ [[package]] name = "salvo_core" -version = "0.72.4" +version = "0.74.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f6962a39666781301f8ff2fb9a3873dc5f5d11348672cf3334b7393276a1e" +checksum = "e37fdc3a8f7d4f4b63649b1b3cd833b61160e1c430912dcb9c0fed2b51d5766f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3634,10 +3771,10 @@ dependencies = [ "headers", "http 1.1.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls", "hyper-util", - "indexmap 2.5.0", + "indexmap 2.6.0", "mime", "mime-infer", "multer", @@ -3663,16 +3800,16 @@ dependencies = [ [[package]] name = "salvo_macros" -version = "0.72.4" +version = "0.74.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84549ee77bca8a611329ffcf0d849d2474ad484aa60171a0757fcb07169b978e" +checksum = "0d1e370bd2cd0ad52be3518350c43f2b94fccbb136519a9547269df1c9a5329d" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", "quote", "regex", "salvo-serde-util", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3686,9 +3823,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -3720,9 +3857,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -3759,9 +3896,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] @@ -3780,22 +3917,22 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "itoa 1.0.11", "memchr", "ryu", @@ -3810,7 +3947,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3836,15 +3973,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -3854,14 +3991,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -3883,7 +4020,7 @@ checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4082,9 +4219,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -4106,6 +4243,26 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -4229,14 +4386,14 @@ checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] name = "tar" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" dependencies = [ "filetime", "libc", @@ -4251,9 +4408,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "570a20223602ad990a30a048f2fdb957ae3e38de3ca9582e04cc09d01e8ccfad" +checksum = "1bf327e247698d3f39af8aa99401c9708384290d1f5c544bf5d251d44c2fea22" dependencies = [ "anyhow", "base64 0.22.1", @@ -4452,9 +4609,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -4482,22 +4639,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4553,25 +4710,20 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.8.0" +name = "tinystr" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -4591,7 +4743,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4676,7 +4828,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -4689,7 +4841,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.5.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -4734,7 +4886,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", ] [[package]] @@ -4792,12 +4944,11 @@ dependencies = [ [[package]] name = "tree_magic_mini" -version = "3.1.5" +version = "3.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469a727cac55b41448315cc10427c069c618ac59bb6a4480283fcd811749bdc2" +checksum = "aac5e8971f245c3389a5a76e648bfc80803ae066a1243a75db0064d7c1129d63" dependencies = [ "fnv", - "home", "memchr", "nom", "once_cell", @@ -4818,18 +4969,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-ident" @@ -4837,15 +4979,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-segmentation" version = "1.12.0" @@ -4870,9 +5003,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", @@ -4886,17 +5019,29 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + [[package]] name = "utf8-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom 0.2.15", ] @@ -4984,9 +5129,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -4995,24 +5140,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -5022,9 +5167,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5032,28 +5177,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -5078,9 +5223,9 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.6" +version = "0.31.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3f45d1222915ef1fd2057220c1d9d9624b7654443ea35c3877f7a52bd0a5a2d" +checksum = "b66249d3fc69f76fd74c82cc319300faa554e9d865dab1f7cd66cc20db10b280" dependencies = [ "bitflags 2.6.0", "rustix", @@ -5137,9 +5282,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -5706,6 +5851,18 @@ dependencies = [ "wayland-protocols-wlr", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wry" version = "0.24.11" @@ -5795,9 +5952,33 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.22" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af310deaae937e48a26602b730250b4949e125f468f11e6990be3e5304ddd96f" + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", +] [[package]] name = "zerocopy" @@ -5817,7 +5998,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.87", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure", ] [[package]] @@ -5826,6 +6028,28 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "zip" version = "0.6.6" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 247bfa3..4ef095b 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -42,6 +42,7 @@ tracing-subscriber = { version = "0", features = [ tracing = { version = "0", features = ["log", "release_max_level_info"] } tracing-appender = '0' rust-embed = "8" +sys-locale = "0" [features] diff --git a/src-tauri/src/i18n/en_us.rs b/src-tauri/src/i18n/en_us.rs new file mode 100644 index 0000000..454377d --- /dev/null +++ b/src-tauri/src/i18n/en_us.rs @@ -0,0 +1,33 @@ +use super::Translations; + +pub(super) const EN_US: &Translations = &Translations { + window_title: "Fluxy", + dark_mode_tooltip: "Switch to Light Mode", + light_mode_tooltip: "Switch to Dark Mode", + about_button_tooltip: "About and Help", + about_dialog_github_tooltip: "Visit Official Website", + about_dialog_feedback_tooltip: "Provide Feedback or Get Help", + home_label_text: "Select Transfer Method", + home_button_text: "Back to Home", + home_receive_button_text: "Receive", + home_send_button_text: "Send", + qrcode_page_title: "Scan to Connect", + qrcode_page_url_label: "Or visit in another computer's browser", + qrcode_page_url_tooltip: "Copy Link to Clipboard", + qrcode_page_url_copied_message: "Link Copied", + qrcode_page_toast_message: "Please scan this QR code with your phone", + ok_button_text: "Confirm", + clear_button_text: "Clear File List", + send_page_title: "Send Files", + send_page_empty_drop_description: "Drag files here", + send_page_drop_description: "You can continue dragging more files", + list_item_file_size_label: "Size", + list_item_file_type_label: "Type", + send_page_list_item_tooltip: "Click to Preview File", + receive_page_empty_description: "Please upload files from your phone or another computer", + receive_page_list_item_tooltip: "Click to Open File with Default Program", + receive_page_dropdown_open_button_label: "Open", + receive_page_dropdown_pick_button_label: "Change", + receive_page_directory_path_label: "Save Directory", + receive_page_directory_path_tooltip: "Click to Open Directory in File Explorer", +}; diff --git a/src-tauri/src/i18n/mod.rs b/src-tauri/src/i18n/mod.rs new file mode 100644 index 0000000..a95c7f4 --- /dev/null +++ b/src-tauri/src/i18n/mod.rs @@ -0,0 +1,61 @@ +use std::{collections::HashMap, sync::LazyLock}; + +use serde::Serialize; + +mod en_us; +mod zh_cn; + +pub static LOCALES: LazyLock> = LazyLock::new(|| { + [(&Locale::ZhCN, zh_cn::ZH_CN), (&Locale::EnUS, en_us::EN_US)] + .iter() + .copied() + .collect() +}); + +#[derive(PartialEq, Eq, Hash)] +pub enum Locale { + ZhCN, + EnUS, +} + +impl From for Locale { + fn from(value: String) -> Self { + match value.as_ref() { + "zh-CN" => Self::ZhCN, + _ => Self::EnUS, + } + } +} + +#[derive(PartialEq, Eq, Hash, Serialize)] +pub struct Translations { + pub window_title: &'static str, + pub dark_mode_tooltip: &'static str, + pub light_mode_tooltip: &'static str, + pub about_button_tooltip: &'static str, + pub about_dialog_github_tooltip: &'static str, + pub about_dialog_feedback_tooltip: &'static str, + pub home_label_text: &'static str, + pub home_button_text: &'static str, + pub home_send_button_text: &'static str, + pub home_receive_button_text: &'static str, + pub qrcode_page_title: &'static str, + pub qrcode_page_url_label: &'static str, + pub qrcode_page_url_tooltip: &'static str, + pub qrcode_page_url_copied_message: &'static str, + pub qrcode_page_toast_message: &'static str, + pub ok_button_text: &'static str, + pub clear_button_text: &'static str, + pub send_page_title: &'static str, + pub send_page_empty_drop_description: &'static str, + pub send_page_drop_description: &'static str, + pub list_item_file_size_label: &'static str, + pub list_item_file_type_label: &'static str, + pub send_page_list_item_tooltip: &'static str, + pub receive_page_empty_description: &'static str, + pub receive_page_list_item_tooltip: &'static str, + pub receive_page_dropdown_open_button_label: &'static str, + pub receive_page_dropdown_pick_button_label: &'static str, + pub receive_page_directory_path_label: &'static str, + pub receive_page_directory_path_tooltip: &'static str, +} diff --git a/src-tauri/src/i18n/zh_cn.rs b/src-tauri/src/i18n/zh_cn.rs new file mode 100644 index 0000000..373614b --- /dev/null +++ b/src-tauri/src/i18n/zh_cn.rs @@ -0,0 +1,33 @@ +use super::Translations; + +pub(super) const ZH_CN: &Translations = &Translations { + window_title: "小路速传", + dark_mode_tooltip: "切换为亮色", + light_mode_tooltip: "切换为暗色", + about_button_tooltip: "关于和帮助", + about_dialog_github_tooltip: "访问官网", + about_dialog_feedback_tooltip: "反馈问题或寻求帮助", + home_label_text: "选择传输方式", + home_button_text: "回到主页", + home_receive_button_text: "接收", + home_send_button_text: "发送", + qrcode_page_title: "扫码连接", + qrcode_page_url_label: "或在另一台电脑中通过浏览器中访问", + qrcode_page_url_tooltip: "复制链接到剪贴板", + qrcode_page_url_copied_message: "已复制链接", + qrcode_page_toast_message: "请使用手机扫描此二维码", + ok_button_text: "确认", + clear_button_text: "清空文件列表", + send_page_title: "发送文件", + send_page_empty_drop_description: "将文件拖到此处", + send_page_drop_description: "可继续拖入文件", + list_item_file_size_label: "大小", + list_item_file_type_label: "类型", + send_page_list_item_tooltip: "单击预览文件", + receive_page_empty_description: "请在手机端或者另一台电脑中上传文件", + receive_page_list_item_tooltip: "单击使用默认程序打开此文件", + receive_page_dropdown_open_button_label: "打开", + receive_page_dropdown_pick_button_label: "修改", + receive_page_directory_path_label: "保存目录", + receive_page_directory_path_tooltip: "单击在文件管理器中打开此目录", +}; diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index d39e053..7506ef4 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -2,6 +2,7 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] mod error; +mod i18n; mod lazy; #[cfg(target_os = "linux")] mod linux; @@ -22,12 +23,14 @@ use std::{ use qrcode_generator::QrCodeEcc; use serde::Serialize; +use sys_locale::get_locale; use tauri::{AppHandle, Manager, UpdaterEvent}; use time::macros::{format_description, offset}; use tokio::fs::File; use tracing::Level; use tracing_subscriber::fmt::time::OffsetTime; +use crate::i18n::{Locale, Translations, LOCALES}; use crate::lazy::LOCAL_IP; #[cfg(target_os = "macos")] use crate::menu::{handle_menu_event, new_menu}; @@ -190,6 +193,12 @@ async fn get_files_metadata(paths: Vec) -> FluxyResult> { Ok(files) } +#[tauri::command] +fn get_locale_translations() -> &'static Translations { + let locale: Locale = get_locale().unwrap_or_else(|| String::from("en-US")).into(); + LOCALES[&locale] +} + #[tauri::command] fn is_linux() -> bool { cfg!(target_os = "linux") @@ -244,6 +253,11 @@ async fn main() -> FluxyResult<()> { #[cfg(not(debug_assertions))] builder.json().init(); + let locale = get_locale().unwrap_or_else(|| String::from("en-US")); + debug!("current locale: {}", locale); + let locale: Locale = locale.into(); + let translations = LOCALES[&locale]; + #[cfg(target_os = "linux")] { let scale_factor = crate::linux::get_scale_factor()?; @@ -262,6 +276,7 @@ async fn main() -> FluxyResult<()> { let mut builder = tauri::Builder::default() .setup(|app| { if let Some(w) = app.get_window("main") { + w.set_title(translations.window_title).unwrap(); if MAIN_WINDOW.set(w).is_err() { error!(message = "设置主窗口失败"); app.handle().exit(1); @@ -277,7 +292,8 @@ async fn main() -> FluxyResult<()> { get_files_metadata, get_send_files_url_qr_code, is_linux, - show_main_window + show_main_window, + get_locale_translations ]); // windows 和 linux 的菜单在窗口内, 无法自动切换暗色, 所以不使用菜单 diff --git a/src-tauri/src/server/error.rs b/src-tauri/src/server/error.rs index 4b695ec..5221e4d 100644 --- a/src-tauri/src/server/error.rs +++ b/src-tauri/src/server/error.rs @@ -20,10 +20,7 @@ impl ServerError { ) -> Self { let msg: Option<&str> = error.into(); let advice: Option<&str> = advice.into(); - let advice = match advice { - None => None, - Some(s) => Some(s.to_owned()), - }; + let advice = advice.map(|s| s.to_owned()); match msg { None => Self::Internal, diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index c1f9ca4..1b99cfe 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -34,9 +34,10 @@ "desktopTemplate": "./linux/alley.desktop" }, "windows": { - "wix": { "language": "zh-CN" }, + "wix": { "language": ["zh-CN", "en-US"] }, "nsis": { - "languages": ["SimpChinese"] + "languages": ["SimpChinese", "English"], + "displayLanguageSelector": true } }, "identifier": "com.thepoy.alley", @@ -67,7 +68,8 @@ "width": 400, "height": 600, "resizable": false, - "visible": false + "visible": false, + "fileDropEnabled": true } ] } diff --git a/src/App.tsx b/src/App.tsx index 7ea3c25..8ce5461 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import { Match, Switch, createSignal, onMount } from "solid-js"; +import { Match, Switch, createResource, createSignal, onMount } from "solid-js"; import { TbArrowsTransferUp, TbArrowsTransferDown } from "solid-icons/tb"; import { BiRegularSun, BiSolidMoon } from "solid-icons/bi"; import { @@ -15,7 +15,7 @@ import "~/App.scss"; import useDark from "alley-components/lib/hooks/useDark"; import About from "./about"; import { AppContext } from "./context"; -import { showMainWindow } from "./api"; +import { getLocaleTranslations, showMainWindow } from "./api"; enum Mode { Send = 1, @@ -27,6 +27,7 @@ const App = () => { const [mode, setMode] = createSignal(null); const [showAbout, setShowAbout] = createSignal(false); + const [translations] = createResource(getLocaleTranslations); const goHome = () => setMode(null); @@ -36,10 +37,18 @@ const App = () => { setShowAbout(true) }, }} > - + { -
选择传输方式
+
{translations()?.home_label_text}
{suspense( { icon={} onClick={() => setMode(Mode.Receive)} > - 接收 + {translations()?.home_receive_button_text} , )} @@ -74,7 +83,7 @@ const App = () => { icon={} onClick={() => setMode(Mode.Send)} > - 发送 + {translations()?.home_send_button_text} , )} diff --git a/src/about.tsx b/src/about.tsx index 05c721d..17b5946 100644 --- a/src/about.tsx +++ b/src/about.tsx @@ -8,14 +8,16 @@ import { LazyTypographyTitle, } from "./lazy"; import useDark from "alley-components/lib/hooks/useDark"; -import { createSignal, onMount } from "solid-js"; +import { createSignal, onMount, useContext } from "solid-js"; import { app } from "@tauri-apps/api"; import { AiFillGithub } from "solid-icons/ai"; import { RiCommunicationFeedbackLine } from "solid-icons/ri"; import { open } from "@tauri-apps/api/shell"; import "./about.scss"; +import { AppContext } from "./context"; const About = () => { + const { translations } = useContext(AppContext)!; const [name, setName] = createSignal(""); const [version, setVersion] = createSignal(""); @@ -39,7 +41,10 @@ const About = () => { - + } type="plain" @@ -48,7 +53,10 @@ const About = () => { /> - + } type="plain" diff --git a/src/api.ts b/src/api.ts index b250c74..75c078e 100644 --- a/src/api.ts +++ b/src/api.ts @@ -26,3 +26,6 @@ export const getSendFilesUrlQrCode = async (files: SendFile[]) => export const isLinux = async () => await invoke("is_linux"); export const showMainWindow = async () => invoke("show_main_window"); + +export const getLocaleTranslations = async () => + invoke("get_locale_translations"); diff --git a/src/components/aboutButton/index.tsx b/src/components/aboutButton/index.tsx index ecb3309..b56d99f 100644 --- a/src/components/aboutButton/index.tsx +++ b/src/components/aboutButton/index.tsx @@ -6,12 +6,13 @@ import { LazyFloatButton } from "~/lazy"; const AboutButton = () => { const { about: { onShow }, + translations, } = useContext(AppContext)!; return ( } - tooltip="关于和帮助" + tooltip={translations()!.about_button_tooltip} onClick={onShow} /> ); diff --git a/src/components/qrcode/index.tsx b/src/components/qrcode/index.tsx index 14ee007..900744c 100644 --- a/src/components/qrcode/index.tsx +++ b/src/components/qrcode/index.tsx @@ -10,7 +10,8 @@ import { } from "~/lazy"; import "./index.scss"; import { AiFillCopy } from "solid-icons/ai"; -import { createSignal } from "solid-js"; +import { createSignal, useContext } from "solid-js"; +import { AppContext } from "~/context"; interface QRCodeProps { qrcode: QrCode; @@ -19,6 +20,7 @@ interface QRCodeProps { const baseClassName = "qr-code"; const QRCode = ({ qrcode }: QRCodeProps) => { + const { translations } = useContext(AppContext)!; const [showToast, setShowToast] = createSignal(false); return ( @@ -28,10 +30,17 @@ const QRCode = ({ qrcode }: QRCodeProps) => { justify="center" direction="vertical" > -

扫码连接

+ { }} + /> + +

{translations()?.qrcode_page_title}

-
或在另一台电脑中通过浏览器中访问
+
{translations()?.qrcode_page_url_label}
{ {qrcode.url} - + } shape="circle" @@ -61,7 +70,7 @@ const QRCode = ({ qrcode }: QRCodeProps) => { autoHideDuration={1000} alert={{ type: "success", - message: "已复制链接", + message: translations()?.qrcode_page_url_copied_message, }} /> diff --git a/src/pages/receive/fileListItem.tsx b/src/pages/receive/fileListItem.tsx index 997b4e8..692004c 100644 --- a/src/pages/receive/fileListItem.tsx +++ b/src/pages/receive/fileListItem.tsx @@ -1,4 +1,4 @@ -import { Show } from "solid-js"; +import { Show, useContext } from "solid-js"; import { open } from "@tauri-apps/api/shell"; import { AiFillCheckCircle } from "solid-icons/ai"; import fileType from "./fileType"; @@ -10,6 +10,7 @@ import { LazyTooltip, LazyTypographyText, } from "~/lazy"; +import { AppContext } from "~/context"; interface FileListItemProps { index?: number; @@ -21,6 +22,8 @@ interface FileListItemProps { } const FileListItem = (props: FileListItemProps) => { + const { translations } = useContext(AppContext)!; + const extension = getExtension(props.name); return ( @@ -38,7 +41,10 @@ const FileListItem = (props: FileListItemProps) => { {props.name} } > - + open(props.path)}>{props.name} @@ -46,8 +52,12 @@ const FileListItem = (props: FileListItemProps) => { } description={ - 大小: {props.size} - 类型:{fileType(extension)} + + {translations()?.list_item_file_size_label}: {props.size} + + + {translations()?.list_item_file_type_label}: {fileType(extension)} + } extra={ diff --git a/src/pages/receive/header.tsx b/src/pages/receive/header.tsx index c2e9768..13de81d 100644 --- a/src/pages/receive/header.tsx +++ b/src/pages/receive/header.tsx @@ -1,14 +1,17 @@ import { open as pick } from "@tauri-apps/api/dialog"; import { open } from "@tauri-apps/api/shell"; -import { createEffect, createSignal, onMount } from "solid-js"; +import { createEffect, createSignal, onMount, useContext } from "solid-js"; import { changeDownloadsDir, getDownloadsDir, isLinux } from "~/api"; import type { MenuItemProps } from "alley-components/lib/components/dropdown"; import Loading from "alley-components/lib/components/spinner"; import { LazyCol, LazyDropdown, LazyLink, LazyRow, LazyTooltip } from "~/lazy"; +import { AppContext } from "~/context"; const baseClassName = "receive-header"; const Header = () => { + const { translations } = useContext(AppContext)!; + const [downloadDir, setDownloadDir] = createSignal( undefined, ); @@ -44,11 +47,11 @@ const Header = () => { const dropdownItems: MenuItemProps[] = [ { - label: "打开", + label: translations()!.receive_page_dropdown_open_button_label, onClick: () => open(downloadDir()!), }, { - label: "修改", + label: translations()!.receive_page_dropdown_pick_button_label, onClick: () => pickDirectory(), }, ]; @@ -69,7 +72,9 @@ const Header = () => { top={dropdownTop()} left={18} > - 保存目录 + + {translations()?.receive_page_directory_path_label} + @@ -79,7 +84,10 @@ const Header = () => { align="center" justify="center" > - + { setOpenDropDown(false); diff --git a/src/pages/receive/index.tsx b/src/pages/receive/index.tsx index fe6ec1b..abce48e 100644 --- a/src/pages/receive/index.tsx +++ b/src/pages/receive/index.tsx @@ -22,7 +22,6 @@ import { LazyQrcode, LazyList, LazyFloatButtonGroup, - LazyToast, LazyAboutButton, } from "~/lazy"; import { createStore } from "solid-js/store"; @@ -30,7 +29,7 @@ import { AiFillDelete, AiOutlineHome } from "solid-icons/ai"; import { AppContext } from "~/context"; const Receive = () => { - const { goHome } = useContext(AppContext)!; + const { goHome, translations } = useContext(AppContext)!; const [qrcode, setQrcode] = createSignal(null); @@ -101,7 +100,7 @@ const Receive = () => { } onClick={() => setFileList([])} danger @@ -109,7 +108,7 @@ const Receive = () => { } onClick={() => { setTaskList([]); @@ -123,16 +122,8 @@ const Receive = () => { return ( - {/* biome-ignore lint/style/noNonNullAssertion: */} - { }} - /> - {floatButtons()} @@ -148,7 +139,9 @@ const Receive = () => { align="center" justify="center" > - + diff --git a/src/pages/send/index.tsx b/src/pages/send/index.tsx index 41496eb..60ccf67 100644 --- a/src/pages/send/index.tsx +++ b/src/pages/send/index.tsx @@ -37,7 +37,7 @@ import { open } from "@tauri-apps/api/shell"; import { AppContext } from "~/context"; const Send = () => { - const { goHome } = useContext(AppContext)!; + const { goHome, translations } = useContext(AppContext)!; const [files, setFiles] = createSignal([]); @@ -98,12 +98,12 @@ const Send = () => { icon={} onClick={() => setFiles([])} danger - tooltip={"清空文件列表"} + tooltip={translations()?.clear_button_text} /> } onClick={goHome} /> @@ -120,7 +120,7 @@ const Send = () => { justify="center" direction="vertical" > -
发送文件
+
{translations()?.send_page_title}
{ + open(file.path)}> {file.name} @@ -146,9 +149,15 @@ const Send = () => { } description={ <> - 大小: {file.size} + + {translations()?.list_item_file_size_label}:{" "} + {file.size} +      - 类型: {file.extension} + + {translations()?.list_item_file_type_label}:{" "} + {file.extension} + } extra={[ @@ -167,11 +176,13 @@ const Send = () => { /> - 可继续拖入文件 + {translations()?.send_page_drop_description} ) : ( - + )} @@ -181,7 +192,7 @@ const Send = () => { block disabled={isEmpty()} > - 确认 + {translations()?.ok_button_text}
diff --git a/static/package.json b/static/package.json index 1917603..bb8fb01 100644 --- a/static/package.json +++ b/static/package.json @@ -11,12 +11,12 @@ }, "dependencies": { "solid-icons": "^1.1.0", - "solid-js": "^1.8.22" + "solid-js": "^1.9.3" }, "devDependencies": { - "sass": "^1.78.0", - "typescript": "^5.6.2", - "vite": "^5.4.4", + "sass": "^1.80.6", + "typescript": "^5.6.3", + "vite": "^5.4.10", "vite-plugin-solid": "^2.10.2" } } diff --git a/static/src/App.tsx b/static/src/App.tsx index 1aa34a5..1bab796 100644 --- a/static/src/App.tsx +++ b/static/src/App.tsx @@ -5,6 +5,8 @@ import Send from "~/pages/send"; import Receive from "~/pages/receive"; import SwitchDark from "~/components/switch"; import "~/App.scss"; +import { getLocale } from "./i18n"; +import LocaleContext from "./context"; type Mode = "receive" | "send"; @@ -14,6 +16,8 @@ const App = () => { const params = new URLSearchParams(url.search); const mode = params.get("mode") as Mode | null; + const locale = getLocale(); + const [isDark, setIsDark] = createSignal(false); onMount(() => { @@ -43,7 +47,7 @@ const App = () => { }); return ( -
+ {
@@ -76,7 +80,7 @@ const App = () => { -
+ ); }; diff --git a/static/src/components/upload/fileItem.tsx b/static/src/components/upload/fileItem.tsx index fe29b5e..29390f3 100644 --- a/static/src/components/upload/fileItem.tsx +++ b/static/src/components/upload/fileItem.tsx @@ -6,6 +6,9 @@ import Space from "~/components/space"; import DotLoading from "~/components/loading/dot"; import List from "~/components/list"; import Progress from "../progress"; +import { Show, useContext } from "solid-js"; +import LocaleContext from "~/context"; +import ZH_CN from "~/i18n/zh_cn"; const getExtension = (name: string): string => { const dotIndex = name.lastIndexOf("."); @@ -24,6 +27,7 @@ interface FileItemProps { } const FileItem = (props: FileItemProps) => { + const locale = useContext(LocaleContext)!; const extension = getExtension(props.file.name); return ( @@ -36,8 +40,15 @@ const FileItem = (props: FileItemProps) => { } description={ - 大小: {formatFileSize(props.file.size)} - 类型:{fileType(extension)} + + {locale.file_item_file_size_label}: + {formatFileSize(props.file.size)} + + + + {locale.file_item_file_type_label}:{fileType(extension)} + + } extra={ diff --git a/static/src/components/upload/index.tsx b/static/src/components/upload/index.tsx index 09272a1..102fe2c 100644 --- a/static/src/components/upload/index.tsx +++ b/static/src/components/upload/index.tsx @@ -1,4 +1,10 @@ -import { type JSX, createEffect, createSignal, createUniqueId } from "solid-js"; +import { + type JSX, + createEffect, + createSignal, + createUniqueId, + useContext, +} from "solid-js"; import { createStore } from "solid-js/store"; import { getFileItemIndex } from "./util"; import request from "./request"; @@ -9,6 +15,7 @@ import FileItem from "./fileItem"; import "./index.scss"; import Button from "../button"; import { AiOutlinePlus } from "solid-icons/ai"; +import LocaleContext from "~/context"; interface UploadProps { action: string; @@ -18,6 +25,8 @@ interface UploadProps { } const Upload = ({ action, headers, withCredentials, method }: UploadProps) => { + const locale = useContext(LocaleContext)!; + let fileInput: HTMLInputElement | undefined; const [fileItems, setFileItems] = createStore([]); @@ -129,13 +138,13 @@ const Upload = ({ action, headers, withCredentials, method }: UploadProps) => {
) : ( ( (); + +export default LocaleContext; diff --git a/static/src/i18n/en_us.ts b/static/src/i18n/en_us.ts new file mode 100644 index 0000000..e81c064 --- /dev/null +++ b/static/src/i18n/en_us.ts @@ -0,0 +1,24 @@ +import type { Locale } from "."; + +const EN_US: Locale = { + invalid_request: "Invalid request", + mode_is_required: "Query parameter 'mode' is required", + + file_item_file_size_label: "Size", + file_item_file_type_label: "Type", + + send_page_title: "Send File", + send_page_empty_title: "No File Selected", + send_page_empty_description: + "Click the plus button in the top left corner to select files", + send_page_uploading_tooltip: + "Click the red button on the right to interrupt unfinished tasks", + + receive_page_title: "Receive File", + receive_page_toast: + "Do not refresh this page, or the file list will be cleared", + receive_page_file_list_header: + "Click the filename or the button on the right to download", +}; + +export default EN_US; diff --git a/static/src/i18n/index.ts b/static/src/i18n/index.ts new file mode 100644 index 0000000..1773198 --- /dev/null +++ b/static/src/i18n/index.ts @@ -0,0 +1,29 @@ +import EN_US from "./en_us"; +import ZH_CN from "./zh_cn"; + +export interface Locale { + invalid_request: string; + mode_is_required: string; + + file_item_file_size_label: string; + file_item_file_type_label: string; + + send_page_title: string; + send_page_empty_title: string; + send_page_empty_description: string; + send_page_uploading_tooltip: string; + + receive_page_title: string; + receive_page_toast: string; + receive_page_file_list_header: string; +} + +export const getLocale = (): Locale => { + const language = navigator.language; + + if (language === "zh-CN") { + return ZH_CN; + } + + return EN_US; +}; diff --git a/static/src/i18n/zh_cn.ts b/static/src/i18n/zh_cn.ts new file mode 100644 index 0000000..1ad0a9a --- /dev/null +++ b/static/src/i18n/zh_cn.ts @@ -0,0 +1,20 @@ +import type { Locale } from "."; + +const ZH_CN: Locale = { + invalid_request: "无效的请求", + mode_is_required: "缺少查询参数:mode", + + file_item_file_size_label: "大小", + file_item_file_type_label: "类型", + + send_page_title: "发送文件", + send_page_empty_title: "未选择文件", + send_page_empty_description: "点击左上角的加号按钮选择文件", + send_page_uploading_tooltip: "未完成的任务可点击右侧红色按钮中断", + + receive_page_title: "接收文件", + receive_page_toast: "不要刷新此页面,否则文件列表将会被清空", + receive_page_file_list_header: "点击文件名或右侧按钮即可下载", +}; + +export default ZH_CN; diff --git a/static/src/pages/receive/index.tsx b/static/src/pages/receive/index.tsx index 359b25b..98c0892 100644 --- a/static/src/pages/receive/index.tsx +++ b/static/src/pages/receive/index.tsx @@ -1,4 +1,4 @@ -import { Match, Switch, createResource } from "solid-js"; +import { Match, Show, Switch, createResource, useContext } from "solid-js"; import { AiOutlineCloudDownload } from "solid-icons/ai"; import Result from "~/components/result"; import SpinLoading from "~/components/loading/spin"; @@ -8,6 +8,8 @@ import List from "~/components/list"; import fileType from "./fileType"; import Link from "~/components/link"; import "./index.scss"; +import LocaleContext from "~/context"; +import ZH_CN from "~/i18n/zh_cn"; type ResponseData = SendFile[] | BadRequest; @@ -24,11 +26,13 @@ const fetchData = async (): Promise => { }; const Receive = () => { + const locale = useContext(LocaleContext)!; + const [data] = createResource(fetchData); return (
-
接收文件
+
{locale.receive_page_title}
@@ -51,14 +55,11 @@ const Receive = () => {
- + { const url = "/download/" + encodeURIComponent(item.path); @@ -78,8 +79,12 @@ const Receive = () => { } description={ - 大小:{item.size} - 类型:{fileType(item.extension)} + + {locale.file_item_file_size_label}:{item.size} + + + 类型:{fileType(item.extension)} + } extra={[ diff --git a/static/src/pages/send/index.tsx b/static/src/pages/send/index.tsx index bb175c4..643d4ce 100644 --- a/static/src/pages/send/index.tsx +++ b/static/src/pages/send/index.tsx @@ -1,10 +1,14 @@ import Upload from "~/components/upload"; import "./index.scss"; +import { useContext } from "solid-js"; +import LocaleContext from "~/context"; const Send = () => { + const locale = useContext(LocaleContext)!; + return (
-
发送文件
+
{locale.send_page_title}
); diff --git a/types/context.d.ts b/types/context.d.ts index 8534a1e..ed2f9ed 100644 --- a/types/context.d.ts +++ b/types/context.d.ts @@ -8,4 +8,5 @@ interface AppContext { show: Accessor; onShow: () => void; }; + translations: Resource; } diff --git a/types/index.d.ts b/types/index.d.ts index 3bca5b4..72a7e26 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -21,3 +21,35 @@ interface SendFile { } type CSSProperties = JSX.CSSProperties; + +interface Translations { + window_title: string; + dark_mode_tooltip: string; + light_mode_tooltip: string; + about_button_tooltip: string; + about_dialog_github_tooltip: string; + about_dialog_feedback_tooltip: string; + home_label_text: string; + home_button_text: string; + home_send_button_text: string; + home_receive_button_text: string; + qrcode_page_title: string; + qrcode_page_url_label: string; + qrcode_page_url_tooltip: string; + qrcode_page_url_copied_message: string; + qrcode_page_toast_message: string; + ok_button_text: string; + clear_button_text: string; + send_page_title: string; + send_page_empty_drop_description: string; + send_page_drop_description: string; + list_item_file_size_label: string; + list_item_file_type_label: string; + send_page_list_item_tooltip: string; + receive_page_empty_description: string; + receive_page_list_item_tooltip: string; + receive_page_dropdown_open_button_label: string; + receive_page_dropdown_pick_button_label: string; + receive_page_directory_path_label: string; + receive_page_directory_path_tooltip: string; +}