From 3f96db6a7e1e492a8941652682d6395f29645c1f Mon Sep 17 00:00:00 2001 From: Forest Anderson Date: Tue, 28 Jun 2022 04:57:14 -0400 Subject: [PATCH] Yewprint upgrade 0.19 (#131) Co-authored-by: Cecile Tonglet Co-authored-by: Francois Stephany --- Cargo.lock | 766 ++++++++++++---------- Cargo.toml | 8 +- src/button_group.rs | 60 +- src/buttons.rs | 127 ++-- src/callout.rs | 93 +-- src/card.rs | 49 +- src/checkbox.rs | 73 +-- src/collapse.rs | 111 ++-- src/control_group.rs | 51 +- src/divider.rs | 45 +- src/html_elements.rs | 58 +- src/html_select.rs | 67 +- src/icon.rs | 93 +-- src/input_group.rs | 73 +-- src/menu.rs | 226 +++---- src/numeric_input.rs | 123 ++-- src/panel_stack.rs | 157 ++--- src/progress_bar.rs | 69 +- src/radio.rs | 77 +-- src/radio_group.rs | 103 ++- src/slider.rs | 160 +++-- src/spinner.rs | 117 ++-- src/switch.rs | 133 ++-- src/tabs.rs | 97 ++- src/tag.rs | 120 ++-- src/text.rs | 56 +- src/text_area.rs | 57 +- src/tree.rs | 167 +++-- yewprint-doc/Cargo.toml | 13 +- yewprint-doc/src/app.rs | 499 +++++++------- yewprint-doc/src/button_group/example.rs | 54 +- yewprint-doc/src/button_group/mod.rs | 58 +- yewprint-doc/src/buttons/example.rs | 41 +- yewprint-doc/src/buttons/mod.rs | 172 +++-- yewprint-doc/src/callout/example.rs | 46 +- yewprint-doc/src/callout/mod.rs | 46 +- yewprint-doc/src/card/example.rs | 47 +- yewprint-doc/src/card/mod.rs | 42 +- yewprint-doc/src/checkbox/example.rs | 73 +-- yewprint-doc/src/checkbox/mod.rs | 50 +- yewprint-doc/src/collapse/example.rs | 20 +- yewprint-doc/src/collapse/mod.rs | 14 +- yewprint-doc/src/control_group/example.rs | 63 +- yewprint-doc/src/control_group/mod.rs | 42 +- yewprint-doc/src/divider/example.rs | 52 +- yewprint-doc/src/divider/mod.rs | 34 +- yewprint-doc/src/example.rs | 82 +-- yewprint-doc/src/html_select/example.rs | 33 +- yewprint-doc/src/html_select/mod.rs | 58 +- yewprint-doc/src/icon/example.rs | 27 +- yewprint-doc/src/icon/mod.rs | 14 +- yewprint-doc/src/input_group/example.rs | 132 ++-- yewprint-doc/src/input_group/mod.rs | 66 +- yewprint-doc/src/lib.rs | 25 +- yewprint-doc/src/logo.rs | 31 +- yewprint-doc/src/menu/example.rs | 112 ++-- yewprint-doc/src/menu/mod.rs | 14 +- yewprint-doc/src/numeric_input/example.rs | 62 +- yewprint-doc/src/numeric_input/mod.rs | 74 +-- yewprint-doc/src/panel_stack/example.rs | 95 +-- yewprint-doc/src/panel_stack/mod.rs | 20 +- yewprint-doc/src/progress_bar/example.rs | 40 +- yewprint-doc/src/progress_bar/mod.rs | 46 +- yewprint-doc/src/radio/example.rs | 57 +- yewprint-doc/src/radio/mod.rs | 50 +- yewprint-doc/src/slider/example.rs | 61 +- yewprint-doc/src/slider/mod.rs | 40 +- yewprint-doc/src/spinner/example.rs | 43 +- yewprint-doc/src/spinner/mod.rs | 36 +- yewprint-doc/src/switch/example.rs | 98 +-- yewprint-doc/src/switch/mod.rs | 58 +- yewprint-doc/src/tabs/example.rs | 31 +- yewprint-doc/src/tabs/mod.rs | 42 +- yewprint-doc/src/tag/example.rs | 53 +- yewprint-doc/src/tag/mod.rs | 120 ++-- yewprint-doc/src/text/example.rs | 41 +- yewprint-doc/src/text/mod.rs | 50 +- yewprint-doc/src/text_area/example.rs | 45 +- yewprint-doc/src/text_area/mod.rs | 54 +- yewprint-doc/src/tree/example.rs | 24 +- yewprint-doc/src/tree/mod.rs | 14 +- 81 files changed, 2726 insertions(+), 3824 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2bf3ce6..7a909d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,21 +19,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" +checksum = "bb07d2053ccdbe10e2af2995a2f116c1330396493dc1269f6a91d0ae82e19704" [[package]] -name = "anymap" -version = "0.12.1" +name = "anymap2" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "d301b3b94cb4b2f23d7917810addbbaff90738e0ca2be692bd027e70d7e0330c" [[package]] name = "atty" @@ -48,9 +42,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" @@ -102,9 +96,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.8.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] name = "byteorder" @@ -112,17 +106,11 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" - [[package]] name = "camino" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3132262930b0522068049f5870a856ab8affc80c70d08b6ecb785771a6fc23" +checksum = "869119e97797867fd90f5e22af7d0bd274bd4635ebb9eb68c04f3f513ae6c412" dependencies = [ "serde", ] @@ -151,9 +139,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" [[package]] name = "cfg-if" @@ -167,12 +155,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cfg-match" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8100e46ff92eb85bf6dc2930c73f2a4f7176393c84a9446b3d501e1b354e7b34" - [[package]] name = "chrono" version = "0.4.19" @@ -194,16 +176,16 @@ checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "clap" -version = "3.1.17" +version = "3.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47582c09be7c8b32c0ab3a6181825ababb713fde6fff20fc573a3870dd45c6a0" +checksum = "9f1fe12880bae935d142c8702d500c63a4e8634b6c3c57ad72bf978fc7b6249a" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", "indexmap", - "lazy_static", + "once_cell", "strsim", "termcolor", "textwrap", @@ -211,9 +193,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.7" +version = "3.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3aab4734e083b809aaf5794e14e756d1c798d2c69c7f7de7a09a2f5214993c1" +checksum = "ed6db9e867166a43a53f7199b5e4d1f522a1e5bd626654be263c999ce59df39a" dependencies = [ "heck 0.4.0", "proc-macro-error", @@ -224,9 +206,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +checksum = "87eba3c8c7f42ef17f6c659fc7416d0f4758cd3e58861ee63c5fa4a4dde649e4" dependencies = [ "os_str_bytes", ] @@ -243,18 +225,18 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "crossbeam-channel" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -273,26 +255,26 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +checksum = "07db9d94cbd326813772c968ccd25999e5f8ae22f4f8d1b11effa37ef6ce281d" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "lazy_static", "memoffset", + "once_cell", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" dependencies = [ "cfg-if 1.0.0", - "lazy_static", + "once_cell", ] [[package]] @@ -315,10 +297,19 @@ dependencies = [ ] [[package]] -name = "filetime" -version = "0.2.15" +name = "fastrand" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + +[[package]] +name = "filetime" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0408e2626025178a6a7f7ffc05a25bc47103229f19c113755de7bf63816290c" dependencies = [ "cfg-if 1.0.0", "libc", @@ -328,13 +319,11 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ - "cfg-if 1.0.0", "crc32fast", - "libc", "miniz_oxide", ] @@ -396,42 +385,88 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] -name = "getrandom" -version = "0.2.3" +name = "futures-channel" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "gloo" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23947965eee55e3e97a5cd142dd4c10631cc349b48cecca0ed230fd296f568cd" +dependencies = [ + "gloo-console", + "gloo-dialogs", + "gloo-events", + "gloo-file", + "gloo-render", + "gloo-storage", + "gloo-timers", + "gloo-utils", ] [[package]] name = "gloo" -version = "0.2.1" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ce6f2dfa9f57f15b848efa2aade5e1850dc72986b87a2b0752d44ca08f4967" +checksum = "f96605dc96adaffef27d911a805f0269d83ab89c1076e9c75ebac64a1a27215d" dependencies = [ - "gloo-console-timer", + "gloo-console", + "gloo-dialogs", "gloo-events", "gloo-file", + "gloo-history", + "gloo-net", + "gloo-render", + "gloo-storage", "gloo-timers", + "gloo-utils", + "gloo-worker", ] [[package]] -name = "gloo-console-timer" -version = "0.1.0" +name = "gloo-console" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b48675544b29ac03402c6dffc31a912f716e38d19f7e74b78b7e900ec3c941ea" +checksum = "3907f786f65bbb4f419e918b0c5674175ef1c231ecda93b2dbd65fd1e8882637" dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-dialogs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67062364ac72d27f08445a46cab428188e2e224ec9e37efdba48ae8c289002e6" +dependencies = [ + "wasm-bindgen", "web-sys", ] [[package]] name = "gloo-events" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088514ec8ef284891c762c88a66b639b3a730134714692ee31829765c5bc814f" +checksum = "68b107f8abed8105e4182de63845afcc7b69c098b7852a813ea7462a320992fc" dependencies = [ "wasm-bindgen", "web-sys", @@ -439,10 +474,11 @@ dependencies = [ [[package]] name = "gloo-file" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9fecfe46b5dc3cc46f58e98ba580cc714f2c93860796d002eb3527a465ef49" +checksum = "aa5d6084efa4a2b182ef3a8649cb6506cb4843f22cf907c6e0a799944248ae90" dependencies = [ + "futures-channel", "gloo-events", "js-sys", "wasm-bindgen", @@ -450,10 +486,83 @@ dependencies = [ ] [[package]] -name = "gloo-timers" +name = "gloo-history" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81af52c0d31e86242eecefe1ed4d066deb79cfb80f9f7da0847fac417396bfe" +dependencies = [ + "gloo-events", + "gloo-utils", + "serde", + "serde-wasm-bindgen", + "serde_urlencoded", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2899cb1a13be9020b010967adc6b2a8a343b6f1428b90238c9d53ca24decc6db" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "gloo-utils", + "js-sys", + "pin-project", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-render" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd9306aef67cfd4449823aadcd14e3958e0800aa2183955a309112a84ec7764" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-storage" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" +checksum = "1caa4ba51c99de680dee3ad99c32ca45e9f13311be72079154d222c3f9a6b6f5" +dependencies = [ + "gloo-utils", + "js-sys", + "serde", + "serde_json", + "thiserror", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-timers" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "gloo-utils" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0bbef55e98d946adbd89f3c65a497cf9adb995a73b99573f30180e8813ab21" dependencies = [ "js-sys", "wasm-bindgen", @@ -461,10 +570,27 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.11.2" +name = "gloo-worker" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "7c843b9a46d07485026f030be7bd008580a12a2920fea837745a440a3b0c97cb" +dependencies = [ + "anymap2", + "bincode", + "gloo-console", + "gloo-utils", + "js-sys", + "serde", + "slab", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "hashbrown" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" [[package]] name = "heck" @@ -490,17 +616,6 @@ dependencies = [ "libc", ] -[[package]] -name = "http" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "humantime" version = "2.1.0" @@ -538,9 +653,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.7.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown", @@ -566,6 +681,15 @@ dependencies = [ "libc", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "iovec" version = "0.1.4" @@ -577,15 +701,15 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "js-sys" -version = "0.3.55" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" dependencies = [ "wasm-bindgen", ] @@ -618,24 +742,11 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" -[[package]] -name = "lexical-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" -dependencies = [ - "arrayvec", - "bitflags", - "cfg-if 1.0.0", - "ryu", - "static_assertions", -] - [[package]] name = "libc" -version = "0.2.125" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "line-wrap" @@ -669,9 +780,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" @@ -690,12 +801,11 @@ checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" dependencies = [ "adler", - "autocfg", ] [[package]] @@ -752,17 +862,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "nom" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -dependencies = [ - "lexical-core", - "memchr", - "version_check", -] - [[package]] name = "notify" version = "4.0.17" @@ -783,9 +882,9 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", @@ -793,28 +892,37 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", ] [[package]] -name = "once_cell" -version = "1.8.0" +name = "num_threads" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" [[package]] name = "onig" @@ -840,9 +948,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.0.0" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" [[package]] name = "percent-encoding" @@ -851,10 +959,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] -name = "pkg-config" -version = "0.3.22" +name = "pin-project" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "plist" @@ -866,16 +994,10 @@ dependencies = [ "indexmap", "line-wrap", "serde", - "time 0.3.5", + "time 0.3.11", "xml-rs", ] -[[package]] -name = "ppv-lite86" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -902,67 +1024,27 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.32" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.10" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core", -] - [[package]] name = "rayon" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" dependencies = [ "autocfg", "crossbeam-deque", @@ -972,9 +1054,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -984,18 +1066,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ "bitflags", ] [[package]] name = "regex" -version = "1.5.4" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" dependencies = [ "aho-corasick", "memchr", @@ -1004,9 +1086,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" [[package]] name = "remove_dir_all" @@ -1032,6 +1114,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rustc-demangle" version = "0.1.21" @@ -1052,9 +1140,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[package]] name = "safe-lock" @@ -1064,36 +1152,36 @@ checksum = "077d73db7973cccf63eb4aff1e5a34dc2459baa867512088269ea5f2f4253c90" [[package]] name = "safe-proc-macro2" -version = "1.0.24" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9ca0693867c373d726819a6655d3dc4e88028905f1b1e9b9d399a57ea1d83e" +checksum = "814c536dcd27acf03296c618dab7ad62d28e70abd7ba41d3f34a2ce707a2c666" dependencies = [ "unicode-xid", ] [[package]] name = "safe-quote" -version = "1.0.9" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566c55c34afcf23f8ae1170373f925201163ed0a9fd315274f35eab6d660b56d" +checksum = "77e530f7831f3feafcd5f1aae406ac205dd998436b4007c8e80f03eca78a88f7" dependencies = [ "safe-proc-macro2", ] [[package]] name = "safe-regex" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "954950893b0d83c719cb5325bf3941bae7b1c6590d923c70f78bdfed101179b5" +checksum = "a15289bf322e0673d52756a18194167f2378ec1a15fe884af6e2d2cb934822b0" dependencies = [ "safe-regex-macro", ] [[package]] name = "safe-regex-compiler" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77be88a67af0852122737d6944cf6cf3b493051ac063b074d11d6dc3aaa57047" +checksum = "fba76fae590a2aa665279deb1f57b5098cbace01a0c5e60e262fcf55f7c51542" dependencies = [ "safe-proc-macro2", "safe-quote", @@ -1101,9 +1189,9 @@ dependencies = [ [[package]] name = "safe-regex-macro" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9276d04505a852d89fab9b9d5d72b47e84c726b121f4b8b212b44fba990485d" +checksum = "96c2e96b5c03f158d1b16ba79af515137795f4ad4e8de3f790518aae91f1d127" dependencies = [ "safe-proc-macro2", "safe-regex-compiler", @@ -1124,6 +1212,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scoped-tls-hkt" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e9d7eaddb227e8fbaaa71136ae0e1e913ca159b86c7da82f3e8f0044ad3a63" + [[package]] name = "scopeguard" version = "1.1.0" @@ -1142,27 +1236,39 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd" +checksum = "a41d061efea015927ac527063765e73601444cdc344ba855bc7bd44578b25e1c" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.130" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" dependencies = [ "serde_derive", ] [[package]] -name = "serde_derive" -version = "1.0.130" +name = "serde-wasm-bindgen" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "618365e8e586c22123d692b72a7d791d5ee697817b65a218cdf12a98870af0f7" +dependencies = [ + "fnv", + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_derive" +version = "1.0.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" dependencies = [ "proc-macro2", "quote", @@ -1171,9 +1277,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.71" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063bf466a64011ac24040a49009724ee60a57da1b437617ceb32e53ad61bfb19" +checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" dependencies = [ "itoa", "ryu", @@ -1181,10 +1287,22 @@ dependencies = [ ] [[package]] -name = "slab" -version = "0.4.5" +name = "serde_urlencoded" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "slab" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "snowflake" @@ -1198,12 +1316,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.10.0" @@ -1212,13 +1324,13 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.81" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1245,9 +1357,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f5515d3add52e0bbdcad7b83c388bb36ba7b754dda3b5f5bc2d38640cdba5c" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" dependencies = [ "filetime", "libc", @@ -1256,13 +1368,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if 1.0.0", + "fastrand", "libc", - "rand", "redox_syscall", "remove_dir_all", "winapi 0.3.9", @@ -1285,18 +1397,18 @@ checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", @@ -1316,19 +1428,20 @@ dependencies = [ [[package]] name = "time" -version = "0.3.5" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41effe7cfa8af36f439fac33861b66b049edc6f9a32331e2312660529c1c24ad" +checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" dependencies = [ "itoa", "libc", + "num_threads", ] [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -1341,9 +1454,15 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" [[package]] name = "unicode-normalization" @@ -1356,15 +1475,15 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-xid" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" [[package]] name = "untrusted" @@ -1405,9 +1524,9 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" @@ -1455,9 +1574,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" dependencies = [ "cfg-if 1.0.0", "serde", @@ -1467,9 +1586,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" dependencies = [ "bumpalo", "lazy_static", @@ -1482,9 +1601,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-cli-support" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab11a7bfc3e3d5c075ee93626160b720a1cd9c320a9b932be4fc243dea9ed507" +checksum = "4016fbd42224de21aab2f009aeaec61067d278a298ba7f8f7f8d40fbffea0822" dependencies = [ "anyhow", "base64 0.9.3", @@ -1506,9 +1625,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-externref-xform" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83f23b0f14e12b08bcf95b75d1896771afbdd0a4167c889d202b81ed7858e3d5" +checksum = "f33c8e2d3f3b6f6647f982911eb4cb44998c8cca97a4fe7afc99f616ebb33a73" dependencies = [ "anyhow", "walrus", @@ -1516,9 +1635,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.28" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" +checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1528,9 +1647,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1538,9 +1657,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ "proc-macro2", "quote", @@ -1551,9 +1670,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-multi-value-xform" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eae02fd62b4954e74bd808ff160b58932b9a208e03a69e5776460655df11ed5" +checksum = "7015b54357604811162710d5cf274ab85d974fe1e324222dd5b2133afdefe9b9" dependencies = [ "anyhow", "walrus", @@ -1561,15 +1680,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" [[package]] name = "wasm-bindgen-threads-xform" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d5d14d234eb095de93a856f4740f0f46e57e58f7cb5c303b35ff3e9db189e90" +checksum = "6961b838d9a9c121ba4a1eea1628014cc759469e3defb42bbac9c5ed0f65be14" dependencies = [ "anyhow", "walrus", @@ -1578,9 +1697,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-wasm-conventions" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0febe9c6944f60dd5d38359ef5ab3eab82e8ac7a6e9b3961e4357d89192db686" +checksum = "c0a0eca38fe89471f57d6903f3e17e732d2d6f995a7af5b23f27df7fee0f0d18" dependencies = [ "anyhow", "walrus", @@ -1588,9 +1707,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-wasm-interpreter" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e3e00a34cb517890ac55321277286ac5e072f7076ab62eb85d58a781449d24" +checksum = "0b1c9fb7f71137840932bbb853ef1f83d68c88584b716c9bbae38675c9fb8b86" dependencies = [ "anyhow", "log", @@ -1621,9 +1740,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.55" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" dependencies = [ "js-sys", "wasm-bindgen", @@ -1779,9 +1898,9 @@ dependencies = [ [[package]] name = "xattr" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" dependencies = [ "libc", ] @@ -1843,26 +1962,17 @@ dependencies = [ [[package]] name = "yew" -version = "0.18.0" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4d5154faef86dddd2eb333d4755ea5643787d20aca683e58759b0e53351409f" +checksum = "2a1ccb53e57d3f7d847338cf5758befa811cabe207df07f543c06f502f9998cd" dependencies = [ - "anyhow", - "anymap", - "bincode", - "cfg-if 1.0.0", - "cfg-match", "console_error_panic_hook", - "gloo", - "http", + "gloo 0.4.2", + "gloo-utils", "indexmap", "js-sys", - "log", - "ryu", - "serde", - "serde_json", + "scoped-tls-hkt", "slab", - "thiserror", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -1871,12 +1981,13 @@ dependencies = [ [[package]] name = "yew-macro" -version = "0.18.0" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6e23bfe3dc3933fbe9592d149c9985f3047d08c637a884b9344c21e56e092ef" +checksum = "5fab79082b556d768d6e21811869c761893f0450e1d550a67892b9bce303b7bb" dependencies = [ "boolinator", "lazy_static", + "proc-macro-error", "proc-macro2", "quote", "syn", @@ -1884,57 +1995,46 @@ dependencies = [ [[package]] name = "yew-router" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27666236d9597eac9be560e841e415e20ba67020bc8cd081076be178e159c8bc" +checksum = "155804f6f3aa309f596d5c3fa14486a94e7756f1edd7634569949e401d5099f2" dependencies = [ - "cfg-if 1.0.0", - "cfg-match", - "gloo", + "gloo 0.4.2", + "gloo-utils", "js-sys", - "log", - "nom", + "route-recognizer", "serde", - "serde_json", + "serde-wasm-bindgen", + "serde_urlencoded", + "thiserror", "wasm-bindgen", "web-sys", "yew", "yew-router-macro", - "yew-router-route-parser", ] [[package]] name = "yew-router-macro" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c0ace2924b7a175e2d1c0e62ee7022a5ad840040dcd52414ce5f410ab322dba" +checksum = "39049d193b52eaad4ffc80916bf08806d142c90b5edcebd527644de438a7e19a" dependencies = [ "proc-macro2", "quote", "syn", - "yew-router-route-parser", -] - -[[package]] -name = "yew-router-route-parser" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de4a67208fb46b900af18a7397938b01f379dfc18da34799cfa8347eec715697" -dependencies = [ - "nom", ] [[package]] name = "yewprint" version = "0.1.1" dependencies = [ + "gloo 0.6.1", "heck 0.3.3", "id_tree", "regex", "wasm-bindgen", "web-sys", "yew", - "yewtil", ] [[package]] @@ -1955,6 +2055,7 @@ version = "0.1.0" dependencies = [ "build-data", "console_error_panic_hook", + "gloo 0.6.1", "syntect", "ureq", "wasm-bindgen", @@ -1964,28 +2065,3 @@ dependencies = [ "yew-router", "yewprint", ] - -[[package]] -name = "yewtil" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8543663ac49cd613df079282a1d8bdbdebdad6e02bac229f870fd4237b5d9aaa" -dependencies = [ - "log", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "yew", - "yewtil-macro", -] - -[[package]] -name = "yewtil-macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1433d8554db0f0a87a38aeea190780c1d5f9570384d99a34ab4de1c51d8eb8f3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/Cargo.toml b/Cargo.toml index ff709c7..4290812 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,11 +18,13 @@ default = ["tree"] tree = ["id_tree"] [dependencies] -web-sys = { version = "0.3", features = ["DomRect", "Element"] } -yew = "0.18" +web-sys = { version = "0.3", features = ["DomRect", "Element", "Event", "HtmlSelectElement"] } +# yew = { git = "https://github.com/yewstack/yew", branch = "master" } +yew = "0.19" id_tree = { version = "1.7", optional = true } -yewtil = { version = "0.4", features = ["pure"] } wasm-bindgen = "0.2" +gloo = "0.6" + [build-dependencies] regex = { version = "1", default-features = false, features = ["std", "unicode-perl"] } diff --git a/src/button_group.rs b/src/button_group.rs index 69e155c..ff559b1 100644 --- a/src/button_group.rs +++ b/src/button_group.rs @@ -1,10 +1,5 @@ -use std::borrow::Cow; use yew::prelude::*; -pub struct ButtonGroup { - props: ButtonGroupProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct ButtonGroupProps { #[prop_or_default] @@ -16,49 +11,28 @@ pub struct ButtonGroupProps { #[prop_or_default] pub large: bool, #[prop_or_default] - pub style: Option>, + pub style: Option, #[prop_or_default] pub children: html::Children, #[prop_or_default] pub class: Classes, } -impl Component for ButtonGroup { - type Message = (); - type Properties = ButtonGroupProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Self { props } - } - - fn update(&mut self, _: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { -
- {self.props.children.clone()} -
- } +#[function_component(ButtonGroup)] +pub fn button_group(props: &ButtonGroupProps) -> Html { + html! { +
+ {props.children.clone()} +
} } diff --git a/src/buttons.rs b/src/buttons.rs index 8156df0..a31364a 100644 --- a/src/buttons.rs +++ b/src/buttons.rs @@ -1,11 +1,6 @@ use crate::{Icon, IconName, Intent, Spinner, ICON_SIZE_LARGE}; -use std::borrow::Cow; use yew::prelude::*; -pub struct Button { - props: ButtonProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct ButtonProps { #[prop_or_default] @@ -35,84 +30,62 @@ pub struct ButtonProps { #[prop_or_default] pub class: Classes, #[prop_or_default] - pub style: Option>, + pub style: Option, #[prop_or_default] pub children: html::Children, } -impl Component for Button { - type Message = (); - type Properties = ButtonProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Button { props } - } - - fn update(&mut self, _msg: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { - - } + } + } } diff --git a/src/callout.rs b/src/callout.rs index a79f15d..59e00a0 100644 --- a/src/callout.rs +++ b/src/callout.rs @@ -1,12 +1,7 @@ use crate::icon::ICON_SIZE_LARGE; use crate::{Icon, IconName, Intent}; -use std::borrow::Cow; use yew::prelude::*; -pub struct Callout { - props: CalloutProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct CalloutProps { #[prop_or_default] @@ -18,63 +13,43 @@ pub struct CalloutProps { #[prop_or_default] pub intent: Option, #[prop_or_default] - pub title: Option>, + pub title: Option, pub children: html::Children, } -impl Component for Callout { - type Message = (); - type Properties = CalloutProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Self { props } - } - - fn update(&mut self, _msg: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props == props { - return false; - } - self.props = props; - true - } - - fn view(&self) -> Html { - let icon = if self.props.without_icon { - None - } else { - self.props.icon.or_else(|| { - self.props.intent.map(|intent| match intent { - Intent::Primary => IconName::InfoSign, - Intent::Success => IconName::Tick, - Intent::Warning => IconName::WarningSign, - Intent::Danger => IconName::Error, - }) +#[function_component(Callout)] +pub fn callout(props: &CalloutProps) -> Html { + let icon = if props.without_icon { + None + } else { + props.icon.or_else(|| { + props.intent.map(|intent| match intent { + Intent::Primary => IconName::InfoSign, + Intent::Success => IconName::Tick, + Intent::Warning => IconName::WarningSign, + Intent::Danger => IconName::Error, }) - }; - let classes = classes!( - self.props.class.clone(), - "bp3-callout", - icon.map(|_| "bp3-callout-icon"), - self.props.intent, - ); - html! { -
- { - icon.iter() - .map(|name| html!{}) - .collect::() - } - { - self.props.title.iter() - .map(|title| html!{

{title}

}) - .collect::() - } - { self.props.children.clone() } -
- } + }) + }; + let classes = classes!( + props.class.clone(), + "bp3-callout", + icon.map(|_| "bp3-callout-icon"), + props.intent, + ); + html! { +
+ { + icon.iter() + .map(|name| html!{}) + .collect::() + } + { + props.title.iter() + .map(|title| html!{

{title}

}) + .collect::() + } + { props.children.clone() } +
} } diff --git a/src/card.rs b/src/card.rs index 50c9213..e29b264 100644 --- a/src/card.rs +++ b/src/card.rs @@ -14,42 +14,17 @@ pub struct CardProps { pub children: html::Children, } -pub struct Card { - props: CardProps, -} - -impl Component for Card { - type Message = (); - type Properties = CardProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Self { props } - } - - fn update(&mut self, _msg: Self::Message) -> bool { - true - } - - fn change(&mut self, props: Self::Properties) -> bool { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { -
- {self.props.children.clone()} -
- } +#[function_component(Card)] +pub fn card(props: &CardProps) -> Html { + html! { +
+ {props.children.clone()} +
} } diff --git a/src/checkbox.rs b/src/checkbox.rs index c8f55a4..75d2a6c 100644 --- a/src/checkbox.rs +++ b/src/checkbox.rs @@ -1,11 +1,7 @@ use yew::prelude::*; -pub struct Checkbox { - props: Props, -} - #[derive(Clone, PartialEq, Properties)] -pub struct Props { +pub struct CheckboxProps { #[prop_or_default] pub disabled: bool, #[prop_or_default] @@ -15,56 +11,35 @@ pub struct Props { #[prop_or_default] pub checked: bool, #[prop_or_default] - pub onchange: Callback, + pub onchange: Callback, #[prop_or_default] pub label: yew::virtual_dom::VNode, #[prop_or_default] pub indeterminate_state: bool, } -impl Component for Checkbox { - type Message = (); - type Properties = Props; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Self { props } - } - - fn update(&mut self, _msg: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { - } } diff --git a/src/collapse.rs b/src/collapse.rs index a78ed39..202d00b 100644 --- a/src/collapse.rs +++ b/src/collapse.rs @@ -1,7 +1,7 @@ -use std::time::Duration; +use gloo::timers::callback::Timeout; +use std::{convert::TryInto, time::Duration}; use web_sys::Element; use yew::prelude::*; -use yew::services::*; pub struct Collapse { height: Height, @@ -11,10 +11,7 @@ pub struct Collapse { height_when_open: Option, animation_state: AnimationState, contents_ref: NodeRef, - callback_delayed_state_change: Callback<()>, - handle_delayed_state_change: Option>, - props: CollapseProps, - link: ComponentLink, + handle_delayed_state_change: Option, } #[derive(Clone, PartialEq, Properties)] @@ -52,77 +49,83 @@ impl Component for Collapse { type Message = (); type Properties = CollapseProps; - fn create(props: Self::Properties, link: ComponentLink) -> Self { + fn create(ctx: &Context) -> Self { Collapse { - height: if props.is_open { + height: if ctx.props().is_open { Height::Auto } else { Height::Zero }, overflow_visible: false, translated: false, - render_children: props.is_open || props.keep_children_mounted, + render_children: ctx.props().is_open || ctx.props().keep_children_mounted, height_when_open: None, - animation_state: if props.is_open { + animation_state: if ctx.props().is_open { AnimationState::Open } else { AnimationState::Closed }, contents_ref: NodeRef::default(), - callback_delayed_state_change: link.callback(|_| ()), handle_delayed_state_change: None, - props, - link, } } - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - if props.is_open { - match self.animation_state { - AnimationState::Open | AnimationState::Opening => {} - _ => { - self.animation_state = AnimationState::OpenStart; - self.render_children = true; - self.translated = false; - } - } - } else { - match self.animation_state { - AnimationState::Closed | AnimationState::Closing => {} - _ => { - self.animation_state = AnimationState::ClosingStart; - self.height = Height::Full; - self.translated = true; - } + fn changed(&mut self, ctx: &Context) -> bool { + if ctx.props().is_open { + match self.animation_state { + AnimationState::Open | AnimationState::Opening => {} + _ => { + self.animation_state = AnimationState::OpenStart; + self.render_children = true; + self.translated = false; } } - - self.props = props; - true } else { - false + match self.animation_state { + AnimationState::Closed | AnimationState::Closing => {} + _ => { + self.animation_state = AnimationState::ClosingStart; + self.height = Height::Full; + self.translated = true; + } + } } + + true } - fn update(&mut self, _msg: Self::Message) -> ShouldRender { + fn update(&mut self, ctx: &Context, _msg: Self::Message) -> bool { match self.animation_state { AnimationState::OpenStart => { + let link = ctx.link().clone(); self.animation_state = AnimationState::Opening; self.height = Height::Full; - self.handle_delayed_state_change = Some(Box::new(TimeoutService::spawn( - self.props.transition_duration, - self.callback_delayed_state_change.clone(), - ))); + self.handle_delayed_state_change = Some(Timeout::new( + ctx.props() + .transition_duration + .as_millis() + .try_into() + .unwrap(), + move || { + link.send_message(()); + }, + )); true } AnimationState::ClosingStart => { + let link = ctx.link().clone(); self.animation_state = AnimationState::Closing; self.height = Height::Zero; - self.handle_delayed_state_change = Some(Box::new(TimeoutService::spawn( - self.props.transition_duration, - self.callback_delayed_state_change.clone(), - ))); + self.handle_delayed_state_change = Some(Timeout::new( + ctx.props() + .transition_duration + .as_millis() + .try_into() + .unwrap(), + move || { + link.send_message(()); + }, + )); true } AnimationState::Opening => { @@ -132,7 +135,7 @@ impl Component for Collapse { } AnimationState::Closing => { self.animation_state = AnimationState::Closed; - if !self.props.keep_children_mounted { + if !ctx.props().keep_children_mounted { self.render_children = false; } true @@ -141,19 +144,19 @@ impl Component for Collapse { } } - fn rendered(&mut self, _first_render: bool) { + fn rendered(&mut self, ctx: &Context, _first_render: bool) { if self.render_children { let client_height = self.contents_ref.cast::().unwrap().client_height(); self.height_when_open = Some(format!("{}px", client_height)); } match self.animation_state { - AnimationState::OpenStart | AnimationState::ClosingStart => self.link.send_message(()), + AnimationState::OpenStart | AnimationState::ClosingStart => ctx.link().send_message(()), _ => {} } } - fn view(&self) -> Html { + fn view(&self, ctx: &Context) -> Html { let mut container_style = String::with_capacity(30); match (self.height, self.height_when_open.as_ref()) { (Height::Zero, _) => container_style.push_str("height: 0px; "), @@ -179,19 +182,19 @@ impl Component for Collapse { } html! { -
+
{ if self.render_children { - self.props.children.clone() + ctx.props().children.clone() } else { Default::default() } diff --git a/src/control_group.rs b/src/control_group.rs index bcf938c..3376ce6 100644 --- a/src/control_group.rs +++ b/src/control_group.rs @@ -1,9 +1,5 @@ use yew::prelude::*; -pub struct ControlGroup { - props: ControlGroupProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct ControlGroupProps { #[prop_or_default] @@ -18,39 +14,18 @@ pub struct ControlGroupProps { pub class: Classes, } -impl Component for ControlGroup { - type Message = (); - type Properties = ControlGroupProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Self { props } - } - - fn update(&mut self, _: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { -
- {self.props.children.clone()} -
- } +#[function_component(ControlGroup)] +pub fn control_group(props: &ControlGroupProps) -> Html { + html! { +
+ {props.children.clone()} +
} } diff --git a/src/divider.rs b/src/divider.rs index ccf37e5..caa8587 100644 --- a/src/divider.rs +++ b/src/divider.rs @@ -1,9 +1,5 @@ use yew::prelude::*; -pub struct Divider { - props: DividerProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct DividerProps { #[prop_or_default] @@ -14,36 +10,15 @@ pub struct DividerProps { pub class: Classes, } -impl Component for Divider { - type Message = (); - type Properties = DividerProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Self { props } - } - - fn update(&mut self, _: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { - - } +#[function_component(Divider)] +pub fn view(props: &DividerProps) -> Html { + html! { + } } diff --git a/src/html_elements.rs b/src/html_elements.rs index 218cd21..796cee8 100644 --- a/src/html_elements.rs +++ b/src/html_elements.rs @@ -1,40 +1,36 @@ use yew::prelude::*; -use yewtil::{Pure, PureComponent}; + +#[derive(Properties, PartialEq)] +pub struct ChildrenOnlyProps { + #[prop_or_default] + pub class: Classes, + #[prop_or_default] + pub children: html::Children, +} macro_rules! build_component { - ($name:ident, $props_name:ident, $tag:tt, $class:literal) => { - pub type $name = Pure<$props_name>; - - #[derive(Debug, Clone, PartialEq, Properties)] - pub struct $props_name { - #[prop_or_default] - pub class: Classes, - #[prop_or_default] - pub children: html::Children, - } - - impl PureComponent for $props_name { - fn render(&self) -> Html { - html! { - <$tag class=classes!($class, self.class.clone())> - {self.children.clone()} - - } + ($name:ident, $tag:tt, $class:literal) => { + #[function_component($name)] + pub fn $tag(props: &ChildrenOnlyProps) -> Html { + html! { + <$tag class={classes!($class, props.class.clone())}> + { props.children.clone() } + } } }; } -build_component!(H1, H1Props, h1, "bp3-heading"); -build_component!(H2, H2Props, h2, "bp3-heading"); -build_component!(H3, H3Props, h3, "bp3-heading"); -build_component!(H4, H4Props, h4, "bp3-heading"); -build_component!(H5, H5Props, h5, "bp3-heading"); -build_component!(H6, H6Props, h6, "bp3-heading"); +build_component!(H1, h1, "bp3-heading"); +build_component!(H2, h2, "bp3-heading"); +build_component!(H3, h3, "bp3-heading"); +build_component!(H4, h4, "bp3-heading"); +build_component!(H5, h5, "bp3-heading"); +build_component!(H6, h6, "bp3-heading"); -build_component!(Blockquote, BlockquoteProps, blockquote, "bp3-blockquote"); -build_component!(Code, CodeProps, code, "bp3-code"); -build_component!(Label, LabelProps, label, "bp3-label"); -build_component!(Pre, PreProps, pre, "bp3-pre"); -build_component!(Ol, OlProps, ol, "bp3-ol"); -build_component!(Ul, UlProps, ul, "bp3-ul"); +build_component!(Blockquote, blockquote, "bp3-blockquote"); +build_component!(Code, code, "bp3-code"); +build_component!(Label, label, "bp3-label"); +build_component!(Pre, pre, "bp3-pre"); +build_component!(Ol, ol, "bp3-ol"); +build_component!(Ul, ul, "bp3-ul"); diff --git a/src/html_select.rs b/src/html_select.rs index 48cfd2e..9bf7fe2 100644 --- a/src/html_select.rs +++ b/src/html_select.rs @@ -1,9 +1,11 @@ +use std::marker::PhantomData; + use crate::{Icon, IconName}; +use web_sys::HtmlSelectElement; use yew::prelude::*; pub struct HtmlSelect { - props: HtmlSelectProps, - link: ComponentLink, + phantom: PhantomData, } #[derive(Clone, PartialEq, Properties)] @@ -30,51 +32,44 @@ pub struct HtmlSelectProps { } impl Component for HtmlSelect { - type Message = ChangeData; + type Message = Event; type Properties = HtmlSelectProps; - fn create(props: Self::Properties, link: ComponentLink) -> Self { - Self { props, link } + fn create(_ctx: &Context) -> Self { + Self { + phantom: PhantomData, + } } - fn update(&mut self, msg: Self::Message) -> ShouldRender { - let i = if let ChangeData::Select(select) = msg { + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + let i = if let Some(select) = msg.target_dyn_into::() { select.selected_index() } else { - unreachable!("unexpected ChangeData variant: {:?}", msg); + unreachable!("unexpected Event: {:?}", msg); }; if i >= 0 { let i = i as usize; - let variant = self.props.options[i].0.clone(); - self.props.onchange.emit(variant); + let variant = ctx.props().options[i].0.clone(); + ctx.props().onchange.emit(variant); } false } - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - let option_children = self - .props + fn view(&self, ctx: &Context) -> Html { + let option_children = ctx + .props() .options .iter() .map(|(value, label)| { - let selected = self - .props + let selected = ctx + .props() .value .as_ref() .map(|x| value == x) .unwrap_or_default(); html! { - } @@ -83,24 +78,24 @@ impl Component for HtmlSelect { html! {
- +
} } diff --git a/src/icon.rs b/src/icon.rs index 25a07fb..9a19a27 100644 --- a/src/icon.rs +++ b/src/icon.rs @@ -12,10 +12,6 @@ impl Default for IconName { pub const ICON_SIZE_STANDARD: i32 = 16; pub const ICON_SIZE_LARGE: i32 = 20; -pub struct Icon { - props: IconProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct IconProps { pub icon: IconName, @@ -33,62 +29,41 @@ pub struct IconProps { pub onclick: Callback, } -impl Component for Icon { - type Message = (); - type Properties = IconProps; +#[function_component(Icon)] +pub fn icon(props: &IconProps) -> Html { + let paths = if props.icon_size == ICON_SIZE_STANDARD { + icon_svg_paths_16(props.icon) + } else { + icon_svg_paths_20(props.icon) + }; + let pixel_grid_size = if props.icon_size >= ICON_SIZE_LARGE { + ICON_SIZE_LARGE + } else { + ICON_SIZE_STANDARD + }; + let icon_string = format!("{:?}", props.icon); - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Icon { props } - } - - fn update(&mut self, _msg: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - let paths = if self.props.icon_size == ICON_SIZE_STANDARD { - icon_svg_paths_16(self.props.icon) - } else { - icon_svg_paths_20(self.props.icon) - }; - let pixel_grid_size = if self.props.icon_size >= ICON_SIZE_LARGE { - ICON_SIZE_LARGE - } else { - ICON_SIZE_STANDARD - }; - let icon_string = format!("{:?}", self.props.icon); - - html! { - + - - {self.props.title.clone().unwrap_or(icon_string)} - { - paths.iter() - .map(|x| html! { - - }) - .collect::() - } - - - } + {props.title.clone().unwrap_or(icon_string)} + { + paths.iter() + .map(|x| html! { + + }) + .collect::() + } + +
} } diff --git a/src/input_group.rs b/src/input_group.rs index 705d1e3..2dc0f9c 100644 --- a/src/input_group.rs +++ b/src/input_group.rs @@ -4,8 +4,6 @@ use yew::prelude::*; const MIN_HORIZONTAL_PADDING: i32 = 10; pub struct InputGroup { - props: InputGroupProps, - link: ComponentLink, left_element_ref: NodeRef, left_element_width: Option, right_element_ref: NodeRef, @@ -74,7 +72,7 @@ pub struct InputGroupProps { #[prop_or_default] pub input_type: TextInputType, #[prop_or_default] - pub oninput: Callback, + pub oninput: Callback, #[prop_or_default] pub onkeyup: Callback, #[prop_or_default] @@ -91,10 +89,8 @@ impl Component for InputGroup { type Message = (); type Properties = InputGroupProps; - fn create(props: Self::Properties, link: ComponentLink) -> Self { + fn create(_ctx: &Context) -> Self { Self { - props, - link, left_element_ref: Default::default(), left_element_width: Default::default(), right_element_ref: Default::default(), @@ -102,20 +98,11 @@ impl Component for InputGroup { } } - fn update(&mut self, _: Self::Message) -> ShouldRender { + fn update(&mut self, _ctx: &Context, _: Self::Message) -> bool { true } - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { + fn view(&self, ctx: &Context) -> Html { let input_style = match (self.left_element_width, self.right_element_width) { (Some(left), None) => format!("padding-left:{}px", left.max(MIN_HORIZONTAL_PADDING)), (None, Some(right)) => format!("padding-right:{}px", right.max(MIN_HORIZONTAL_PADDING)), @@ -129,53 +116,53 @@ impl Component for InputGroup { html! {
{ - if let Some(left_element) = self.props.left_element.clone() { + if let Some(left_element) = ctx.props().left_element.clone() { html! { {left_element} } - } else if let Some(icon) = self.props.left_icon { + } else if let Some(icon) = ctx.props().left_icon { html! { - + } } else { html!() } } { - if let Some(right_element) = self.props.right_element.clone() { + if let Some(right_element) = ctx.props().right_element.clone() { html! { {right_element} @@ -188,7 +175,7 @@ impl Component for InputGroup { } } - fn rendered(&mut self, _first_render: bool) { + fn rendered(&mut self, ctx: &Context, _first_render: bool) { let left_old_value = self.left_element_width.take(); self.left_element_width = self .left_element_ref @@ -203,7 +190,7 @@ impl Component for InputGroup { if left_old_value != self.left_element_width || right_old_value != self.right_element_width { - self.link.send_message(()); + ctx.link().send_message(()); } } } diff --git a/src/menu.rs b/src/menu.rs index 158fbf9..c142a1e 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -1,11 +1,6 @@ use crate::{Icon, IconName, Intent, H6}; -use std::borrow::Cow; use yew::prelude::*; -pub struct Menu { - props: MenuProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct MenuProps { #[prop_or_default] @@ -17,45 +12,20 @@ pub struct MenuProps { pub children: html::Children, } -impl Component for Menu { - type Message = (); - type Properties = MenuProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Menu { props } +#[function_component(Menu)] +pub fn menu(props: &MenuProps) -> Html { + html! { +
    + {props.children.clone()} +
} - - fn update(&mut self, _msg: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { -
    - {self.props.children.clone()} -
- } - } -} - -pub struct MenuItem { - props: MenuItemProps, } #[derive(Clone, PartialEq, Properties)] @@ -71,7 +41,7 @@ pub struct MenuItemProps { #[prop_or_default] pub disabled: bool, #[prop_or_default] - pub href: Option>, + pub href: Option, #[prop_or_default] pub label: Option, #[prop_or_default] @@ -89,127 +59,81 @@ pub struct MenuItemProps { // TODO: pub children: html::Children, } -impl Component for MenuItem { - type Message = (); - type Properties = MenuItemProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - MenuItem { props } - } - - fn update(&mut self, _msg: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { -
  • - - { - if let Some(icon_name) = self.props.icon { - html! { - - } - } else if let Some(html) = self.props.icon_html.clone() { - html - } else { - html! { - - } +#[function_component(MenuItem)] +pub fn menu_item(props: &MenuItemProps) -> Html { + html! { +
  • + + { + if let Some(icon_name) = props.icon { + html! { + + } + } else if let Some(html) = props.icon_html.clone() { + html + } else { + html! { + } } -
    - {self.props.text.clone()} -
    - { - if let Some(label) = self.props.label.clone() { - html! { - - {label} - - } - } else { - html!() + } +
    + {props.text.clone()} +
    + { + if let Some(label) = props.label.clone() { + html! { + + {label} + } + } else { + html!() } + } -
    -
  • - } + + } } -pub struct MenuDivider { - props: MenuDividerProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct MenuDividerProps { #[prop_or_default] pub title: Option, } -impl Component for MenuDivider { - type Message = (); - type Properties = MenuDividerProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Self { props } - } - - fn update(&mut self, _msg: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { - if let Some(title) = self.props.title.clone() { - html! { -
  • -
    {title}
    -
  • - } - } else { - html! { -
  • - } +#[function_component(MenuDivider)] +pub fn menu_divider(props: &MenuDividerProps) -> Html { + html! { + {if let Some(title) = props.title.clone() { + html! { +
  • +
    {title}
    +
  • } - } + } else { + html! { +
  • + } + }} } } diff --git a/src/numeric_input.rs b/src/numeric_input.rs index bef7efd..1bf2a35 100644 --- a/src/numeric_input.rs +++ b/src/numeric_input.rs @@ -1,7 +1,9 @@ use crate::{Button, ButtonGroup, ControlGroup, IconName, InputGroup, Intent}; use std::fmt::Display; +use std::marker::PhantomData; use std::ops::{Add, Bound, RangeBounds, Sub}; use std::str::FromStr; +use web_sys::HtmlInputElement; use yew::html::IntoPropValue; use yew::prelude::*; @@ -16,9 +18,8 @@ where + PartialOrd + 'static, { - props: NumericInputProps, - link: ComponentLink, input: String, + phantom: PhantomData, } #[derive(Clone, PartialEq, Properties)] @@ -84,42 +85,46 @@ where type Message = Msg; type Properties = NumericInputProps; - fn create(props: Self::Properties, link: ComponentLink) -> Self { + fn create(_ctx: &Context) -> Self { Self { - props, - link, input: Default::default(), + phantom: PhantomData, } } - fn update(&mut self, msg: Self::Message) -> ShouldRender { + fn update(&mut self, ctx: &Context, msg: Self::Message) -> bool { + let mut update_value = |new_value| { + let new_value = ctx.props().bounds.clamp(new_value, ctx.props().increment); + + if new_value != ctx.props().value { + self.input = new_value.to_string(); + ctx.props().onchange.emit(new_value); + true + } else { + false + } + }; + match msg { Msg::InputUpdate(new_value) => { if let Ok(new_value) = new_value.trim().parse::() { - self.update_value(new_value) + update_value(new_value) } else { false } } - Msg::Up => self.update_value(self.props.value + self.props.increment), - Msg::Down => self.update_value(self.props.value - self.props.increment), + Msg::Up => update_value(ctx.props().value + ctx.props().increment), + Msg::Down => update_value(ctx.props().value - ctx.props().increment), Msg::Noop => false, } } - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - if self.props.value != props.value { - self.input = props.value.to_string(); - } - self.props = props; - true - } else { - false - } + fn changed(&mut self, ctx: &Context) -> bool { + self.input = ctx.props().value.to_string(); + true } - fn view(&self) -> Html { + fn view(&self, ctx: &Context) -> Html { let NumericInputProps { value, increment, @@ -127,8 +132,9 @@ where disable_buttons, buttons_on_the_left, .. - } = self.props; - let bounds = &self.props.bounds; + } = *ctx.props(); + + let bounds = &ctx.props().bounds; let button_up_disabled = disabled || bounds.clamp(value + increment, increment) == value; let button_down_disabled = disabled || bounds.clamp(value - increment, increment) == value; @@ -136,16 +142,16 @@ where html!() } else { html! { - + - ) - }; - - html! { - + html!( + + ) + }; + + html! { + + {icon} + + {props.children.clone()} + + {right_icon} + {remove_button} + } } diff --git a/src/text.rs b/src/text.rs index 6246bc2..77f0985 100644 --- a/src/text.rs +++ b/src/text.rs @@ -1,10 +1,5 @@ -use std::borrow::Cow; use yew::prelude::*; -pub struct Text { - props: TextProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct TextProps { #[prop_or_default] @@ -17,44 +12,23 @@ pub struct TextProps { #[prop_or_default] pub inline: bool, #[prop_or_default] - pub title: Option>, + pub title: Option, #[prop_or_default] - pub style: Option>, + pub style: Option, } -impl Component for Text { - type Message = (); - type Properties = TextProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Text { props } - } - - fn update(&mut self, _msg: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - html! { - <@{if self.props.inline { "span" } else { "div"}} - class=classes!( - self.props.class.clone(), - self.props.ellipsize.then (|| "bp3-text-overflow-ellipsis"), - ) - style=self.props.style.clone() - title=self.props.title.clone() - > - {self.props.children.clone()} - - } +#[function_component(Text)] +pub fn text(props: &TextProps) -> Html { + html! { + <@{if props.inline { "span" } else { "div"}} + class={classes!( + props.class.clone(), + props.ellipsize.then (|| "bp3-text-overflow-ellipsis"), + )} + style={props.style.clone()} + title={props.title.clone()} + > + {props.children.clone()} + } } diff --git a/src/text_area.rs b/src/text_area.rs index 496019c..10cce90 100644 --- a/src/text_area.rs +++ b/src/text_area.rs @@ -1,10 +1,6 @@ use crate::Intent; use yew::prelude::*; -pub struct TextArea { - props: TextAreaProps, -} - #[derive(Clone, PartialEq, Properties)] pub struct TextAreaProps { #[prop_or_default] @@ -22,44 +18,23 @@ pub struct TextAreaProps { #[prop_or_default] pub small: bool, #[prop_or_default] - pub onchange: Option>, + pub onchange: Option>, } -impl Component for TextArea { - type Message = (); - type Properties = TextAreaProps; - - fn create(props: Self::Properties, _link: ComponentLink) -> Self { - TextArea { props } - } - - fn update(&mut self, _msg: Self::Message) -> ShouldRender { - true - } - - fn change(&mut self, props: Self::Properties) -> ShouldRender { - if self.props != props { - self.props = props; - true - } else { - false - } - } - - fn view(&self) -> Html { - let classes = classes!( - "bp3-input", - self.props.intent, - self.props.class.clone(), - self.props.fill.then(|| "bp3-fill"), - self.props.small.then(|| "bp3-small"), - self.props.large.then(|| "bp3-large"), - ); - html! { -