From 66931e50040913368531da7faad94fa0fa685428 Mon Sep 17 00:00:00 2001 From: Matt Hunzinger Date: Thu, 4 Apr 2024 15:34:33 -0400 Subject: [PATCH] Update to dioxus v0.5 --- Cargo.lock | 1249 +++++++++++++++++--------- Cargo.toml | 8 +- lookbook/src/main.rs | 20 +- lookbook/src/previews/button.rs | 9 +- lookbook/src/previews/chip.rs | 9 +- lookbook/src/previews/tab_row.rs | 9 +- lookbook/src/previews/text_button.rs | 9 +- lookbook/src/previews/text_field.rs | 14 +- src/button.rs | 62 +- src/chip.rs | 34 +- src/dialog.rs | 12 +- src/icon.rs | 17 +- src/menu.rs | 2 +- src/navigation_rail.rs | 32 +- src/ripple.rs | 23 +- src/tab.rs | 6 +- src/tab_row.rs | 57 +- src/text_field.rs | 42 +- src/theme.rs | 21 +- src/use_ripple.rs | 30 +- 20 files changed, 1040 insertions(+), 625 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ea2a393..e3db0d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[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", "once_cell", @@ -14,10 +14,22 @@ dependencies = [ ] [[package]] -name = "anyhow" -version = "1.0.75" +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "anymap2" @@ -32,30 +44,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", "futures-core", ] +[[package]] +name = "async-channel" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" +dependencies = [ + "concurrent-queue", + "event-listener 5.2.0", + "event-listener-strategy 0.5.1", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-lock" -version = "2.8.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener", + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", + "pin-project-lite", ] [[package]] name = "async-task" -version = "4.5.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", @@ -70,9 +97,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "bincode" @@ -91,20 +118,20 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] [[package]] name = "blocking" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c36a4d0d48574b3dd360b4b7d95cc651d2b6557b6402848a27d4b228a473e2a" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel", + "async-channel 2.2.0", "async-lock", "async-task", "fastrand", @@ -116,38 +143,68 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[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" [[package]] -name = "cfg-if" -version = "1.0.0" +name = "camino" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] [[package]] -name = "colored" -version = "2.0.4" +name = "cargo-platform" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2674ec482fbc38012cf31e6c42ba0177b431a0cb6f15fe40efa5aab1bda516f6" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ - "is-terminal", - "lazy_static", - "windows-sys 0.48.0", + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", ] +[[package]] +name = "cfg-expr" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "concurrent-queue" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -169,19 +226,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" [[package]] -name = "crossbeam-utils" -version = "0.8.16" +name = "convert_case" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" dependencies = [ - "cfg-if", + "unicode-segmentation", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + [[package]] name = "darling" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ "darling_core", "darling_macro", @@ -189,9 +252,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", @@ -202,9 +265,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", @@ -212,51 +275,120 @@ dependencies = [ ] [[package]] -name = "deranged" -version = "0.3.9" +name = "dioxus" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "804134b0ea229772d5841e8bc19b8e41a5b93cb6f6a7d28fdf24cbd44d373687" dependencies = [ - "powerfmt", + "dioxus-config-macro 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-core-macro 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-hooks 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-hot-reload 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-html 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-signals 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "dioxus" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" dependencies = [ - "dioxus-core", - "dioxus-core-macro", - "dioxus-hooks", - "dioxus-hot-reload", - "dioxus-html", - "dioxus-rsx", + "dioxus-config-macro 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-core 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-core-macro 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-hooks 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-hot-reload 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-html 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-signals 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", +] + +[[package]] +name = "dioxus-cli-config" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" +dependencies = [ + "once_cell", + "serde", + "serde_json", + "tracing", +] + +[[package]] +name = "dioxus-config-macro" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe244197b320dec9e9f38742985fe98c058136ada770df73e9429878ed92863" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "dioxus-config-macro" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" +dependencies = [ + "proc-macro2", + "quote", ] [[package]] name = "dioxus-core" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51e22f08fd018c32e6aebd8defd45a8262570881f2d616670bc62a87ef4324c" +dependencies = [ + "futures-channel", + "futures-util", + "generational-box 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "longest-increasing-subsequence", + "rustc-hash", + "serde", + "slab", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "dioxus-core" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" dependencies = [ - "bumpalo", "futures-channel", "futures-util", + "generational-box 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "longest-increasing-subsequence", "rustc-hash", "serde", "slab", - "smallbox", "tracing", + "tracing-subscriber", ] [[package]] name = "dioxus-core-macro" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b59ee29f0273f78e0d5514b0efbec7d594de2a1c611b57fb507ce479731656ee" dependencies = [ "constcat", - "dioxus-core", - "dioxus-rsx", + "convert_case", + "dioxus-rsx 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "prettyplease", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dioxus-core-macro" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" +dependencies = [ + "constcat", + "convert_case", + "dioxus-rsx 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "prettyplease", "proc-macro2", "quote", @@ -271,12 +403,32 @@ checksum = "2ea539174bb236e0e7dc9c12b19b88eae3cb574dedbd0252a2d43ea7e6de13e2" [[package]] name = "dioxus-hooks" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "198eba79d71119d10b094ce69c5e2f3186359edb54e6b9a3219c9fed3f1990ed" dependencies = [ - "dioxus-core", + "dioxus-core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "dioxus-debug-cell", + "dioxus-signals 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures-channel", + "futures-util", + "generational-box 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab", + "thiserror", + "tracing", +] + +[[package]] +name = "dioxus-hooks" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" +dependencies = [ + "dioxus-core 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-debug-cell", + "dioxus-signals 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "futures-channel", + "futures-util", + "generational-box 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "slab", "thiserror", "tracing", @@ -284,12 +436,26 @@ dependencies = [ [[package]] name = "dioxus-hot-reload" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5a28a2af6655473c6521fb5a428538807b985e8e5f1a8c30e2ab71bd54e637" +dependencies = [ + "dioxus-core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-html 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-rsx 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "interprocess-docfix", + "serde", + "serde_json", +] + +[[package]] +name = "dioxus-hot-reload" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" dependencies = [ - "dioxus-core", - "dioxus-html", - "dioxus-rsx", + "dioxus-core 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-html 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-rsx 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "interprocess-docfix", "serde", "serde_json", @@ -297,35 +463,111 @@ dependencies = [ [[package]] name = "dioxus-html" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0db16306a568ec8f160d98420de7b553d572b2883572d321483903d8e252924" +dependencies = [ + "async-trait", + "dioxus-core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-html-internal-macro 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "enumset", + "euclid", + "futures-channel", + "generational-box 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "keyboard-types", + "serde", + "serde-value", + "serde_json", + "serde_repr", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "dioxus-html" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" dependencies = [ - "async-channel", "async-trait", - "dioxus-core", + "dioxus-core 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-html-internal-macro 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "enumset", "euclid", + "futures-channel", + "generational-box 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "keyboard-types", "serde", "serde-value", "serde_json", "serde_repr", + "tracing", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "dioxus-html-internal-macro" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1799f34affdb158f6ebec23b46b11f9e65de0bbadbbb781dc68c3eddfe6fd32b" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dioxus-html-internal-macro" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dioxus-interpreter-js" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aaacee7f371c92e3c284a10f59286ef3d328e3222fc39f6a96017dc2825c0fa" +dependencies = [ + "js-sys", + "md5", + "sledgehammer_bindgen", + "sledgehammer_utils", "wasm-bindgen", "web-sys", ] [[package]] name = "dioxus-interpreter-js" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" dependencies = [ "js-sys", + "md5", "sledgehammer_bindgen", "sledgehammer_utils", "wasm-bindgen", "web-sys", ] +[[package]] +name = "dioxus-lib" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" +dependencies = [ + "dioxus-core 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-core-macro 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-hooks 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-html 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-rsx 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-signals 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", +] + [[package]] name = "dioxus-logger" version = "0.4.1" @@ -340,26 +582,25 @@ dependencies = [ name = "dioxus-material" version = "0.1.0" dependencies = [ - "dioxus", + "dioxus 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "dioxus-logger", - "dioxus-resize-observer", - "dioxus-signals", + "dioxus-resize-observer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "dioxus-spring", - "dioxus-use-mounted", + "dioxus-use-mounted 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log", ] [[package]] name = "dioxus-material" version = "0.1.0" -source = "git+https://github.com/matthunz/dioxus-material#150553f12f160efcf186c72b39f00a86e438ff80" +source = "git+https://github.com/matthunz/dioxus-material#41bfc56b945f1777c970b0268dcc263ea4a6469b" dependencies = [ - "dioxus", + "dioxus 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "dioxus-logger", - "dioxus-resize-observer", - "dioxus-signals", + "dioxus-resize-observer 0.2.0 (git+https://github.com/dioxus-community/dioxus-resize-observer)", + "dioxus-signals 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "dioxus-spring", - "dioxus-use-mounted", + "dioxus-use-mounted 0.2.0 (git+https://github.com/matthunz/dioxus-use-mounted)", "log", ] @@ -367,21 +608,32 @@ dependencies = [ name = "dioxus-material-lookbook" version = "0.1.0" dependencies = [ - "dioxus", + "dioxus 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "dioxus-material 0.1.0 (git+https://github.com/matthunz/dioxus-material)", - "dioxus-web", + "dioxus-web 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "lookbook", ] [[package]] name = "dioxus-resize-observer" -version = "0.1.0" -source = "git+https://github.com/dioxus-community/dioxus-resize-observer#481585f6100075996782910b8a91e34c77573370" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb46ee826d452f51b7d378d4a5394f4770e4cc0630c57eb169cc23459a32f278" dependencies = [ - "dioxus", - "dioxus-signals", - "dioxus-use-mounted", - "dioxus-web", + "dioxus 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-use-mounted 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "dioxus-resize-observer" +version = "0.2.0" +source = "git+https://github.com/dioxus-community/dioxus-resize-observer#ee74edaaa24bf127809767a32b83425767874e64" +dependencies = [ + "dioxus 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-use-mounted 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "js-sys", "wasm-bindgen", "web-sys", @@ -389,17 +641,15 @@ dependencies = [ [[package]] name = "dioxus-router" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" dependencies = [ - "anyhow", - "dioxus", + "dioxus-cli-config", + "dioxus-lib", "dioxus-router-macro", - "futures-util", "gloo", "gloo-utils", "js-sys", - "thiserror", "tracing", "url", "urlencoding", @@ -409,8 +659,8 @@ dependencies = [ [[package]] name = "dioxus-router-macro" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" dependencies = [ "proc-macro2", "quote", @@ -420,37 +670,75 @@ dependencies = [ [[package]] name = "dioxus-rsx" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2425ff908a21219b142251f5d2151a5f67a3558889898eef5d83fc83c37fdaa" +dependencies = [ + "dioxus-core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "internment", + "krates", + "proc-macro2", + "quote", + "syn", + "tracing", +] + +[[package]] +name = "dioxus-rsx" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" dependencies = [ - "dioxus-core", + "dioxus-core 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "internment", + "krates", "proc-macro2", "quote", "syn", + "tracing", ] [[package]] name = "dioxus-signals" -version = "0.0.0" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5fa4ec45a13f3c00d30cbbdf967160b43f9a7c774c53fccdec000f9f07e1aaa" dependencies = [ - "dioxus-core", - "generational-box", - "simple_logger", + "dioxus-core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel", + "futures-util", + "generational-box 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell", + "parking_lot", + "rustc-hash", + "tracing", +] + +[[package]] +name = "dioxus-signals" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" +dependencies = [ + "dioxus-core 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "futures-channel", + "futures-util", + "generational-box 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "once_cell", + "parking_lot", + "rustc-hash", "tracing", ] [[package]] name = "dioxus-spring" -version = "0.1.0" -source = "git+https://github.com/matthunz/dioxus-spring#64e4e7732f042d2ed0bcd873940875188ddf9a4b" +version = "0.2.0-alpha.2" +source = "git+https://github.com/matthunz/dioxus-spring#438e9e6fbe328e18fa97104e5c511421464d0692" dependencies = [ - "async-channel", - "dioxus", + "async-channel 1.9.0", + "dioxus 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "dioxus-logger", - "dioxus-signals", - "dioxus-use-mounted", - "dioxus-web", + "dioxus-signals 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-use-mounted 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-web 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures", "interpolation", "js-sys", @@ -460,29 +748,61 @@ dependencies = [ "web-sys", ] -[[package]] -name = "dioxus-use-mounted" -version = "0.1.0" -source = "git+https://github.com/matthunz/dioxus-use-mounted#7f27c94bb6b2e63f175aeab06b671c0940e4bd15" -dependencies = [ - "dioxus", - "dioxus-signals", - "dioxus-web", -] - +[[package]] +name = "dioxus-use-mounted" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ff63e02229c2b75804d195c6fa457069cf3b5311572c34b6a1ced2c6bfc2c4e" +dependencies = [ + "dioxus 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dioxus-use-mounted" +version = "0.2.0" +source = "git+https://github.com/matthunz/dioxus-use-mounted#ed077b363b194f592c3e110652c022ebaec7bf86" +dependencies = [ + "dioxus 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dioxus-web" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "737b449ac5fce120d95abe2b0e159a5f40dfb7f8b4f8deb942abaf018bc45a16" +dependencies = [ + "async-trait", + "console_error_panic_hook", + "dioxus-core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-html 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dioxus-interpreter-js 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel", + "futures-util", + "generational-box 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys", + "rustc-hash", + "serde", + "serde-wasm-bindgen", + "serde_json", + "tracing", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "dioxus-web" -version = "0.4.2" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" dependencies = [ - "async-channel", "async-trait", "console_error_panic_hook", - "dioxus-core", - "dioxus-html", - "dioxus-interpreter-js", + "dioxus-core 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-html 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-interpreter-js 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "futures-channel", "futures-util", + "generational-box 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "js-sys", "rustc-hash", "serde", @@ -499,7 +819,7 @@ name = "dioxus_markdown" version = "0.1.0" source = "git+https://github.com/matthunz/markdown#cb4da0df1c462c1c2c9bc4c88816ede89597cf52" dependencies = [ - "dioxus", + "dioxus 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "pulldown-cmark", ] @@ -525,14 +845,10 @@ dependencies = [ ] [[package]] -name = "errno" -version = "0.3.5" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "euclid" @@ -550,11 +866,59 @@ version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "332f51cb23d20b0de8458b86580878211da09bcd4503cb579c225b3d124cabb3" +dependencies = [ + "event-listener 5.2.0", + "pin-project-lite", +] + [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" + +[[package]] +name = "fixedbitset" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "fnv" @@ -564,18 +928,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -588,9 +952,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -598,15 +962,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -615,15 +979,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "1.13.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ "futures-core", "pin-project-lite", @@ -631,9 +995,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -642,21 +1006,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -672,10 +1036,19 @@ dependencies = [ [[package]] name = "generational-box" -version = "0.0.0" -source = "git+https://github.com/dioxuslabs/dioxus#d4e6876ff648159c78ad008ade4e3b1b469bb996" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871f4a6bd7e2a93fbdd5a880776c9cd63df38145f390d43e4c4847af4c300add" dependencies = [ - "bumpalo", + "parking_lot", +] + +[[package]] +name = "generational-box" +version = "0.5.0" +source = "git+https://github.com/dioxuslabs/dioxus#6f3c5518ca520effa0450649ab586c92b2555265" +dependencies = [ + "parking_lot", ] [[package]] @@ -689,9 +1062,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -870,20 +1243,24 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.8", ] [[package]] -name = "hermit-abi" -version = "0.3.3" +name = "hashbrown" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -898,14 +1275,34 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", ] +[[package]] +name = "indexmap" +version = "2.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + +[[package]] +name = "internment" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e976188335292f66a1533fd41d5c2ce24b32dc2c000569b8dccf4e57f489806" +dependencies = [ + "hashbrown 0.12.3", + "parking_lot", +] + [[package]] name = "interpolation" version = "0.3.0" @@ -938,28 +1335,17 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae52f28f45ac2bc96edb7714de995cffc174a395fb0abf5bff453587c980d7b9" -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix", - "windows-sys 0.48.0", -] - [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -970,11 +1356,23 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "serde", "unicode-segmentation", ] +[[package]] +name = "krates" +version = "0.16.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b315eaab6cde3e2bcbd21810067a7b8bf4ced8cc63683ab7a96b18360c4e9df9" +dependencies = [ + "cargo_metadata", + "cfg-expr", + "petgraph", + "semver", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -983,36 +1381,30 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linkme" -version = "0.3.17" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ed2ee9464ff9707af8e9ad834cffa4802f072caad90639c583dd3c62e6e608" +checksum = "bb2cfee0de9bd869589fb9a015e155946d1be5ff415cb844c2caccc6cc4b5db9" dependencies = [ "linkme-impl", ] [[package]] name = "linkme-impl" -version = "0.3.17" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125974b109d512fccbc6c0244e7580143e460895dfd6ea7f8bbb692fd94396" +checksum = "adf157a4dc5a29b7b464aa8fe7edeff30076e07e13646a1c3874f58477dc99f8" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" - [[package]] name = "lock_api" version = "0.4.11" @@ -1025,9 +1417,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" [[package]] name = "longest-increasing-subsequence" @@ -1040,13 +1432,13 @@ name = "lookbook" version = "0.1.0" source = "git+https://github.com/matthunz/lookbook#1e6a741b5eda865826ec3f19c22533baf53e072c" dependencies = [ - "dioxus", + "dioxus 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "dioxus-material 0.1.0 (git+https://github.com/matthunz/dioxus-material)", - "dioxus-resize-observer", + "dioxus-resize-observer 0.2.0 (git+https://github.com/dioxus-community/dioxus-resize-observer)", "dioxus-router", - "dioxus-signals", - "dioxus-use-mounted", - "dioxus-web", + "dioxus-signals 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", + "dioxus-use-mounted 0.2.0 (git+https://github.com/matthunz/dioxus-use-mounted)", + "dioxus-web 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "dioxus_markdown", "linkme", "lookbook-macros", @@ -1059,7 +1451,7 @@ name = "lookbook-macros" version = "0.1.0" source = "git+https://github.com/matthunz/lookbook#1e6a741b5eda865826ec3f19c22533baf53e072c" dependencies = [ - "dioxus-rsx", + "dioxus-rsx 0.5.0 (git+https://github.com/dioxuslabs/dioxus)", "prettyplease", "proc-macro2", "quote", @@ -1068,42 +1460,49 @@ dependencies = [ [[package]] name = "lru" -version = "0.8.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown", + "hashbrown 0.14.3", ] +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] -name = "num-traits" -version = "0.2.17" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "autocfg", + "overload", + "winapi", ] [[package]] -name = "num_threads" -version = "0.1.6" +name = "num-traits" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ - "libc", + "autocfg", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "ordered-float" @@ -1114,26 +1513,71 @@ dependencies = [ "num-traits", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets", +] + [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", @@ -1142,9 +1586,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" @@ -1163,17 +1607,11 @@ dependencies = [ "futures-io", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" dependencies = [ "proc-macro2", "syn", @@ -1181,20 +1619,20 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] [[package]] name = "pulldown-cmark" -version = "0.9.3" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "getopts", "memchr", "unicase", @@ -1202,13 +1640,22 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "rustc-hash" version = "1.1.0" @@ -1224,24 +1671,11 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.38.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" -dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.48.0", -] - [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "scopeguard" @@ -1251,15 +1685,18 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +dependencies = [ + "serde", +] [[package]] name = "serde" -version = "1.0.190" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] @@ -1287,9 +1724,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", @@ -1298,9 +1735,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -1309,9 +1746,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", @@ -1331,15 +1768,12 @@ dependencies = [ ] [[package]] -name = "simple_logger" -version = "4.2.0" +name = "sharded-slab" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2230cd5c29b815c9b699fb610b49a5ed65588f3509d9f0108be3a885da629333" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ - "colored", - "log", - "time", - "windows-sys 0.42.0", + "lazy_static", ] [[package]] @@ -1353,9 +1787,19 @@ dependencies = [ [[package]] name = "sledgehammer_bindgen" -version = "0.2.4" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcfaf791ff02f48f3518ce825d32cf419c13a43c1d8b1232f74ac89f339c46d2" +dependencies = [ + "sledgehammer_bindgen_macro", + "wasm-bindgen", +] + +[[package]] +name = "sledgehammer_bindgen_macro" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0bc2cf26c12673eee8674b19d56cec04e9b815704c71298eafac61f131f99d7" +checksum = "bdd941cc539bd3dc694edaf9d0c4e1221d02baa67c6b45ec04fad1024d9e8139" dependencies = [ "quote", "syn", @@ -1363,9 +1807,9 @@ dependencies = [ [[package]] name = "sledgehammer_utils" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cd16550f1dd7866c7580dbf80c892dc1bef106737eeb850d42c62ec61896059" +checksum = "f20798defa0e9d4eff9ca451c7f84774c7378a9c3b5a40112cfa2b3eadb97ae2" dependencies = [ "lru", "once_cell", @@ -1374,18 +1818,18 @@ dependencies = [ [[package]] name = "slotmap" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" dependencies = [ "version_check", ] [[package]] -name = "smallbox" -version = "0.8.2" +name = "smallvec" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92359f97e6b417da4328a970cf04a044db104fbd57f7d72cb7ff665bb8806af" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "spinning" @@ -1398,9 +1842,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -1409,18 +1853,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", @@ -1428,34 +1872,13 @@ dependencies = [ ] [[package]] -name = "time" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" -dependencies = [ - "deranged", - "itoa", - "libc", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.15" +name = "thread_local" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "time-core", + "cfg-if", + "once_cell", ] [[package]] @@ -1508,6 +1931,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", ] [[package]] @@ -1521,9 +1970,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -1533,18 +1982,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 = "unicode-width" @@ -1554,9 +2003,9 @@ checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -1569,6 +2018,12 @@ version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "version_check" version = "0.9.4" @@ -1583,9 +2038,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1593,9 +2048,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -1608,9 +2063,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -1620,9 +2075,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1630,9 +2085,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -1643,15 +2098,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -1679,99 +2134,45 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -1780,24 +2181,32 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_gnullvm" +name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "zerocopy" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" +name = "zerocopy-derive" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml index 38883fb..ba4a07d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,11 +12,9 @@ members = [ ] [dependencies] -dioxus = { git = "https://github.com/dioxuslabs/dioxus" } -# dioxus-web = { git = "https://github.com/dioxuslabs/dioxus" } -dioxus-signals = { git = "https://github.com/dioxuslabs/dioxus" } -dioxus-use-mounted = { git = "https://github.com/matthunz/dioxus-use-mounted" } +dioxus = "0.5.0" +dioxus-use-mounted = "0.2.0" dioxus-spring = { git = "https://github.com/matthunz/dioxus-spring" } -dioxus-resize-observer = { git = "https://github.com/dioxus-community/dioxus-resize-observer" } +dioxus-resize-observer = "0.2.0" log = "0.4.20" dioxus-logger = "0.4.1" diff --git a/lookbook/src/main.rs b/lookbook/src/main.rs index 4ad6c6b..051ce82 100644 --- a/lookbook/src/main.rs +++ b/lookbook/src/main.rs @@ -2,11 +2,11 @@ use dioxus::prelude::*; use lookbook::LookBook; mod previews; -use previews::{ButtonPreview, ChipPreview,TabRowPreview, TextButtonPreview, TextFieldPreview}; +use previews::{ButtonPreview, ChipPreview, TabRowPreview, TextButtonPreview, TextFieldPreview}; #[component] fn Home(cx: Scope) -> Element { - render!( + rsx!( div { padding: "20px", h1 { "Dioxus Material" } h5 { "Material You design library for dioxus." } @@ -22,12 +22,16 @@ fn Home(cx: Scope) -> Element { } fn app(cx: Scope) -> Element { - render!( - LookBook { - home: Home, - previews: [ButtonPreview, ChipPreview, TabRowPreview, TextButtonPreview, TextFieldPreview] - } - ) + rsx!(LookBook { + home: Home, + previews: [ + ButtonPreview, + ChipPreview, + TabRowPreview, + TextButtonPreview, + TextFieldPreview + ] + }) } fn main() { diff --git a/lookbook/src/previews/button.rs b/lookbook/src/previews/button.rs index fe3deec..dbe3d62 100644 --- a/lookbook/src/previews/button.rs +++ b/lookbook/src/previews/button.rs @@ -18,7 +18,10 @@ pub fn ButtonPreview( #[lookbook(default = &*use_theme(cx).border_radius_medium)] border_radius: &'a str, ) -> Element { - render!( - Button { background_color: background_color, border_radius: border_radius, onpress: |_| {}, label } - ) + rsx!(Button { + background_color, + border_radius, + onpress: |_| {}, + label + }) } diff --git a/lookbook/src/previews/chip.rs b/lookbook/src/previews/chip.rs index c462450..b52f4d5 100644 --- a/lookbook/src/previews/chip.rs +++ b/lookbook/src/previews/chip.rs @@ -13,9 +13,10 @@ pub fn ChipPreview( /// Background color of the container (optional). #[lookbook(default = false)] is_selected: Json, - ) -> Element { - render!( - Chip { is_selected: is_selected.0, onclick: |_| {}, label } - ) + rsx!(Chip { + is_selected: is_selected.0, + onclick: |_| {}, + label + }) } diff --git a/lookbook/src/previews/tab_row.rs b/lookbook/src/previews/tab_row.rs index baa6053..0fab9ba 100644 --- a/lookbook/src/previews/tab_row.rs +++ b/lookbook/src/previews/tab_row.rs @@ -14,15 +14,14 @@ pub fn TabRowPreview<'a>( /// Tab elements. #[lookbook(default = vec![String::from("Tab A"), String::from("Tab B")])] tabs: Json>, -) -> Element<'a> { - render!( +) -> Element { + rsx!( div { width: "500px", TabRow { onselect: |_| {}, selected: selected.0, - tabs: cx - .bump() - .alloc(tabs.0.iter().map(|label| render!(Tab { "{label}" })).collect::>()) + tabs: cx.bump() + .alloc(tabs.0.iter().map(|label| rsx!(Tab { "{label}" })).collect::>()) } } ) diff --git a/lookbook/src/previews/text_button.rs b/lookbook/src/previews/text_button.rs index 58a18cb..65f3503 100644 --- a/lookbook/src/previews/text_button.rs +++ b/lookbook/src/previews/text_button.rs @@ -18,7 +18,10 @@ pub fn TextButtonPreview( #[lookbook(default = &*use_theme(cx).border_radius_medium)] border_radius: &'a str, ) -> Element { - render!( - TextButton { color: color, border_radius: border_radius, onpress: |_| {}, label } - ) + rsx!(TextButton { + color, + border_radius, + onpress: |_| {}, + label + }) } diff --git a/lookbook/src/previews/text_field.rs b/lookbook/src/previews/text_field.rs index 651ec75..57d17f5 100644 --- a/lookbook/src/previews/text_field.rs +++ b/lookbook/src/previews/text_field.rs @@ -9,14 +9,12 @@ pub fn TextFieldPreview<'a>( /// Label for the text field. #[lookbook(default = "Label")] label: &'a str, -) -> Element<'a> { +) -> Element { let value = use_state(cx, || String::from("Text Field")); - render!( - TextField { - label: label, - value: value, - onchange: move |event: FormEvent| value.set(event.data.value.clone()) - } - ) + rsx!(TextField { + label, + value, + onchange: move |event: FormEvent| value.set(event.data.value.clone()) + }) } diff --git a/src/button.rs b/src/button.rs index 988a7b4..ad085c5 100644 --- a/src/button.rs +++ b/src/button.rs @@ -16,36 +16,36 @@ use dioxus::prelude::*; /// use dioxus_material::{Button, Theme}; /// /// fn app(cx: Scope) -> Element { -/// render!(Theme { +/// rsx!(Theme { /// Button { onpress: |_| log::info!("clicked!"), "Click me!" } } /// ) /// } /// ``` #[component] -pub fn Button<'a>( - cx: Scope<'a>, - +pub fn Button( /// Handler for button press events. - onpress: EventHandler<'a, Event>, + onpress: EventHandler>, /// Label child element. - children: Element<'a>, + children: Element, /// Background color of the container (optional). - background_color: Option<&'a str>, + background_color: Option, /// Border radius of the container (optional). - border_radius: Option<&'a str>, + border_radius: Option, /// Height of the container (optional). - height: Option<&'a str>, -) -> Element<'a> { - let theme = use_theme(cx); - let background_color = background_color.unwrap_or(&theme.primary_color); - let border_radius = border_radius.unwrap_or(&theme.border_radius_medium); - let height = height.unwrap_or("50px"); + height: Option, +) -> Element { + let theme = use_theme(); + let background_color = background_color.as_deref().unwrap_or(&theme.primary_color); + let border_radius = border_radius + .as_deref() + .unwrap_or(&theme.border_radius_medium); + let height = height.as_deref().unwrap_or("50px"); - render!( + rsx!( div { display: "inline-block", position: "relative", @@ -64,7 +64,7 @@ pub fn Button<'a>( font_family: "sans-serif", user_select: "none", webkit_user_select: "none", - children + {children} } } } @@ -72,30 +72,30 @@ pub fn Button<'a>( } #[component] -pub fn TextButton<'a>( - cx: Scope<'a>, - +pub fn TextButton( /// Handler for button press events. - onpress: EventHandler<'a, Event>, + onpress: EventHandler>, /// Label child element. - children: Element<'a>, + children: Element, /// Border radiusof the container (optional). - border_radius: Option<&'a str>, + border_radius: Option, /// Text color (optional). - color: Option<&'a str>, + color: Option, /// Height of the container (optional). - height: Option<&'a str>, -) -> Element<'a> { - let theme = use_theme(cx); - let color = color.unwrap_or(&theme.primary_color); - let border_radius = border_radius.unwrap_or(&theme.border_radius_medium); - let height = height.unwrap_or("40px"); + height: Option, +) -> Element { + let theme = use_theme(); + let color = color.as_deref().unwrap_or(&theme.primary_color); + let border_radius = border_radius + .as_deref() + .unwrap_or(&theme.border_radius_medium); + let height = height.as_deref().unwrap_or("40px"); - render!( + rsx!( div { display: "inline-block", position: "relative", @@ -114,7 +114,7 @@ pub fn TextButton<'a>( font_family: "sans-serif", user_select: "none", webkit_user_select: "none", - children + {children} } } } diff --git a/src/chip.rs b/src/chip.rs index b49ed4e..d849719 100644 --- a/src/chip.rs +++ b/src/chip.rs @@ -17,7 +17,7 @@ use dioxus::prelude::*; /// use dioxus_material::{Chip, Theme, IconFont}; /// /// fn app(cx: Scope) -> Element { -/// render!(Theme { +/// rsx!(Theme { /// IconFont {} /// div { display: "flex", gap: "10px", /// Chip { onclick: |_| {}, "Asset chip" } @@ -27,14 +27,13 @@ use dioxus::prelude::*; /// } /// ``` #[component] -pub fn Chip<'a>( - cx: Scope, - children: Element<'a>, +pub fn Chip( + children: Element, is_selected: Option, - onclick: EventHandler<'a, Event>, -) -> Element<'a> { - let theme = use_theme(cx); - let (border_color, background) = if *is_selected == Some(true) { + onclick: EventHandler>, +) -> Element { + let theme = use_theme(); + let (border_color, background) = if is_selected == Some(true) { ( &*theme.secondary_container_color, &*theme.secondary_container_color, @@ -43,7 +42,7 @@ pub fn Chip<'a>( ("#79747E", "none") }; - render!( + rsx!( div { display: "inline-flex", flex_direction: "row", @@ -55,16 +54,17 @@ pub fn Chip<'a>( font_size: "14px", font_weight: 500, border: "1px solid {border_color}", - background: background, - Ripple { onclick: |event| onclick.call(event), - div { display: "inline-flex", flex_direction: "row", align_items: "center", - if *is_selected == Some(true) { - render!(Icon { kind: IconKind::Check }) - } else { - None + background, + Ripple { onclick: move |event| onclick.call(event), + div { + display: "inline-flex", + flex_direction: "row", + align_items: "center", + if is_selected == Some(true) { + Icon { kind: IconKind::Check } } - div { padding: "0 14px", children } + div { padding: "0 14px", {children} } } } } diff --git a/src/dialog.rs b/src/dialog.rs index d175626..a731016 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -10,7 +10,7 @@ use dioxus::prelude::*; /// use dioxus_material::{Dialog, Theme}; /// /// fn app(cx: Scope) -> Element { -/// render!( +/// rsx!( /// Theme { /// Dialog { is_visible: true, h1 { "Dialog" } } /// } @@ -18,12 +18,12 @@ use dioxus::prelude::*; /// } /// ``` #[component] -pub fn Dialog<'a>(cx: Scope<'a>, children: Element<'a>, is_visible: bool) -> Element<'a> { - let theme = use_theme(cx); +pub fn Dialog(children: Element, is_visible: bool) -> Element { + let theme = use_theme(); - render!( + rsx!( div { - display: if *is_visible { "block" } else { "none" }, + display: if is_visible { "block" } else { "none" }, position: "fixed", top: 0, left: 0, @@ -37,7 +37,7 @@ pub fn Dialog<'a>(cx: Scope<'a>, children: Element<'a>, is_visible: bool) -> Ele transform: "translate(-50%, -50%)", border_radius: "{theme.border_radius_medium}", background: "#fff", - children + {children} } } ) diff --git a/src/icon.rs b/src/icon.rs index 4a55b5c..5300052 100644 --- a/src/icon.rs +++ b/src/icon.rs @@ -3,8 +3,8 @@ use dioxus::prelude::*; /// Material Symbols icon font. #[component] -pub fn IconFont(cx: Scope) -> Element { - render!( +pub fn IconFont() -> Element { + rsx!( link { href: "https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200", rel: "stylesheet" @@ -15,8 +15,6 @@ pub fn IconFont(cx: Scope) -> Element { /// Material Symbols icon. #[component] pub fn Icon( - cx: Scope, - /// Kind of icon. kind: IconKind, @@ -29,10 +27,11 @@ pub fn Icon( /// Optical size of the icon (optional). size: Option, ) -> Element { - let font_variation_settings = use_memo(cx, (is_filled, weight, size), move |_| { + // TODO memo + let font_variation_settings = { let mut s = String::new(); let mut is_first = true; - if *is_filled == Some(true) { + if is_filled == Some(true) { if !is_first { s.push_str(", "); } @@ -53,13 +52,13 @@ pub fn Icon( s.push_str(&format!("'opsz' {}", size)); } s - }); + }; - render!( + rsx!( span { class: "material-symbols-rounded", style: "font-variation-settings: {font_variation_settings};", - kind.name() + { kind.name()} } ) } diff --git a/src/menu.rs b/src/menu.rs index 8d4b2e2..524e54d 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -1,6 +1,6 @@ use dioxus::prelude::*; #[component] -pub fn Menu(_cx: Scope) -> Element { +pub fn Menu() -> Element { todo!() } diff --git a/src/navigation_rail.rs b/src/navigation_rail.rs index 580c1d5..2b0a25f 100644 --- a/src/navigation_rail.rs +++ b/src/navigation_rail.rs @@ -2,8 +2,8 @@ use crate::use_theme; use dioxus::prelude::*; #[component] -pub fn NavigationRail<'a>(cx: Scope<'a>, children: Element<'a>) -> Element<'a> { - render!( +pub fn NavigationRail(children: Element) -> Element { + rsx!( nav { ul { display: "flex", @@ -13,23 +13,22 @@ pub fn NavigationRail<'a>(cx: Scope<'a>, children: Element<'a>) -> Element<'a> { list_style: "none", margin: 0, padding: "0 10px", - children + {children} } } ) } #[component] -pub fn NavigationRailItem<'a>( - cx: Scope<'a>, - icon: Element<'a>, - label: Element<'a>, +pub fn NavigationRailItem( + icon: Element, + label: Element, is_selected: bool, - onselect: EventHandler<'a, MouseEvent>, -) -> Element<'a> { - let theme = use_theme(cx); + onselect: EventHandler, +) -> Element { + let theme = use_theme(); - render!( + rsx!( li { display: "flex", flex_direction: "column", @@ -45,10 +44,15 @@ pub fn NavigationRailItem<'a>( padding: "5px 0", text_align: "center", border_radius: "{theme.border_radius_medium}", - background: if *is_selected { &theme.secondary_container_color } else { "" }, - icon + background: if is_selected { &theme.secondary_container_color } else { "" }, + {icon} + } + div { + margin_top: "5px", + font_size: "{theme.label_small}px", + line_height: "16px", + {label} } - div { margin_top: "5px", font_size: "{theme.label_small}px", line_height: "16px", label } } ) } diff --git a/src/ripple.rs b/src/ripple.rs index 7fd1de2..877ef94 100644 --- a/src/ripple.rs +++ b/src/ripple.rs @@ -1,18 +1,17 @@ -use dioxus::prelude::*; use crate::use_ripple; +use dioxus::prelude::*; use std::time::Duration; #[component] -pub fn Ripple<'a>( - cx: Scope<'a>, - onclick: EventHandler<'a, Event>, - children: Element<'a>, +pub fn Ripple( + onclick: EventHandler>, + children: Element, duration: Option, -) -> Element<'a> { +) -> Element { let duration = duration.unwrap_or(Duration::from_millis(200)); - let ripple = use_ripple(cx, duration); + let mut ripple = use_ripple(duration); - render!( + rsx!( div { display: "inline-flex", flex: 1, @@ -28,7 +27,13 @@ pub fn Ripple<'a>( }, onmouseleave: move |_| ripple.onmouseleave(), div { onmounted: move |event| ripple.animated_ref.onmounted(event) } - div { position: "relative", z_index: 9, user_select: "none", webkit_user_select: "none", children } + div { + position: "relative", + z_index: 9, + user_select: "none", + webkit_user_select: "none", + {children} + } } ) } diff --git a/src/tab.rs b/src/tab.rs index c09bd5d..d9a9f69 100644 --- a/src/tab.rs +++ b/src/tab.rs @@ -1,8 +1,8 @@ use dioxus::prelude::*; #[component] -pub fn Tab<'a>(cx: Scope<'a>, children: Element<'a>) -> Element<'a> { - render!( - div { font_size: "1.2em", padding: "10px 0", text_align: "center", children } +pub fn Tab(children: Element) -> Element { + rsx!( + div { font_size: "1.2em", padding: "10px 0", text_align: "center", {children} } ) } diff --git a/src/tab_row.rs b/src/tab_row.rs index ae3c0e9..55703a1 100644 --- a/src/tab_row.rs +++ b/src/tab_row.rs @@ -1,26 +1,20 @@ use crate::{use_theme, Ripple}; use dioxus::prelude::*; use dioxus_resize_observer::{use_resize, Rect}; -use dioxus_signals::{use_signal, Signal}; use dioxus_spring::{use_animated, use_spring}; use dioxus_use_mounted::use_mounted; use std::{collections::HashMap, time::Duration}; #[component] -pub fn TabRow<'a>( - cx: Scope<'a>, - tabs: &'a [Element<'a>], - selected: usize, - onselect: EventHandler<'a, usize>, -) -> Element<'a> { - let sizes = use_signal(cx, HashMap::new); +pub fn TabRow(tabs: Vec, selected: usize, onselect: EventHandler) -> Element { + let sizes = use_signal(HashMap::new); let width = sizes .read() - .get(selected) + .get(&selected) .map(|rect: &Rect| rect.width() as f32) .unwrap_or_default(); - let left: f32 = (0..*selected) + let left: f32 = (0..selected) .map(|idx| { sizes .read() @@ -30,13 +24,13 @@ pub fn TabRow<'a>( }) .sum(); - let value_ref = use_spring(cx, [width, left], Duration::from_millis(200)); - let animated_ref = use_mounted(cx); + let value_ref = use_spring([width, left], Duration::from_millis(200)); + let animated_ref = use_mounted(); - let theme = use_theme(cx); + let theme = use_theme(); let primary_color = theme.primary_color.clone(); - use_animated(cx, animated_ref, value_ref, move |[width, left]| { + use_animated(animated_ref, value_ref, move |[width, left]| { format!( r" position: absolute; @@ -49,10 +43,16 @@ pub fn TabRow<'a>( ) }); - render!( + rsx!( div { position: "relative", - ul { display: "flex", flex_direction: "row", justify_content: "space-evenly", list_style: "none", margin: 0, padding: 0, - tabs.iter().enumerate().map(|(idx, tab)| render!(TabRowItem { index: idx, sizes: sizes, onselect: move |idx| onselect.call(idx), tab })) + ul { + display: "flex", + flex_direction: "row", + justify_content: "space-evenly", + list_style: "none", + margin: 0, + padding: 0, + {tabs.iter().enumerate().map(|(idx, tab)| rsx!(TabRowItem { index: idx, sizes: sizes, onselect: move |idx| onselect.call(idx), {tab} }))} } div { onmounted: move |event| animated_ref.onmounted(event) } } @@ -60,29 +60,26 @@ pub fn TabRow<'a>( } #[component] -fn TabRowItem<'a>( - cx: Scope<'a, TabRowItemProps<'a>>, - children: Element<'a>, +fn TabRowItem( + children: Element, index: usize, sizes: Signal>, - onselect: EventHandler<'a, usize>, -) -> Element<'a> { - let mounted = use_mounted(cx); - let resize = use_resize(cx, mounted); + onselect: EventHandler, +) -> Element { + let mounted = use_mounted(); + let resize = use_resize(mounted); - let idx = *index; - let sizes = *sizes; - dioxus_signals::use_effect(cx, move || { + use_effect(move || { if let Some(content_rect) = &*resize.read() { sizes .write() - .entry(idx) + .entry(index) .and_modify(|rect| *rect = content_rect.clone()) .or_insert(content_rect.clone()); } }); - render!( + rsx!( li { display: "flex", flex_direction: "row", @@ -90,7 +87,7 @@ fn TabRowItem<'a>( margin: 0, padding: 0, onmounted: move |event| mounted.onmounted(event), - Ripple { onclick: move |_| onselect.call(idx), children } + Ripple { onclick: move |_| onselect.call(index), children } } ) } diff --git a/src/text_field.rs b/src/text_field.rs index aed2a79..e89e998 100644 --- a/src/text_field.rs +++ b/src/text_field.rs @@ -20,7 +20,7 @@ use std::time::Duration; /// /// fn app(cx: Scope) -> Element { /// let value = use_state(cx, || String::from("Filled")); -/// render!( +/// rsx!( /// Theme { /// TextField { /// label: "Text field", @@ -32,22 +32,20 @@ use std::time::Duration; /// } /// ``` #[component] -pub fn TextField<'a>( - cx: Scope<'a>, - label: &'a str, - value: &'a str, - onchange: EventHandler<'a, FormEvent>, - background: Option<&'a str>, +pub fn TextField( + label: String, + value: String, + onchange: EventHandler, + background: Option, font_size: Option, - width: Option<&'a str>, -) -> Element<'a> { - let is_populated = use_state(cx, || !value.is_empty()); - let theme = use_theme(cx); + width: Option, +) -> Element { + let mut is_populated = use_signal(|| !value.is_empty()); + let theme = use_theme(); let font_size = font_size.unwrap_or(theme.label_medium); let spring = use_spring( - cx, - if **is_populated { + if is_populated() { [10f32, 12f32, 16f32] } else { [20., font_size, 24.] @@ -55,8 +53,8 @@ pub fn TextField<'a>( Duration::from_millis(50), ); - let mounted = use_mounted(cx); - use_animated(cx, mounted, spring, |[top, font_size, line_height]| { + let mounted = use_mounted(); + use_animated(mounted, spring, |[top, font_size, line_height]| { format!( r" position: absolute; @@ -68,14 +66,14 @@ pub fn TextField<'a>( ) }); - let background = background.unwrap_or(&theme.background_color); - let width = width.unwrap_or("200px"); + let background = background.as_deref().unwrap_or(&theme.background_color); + let width = width.as_deref().unwrap_or("200px"); - render!( + rsx!( div { position: "relative", display: "flex", - width: width, + width, background: "{background}", font_family: "sans-serif", border_bottom: "2px solid #999", @@ -84,7 +82,7 @@ pub fn TextField<'a>( position: "relative", z_index: 9, r#type: "text", - value: *value, + value: value.clone(), padding: "10px 20px", padding_top: "30px", font_size: "{font_size}px", @@ -93,12 +91,12 @@ pub fn TextField<'a>( outline: "none", background: "none", onfocusin: move |_| { - if !is_populated { + if !is_populated() { is_populated.set(true) } }, onfocusout: move |_| { - if **is_populated && value.is_empty() { + if is_populated() && value.is_empty() { is_populated.set(false) } }, diff --git a/src/theme.rs b/src/theme.rs index da33cb6..a9e5518 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -5,9 +5,7 @@ use std::{borrow::Cow, rc::Rc}; /// /// This component provides access to [`UseTheme`](UseTheme) to its children. #[component] -pub fn Theme<'a>( - cx: Scope<'a>, - +pub fn Theme( /// Primary color. #[props(into, default = Cow::Borrowed("#6750A4"))] primary_color: Cow<'static, str>, @@ -36,21 +34,21 @@ pub fn Theme<'a>( #[props(default = 16.)] label_medium: f32, - children: Element<'a>, -) -> Element<'a> { - use_context_provider(cx, move || { + children: Element, +) -> Element { + use_context_provider(move || { Rc::new(UseTheme { primary_color: primary_color.clone(), background_color: background_color.clone(), secondary_container_color: secondary_container_color.clone(), border_radius_medium: border_radius_medium.clone(), border_radius_small: border_radius_small.clone(), - label_small: *label_small, - label_medium: *label_medium, + label_small, + label_medium, }) }); - render!(children) + children } pub struct UseTheme { @@ -63,7 +61,6 @@ pub struct UseTheme { pub label_medium: f32, } -pub fn use_theme(cx: Scope) -> &UseTheme { - let rc: &Rc = use_context(cx).unwrap(); - rc.as_ref() +pub fn use_theme() -> Rc { + use_context() } diff --git a/src/use_ripple.rs b/src/use_ripple.rs index 1c31fdd..78ea31b 100644 --- a/src/use_ripple.rs +++ b/src/use_ripple.rs @@ -5,17 +5,17 @@ use dioxus_use_mounted::{use_mounted, UseMounted}; use std::time::Duration; /// Hook to create a ripple from a container and animated component. -pub fn use_ripple(cx: Scope, duration: Duration) -> UseRipple { - let is_pressed = use_state(cx, || false); +pub fn use_ripple(duration: Duration) -> UseRipple { + let is_pressed = use_signal(|| false); - let container_ref = use_mounted(cx); - let content_rect = use_size(cx, container_ref); + let container_ref = use_mounted(); + let content_rect = use_size(container_ref); let size = content_rect.width().max(content_rect.height()) * 1.2; - let (spring_ref, value_ref) = use_spring_signal(cx, [0f32; 2]); - let animated_ref = use_mounted(cx); + let (spring_ref, value_ref) = use_spring_signal([0f32; 2]); + let animated_ref = use_mounted(); - use_animated(cx, animated_ref, value_ref, |[size, opacity]| { + use_animated(animated_ref, value_ref, |[size, opacity]| { format!( r" width: {size}px; @@ -42,23 +42,23 @@ pub fn use_ripple(cx: Scope, duration: Duration) -> UseRipple { } #[derive(Clone, Copy)] -pub struct UseRipple<'a> { +pub struct UseRipple { pub spring_ref: UseSpringSignal<[f32; 2]>, pub size: f64, - pub is_pressed: &'a UseState, + pub is_pressed: Signal, pub duration: Duration, pub container_ref: UseMounted, pub animated_ref: UseMounted, } -impl UseRipple<'_> { - pub fn onmousedown(&self) { +impl UseRipple { + pub fn onmousedown(&mut self) { self.spring_ref.animate([self.size as _, 1.], self.duration); self.is_pressed.set(true) } - pub fn onmouseup(&self) -> bool { - if **self.is_pressed { + pub fn onmouseup(&mut self) -> bool { + if (self.is_pressed)() { self.spring_ref.queue([self.size as _, 0.], self.duration); self.spring_ref.queue([0., 0.], Duration::ZERO); self.is_pressed.set(false); @@ -68,8 +68,8 @@ impl UseRipple<'_> { } } - pub fn onmouseleave(&self) { - if **self.is_pressed { + pub fn onmouseleave(&mut self) { + if (self.is_pressed)() { self.spring_ref.animate([0., 0.], self.duration); self.is_pressed.set(false) }