From fca888175c41a80f9a456018d3ac18b6a98e4254 Mon Sep 17 00:00:00 2001 From: Yato Date: Fri, 24 May 2024 04:46:50 +0700 Subject: [PATCH] separate config and input logic from pets scence. bump dependencies --- package.json | 54 +- src-tauri/Cargo.lock | 1021 ++++++++++++++++-------------- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- src/SettingWindow.tsx | 2 +- src/hooks/usePets.tsx | 10 +- src/hooks/useSettingTabStore.tsx | 1 - src/hooks/useSettings.tsx | 5 +- src/scenes/Pets.ts | 871 ++++++++++++------------- src/scenes/manager.ts | 346 ++++++++++ src/types/IEvents.ts | 5 - src/types/ISetting.ts | 26 - src/ui/setting_tabs/Settings.tsx | 9 +- src/utils/event.ts | 8 +- src/utils/handleSettingChange.ts | 9 +- src/utils/settings.ts | 9 +- 16 files changed, 1404 insertions(+), 976 deletions(-) create mode 100644 src/scenes/manager.ts diff --git a/package.json b/package.json index 0ac5510..c2e759b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "WindowPet", "private": "false", - "version": "0.0.7", + "version": "0.0.8", "type": "module", "scripts": { "dev": "vite", @@ -12,42 +12,42 @@ "tauri": "tauri" }, "dependencies": { - "@mantine/core": "^7.4.2", - "@mantine/modals": "^7.4.2", - "@mantine/notifications": "^7.4.2", - "@tabler/icons-react": "^2.46.0", - "@tauri-apps/api": "^1.5.3", - "clsx": "^2.1.0", - "i18next": "^23.7.18", + "@mantine/core": "^7.10.0", + "@mantine/modals": "^7.10.0", + "@mantine/notifications": "^7.10.0", + "@tabler/icons-react": "^2.47.0", + "@tauri-apps/api": "^1.5.6", + "clsx": "^2.1.1", + "i18next": "^23.11.5", "jsdom": "^24.0.0", - "phaser": "^3.70.0", - "postcss": "^8.4.33", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-i18next": "^13.5.0", - "react-intersection-observer": "^9.5.3", + "phaser": "^3.80.1", + "postcss": "^8.4.38", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "react-i18next": "^14.1.2", + "react-intersection-observer": "^9.10.2", "react-markdown": "^9.0.1", "react-query": "^3.39.3", - "react-router-dom": "^6.21.3", + "react-router-dom": "^6.23.1", "remark-gfm": "^4.0.0", "tauri-plugin-autostart-api": "github:tauri-apps/tauri-plugin-autostart#v1", "tauri-plugin-log-api": "github:tauri-apps/tauri-plugin-log#v1", "tauri-plugin-store-api": "github:tauri-apps/tauri-plugin-store#v1", - "vite-tsconfig-paths": "^4.3.1", - "zustand": "^4.5.0" + "vite-tsconfig-paths": "^4.3.2", + "zustand": "^4.5.2" }, "devDependencies": { - "@tauri-apps/cli": "1.5.9", - "@testing-library/react": "^14.1.2", - "@types/node": "^20.11.5", - "@types/react": "^18.2.48", - "@types/react-dom": "^18.2.18", - "@vitejs/plugin-react": "^4.2.1", - "postcss-preset-mantine": "^1.12.3", + "@tauri-apps/cli": "1.5.14", + "@testing-library/react": "^14.3.1", + "@types/node": "^20.12.12", + "@types/react": "^18.3.3", + "@types/react-dom": "^18.3.0", + "@vitejs/plugin-react": "^4.3.0", + "postcss-preset-mantine": "^1.15.0", "ts-node": "^10.9.2", - "typescript": "^5.3.3", - "vite": "^5.0.12", - "vitest": "^1.2.1", + "typescript": "^5.4.5", + "vite": "^5.2.11", + "vitest": "^1.6.0", "vitest-canvas-mock": "^0.3.3" } } diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 6ea1766..d67dedd 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -19,20 +19,20 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -69,9 +69,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arrayvec" @@ -91,28 +91,26 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.1.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 4.0.3", - "event-listener-strategy", + "event-listener-strategy 0.5.2", "futures-core", "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" +checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" dependencies = [ - "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.0.1", - "futures-lite 2.2.0", + "fastrand 2.1.0", + "futures-lite 2.3.0", "slab", ] @@ -150,18 +148,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.0" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744" +checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" dependencies = [ "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "parking", - "polling 3.3.2", - "rustix 0.38.30", + "polling 3.7.0", + "rustix 0.38.34", "slab", "tracing", "windows-sys 0.52.0", @@ -183,7 +181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener 4.0.3", - "event-listener-strategy", + "event-listener-strategy 0.4.0", "pin-project-lite", ] @@ -200,54 +198,54 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.30", + "rustix 0.38.34", "windows-sys 0.48.0", ] [[package]] name = "async-recursion" -version = "1.0.5" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "async-signal" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" +checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" dependencies = [ - "async-io 2.3.0", - "async-lock 2.8.0", + "async-io 2.3.2", + "async-lock 3.3.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.30", + "rustix 0.38.34", "signal-hook-registry", "slab", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "async-task" -version = "4.7.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -271,7 +269,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -293,15 +291,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -324,6 +322,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bitflags" version = "1.3.2" @@ -332,9 +336,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -365,25 +369,23 @@ dependencies = [ [[package]] name = "blocking" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" +checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" dependencies = [ "async-channel", "async-lock 3.3.0", "async-task", - "fastrand 2.0.1", "futures-io", - "futures-lite 2.2.0", + "futures-lite 2.3.0", "piper", - "tracing", ] [[package]] name = "borsh" -version = "1.3.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" +checksum = "dbe5b10e214954177fb1dc9fbd20a1a2608fe99e6c832033bdc7cea287a20d77" dependencies = [ "borsh-derive", "cfg_aliases", @@ -391,23 +393,23 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.3.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" +checksum = "d7a8646f94ab393e43e8b35a2558b1624bed28b97ee09c5d15456e3c9463f46d" dependencies = [ "once_cell", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", "syn_derive", ] [[package]] name = "brotli" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -426,9 +428,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "serde", @@ -436,9 +438,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-unit" @@ -453,9 +455,9 @@ dependencies = [ [[package]] name = "bytecheck" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -464,9 +466,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ "proc-macro2", "quote", @@ -475,9 +477,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" [[package]] name = "byteorder" @@ -487,9 +489,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" dependencies = [ "serde", ] @@ -515,7 +517,7 @@ checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" dependencies = [ "glib-sys", "libc", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -530,12 +532,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cesu8" @@ -565,9 +564,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.6" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", "target-lexicon", @@ -587,15 +586,15 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.32" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -636,9 +635,9 @@ checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "memchr", @@ -646,9 +645,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -710,18 +709,18 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -747,9 +746,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -785,24 +784,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "ctor" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" +checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "darling" -version = "0.20.3" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" dependencies = [ "darling_core", "darling_macro", @@ -810,27 +809,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -947,16 +946,16 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "embed-resource" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bde55e389bea6a966bd467ad1ad7da0ae14546a5bc794d16d1e55e7fca44881" +checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" dependencies = [ "cc", "memchr", "rustc_version", - "toml 0.8.8", + "toml 0.8.13", "vswhom", - "winreg 0.51.0", + "winreg 0.52.0", ] [[package]] @@ -967,18 +966,18 @@ checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] [[package]] name = "enumflags2" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" dependencies = [ "enumflags2_derive", "serde", @@ -986,13 +985,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -1003,9 +1002,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1039,6 +1038,17 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + [[package]] name = "event-listener-strategy" version = "0.4.0" @@ -1049,6 +1059,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.0", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -1060,9 +1080,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fdeflate" @@ -1088,7 +1108,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "memoffset 0.9.0", + "memoffset 0.9.1", "rustc_version", ] @@ -1100,15 +1120,15 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1209,11 +1229,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-core", "futures-io", "parking", @@ -1228,7 +1248,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -1308,7 +1328,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -1325,7 +1345,7 @@ dependencies = [ "libc", "pango-sys", "pkg-config", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -1339,7 +1359,7 @@ dependencies = [ "gobject-sys", "libc", "pkg-config", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -1351,7 +1371,7 @@ dependencies = [ "gdk-sys", "glib-sys", "libc", - "system-deps 6.2.0", + "system-deps 6.2.2", "x11", ] @@ -1391,9 +1411,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1432,7 +1452,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.2.0", + "system-deps 6.2.2", "winapi", ] @@ -1478,7 +1498,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" dependencies = [ "libc", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -1496,8 +1516,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.4", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -1508,7 +1528,7 @@ checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" dependencies = [ "glib-sys", "libc", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -1549,7 +1569,7 @@ dependencies = [ "gobject-sys", "libc", "pango-sys", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -1568,9 +1588,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -1578,7 +1598,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.1.0", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1596,9 +1616,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "heck" @@ -1615,11 +1635,17 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1643,13 +1669,13 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", - "itoa 1.0.10", + "itoa 1.0.11", ] [[package]] @@ -1696,9 +1722,9 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.10", + "itoa 1.0.11", "pin-project-lite", - "socket2 0.5.5", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -1720,9 +1746,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1777,7 +1803,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.4", + "regex-automata 0.4.6", "same-file", "walkdir", "winapi-util", @@ -1785,9 +1811,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" dependencies = [ "bytemuck", "byteorder", @@ -1808,12 +1834,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -1828,9 +1854,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -1879,9 +1905,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "javascriptcore-rs" @@ -1928,23 +1954,22 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "json-patch" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6" +checksum = "ec9ad60d674508f3ca8f380a928cfe7b096bc729c4e2dbfe3852bc45da3ab30b" dependencies = [ "serde", "serde_json", "thiserror", - "treediff", ] [[package]] @@ -1992,9 +2017,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.152" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" @@ -2008,23 +2033,19 @@ dependencies = [ [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] name = "line-wrap" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9" -dependencies = [ - "safemem", -] +checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" [[package]] name = "linux-raw-sys" @@ -2034,15 +2055,15 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2050,9 +2071,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" dependencies = [ "value-bag", ] @@ -2118,9 +2139,9 @@ checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memoffset" @@ -2133,9 +2154,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -2154,9 +2175,9 @@ checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", "simd-adler32", @@ -2164,9 +2185,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -2232,9 +2253,9 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nix" @@ -2264,11 +2285,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -2306,9 +2333,9 @@ dependencies = [ [[package]] name = "num_threads" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" dependencies = [ "libc", ] @@ -2379,9 +2406,9 @@ dependencies = [ [[package]] name = "open" -version = "5.0.1" +version = "5.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90878fb664448b54c4e592455ad02831e23a3f7e157374a8b95654731aac7349" +checksum = "2eb49fbd5616580e9974662cb96a3463da4476e649a7e4b258df0de065db0657" dependencies = [ "is-wsl", "libc", @@ -2390,11 +2417,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -2411,7 +2438,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -2422,9 +2449,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -2470,7 +2497,7 @@ dependencies = [ "glib-sys", "gobject-sys", "libc", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -2481,9 +2508,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -2491,15 +2518,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -2618,7 +2645,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -2650,9 +2677,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2662,29 +2689,29 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" dependencies = [ "atomic-waker", - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-io", ] [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plist" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef" +checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" dependencies = [ "base64 0.21.7", - "indexmap 2.1.0", + "indexmap 2.2.6", "line-wrap", "quick-xml", "serde", @@ -2693,9 +2720,9 @@ dependencies = [ [[package]] name = "png" -version = "0.17.11" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" +checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -2722,14 +2749,15 @@ dependencies = [ [[package]] name = "polling" -version = "3.3.2" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" +checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" dependencies = [ "cfg-if", "concurrent-queue", + "hermit-abi", "pin-project-lite", - "rustix 0.38.30", + "rustix 0.38.34", "tracing", "windows-sys 0.52.0", ] @@ -2768,7 +2796,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.21.0", + "toml_edit 0.21.1", ] [[package]] @@ -2803,9 +2831,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] @@ -2841,9 +2869,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2914,7 +2942,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", ] [[package]] @@ -2950,27 +2978,36 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.4", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -2984,13 +3021,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -3001,24 +3038,24 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "rend" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" dependencies = [ "bytecheck", ] [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -3038,9 +3075,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -3080,9 +3119,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.43" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" dependencies = [ "bitvec", "bytecheck", @@ -3098,9 +3137,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.43" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" dependencies = [ "proc-macro2", "quote", @@ -3109,9 +3148,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.33.1" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" +checksum = "1790d1c4c0ca81211399e0e0af16333276f375209e71a37b67698a373db5b47a" dependencies = [ "arrayvec", "borsh", @@ -3125,9 +3164,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc_version" @@ -3154,34 +3193,37 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] [[package]] -name = "rustversion" -version = "1.0.14" +name = "rustls-pemfile" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] [[package]] -name = "ryu" -version = "1.0.16" +name = "rustversion" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] -name = "safemem" -version = "0.3.3" +name = "ryu" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -3221,11 +3263,11 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -3234,9 +3276,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -3264,60 +3306,61 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.195" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ - "itoa 1.0.10", + "indexmap 2.2.6", + "itoa 1.0.11", "ryu", "serde", ] [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -3329,23 +3372,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.10", + "itoa 1.0.11", "ryu", "serde", ] [[package]] name = "serde_with" -version = "3.5.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58c3a1b3e418f61c25b2aeb43fc6c95eaa252b8cecdda67f401943e9e08d33f" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -3353,14 +3397,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.5.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2068b437a31fc68f25dd7edc296b078f04b45145c199d8eed9866e45f1ff274" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -3428,9 +3472,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3464,9 +3508,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -3480,12 +3524,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3565,9 +3609,9 @@ dependencies = [ [[package]] name = "strsim" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" @@ -3582,9 +3626,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" dependencies = [ "proc-macro2", "quote", @@ -3600,9 +3644,15 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -3639,22 +3689,22 @@ dependencies = [ [[package]] name = "system-deps" -version = "6.2.0" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2d580ff6a20c55dfb86be5f9c238f67835d0e81cbdea8bf5680e0897320331" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ - "cfg-expr 0.15.6", - "heck 0.4.1", + "cfg-expr 0.15.8", + "heck 0.5.0", "pkg-config", - "toml 0.8.8", - "version-compare 0.1.1", + "toml 0.8.13", + "version-compare 0.2.0", ] [[package]] name = "tao" -version = "0.16.7" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22205b267a679ca1c590b9f178488d50981fc3e48a1b91641ae31593db875ce" +checksum = "575c856fc21e551074869dcfaad8f706412bd5b803dfa0fbf6881c4ff4bfafab" dependencies = [ "bitflags 1.3.2", "cairo-rs", @@ -3729,31 +3779,34 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tauri" -version = "1.5.4" +version = "1.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd27c04b9543776a972c86ccf70660b517ecabbeced9fb58d8b961a13ad129af" +checksum = "67c7177b6be45bbb875aa239578f5adc982a1b3d5ea5b315ccd100aeb0043374" dependencies = [ "anyhow", "base64 0.21.7", "bytes", "cocoa", "dirs-next", + "dunce", "embed_plist", "encoding_rs", "flate2", "futures-util", + "getrandom 0.2.15", "glib", "glob", "gtk", - "heck 0.4.1", + "heck 0.5.0", "http", "ignore", + "indexmap 1.9.3", "minisign-verify", "objc", "once_cell", @@ -3789,14 +3842,14 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9914a4715e0b75d9f387a285c7e26b5bbfeb1249ad9f842675a82481565c532" +checksum = "ab30cba12974d0f9b09794f61e72cad6da2142d3ceb81e519321bab86ce53312" dependencies = [ "anyhow", "cargo_toml", "dirs-next", - "heck 0.4.1", + "heck 0.5.0", "json-patch", "semver", "serde", @@ -3808,9 +3861,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1554c5857f65dbc377cefb6b97c8ac77b1cb2a90d30d3448114d5d6b48a77fc" +checksum = "c3a1d90db526a8cdfd54444ad3f34d8d4d58fa5c536463915942393743bd06f8" dependencies = [ "base64 0.21.7", "brotli", @@ -3834,11 +3887,11 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "1.4.3" +version = "1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "277abf361a3a6993ec16bcbb179de0d6518009b851090a01adfea12ac89fa875" +checksum = "6a582d75414250122e4a597b9dd7d3c910a2c77906648fc2ac9353845ff0feec" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3849,7 +3902,7 @@ dependencies = [ [[package]] name = "tauri-plugin-autostart" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#035a4824d64691ca5c342771ee8d775a6a07a5e0" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#5e3900e682e13f3759b439116ae2f77a6d389ca2" dependencies = [ "auto-launch", "log", @@ -3862,7 +3915,7 @@ dependencies = [ [[package]] name = "tauri-plugin-log" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#035a4824d64691ca5c342771ee8d775a6a07a5e0" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#5e3900e682e13f3759b439116ae2f77a6d389ca2" dependencies = [ "byte-unit", "fern", @@ -3877,7 +3930,7 @@ dependencies = [ [[package]] name = "tauri-plugin-single-instance" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#035a4824d64691ca5c342771ee8d775a6a07a5e0" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#5e3900e682e13f3759b439116ae2f77a6d389ca2" dependencies = [ "log", "serde", @@ -3891,7 +3944,7 @@ dependencies = [ [[package]] name = "tauri-plugin-store" version = "0.0.0" -source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#035a4824d64691ca5c342771ee8d775a6a07a5e0" +source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#5e3900e682e13f3759b439116ae2f77a6d389ca2" dependencies = [ "log", "serde", @@ -3902,9 +3955,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2d0652aa2891ff3e9caa2401405257ea29ab8372cce01f186a5825f1bd0e76" +checksum = "cd7ffddf36d450791018e63a3ddf54979b9581d9644c584a5fb5611e6b5f20b4" dependencies = [ "gtk", "http", @@ -3923,9 +3976,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.14.3" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cae61fbc731f690a4899681c9052dde6d05b159b44563ace8186fc1bfb7d158" +checksum = "1989b3b4d611f5428b3414a4abae6fa6df30c7eb8ed33250ca90a5f7e5bb3655" dependencies = [ "cocoa", "gtk", @@ -3943,15 +3996,15 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.5.2" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece74810b1d3d44f29f732a7ae09a63183d63949bbdd59c61f8ed2a1b70150db" +checksum = "450b17a7102e5d46d4bdabae0d1590fd27953e704e691fc081f06c06d2253b35" dependencies = [ "brotli", "ctor", "dunce", "glob", - "heck 0.4.1", + "heck 0.5.0", "html5ever", "infer", "json-patch", @@ -3983,14 +4036,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.1", - "redox_syscall", - "rustix 0.38.30", + "fastrand 2.1.0", + "rustix 0.38.34", "windows-sys 0.52.0", ] @@ -4013,29 +4065,29 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -4043,13 +4095,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa 1.0.10", + "itoa 1.0.11", "libc", + "num-conv", "num_threads", "powerfmt", "serde", @@ -4065,10 +4118,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -4089,9 +4143,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -4099,7 +4153,7 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.5", + "socket2 0.5.7", "windows-sys 0.48.0", ] @@ -4115,16 +4169,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -4150,21 +4203,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.22.13", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] @@ -4175,24 +4228,35 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +dependencies = [ + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.8", ] [[package]] @@ -4220,7 +4284,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -4262,15 +4326,6 @@ dependencies = [ "tracing-log", ] -[[package]] -name = "treediff" -version = "4.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52984d277bdf2a751072b5df30ec0377febdb02f7696d64c2d7d54630bac4303" -dependencies = [ - "serde_json", -] - [[package]] name = "try-lock" version = "0.2.5" @@ -4289,7 +4344,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ - "memoffset 0.9.0", + "memoffset 0.9.1", "tempfile", "winapi", ] @@ -4308,18 +4363,18 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "url" @@ -4347,11 +4402,11 @@ checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ - "getrandom 0.2.12", + "getrandom 0.2.15", ] [[package]] @@ -4362,9 +4417,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cdbaf5e132e593e9fc1de6a15bbec912395b11fb9719e061cf64f804524c503" +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" [[package]] name = "vcpkg" @@ -4380,9 +4435,9 @@ checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" [[package]] name = "version-compare" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" +checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" [[package]] name = "version_check" @@ -4412,15 +4467,15 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4449,9 +4504,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4459,24 +4514,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -4486,9 +4541,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4496,28 +4551,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" dependencies = [ "futures-util", "js-sys", @@ -4528,9 +4583,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -4580,7 +4635,7 @@ dependencies = [ "pango-sys", "pkg-config", "soup2-sys", - "system-deps 6.2.0", + "system-deps 6.2.2", ] [[package]] @@ -4639,11 +4694,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -4654,11 +4709,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_pet" -version = "0.0.7" +version = "0.0.8" dependencies = [ "log", "mouse_position", - "open 5.0.1", + "open 5.1.3", "serde", "serde_json", "tauri", @@ -4722,7 +4777,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -4771,7 +4826,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -4791,17 +4846,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -4812,11 +4868,11 @@ checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" [[package]] name = "windows-version" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75aa004c988e080ad34aff5739c39d0312f4684699d6d71fc8a198d057b8b9b4" +checksum = "6998aa457c9ba8ff2fb9f13e9d2a930dabcea28f1d0ab94d687d8b3654844515" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -4833,9 +4889,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -4863,9 +4919,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -4893,9 +4949,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -4923,9 +4985,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -4953,9 +5015,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -4971,9 +5033,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -5001,15 +5063,24 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.5.34" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -5035,9 +5106,9 @@ dependencies = [ [[package]] name = "winreg" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", @@ -5045,9 +5116,9 @@ dependencies = [ [[package]] name = "wry" -version = "0.24.7" +version = "0.24.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ad85d0e067359e409fcb88903c3eac817c392e5d638258abfb3da5ad8ba6fc4" +checksum = "00711278ed357350d44c749c286786ecac644e044e4da410d466212152383b45" dependencies = [ "base64 0.13.1", "block", @@ -5118,25 +5189,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys 0.4.13", - "rustix 0.38.30", + "linux-raw-sys 0.4.14", + "rustix 0.38.34", ] [[package]] name = "xdg-home" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2769203cd13a0c6015d515be729c526d041e9cf2c0cc478d57faee85f40c6dcd" +checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" dependencies = [ - "nix", + "libc", "winapi", ] [[package]] name = "zbus" -version = "3.14.1" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" +checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" dependencies = [ "async-broadcast", "async-executor", @@ -5175,9 +5246,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.14.1" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" +checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -5189,9 +5260,9 @@ dependencies = [ [[package]] name = "zbus_names" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" +checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" dependencies = [ "serde", "static_assertions", @@ -5211,9 +5282,9 @@ dependencies = [ [[package]] name = "zvariant" -version = "3.15.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" +checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" dependencies = [ "byteorder", "enumflags2", @@ -5225,9 +5296,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.15.0" +version = "3.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" +checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 5f10e49..7b165e9 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "window_pet" -version = "0.0.7" +version = "0.0.8" description = "Window Pet" authors = ["SeakMengs"] license = "MIT" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 5206b59..0a1c406 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -8,7 +8,7 @@ }, "package": { "productName": "WindowPet", - "version": "0.0.7" + "version": "0.0.8" }, "tauri": { "allowlist": { diff --git a/src/SettingWindow.tsx b/src/SettingWindow.tsx index 3ddf17b..630692e 100644 --- a/src/SettingWindow.tsx +++ b/src/SettingWindow.tsx @@ -143,7 +143,7 @@ function SettingWindow() { - + <CurrentSettingTab key={activeTab} /> </Box> diff --git a/src/hooks/usePets.tsx b/src/hooks/usePets.tsx index 33fd776..bba5cf2 100644 --- a/src/hooks/usePets.tsx +++ b/src/hooks/usePets.tsx @@ -31,7 +31,10 @@ const getPets = async () => { }; export function usePets(): UseQueryResult<unknown, Error> { - return useQuery('pets', getPets, { refetchOnWindowFocus: false }); + return useQuery('pets', getPets, { refetchOnWindowFocus: false, + // disable cache + cacheTime: 0, + }); }; const getDefaultPets = async () => { @@ -52,5 +55,8 @@ const getDefaultPets = async () => { }; export function useDefaultPets(): UseQueryResult<unknown, Error> { - return useQuery('defaultPets', getDefaultPets, { refetchOnWindowFocus: false }); + return useQuery('defaultPets', getDefaultPets, { refetchOnWindowFocus: false, + // disable cache + cacheTime: 0, + }); } \ No newline at end of file diff --git a/src/hooks/useSettingTabStore.tsx b/src/hooks/useSettingTabStore.tsx index 3d61fea..73bf226 100644 --- a/src/hooks/useSettingTabStore.tsx +++ b/src/hooks/useSettingTabStore.tsx @@ -1,5 +1,4 @@ import { create } from "zustand"; -import useQueryParams from "./useQueryParams"; import { ESettingTab } from "../types/ISetting"; interface ISettingTabState { diff --git a/src/hooks/useSettings.tsx b/src/hooks/useSettings.tsx index 52bb3e5..fd8733a 100644 --- a/src/hooks/useSettings.tsx +++ b/src/hooks/useSettings.tsx @@ -29,5 +29,8 @@ const getSettings = async () => { }; export function useSettings() { - return useQuery('settings', getSettings, { refetchOnWindowFocus: false }); + return useQuery('settings', getSettings, { refetchOnWindowFocus: false, + // disable cache + cacheTime: 0, + }); } \ No newline at end of file diff --git a/src/scenes/Pets.ts b/src/scenes/Pets.ts index e69d76a..0a78086 100644 --- a/src/scenes/Pets.ts +++ b/src/scenes/Pets.ts @@ -1,60 +1,105 @@ -import { invoke } from "@tauri-apps/api"; -import { appWindow } from "@tauri-apps/api/window"; -import { ISpriteConfig, SpriteType } from "../types/ISpriteConfig"; +import { ISpriteConfig } from "../types/ISpriteConfig"; import { useSettingStore } from "../hooks/useSettingStore"; import { listen } from "@tauri-apps/api/event"; -import { DispatchType, EventType, TRenderEventListener } from "../types/IEvents"; -import { IPet, Direction, IWorldBounding, ISwitchStateOptions, Ease } from "../types/IPet"; +import { + DispatchType, + EventType, + TRenderEventListener, +} from "../types/IEvents"; +import { + Direction, + IWorldBounding, + ISwitchStateOptions, + Ease, +} from "../types/IPet"; import { info, error } from "tauri-plugin-log-api"; import defaultSettings from "../../src-tauri/src/app/default/settings.json"; -import { convertFileSrc } from "@tauri-apps/api/tauri"; +import { ConfigManager, InputManager } from "./manager"; + +interface Pet extends Phaser.Types.Physics.Arcade.SpriteWithDynamicBody { + direction?: Direction; + availableStates: string[]; + canPlayRandomState: boolean; + canRandomFlip: boolean; + id: string; +} export default class Pets extends Phaser.Scene { - private pets: IPet[] = []; - private spriteConfig: ISpriteConfig[] = []; - private isIgnoreCursorEvents: boolean = true; + private pets: Pet[] = []; private isFlipped: boolean = false; private frameCount: number = 0; // use this array to store index of pet that is currently climb and crawl private petClimbAndCrawlIndex: number[] = []; - private registeredName: string[] = []; + + private configManager: ConfigManager; + // input manager to handle mouse, toggle cursor events to ignore cursor events when mouse is over pet + private inputManager: InputManager; // app settings - private allowPetInteraction: boolean = useSettingStore.getState().allowPetInteraction ?? defaultSettings.allowPetInteraction - private allowPetAboveTaskbar: boolean = useSettingStore.getState().allowPetAboveTaskbar ?? defaultSettings.allowPetAboveTaskbar - private allowOverridePetScale: boolean = useSettingStore.getState().allowOverridePetScale ?? defaultSettings.allowOverridePetScale - private petScale: number = useSettingStore.getState().petScale ?? defaultSettings.petScale - private allowPetClimbing: boolean = useSettingStore.getState().allowPetClimbing ?? defaultSettings.allowPetClimbing + private allowPetInteraction: boolean; + private allowPetAboveTaskbar: boolean; + private allowOverridePetScale: boolean; + private petScale: number; + private allowPetClimbing: boolean; // delay ms to set ignore cursor events - readonly setIgnoreCursorEventsDelay: number = 50; - readonly frameRate: number = 9; - // -1 means repeat forever - readonly repeat: number = -1; - readonly forbiddenRandomState: string[] = ['fall', 'climb', 'drag', 'crawl', 'drag', 'bounce', 'jump']; - readonly movementState: string[] = ['walk', 'jump', 'climb', 'crawl']; - readonly updateDelay: number = 1000 / this.frameRate; - readonly moveVelocity: number = this.frameRate * 6; - readonly moveAcceleration: number = this.moveVelocity * 2; - readonly tweenAcceleration: number = this.frameRate * 1.1; - readonly randomStateDelay: number = 3000; - readonly flipDelay: number = 5000; + private readonly FORBIDDEN_RAND_STATE: string[] = [ + "fall", + "climb", + "drag", + "crawl", + "drag", + "bounce", + "jump", + ]; + private readonly FRAME_RATE: number = 9; + private readonly UPDATE_DELAY: number = 1000 / this.FRAME_RATE; + private readonly PET_MOVE_VELOCITY: number = this.FRAME_RATE * 6; + private readonly PET_MOVE_ACCELERATION: number = this.PET_MOVE_VELOCITY * 2; + private readonly TWEEN_ACCELERATION: number = this.FRAME_RATE * 1.1; + private readonly RAND_STATE_DELAY: number = 3000; + private readonly FLIP_DELAY: number = 5000; constructor() { - super({ key: 'Pets' }); + super({ key: "Pets" }); + + // Initialize other settings without relying on this.input + this.allowPetInteraction = + useSettingStore.getState().allowPetInteraction ?? + defaultSettings.allowPetInteraction; + this.allowPetAboveTaskbar = + useSettingStore.getState().allowPetAboveTaskbar ?? + defaultSettings.allowPetAboveTaskbar; + this.allowOverridePetScale = + useSettingStore.getState().allowOverridePetScale ?? + defaultSettings.allowOverridePetScale; + this.petScale = + useSettingStore.getState().petScale ?? defaultSettings.petScale; + this.allowPetClimbing = + useSettingStore.getState().allowPetClimbing ?? + defaultSettings.allowPetClimbing; + + this.configManager = new ConfigManager({ + FRAME_RATE: this.FRAME_RATE, + }); + this.inputManager = new InputManager(); } preload(): void { - this.spriteConfig = this.game.registry.get('spriteConfig'); + this.configManager.setConfigManager({ + load: this.load, + textures: this.textures, + anims: this.anims, + }); - // preload the sprite of the user, if it has already loaded above, we skip it - for (const sprite of this.spriteConfig) { - this.loadSpriteSheet(sprite); - } + this.inputManager.setInputManager({ input: this.input }); + const spriteConfig = this.game.registry.get("spriteConfig"); + this.configManager.setSpriteConfig(spriteConfig); + this.configManager.loadAllSpriteSheet(); } create(): void { - this.turnOnIgnoreCursorEvents(); + this.inputManager.turnOnIgnoreCursorEvents(); this.physics.world.setBoundsCollision(true, true, true, true); this.updatePetAboveTaskbar(); @@ -63,45 +108,52 @@ export default class Pets extends Phaser.Scene { let i = 0; // create pets - for (const sprite of this.spriteConfig) { + for (const sprite of this.configManager.getSpriteConfig()) { this.addPet(sprite, i); i++; } // register event - this.input.on('drag', (pointer: any, pet: IPet, dragX: number, dragY: number) => { - pet.x = dragX; - pet.y = dragY; - - if (pet.anims && pet.anims.getName() !== this.getStateName('drag', pet)) { - this.switchState(pet, 'drag'); - } + this.input.on( + "drag", + (pointer: any, pet: Pet, dragX: number, dragY: number) => { + pet.x = dragX; + pet.y = dragY; + + if ( + pet.anims && + pet.anims.getName() !== + this.configManager.getStateName("drag", pet) + ) { + this.switchState(pet, "drag"); + } - // disable world bounds when dragging so that pet can go beyond screen - // @ts-ignore - if (pet.body!.enable) pet.body!.enable = false; + // disable world bounds when dragging so that pet can go beyond screen + // @ts-ignore + if (pet.body!.enable) pet.body!.enable = false; - // if current pet x is greater than drag start x, flip the pet to the right - if (pet.x > pet.input!.dragStartX) { - if (this.isFlipped) { - this.toggleFlipX(pet); - this.isFlipped = false; - } - } else { - if (!this.isFlipped) { - this.toggleFlipX(pet); - this.isFlipped = true; + // if current pet x is greater than drag start x, flip the pet to the right + if (pet.x > pet.input!.dragStartX) { + if (this.isFlipped) { + this.toggleFlipX(pet); + this.isFlipped = false; + } + } else { + if (!this.isFlipped) { + this.toggleFlipX(pet); + this.isFlipped = true; + } } } - }); + ); - this.input.on('dragend', (pointer: any, pet: IPet) => { + this.input.on("dragend", (pointer: any, pet: Pet) => { // add tween effect when drag end for smooth throw effect this.tweens.add({ targets: pet, // x and y is the position of the pet when drag end - x: pet.x + pointer.velocity.x * this.tweenAcceleration, - y: pet.y + pointer.velocity.y * this.tweenAcceleration, + x: pet.x + pointer.velocity.x * this.TWEEN_ACCELERATION, + y: pet.y + pointer.velocity.y * this.TWEEN_ACCELERATION, duration: 600, ease: Ease.QuartEaseOut, onComplete: () => { @@ -112,204 +164,188 @@ export default class Pets extends Phaser.Scene { // not sure why when enabling body, velocity become 0, and need to take a while to update velocity setTimeout(() => { switch (pet.anims.getName()) { - case this.getStateName('climb', pet): + case this.configManager.getStateName( + "climb", + pet + ): this.updateDirection(pet, Direction.UP); break; - case this.getStateName('crawl', pet): - this.updateDirection(pet, pet.scaleX === -1 ? Direction.UPSIDELEFT : Direction.UPSIDERIGHT); + case this.configManager.getStateName( + "crawl", + pet + ): + this.updateDirection( + pet, + pet.scaleX === -1 + ? Direction.UPSIDELEFT + : Direction.UPSIDERIGHT + ); break; default: return; } }, 50); } - } + }, }); this.petBeyondScreenSwitchClimb(pet, { up: this.getPetBoundTop(pet), down: this.getPetBoundDown(pet), left: this.getPetBoundLeft(pet), - right: this.getPetBoundRight(pet) + right: this.getPetBoundRight(pet), }); }); - this.physics.world.on('worldbounds', (body: Phaser.Physics.Arcade.Body, up: boolean, down: boolean, left: boolean, right: boolean) => { - const pet = body.gameObject as IPet; - // if crawl to world bounds, we make the pet jump or spawn on the ground - if (pet.anims && pet.anims.getName() === this.getStateName('crawl', pet)) { - if (left || right) { - this.petJumpOrPlayRandomState(pet); + this.physics.world.on( + "worldbounds", + ( + body: Phaser.Physics.Arcade.Body, + up: boolean, + down: boolean, + left: boolean, + right: boolean + ) => { + const pet = body.gameObject as Pet; + // if crawl to world bounds, we make the pet jump or spawn on the ground + if ( + pet.anims && + pet.anims.getName() === + this.configManager.getStateName("crawl", pet) + ) { + if (left || right) { + this.petJumpOrPlayRandomState(pet); + } + return; } - return; - } - if (up) { - if (!this.allowPetClimbing) { + if (up) { + if (!this.allowPetClimbing) { + this.petJumpOrPlayRandomState(pet); + return; + } + + if (pet.availableStates.includes("crawl")) { + this.switchState(pet, "crawl"); + return; + } this.petJumpOrPlayRandomState(pet); - return; + } else if (down) { + this.switchStateAfterPetJump(pet); + this.petOnTheGroundPlayRandomState(pet); } - if (pet.availableStates.includes('crawl')) { - this.switchState(pet, 'crawl') - return; - } - this.petJumpOrPlayRandomState(pet); - } else if (down) { - this.switchStateAfterPetJump(pet); - this.petOnTheGroundPlayRandomState(pet); + /* + * this will check on the ground and mid air if pet is beyond screen + * and change pet state accordingly + */ + this.petBeyondScreenSwitchClimb(pet, { + up: up, + down: down, + left: left, + right: right, + }); } - - /* - * this will check on the ground and mid air if pet is beyond screen - * and change pet state accordingly - */ - this.petBeyondScreenSwitchClimb(pet, { - up: up, - down: down, - left: left, - right: right - }); - }); + ); // listen to setting change from setting window and update settings - listen<any>(EventType.SettingWindowToPetOverlay, (event: TRenderEventListener) => { - switch (event.payload.dispatchType) { - case DispatchType.SwitchAllowPetInteraction: - this.allowPetInteraction = event.payload.value as boolean; - break; - case DispatchType.SwitchPetAboveTaskbar: - this.allowPetAboveTaskbar = event.payload.value as boolean; - this.updatePetAboveTaskbar(); - - // when the user switch from pet above taskbar to not above taskbar, there will be a little space for pet, we force pet to jump or play random state - if (!this.allowPetAboveTaskbar) { - this.pets.forEach((pet) => { - this.petJumpOrPlayRandomState(pet); - }); - } + listen<any>( + EventType.SettingWindowToPetOverlay, + (event: TRenderEventListener) => { + switch (event.payload.dispatchType) { + case DispatchType.SwitchAllowPetInteraction: + this.allowPetInteraction = event.payload + .value as boolean; + break; + case DispatchType.SwitchPetAboveTaskbar: + this.allowPetAboveTaskbar = event.payload + .value as boolean; + this.updatePetAboveTaskbar(); + + // when the user switch from pet above taskbar to not above taskbar, there will be a little space for pet, we force pet to jump or play random state + if (!this.allowPetAboveTaskbar) { + this.pets.forEach((pet) => { + this.petJumpOrPlayRandomState(pet); + }); + } - break; - case DispatchType.AddPet: - this.addPet(event.payload!.value as ISpriteConfig, this.pets.length); - break; - case DispatchType.RemovePet: - this.removePet(event.payload.value as string); - break; - case DispatchType.OverridePetScale: - this.allowOverridePetScale = event.payload.value as boolean; - this.allowOverridePetScale ? - this.scaleAllPets(this.petScale) : - this.scaleAllPets(defaultSettings.petScale); - break; - case DispatchType.SwitchAllowPetClimbing: - this.allowPetClimbing = event.payload.value as boolean; - - // when the user switch from pet climb to not climb, we force pet to jump or play random state - if (!this.allowPetClimbing) { - this.pets.forEach((pet) => { - this.petJumpOrPlayRandomState(pet); - }); - } - break; - case DispatchType.ChangePetScale: - this.petScale = event.payload.value as number; - this.scaleAllPets(this.petScale); - break; - default: - break; + break; + case DispatchType.AddPet: + this.addPet( + event.payload!.value as ISpriteConfig, + this.pets.length + ); + break; + case DispatchType.RemovePet: + this.removePet(event.payload.value as string); + break; + case DispatchType.OverridePetScale: + this.allowOverridePetScale = event.payload + .value as boolean; + this.allowOverridePetScale + ? this.scaleAllPets(this.petScale) + : this.scaleAllPets(defaultSettings.petScale); + break; + case DispatchType.SwitchAllowPetClimbing: + this.allowPetClimbing = event.payload.value as boolean; + + // when the user switch from pet climb to not climb, we force pet to jump or play random state + if (!this.allowPetClimbing) { + this.pets.forEach((pet) => { + this.petJumpOrPlayRandomState(pet); + }); + } + break; + case DispatchType.ChangePetScale: + this.petScale = event.payload.value as number; + this.scaleAllPets(this.petScale); + break; + default: + break; + } } - }) + ); - info('Pets scene loaded'); + info("Pets scene loaded"); } update(time: number, delta: number): void { this.frameCount += delta; - if (this.frameCount >= this.updateDelay) { + if (this.frameCount >= this.UPDATE_DELAY) { this.frameCount = 0; if (this.allowPetInteraction) { - invoke('get_mouse_position').then((event: any) => { - if (this.detectMouseOverPet(event.clientX, event.clientY)) { - this.turnOffIgnoreCursorEvents(); - return; - } - - this.turnOnIgnoreCursorEvents(); - }); + this.inputManager.checkIsMouseInOnPet(); } this.randomJumpIfPetClimbAndCrawl(); } } - loadSpriteSheet(sprite: ISpriteConfig): void { - // if sprite name is duplicate, we skip it because we can use the same key for different sprite object - if (this.checkDuplicateName(sprite.name)) return; - // if pet sprite is not valid, we skip it to avoid error - if (!this.validatePetSprite(sprite)) return; - - this.load.spritesheet({ - key: sprite.name, - url: sprite.type === SpriteType.CUSTOM ? convertFileSrc(sprite.imageSrc) : sprite.imageSrc, - frameConfig: this.getFrameSize(sprite) - }); - } - - checkDuplicateName(name: string): boolean { - if (this.registeredName.includes(name)) return true; - - this.registeredName.push(name); - return false; - } - addPet(sprite: ISpriteConfig, index: number): void { - // avoid showing broken sprite - if (!this.validatePetSprite(sprite)) return; - - // in case sprite hasn't loaded yet, we load it - if (!this.textures.exists(sprite.name)) { - this.loadSpriteSheet(sprite); - this.load.start(); - - this.load.once('complete', () => { - this.addPet(sprite, index); - }); - return; - } - - // convert sprite states to lowercase because it help to avoid error when user edit their own json file and type state in uppercase - for (const state in sprite.states) { - if (state.toLowerCase() === state) continue; - - sprite.states[state.toLowerCase()] = sprite.states[state]; - delete sprite.states[state]; - } + this.configManager.registerSpriteStateAnimation(sprite); - // register state animations - for (const animationConfig of this.getAnimationConfigPerSprite(sprite)) { - if (this.anims.exists(animationConfig.key)) continue; - - this.anims.create(animationConfig); - } - - const randomX = Phaser.Math.Between(100, this.physics.world.bounds.width - 100); + const randomX = Phaser.Math.Between( + 100, + this.physics.world.bounds.width - 100 + ); // make the pet jump from the top of the screen - const petY = 0 + this.getFrameSize(sprite).frameHeight; - this.pets[index] = this.physics.add.sprite(randomX, petY, sprite.name).setInteractive({ - draggable: true, - pixelPerfect: true, - }) as IPet; - - this.allowOverridePetScale ? - this.scalePet(this.pets[index], this.petScale) : - this.scalePet(this.pets[index], defaultSettings.petScale); + const petY = 0 + this.configManager.getFrameSize(sprite).frameHeight; + this.pets[index] = this.physics.add + .sprite(randomX, petY, sprite.name) + .setInteractive({ + draggable: true, + pixelPerfect: true, + }) as Pet; + + this.allowOverridePetScale + ? this.scalePet(this.pets[index], this.petScale) + : this.scalePet(this.pets[index], defaultSettings.petScale); this.pets[index].setCollideWorldBounds(true, 0, 0, true); // store available states to pet (it actual name, not modified name) - this.pets[index].availableStates = Object.keys(sprite.states) + this.pets[index].availableStates = Object.keys(sprite.states); this.pets[index].canPlayRandomState = true; this.pets[index].canRandomFlip = true; this.pets[index].id = sprite.id as string; @@ -318,12 +354,15 @@ export default class Pets extends Phaser.Scene { } removePet(petId: string): void { - this.pets = this.pets.filter((pet: IPet, index: number) => { + this.pets = this.pets.filter((pet: Pet, index: number) => { if (pet.id === petId) { pet.destroy(); // get pet that use the same texture as the pet that is destroyed - const petsWithSameTexture = this.pets.filter((pet: IPet) => pet.texture.key === this.pets[index].texture.key); + const petsWithSameTexture = this.pets.filter( + (pet: Pet) => + pet.texture.key === this.pets[index].texture.key + ); // remove texture if there is only one pet that use the texture because we don't need it anymore if (petsWithSameTexture.length === 1) { @@ -332,7 +371,8 @@ export default class Pets extends Phaser.Scene { // remove index from petClimbAndCrawlIndex if it exist because the pet is destroyed if (this.petClimbAndCrawlIndex.includes(index)) { - this.petClimbAndCrawlIndex = this.petClimbAndCrawlIndex.filter(i => i !== index); + this.petClimbAndCrawlIndex = + this.petClimbAndCrawlIndex.filter((i) => i !== index); } return false; } @@ -340,29 +380,31 @@ export default class Pets extends Phaser.Scene { }); } - updateDirection(pet: IPet, direction: Direction): void { + updateDirection(pet: Pet, direction: Direction): void { pet.direction = direction; this.updateMovement(pet); } - updateStateDirection(pet: IPet, state: string): void { + updateStateDirection(pet: Pet, state: string): void { let direction = Direction.UNKNOWN; switch (state) { - case 'walk': + case "walk": // if pet.scaleX is negative, it means pet is facing left, so we set direction to left, else right direction = pet.scaleX < 0 ? Direction.LEFT : Direction.RIGHT; break; - case 'jump': + case "jump": // feel like jump state is opposite of walk so every jump, i flip the pet horizontally :) this.toggleFlipX(pet); direction = Direction.DOWN; break; - case 'climb': + case "climb": direction = Direction.UP; break; - case 'crawl': - pet.scaleX > 0 ? direction = Direction.UPSIDELEFT : direction = Direction.UPSIDERIGHT; + case "crawl": + pet.scaleX > 0 + ? (direction = Direction.UPSIDELEFT) + : (direction = Direction.UPSIDERIGHT); break; default: direction = Direction.UNKNOWN; @@ -370,36 +412,39 @@ export default class Pets extends Phaser.Scene { } this.updateDirection(pet, direction); - }; + } // this function will be called every time we update the pet direction using updateDirection - updateMovement(pet: IPet): void { + updateMovement(pet: Pet): void { switch (pet.direction) { case Direction.RIGHT: - pet.setVelocity(this.moveVelocity, 0); + pet.setVelocity(this.PET_MOVE_VELOCITY, 0); pet.setAcceleration(0); this.setPetLookToTheLeft(pet, false); break; case Direction.LEFT: - pet.setVelocity(-this.moveVelocity, 0); + pet.setVelocity(-this.PET_MOVE_VELOCITY, 0); pet.setAcceleration(0); this.setPetLookToTheLeft(pet, true); break; case Direction.UP: - pet.setVelocity(0, -this.moveVelocity); + pet.setVelocity(0, -this.PET_MOVE_VELOCITY); pet.setAcceleration(0); break; case Direction.DOWN: - pet.setVelocity(0, this.moveVelocity); - pet.setAcceleration(0, this.moveAcceleration); + pet.setVelocity(0, this.PET_MOVE_VELOCITY); + pet.setAcceleration(0, this.PET_MOVE_ACCELERATION); break; case Direction.UPSIDELEFT: - pet.setVelocity(-this.moveVelocity); - pet.setAcceleration(0) + pet.setVelocity(-this.PET_MOVE_VELOCITY); + pet.setAcceleration(0); this.setPetLookToTheLeft(pet, true); break; case Direction.UPSIDERIGHT: - pet.setVelocity(this.moveVelocity, -this.moveVelocity); + pet.setVelocity( + this.PET_MOVE_VELOCITY, + -this.PET_MOVE_VELOCITY + ); pet.setAcceleration(0); this.setPetLookToTheLeft(pet, false); break; @@ -414,31 +459,41 @@ export default class Pets extends Phaser.Scene { } // if pet is going up, we disable gravity, if pet is going down, we enable gravity - const isMovingUp = [Direction.UP, Direction.UPSIDELEFT, Direction.UPSIDERIGHT].includes(pet.direction as Direction); + const isMovingUp = [ + Direction.UP, + Direction.UPSIDELEFT, + Direction.UPSIDERIGHT, + ].includes(pet.direction as Direction); // Set the gravity according to the direction // @ts-ignore pet.body!.setAllowGravity(!isMovingUp); // Set the horizontal velocityX to zero if the direction is up - if (pet.direction === Direction.UP) pet.setVelocityX(0); + if (pet.direction === Direction.UP) { + pet.setVelocityX(0); + } } - switchState(pet: IPet, state: string, options: ISwitchStateOptions = { - repeat: -1, - delay: 0, - repeatDelay: 0, - }): void { + switchState( + pet: Pet, + state: string, + options: ISwitchStateOptions = { + repeat: -1, + delay: 0, + repeatDelay: 0, + } + ): void { try { // when pet is destroyed, pet.anims will be undefined, there is a chance that this function get called because of setTimeout if (!pet.anims) return; // prevent pet from playing crawl and climb state if allowPetClimbing is false if (!this.allowPetClimbing) { - if (state === 'climb' || state === 'crawl') return; + if (state === "climb" || state === "crawl") return; } - const animationKey = this.getStateName(state, pet); + const animationKey = this.configManager.getStateName(state, pet); // if current state is the same as the new state, do nothing if (pet.anims && pet.anims.getName() === animationKey) return; if (!pet.availableStates.includes(state)) return; @@ -450,10 +505,12 @@ export default class Pets extends Phaser.Scene { repeatDelay: options.repeatDelay, }); - if (state === 'climb' || state === 'crawl') { + if (state === "climb" || state === "crawl") { this.petClimbAndCrawlIndex.push(this.pets.indexOf(pet)); } else { - this.petClimbAndCrawlIndex = this.petClimbAndCrawlIndex.filter(index => index !== this.pets.indexOf(pet)); + this.petClimbAndCrawlIndex = this.petClimbAndCrawlIndex.filter( + (index) => index !== this.pets.indexOf(pet) + ); } this.updateStateDirection(pet, state); @@ -464,12 +521,12 @@ export default class Pets extends Phaser.Scene { } // if lookToTheLeft is true, pet will look to the left, if false, pet will look to the right - setPetLookToTheLeft(pet: IPet, lookToTheLeft: boolean): void { + setPetLookToTheLeft(pet: Pet, lookToTheLeft: boolean): void { if (lookToTheLeft) { if (pet.scaleX > 0) { this.toggleFlipX(pet); } - return + return; } if (pet.scaleX < 0) { @@ -477,7 +534,7 @@ export default class Pets extends Phaser.Scene { } } - scalePet(pet: IPet, scaleValue: number): void { + scalePet(pet: Pet, scaleValue: number): void { const scaleX = pet.scaleX > 0 ? scaleValue : -scaleValue; const scaleY = pet.scaleY > 0 ? scaleValue : -scaleValue; pet.setScale(scaleX, scaleY); @@ -492,7 +549,7 @@ export default class Pets extends Phaser.Scene { }); } - toggleFlipX(pet: IPet): void { + toggleFlipX(pet: Pet): void { /* * using scale because flipX doesn't flip the hitbox * so i have to flip the hitbox manually @@ -503,7 +560,7 @@ export default class Pets extends Phaser.Scene { pet.setScale(pet.scaleX * -1, pet.scaleY); } - toggleFlipXThenUpdateDirection(pet: IPet): void { + toggleFlipXThenUpdateDirection(pet: Pet): void { this.toggleFlipX(pet); switch (pet.direction) { @@ -524,111 +581,28 @@ export default class Pets extends Phaser.Scene { } } - getFrameSize(sprite: ISpriteConfig): { frameWidth: number, frameHeight: number } { - if (sprite.frameSize) { - return { - frameWidth: sprite.frameSize, - frameHeight: sprite.frameSize - }; - }; - - const frameWidth = sprite.width! / sprite.highestFrameMax!; - const frameHeight = sprite.height! / sprite.totalSpriteLine!; - return { frameWidth, frameHeight }; - } - - getHighestFrameMax(sprite: ISpriteConfig): number { - if (sprite.highestFrameMax) return sprite.highestFrameMax; - - let highestFrameMax = 0; - for (const state in sprite.states) { - // if frameMax doesn't exist in sprite.states[state] maybe the user specify specific position using start, end - if (!sprite.states[state].frameMax!) return 0; - highestFrameMax = Math.max(highestFrameMax, sprite.states[state].frameMax!); - } - - return highestFrameMax; - } - - validatePetSprite(sprite: ISpriteConfig): boolean { - if (!sprite.name || !sprite.imageSrc || !sprite.states) { - error(`Invalid sprite config: ${sprite.name ?? 'unknown name'}`); - return false; - } - - // technically we accept two type of size, user can either only provide frameSize, or width, height, highestFrameMax, totalSpriteLine for us to calculate frameSize - if (!sprite.frameSize && - (!sprite.width || !sprite.height || !sprite.highestFrameMax || !sprite.totalSpriteLine) - ) { - error(`Invalid sprite config: ${sprite.name}`); - return false; - } - - for (const state in sprite.states) { - if ( - (!sprite.states[state].spriteLine || !sprite.states[state].frameMax) && - (!sprite.states[state].start || !sprite.states[state].end) - ) { - error(`Invalid sprite config: ${sprite.name}`); - return false; - } - } - - return true; - } - - getAnimationConfigPerSprite(sprite: ISpriteConfig): { - key: string; - frames: Phaser.Types.Animations.AnimationFrame[]; - frameRate: number; - repeat: number; - }[] { - let animationConfig = []; - const HighestFrameMax = this.getHighestFrameMax(sprite); - for (const state in sprite.states) { - - // we accept to type of state input, either start, end or spriteLine, frameMax - // -1 because phaser frame start from 0 - const start = sprite.states[state].start !== undefined ? - sprite.states[state].start! - 1 : (sprite.states[state].spriteLine! - 1) * HighestFrameMax; - const end = sprite.states[state].end !== undefined ? - sprite.states[state].end! - 1 : start + sprite.states[state].frameMax! - 1; - - animationConfig.push({ - // avoid duplicate key - key: `${state}-${sprite.name}`, - frames: this.anims.generateFrameNumbers(sprite.name, { - // -1 because phaser frame start from 0 - start: start, - end: end, - first: start - }), - frameRate: this.frameRate, - repeat: this.repeat, - }); - } - return animationConfig; - } - - getStateName(state: string, pet: IPet): string { - return `${state}-${pet.texture.key}`; - } - - getOneRandomState(pet: IPet): string { + getOneRandomState(pet: Pet): string { let randomStateIndex; do { - randomStateIndex = Phaser.Math.Between(0, pet.availableStates.length - 1); - } while (this.forbiddenRandomState.includes(pet.availableStates[randomStateIndex])); + randomStateIndex = Phaser.Math.Between( + 0, + pet.availableStates.length - 1 + ); + } while ( + this.FORBIDDEN_RAND_STATE.includes( + pet.availableStates[randomStateIndex] + ) + ); return pet.availableStates[randomStateIndex]; } - getOneRandomStateByPet(pet: IPet): string { + getOneRandomStateByPet(pet: Pet): string { return this.getOneRandomState(pet); } - playRandomState(pet: IPet): void { + playRandomState(pet: Pet): void { if (!pet.canPlayRandomState) return; this.switchState(pet, this.getOneRandomState(pet)); @@ -637,128 +611,140 @@ export default class Pets extends Phaser.Scene { // add delay to prevent spamming random state too fast setTimeout(() => { pet.canPlayRandomState = true; - }, this.randomStateDelay); + }, this.RAND_STATE_DELAY); } // this function is for when pet jump to the ground, it will call every time pet hit the ground - switchStateAfterPetJump(pet: IPet): void { + switchStateAfterPetJump(pet: Pet): void { if (!pet) return; - if (pet.anims && pet.anims.getName() !== this.getStateName('jump', pet)) return; + if ( + pet.anims && + pet.anims.getName() !== this.configManager.getStateName("jump", pet) + ) + return; - if (pet.availableStates.includes('fall')) { - this.switchState(pet, 'fall', { + if (pet.availableStates.includes("fall")) { + this.switchState(pet, "fall", { repeat: 0, }); // after fall animation complete, we play random state pet.canPlayRandomState = false; - pet.on('animationcomplete', () => { + pet.on("animationcomplete", () => { pet.canPlayRandomState = true; this.playRandomState(pet); }); - return + return; } this.playRandomState(pet); } - getPetGroundPosition(pet: IPet): number { - return this.physics.world.bounds.height - pet.height * Math.abs(pet.scaleY) * pet.originY; + getPetGroundPosition(pet: Pet): number { + return ( + this.physics.world.bounds.height - + pet.height * Math.abs(pet.scaleY) * pet.originY + ); } - getPetTopPosition(pet: IPet): number { + getPetTopPosition(pet: Pet): number { return pet.height * Math.abs(pet.scaleY) * pet.originY; } - getPetLeftPosition(pet: IPet): number { + getPetLeftPosition(pet: Pet): number { return pet.width * Math.abs(pet.scaleX) * pet.originX; } - getPetRightPosition(pet: IPet): number { - return this.physics.world.bounds.width - pet.width * Math.abs(pet.scaleX) * pet.originX; + getPetRightPosition(pet: Pet): number { + return ( + this.physics.world.bounds.width - + pet.width * Math.abs(pet.scaleX) * pet.originX + ); } - getPetBoundDown(pet: IPet): boolean { + getPetBoundDown(pet: Pet): boolean { // we have to check * with scaleY because sometimes user scale the pet return pet.y >= this.getPetGroundPosition(pet); } - getPetBoundLeft(pet: IPet): boolean { + getPetBoundLeft(pet: Pet): boolean { return pet.x <= this.getPetLeftPosition(pet); } - getPetBoundRight(pet: IPet): boolean { + getPetBoundRight(pet: Pet): boolean { return pet.x >= this.getPetRightPosition(pet); } - getPetBoundTop(pet: IPet): boolean { + getPetBoundTop(pet: Pet): boolean { return pet.y <= this.getPetTopPosition(pet); } - turnOnIgnoreCursorEvents(): void { - if (!this.isIgnoreCursorEvents) { - // slight delay to avoid crash when call setIgnoreCursorEvents too fast - setTimeout(() => { - appWindow.setIgnoreCursorEvents(true).then(() => { - this.isIgnoreCursorEvents = true; - }); - }, this.setIgnoreCursorEventsDelay); - } - } - - turnOffIgnoreCursorEvents(): void { - if (this.isIgnoreCursorEvents) { - appWindow.setIgnoreCursorEvents(false).then(() => { - this.isIgnoreCursorEvents = false; - }) - } - } - updatePetAboveTaskbar(): void { if (this.allowPetAboveTaskbar) { // get taskbar height - const taskbarHeight = window.screen.height - window.screen.availHeight + const taskbarHeight = + window.screen.height - window.screen.availHeight; // update world bounds to include task bar - this.physics.world.setBounds(0, 0, window.screen.width, window.screen.height - taskbarHeight); + this.physics.world.setBounds( + 0, + 0, + window.screen.width, + window.screen.height - taskbarHeight + ); return; } - this.physics.world.setBounds(0, 0, window.screen.width, window.screen.height); + this.physics.world.setBounds( + 0, + 0, + window.screen.width, + window.screen.height + ); } - petJumpOrPlayRandomState(pet: IPet): void { + petJumpOrPlayRandomState(pet: Pet): void { if (!pet) return; - if (pet.availableStates.includes('jump')) { - this.switchState(pet, 'jump'); - return + if (pet.availableStates.includes("jump")) { + this.switchState(pet, "jump"); + return; } this.switchState(pet, this.getOneRandomState(pet)); } - petOnTheGroundPlayRandomState(pet: IPet): void { - if (!pet) return; + petOnTheGroundPlayRandomState(pet: Pet): void { + if (!pet) { + return; + } switch (pet.anims.getName()) { - case this.getStateName('climb', pet): + case this.configManager.getStateName("climb", pet): return; - case this.getStateName('crawl', pet): + case this.configManager.getStateName("crawl", pet): return; - case this.getStateName('drag', pet): + case this.configManager.getStateName("drag", pet): return; - case this.getStateName('jump', pet): + case this.configManager.getStateName("jump", pet): return; } const random = Phaser.Math.Between(0, 2000); - if (pet.anims && pet.anims.getName() === this.getStateName('walk', pet)) { + if ( + pet.anims && + pet.anims.getName() === this.configManager.getStateName("walk", pet) + ) { if (random >= 0 && random <= 5) { - this.switchState(pet, 'idle'); + this.switchState(pet, "idle"); setTimeout(() => { - if (pet.anims && pet.anims.getName() !== this.getStateName('idle', pet)) return - this.switchState(pet, 'walk'); + if ( + pet.anims && + pet.anims.getName() !== + this.configManager.getStateName("idle", pet) + ) + return; + this.switchState(pet, "walk"); }, Phaser.Math.Between(3000, 6000)); return; } @@ -766,26 +752,26 @@ export default class Pets extends Phaser.Scene { // enhance random state if pet is not walk if (random >= 777 && random <= 800) { this.playRandomState(pet); - return + return; } } // just some random number to play random state if (random >= 888 && random <= 890) { - // allow random flip only after pet flipped "flipDelay" time + // allow random flip only after pet flipped "FLIP_DELAY" time if (pet.canRandomFlip) { this.toggleFlipXThenUpdateDirection(pet); pet.canRandomFlip = false; // add delay to prevent spamming pet flip too fast setTimeout(() => { - pet.canRandomFlip = true - }, this.flipDelay); + pet.canRandomFlip = true; + }, this.FLIP_DELAY); } } else if (random >= 777 && random <= 780) { this.playRandomState(pet); } else if (random >= 170 && random <= 175) { - this.switchState(pet, 'walk'); + this.switchState(pet, "walk"); } } @@ -797,9 +783,9 @@ export default class Pets extends Phaser.Scene { if (!pet) continue; switch (pet.anims.getName()) { - case this.getStateName('drag', pet): + case this.configManager.getStateName("drag", pet): continue; - case this.getStateName('jump', pet): + case this.configManager.getStateName("jump", pet): continue; } @@ -808,14 +794,24 @@ export default class Pets extends Phaser.Scene { if (random === 78) { let newPetx = pet.x; // if pet climb, I want the pet to have some opposite x direction when jump - if (pet.anims && pet.anims.getName() === this.getStateName('climb', pet)) { + if ( + pet.anims && + pet.anims.getName() === + this.configManager.getStateName("climb", pet) + ) { // if pet.scaleX is negative, it means pet is facing left, vice versa - newPetx = pet.scaleX < 0 ? Phaser.Math.Between(pet.x, 500) : Phaser.Math.Between(pet.x, this.physics.world.bounds.width - 500); + newPetx = + pet.scaleX < 0 + ? Phaser.Math.Between(pet.x, 500) + : Phaser.Math.Between( + pet.x, + this.physics.world.bounds.width - 500 + ); } // disable body to prevent shaking when jump if (pet.body!.enable) pet.body!.enable = false; - this.switchState(pet, 'jump'); + this.switchState(pet, "jump"); // use tween animation to make jump more smooth this.tweens.add({ targets: pet, @@ -828,14 +824,18 @@ export default class Pets extends Phaser.Scene { pet.body!.enable = true; this.switchStateAfterPetJump(pet); } - } + }, }); - return + return; } // add random pause when climb if (random >= 0 && random <= 5) { - if (pet.anims && pet.anims.getName() === this.getStateName('climb', pet)) { + if ( + pet.anims && + pet.anims.getName() === + this.configManager.getStateName("climb", pet) + ) { pet.anims.pause(); this.updateDirection(pet, Direction.UNKNOWN); // @ts-ignore @@ -847,7 +847,11 @@ export default class Pets extends Phaser.Scene { } }, Phaser.Math.Between(3000, 6000)); return; - } else if (pet.anims && pet.anims.getName() === this.getStateName('crawl', pet)) { + } else if ( + pet.anims && + pet.anims.getName() === + this.configManager.getStateName("crawl", pet) + ) { // add random pause when crawl pet.anims.pause(); this.updateDirection(pet, Direction.UNKNOWN); @@ -857,7 +861,12 @@ export default class Pets extends Phaser.Scene { if (pet.anims && !pet.anims.isPlaying) { pet.anims.resume(); // if pet.scaleX is negative, it means pet is facing up side left, vice versa - this.updateDirection(pet, pet.scaleX < 0 ? Direction.UPSIDELEFT : Direction.UPSIDERIGHT); + this.updateDirection( + pet, + pet.scaleX < 0 + ? Direction.UPSIDELEFT + : Direction.UPSIDERIGHT + ); } }, Phaser.Math.Between(3000, 6000)); return; @@ -866,14 +875,14 @@ export default class Pets extends Phaser.Scene { } } - petBeyondScreenSwitchClimb(pet: IPet, worldBounding: IWorldBounding): void { + petBeyondScreenSwitchClimb(pet: Pet, worldBounding: IWorldBounding): void { if (!pet) return; // if pet is climb and crawl, we don't want to switch state again switch (pet.anims.getName()) { - case this.getStateName('climb', pet): + case this.configManager.getStateName("climb", pet): return; - case this.getStateName('crawl', pet): + case this.configManager.getStateName("crawl", pet): return; } @@ -881,8 +890,11 @@ export default class Pets extends Phaser.Scene { // pet.availableStates = pet.availableStates.filter(state => state !== 'climb'); if (worldBounding.left || worldBounding.right) { - if (pet.availableStates.includes('climb') && this.allowPetClimbing) { - this.switchState(pet, 'climb'); + if ( + pet.availableStates.includes("climb") && + this.allowPetClimbing + ) { + this.switchState(pet, "climb"); const lastPetX = pet.x; // const lastPetX = pet.x + pet.width * Math.abs(pet.scaleX) * pet.originX; @@ -894,17 +906,22 @@ export default class Pets extends Phaser.Scene { * pet body when drag, the pet will go back with absolute value of pet.x * so i get lastPetX to minus with petLeftPosition to get the correct position */ - pet.setPosition(lastPetX - this.getPetLeftPosition(pet), pet.y); + pet.setPosition( + lastPetX - this.getPetLeftPosition(pet), + pet.y + ); this.setPetLookToTheLeft(pet, true); } else { - pet.setPosition(lastPetX + this.getPetRightPosition(pet), pet.y); + pet.setPosition( + lastPetX + this.getPetRightPosition(pet), + pet.y + ); this.setPetLookToTheLeft(pet, false); } } else { if (worldBounding.down) { // if pet on the ground and beyond screen and doesn't have climb state, we flip the pet this.toggleFlipXThenUpdateDirection(pet); - } else { // if pet bounding left or right and not on the ground, we make the pet jump or spawn on the ground this.petJumpOrPlayRandomState(pet); @@ -913,7 +930,11 @@ export default class Pets extends Phaser.Scene { } else { if (worldBounding.down) { // if pet is on the ground after being dragged and they are not bounding left or right, we play random state - if (pet.anims && pet.anims.getName() === this.getStateName('drag', pet)) { + if ( + pet.anims && + pet.anims.getName() === + this.configManager.getStateName("drag", pet) + ) { this.switchState(pet, this.getOneRandomState(pet)); } } else { @@ -922,18 +943,4 @@ export default class Pets extends Phaser.Scene { } } } - - detectMouseOverPet(clientX: number, clientY: number): boolean { - // if not pixel perfect, we can detect mouse over pet using this (with loop through pets array) - // return Phaser.Geom.Rectangle.Contains(this.pets[0].getBounds(), clientX, clientY); - - // divide clientX,Y by window.devicePixelRatio because the game world is not scaled by devicePixelRatio, and the mouse position we get is scaled by devicePixelRatio - this.input.mousePointer.x = clientX / window.devicePixelRatio; - this.input.mousePointer.y = clientY / window.devicePixelRatio; - - // this returns an array of all objects that the pointer is currently over, - // if array length > 0, it means the pointer is over some sprite object - return this.input.hitTestPointer(this.input.activePointer).length > 0 - } - -} \ No newline at end of file +} diff --git a/src/scenes/manager.ts b/src/scenes/manager.ts new file mode 100644 index 0000000..86846c1 --- /dev/null +++ b/src/scenes/manager.ts @@ -0,0 +1,346 @@ +import { convertFileSrc, invoke } from "@tauri-apps/api/tauri"; +import { ISpriteConfig, SpriteType } from "../types/ISpriteConfig"; +import { appWindow } from "@tauri-apps/api/window"; +import { error } from "tauri-plugin-log-api"; + +export class ConfigManager { + // Config for sprite sheet that's going to be loaded + private spriteConfig: ISpriteConfig[] = []; + // Phaser loader plugin + private load: Phaser.Loader.LoaderPlugin | undefined; + // Phaser texture manager + private textures: Phaser.Textures.TextureManager | undefined; + // Phaser anims manager + private anims: Phaser.Animations.AnimationManager | undefined; + // List of registered sprite name to avoid loading duplicate sprite + private registeredName: Map<string, boolean> = new Map(); + + // constants + // fps for sprite animation + public readonly FRAME_RATE: number; + // repeat for sprite animation after it's done, -1 means repeat forever + private readonly REPEAT: number = -1; + + constructor({ + FRAME_RATE, + }: { + FRAME_RATE: number; + }) { + this.FRAME_RATE = FRAME_RATE; + } + + public loadAllSpriteSheet(): void { + try { + if (!this.spriteConfig) { + return; + } + + this.spriteConfig.forEach((sprite) => { + this.loadSpriteSheet(sprite); + }); + } catch (error) { + console.log("Error in ConfigManager loadAllSpriteSheet()", error); + } + } + + public registerSpriteStateAnimation(sprite: ISpriteConfig): void { + if (!this.anims) { + error("Anims manager is not set"); + return; + } + + if (!this.load) { + error("Loader manager is not set"); + return; + } + + // avoid showing broken sprite + if (!this.validatePetSprite(sprite)) return; + + // in case sprite hasn't loaded yet, we load it + if (this.textures && !this.textures.exists(sprite.name)) { + this.loadSpriteSheet(sprite); + this.load.start(); + + this.load.once("complete", () => { + // if loaded, try to register state animation again + this.registerSpriteStateAnimation(sprite); + }); + return; + } + + // convert sprite states to lowercase because it help to avoid error when user edit their own json file and type state in uppercase + for (const state in sprite.states) { + if (state.toLowerCase() !== state) { + sprite.states[state.toLowerCase()] = sprite.states[state]; + delete sprite.states[state]; + } + } + + // register state animations for the sprite + for (const animationConfig of this.getAnimationConfigPerSprite( + sprite + )) { + if (!this.anims.exists(animationConfig.key)) { + this.anims.create(animationConfig); + } + } + } + + public setConfigManager({ + load, + textures, + anims, + }: { + load: Phaser.Loader.LoaderPlugin; + textures: Phaser.Textures.TextureManager; + anims: Phaser.Animations.AnimationManager; + }): void { + this.load = load; + this.textures = textures; + this.anims = anims; + } + + public setSpriteConfig(spriteConfig: ISpriteConfig[]): void { + this.spriteConfig = spriteConfig; + } + + public getSpriteConfig(): ISpriteConfig[] { + return this.spriteConfig; + } + + private loadSpriteSheet(sprite: ISpriteConfig): void { + if (!this.load) { + error("Loader manager is not set"); + return; + } + + // if sprite name is duplicate, we skip it because we can use the same key for different sprite object + if (this.checkDuplicateName(sprite.name)) { + return; + } + // if pet sprite is not valid, we skip it to avoid error + if (!this.validatePetSprite(sprite)) { + return; + } + + this.load.spritesheet({ + key: sprite.name, + url: + sprite.type === SpriteType.CUSTOM + ? convertFileSrc(sprite.imageSrc) + : sprite.imageSrc, + frameConfig: this.getFrameSize(sprite), + }); + } + + private getAnimationConfigPerSprite(sprite: ISpriteConfig): { + key: string; + frames: Phaser.Types.Animations.AnimationFrame[]; + frameRate: number; + repeat: number; + }[] { + if (!sprite.states) { + return []; + } + + if (!this.anims) { + error("Anims manager is not set"); + return []; + } + + let animationConfig = []; + const HighestFrameMax = this.getHighestFrameMax(sprite); + for (const state in sprite.states) { + // we accept to type of state input, either start, end or spriteLine, frameMax + // -1 because phaser frame start from 0 + const start = + sprite.states[state].start !== undefined + ? sprite.states[state].start! - 1 + : (sprite.states[state].spriteLine! - 1) * HighestFrameMax; + const end = + sprite.states[state].end !== undefined + ? sprite.states[state].end! - 1 + : start + sprite.states[state].frameMax! - 1; + + animationConfig.push({ + // avoid duplicate key + key: `${state}-${sprite.name}`, + frames: this.anims.generateFrameNumbers(sprite.name, { + // -1 because phaser frame start from 0 + start: start, + end: end, + first: start, + }), + frameRate: this.FRAME_RATE, + repeat: this.REPEAT, + }); + } + return animationConfig; + } + + public getStateName( + state: string, + pet: Phaser.Types.Physics.Arcade.SpriteWithDynamicBody + ): string { + return `${state}-${pet.texture.key}`; + } + + private getHighestFrameMax(sprite: ISpriteConfig): number { + if (sprite.highestFrameMax) { + return sprite.highestFrameMax; + } + + let highestFrameMax = 0; + for (const state in sprite.states) { + // if frameMax doesn't exist in sprite.states[state] maybe the user specify specific position using start, end + if (!sprite.states[state].frameMax!) return 0; + highestFrameMax = Math.max( + highestFrameMax, + sprite.states[state].frameMax! + ); + } + + return highestFrameMax; + } + + public getFrameSize(sprite: ISpriteConfig): { + frameWidth: number; + frameHeight: number; + } { + if (sprite.frameSize) { + return { + frameWidth: sprite.frameSize, + frameHeight: sprite.frameSize, + }; + } + + const frameWidth = sprite.width! / sprite.highestFrameMax!; + const frameHeight = sprite.height! / sprite.totalSpriteLine!; + return { frameWidth, frameHeight }; + } + + private checkDuplicateName(name: string): boolean { + if (this.registeredName.has(name)) { + console.log(`Sprite name ${name} is already registered`); + return true; + } + this.registeredName.set(name, true); + return false; + } + + private validatePetSprite(sprite: ISpriteConfig): boolean { + if (!sprite.name || !sprite.imageSrc || !sprite.states) { + // error(`Invalid sprite config: ${sprite.name ?? 'unknown name'}`); + return false; + } + + // technically we accept two type of size, user can either only provide frameSize, or width, height, highestFrameMax, totalSpriteLine for us to calculate frameSize + if ( + !sprite.frameSize && + (!sprite.width || + !sprite.height || + !sprite.highestFrameMax || + !sprite.totalSpriteLine) + ) { + // error(`Invalid sprite config: ${sprite.name}`); + return false; + } + + for (const state in sprite.states) { + if ( + (!sprite.states[state].spriteLine || + !sprite.states[state].frameMax) && + (!sprite.states[state].start || !sprite.states[state].end) + ) { + // error(`Invalid sprite config: ${sprite.name}`); + return false; + } + } + + return true; + } +} + +export class InputManager { + private input: Phaser.Input.InputPlugin | undefined; + private isIgnoreCursorEvents: boolean = false; + + private readonly IGNORE_CURSOR_EVENTS_DELAY: number = 50; + + public setInputManager({ input }: { input: Phaser.Input.InputPlugin }) { + this.input = input; + } + + public checkIsMouseInOnPet(): void { + try { + invoke("get_mouse_position").then((event: any) => { + if (this.detectMouseOverPet(event.clientX, event.clientY)) { + this.turnOffIgnoreCursorEvents(); + return; + } + + this.turnOnIgnoreCursorEvents(); + }); + } catch (error) { + console.log("Error in InputManager checkIsMouseInOnPet()", error); + } + } + + public turnOffIgnoreCursorEvents(): void { + try { + if (this.isIgnoreCursorEvents) { + appWindow.setIgnoreCursorEvents(false).then(() => { + this.isIgnoreCursorEvents = false; + }); + } + } catch (error) { + console.log( + "Error in InputManager turnOffIgnoreCursorEvents()", + error + ); + } + } + + public turnOnIgnoreCursorEvents(): void { + try { + if (!this.isIgnoreCursorEvents) { + // slight delay to avoid crash when call setIgnoreCursorEvents too fast + setTimeout(() => { + appWindow.setIgnoreCursorEvents(true).then(() => { + this.isIgnoreCursorEvents = true; + }); + }, this.IGNORE_CURSOR_EVENTS_DELAY); + } + } catch (error) { + console.log( + "Error in InputManager turnOnIgnoreCursorEvents()", + error + ); + } + } + + private detectMouseOverPet(clientX: number, clientY: number): boolean { + try { + if (!this.input) { + return false; + } + + // if not pixel perfect, we can detect mouse over pet using this (with loop through pets array) + // return Phaser.Geom.Rectangle.Contains(this.pets[0].getBounds(), clientX, clientY); + + // divide clientX,Y by window.devicePixelRatio because the game world is not scaled by devicePixelRatio, and the mouse position we get is scaled by devicePixelRatio + this.input.mousePointer.x = clientX / window.devicePixelRatio; + this.input.mousePointer.y = clientY / window.devicePixelRatio; + + // this returns an array of all objects that the pointer is currently over, + // if array length > 0, it means the pointer is over some sprite object + return ( + this.input.hitTestPointer(this.input.activePointer).length > 0 + ); + } catch (error) { + console.log("Error in InputManager detectMouseOverPet()", error); + return false; + } + } +} diff --git a/src/types/IEvents.ts b/src/types/IEvents.ts index 6a670de..32c90ee 100644 --- a/src/types/IEvents.ts +++ b/src/types/IEvents.ts @@ -13,11 +13,6 @@ export type TRenderEventListener = { id: number, } -export interface IEmitReRenderPetsEvent { - dispatchType: DispatchType; - newValue?: boolean | string | ISpriteConfig | number; -} - export enum EventType { SettingWindowToPetOverlay = 'settingWindowToPetOverlay', } diff --git a/src/types/ISetting.ts b/src/types/ISetting.ts index bf6ecaa..480aed5 100644 --- a/src/types/ISetting.ts +++ b/src/types/ISetting.ts @@ -1,6 +1,4 @@ import { MemoExoticComponent } from "react"; -import { ISpriteConfig } from "./ISpriteConfig"; -import { DispatchType } from "./IEvents"; export interface IGetAppSetting { withErrorDialog?: boolean, @@ -8,15 +6,6 @@ export interface IGetAppSetting { key?: string, } -export interface ISetSetting extends IGetAppSetting { - setKey: string, - newValue: unknown, -} - -export interface ISetConfig extends IGetAppSetting { - newConfig: unknown, -} - export enum ColorSchemeType { Light = "light", Dark = "dark", @@ -24,13 +13,6 @@ export enum ColorSchemeType { export type ColorScheme = ColorSchemeType.Light | ColorSchemeType.Dark; -export interface IHandleSettingChange { - ( - dispatchType: DispatchType, - newValue: string | boolean | ISpriteConfig | number, - ): void; -} - export enum ESettingTab { MyPets = 0, PetShop = 1, @@ -48,14 +30,6 @@ export interface ISettingTabs { tab: ESettingTab, } -export interface ISettingsContent { - title: string, - description: string, - checked: boolean, - dispatchType: DispatchType, - component?: React.ReactNode, -} - export enum DefaultConfigName { PET_LINKER = "pet_linker.json", } \ No newline at end of file diff --git a/src/ui/setting_tabs/Settings.tsx b/src/ui/setting_tabs/Settings.tsx index 11e6df5..96eb2c2 100644 --- a/src/ui/setting_tabs/Settings.tsx +++ b/src/ui/setting_tabs/Settings.tsx @@ -4,7 +4,6 @@ import languages from "../../locale/languages"; import SettingSwitch from "./settings/SettingSwitch"; import { useTranslation } from "react-i18next"; import { handleSettingChange } from "../../utils/handleSettingChange"; -import { ISettingsContent } from "../../types/ISetting"; import { useSettingStore } from "../../hooks/useSettingStore"; import { memo, useCallback } from "react"; import { IconLanguage } from "@tabler/icons-react"; @@ -12,6 +11,14 @@ import { invoke } from "@tauri-apps/api/tauri"; import SettingButton from "./settings/SettingButton"; import { DispatchType } from "../../types/IEvents"; +interface ISettingsContent { + title: string, + description: string, + checked: boolean, + dispatchType: DispatchType, + component?: React.ReactNode, +} + function Settings() { const { t, i18n } = useTranslation(); const { allowAutoStartUp, allowPetAboveTaskbar, allowPetInteraction, allowOverridePetScale, petScale, allowPetClimbing } = useSettingStore(); diff --git a/src/utils/event.ts b/src/utils/event.ts index d5109c4..919056a 100644 --- a/src/utils/event.ts +++ b/src/utils/event.ts @@ -1,5 +1,11 @@ import { WebviewWindow } from '@tauri-apps/api/window' -import { EventType, IEmitReRenderPetsEvent } from '../types/IEvents'; +import { DispatchType, EventType } from '../types/IEvents'; +import { ISpriteConfig } from '../types/ISpriteConfig'; + +interface IEmitReRenderPetsEvent { + dispatchType: DispatchType; + newValue?: boolean | string | ISpriteConfig | number; +} export const emitUpdatePetsEvent = async ({dispatchType, newValue}: IEmitReRenderPetsEvent) => { // get the window instance by its label diff --git a/src/utils/handleSettingChange.ts b/src/utils/handleSettingChange.ts index 38b943d..199459e 100644 --- a/src/utils/handleSettingChange.ts +++ b/src/utils/handleSettingChange.ts @@ -1,11 +1,18 @@ import { setSettings, toggleAutoStartUp } from "./settings"; -import { ColorScheme, IHandleSettingChange } from "../types/ISetting"; +import { ColorScheme } from "../types/ISetting"; import { useSettingStore } from "../hooks/useSettingStore"; import { emitUpdatePetsEvent } from "./event"; import i18next from "i18next"; import { info } from "tauri-plugin-log-api"; import { DispatchType } from "../types/IEvents"; +import { ISpriteConfig } from "../types/ISpriteConfig"; +interface IHandleSettingChange { + ( + dispatchType: DispatchType, + newValue: string | boolean | ISpriteConfig | number, + ): void; +} export const handleSettingChange: IHandleSettingChange = ( dispatchType, newValue diff --git a/src/utils/settings.ts b/src/utils/settings.ts index 84dd445..a9e6d5d 100644 --- a/src/utils/settings.ts +++ b/src/utils/settings.ts @@ -1,6 +1,6 @@ import { enable, isEnabled, disable } from "tauri-plugin-autostart-api"; import { Store } from "tauri-plugin-store-api"; -import { DefaultConfigName, IGetAppSetting, ISetConfig, ISetSetting } from "../types/ISetting"; +import { DefaultConfigName, IGetAppSetting } from "../types/ISetting"; import { invoke } from '@tauri-apps/api/tauri' import { readTextFile, exists, copyFile, BaseDirectory, createDir } from "@tauri-apps/api/fs" import { confirm } from "@tauri-apps/api/dialog"; @@ -39,6 +39,10 @@ export async function getAppSettings({ configName = "settings.json", key = "app" // set a specific key under object app // exp: { app: { key: value } } +interface ISetSetting extends IGetAppSetting { + setKey: string, + newValue: unknown, +} export function setSettings({ configName = "settings.json", key = "app", setKey, newValue }: ISetSetting) { (async () => { let setting: any = await getAppSettings({ configName }); @@ -52,6 +56,9 @@ export function setSettings({ configName = "settings.json", key = "app", setKey, } // this function differs from setSettings because it will replace the whole config file, not just some specific key +export interface ISetConfig extends IGetAppSetting { + newConfig: unknown, +} export function setConfig({ configName = "settings.json", key = "app", newConfig }: ISetConfig) { (async () => { const configPath: string = await invoke("combine_config_path", { config_name: configName });