diff --git a/.changes/notification-revert-sound.md b/.changes/notification-revert-sound.md new file mode 100644 index 00000000..b21cb9a6 --- /dev/null +++ b/.changes/notification-revert-sound.md @@ -0,0 +1,5 @@ +--- +"notification": patch +--- + +Revert [7d71ad4e5](https://github.com/tauri-apps/plugins-workspace/commit/7d71ad4e587bcf47ea34645f5b226945e487b765) which added a default sound for notifications on Windows. This introduced inconsistency with other platforms that has silent notifications by default. In the upcoming releases, we will add support for modifying the notification sound across all platforms. diff --git a/.changes/os-plugin-refactor.md b/.changes/os-plugin-refactor.md index 63cd5bdd..ff0f7384 100644 --- a/.changes/os-plugin-refactor.md +++ b/.changes/os-plugin-refactor.md @@ -9,3 +9,4 @@ The os plugin is recieving a few changes to improve consistency and add new feat - Added `family()`,`exe_extension()`, and `hostname()` functions and their equivalents for JS. - Removed `tempdir()` function and its equivalent on JS, use `std::env::temp_dir` instead of `temp_dir` from `tauri::path::PathResolver::temp_dir` and `path.tempDir` on JS. - Modified `platform()` implementation to return `windows` instead of `win32` and `macos` instead of `darwin` to align with Rust's `std::env::consts::OS` +- `EOL` const in JS has been modified into a function `eol()` fix import issues in frameworks like `next.js` diff --git a/.changes/updater-nsis.md b/.changes/updater-nsis.md new file mode 100644 index 00000000..adfd7f0d --- /dev/null +++ b/.changes/updater-nsis.md @@ -0,0 +1,5 @@ +--- +"updater": patch +--- + +Implement passive mode on NSIS and automatically restart after NSIS update. diff --git a/.changes/window-incognito.md b/.changes/window-incognito.md new file mode 100644 index 00000000..5d64fb03 --- /dev/null +++ b/.changes/window-incognito.md @@ -0,0 +1,5 @@ +--- +"window-js": "minor" +--- + +Add `incognito` window configuration option diff --git a/.changes/window-is-focused.md b/.changes/window-is-focused.md new file mode 100644 index 00000000..6f212fd5 --- /dev/null +++ b/.changes/window-is-focused.md @@ -0,0 +1,6 @@ +--- +"window": "minor:feat" +"window-js": "minor:feat" +--- + +Add `WebviewWindow.is_focused` and `WebviewWindow.getFocusedWindow` getters. diff --git a/.changes/window-set-effects.md b/.changes/window-set-effects.md new file mode 100644 index 00000000..f2a5d3d9 --- /dev/null +++ b/.changes/window-set-effects.md @@ -0,0 +1,6 @@ +--- +"window": "patch" +"window-js": "patch" +--- + +Added the `setEffects` and `clearEffects` API. diff --git a/.eslintignore b/.eslintignore index efef8f77..329feacb 100644 --- a/.eslintignore +++ b/.eslintignore @@ -2,4 +2,5 @@ target node_modules dist dist-js -api-iife.js \ No newline at end of file +api-iife.js +init.js \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index d5c3a540..1db4dad9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,23 +52,23 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.9.4" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +checksum = "bc3be92e19a7ef47457b8e6f90707e12b6ac5d20c6f3866584fa3be0787d839f" dependencies = [ "aead 0.4.3", "aes 0.7.5", "cipher 0.3.0", - "ctr 0.8.0", + "ctr 0.7.0", "ghash 0.4.4", "subtle", ] [[package]] name = "aes-gcm" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e1366e0c69c9f927b1fa5ce2c7bf9eafc8f9268c0b9800729e8b267612447c" +checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" dependencies = [ "aead 0.5.2", "aes 0.8.2", @@ -89,6 +89,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.20" @@ -151,9 +162,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e579a7752471abc2a8268df8b20005e3eadd975f585398f17efcfd8d4927371" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" dependencies = [ "anstyle", "anstyle-parse", @@ -190,9 +201,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcd8291a340dd8ac70e18878bc4501dd7b4ff970cfa21c207d36ece51ea88fd" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -200,9 +211,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" +checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" [[package]] name = "api" @@ -240,7 +251,7 @@ dependencies = [ "tauri", "tauri-build", "tauri-plugin-updater", - "time 0.3.20", + "time 0.3.21", "tiny_http 0.11.0", ] @@ -493,7 +504,7 @@ checksum = "5904a4d734f0235edf29aab320a14899f3e090446e594ff96508a6215f76f89c" dependencies = [ "dirs", "thiserror", - "winreg", + "winreg 0.10.1", ] [[package]] @@ -516,9 +527,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -543,9 +554,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.2.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a6904aef64d73cf10ab17ebace7befb918b82164785cb89907993be7f83813" +checksum = "6776fc96284a0bb647b615056fc496d1fe1644a7ab01829818a6d91cae888b84" [[package]] name = "blake2" @@ -553,7 +564,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -629,9 +640,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d4260bcc2e8fc9df1eac4919a720effeb63a3f0952f5bf4944adfa18897f09" +checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" dependencies = [ "memchr", "serde", @@ -639,9 +650,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-unit" @@ -716,7 +727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" dependencies = [ "serde", - "toml 0.7.3", + "toml", ] [[package]] @@ -744,11 +755,12 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35b255461940a32985c627ce82900867c61db1659764d3675ea81963f72a4c6" +checksum = "c8790cf1286da485c72cf5fc7aeba308438800036ec67d89425924c4807268c9" dependencies = [ "smallvec", + "target-lexicon", ] [[package]] @@ -825,18 +837,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.2" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b802d85aaf3a1cdb02b224ba472ebdea62014fccfcb269b95a4d76443b5ee5a" +checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.2.2" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14a1a858f532119338887a4b8e1af9c60de8249cd7bafd68036a489e261e37b6" +checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" dependencies = [ "anstream", "anstyle", @@ -847,9 +859,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "clipboard-win" @@ -893,16 +905,6 @@ dependencies = [ "objc", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "color_quant" version = "1.1.0" @@ -1023,9 +1025,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] @@ -1143,9 +1145,9 @@ dependencies = [ [[package]] name = "ctr" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +checksum = "a232f92a03f37dd7d7dd2adc67166c77e9cd88de5b019b9a9eecfaeaf7bfd481" dependencies = [ "cipher 0.3.0", ] @@ -1172,50 +1174,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "cxx" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 2.0.18", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.18", -] - [[package]] name = "darling" version = "0.20.1" @@ -1253,9 +1211,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "der" @@ -1313,9 +1271,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", "crypto-common", @@ -1392,9 +1350,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "ed25519-zebra" @@ -1403,7 +1361,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ "curve25519-dalek", - "hashbrown", + "hashbrown 0.12.3", "hex", "rand_core 0.6.4", "sha2 0.9.9", @@ -1416,6 +1374,19 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +[[package]] +name = "embed-resource" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80663502655af01a2902dff3f06869330782267924bf1788410b74edcd93770a" +dependencies = [ + "cc", + "rustc_version", + "toml", + "vswhom", + "winreg 0.11.0", +] + [[package]] name = "embed_plist" version = "1.2.2" @@ -1508,6 +1479,15 @@ dependencies = [ "instant", ] +[[package]] +name = "fdeflate" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +dependencies = [ + "simd-adler32", +] + [[package]] name = "fern" version = "0.6.2" @@ -1542,9 +1522,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "miniz_oxide", @@ -1672,9 +1652,9 @@ checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ "fastrand", "futures-core", @@ -1823,15 +1803,15 @@ dependencies = [ [[package]] name = "generator" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a20a288a94683f5f4da0adecdbe095c94a77c295e514cc6484e9394dd8376e" +checksum = "f3e123d9ae7c02966b4d892e550bdc32164f05853cd40ab570650ad600596a8a" dependencies = [ "cc", "libc", "log", "rustversion", - "windows 0.44.0", + "windows 0.48.0", ] [[package]] @@ -2112,16 +2092,25 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", ] [[package]] name = "hashlink" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69fe1fcf8b4278d860ad0548329f892a3631fb63f82574df68275f34cdbe0ffa" +checksum = "0761a1b9491c4f2e3d66aa0f62d0fba0af9a0e2852e4d48ea506632a4b56e6aa" dependencies = [ - "hashbrown", + "hashbrown 0.13.2", ] [[package]] @@ -2187,7 +2176,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2246,9 +2235,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes 1.4.0", "futures-channel", @@ -2310,12 +2299,11 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -2393,7 +2381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", "serde", ] @@ -2455,9 +2443,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi 0.3.1", "libc", @@ -2472,12 +2460,12 @@ checksum = "4e04d492224bff6e97142f033d0a4383bcbc05918be1ff7b3abd2c1cc85205a2" dependencies = [ "aead 0.4.3", "aes 0.7.5", - "aes-gcm 0.9.4", + "aes-gcm 0.9.2", "autocfg", "blake2", "chacha20poly1305", "curve25519-dalek", - "digest 0.10.6", + "digest 0.10.7", "ed25519-zebra", "generic-array", "getrandom 0.2.9", @@ -2492,9 +2480,9 @@ dependencies = [ [[package]] name = "iota-crypto" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0180a2a7939b4b0ae68e651bbec130b27fd5882ef552df5bb55e0320e78bacbc" +checksum = "7eb2df6763689b6e2b95787941eb9a58b29d16d17c2055392f550b3daf40bdce" dependencies = [ "autocfg", ] @@ -2635,9 +2623,9 @@ checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] @@ -2732,9 +2720,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.141" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "libloading" @@ -2748,9 +2736,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "libsodium-sys" @@ -2804,20 +2792,11 @@ dependencies = [ "safemem", ] -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - [[package]] name = "linux-raw-sys" -version = "0.3.1" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "lock_api" @@ -2870,7 +2849,7 @@ dependencies = [ "dirs-next", "objc-foundation", "objc_id", - "time 0.3.20", + "time 0.3.21", ] [[package]] @@ -2917,7 +2896,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2983,11 +2962,12 @@ checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", + "simd-adler32", ] [[package]] @@ -3094,7 +3074,6 @@ dependencies = [ "cfg-if", "libc", "memoffset 0.7.1", - "pin-utils", "static_assertions", ] @@ -3330,9 +3309,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "open" -version = "4.0.2" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873240a4a404d44c8cd1bf394359245d466a5695771fea15a79cafbc5e5cf4d7" +checksum = "d16814a067484415fda653868c9be0ac5f2abd2ef5d951082a5f2fe1b3662944" dependencies = [ "is-wsl", "pathdiff", @@ -3340,9 +3319,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.49" +version = "0.10.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d2f106ab837a24e03672c59b1239669a0596406ff657c3c0835b6b7f0f35a33" +checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -3381,9 +3360,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.84" +version = "0.9.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a20eace9dc2d82904039cb76dcf50fb1a0bba071cfd1629720b5d6f1ddba0fa" +checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" dependencies = [ "cc", "libc", @@ -3415,12 +3394,12 @@ dependencies = [ [[package]] name = "os_pipe" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53dbb20faf34b16087a931834cba2d7a73cc74af2b7ef345a4c8324e2409a12" +checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" dependencies = [ "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3527,7 +3506,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -3645,22 +3624,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] @@ -3699,9 +3678,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "plist" @@ -3709,31 +3688,32 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bd9647b268a3d3e14ff09c23201133a62589c658db02bb7388c7246aafe0590" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "indexmap", "line-wrap", - "quick-xml 0.28.1", + "quick-xml 0.28.2", "serde", - "time 0.3.20", + "time 0.3.21", ] [[package]] name = "png" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +checksum = "aaeebc51f9e7d2c150d3f3bfeb667f2aa985db5ef1e3d212847bdedb488beeaa" dependencies = [ "bitflags 1.3.2", "crc32fast", + "fdeflate", "flate2", "miniz_oxide", ] [[package]] name = "polling" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e1f879b2998099c2d69ab9605d145d5b661195627eccc680002c4918a7fb6fa" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", "bitflags 1.3.2", @@ -3742,7 +3722,7 @@ dependencies = [ "libc", "log", "pin-project-lite", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -3753,7 +3733,7 @@ checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ "cpufeatures", "opaque-debug", - "universal-hash 0.4.1", + "universal-hash 0.4.0", ] [[package]] @@ -3765,7 +3745,7 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug", - "universal-hash 0.4.1", + "universal-hash 0.4.0", ] [[package]] @@ -3777,7 +3757,7 @@ dependencies = [ "cfg-if", "cpufeatures", "opaque-debug", - "universal-hash 0.5.0", + "universal-hash 0.5.1", ] [[package]] @@ -3858,9 +3838,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c1a97b1bc42b1d550bfb48d4262153fe400a12bab1511821736f7eac76d7e2" +checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1" dependencies = [ "memchr", ] @@ -4003,13 +3983,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" dependencies = [ - "aho-corasick 0.7.20", + "aho-corasick 1.0.1", "memchr", - "regex-syntax", + "regex-syntax 0.7.2", ] [[package]] @@ -4018,7 +3998,7 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", ] [[package]] @@ -4027,13 +4007,19 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + [[package]] name = "reqwest" version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "bytes 1.4.0", "encoding_rs", "futures-core", @@ -4069,14 +4055,14 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots 0.22.6", - "winreg", + "winreg 0.10.1", ] [[package]] name = "rfd" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cb2988ec50c9bcdb0c012b89643a6094a35a785a37897211ee62e1639342f7b" +checksum = "4fe664af397d2b6a13a8ba1d172a2b5c87c6c5149039edbf8fa122b98c9ed96f" dependencies = [ "async-io", "block", @@ -4119,7 +4105,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" dependencies = [ "byteorder", - "digest 0.10.6", + "digest 0.10.7", "num-bigint-dig", "num-integer", "num-iter", @@ -4161,16 +4147,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.3" +version = "0.37.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b24138615de35e32031d041a09032ef3487a616d901ca4db224e7d557efae2" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" dependencies = [ "bitflags 1.3.2", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -4203,7 +4189,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] @@ -4276,12 +4262,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "scratch" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" - [[package]] name = "sct" version = "0.7.0" @@ -4294,9 +4274,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -4307,9 +4287,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" dependencies = [ "core-foundation-sys", "libc", @@ -4346,18 +4326,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.159" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", @@ -4366,9 +4346,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa 1.0.6", "ryu", @@ -4388,9 +4368,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" dependencies = [ "serde", ] @@ -4413,14 +4393,14 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f02d8aa6e3c385bf084924f660ce2a3a6bd333ba55b35e8590b321f35d88513" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "chrono", "hex", "indexmap", "serde", "serde_json", "serde_with_macros", - "time 0.3.20", + "time 0.3.21", ] [[package]] @@ -4475,7 +4455,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -4499,7 +4479,7 @@ checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -4521,6 +4501,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "simd-adler32" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f" + [[package]] name = "similar" version = "2.2.1" @@ -4638,7 +4624,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" dependencies = [ - "ahash", + "ahash 0.7.6", "atoi", "base64 0.13.1", "bitflags 1.3.2", @@ -4646,7 +4632,7 @@ dependencies = [ "bytes 1.4.0", "crc", "crossbeam-queue", - "digest 0.10.6", + "digest 0.10.7", "dirs", "dotenvy", "either", @@ -4686,7 +4672,7 @@ dependencies = [ "sqlx-rt", "stringprep", "thiserror", - "time 0.3.20", + "time 0.3.21", "tokio-stream", "url", "webpki-roots 0.22.6", @@ -4874,17 +4860,17 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "swift-rs" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fa67d647176dfa7bdc5775430a1cb339e0ea48fe24707424023a4b17eb9688e" +checksum = "05e51d6f2b5fff4808614f429f8a7655ac8bcfe218185413f3a60c508482c2d6" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "serde", "serde_json", ] @@ -4923,14 +4909,14 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.0.4" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555fc8147af6256f3931a36bb83ad0023240ce9cf2b319dec8236fd1f220b05f" +checksum = "e5fa6fb9ee296c0dc2df41a656ca7948546d061958115ddb0bcaae43ad0d17d2" dependencies = [ "cfg-expr", "heck 0.4.1", "pkg-config", - "toml 0.7.3", + "toml", "version-compare", ] @@ -5005,6 +4991,12 @@ dependencies = [ "xattr", ] +[[package]] +name = "target-lexicon" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" + [[package]] name = "tauri" version = "2.0.0-alpha.10" @@ -5083,7 +5075,7 @@ version = "2.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c1f1611ab0896f2693163ba4e8f3e39c02a1b70cdca4314286b5e365a5e08c6" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "brotli", "ico 0.3.0", "json-patch", @@ -5097,7 +5089,7 @@ dependencies = [ "sha2 0.10.6", "tauri-utils", "thiserror", - "time 0.3.20", + "time 0.3.21", "url", "uuid", "walkdir", @@ -5129,7 +5121,7 @@ name = "tauri-plugin-authenticator" version = "2.0.0-alpha.0" dependencies = [ "authenticator", - "base64 0.21.0", + "base64 0.21.2", "chrono", "log", "once_cell", @@ -5268,7 +5260,7 @@ dependencies = [ "swift-rs", "tauri", "tauri-build", - "time 0.3.20", + "time 0.3.21", ] [[package]] @@ -5284,7 +5276,7 @@ dependencies = [ "tauri", "tauri-build", "thiserror", - "time 0.3.20", + "time 0.3.21", "url", "win7-notifications", ] @@ -5298,6 +5290,7 @@ dependencies = [ "os_info", "serde", "serde_json", + "serialize-to-javascript", "sys-locale", "tauri", "thiserror", @@ -5376,7 +5369,7 @@ dependencies = [ "sqlx", "tauri", "thiserror", - "time 0.3.20", + "time 0.3.21", "tokio", ] @@ -5396,7 +5389,7 @@ name = "tauri-plugin-stronghold" version = "2.0.0-alpha.0" dependencies = [ "hex", - "iota-crypto 0.20.0", + "iota-crypto 0.20.1", "iota_stronghold", "log", "rand 0.8.5", @@ -5412,7 +5405,7 @@ dependencies = [ name = "tauri-plugin-updater" version = "2.0.0-alpha.0" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "dirs-next", "flate2", "futures-util", @@ -5429,7 +5422,7 @@ dependencies = [ "tauri", "tempfile", "thiserror", - "time 0.3.20", + "time 0.3.21", "tokio", "tokio-test", "url", @@ -5481,7 +5474,7 @@ name = "tauri-plugin-window-state" version = "2.0.0-alpha.0" dependencies = [ "bincode", - "bitflags 2.2.1", + "bitflags 2.3.1", "log", "serde", "serde_json", @@ -5537,7 +5530,7 @@ version = "2.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e2812e0cdfffb892c654555b2f1b8c84a035b4c56eb1646cb3eb5a9d8164d8e" dependencies = [ - "aes-gcm 0.10.1", + "aes-gcm 0.10.2", "brotli", "ctor", "dunce", @@ -5565,12 +5558,12 @@ dependencies = [ [[package]] name = "tauri-winres" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b7a78dc04f75fb5ab815e66ac561c81e92a968a40f29e7c21afd152d694fad8" +checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb" dependencies = [ - "toml 0.5.11", - "version_check", + "embed-resource", + "toml", ] [[package]] @@ -5608,15 +5601,6 @@ dependencies = [ "utf-8", ] -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - [[package]] name = "thin-slice" version = "0.1.1" @@ -5677,9 +5661,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" dependencies = [ "itoa 1.0.6", "libc", @@ -5691,15 +5675,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" dependencies = [ "time-core", ] @@ -5713,7 +5697,7 @@ dependencies = [ "ascii", "chunked_transfer", "log", - "time 0.3.20", + "time 0.3.21", "url", ] @@ -5746,9 +5730,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" dependencies = [ "autocfg", "bytes 1.4.0", @@ -5757,7 +5741,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "socket2", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -5793,9 +5777,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -5834,9 +5818,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes 1.4.0", "futures-core", @@ -5848,18 +5832,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "toml" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" dependencies = [ "serde", "serde_spanned", @@ -5869,18 +5844,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ "indexmap", "serde", @@ -5909,20 +5884,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -5941,9 +5916,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ "matchers", "nu-ansi-term", @@ -6044,9 +6019,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-normalization" @@ -6063,12 +6038,6 @@ version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - [[package]] name = "unicode_categories" version = "0.1.1" @@ -6077,9 +6046,9 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ "generic-array", "subtle", @@ -6087,9 +6056,9 @@ dependencies = [ [[package]] name = "universal-hash" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3160b73c9a19f7e2939a2fdad446c57c1bbbbf4d919d3213ff1267a580d8b5" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", "subtle", @@ -6133,9 +6102,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "1.3.0" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" +checksum = "345444e32442451b267fc254ae85a209c64be56d2890e601a0c37ff0c3c5ecd2" dependencies = [ "getrandom 0.2.9", ] @@ -6174,6 +6143,26 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "wait-timeout" version = "0.2.0" @@ -6229,9 +6218,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -6239,24 +6228,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" dependencies = [ "cfg-if", "js-sys", @@ -6266,9 +6255,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6276,22 +6265,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "wasm-streams" @@ -6308,9 +6297,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" dependencies = [ "js-sys", "wasm-bindgen", @@ -6816,9 +6805,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.1" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" dependencies = [ "memchr", ] @@ -6832,6 +6821,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "winreg" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a1a57ff50e9b408431e8f97d5456f2807f8eb2a2cd79b06068fc87f8ecf189" +dependencies = [ + "cfg-if", + "winapi", +] + [[package]] name = "wry" version = "0.28.3" @@ -6934,11 +6933,21 @@ dependencies = [ "libc", ] +[[package]] +name = "xdg-home" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" +dependencies = [ + "nix 0.26.2", + "winapi", +] + [[package]] name = "zbus" -version = "3.11.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dc29e76f558b2cb94190e8605ecfe77dd40f5df8c072951714b4b71a97f5848" +checksum = "29242fa5ec5693629ae74d6eb1f69622a9511f600986d6d9779bccf36ac316e3" dependencies = [ "async-broadcast", "async-executor", @@ -6950,7 +6959,6 @@ dependencies = [ "async-trait", "byteorder", "derivative", - "dirs", "enumflags2", "event-listener", "futures-core", @@ -6968,6 +6976,7 @@ dependencies = [ "tracing", "uds_windows", "winapi", + "xdg-home", "zbus_macros", "zbus_names", "zvariant", @@ -6975,9 +6984,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.11.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62a80fd82c011cd08459eaaf1fd83d3090c1b61e6d5284360074a7475af3a85d" +checksum = "537793e26e9af85f774801dc52c6f6292352b2b517c5cf0449ffd3735732a53a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -6989,9 +6998,9 @@ dependencies = [ [[package]] name = "zbus_names" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34f314916bd89bdb9934154627fab152f4f28acdda03e7c4c68181b214fe7e3" +checksum = "82441e6033be0a741157a72951a3e4957d519698f3a824439cc131c5ba77ac2a" dependencies = [ "serde", "static_assertions", @@ -7020,9 +7029,9 @@ dependencies = [ [[package]] name = "zip" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e92305c174683d78035cbf1b70e18db6329cc0f1b9cae0a52ca90bf5bfe7125" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" dependencies = [ "byteorder", "crc32fast", @@ -7031,9 +7040,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe4914a985446d6fd287019b5fceccce38303d71407d9e6e711d44954a05d8" +checksum = "5cb36cd95352132911c9c99fdcc1635de5c2c139bd34cbcf6dfb8350ee8ff6a7" dependencies = [ "byteorder", "enumflags2", @@ -7045,9 +7054,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34c20260af4b28b3275d6676c7e2a6be0d4332e8e0aba4616d34007fd84e462a" +checksum = "9b34951e1ac64f3a1443fe7181256b9ed6a811a1631917566c3d5ca718d8cf33" dependencies = [ "proc-macro-crate", "proc-macro2", diff --git a/examples/api/src-tauri/src/lib.rs b/examples/api/src-tauri/src/lib.rs index 2509c935..6922352e 100644 --- a/examples/api/src-tauri/src/lib.rs +++ b/examples/api/src-tauri/src/lib.rs @@ -55,7 +55,7 @@ pub fn run() { #[cfg(desktop)] { window_builder = window_builder - .user_agent("Tauri API") + .user_agent(&format!("Tauri API - {}", std::env::consts::OS)) .title("Tauri API Validation") .inner_size(1000., 800.) .min_inner_size(600., 400.) @@ -70,6 +70,11 @@ pub fn run() { .decorations(false); } + #[cfg(target_os = "macos")] + { + window_builder = window_builder.transparent(true); + } + let window = window_builder.build().unwrap(); #[cfg(debug_assertions)] diff --git a/examples/api/src/views/Window.svelte b/examples/api/src/views/Window.svelte index 2d4a8c61..c8c1a20b 100644 --- a/examples/api/src/views/Window.svelte +++ b/examples/api/src/views/Window.svelte @@ -6,6 +6,8 @@ UserAttentionType, PhysicalSize, PhysicalPosition, + Effect, + EffectState, } from "@tauri-apps/plugin-window"; import { open as openDialog } from "@tauri-apps/plugin-dialog"; import { open } from "@tauri-apps/plugin-shell"; @@ -57,7 +59,20 @@ "rowResize", ]; + const windowsEffects = ["mica", "blur", "acrylic"]; + const isWindows = navigator.appVersion.includes("windows"); + const isMacOS = navigator.appVersion.includes("macos"); + let effectOptions = isWindows + ? windowsEffects + : Object.keys(Effect) + .map((effect) => Effect[effect]) + .filter((e) => !windowsEffects.includes(e)); + const effectStateOptions = Object.keys(EffectState).map( + (state) => EffectState[state] + ); + export let onMessage; + const mainEl = document.querySelector("main"); let newWindowLabel; @@ -91,6 +106,12 @@ let cursorIgnoreEvents = false; let windowTitle = "Awesome Tauri Example!"; + let effects = []; + let selectedEffect; + let effectState; + let effectRadius; + let effectR, effectG, effectB, effectA; + function openUrl() { open(urlValue); } @@ -172,6 +193,38 @@ await windowMap[selectedWindow].requestUserAttention(null); } + async function addEffect() { + if (!effects.includes(selectedEffect)) { + effects = [...effects, selectedEffect]; + } + + const payload = { + effects, + state: effectState, + radius: effectRadius, + }; + if ( + Number.isInteger(effectR) && + Number.isInteger(effectG) && + Number.isInteger(effectB) && + Number.isInteger(effectA) + ) { + payload.color = [effectR, effectG, effectB, effectA]; + } + + mainEl.classList.remove("bg-primary"); + mainEl.classList.remove("dark:bg-darkPrimary"); + await windowMap[selectedWindow].clearEffects(); + await windowMap[selectedWindow].setEffects(payload); + } + + async function clearEffects() { + effects = []; + await windowMap[selectedWindow].clearEffects(); + mainEl.classList.add("bg-primary"); + mainEl.classList.add("dark:bg-darkPrimary"); + } + $: { windowMap[selectedWindow]; loadWindowPosition(); @@ -455,5 +508,88 @@ + +
+ + {#if isWindows || isMacOS} +
+
+ + + + + +
+ +
+ +
+ +
+ +
+ +
+
+ Applied effects: {effects.length ? effects.join(",") : "None"} +
+ + +
+
+ {/if} {/if} diff --git a/plugins/app/README.md b/plugins/app/README.md index 96625b18..34d44e56 100644 --- a/plugins/app/README.md +++ b/plugins/app/README.md @@ -1,4 +1,4 @@ -# App +![plugin-app](banner.png) This plugin provides APIs to read application metadata and macOS app visibility functions. diff --git a/plugins/app/banner.png b/plugins/app/banner.png new file mode 100644 index 00000000..752d36da Binary files /dev/null and b/plugins/app/banner.png differ diff --git a/plugins/cli/README.md b/plugins/cli/README.md index 5de6c9e8..c0bd1ae4 100644 --- a/plugins/cli/README.md +++ b/plugins/cli/README.md @@ -1,4 +1,4 @@ -# CLI +![plugin-cli](banner.png) Parse arguments from your Command Line Interface. diff --git a/plugins/cli/banner.png b/plugins/cli/banner.png new file mode 100644 index 00000000..2d1f2cd9 Binary files /dev/null and b/plugins/cli/banner.png differ diff --git a/plugins/clipboard-manager/README.md b/plugins/clipboard-manager/README.md index 9767c310..3bdc6f73 100644 --- a/plugins/clipboard-manager/README.md +++ b/plugins/clipboard-manager/README.md @@ -1,4 +1,4 @@ -# Clipboard Manager +![plugin-clipboard-manager](banner.png) Read and write to the system clipboard. diff --git a/plugins/clipboard-manager/banner.png b/plugins/clipboard-manager/banner.png new file mode 100644 index 00000000..5d304708 Binary files /dev/null and b/plugins/clipboard-manager/banner.png differ diff --git a/plugins/dialog/README.md b/plugins/dialog/README.md index 8e06ed2b..2c5638fc 100644 --- a/plugins/dialog/README.md +++ b/plugins/dialog/README.md @@ -1,4 +1,4 @@ -# Dialog +![plugin-dialog](banner.png) Native system dialogs for opening and saving files along with message dialogs. diff --git a/plugins/dialog/banner.png b/plugins/dialog/banner.png new file mode 100644 index 00000000..88be34e4 Binary files /dev/null and b/plugins/dialog/banner.png differ diff --git a/plugins/fs/README.md b/plugins/fs/README.md index badc305d..24501a34 100644 --- a/plugins/fs/README.md +++ b/plugins/fs/README.md @@ -1,4 +1,4 @@ -# File System +![plugin-fs](banner.png) Access the file system. diff --git a/plugins/fs/banner.png b/plugins/fs/banner.png new file mode 100644 index 00000000..767a1fe2 Binary files /dev/null and b/plugins/fs/banner.png differ diff --git a/plugins/global-shortcut/README.md b/plugins/global-shortcut/README.md index 7c151730..7c5097ce 100644 --- a/plugins/global-shortcut/README.md +++ b/plugins/global-shortcut/README.md @@ -1,4 +1,4 @@ -# Global Shortcut +![plugin-global-shortcut](banner.png) Register global shortcuts. diff --git a/plugins/global-shortcut/banner.png b/plugins/global-shortcut/banner.png new file mode 100644 index 00000000..d74203a5 Binary files /dev/null and b/plugins/global-shortcut/banner.png differ diff --git a/plugins/http/README.md b/plugins/http/README.md index 440e5a18..54532243 100644 --- a/plugins/http/README.md +++ b/plugins/http/README.md @@ -1,4 +1,4 @@ -# HTTP +![plugin-http](banner.png) Access the HTTP client written in Rust. diff --git a/plugins/http/banner.png b/plugins/http/banner.png new file mode 100644 index 00000000..121741e5 Binary files /dev/null and b/plugins/http/banner.png differ diff --git a/plugins/notification/README.md b/plugins/notification/README.md index 08f9dfd3..95ca72b3 100644 --- a/plugins/notification/README.md +++ b/plugins/notification/README.md @@ -1,4 +1,4 @@ -# Notification +![plugin-notification](banner.png) Send message notifications (brief auto-expiring OS window element) to your user. Can also be used with the Notification Web API. diff --git a/plugins/notification/banner.png b/plugins/notification/banner.png new file mode 100644 index 00000000..f6460f3d Binary files /dev/null and b/plugins/notification/banner.png differ diff --git a/plugins/notification/src/desktop.rs b/plugins/notification/src/desktop.rs index 401f6569..897790f0 100644 --- a/plugins/notification/src/desktop.rs +++ b/plugins/notification/src/desktop.rs @@ -184,9 +184,6 @@ mod imp { { notification.app_id(&self.identifier); } - - // will be parsed as a `::winrt_notification::Sound` - notification.sound_name("Default"); } #[cfg(target_os = "macos")] { diff --git a/plugins/os/Cargo.toml b/plugins/os/Cargo.toml index ef2f8a6d..e2280410 100644 --- a/plugins/os/Cargo.toml +++ b/plugins/os/Cargo.toml @@ -15,3 +15,4 @@ thiserror = { workspace = true } os_info = "3" sys-locale = "0.3" gethostname = "0.4" +serialize-to-javascript = "=0.1.1" diff --git a/plugins/os/README.md b/plugins/os/README.md index 27ed03ad..f7ce7954 100644 --- a/plugins/os/README.md +++ b/plugins/os/README.md @@ -1,4 +1,4 @@ -# Operating System +![plugin-os](banner.png) Read information about the operating system. diff --git a/plugins/os/banner.png b/plugins/os/banner.png new file mode 100644 index 00000000..08b4fd8c Binary files /dev/null and b/plugins/os/banner.png differ diff --git a/plugins/os/guest-js/index.ts b/plugins/os/guest-js/index.ts index 2b94895d..5c85b579 100644 --- a/plugins/os/guest-js/index.ts +++ b/plugins/os/guest-js/index.ts @@ -11,6 +11,9 @@ declare global { interface Window { __TAURI_INVOKE__: (cmd: string, args?: unknown) => Promise; + __TAURI__: { + os: { __eol: string }; + }; } } @@ -41,18 +44,16 @@ type Arch = | "s390x" | "sparc64"; -function isWindows(): boolean { - return navigator.appVersion.includes("Win"); -} - /** - * The operating system-specific end-of-line marker. + * Returns the operating system-specific end-of-line marker. * - `\n` on POSIX * - `\r\n` on Windows * * @since 2.0.0 * */ -const EOL = isWindows() ? "\r\n" : "\n"; +function eol() { + return window.__TAURI__.os.__eol; +} /** * Returns a string describing the specific operating system in use. @@ -174,7 +175,7 @@ async function hostname(): Promise { } export { - EOL, + eol, platform, family, version, diff --git a/plugins/os/src/api-iife.js b/plugins/os/src/api-iife.js index 382e6d15..98ed20a7 100644 --- a/plugins/os/src/api-iife.js +++ b/plugins/os/src/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_OS__=function(n){"use strict";const _=navigator.appVersion.includes("Win")?"\r\n":"\n";return n.EOL=_,n.arch=async function(){return window.__TAURI_INVOKE__("plugin:os|arch")},n.exeExtension=async function(){return window.__TAURI_INVOKE__("plugin:os|exe_extension")},n.family=async function(){return window.__TAURI_INVOKE__("plugin:os|family")},n.hostname=async function(){return window.__TAURI_INVOKE__("plugin:os|hostname")},n.locale=async function(){return window.__TAURI_INVOKE__("plugin:os|locale")},n.platform=async function(){return window.__TAURI_INVOKE__("plugin:os|platform")},n.type=async function(){return window.__TAURI_INVOKE__("plugin:os|os_type")},n.version=async function(){return window.__TAURI_INVOKE__("plugin:os|version")},n}({});Object.defineProperty(window.__TAURI__,"os",{value:__TAURI_OS__})} +if("__TAURI__"in window){var __TAURI_OS__=function(n){"use strict";return n.arch=async function(){return window.__TAURI_INVOKE__("plugin:os|arch")},n.eol=function(){return window.__TAURI__.os.__eol},n.exeExtension=async function(){return window.__TAURI_INVOKE__("plugin:os|exe_extension")},n.family=async function(){return window.__TAURI_INVOKE__("plugin:os|family")},n.hostname=async function(){return window.__TAURI_INVOKE__("plugin:os|hostname")},n.locale=async function(){return window.__TAURI_INVOKE__("plugin:os|locale")},n.platform=async function(){return window.__TAURI_INVOKE__("plugin:os|platform")},n.type=async function(){return window.__TAURI_INVOKE__("plugin:os|os_type")},n.version=async function(){return window.__TAURI_INVOKE__("plugin:os|version")},n}({});Object.defineProperty(window.__TAURI__,"os",{value:__TAURI_OS__})} diff --git a/plugins/os/src/init.js b/plugins/os/src/init.js new file mode 100644 index 00000000..33e42748 --- /dev/null +++ b/plugins/os/src/init.js @@ -0,0 +1,8 @@ +// Copyright 2019-2023 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +__RAW_global_os_api__; + +// eslint-disable-next-line +window.__TAURI__.os.__eol = __TEMPLATE_eol__; diff --git a/plugins/os/src/lib.rs b/plugins/os/src/lib.rs index ccbbdfef..c66580d1 100644 --- a/plugins/os/src/lib.rs +++ b/plugins/os/src/lib.rs @@ -5,6 +5,7 @@ use std::fmt::Display; pub use os_info::Version; +use serialize_to_javascript::{default_template, DefaultTemplate, Template}; use tauri::{ plugin::{Builder, TauriPlugin}, Runtime, @@ -90,9 +91,28 @@ pub fn hostname() -> String { gethostname::gethostname().to_string_lossy().to_string() } +#[derive(Template)] +#[default_template("./init.js")] +struct InitJavascript { + #[raw] + global_os_api: &'static str, + eol: &'static str, +} + pub fn init() -> TauriPlugin { + let init_js = InitJavascript { + global_os_api: include_str!("api-iife.js"), + #[cfg(windows)] + eol: "\r\n", + #[cfg(not(windows))] + eol: "\n", + } + .render_default(&Default::default()) + // this will never fail with the above global_os_api eol values + .unwrap(); + Builder::new("os") - .js_init_script(include_str!("api-iife.js").to_string()) + .js_init_script(init_js.to_string()) .invoke_handler(tauri::generate_handler![ commands::platform, commands::version, diff --git a/plugins/process/README.md b/plugins/process/README.md index fad3e821..10b0a111 100644 --- a/plugins/process/README.md +++ b/plugins/process/README.md @@ -1,4 +1,4 @@ -# Process +![plugin-process](banner.png) This plugin provides APIs to access the current process. To spawn child processes, see the [`shell`](https://github.com/tauri-apps/tauri-plugin-shell) plugin. diff --git a/plugins/process/banner.png b/plugins/process/banner.png new file mode 100644 index 00000000..7634d6e4 Binary files /dev/null and b/plugins/process/banner.png differ diff --git a/plugins/shell/README.md b/plugins/shell/README.md index 4d06a1e9..8389a687 100644 --- a/plugins/shell/README.md +++ b/plugins/shell/README.md @@ -1,4 +1,4 @@ -# Shell +![plugin-shell](banner.png) Access the system shell. Allows you to spawn child processes and manage files and URLs using their default application. diff --git a/plugins/shell/banner.png b/plugins/shell/banner.png new file mode 100644 index 00000000..cbf74818 Binary files /dev/null and b/plugins/shell/banner.png differ diff --git a/plugins/updater/README.md b/plugins/updater/README.md index eb6f3642..0e47281f 100644 --- a/plugins/updater/README.md +++ b/plugins/updater/README.md @@ -1,4 +1,4 @@ -# Updater +![plugin-updater](banner.png) In-app updates for Tauri applications. diff --git a/plugins/updater/banner.png b/plugins/updater/banner.png new file mode 100644 index 00000000..439110d8 Binary files /dev/null and b/plugins/updater/banner.png differ diff --git a/plugins/window/README.md b/plugins/window/README.md index 14e7c8a8..03dcc509 100644 --- a/plugins/window/README.md +++ b/plugins/window/README.md @@ -1,4 +1,4 @@ -# Window +![plugin-window](banner.png) Interact with the Tauri window. diff --git a/plugins/window/banner.png b/plugins/window/banner.png new file mode 100644 index 00000000..ea52673a Binary files /dev/null and b/plugins/window/banner.png differ diff --git a/plugins/window/guest-js/index.ts b/plugins/window/guest-js/index.ts index 518383b2..d1aa0c1c 100644 --- a/plugins/window/guest-js/index.ts +++ b/plugins/window/guest-js/index.ts @@ -563,6 +563,24 @@ class WindowManager extends WebviewWindowHandle { }); } + /** + * Gets the window's current focus state. + * @example + * ```typescript + * import { appWindow } from '@tauri-apps/plugin-window'; + * const focused = await appWindow.isFocused(); + * ``` + * + * @returns Whether the window is focused or not. + * + * @since 2.0.0 + * */ + async isFocused(): Promise { + return window.__TAURI_INVOKE__("plugin:window|is_focused", { + label: this.label, + }); + } + /** * Gets the window's current decorated state. * @example @@ -950,6 +968,30 @@ class WindowManager extends WebviewWindowHandle { }); } + /** + * Set window effects. + * + * @since 2.0 + */ + async setEffects(effects: Effects): Promise { + return window.__TAURI_INVOKE__("plugin:window|set_effects", { + label: this.label, + value: effects, + }); + } + + /** + * Clear any applied effects if possible. + * + * @since 2.0 + */ + async clearEffects(): Promise { + return window.__TAURI_INVOKE__("plugin:window|set_effects", { + label: this.label, + value: null, + }); + } + /** * Whether the window should always be on top of other windows. * @example @@ -1755,6 +1797,27 @@ class WebviewWindow extends WindowManager { } return null; } + + /** + * Gets the focused window. + * @example + * ```typescript + * import { WebviewWindow } from '@tauri-apps/plugin-window'; + * const focusedWindow = WebviewWindow.getFocusedWindow(); + * ``` + * + * @returns The WebviewWindow instance to communicate with the webview or `undefined` if there is not any focused window. + * + * @since 1.4 + */ + static async getFocusedWindow(): Promise { + for (const w of getAll()) { + if (await w.isFocused()) { + return w; + } + } + return null; + } } /** The WebviewWindow for the current window. */ @@ -1777,6 +1840,174 @@ if ("__TAURI_METADATA__" in window) { }); } +/** + * an array RGBA colors. Each value has minimum of 0 and maximum of 255. + * + * @since 2.0 + */ +type Color = [number, number, number, number]; + +/** + * Platform-specific window effects + * + * @since 2.0 + */ +enum Effect { + /** + * A default material appropriate for the view's effectiveAppearance. **macOS 10.14-** + * + * @deprecated since macOS 10.14. You should instead choose an appropriate semantic material. + */ + AppearanceBased = "appearanceBased", + /** + * **macOS 10.14-** + * + * @deprecated since macOS 10.14. Use a semantic material instead. + */ + Light = "light", + /** + * **macOS 10.14-** + * + * @deprecated since macOS 10.14. Use a semantic material instead. + */ + Dark = "dark", + /** + * **macOS 10.14-** + * + * @deprecated since macOS 10.14. Use a semantic material instead. + */ + MediumLight = "mediumLight", + /** + * **macOS 10.14-** + * + * @deprecated since macOS 10.14. Use a semantic material instead. + */ + UltraDark = "ultraDark", + /** + * **macOS 10.10+** + */ + Titlebar = "titlebar", + /** + * **macOS 10.10+** + */ + Selection = "selection", + /** + * **macOS 10.11+** + */ + Menu = "menu", + /** + * **macOS 10.11+** + */ + Popover = "popover", + /** + * **macOS 10.11+** + */ + Sidebar = "sidebar", + /** + * **macOS 10.14+** + */ + HeaderView = "headerView", + /** + * **macOS 10.14+** + */ + Sheet = "sheet", + /** + * **macOS 10.14+** + */ + WindowBackground = "windowBackground", + /** + * **macOS 10.14+** + */ + HudWindow = "hudWindow", + /** + * **macOS 10.14+** + */ + FullScreenUI = "fullScreenUI", + /** + * **macOS 10.14+** + */ + Tooltip = "tooltip", + /** + * **macOS 10.14+** + */ + ContentBackground = "contentBackground", + /** + * **macOS 10.14+** + */ + UnderWindowBackground = "underWindowBackground", + /** + * **macOS 10.14+** + */ + UnderPageBackground = "underPageBackground", + /** + * **Windows 11 Only** + */ + Mica = "mica", + /** + * **Windows 7/10/11(22H1) Only** + * + * ## Notes + * + * This effect has bad performance when resizing/dragging the window on Windows 11 build 22621. + */ + Blur = "blur", + /** + * **Windows 10/11** + * + * ## Notes + * + * This effect has bad performance when resizing/dragging the window on Windows 10 v1903+ and Windows 11 build 22000. + */ + Acrylic = "acrylic", +} + +/** + * Window effect state **macOS only** + * + * @see https://developer.apple.com/documentation/appkit/nsvisualeffectview/state + * + * @since 2.0 + */ +enum EffectState { + /** + * Make window effect state follow the window's active state **macOS only** + */ + FollowsWindowActiveState = "followsWindowActiveState", + /** + * Make window effect state always active **macOS only** + */ + Active = "active", + /** + * Make window effect state always inactive **macOS only** + */ + Inactive = "inactive", +} + +/** The window effects configuration object + * + * @since 2.0 + */ +interface Effects { + /** + * List of Window effects to apply to the Window. + * Conflicting effects will apply the first one and ignore the rest. + */ + effects: Effect[]; + /** + * Window effect state **macOS Only** + */ + state?: EffectState; + /** + * Window effect corner radius **macOS Only** + */ + radius?: number; + /** + * Window effect color. Affects {@link Effects.Blur} and {@link Effects.Acrylic} only + * on Windows 10 v1903+. Doesn't have any effect on Windows 7 or Windows 11. + */ + color?: Color; +} + /** * Configuration for the window to create. * @@ -1884,6 +2115,14 @@ interface WindowOptions { * The user agent for the webview. */ userAgent?: string; + /** + * Whether or not the webview should be launched in incognito mode. + * + * #### Platform-specific + * + * - **Android:** Unsupported. + */ + incognito?: boolean; } function mapMonitor(m: Monitor | null): Monitor | null { @@ -1968,6 +2207,8 @@ export { LogicalPosition, PhysicalPosition, UserAttentionType, + Effect, + EffectState, currentMonitor, primaryMonitor, availableMonitors, @@ -1980,4 +2221,5 @@ export type { ScaleFactorChanged, FileDropEvent, WindowOptions, + Color, }; diff --git a/plugins/window/src/api-iife.js b/plugins/window/src/api-iife.js index 2079c27b..ed7f458d 100644 --- a/plugins/window/src/api-iife.js +++ b/plugins/window/src/api-iife.js @@ -1 +1 @@ -if("__TAURI__"in window){var __TAURI_WINDOW__=function(e){"use strict";var i=Object.defineProperty,n=(e,n)=>{for(var t in n)i(e,t,{get:n[t],enumerable:!0})},t=(e,i,n)=>{if(!i.has(e))throw TypeError("Cannot "+n)},l=(e,i,n)=>(t(e,i,"read from private field"),n?n.call(e):i.get(e)),a=(e,i,n,l)=>(t(e,i,"write to private field"),l?l.call(e,n):i.set(e,n),n);function s(e,i=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],t=`_${n}`;return Object.defineProperty(window,t,{value:n=>(i&&Reflect.deleteProperty(window,t),e?.(n)),writable:!1,configurable:!0}),n}n({},{Channel:()=>o,PluginListener:()=>_,addPluginListener:()=>w,convertFileSrc:()=>c,invoke:()=>u,transformCallback:()=>s});var r,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,i,n)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,n)})(this,r,(()=>{})),this.id=s((e=>{l(this,r).call(this,e)}))}set onmessage(e){a(this,r,e)}get onmessage(){return l(this,r)}toJSON(){return`__CHANNEL__:${this.id}`}};r=new WeakMap;var _=class{constructor(e,i,n){this.plugin=e,this.event=i,this.channelId=n}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function w(e,i,n){let t=new o;return t.onmessage=n,u(`plugin:${e}|register_listener`,{event:i,handler:t}).then((()=>new _(e,i,t.id)))}async function u(e,i={}){return new Promise(((n,t)=>{let l=s((e=>{n(e),Reflect.deleteProperty(window,`_${a}`)}),!0),a=s((e=>{t(e),Reflect.deleteProperty(window,`_${l}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:l,error:a,...i})}))}function c(e,i="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${i}.localhost/${n}`:`${i}://localhost/${n}`}n({},{TauriEvent:()=>h,emit:()=>b,listen:()=>y,once:()=>I});var d,h=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(h||{});async function p(e,i){await u("plugin:event|unlisten",{event:e,eventId:i})}async function y(e,i,n){return u("plugin:event|listen",{event:e,windowLabel:n?.target,handler:s(i)}).then((i=>async()=>p(e,i)))}async function I(e,i,n){return y(e,(n=>{i(n),p(e,n.id).catch((()=>{}))}),n)}async function b(e,i,n){await u("plugin:event|emit",{event:e,windowLabel:n?.target,payload:i})}class g{constructor(e,i){this.type="Logical",this.width=e,this.height=i}}class E{constructor(e,i){this.type="Physical",this.width=e,this.height=i}toLogical(e){return new g(this.width/e,this.height/e)}}class A{constructor(e,i){this.type="Logical",this.x=e,this.y=i}}class O{constructor(e,i){this.type="Physical",this.x=e,this.y=i}toLogical(e){return new A(this.x/e,this.y/e)}}function T(){return window.__TAURI_METADATA__.__windows.map((e=>new U(e.label,{skip:!0})))}e.UserAttentionType=void 0,(d=e.UserAttentionType||(e.UserAttentionType={}))[d.Critical=1]="Critical",d[d.Informational=2]="Informational";const R=["tauri://created","tauri://error"];class N{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,i){return this._handleTauriEvent(e,i)?Promise.resolve((()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)})):y(e,i,{target:this.label})}async once(e,i){return this._handleTauriEvent(e,i)?Promise.resolve((()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)})):I(e,i,{target:this.label})}async emit(e,i){if(R.includes(e)){for(const n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:i});return Promise.resolve()}return b(e,i,{target:this.label})}_handleTauriEvent(e,i){return!!R.includes(e)&&(e in this.listeners?this.listeners[e].push(i):this.listeners[e]=[i],!0)}}class m extends N{async scaleFactor(){return window.__TAURI_INVOKE__("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return window.__TAURI_INVOKE__("plugin:window|inner_position",{label:this.label}).then((({x:e,y:i})=>new O(e,i)))}async outerPosition(){return window.__TAURI_INVOKE__("plugin:window|outer_position",{label:this.label}).then((({x:e,y:i})=>new O(e,i)))}async innerSize(){return window.__TAURI_INVOKE__("plugin:window|inner_size",{label:this.label}).then((({width:e,height:i})=>new E(e,i)))}async outerSize(){return window.__TAURI_INVOKE__("plugin:window|outer_size",{label:this.label}).then((({width:e,height:i})=>new E(e,i)))}async isFullscreen(){return window.__TAURI_INVOKE__("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return window.__TAURI_INVOKE__("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return window.__TAURI_INVOKE__("plugin:window|is_maximized",{label:this.label})}async isDecorated(){return window.__TAURI_INVOKE__("plugin:window|is_decorated",{label:this.label})}async isResizable(){return window.__TAURI_INVOKE__("plugin:window|is_resizable",{label:this.label})}async isVisible(){return window.__TAURI_INVOKE__("plugin:window|is_visible",{label:this.label})}async title(){return window.__TAURI_INVOKE__("plugin:window|title",{label:this.label})}async theme(){return window.__TAURI_INVOKE__("plugin:window|theme",{label:this.label})}async center(){return window.__TAURI_INVOKE__("plugin:window|center",{label:this.label})}async requestUserAttention(i){let n=null;return i&&(n=i===e.UserAttentionType.Critical?{type:"Critical"}:{type:"Informational"}),window.__TAURI_INVOKE__("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return window.__TAURI_INVOKE__("plugin:window|set_resizable",{label:this.label,value:e})}async setTitle(e){return window.__TAURI_INVOKE__("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return window.__TAURI_INVOKE__("plugin:window|maximize",{label:this.label})}async unmaximize(){return window.__TAURI_INVOKE__("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return window.__TAURI_INVOKE__("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return window.__TAURI_INVOKE__("plugin:window|minimize",{label:this.label})}async unminimize(){return window.__TAURI_INVOKE__("plugin:window|unminimize",{label:this.label})}async show(){return window.__TAURI_INVOKE__("plugin:window|show",{label:this.label})}async hide(){return window.__TAURI_INVOKE__("plugin:window|hide",{label:this.label})}async close(){return window.__TAURI_INVOKE__("plugin:window|close",{label:this.label})}async setDecorations(e){return window.__TAURI_INVOKE__("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return window.__TAURI_INVOKE__("plugin:window|set_shadow",{label:this.label,value:e})}async setAlwaysOnTop(e){return window.__TAURI_INVOKE__("plugin:window|set_always_on_top",{label:this.label,value:e})}async setContentProtected(e){return window.__TAURI_INVOKE__("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return window.__TAURI_INVOKE__("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return window.__TAURI_INVOKE__("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return window.__TAURI_INVOKE__("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return window.__TAURI_INVOKE__("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return window.__TAURI_INVOKE__("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return window.__TAURI_INVOKE__("plugin:window|set_focus",{label:this.label})}async setIcon(e){return window.__TAURI_INVOKE__("plugin:window|set_icon",{label:this.label,value:"string"==typeof e?e:Array.from(e)})}async setSkipTaskbar(e){return window.__TAURI_INVOKE__("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return window.__TAURI_INVOKE__("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return window.__TAURI_INVOKE__("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return window.__TAURI_INVOKE__("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return window.__TAURI_INVOKE__("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return window.__TAURI_INVOKE__("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return window.__TAURI_INVOKE__("plugin:window|start_dragging",{label:this.label})}async onResized(e){return this.listen(h.WINDOW_RESIZED,(i=>{i.payload=D(i.payload),e(i)}))}async onMoved(e){return this.listen(h.WINDOW_MOVED,(i=>{i.payload=W(i.payload),e(i)}))}async onCloseRequested(e){return this.listen(h.WINDOW_CLOSE_REQUESTED,(i=>{const n=new v(i);Promise.resolve(e(n)).then((()=>{if(!n.isPreventDefault())return this.close()}))}))}async onFocusChanged(e){const i=await this.listen(h.WINDOW_FOCUS,(i=>{e({...i,payload:!0})})),n=await this.listen(h.WINDOW_BLUR,(i=>{e({...i,payload:!1})}));return()=>{i(),n()}}async onScaleChanged(e){return this.listen(h.WINDOW_SCALE_FACTOR_CHANGED,e)}async onMenuClicked(e){return this.listen(h.MENU,e)}async onFileDropEvent(e){const i=await this.listen(h.WINDOW_FILE_DROP,(i=>{e({...i,payload:{type:"drop",paths:i.payload}})})),n=await this.listen(h.WINDOW_FILE_DROP_HOVER,(i=>{e({...i,payload:{type:"hover",paths:i.payload}})})),t=await this.listen(h.WINDOW_FILE_DROP_CANCELLED,(i=>{e({...i,payload:{type:"cancel"}})}));return()=>{i(),n(),t()}}async onThemeChanged(e){return this.listen(h.WINDOW_THEME_CHANGED,e)}}class v{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}class U extends m{constructor(e,i={}){super(e),(null==i?void 0:i.skip)||window.__TAURI_INVOKE__("plugin:window|create",{options:{...i,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){return T().some((i=>i.label===e))?new U(e,{skip:!0}):null}}function f(e){return null===e?null:{name:e.name,scaleFactor:e.scaleFactor,position:W(e.position),size:D(e.size)}}function W(e){return new O(e.x,e.y)}function D(e){return new E(e.width,e.height)}return e.appWindow=void 0,"__TAURI_METADATA__"in window?e.appWindow=new U(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),e.appWindow=new U("main",{skip:!0})),e.CloseRequestedEvent=v,e.LogicalPosition=A,e.LogicalSize=g,e.PhysicalPosition=O,e.PhysicalSize=E,e.WebviewWindow=U,e.WebviewWindowHandle=N,e.WindowManager=m,e.availableMonitors=async function(){return window.__TAURI_INVOKE__("plugin:window|available_monitors").then((e=>e.map(f)))},e.currentMonitor=async function(){return window.__TAURI_INVOKE__("plugin:window|current_monitor").then(f)},e.getAll=T,e.getCurrent=function(){return new U(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},e.primaryMonitor=async function(){return window.__TAURI_INVOKE__("plugin:window|primary_monitor").then(f)},e}({});Object.defineProperty(window.__TAURI__,"window",{value:__TAURI_WINDOW__})} +if("__TAURI__"in window){var __TAURI_WINDOW__=function(e){"use strict";var i=Object.defineProperty,n=(e,n)=>{for(var t in n)i(e,t,{get:n[t],enumerable:!0})},t=(e,i,n)=>{if(!i.has(e))throw TypeError("Cannot "+n)},a=(e,i,n)=>(t(e,i,"read from private field"),n?n.call(e):i.get(e)),l=(e,i,n,a)=>(t(e,i,"write to private field"),a?a.call(e,n):i.set(e,n),n);function s(e,i=!1){let n=window.crypto.getRandomValues(new Uint32Array(1))[0],t=`_${n}`;return Object.defineProperty(window,t,{value:n=>(i&&Reflect.deleteProperty(window,t),e?.(n)),writable:!1,configurable:!0}),n}n({},{Channel:()=>o,PluginListener:()=>_,addPluginListener:()=>w,convertFileSrc:()=>c,invoke:()=>u,transformCallback:()=>s});var r,o=class{constructor(){this.__TAURI_CHANNEL_MARKER__=!0,((e,i,n)=>{if(i.has(e))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(e):i.set(e,n)})(this,r,(()=>{})),this.id=s((e=>{a(this,r).call(this,e)}))}set onmessage(e){l(this,r,e)}get onmessage(){return a(this,r)}toJSON(){return`__CHANNEL__:${this.id}`}};r=new WeakMap;var _=class{constructor(e,i,n){this.plugin=e,this.event=i,this.channelId=n}async unregister(){return u(`plugin:${this.plugin}|remove_listener`,{event:this.event,channelId:this.channelId})}};async function w(e,i,n){let t=new o;return t.onmessage=n,u(`plugin:${e}|register_listener`,{event:i,handler:t}).then((()=>new _(e,i,t.id)))}async function u(e,i={}){return new Promise(((n,t)=>{let a=s((e=>{n(e),Reflect.deleteProperty(window,`_${l}`)}),!0),l=s((e=>{t(e),Reflect.deleteProperty(window,`_${a}`)}),!0);window.__TAURI_IPC__({cmd:e,callback:a,error:l,...i})}))}function c(e,i="asset"){let n=encodeURIComponent(e);return navigator.userAgent.includes("Windows")?`https://${i}.localhost/${n}`:`${i}://localhost/${n}`}n({},{TauriEvent:()=>h,emit:()=>g,listen:()=>y,once:()=>I});var d,h=(e=>(e.WINDOW_RESIZED="tauri://resize",e.WINDOW_MOVED="tauri://move",e.WINDOW_CLOSE_REQUESTED="tauri://close-requested",e.WINDOW_CREATED="tauri://window-created",e.WINDOW_DESTROYED="tauri://destroyed",e.WINDOW_FOCUS="tauri://focus",e.WINDOW_BLUR="tauri://blur",e.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",e.WINDOW_THEME_CHANGED="tauri://theme-changed",e.WINDOW_FILE_DROP="tauri://file-drop",e.WINDOW_FILE_DROP_HOVER="tauri://file-drop-hover",e.WINDOW_FILE_DROP_CANCELLED="tauri://file-drop-cancelled",e.MENU="tauri://menu",e))(h||{});async function p(e,i){await u("plugin:event|unlisten",{event:e,eventId:i})}async function y(e,i,n){return u("plugin:event|listen",{event:e,windowLabel:n?.target,handler:s(i)}).then((i=>async()=>p(e,i)))}async function I(e,i,n){return y(e,(n=>{i(n),p(e,n.id).catch((()=>{}))}),n)}async function g(e,i,n){await u("plugin:event|emit",{event:e,windowLabel:n?.target,payload:i})}class b{constructor(e,i){this.type="Logical",this.width=e,this.height=i}}class E{constructor(e,i){this.type="Physical",this.width=e,this.height=i}toLogical(e){return new b(this.width/e,this.height/e)}}class A{constructor(e,i){this.type="Logical",this.x=e,this.y=i}}class O{constructor(e,i){this.type="Physical",this.x=e,this.y=i}toLogical(e){return new A(this.x/e,this.y/e)}}function T(){return window.__TAURI_METADATA__.__windows.map((e=>new N(e.label,{skip:!0})))}e.UserAttentionType=void 0,(d=e.UserAttentionType||(e.UserAttentionType={}))[d.Critical=1]="Critical",d[d.Informational=2]="Informational";const f=["tauri://created","tauri://error"];class v{constructor(e){this.label=e,this.listeners=Object.create(null)}async listen(e,i){return this._handleTauriEvent(e,i)?Promise.resolve((()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)})):y(e,i,{target:this.label})}async once(e,i){return this._handleTauriEvent(e,i)?Promise.resolve((()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)})):I(e,i,{target:this.label})}async emit(e,i){if(f.includes(e)){for(const n of this.listeners[e]||[])n({event:e,id:-1,windowLabel:this.label,payload:i});return Promise.resolve()}return g(e,i,{target:this.label})}_handleTauriEvent(e,i){return!!f.includes(e)&&(e in this.listeners?this.listeners[e].push(i):this.listeners[e]=[i],!0)}}class R extends v{async scaleFactor(){return window.__TAURI_INVOKE__("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return window.__TAURI_INVOKE__("plugin:window|inner_position",{label:this.label}).then((({x:e,y:i})=>new O(e,i)))}async outerPosition(){return window.__TAURI_INVOKE__("plugin:window|outer_position",{label:this.label}).then((({x:e,y:i})=>new O(e,i)))}async innerSize(){return window.__TAURI_INVOKE__("plugin:window|inner_size",{label:this.label}).then((({width:e,height:i})=>new E(e,i)))}async outerSize(){return window.__TAURI_INVOKE__("plugin:window|outer_size",{label:this.label}).then((({width:e,height:i})=>new E(e,i)))}async isFullscreen(){return window.__TAURI_INVOKE__("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return window.__TAURI_INVOKE__("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return window.__TAURI_INVOKE__("plugin:window|is_maximized",{label:this.label})}async isFocused(){return window.__TAURI_INVOKE__("plugin:window|is_focused",{label:this.label})}async isDecorated(){return window.__TAURI_INVOKE__("plugin:window|is_decorated",{label:this.label})}async isResizable(){return window.__TAURI_INVOKE__("plugin:window|is_resizable",{label:this.label})}async isVisible(){return window.__TAURI_INVOKE__("plugin:window|is_visible",{label:this.label})}async title(){return window.__TAURI_INVOKE__("plugin:window|title",{label:this.label})}async theme(){return window.__TAURI_INVOKE__("plugin:window|theme",{label:this.label})}async center(){return window.__TAURI_INVOKE__("plugin:window|center",{label:this.label})}async requestUserAttention(i){let n=null;return i&&(n=i===e.UserAttentionType.Critical?{type:"Critical"}:{type:"Informational"}),window.__TAURI_INVOKE__("plugin:window|request_user_attention",{label:this.label,value:n})}async setResizable(e){return window.__TAURI_INVOKE__("plugin:window|set_resizable",{label:this.label,value:e})}async setTitle(e){return window.__TAURI_INVOKE__("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return window.__TAURI_INVOKE__("plugin:window|maximize",{label:this.label})}async unmaximize(){return window.__TAURI_INVOKE__("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return window.__TAURI_INVOKE__("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return window.__TAURI_INVOKE__("plugin:window|minimize",{label:this.label})}async unminimize(){return window.__TAURI_INVOKE__("plugin:window|unminimize",{label:this.label})}async show(){return window.__TAURI_INVOKE__("plugin:window|show",{label:this.label})}async hide(){return window.__TAURI_INVOKE__("plugin:window|hide",{label:this.label})}async close(){return window.__TAURI_INVOKE__("plugin:window|close",{label:this.label})}async setDecorations(e){return window.__TAURI_INVOKE__("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return window.__TAURI_INVOKE__("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return window.__TAURI_INVOKE__("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return window.__TAURI_INVOKE__("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return window.__TAURI_INVOKE__("plugin:window|set_always_on_top",{label:this.label,value:e})}async setContentProtected(e){return window.__TAURI_INVOKE__("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return window.__TAURI_INVOKE__("plugin:window|set_size",{label:this.label,value:{type:e.type,data:{width:e.width,height:e.height}}})}async setMinSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return window.__TAURI_INVOKE__("plugin:window|set_min_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setMaxSize(e){if(e&&"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `size` argument must be either a LogicalSize or a PhysicalSize instance");return window.__TAURI_INVOKE__("plugin:window|set_max_size",{label:this.label,value:e?{type:e.type,data:{width:e.width,height:e.height}}:null})}async setPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return window.__TAURI_INVOKE__("plugin:window|set_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setFullscreen(e){return window.__TAURI_INVOKE__("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return window.__TAURI_INVOKE__("plugin:window|set_focus",{label:this.label})}async setIcon(e){return window.__TAURI_INVOKE__("plugin:window|set_icon",{label:this.label,value:"string"==typeof e?e:Array.from(e)})}async setSkipTaskbar(e){return window.__TAURI_INVOKE__("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return window.__TAURI_INVOKE__("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return window.__TAURI_INVOKE__("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return window.__TAURI_INVOKE__("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setCursorPosition(e){if(!e||"Logical"!==e.type&&"Physical"!==e.type)throw new Error("the `position` argument must be either a LogicalPosition or a PhysicalPosition instance");return window.__TAURI_INVOKE__("plugin:window|set_cursor_position",{label:this.label,value:{type:e.type,data:{x:e.x,y:e.y}}})}async setIgnoreCursorEvents(e){return window.__TAURI_INVOKE__("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return window.__TAURI_INVOKE__("plugin:window|start_dragging",{label:this.label})}async onResized(e){return this.listen(h.WINDOW_RESIZED,(i=>{i.payload=K(i.payload),e(i)}))}async onMoved(e){return this.listen(h.WINDOW_MOVED,(i=>{i.payload=V(i.payload),e(i)}))}async onCloseRequested(e){return this.listen(h.WINDOW_CLOSE_REQUESTED,(i=>{const n=new m(i);Promise.resolve(e(n)).then((()=>{if(!n.isPreventDefault())return this.close()}))}))}async onFocusChanged(e){const i=await this.listen(h.WINDOW_FOCUS,(i=>{e({...i,payload:!0})})),n=await this.listen(h.WINDOW_BLUR,(i=>{e({...i,payload:!1})}));return()=>{i(),n()}}async onScaleChanged(e){return this.listen(h.WINDOW_SCALE_FACTOR_CHANGED,e)}async onMenuClicked(e){return this.listen(h.MENU,e)}async onFileDropEvent(e){const i=await this.listen(h.WINDOW_FILE_DROP,(i=>{e({...i,payload:{type:"drop",paths:i.payload}})})),n=await this.listen(h.WINDOW_FILE_DROP_HOVER,(i=>{e({...i,payload:{type:"hover",paths:i.payload}})})),t=await this.listen(h.WINDOW_FILE_DROP_CANCELLED,(i=>{e({...i,payload:{type:"cancel"}})}));return()=>{i(),n(),t()}}async onThemeChanged(e){return this.listen(h.WINDOW_THEME_CHANGED,e)}}class m{constructor(e){this._preventDefault=!1,this.event=e.event,this.windowLabel=e.windowLabel,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}class N extends R{constructor(e,i={}){super(e),(null==i?void 0:i.skip)||window.__TAURI_INVOKE__("plugin:window|create",{options:{...i,label:e}}).then((async()=>this.emit("tauri://created"))).catch((async e=>this.emit("tauri://error",e)))}static getByLabel(e){return T().some((i=>i.label===e))?new N(e,{skip:!0}):null}static async getFocusedWindow(){for(const e of T())if(await e.isFocused())return e;return null}}var U,W;function D(e){return null===e?null:{name:e.name,scaleFactor:e.scaleFactor,position:V(e.position),size:K(e.size)}}function V(e){return new O(e.x,e.y)}function K(e){return new E(e.width,e.height)}return e.appWindow=void 0,"__TAURI_METADATA__"in window?e.appWindow=new N(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0}):(console.warn('Could not find "window.__TAURI_METADATA__". The "appWindow" value will reference the "main" window label.\nNote that this is not an issue if running this frontend on a browser instead of a Tauri window.'),e.appWindow=new N("main",{skip:!0})),e.Effect=void 0,(U=e.Effect||(e.Effect={})).AppearanceBased="appearanceBased",U.Light="light",U.Dark="dark",U.MediumLight="mediumLight",U.UltraDark="ultraDark",U.Titlebar="titlebar",U.Selection="selection",U.Menu="menu",U.Popover="popover",U.Sidebar="sidebar",U.HeaderView="headerView",U.Sheet="sheet",U.WindowBackground="windowBackground",U.HudWindow="hudWindow",U.FullScreenUI="fullScreenUI",U.Tooltip="tooltip",U.ContentBackground="contentBackground",U.UnderWindowBackground="underWindowBackground",U.UnderPageBackground="underPageBackground",U.Mica="mica",U.Blur="blur",U.Acrylic="acrylic",e.EffectState=void 0,(W=e.EffectState||(e.EffectState={})).FollowsWindowActiveState="followsWindowActiveState",W.Active="active",W.Inactive="inactive",e.CloseRequestedEvent=m,e.LogicalPosition=A,e.LogicalSize=b,e.PhysicalPosition=O,e.PhysicalSize=E,e.WebviewWindow=N,e.WebviewWindowHandle=v,e.WindowManager=R,e.availableMonitors=async function(){return window.__TAURI_INVOKE__("plugin:window|available_monitors").then((e=>e.map(D)))},e.currentMonitor=async function(){return window.__TAURI_INVOKE__("plugin:window|current_monitor").then(D)},e.getAll=T,e.getCurrent=function(){return new N(window.__TAURI_METADATA__.__currentWindow.label,{skip:!0})},e.primaryMonitor=async function(){return window.__TAURI_INVOKE__("plugin:window|primary_monitor").then(D)},e}({});Object.defineProperty(window.__TAURI__,"window",{value:__TAURI_WINDOW__})} diff --git a/plugins/window/src/desktop_commands.rs b/plugins/window/src/desktop_commands.rs index 135e8d80..aafe9f5b 100644 --- a/plugins/window/src/desktop_commands.rs +++ b/plugins/window/src/desktop_commands.rs @@ -4,8 +4,9 @@ use serde::{Deserialize, Serialize, Serializer}; use tauri::{ - utils::config::WindowConfig, AppHandle, CursorIcon, Icon, Manager, Monitor, PhysicalPosition, - PhysicalSize, Position, Runtime, Size, Theme, UserAttentionType, Window, + utils::config::{WindowConfig, WindowEffectsConfig}, + AppHandle, CursorIcon, Icon, Manager, Monitor, PhysicalPosition, PhysicalSize, Position, + Runtime, Size, Theme, UserAttentionType, Window, }; #[derive(Debug, thiserror::Error)] @@ -111,6 +112,7 @@ getter!(outer_size, PhysicalSize); getter!(is_fullscreen, bool); getter!(is_minimized, bool); getter!(is_maximized, bool); +getter!(is_focused, bool); getter!(is_decorated, bool); getter!(is_resizable, bool); getter!(is_visible, bool); @@ -133,6 +135,7 @@ setter!(hide); setter!(close); setter!(set_decorations, bool); setter!(set_shadow, bool); +setter!(set_effects, Option); setter!(set_always_on_top, bool); setter!(set_content_protected, bool); setter!(set_size, Size); diff --git a/plugins/window/src/lib.rs b/plugins/window/src/lib.rs index 1efeae15..14411f17 100644 --- a/plugins/window/src/lib.rs +++ b/plugins/window/src/lib.rs @@ -40,6 +40,7 @@ pub fn init() -> TauriPlugin { desktop_commands::is_fullscreen, desktop_commands::is_minimized, desktop_commands::is_maximized, + desktop_commands::is_focused, desktop_commands::is_decorated, desktop_commands::is_resizable, desktop_commands::is_visible, @@ -62,6 +63,7 @@ pub fn init() -> TauriPlugin { desktop_commands::close, desktop_commands::set_decorations, desktop_commands::set_shadow, + desktop_commands::set_effects, desktop_commands::set_always_on_top, desktop_commands::set_content_protected, desktop_commands::set_size,