diff --git a/Cargo.lock b/Cargo.lock index 8ead66f..f260de8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -280,6 +280,15 @@ dependencies = [ "half", ] +[[package]] +name = "codee" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af40247be877a1e3353fb406aa27ab3ef4bd3ff18cef91e75e667bfa3fde701d" +dependencies = [ + "thiserror", +] + [[package]] name = "collection_literals" version = "1.0.1" @@ -387,12 +396,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -405,21 +414,21 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.11.1", "syn 2.0.60", ] @@ -436,11 +445,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.8", + "darling_core 0.20.10", "quote", "syn 2.0.60", ] @@ -464,7 +473,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fa90da96b8fd491f5754d1f7a731f73921e3b7aa0ce333c821a0e43666ac14" dependencies = [ - "darling 0.20.8", + "darling 0.20.10", "proc-macro2", "quote", "syn 2.0.60", @@ -478,10 +487,10 @@ dependencies = [ "console_log", "copy_dir", "leptos", + "leptos-use", "leptos_hotkeys", "leptos_meta", "leptos_router", - "leptos_theme", "log", ] @@ -505,6 +514,17 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "drain_filter_polyfill" version = "0.1.3" @@ -618,12 +638,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" - [[package]] name = "futures-util" version = "0.3.30" @@ -661,12 +675,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "gloo-net" version = "0.5.0" @@ -916,9 +924,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -951,12 +959,13 @@ dependencies = [ [[package]] name = "leptos-use" -version = "0.10.9" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad1b68e891bbd9bd047f45951413313bdcfcfeb82870494b5e78ae5a8ccee09" +checksum = "268b9df23d8c68ed0518c39d6f0d3b99fcbe30190a6dce4a7e5f342027ab0033" dependencies = [ "async-trait", "cfg-if", + "codee", "cookie", "default-struct-builder", "futures-util", @@ -966,9 +975,8 @@ dependencies = [ "lazy_static", "leptos", "paste", - "serde", - "serde_json", "thiserror", + "unic-langid", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -1195,22 +1203,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "leptos_theme" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566714b896f24ba6249632e5331638f41b360145a09096c9c6db37322d526c01" -dependencies = [ - "console_log", - "leptos", - "leptos-use", - "rstest", - "serde", - "serde_json", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "libc" version = "0.2.154" @@ -1609,41 +1601,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" -[[package]] -name = "relative-path" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" - -[[package]] -name = "rstest" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97eeab2f3c0a199bc4be135c36c924b6590b88c377d416494288c14f2db30199" -dependencies = [ - "futures", - "futures-timer", - "rstest_macros", - "rustc_version", -] - -[[package]] -name = "rstest_macros" -version = "0.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d428f8247852f894ee1be110b375111b586d4fa431f6c46e64ba5a0dcccbe605" -dependencies = [ - "cfg-if", - "glob", - "proc-macro2", - "quote", - "regex", - "relative-path", - "rustc_version", - "syn 2.0.60", - "unicode-ident", -] - [[package]] name = "rstml" version = "0.11.2" @@ -1670,15 +1627,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - [[package]] name = "rustversion" version = "1.0.15" @@ -1712,12 +1660,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58bf37232d3bb9a2c4e641ca2a11d83b5062066f88df7fed36c28772046d65ba" -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - [[package]] name = "send_wrapper" version = "0.6.0" @@ -1946,6 +1888,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "syn" version = "1.0.109" @@ -1994,18 +1942,18 @@ checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", @@ -2043,6 +1991,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2240,6 +2197,24 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "unic-langid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23dd9d1e72a73b25e07123a80776aae3e7b0ec461ef94f9151eed6ec88005a44" +dependencies = [ + "unic-langid-impl", +] + +[[package]] +name = "unic-langid-impl" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a5422c1f65949306c99240b81de9f3f15929f5a8bfe05bb44b034cc8bf593e5" +dependencies = [ + "tinystr", +] + [[package]] name = "unicase" version = "2.7.0" @@ -2332,19 +2307,20 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -2369,9 +2345,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2379,9 +2355,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -2392,9 +2368,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-streams" @@ -2411,9 +2387,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 724efb4..5680789 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,11 @@ members = ["leptos_hotkeys", "examples/demo", "examples/ssr-demo"] resolver = "2" +[workspace.dependencies] +wasm-bindgen = "=0.2.93" +web-sys = "=0.3.70" + + [profile.wasm-release] inherits = "release" opt-level = "z" diff --git a/examples/demo/Cargo.toml b/examples/demo/Cargo.toml index f3b6eb0..3f9e868 100644 --- a/examples/demo/Cargo.toml +++ b/examples/demo/Cargo.toml @@ -11,5 +11,5 @@ copy_dir = "0.1" leptos_meta = "0.6" leptos_router = { version = "0.6", features = ["csr"] } log = "0.4" -leptos_theme = "0.1" leptos_hotkeys = { path = "../../leptos_hotkeys", features = ["debug"] } +leptos-use = "0.12.0" \ No newline at end of file diff --git a/examples/demo/src/app.rs b/examples/demo/src/app.rs index e527629..7267fbc 100644 --- a/examples/demo/src/app.rs +++ b/examples/demo/src/app.rs @@ -5,7 +5,6 @@ use leptos_hotkeys::{ }; use leptos_meta::*; use leptos_router::*; -use leptos_theme::{use_theme, Theme, ThemeProvider}; #[component] pub fn Button(href: &'static str, children: Children) -> impl IntoView { @@ -25,14 +24,12 @@ pub fn App() -> impl IntoView { view! {
- -
} } @@ -43,7 +40,6 @@ fn HomePage() -> impl IntoView { "border border-1 border-[#1a1a1a] dark:border-[#fdfdfd] p-8 space-y-20 h-full"; let current_scope = create_rw_signal("scope_a"); let is_green = create_rw_signal(true); - let current_theme = use_theme(); // leptos_hotkey specific logic fn go_to_link(key: &'static str, link: String, scope: &'static str) { @@ -91,15 +87,6 @@ fn HomePage() -> impl IntoView { set_count.set(0); }); - // scope_b related hotkeys - use_hotkeys!(("keyT", "scope_b") => move |_| { - if current_theme.get() == Theme::Light { - current_theme.set(Theme::Dark) - } else { - current_theme.set(Theme::Light) - } - }); - let a_ref = create_node_ref::(); use_hotkeys_ref!((a_ref, "digit6", "scope_a") => move |_| { if is_green.get() { diff --git a/examples/ssr-demo/Cargo.toml b/examples/ssr-demo/Cargo.toml index 1ef2c3a..caa4f83 100644 --- a/examples/ssr-demo/Cargo.toml +++ b/examples/ssr-demo/Cargo.toml @@ -16,7 +16,7 @@ leptos_router = { version = "0.6", features = ["nightly"] } tokio = { version = "1", features = ["rt-multi-thread"], optional = true } tower = { version = "0.4", optional = true } tower-http = { version = "0.5", features = ["fs"], optional = true } -wasm-bindgen = "=0.2.92" +wasm-bindgen.workspace = true thiserror = "1" tracing = { version = "0.1", optional = true } http = "1" diff --git a/leptos_hotkeys/Cargo.toml b/leptos_hotkeys/Cargo.toml index 89a38c3..dc01da4 100644 --- a/leptos_hotkeys/Cargo.toml +++ b/leptos_hotkeys/Cargo.toml @@ -12,8 +12,8 @@ keywords = ["leptos", "hotkeys", "wasm"] [dependencies] leptos = "0.6" log = { version = "0.4", optional = true } -wasm-bindgen = "0.2" -web-sys = "0.3" +wasm-bindgen.workspace = true +web-sys.workspace = true [features] debug = ["dep:log"]