From 350a878245f19f3e9bfaf0d60cd3ac3a25a837d0 Mon Sep 17 00:00:00 2001 From: spieljs Date: Sun, 22 Mar 2020 02:55:10 +0100 Subject: [PATCH 01/16] implementing test for button --- crate/Cargo.lock | 37 ++++++- crate/webdriver.json | 17 +++ crate/yew_styles/Cargo.lock | 33 +++++- crate/yew_styles/Cargo.toml | 5 +- crate/yew_styles/src/components/button.rs | 120 ++++++++++++++++++++++ crate/yew_styles/src/lib.rs | 1 + 6 files changed, 207 insertions(+), 6 deletions(-) create mode 100644 crate/webdriver.json diff --git a/crate/Cargo.lock b/crate/Cargo.lock index 0956f1c..bde2b95 100644 --- a/crate/Cargo.lock +++ b/crate/Cargo.lock @@ -503,6 +503,11 @@ name = "ryu" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "semver" version = "0.9.0" @@ -721,7 +726,7 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -756,6 +761,28 @@ name = "wasm-bindgen-shared" version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wasm-bindgen-test" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test-macro 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "web-sys" version = "0.3.36" @@ -832,7 +859,7 @@ dependencies = [ "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-futures 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", "yew-macro 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -913,6 +940,7 @@ version = "0.2.1" dependencies = [ "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", "yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -985,6 +1013,7 @@ dependencies = [ "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +"checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" @@ -1010,10 +1039,12 @@ dependencies = [ "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" "checksum wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" -"checksum wasm-bindgen-futures 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8bbdd49e3e28b40dec6a9ba8d17798245ce32b019513a845369c641b275135d9" +"checksum wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" "checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" "checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" "checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" +"checksum wasm-bindgen-test 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "449aeba7035e4a4710cd263bbac33519fa3828bff1c6f642fa8896601e7016ad" +"checksum wasm-bindgen-test-macro 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "49449f8dcedc192bd0cf11b5711982decdd4dbad1029f92370e2b1215031dd59" "checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum wee_alloc 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" diff --git a/crate/webdriver.json b/crate/webdriver.json new file mode 100644 index 0000000..3d81202 --- /dev/null +++ b/crate/webdriver.json @@ -0,0 +1,17 @@ +{ + "moz:firefoxOptions": { + "prefs": { + "binary": "/usr/bin/firefox", + "media.navigator.streams.fake": true, + "media.navigator.permission.disabled": true + }, + "log": {"level": "trace"}, + "args": [] + }, + "goog:chromeOptions": { + "args": [ + "--use-fake-device-for-media-stream", + "--use-fake-ui-for-media-stream" + ] + } + } \ No newline at end of file diff --git a/crate/yew_styles/Cargo.lock b/crate/yew_styles/Cargo.lock index 0a224c0..8ec460b 100644 --- a/crate/yew_styles/Cargo.lock +++ b/crate/yew_styles/Cargo.lock @@ -408,6 +408,11 @@ name = "ryu" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "semver" version = "0.9.0" @@ -640,6 +645,28 @@ name = "wasm-bindgen-shared" version = "0.2.59" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wasm-bindgen-test" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test-macro 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "web-sys" version = "0.3.36" @@ -707,11 +734,12 @@ dependencies = [ [[package]] name = "yew_styles" -version = "0.2.0" +version = "0.2.1" dependencies = [ "stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", "yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -772,6 +800,7 @@ dependencies = [ "checksum rmp-serde 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4c1ee98f14fe8b8e9c5ea13d25da7b2a1796169202c57a09d7288de90d56222b" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +"checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" @@ -798,6 +827,8 @@ dependencies = [ "checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" "checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" "checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" +"checksum wasm-bindgen-test 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "449aeba7035e4a4710cd263bbac33519fa3828bff1c6f642fa8896601e7016ad" +"checksum wasm-bindgen-test-macro 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "49449f8dcedc192bd0cf11b5711982decdd4dbad1029f92370e2b1215031dd59" "checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" "checksum yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "29d4669e99b3ab4473eb8337c4c2f0c5e1ad6230ee704d6460bdf40084480db1" diff --git a/crate/yew_styles/Cargo.toml b/crate/yew_styles/Cargo.toml index 44d8239..4cb238b 100644 --- a/crate/yew_styles/Cargo.toml +++ b/crate/yew_styles/Cargo.toml @@ -14,8 +14,9 @@ std_web = ["stdweb", "yew/std_web"] web_sys = ["web-sys", "yew/web_sys"] [dependencies] -wasm-bindgen = "0.2" +wasm-bindgen = "0.2.59" +wasm-bindgen-test = "0.3" yew = { version = "0.14", features = ["toml", "yaml", "msgpack", "cbor"], optional = true} stdweb = { version = "0.4", optional = true} -web-sys = {version = "0.3", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement"], optional=true} +web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"], optional=true} uuid = {version= "0.8", features=["v4", "wasm-bindgen", "stdweb"]} diff --git a/crate/yew_styles/src/components/button.rs b/crate/yew_styles/src/components/button.rs index 0d7499a..c25a70a 100644 --- a/crate/yew_styles/src/components/button.rs +++ b/crate/yew_styles/src/components/button.rs @@ -1,6 +1,9 @@ use crate::styles::{get_pallete, get_style, Palette, Style}; +use wasm_bindgen_test::{wasm_bindgen_test, wasm_bindgen_test_configure}; use yew::prelude::*; +wasm_bindgen_test_configure!(run_in_browser); + #[derive(Clone)] pub enum ButtonType { Primary, @@ -120,3 +123,120 @@ impl Component for Button { } } } + +#[cfg(feature = "web_sys")] +#[wasm_bindgen_test] +fn should_trigger_action_when_button_clicked() { + use web_sys::window; + + let body = window().unwrap().document().unwrap().body().unwrap(); + + let element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + element.set_text_content(Some("home")); + element.set_id("menu"); + + body.append_child(&element).unwrap(); + + let onchange_name = Callback::from(|_| { + let content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("menu") + .unwrap(); + + content.set_text_content(Some("about")); + }); + + let props = Props { + class_name: String::from("test-button"), + size: Size::Medium, + button_style: Style::Regular, + onsignal: onchange_name, + button_type: Palette::Standard, + children: Children::new(vec![html! {}]), + }; + + let link = ComponentLink::new(); + + let mut button = Button::create(props.clone(), link); + + props.onsignal.emit(()); + + button.change(props); + + let updated_content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("menu") + .unwrap() + .text_content() + .unwrap(); + + assert_eq!(updated_content, String::from("about")); +} + +#[cfg(feature = "web_sys")] +#[wasm_bindgen_test] +fn should_create_button_component() { + use web_sys::window; + use yew::services::ConsoleService; + + let mut console = ConsoleService::new(); + + let on_add_child = Callback::from(|_| { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let child_element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + + child_element.set_text_content(Some("child")); + child_element.set_id("child"); + body.append_child(&child_element).unwrap(); + }); + + let props = Props { + class_name: String::from("test-button"), + size: Size::Medium, + button_style: Style::Regular, + onsignal: on_add_child, + button_type: Palette::Standard, + children: Children::new(vec![html! {
{"parent"}
}]), + }; + + let link = ComponentLink::new(); + + let mut button = Button::create(props.clone(), link.clone()); + + props.onsignal.emit(()); + + button.change(props); + + let button_vnode = button.render(); + + console.log(&format!("{:#?}", button_vnode)); + + let vnode_expected = html! { + + }; + + console.log(&format!("{:#?}", vnode_expected)); + + let match_vnode = button_vnode.eq(&vnode_expected); + + assert_eq!(match_vnode, true); +} diff --git a/crate/yew_styles/src/lib.rs b/crate/yew_styles/src/lib.rs index bf21834..cf97ba4 100644 --- a/crate/yew_styles/src/lib.rs +++ b/crate/yew_styles/src/lib.rs @@ -1,4 +1,5 @@ #![recursion_limit = "512"] +extern crate wasm_bindgen_test; pub mod assets; mod components; From 8ada9c42b4896ea67f0ad184e05d910ba7963e6f Mon Sep 17 00:00:00 2001 From: spieljs Date: Tue, 24 Mar 2020 01:41:10 +0100 Subject: [PATCH 02/16] implement test to Button --- crate/yew_styles/src/components/button.rs | 59 ----------------------- 1 file changed, 59 deletions(-) diff --git a/crate/yew_styles/src/components/button.rs b/crate/yew_styles/src/components/button.rs index c25a70a..3746832 100644 --- a/crate/yew_styles/src/components/button.rs +++ b/crate/yew_styles/src/components/button.rs @@ -181,62 +181,3 @@ fn should_trigger_action_when_button_clicked() { assert_eq!(updated_content, String::from("about")); } - -#[cfg(feature = "web_sys")] -#[wasm_bindgen_test] -fn should_create_button_component() { - use web_sys::window; - use yew::services::ConsoleService; - - let mut console = ConsoleService::new(); - - let on_add_child = Callback::from(|_| { - let body = window().unwrap().document().unwrap().body().unwrap(); - - let child_element = window() - .unwrap() - .document() - .unwrap() - .create_element("div") - .unwrap(); - - child_element.set_text_content(Some("child")); - child_element.set_id("child"); - body.append_child(&child_element).unwrap(); - }); - - let props = Props { - class_name: String::from("test-button"), - size: Size::Medium, - button_style: Style::Regular, - onsignal: on_add_child, - button_type: Palette::Standard, - children: Children::new(vec![html! {
{"parent"}
}]), - }; - - let link = ComponentLink::new(); - - let mut button = Button::create(props.clone(), link.clone()); - - props.onsignal.emit(()); - - button.change(props); - - let button_vnode = button.render(); - - console.log(&format!("{:#?}", button_vnode)); - - let vnode_expected = html! { - - }; - - console.log(&format!("{:#?}", vnode_expected)); - - let match_vnode = button_vnode.eq(&vnode_expected); - - assert_eq!(match_vnode, true); -} From 674c6cd3d3a0019c15ef8a5e28f53bbb79643490 Mon Sep 17 00:00:00 2001 From: spieljs Date: Sun, 29 Mar 2020 18:16:45 +0200 Subject: [PATCH 03/16] fix clippy issues and split the tests --- crate/Cargo.lock | 786 +++++++++--------- crate/Cargo.toml | 2 +- crate/webdriver.json | 17 - crate/yew_styles/.cargo/config | 2 + crate/yew_styles/Cargo.lock | 279 +++---- crate/yew_styles/Cargo.toml | 13 +- crate/yew_styles/src/components/button.rs | 61 -- crate/yew_styles/src/components/container.rs | 20 +- crate/yew_styles/src/components/item.rs | 14 +- crate/yew_styles/src/components/navbar/mod.rs | 4 +- .../navbar/{navbar.rs => navbar_component.rs} | 0 .../src/components/navbar/navbar_container.rs | 2 +- crate/yew_styles/src/lib.rs | 2 - crate/yew_styles/tests/button.rs | 119 +++ 14 files changed, 685 insertions(+), 636 deletions(-) delete mode 100644 crate/webdriver.json create mode 100644 crate/yew_styles/.cargo/config rename crate/yew_styles/src/components/navbar/{navbar.rs => navbar_component.rs} (100%) create mode 100644 crate/yew_styles/tests/button.rs diff --git a/crate/Cargo.lock b/crate/Cargo.lock index bde2b95..54a0677 100644 --- a/crate/Cargo.lock +++ b/crate/Cargo.lock @@ -4,1055 +4,1065 @@ name = "anyhow" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "768155103fe6b9bf51090758e0657aa34dde4f6618f32ba1c3e45be3b29a0709" [[package]] name = "anymap" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" [[package]] name = "arrayvec" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" dependencies = [ - "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "nodrop", ] [[package]] name = "autocfg" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" [[package]] name = "backtrace" version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" dependencies = [ - "backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys", + "cfg-if", + "libc", + "rustc-demangle", ] [[package]] name = "backtrace-sys" version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" dependencies = [ - "cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", + "cc", + "libc", ] [[package]] name = "base-x" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" [[package]] name = "bincode" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", + "serde", ] [[package]] name = "boolinator" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" [[package]] name = "bumpalo" version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fb8038c1ddc0a5f73787b130f4cc75151e96ed33e417fde765eb5a81e3532f4" [[package]] name = "byteorder" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" [[package]] name = "bytes" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10004c15deb332055f7a4a208190aed362cf9a7c2f6ab70a305fba50e1105f38" [[package]] name = "cc" version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0213d356d3c4ea2c18c40b037c3be23cd639825c18f25ee670ac7813beeef99c" [[package]] name = "cfg-if" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] name = "cfg-match" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8100e46ff92eb85bf6dc2930c73f2a4f7176393c84a9446b3d501e1b354e7b34" [[package]] name = "console_error_panic_hook" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "wasm-bindgen", ] [[package]] name = "discard" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" [[package]] name = "dotenv" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" [[package]] name = "dtoa" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" [[package]] name = "failure" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" dependencies = [ - "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", - "failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace", + "failure_derive", ] [[package]] name = "failure_derive" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", + "synstructure", ] [[package]] name = "fnv" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" [[package]] name = "futures" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780" dependencies = [ - "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", ] [[package]] name = "futures-channel" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core", + "futures-sink", ] [[package]] name = "futures-core" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" [[package]] name = "futures-executor" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba" dependencies = [ - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core", + "futures-task", + "futures-util", ] [[package]] name = "futures-io" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" [[package]] name = "futures-macro" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" dependencies = [ - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "futures-sink" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" [[package]] name = "futures-task" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" [[package]] name = "futures-util" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" dependencies = [ - "futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-utils", + "proc-macro-hack", + "proc-macro-nested", + "slab", ] [[package]] name = "getrandom" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "stdweb", + "wasi", + "wasm-bindgen", ] [[package]] name = "gloo" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ce6f2dfa9f57f15b848efa2aade5e1850dc72986b87a2b0752d44ca08f4967" dependencies = [ - "gloo-console-timer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gloo-events 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gloo-file 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "gloo-timers 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gloo-console-timer", + "gloo-events", + "gloo-file", + "gloo-timers", ] [[package]] name = "gloo-console-timer" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b48675544b29ac03402c6dffc31a912f716e38d19f7e74b78b7e900ec3c941ea" dependencies = [ - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys", ] [[package]] name = "gloo-events" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "088514ec8ef284891c762c88a66b639b3a730134714692ee31829765c5bc814f" dependencies = [ - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen", + "web-sys", ] [[package]] name = "gloo-file" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9fecfe46b5dc3cc46f58e98ba580cc714f2c93860796d002eb3527a465ef49" dependencies = [ - "gloo-events 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "gloo-events", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] name = "gloo-timers" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2d17dbd803c2fc86cb1b613adf63192046a7176f383a8302594654752c4c4a" dependencies = [ - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] name = "half" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff54597ea139063f4225f1ec47011b03c9de4a486957ff3fc506881dac951d0" [[package]] name = "http" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" dependencies = [ - "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes", + "fnv", + "itoa", ] [[package]] name = "indexmap" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", ] [[package]] name = "itoa" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" [[package]] name = "js-sys" version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" dependencies = [ - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lexical-core" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7043aa5c05dd34fb73b47acb8c3708eac428de4545ea3682ed2f11293ebd890" dependencies = [ - "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec", + "cfg-if", + "rustc_version", + "ryu", + "static_assertions", ] [[package]] name = "libc" version = "0.2.65" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" [[package]] name = "linked-hash-map" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" [[package]] name = "log" version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", ] [[package]] name = "memchr" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" [[package]] name = "memory_units" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" [[package]] name = "nodrop" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "nom" version = "5.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b471253da97532da4b61552249c521e01e736071f71c1a4f7ebbfbf0a06aad6" dependencies = [ - "lexical-core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lexical-core", + "memchr", + "version_check", ] [[package]] name = "num-traits" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" dependencies = [ - "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg", ] [[package]] name = "pin-utils" version = "0.1.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" [[package]] name = "ppv-lite86" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" [[package]] name = "proc-macro-hack" version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "proc-macro-nested" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" [[package]] name = "proc-macro2" version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid", ] [[package]] name = "quote" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", ] [[package]] name = "rand" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", + "libc", + "rand_chacha", + "rand_core", + "rand_hc", ] [[package]] name = "rand_chacha" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ - "ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ppv-lite86", + "rand_core", ] [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom", ] [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core", ] [[package]] name = "rmp" version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f594cb7ff8f1c5a7907f6be91f15795c8301e0d5718eb007fb5832723dd716e" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", + "num-traits", ] [[package]] name = "rmp-serde" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a31c0798045f039ace94e0166f76478b3ba83116ec7c9d4bc934c5b13b8df21" dependencies = [ - "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rmp 0.8.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder", + "rmp", + "serde", ] [[package]] name = "rustc-demangle" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" [[package]] name = "rustc_version" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "semver", ] [[package]] name = "ryu" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" [[package]] name = "semver" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "semver-parser", ] [[package]] name = "semver-parser" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" dependencies = [ - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive", ] [[package]] name = "serde_cbor" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" dependencies = [ - "half 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "half", + "serde", ] [[package]] name = "serde_derive" version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "serde_json" version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" dependencies = [ - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa", + "ryu", + "serde", ] [[package]] name = "serde_yaml" version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" dependencies = [ - "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "dtoa", + "linked-hash-map", + "serde", + "yaml-rust", ] [[package]] name = "sha1" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "slab" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "static_assertions" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" [[package]] name = "stdweb" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" dependencies = [ - "discard 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb-derive 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb-internal-macros 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb-internal-runtime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "discard", + "rustc_version", + "serde", + "serde_json", + "stdweb-derive", + "stdweb-internal-macros", + "stdweb-internal-runtime", + "wasm-bindgen", ] [[package]] name = "stdweb-derive" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "syn", ] [[package]] name = "stdweb-internal-macros" version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" dependencies = [ - "base-x 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "base-x", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "serde_json", + "sha1", + "syn", ] [[package]] name = "stdweb-internal-runtime" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" [[package]] name = "syn" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] name = "synstructure" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", + "unicode-xid", ] [[package]] name = "thiserror" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee14bf8e6767ab4c687c9e8bc003879e042a96fd67a3ba5934eadb6536bef4db" dependencies = [ - "thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror-impl", ] [[package]] name = "thiserror-impl" version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7b51e1fbc44b5a0840be594fbc0f960be09050f2617e61e6aa43bef97cd3ef4" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "toml" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", ] [[package]] name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" [[package]] name = "uuid" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" dependencies = [ - "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand", ] [[package]] name = "version_check" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasm-bindgen" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc57ce05287f8376e998cbddfb4c8cb43b84a7ec55cf4551d7c00eef317a47f" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d967d37bf6c16cca2973ca3af071d0a2523392e4a594548155d89a678f4237cd" dependencies = [ - "bumpalo 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "bumpalo", + "lazy_static", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bd151b63e1ea881bb742cd20e1d6127cef28399558f3b5d415289bc41eee3a4" dependencies = [ - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "quote", + "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d68a5b36eef1be7868f668632863292e37739656a80fc4b9acec7b0bd35a4931" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "wasm-bindgen-test" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-test-macro 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "wasm-bindgen-test-macro" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639" [[package]] name = "web-sys" version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" dependencies = [ - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys", + "wasm-bindgen", ] [[package]] name = "wee_alloc" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "memory_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "libc", + "memory_units", + "winapi", ] [[package]] name = "winapi" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" dependencies = [ - "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "yaml-rust" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" dependencies = [ - "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map", ] [[package]] name = "yew" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "anyhow 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)", - "anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-match 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "gloo 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rmp-serde 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", +checksum = "29d4669e99b3ab4473eb8337c4c2f0c5e1ad6230ee704d6460bdf40084480db1" +dependencies = [ + "anyhow", + "anymap", + "bincode", + "cfg-if", + "cfg-match", + "console_error_panic_hook", + "futures", + "gloo", + "http", + "indexmap", + "js-sys", + "log", + "proc-macro-hack", + "proc-macro-nested", + "ryu", + "serde", + "serde_json", + "slab", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", "yew-macro 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "yew" +version = "0.14.2" +source = "git+https://github.com/yewstack/yew.git#b989494cd9aca4dacb81adb1e582b835228508b6" +dependencies = [ + "anyhow", + "anymap", + "bincode", + "cfg-if", + "cfg-match", + "console_error_panic_hook", + "futures", + "gloo", + "http", + "indexmap", + "js-sys", + "log", + "proc-macro-hack", + "proc-macro-nested", + "rmp-serde", + "ryu", + "serde", + "serde_cbor", + "serde_json", + "serde_yaml", + "slab", + "thiserror", + "toml", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "yew-macro 0.14.0 (git+https://github.com/yewstack/yew.git)", +] + +[[package]] +name = "yew-macro" +version = "0.14.0" +source = "git+https://github.com/yewstack/yew.git#b989494cd9aca4dacb81adb1e582b835228508b6" +dependencies = [ + "boolinator", + "lazy_static", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "yew-macro" version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb25d91f16265dd1643497ac3252be6c21c169d9cf3babcae32325c74200499f" dependencies = [ - "boolinator 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "boolinator", + "lazy_static", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "yew-router" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19145953cfaa35cbd26a06ef5f589553d8e16d2a8d889d9c3e74516617ea7db8" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-match 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "gloo 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-router-macro 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-router-route-parser 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if", + "cfg-match", + "gloo", + "js-sys", + "log", + "nom", + "serde", + "serde_json", + "wasm-bindgen", + "web-sys", + "yew 0.14.1", + "yew-router-macro", + "yew-router-route-parser", ] [[package]] name = "yew-router-macro" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2b24468a3ea4ac70f2c46f6ca07a80b2cbb14eb725a16bc74eb5d759fbb3e7" dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-router-route-parser 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2", + "quote", + "syn", + "yew-router-route-parser", ] [[package]] name = "yew-router-route-parser" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6801d6eb8583313fb33f20b141627c51881d24225e8de1660571e971f268d8" dependencies = [ - "nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "nom", ] [[package]] name = "yew_style_page" version = "0.2.0" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "dotenv 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wee_alloc 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-router 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "yew_styles 0.2.1", + "cfg-if", + "console_error_panic_hook", + "dotenv", + "failure", + "serde", + "serde_derive", + "wasm-bindgen", + "web-sys", + "wee_alloc", + "yew 0.14.2", + "yew-router", + "yew_styles", ] [[package]] name = "yew_styles" version = "0.2.1" dependencies = [ - "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-test 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[metadata] -"checksum anyhow 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "768155103fe6b9bf51090758e0657aa34dde4f6618f32ba1c3e45be3b29a0709" -"checksum anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" -"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" -"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" -"checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" -"checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" -"checksum base-x 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" -"checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" -"checksum boolinator 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" -"checksum bumpalo 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb8038c1ddc0a5f73787b130f4cc75151e96ed33e417fde765eb5a81e3532f4" -"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10004c15deb332055f7a4a208190aed362cf9a7c2f6ab70a305fba50e1105f38" -"checksum cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "0213d356d3c4ea2c18c40b037c3be23cd639825c18f25ee670ac7813beeef99c" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -"checksum cfg-match 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8100e46ff92eb85bf6dc2930c73f2a4f7176393c84a9446b3d501e1b354e7b34" -"checksum console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" -"checksum discard 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" -"checksum dotenv 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" -"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" -"checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" -"checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" -"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" -"checksum futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780" -"checksum futures-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" -"checksum futures-core 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" -"checksum futures-executor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba" -"checksum futures-io 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" -"checksum futures-macro 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" -"checksum futures-sink 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" -"checksum futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" -"checksum futures-util 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" -"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" -"checksum gloo 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "68ce6f2dfa9f57f15b848efa2aade5e1850dc72986b87a2b0752d44ca08f4967" -"checksum gloo-console-timer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b48675544b29ac03402c6dffc31a912f716e38d19f7e74b78b7e900ec3c941ea" -"checksum gloo-events 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "088514ec8ef284891c762c88a66b639b3a730134714692ee31829765c5bc814f" -"checksum gloo-file 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f9fecfe46b5dc3cc46f58e98ba580cc714f2c93860796d002eb3527a465ef49" -"checksum gloo-timers 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0b2d17dbd803c2fc86cb1b613adf63192046a7176f383a8302594654752c4c4a" -"checksum half 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ff54597ea139063f4225f1ec47011b03c9de4a486957ff3fc506881dac951d0" -"checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" -"checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" -"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" -"checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" -"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum lexical-core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d7043aa5c05dd34fb73b47acb8c3708eac428de4545ea3682ed2f11293ebd890" -"checksum libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)" = "1a31a0627fdf1f6a39ec0dd577e101440b7db22672c0901fe00a9a6fbb5c24e8" -"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" -"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum memory_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" -"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" -"checksum nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b471253da97532da4b61552249c521e01e736071f71c1a4f7ebbfbf0a06aad6" -"checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32" -"checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" -"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" -"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" -"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" -"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" -"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -"checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -"checksum rmp 0.8.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0f594cb7ff8f1c5a7907f6be91f15795c8301e0d5718eb007fb5832723dd716e" -"checksum rmp-serde 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4a31c0798045f039ace94e0166f76478b3ba83116ec7c9d4bc934c5b13b8df21" -"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" -"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" -"checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" -"checksum serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" -"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" -"checksum serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" -"checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" -"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -"checksum static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" -"checksum stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -"checksum stdweb-derive 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -"checksum stdweb-internal-macros 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -"checksum stdweb-internal-runtime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" -"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" -"checksum synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203" -"checksum thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ee14bf8e6767ab4c687c9e8bc003879e042a96fd67a3ba5934eadb6536bef4db" -"checksum thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "a7b51e1fbc44b5a0840be594fbc0f960be09050f2617e61e6aa43bef97cd3ef4" -"checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" -"checksum uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" -"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" -"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -"checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" -"checksum wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" -"checksum wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" -"checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" -"checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" -"checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" -"checksum wasm-bindgen-test 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "449aeba7035e4a4710cd263bbac33519fa3828bff1c6f642fa8896601e7016ad" -"checksum wasm-bindgen-test-macro 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "49449f8dcedc192bd0cf11b5711982decdd4dbad1029f92370e2b1215031dd59" -"checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" -"checksum wee_alloc 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" -"checksum yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "29d4669e99b3ab4473eb8337c4c2f0c5e1ad6230ee704d6460bdf40084480db1" -"checksum yew-macro 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb25d91f16265dd1643497ac3252be6c21c169d9cf3babcae32325c74200499f" -"checksum yew-router 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "19145953cfaa35cbd26a06ef5f589553d8e16d2a8d889d9c3e74516617ea7db8" -"checksum yew-router-macro 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e2b24468a3ea4ac70f2c46f6ca07a80b2cbb14eb725a16bc74eb5d759fbb3e7" -"checksum yew-router-route-parser 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6801d6eb8583313fb33f20b141627c51881d24225e8de1660571e971f268d8" + "uuid", + "wasm-bindgen", + "web-sys", + "yew 0.14.2", +] diff --git a/crate/Cargo.toml b/crate/Cargo.toml index 323f095..c29085a 100644 --- a/crate/Cargo.toml +++ b/crate/Cargo.toml @@ -20,7 +20,7 @@ serde = "1.0" serde_derive = "1.0" dotenv = "0.15" failure = "0.1" -yew = { version = "0.14", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"]} +yew = { git="https://github.com/yewstack/yew.git", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"]} yew-router = {version = "0.11", features = ["web_sys"] } web-sys = "0.3" yew_styles= {path= "./yew_styles", version = "0.2.0", features = ["web_sys"]} diff --git a/crate/webdriver.json b/crate/webdriver.json deleted file mode 100644 index 3d81202..0000000 --- a/crate/webdriver.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "moz:firefoxOptions": { - "prefs": { - "binary": "/usr/bin/firefox", - "media.navigator.streams.fake": true, - "media.navigator.permission.disabled": true - }, - "log": {"level": "trace"}, - "args": [] - }, - "goog:chromeOptions": { - "args": [ - "--use-fake-device-for-media-stream", - "--use-fake-ui-for-media-stream" - ] - } - } \ No newline at end of file diff --git a/crate/yew_styles/.cargo/config b/crate/yew_styles/.cargo/config new file mode 100644 index 0000000..a20c8ca --- /dev/null +++ b/crate/yew_styles/.cargo/config @@ -0,0 +1,2 @@ +[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'] +runner = 'wasm-bindgen-test-runner' \ No newline at end of file diff --git a/crate/yew_styles/Cargo.lock b/crate/yew_styles/Cargo.lock index 8ec460b..9ba57ca 100644 --- a/crate/yew_styles/Cargo.lock +++ b/crate/yew_styles/Cargo.lock @@ -2,7 +2,7 @@ # It is not intended for manual editing. [[package]] name = "anyhow" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -26,7 +26,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -36,7 +36,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bumpalo" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -65,7 +65,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -131,10 +131,10 @@ name = "futures-macro" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -160,8 +160,8 @@ dependencies = [ "futures-task 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -171,10 +171,10 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -193,7 +193,7 @@ name = "gloo-console-timer" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -201,8 +201,8 @@ name = "gloo-events" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -211,9 +211,9 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gloo-events 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -221,19 +221,19 @@ name = "gloo-timers" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "half" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "http" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -256,10 +256,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "js-sys" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -269,7 +269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.67" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -310,17 +310,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro-hack" -version = "0.5.11" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "proc-macro-nested" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -333,7 +328,7 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -345,7 +340,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -392,7 +387,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "rmp 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -405,7 +400,7 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -428,10 +423,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -439,18 +434,18 @@ name = "serde_cbor" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "half 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "half 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -459,8 +454,8 @@ version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -470,7 +465,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -491,12 +486,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "discard 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "stdweb-derive 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "stdweb-internal-macros 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", "stdweb-internal-runtime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -505,10 +500,10 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -518,12 +513,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base-x 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -533,30 +528,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "thiserror" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror-impl 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "thiserror-impl" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -564,7 +559,7 @@ name = "toml" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -587,93 +582,93 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-bindgen" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bumpalo 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.59" +version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-bindgen-test" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-test-macro 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test-macro 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "web-sys" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -686,10 +681,10 @@ dependencies = [ [[package]] name = "yew" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" +version = "0.14.2" +source = "git+https://github.com/yewstack/yew.git#b989494cd9aca4dacb81adb1e582b835228508b6" dependencies = [ - "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -697,39 +692,39 @@ dependencies = [ "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "gloo 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "rmp-serde 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", - "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)", "serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-macro 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", + "yew-macro 0.14.0 (git+https://github.com/yewstack/yew.git)", ] [[package]] name = "yew-macro" version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" +source = "git+https://github.com/yewstack/yew.git#b989494cd9aca4dacb81adb1e582b835228508b6" dependencies = [ "boolinator 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -738,20 +733,20 @@ version = "0.2.1" dependencies = [ "stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-test 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", + "yew 0.14.2 (git+https://github.com/yewstack/yew.git)", ] [metadata] -"checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" +"checksum anyhow 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "013a6e0a2cbe3d20f9c60b65458f7a7f7a5e636c5d0f45a5a6aee5d4b1f01785" "checksum anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum base-x 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" "checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" "checksum boolinator 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" -"checksum bumpalo 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f359dc14ff8911330a51ef78022d376f25ed00248912803b58f00cb1c27f742" +"checksum bumpalo 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187" "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" "checksum bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" @@ -775,23 +770,23 @@ dependencies = [ "checksum gloo-events 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "088514ec8ef284891c762c88a66b639b3a730134714692ee31829765c5bc814f" "checksum gloo-file 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f9fecfe46b5dc3cc46f58e98ba580cc714f2c93860796d002eb3527a465ef49" "checksum gloo-timers 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" -"checksum half 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20d6a47d6e4b8559729f58287efa8e6f767e603c068fea7a5e4d9f1cebe2bebb" -"checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" +"checksum half 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f36b5f248235f45773d4944f555f83ea61fe07b18b561ccf99d7483d7381e54d" +"checksum http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" "checksum indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" "checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" -"checksum js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1cb931d43e71f560c81badb0191596562bafad2be06a3f9025b845c847c60df5" +"checksum js-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)" = "6a27d435371a2fa5b6d2b028a74bbdb1234f308da363226a2854ca3ff8ba7055" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" +"checksum libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" "checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" "checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" -"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" -"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" +"checksum proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfdefadc3d57ca21cf17990a28ef4c0f7c61383a28cb7604cf4a18e6ede1420" +"checksum proc-macro-nested 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8e946095f9d3ed29ec38de908c22f95d9ac008e424c7bcae54c75a79c527c694" "checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" -"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" "checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" "checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" @@ -799,13 +794,13 @@ dependencies = [ "checksum rmp 0.8.9 (registry+https://github.com/rust-lang/crates.io-index)" = "0f10b46df14cf1ee1ac7baa4d2fbc2c52c0622a4b82fa8740e37bc452ac0184f" "checksum rmp-serde 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4c1ee98f14fe8b8e9c5ea13d25da7b2a1796169202c57a09d7288de90d56222b" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +"checksum ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535622e6be132bccd223f4bb2b8ac8d53cda3c7a6394944d3b2b33fb974f9d76" "checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "e707fbbf255b8fc8c3b99abb91e7257a622caeb20a9818cbadbeeede4e0932ff" "checksum serde_cbor 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e18acfa2f90e8b735b2836ab8d538de304cbb6729a7360729ea5a895d15a622" -"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +"checksum serde_derive 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)" = "ac5d00fc561ba2724df6758a17de23df5914f20e41cb00f94d5b7ae42fffaff8" "checksum serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" "checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" @@ -814,22 +809,22 @@ dependencies = [ "checksum stdweb-derive 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" "checksum stdweb-internal-macros 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" "checksum stdweb-internal-runtime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" -"checksum syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" -"checksum thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ee14bf8e6767ab4c687c9e8bc003879e042a96fd67a3ba5934eadb6536bef4db" -"checksum thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "a7b51e1fbc44b5a0840be594fbc0f960be09050f2617e61e6aa43bef97cd3ef4" +"checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" +"checksum thiserror 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e3711fd1c4e75b3eff12ba5c40dba762b6b65c5476e8174c1a664772060c49bf" +"checksum thiserror-impl 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "ae2b85ba4c9aa32dd3343bd80eb8d22e9b54b7688c17ea3907f236885353b233" "checksum toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" "checksum uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -"checksum wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "3557c397ab5a8e347d434782bcd31fc1483d927a6826804cec05cc792ee2519d" -"checksum wasm-bindgen-backend 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "e0da9c9a19850d3af6df1cb9574970b566d617ecfaf36eb0b706b6f3ef9bd2f8" -"checksum wasm-bindgen-futures 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "457414a91863c0ec00090dba537f88ab955d93ca6555862c29b6d860990b8a8a" -"checksum wasm-bindgen-macro 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "0f6fde1d36e75a714b5fe0cffbb78978f222ea6baebb726af13c78869fdb4205" -"checksum wasm-bindgen-macro-support 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "25bda4168030a6412ea8a047e27238cadf56f0e53516e1e83fec0a8b7c786f6d" -"checksum wasm-bindgen-shared 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)" = "fc9f36ad51f25b0219a3d4d13b90eb44cd075dff8b6280cca015775d7acaddd8" -"checksum wasm-bindgen-test 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "449aeba7035e4a4710cd263bbac33519fa3828bff1c6f642fa8896601e7016ad" -"checksum wasm-bindgen-test-macro 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "49449f8dcedc192bd0cf11b5711982decdd4dbad1029f92370e2b1215031dd59" -"checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" +"checksum wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "2cc57ce05287f8376e998cbddfb4c8cb43b84a7ec55cf4551d7c00eef317a47f" +"checksum wasm-bindgen-backend 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d967d37bf6c16cca2973ca3af071d0a2523392e4a594548155d89a678f4237cd" +"checksum wasm-bindgen-futures 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "7add542ea1ac7fdaa9dc25e031a6af33b7d63376292bd24140c637d00d1c312a" +"checksum wasm-bindgen-macro 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "8bd151b63e1ea881bb742cd20e1d6127cef28399558f3b5d415289bc41eee3a4" +"checksum wasm-bindgen-macro-support 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d68a5b36eef1be7868f668632863292e37739656a80fc4b9acec7b0bd35a4931" +"checksum wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639" +"checksum wasm-bindgen-test 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)" = "648da3460c6d2aa04b715a936329e2e311180efe650b2127d6267f4193ccac14" +"checksum wasm-bindgen-test-macro 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)" = "cf2f86cd78a2aa7b1fb4bb6ed854eccb7f9263089c79542dca1576a1518a8467" +"checksum web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6f51648d8c56c366144378a33290049eafdd784071077f6fe37dae64c1c4cb" "checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" -"checksum yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "29d4669e99b3ab4473eb8337c4c2f0c5e1ad6230ee704d6460bdf40084480db1" -"checksum yew-macro 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb25d91f16265dd1643497ac3252be6c21c169d9cf3babcae32325c74200499f" +"checksum yew 0.14.2 (git+https://github.com/yewstack/yew.git)" = "" +"checksum yew-macro 0.14.0 (git+https://github.com/yewstack/yew.git)" = "" diff --git a/crate/yew_styles/Cargo.toml b/crate/yew_styles/Cargo.toml index 4cb238b..9fbc23f 100644 --- a/crate/yew_styles/Cargo.toml +++ b/crate/yew_styles/Cargo.toml @@ -2,21 +2,26 @@ name = "yew_styles" version = "0.2.1" description = "Framework styles for yew" -authors = ["spieljs "] +authors = ["Francisco Jesus Navarro Cortes "] edition = "2018" license = "MIT" repository = "https://github.com/spielrs/yew-styles-page/tree/master/crate/yew_styles" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[lib] +crate-type = ["cdylib", "rlib"] + [features] std_web = ["stdweb", "yew/std_web"] web_sys = ["web-sys", "yew/web_sys"] [dependencies] -wasm-bindgen = "0.2.59" -wasm-bindgen-test = "0.3" -yew = { version = "0.14", features = ["toml", "yaml", "msgpack", "cbor"], optional = true} +wasm-bindgen = "0.2.60" +yew = { git="https://github.com/yewstack/yew.git", features = ["toml", "yaml", "msgpack", "cbor"], optional = true } stdweb = { version = "0.4", optional = true} web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"], optional=true} uuid = {version= "0.8", features=["v4", "wasm-bindgen", "stdweb"]} + +[dev-dependencies] +wasm-bindgen-test = "0.3" diff --git a/crate/yew_styles/src/components/button.rs b/crate/yew_styles/src/components/button.rs index 3746832..0d7499a 100644 --- a/crate/yew_styles/src/components/button.rs +++ b/crate/yew_styles/src/components/button.rs @@ -1,9 +1,6 @@ use crate::styles::{get_pallete, get_style, Palette, Style}; -use wasm_bindgen_test::{wasm_bindgen_test, wasm_bindgen_test_configure}; use yew::prelude::*; -wasm_bindgen_test_configure!(run_in_browser); - #[derive(Clone)] pub enum ButtonType { Primary, @@ -123,61 +120,3 @@ impl Component for Button { } } } - -#[cfg(feature = "web_sys")] -#[wasm_bindgen_test] -fn should_trigger_action_when_button_clicked() { - use web_sys::window; - - let body = window().unwrap().document().unwrap().body().unwrap(); - - let element = window() - .unwrap() - .document() - .unwrap() - .create_element("div") - .unwrap(); - element.set_text_content(Some("home")); - element.set_id("menu"); - - body.append_child(&element).unwrap(); - - let onchange_name = Callback::from(|_| { - let content = window() - .unwrap() - .document() - .unwrap() - .get_element_by_id("menu") - .unwrap(); - - content.set_text_content(Some("about")); - }); - - let props = Props { - class_name: String::from("test-button"), - size: Size::Medium, - button_style: Style::Regular, - onsignal: onchange_name, - button_type: Palette::Standard, - children: Children::new(vec![html! {}]), - }; - - let link = ComponentLink::new(); - - let mut button = Button::create(props.clone(), link); - - props.onsignal.emit(()); - - button.change(props); - - let updated_content = window() - .unwrap() - .document() - .unwrap() - .get_element_by_id("menu") - .unwrap() - .text_content() - .unwrap(); - - assert_eq!(updated_content, String::from("about")); -} diff --git a/crate/yew_styles/src/components/container.rs b/crate/yew_styles/src/components/container.rs index 26b8847..7522cce 100644 --- a/crate/yew_styles/src/components/container.rs +++ b/crate/yew_styles/src/components/container.rs @@ -144,16 +144,16 @@ impl ContainerModel { fn get_flow(self, direction: Direction, wrap: Wrap, index: i16, name: String) { let direction = match direction { - Direction::Row => format!("row"), - Direction::RowReverse => format!("row-reverse"), - Direction::Column => format!("column"), - Direction::ColumnReverse => format!("column-reverse"), + Direction::Row => "row".to_string(), + Direction::RowReverse => "row-reverse".to_string(), + Direction::Column => "column".to_string(), + Direction::ColumnReverse => "column-reverse".to_string(), }; let wrap = match wrap { - Wrap::Nowrap => format!("nowrap"), - Wrap::Wrap => format!("wrap"), - Wrap::WrapReverse => format!("wrap-reverse"), + Wrap::Nowrap => "nowrap".to_string(), + Wrap::Wrap => "wrap".to_string(), + Wrap::WrapReverse => "wrap-reverse".to_string(), }; let value = format!("{} {}", direction, wrap); @@ -171,9 +171,9 @@ impl ContainerModel { fn get_mode(self, mode: Mode) -> String { match mode { - Mode::NoMode => format!(""), - Mode::SafeMode => format!(" safe"), - Mode::UnsafeMode => format!(" unsafe"), + Mode::NoMode => "".to_string(), + Mode::SafeMode => " safe".to_string(), + Mode::UnsafeMode => " unsafe".to_string(), } } diff --git a/crate/yew_styles/src/components/item.rs b/crate/yew_styles/src/components/item.rs index d4f9f01..aa5b0ca 100644 --- a/crate/yew_styles/src/components/item.rs +++ b/crate/yew_styles/src/components/item.rs @@ -1,4 +1,3 @@ -#[cfg(any(feature = "web_sys", feature = "std_web"))] use crate::utils::create_style; use yew::prelude::*; @@ -143,15 +142,14 @@ impl ItemModel { fn get_item_align(self, align: AlignSelf, index: i16, name: String) { let value = match align { - AlignSelf::Auto => format!("auto"), - AlignSelf::Baseline => format!("baseline"), - AlignSelf::Center => format!("center"), - AlignSelf::FlexStart => format!("flex-start"), - AlignSelf::FlexEnd => format!("flex-end"), - AlignSelf::Stretch => format!("stretch"), + AlignSelf::Auto => "auto".to_string(), + AlignSelf::Baseline => "baseline".to_string(), + AlignSelf::Center => "center".to_string(), + AlignSelf::FlexStart => "flex-start".to_string(), + AlignSelf::FlexEnd => "flex-end".to_string(), + AlignSelf::Stretch => "stretch".to_string(), }; - #[cfg(any(feature = "web_sys", feature = "std_web"))] create_style( String::from("align-self"), value, diff --git a/crate/yew_styles/src/components/navbar/mod.rs b/crate/yew_styles/src/components/navbar/mod.rs index 46d9ec9..d840a2d 100644 --- a/crate/yew_styles/src/components/navbar/mod.rs +++ b/crate/yew_styles/src/components/navbar/mod.rs @@ -1,7 +1,7 @@ -pub mod navbar; +pub mod navbar_component; pub mod navbar_container; pub mod navbar_item; -pub use navbar::{Fixed, Navbar}; +pub use navbar_component::{Fixed, Navbar}; pub use navbar_container::NavbarContainer; pub use navbar_item::NavbarItem; diff --git a/crate/yew_styles/src/components/navbar/navbar.rs b/crate/yew_styles/src/components/navbar/navbar_component.rs similarity index 100% rename from crate/yew_styles/src/components/navbar/navbar.rs rename to crate/yew_styles/src/components/navbar/navbar_component.rs diff --git a/crate/yew_styles/src/components/navbar/navbar_container.rs b/crate/yew_styles/src/components/navbar/navbar_container.rs index a220a43..0b01afa 100644 --- a/crate/yew_styles/src/components/navbar/navbar_container.rs +++ b/crate/yew_styles/src/components/navbar/navbar_container.rs @@ -27,7 +27,7 @@ impl Component for NavbarContainer { type Properties = Props; fn create(props: Self::Properties, _link: ComponentLink) -> Self { - NavbarContainer { props: props } + NavbarContainer { props } } fn update(&mut self, _msg: Self::Message) -> ShouldRender { diff --git a/crate/yew_styles/src/lib.rs b/crate/yew_styles/src/lib.rs index cf97ba4..8a84385 100644 --- a/crate/yew_styles/src/lib.rs +++ b/crate/yew_styles/src/lib.rs @@ -1,6 +1,4 @@ #![recursion_limit = "512"] -extern crate wasm_bindgen_test; - pub mod assets; mod components; pub mod styles; diff --git a/crate/yew_styles/tests/button.rs b/crate/yew_styles/tests/button.rs new file mode 100644 index 0000000..1f9099d --- /dev/null +++ b/crate/yew_styles/tests/button.rs @@ -0,0 +1,119 @@ +#![cfg(target_arch = "wasm32")] +extern crate wasm_bindgen_test; +extern crate yew_styles; + +use wasm_bindgen_test::*; +use web_sys::window; +use yew::prelude::*; +use yew_styles::{ + button::{Button, Msg, Props, Size}, + styles::{Palette, Style}, +}; + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn should_trigger_action_when_button_clicked() { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + element.set_text_content(Some("home")); + element.set_id("menu"); + + body.append_child(&element).unwrap(); + + let onchange_name = Callback::from(|_| { + let content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("menu") + .unwrap(); + + content.set_text_content(Some("about")); + }); + + let props = Props { + class_name: String::from("test-button"), + size: Size::Medium, + button_style: Style::Regular, + onsignal: onchange_name, + button_type: Palette::Standard, + children: Children::new(vec![html! {}]), + }; + + let link = ComponentLink::new(); + + let mut button = Button::create(props.clone(), link); + + props.onsignal.emit(()); + + button.change(props); + + let updated_content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("menu") + .unwrap() + .text_content() + .unwrap(); + + assert_eq!(updated_content, String::from("about")); +} + +#[wasm_bindgen_test] +fn should_create_button_component() { + use web_sys::window; + + let on_add_child = Callback::from(|_| { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let child_element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + + child_element.set_text_content(Some("child")); + child_element.set_id("child"); + body.append_child(&child_element).unwrap(); + }); + + let props = Props { + class_name: String::from("test-button"), + size: Size::Medium, + button_style: Style::Regular, + onsignal: on_add_child.clone(), + button_type: Palette::Standard, + children: Children::new(vec![html! {
{"parent"}
}]), + }; + + let link = ComponentLink::new(); + + let mut button = Button::create(props.clone(), link.clone()); + + props.onsignal.emit(()); + + button.change(props); + + let button_vnode = button.render(); + + let vnode_expected = html! { + + }; + + assert_eq!(button_vnode, vnode_expected); +} From 366ea1ac4de0d08d769d0c172e3e7396d4d3f950 Mon Sep 17 00:00:00 2001 From: spieljs Date: Mon, 30 Mar 2020 00:03:53 +0200 Subject: [PATCH 04/16] add test for layouts --- crate/yew_styles/tests/button.rs | 4 --- crate/yew_styles/tests/layouts.rs | 44 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 crate/yew_styles/tests/layouts.rs diff --git a/crate/yew_styles/tests/button.rs b/crate/yew_styles/tests/button.rs index 1f9099d..0efd4ba 100644 --- a/crate/yew_styles/tests/button.rs +++ b/crate/yew_styles/tests/button.rs @@ -1,7 +1,3 @@ -#![cfg(target_arch = "wasm32")] -extern crate wasm_bindgen_test; -extern crate yew_styles; - use wasm_bindgen_test::*; use web_sys::window; use yew::prelude::*; diff --git a/crate/yew_styles/tests/layouts.rs b/crate/yew_styles/tests/layouts.rs new file mode 100644 index 0000000..072c2de --- /dev/null +++ b/crate/yew_styles/tests/layouts.rs @@ -0,0 +1,44 @@ +use wasm_bindgen_test::*; +use yew::prelude::*; +use yew_styles::{ + container::{ + AlignContent, AlignItems, Container, Direction, JustifyContent, Mode, + Props as PropsContainer, Wrap, + }, + item::{AlignSelf, Item, ItemLayout, Props as PropsItem}, +}; + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn should_create_a_container() { + let props_container = PropsContainer { + direction: Direction::Row, + wrap: Wrap::Wrap, + index: 0, + justify_content: JustifyContent::Center(Mode::NoMode), + align_content: AlignContent::Center(Mode::NoMode), + align_items: AlignItems::Center(Mode::NoMode), + class_name: String::from("layout-test"), + name: String::from("layout-test"), + children: Children::new(vec![html! { +
{"Container"}
+ }]), + }; + + let link = ComponentLink::new(); + + let layout = Container::create(props_container, link.clone()); + + let layout_vnode = layout.render(); + + let vnode_expected = html! { +
+ <> +
{"Container"}
+ +
+ }; + + assert_eq!(layout_vnode, vnode_expected); +} From a0be25b25437b7d7eedbe8598dbbfef0b741bd97 Mon Sep 17 00:00:00 2001 From: spieljs Date: Wed, 1 Apr 2020 01:19:19 +0200 Subject: [PATCH 05/16] implement test for layouts --- crate/yew_styles/tests/button.rs | 2 - crate/yew_styles/tests/layouts.rs | 83 +++++++++++++++++++++++++++++-- 2 files changed, 80 insertions(+), 5 deletions(-) diff --git a/crate/yew_styles/tests/button.rs b/crate/yew_styles/tests/button.rs index 0efd4ba..1643ab6 100644 --- a/crate/yew_styles/tests/button.rs +++ b/crate/yew_styles/tests/button.rs @@ -65,8 +65,6 @@ fn should_trigger_action_when_button_clicked() { #[wasm_bindgen_test] fn should_create_button_component() { - use web_sys::window; - let on_add_child = Callback::from(|_| { let body = window().unwrap().document().unwrap().body().unwrap(); diff --git a/crate/yew_styles/tests/layouts.rs b/crate/yew_styles/tests/layouts.rs index 072c2de..d699dea 100644 --- a/crate/yew_styles/tests/layouts.rs +++ b/crate/yew_styles/tests/layouts.rs @@ -1,4 +1,5 @@ use wasm_bindgen_test::*; +use web_sys::window; use yew::prelude::*; use yew_styles::{ container::{ @@ -28,9 +29,9 @@ fn should_create_a_container() { let link = ComponentLink::new(); - let layout = Container::create(props_container, link.clone()); + let container = Container::create(props_container, link.clone()); - let layout_vnode = layout.render(); + let container_vnode = container.render(); let vnode_expected = html! {
@@ -40,5 +41,81 @@ fn should_create_a_container() {
}; - assert_eq!(layout_vnode, vnode_expected); + assert_eq!(container_vnode, vnode_expected); +} + +#[wasm_bindgen_test] +fn should_create_item() { + let props_item = PropsItem { + layouts: vec![ItemLayout::ItXs(12)], + align_self: AlignSelf::Center, + name: "item-test".to_string(), + class_name: "item-test".to_string(), + index: 0, + onsignal: Callback::noop(), + children: Children::new(vec![html! { +
{"Item"}
+ }]), + }; + + let link = ComponentLink::new(); + + let item = Item::create(props_item, link.clone()); + + let item_vnode = item.render(); + + let vnode_expected = html! { +
+ <> +
{"Item"}
+ +
+ }; + + assert_eq!(item_vnode, vnode_expected); +} + +#[wasm_bindgen_test] +fn should_create_clickable_item() { + let on_add_item_div = Callback::from(|_| { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let child_element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + + child_element.set_text_content(Some("item2")); + child_element.set_id("item2"); + body.append_child(&child_element).unwrap(); + }); + + let props_item = PropsItem { + layouts: vec![ItemLayout::ItXs(12)], + align_self: AlignSelf::Center, + name: "item-test".to_string(), + class_name: "item-test".to_string(), + index: 0, + onsignal: on_add_item_div, + children: Children::new(vec![html! { +
{"Item"}
+ }]), + }; + + props_item.onsignal.emit(()); + + let updated_content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("item2") + .unwrap() + .text_content() + .unwrap(); + + assert_eq!(updated_content, "item2".to_string()); } From 3af5af60a6b993cdd77d35f6e28f8e8c6b87a49b Mon Sep 17 00:00:00 2001 From: spieljs Date: Sun, 5 Apr 2020 17:45:29 +0200 Subject: [PATCH 06/16] implment tests --- crate/Cargo.lock | 59 ++------------- crate/Cargo.toml | 2 +- crate/src/app.rs | 2 +- crate/src/page/button_page.rs | 2 +- crate/src/page/layouts_page.rs | 2 +- crate/src/page/navbar_page.rs | 12 ++- crate/yew_styles/Cargo.lock | 16 ++-- crate/yew_styles/Cargo.toml | 2 +- .../src/components/{ => layouts}/container.rs | 0 .../src/components/{ => layouts}/item.rs | 0 .../yew_styles/src/components/layouts/mod.rs | 2 + crate/yew_styles/src/components/mod.rs | 3 +- crate/yew_styles/src/components/navbar/mod.rs | 4 - .../src/components/navbar/navbar_component.rs | 2 +- .../src/components/navbar/navbar_container.rs | 2 +- .../src/components/navbar/navbar_item.rs | 2 - crate/yew_styles/src/lib.rs | 2 +- crate/yew_styles/tests/layouts.rs | 2 +- crate/yew_styles/tests/navbar.rs | 74 +++++++++++++++++++ crate/yew_styles/tests/utils.rs | 42 +++++++++++ 20 files changed, 152 insertions(+), 80 deletions(-) rename crate/yew_styles/src/components/{ => layouts}/container.rs (100%) rename crate/yew_styles/src/components/{ => layouts}/item.rs (100%) create mode 100644 crate/yew_styles/src/components/layouts/mod.rs create mode 100644 crate/yew_styles/tests/navbar.rs create mode 100644 crate/yew_styles/tests/utils.rs diff --git a/crate/Cargo.lock b/crate/Cargo.lock index 54a0677..f1509b7 100644 --- a/crate/Cargo.lock +++ b/crate/Cargo.lock @@ -907,39 +907,9 @@ dependencies = [ [[package]] name = "yew" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d4669e99b3ab4473eb8337c4c2f0c5e1ad6230ee704d6460bdf40084480db1" -dependencies = [ - "anyhow", - "anymap", - "bincode", - "cfg-if", - "cfg-match", - "console_error_panic_hook", - "futures", - "gloo", - "http", - "indexmap", - "js-sys", - "log", - "proc-macro-hack", - "proc-macro-nested", - "ryu", - "serde", - "serde_json", - "slab", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "yew-macro 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "yew" -version = "0.14.2" -source = "git+https://github.com/yewstack/yew.git#b989494cd9aca4dacb81adb1e582b835228508b6" +checksum = "2e48bc6b264e30362e5d420cd6aa2cd24dd4c9131284bc24afc0a41c28c125f3" dependencies = [ "anyhow", "anymap", @@ -967,27 +937,14 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "yew-macro 0.14.0 (git+https://github.com/yewstack/yew.git)", + "yew-macro", ] [[package]] name = "yew-macro" -version = "0.14.0" -source = "git+https://github.com/yewstack/yew.git#b989494cd9aca4dacb81adb1e582b835228508b6" -dependencies = [ - "boolinator", - "lazy_static", - "proc-macro-hack", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "yew-macro" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb25d91f16265dd1643497ac3252be6c21c169d9cf3babcae32325c74200499f" +checksum = "074c652331c32cf6431b0c5c4b6cb6fbb2168a1be6022e51b32c95fefb70153c" dependencies = [ "boolinator", "lazy_static", @@ -1013,7 +970,7 @@ dependencies = [ "serde_json", "wasm-bindgen", "web-sys", - "yew 0.14.1", + "yew", "yew-router-macro", "yew-router-route-parser", ] @@ -1052,7 +1009,7 @@ dependencies = [ "wasm-bindgen", "web-sys", "wee_alloc", - "yew 0.14.2", + "yew", "yew-router", "yew_styles", ] @@ -1064,5 +1021,5 @@ dependencies = [ "uuid", "wasm-bindgen", "web-sys", - "yew 0.14.2", + "yew", ] diff --git a/crate/Cargo.toml b/crate/Cargo.toml index c29085a..fad9963 100644 --- a/crate/Cargo.toml +++ b/crate/Cargo.toml @@ -20,7 +20,7 @@ serde = "1.0" serde_derive = "1.0" dotenv = "0.15" failure = "0.1" -yew = { git="https://github.com/yewstack/yew.git", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"]} +yew = { version="0.14.2", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"]} yew-router = {version = "0.11", features = ["web_sys"] } web-sys = "0.3" yew_styles= {path= "./yew_styles", version = "0.2.0", features = ["web_sys"]} diff --git a/crate/src/app.rs b/crate/src/app.rs index 1c46465..6620410 100644 --- a/crate/src/app.rs +++ b/crate/src/app.rs @@ -1,7 +1,7 @@ use page::{ButtonPage, LayoutsPage, NavbarPage}; use yew::prelude::*; use yew_router::{prelude::*, route::Route, switch::Permissive, Switch}; -use yew_styles::{ +use yew_styles::layouts::{ container::{AlignItems, Container, Direction, Mode, Wrap}, item::{Item, ItemLayout}, }; diff --git a/crate/src/page/button_page.rs b/crate/src/page/button_page.rs index 7b948c2..5c0a77f 100644 --- a/crate/src/page/button_page.rs +++ b/crate/src/page/button_page.rs @@ -122,7 +122,7 @@ fn get_buttons(size: Size, button_style: Style, link: ComponentLink) >{to_first_upercase(&get_pallete(button_types_enum[index].clone()))} }; - index = index + 1; + index += 1; button }).collect::() } diff --git a/crate/src/page/layouts_page.rs b/crate/src/page/layouts_page.rs index cd9aa83..837a26d 100644 --- a/crate/src/page/layouts_page.rs +++ b/crate/src/page/layouts_page.rs @@ -1,5 +1,5 @@ use yew::prelude::*; -use yew_styles::{ +use yew_styles::layouts::{ container::{AlignContent, AlignItems, Container, Direction, JustifyContent, Mode, Wrap}, item::{AlignSelf, Item, ItemLayout}, }; diff --git a/crate/src/page/navbar_page.rs b/crate/src/page/navbar_page.rs index 7c34f08..484edfc 100644 --- a/crate/src/page/navbar_page.rs +++ b/crate/src/page/navbar_page.rs @@ -1,7 +1,11 @@ use yew::prelude::*; use yew_styles::{ - container::{JustifyContent, Mode}, - navbar::{Fixed, Navbar, NavbarContainer, NavbarItem}, + layouts::container::{JustifyContent, Mode}, + navbar::{ + navbar_component::{Fixed, Navbar}, + navbar_container::NavbarContainer, + navbar_item::NavbarItem, + }, styles::{Palette, Style}, }; @@ -83,7 +87,7 @@ fn get_style(link: ComponentLink, navbar_menu: Vec) -> Html styles .into_iter() .map(|style| { - let navbar = get_navbar_type(link.clone(), style.clone(), navbar_menu.clone(), index); + let navbar = get_navbar_type(link.clone(), style, navbar_menu.clone(), index); index = navbar.index + 1; @@ -154,7 +158,7 @@ fn get_navbar_type( }; - navbar_type_rendered = navbar_type_rendered + 1; + navbar_type_rendered += 1; element }) diff --git a/crate/yew_styles/Cargo.lock b/crate/yew_styles/Cargo.lock index 9ba57ca..b752bed 100644 --- a/crate/yew_styles/Cargo.lock +++ b/crate/yew_styles/Cargo.lock @@ -681,8 +681,8 @@ dependencies = [ [[package]] name = "yew" -version = "0.14.2" -source = "git+https://github.com/yewstack/yew.git#b989494cd9aca4dacb81adb1e582b835228508b6" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "anyhow 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -711,13 +711,13 @@ dependencies = [ "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-futures 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-macro 0.14.0 (git+https://github.com/yewstack/yew.git)", + "yew-macro 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "yew-macro" -version = "0.14.0" -source = "git+https://github.com/yewstack/yew.git#b989494cd9aca4dacb81adb1e582b835228508b6" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "boolinator 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -736,7 +736,7 @@ dependencies = [ "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-test 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.2 (git+https://github.com/yewstack/yew.git)", + "yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] @@ -826,5 +826,5 @@ dependencies = [ "checksum wasm-bindgen-test-macro 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)" = "cf2f86cd78a2aa7b1fb4bb6ed854eccb7f9263089c79542dca1576a1518a8467" "checksum web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6f51648d8c56c366144378a33290049eafdd784071077f6fe37dae64c1c4cb" "checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" -"checksum yew 0.14.2 (git+https://github.com/yewstack/yew.git)" = "" -"checksum yew-macro 0.14.0 (git+https://github.com/yewstack/yew.git)" = "" +"checksum yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e48bc6b264e30362e5d420cd6aa2cd24dd4c9131284bc24afc0a41c28c125f3" +"checksum yew-macro 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "074c652331c32cf6431b0c5c4b6cb6fbb2168a1be6022e51b32c95fefb70153c" diff --git a/crate/yew_styles/Cargo.toml b/crate/yew_styles/Cargo.toml index 9fbc23f..78b0b25 100644 --- a/crate/yew_styles/Cargo.toml +++ b/crate/yew_styles/Cargo.toml @@ -18,7 +18,7 @@ web_sys = ["web-sys", "yew/web_sys"] [dependencies] wasm-bindgen = "0.2.60" -yew = { git="https://github.com/yewstack/yew.git", features = ["toml", "yaml", "msgpack", "cbor"], optional = true } +yew = { version="0.14.2", features = ["toml", "yaml", "msgpack", "cbor"], optional = true } stdweb = { version = "0.4", optional = true} web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"], optional=true} uuid = {version= "0.8", features=["v4", "wasm-bindgen", "stdweb"]} diff --git a/crate/yew_styles/src/components/container.rs b/crate/yew_styles/src/components/layouts/container.rs similarity index 100% rename from crate/yew_styles/src/components/container.rs rename to crate/yew_styles/src/components/layouts/container.rs diff --git a/crate/yew_styles/src/components/item.rs b/crate/yew_styles/src/components/layouts/item.rs similarity index 100% rename from crate/yew_styles/src/components/item.rs rename to crate/yew_styles/src/components/layouts/item.rs diff --git a/crate/yew_styles/src/components/layouts/mod.rs b/crate/yew_styles/src/components/layouts/mod.rs new file mode 100644 index 0000000..d8b2350 --- /dev/null +++ b/crate/yew_styles/src/components/layouts/mod.rs @@ -0,0 +1,2 @@ +pub mod container; +pub mod item; diff --git a/crate/yew_styles/src/components/mod.rs b/crate/yew_styles/src/components/mod.rs index d211a41..6aa42eb 100644 --- a/crate/yew_styles/src/components/mod.rs +++ b/crate/yew_styles/src/components/mod.rs @@ -1,5 +1,4 @@ extern crate uuid; pub mod button; -pub mod container; -pub mod item; +pub mod layouts; pub mod navbar; diff --git a/crate/yew_styles/src/components/navbar/mod.rs b/crate/yew_styles/src/components/navbar/mod.rs index d840a2d..eb367d3 100644 --- a/crate/yew_styles/src/components/navbar/mod.rs +++ b/crate/yew_styles/src/components/navbar/mod.rs @@ -1,7 +1,3 @@ pub mod navbar_component; pub mod navbar_container; pub mod navbar_item; - -pub use navbar_component::{Fixed, Navbar}; -pub use navbar_container::NavbarContainer; -pub use navbar_item::NavbarItem; diff --git a/crate/yew_styles/src/components/navbar/navbar_component.rs b/crate/yew_styles/src/components/navbar/navbar_component.rs index a1f4dca..266da3a 100644 --- a/crate/yew_styles/src/components/navbar/navbar_component.rs +++ b/crate/yew_styles/src/components/navbar/navbar_component.rs @@ -1,7 +1,7 @@ use super::navbar_container::NavbarContainer; use super::navbar_item::NavbarItem; use crate::assets::{Assets, Icon}; -use crate::container::{Direction, JustifyContent, Mode}; +use crate::layouts::container::{Direction, JustifyContent, Mode}; use crate::styles::{get_pallete, get_style, Palette, Style}; use crate::utils::create_style; use yew::prelude::*; diff --git a/crate/yew_styles/src/components/navbar/navbar_container.rs b/crate/yew_styles/src/components/navbar/navbar_container.rs index 0b01afa..99a8218 100644 --- a/crate/yew_styles/src/components/navbar/navbar_container.rs +++ b/crate/yew_styles/src/components/navbar/navbar_container.rs @@ -1,4 +1,4 @@ -use crate::container::{Container, Direction, JustifyContent, Mode, Wrap}; +use crate::layouts::container::{Container, Direction, JustifyContent, Mode, Wrap}; use yew::prelude::*; use uuid::Uuid; diff --git a/crate/yew_styles/src/components/navbar/navbar_item.rs b/crate/yew_styles/src/components/navbar/navbar_item.rs index f21a6f5..6e864c9 100644 --- a/crate/yew_styles/src/components/navbar/navbar_item.rs +++ b/crate/yew_styles/src/components/navbar/navbar_item.rs @@ -9,8 +9,6 @@ pub struct NavbarItem { props: Props, } -pub struct NavbarItemModel; - #[derive(Clone, Properties)] pub struct Props { #[prop_or_default] diff --git a/crate/yew_styles/src/lib.rs b/crate/yew_styles/src/lib.rs index 8a84385..be7b77b 100644 --- a/crate/yew_styles/src/lib.rs +++ b/crate/yew_styles/src/lib.rs @@ -4,4 +4,4 @@ mod components; pub mod styles; pub mod utils; -pub use components::{button, container, item, navbar}; +pub use components::{button, layouts, navbar}; diff --git a/crate/yew_styles/tests/layouts.rs b/crate/yew_styles/tests/layouts.rs index d699dea..90cdbd5 100644 --- a/crate/yew_styles/tests/layouts.rs +++ b/crate/yew_styles/tests/layouts.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use web_sys::window; use yew::prelude::*; -use yew_styles::{ +use yew_styles::layouts::{ container::{ AlignContent, AlignItems, Container, Direction, JustifyContent, Mode, Props as PropsContainer, Wrap, diff --git a/crate/yew_styles/tests/navbar.rs b/crate/yew_styles/tests/navbar.rs new file mode 100644 index 0000000..6c839ee --- /dev/null +++ b/crate/yew_styles/tests/navbar.rs @@ -0,0 +1,74 @@ +use wasm_bindgen_test::*; +use web_sys::window; +use yew::prelude::*; +use yew_styles::navbar::navbar_item::{NavbarItem, Props}; + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn should_create_navbar_item() { + let navbar_item_props = Props { + class_name: "navbar-item-test".to_string(), + onsignal: Callback::noop(), + children: Children::new(vec![html! { +
{"Item"}
+ }]), + }; + + let link = ComponentLink::new(); + let navbar_item = NavbarItem::create(navbar_item_props, link.clone()); + let navbar_item_vnode = navbar_item.render(); + + let vnode_expected = html! { + + }; + + assert_eq!(navbar_item_vnode, vnode_expected); +} + +#[wasm_bindgen_test] +fn should_create_clickable_navbar_item() { + let on_add_item_div = Callback::from(|_| { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let child_element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + + child_element.set_text_content(Some("item2")); + child_element.set_id("item2"); + body.append_child(&child_element).unwrap(); + }); + + let navbar_item_props = Props { + class_name: "navbar-item-test".to_string(), + onsignal: on_add_item_div, + children: Children::new(vec![html! { +
{"Item"}
+ }]), + }; + + navbar_item_props.onsignal.emit(()); + + let updated_content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("item2") + .unwrap() + .text_content() + .unwrap(); + + assert_eq!(updated_content, "item2".to_string()); +} diff --git a/crate/yew_styles/tests/utils.rs b/crate/yew_styles/tests/utils.rs new file mode 100644 index 0000000..da5c4d4 --- /dev/null +++ b/crate/yew_styles/tests/utils.rs @@ -0,0 +1,42 @@ +use wasm_bindgen::JsCast; +use wasm_bindgen_test::*; +use web_sys::{window, HtmlElement}; +use yew_styles::utils::create_style; + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn should_set_style_prop() { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + + element.set_text_content(Some("item")); + element.set_class_name("item"); + body.append_child(&element).unwrap(); + + create_style( + "padding".to_string(), + "10px".to_string(), + "item".to_string(), + ); + + let item = window() + .unwrap() + .document() + .unwrap() + .get_elements_by_class_name("item") + .get_with_index(0) + .unwrap() + .dyn_into::() + .unwrap(); + + let value = item.style().get_property_value("padding").unwrap(); + + assert_eq!(value, "10px"); +} From 865c8d02b2241523b0f1a089b119db9a82102a3b Mon Sep 17 00:00:00 2001 From: spieljs Date: Tue, 21 Apr 2020 22:14:32 +0200 Subject: [PATCH 07/16] adding documentation for buttons --- app/index.ts | 3 ++ crate/.cargo/config | 2 ++ crate/Cargo.lock | 12 ++++++++ crate/Cargo.toml | 4 +-- crate/src/lib.rs | 1 + crate/src/page/button_page.rs | 18 ++++++------ crate/src/page/highlighters.rs | 11 +++++++ crate/src/page/mod.rs | 1 + crate/src/page/navbar_page.rs | 4 +-- package-lock.json | 52 ++++++++++++++++++++++++++++++++++ package.json | 4 ++- 11 files changed, 98 insertions(+), 14 deletions(-) create mode 100644 crate/.cargo/config create mode 100644 crate/src/page/highlighters.rs diff --git a/app/index.ts b/app/index.ts index 11b71c6..5cc719b 100644 --- a/app/index.ts +++ b/app/index.ts @@ -1,4 +1,7 @@ import './yew-styles/main.sass'; import './page-styles/main.sass'; +import 'prismjs/themes/prism.css'; +import 'prismjs/components/prism-rust'; + import module from '../crate/Cargo.toml'; module.run(); diff --git a/crate/.cargo/config b/crate/.cargo/config new file mode 100644 index 0000000..91cd80c --- /dev/null +++ b/crate/.cargo/config @@ -0,0 +1,2 @@ +[build] +target="wasm32-unknown-unknown" \ No newline at end of file diff --git a/crate/Cargo.lock b/crate/Cargo.lock index 0956f1c..ffe7113 100644 --- a/crate/Cargo.lock +++ b/crate/Cargo.lock @@ -889,6 +889,16 @@ dependencies = [ "nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "yew_prism" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wasm-bindgen 0.2.59 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "yew_style_page" version = "0.2.0" @@ -904,6 +914,7 @@ dependencies = [ "wee_alloc 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", "yew 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "yew-router 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "yew_prism 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "yew_styles 0.2.1", ] @@ -1025,3 +1036,4 @@ dependencies = [ "checksum yew-router 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "19145953cfaa35cbd26a06ef5f589553d8e16d2a8d889d9c3e74516617ea7db8" "checksum yew-router-macro 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e2b24468a3ea4ac70f2c46f6ca07a80b2cbb14eb725a16bc74eb5d759fbb3e7" "checksum yew-router-route-parser 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6801d6eb8583313fb33f20b141627c51881d24225e8de1660571e971f268d8" +"checksum yew_prism 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd106672abd15d82f60486abaafcde1491c33ee5f3fcd138cb7429edf449850e" diff --git a/crate/Cargo.toml b/crate/Cargo.toml index 323f095..1a111c6 100644 --- a/crate/Cargo.toml +++ b/crate/Cargo.toml @@ -23,7 +23,5 @@ failure = "0.1" yew = { version = "0.14", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"]} yew-router = {version = "0.11", features = ["web_sys"] } web-sys = "0.3" +yew_prism = "0.1" yew_styles= {path= "./yew_styles", version = "0.2.0", features = ["web_sys"]} - -[build] -target="wasm32-unknown-unknown" \ No newline at end of file diff --git a/crate/src/lib.rs b/crate/src/lib.rs index e784b9d..176cb9c 100644 --- a/crate/src/lib.rs +++ b/crate/src/lib.rs @@ -5,6 +5,7 @@ extern crate cfg_if; extern crate wasm_bindgen; extern crate web_sys; extern crate yew; +extern crate yew_prism; extern crate yew_router; extern crate yew_styles; diff --git a/crate/src/page/button_page.rs b/crate/src/page/button_page.rs index 7b948c2..65372fb 100644 --- a/crate/src/page/button_page.rs +++ b/crate/src/page/button_page.rs @@ -113,14 +113,16 @@ fn get_buttons(size: Size, button_style: Style, link: ComponentLink) { button_types.into_iter().map(|button_type| { let button = html! { - + <> + + }; index = index + 1; button diff --git a/crate/src/page/highlighters.rs b/crate/src/page/highlighters.rs new file mode 100644 index 0000000..7e94ad2 --- /dev/null +++ b/crate/src/page/highlighters.rs @@ -0,0 +1,11 @@ +pub fn button_code() -> String { + "" + .to_string() +} diff --git a/crate/src/page/mod.rs b/crate/src/page/mod.rs index e0accc1..5148fc2 100644 --- a/crate/src/page/mod.rs +++ b/crate/src/page/mod.rs @@ -1,4 +1,5 @@ pub mod button_page; +mod highlighters; pub mod layouts_page; pub mod navbar_page; diff --git a/crate/src/page/navbar_page.rs b/crate/src/page/navbar_page.rs index 7c34f08..14a9668 100644 --- a/crate/src/page/navbar_page.rs +++ b/crate/src/page/navbar_page.rs @@ -83,7 +83,7 @@ fn get_style(link: ComponentLink, navbar_menu: Vec) -> Html styles .into_iter() .map(|style| { - let navbar = get_navbar_type(link.clone(), style.clone(), navbar_menu.clone(), index); + let navbar = get_navbar_type(link.clone(), style, navbar_menu.clone(), index); index = navbar.index + 1; @@ -154,7 +154,7 @@ fn get_navbar_type( }; - navbar_type_rendered = navbar_type_rendered + 1; + navbar_type_rendered += 1; element }) diff --git a/package-lock.json b/package-lock.json index 2b0ac29..a2b258f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1669,6 +1669,18 @@ "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==", "dev": true }, + "clipboard": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz", + "integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==", + "dev": true, + "optional": true, + "requires": { + "good-listener": "^1.2.2", + "select": "^1.1.2", + "tiny-emitter": "^2.0.0" + } + }, "clone": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", @@ -2377,6 +2389,13 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, + "delegate": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz", + "integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==", + "dev": true, + "optional": true + }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -3577,6 +3596,16 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, + "good-listener": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", + "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", + "dev": true, + "optional": true, + "requires": { + "delegate": "^3.1.2" + } + }, "graceful-fs": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", @@ -5569,6 +5598,15 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prismjs": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.20.0.tgz", + "integrity": "sha512-AEDjSrVNkynnw6A+B1DsFkd6AVdTnp+/WoUixFRULlCLZVRZlVQMVWio/16jv7G1FscUxQxOQhWwApgbnxr6kQ==", + "dev": true, + "requires": { + "clipboard": "^2.0.0" + } + }, "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", @@ -5973,6 +6011,13 @@ "xmlchars": "^2.1.1" } }, + "select": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", + "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=", + "dev": true, + "optional": true + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -6554,6 +6599,13 @@ "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "dev": true }, + "tiny-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz", + "integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==", + "dev": true, + "optional": true + }, "tiny-inflate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.2.tgz", diff --git a/package.json b/package.json index 8f7e35c..1939a71 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,9 @@ "devDependencies": { "parcel-bundler": "^1.12.4", "parcel-plugin-wasm.rs": "^1.2.15", + "prismjs": "^1.20.0", "sass": "^1.26.3", "typescript": "^3.8.3" - } + }, + "dependencies": {} } From ebefbeb789c0474322d7f0ad7092052271beeb95 Mon Sep 17 00:00:00 2001 From: spieljs Date: Wed, 22 Apr 2020 01:03:07 +0200 Subject: [PATCH 08/16] add docs for Button component --- crate/src/page/button_page.rs | 40 ++++++++++-- crate/src/page/highlighters.rs | 3 +- crate/yew_styles/src/components/button.rs | 80 +++++++++++++++++------ 3 files changed, 95 insertions(+), 28 deletions(-) diff --git a/crate/src/page/button_page.rs b/crate/src/page/button_page.rs index 5d2cc93..688b5e8 100644 --- a/crate/src/page/button_page.rs +++ b/crate/src/page/button_page.rs @@ -1,6 +1,9 @@ +use super::highlighters::button_code; use yew::prelude::*; +use yew_prism::Prism; use yew_styles::{ button::{get_size, Button, Size}, + layouts::item::{Item, ItemLayout}, styles::{get_pallete, get_style, Palette, Style}, }; @@ -38,14 +41,37 @@ impl Component for ButtonPage { fn view(&self) -> Html { html! { -
-
- {get_button_styles(self.link.clone())} -
-
- {self.button_type.clone()} + <> + +

{"Button Component"}

+
+ + +

{"Code example"}

+ +
+ + +

{"Propeties"}

+
    +
  • {"button_type: "}{"type botton style. Options included in "}{"Pallete"}{". Default "}{"Standard"}
  • +
  • {"size: "}{"three diffent button standard sizes. Options included in "}{"Size"}{". Default "}{"Medium"}
  • +
  • {"button_style: "}{"button styles. Options included in "}{"Style"}{". Default "}{"Regular"}
  • +
  • {"onsignal: "}{"click event for button"}
  • +
+
+
+
+ {get_button_styles(self.link.clone())} +
+
+ {self.button_type.clone()} +
-
+ } } } diff --git a/crate/src/page/highlighters.rs b/crate/src/page/highlighters.rs index 7e94ad2..e7051cc 100644 --- a/crate/src/page/highlighters.rs +++ b/crate/src/page/highlighters.rs @@ -5,7 +5,6 @@ pub fn button_code() -> String { button_type=Pallete::Standard button_style=Style::Light size=Size::Medium ->{{to_first_upercase(&get_pallete(button_types_enum[index].clone()))}} -" +>{\"Greeting\"}" .to_string() } diff --git a/crate/yew_styles/src/components/button.rs b/crate/yew_styles/src/components/button.rs index 0d7499a..23696cf 100644 --- a/crate/yew_styles/src/components/button.rs +++ b/crate/yew_styles/src/components/button.rs @@ -1,25 +1,7 @@ use crate::styles::{get_pallete, get_style, Palette, Style}; use yew::prelude::*; -#[derive(Clone)] -pub enum ButtonType { - Primary, - Secondary, - Success, - Info, - Link, - Warning, - Danger, - Standard, -} - -#[derive(Clone)] -pub enum ButtonStyle { - Regular, - Light, - Outline, -} - +/// The standard sizes for button #[derive(Clone)] pub enum Size { Small, @@ -27,6 +9,61 @@ pub enum Size { Big, } +/// # Button component +/// +/// ## Example +/// +/// ```rust +/// use yew::prelude::*; +/// use yew::services::ConsoleService; +/// use yew_styles::{ +/// button::{Button, Size}, +/// styles::{Palette, Style}, +/// }; +/// +/// pub struct App { +/// link: ComponentLink, +/// } +/// +/// pub enum Msg { +/// Clicked(String), +/// } +/// #[derive(Clone, Properties)] +/// pub struct Props {} +/// +/// impl Component for App { +/// type Message = Msg; +/// type Properties = Props; +/// +/// fn create(_props: Self::Properties, link: ComponentLink) -> Self { +/// App { +/// link +/// } +/// } +/// +/// fn update(&mut self, msg: Self::Message) -> ShouldRender { +/// match msg { +/// Msg::Clicked(greeting) => { +/// let mut console = ConsoleService::new(); +/// console.log(format!("{}", greeting)) +/// } +/// } +/// false +/// } +/// +/// fn view(&self) -> Html { +/// html! { +/// +/// } +/// } +/// } +/// ``` pub struct Button { link: ComponentLink, props: ButtonProps, @@ -56,14 +93,19 @@ impl From for ButtonProps { #[derive(Clone, Properties)] pub struct Props { + /// Type botton style. Options included in `Pallete` #[prop_or(Palette::Standard)] pub button_type: Palette, + /// General property to add custom class styles #[prop_or_default] pub class_name: String, + /// Three diffent button standard sizes. Options included in `Size` #[prop_or(Size::Medium)] pub size: Size, + /// Button styles. Options included in `Style` #[prop_or(Style::Regular)] pub button_style: Style, + /// Click event for button pub onsignal: Callback<()>, pub children: Children, } From f57805a33274245d21ba800ae74e62be1cf5b7f8 Mon Sep 17 00:00:00 2001 From: spieljs Date: Thu, 23 Apr 2020 01:57:48 +0200 Subject: [PATCH 09/16] implementing documentation for layouts --- crate/src/page/button_page.rs | 8 +++-- crate/src/page/highlighters.rs | 15 ++++++++ crate/src/page/layouts_page.rs | 62 +++++++++++++++++++++++++++------- crate/yew_styles/Cargo.toml | 2 +- 4 files changed, 70 insertions(+), 17 deletions(-) diff --git a/crate/src/page/button_page.rs b/crate/src/page/button_page.rs index 688b5e8..9400341 100644 --- a/crate/src/page/button_page.rs +++ b/crate/src/page/button_page.rs @@ -60,9 +60,11 @@ impl Component for ButtonPage {
  • {"button_type: "}{"type botton style. Options included in "}{"Pallete"}{". Default "}{"Standard"}
  • {"size: "}{"three diffent button standard sizes. Options included in "}{"Size"}{". Default "}{"Medium"}
  • {"button_style: "}{"button styles. Options included in "}{"Style"}{". Default "}{"Regular"}
  • -
  • {"onsignal: "}{"click event for button"}
  • +
  • {"onsignal: "}{"click event for button. Required"}
  • + +

    {"Visual examples"}

    {get_button_styles(self.link.clone())} @@ -93,7 +95,7 @@ fn get_button_styles(link: ComponentLink) -> Html { .map(move |style| { html! { <> -

    {get_style(style.clone()).to_uppercase()}

    +

    {get_style(style.clone()).to_uppercase()}

    {get_sizes(style, link.clone())} } @@ -135,7 +137,7 @@ fn get_buttons(size: Size, button_style: Style, link: ComponentLink) html! {
    -

    {get_size(size.clone()).to_uppercase()}

    +

    {get_size(size.clone()).to_uppercase()}

    { button_types.into_iter().map(|button_type| { let button = html! { diff --git a/crate/src/page/highlighters.rs b/crate/src/page/highlighters.rs index e7051cc..2aec457 100644 --- a/crate/src/page/highlighters.rs +++ b/crate/src/page/highlighters.rs @@ -8,3 +8,18 @@ pub fn button_code() -> String { >{\"Greeting\"}" .to_string() } + +pub fn container_code() -> String { + " + +

    {\"start\"}

    +
    + +

    {\"center\"}

    +
    + +

    {\"end\"}

    +
    +
    " + .to_string() +} diff --git a/crate/src/page/layouts_page.rs b/crate/src/page/layouts_page.rs index 837a26d..3bff245 100644 --- a/crate/src/page/layouts_page.rs +++ b/crate/src/page/layouts_page.rs @@ -1,4 +1,6 @@ +use super::highlighters::container_code; use yew::prelude::*; +use yew_prism::Prism; use yew_styles::layouts::{ container::{AlignContent, AlignItems, Container, Direction, JustifyContent, Mode, Wrap}, item::{AlignSelf, Item, ItemLayout}, @@ -23,36 +25,70 @@ impl Component for LayoutsPage { fn view(&self) -> Html { html! {
    -

    {"Layouts"}

    -

    {"Wrap"}

    + +

    {"Layouts components"}

    +
    + + +

    {"Code example"}

    + +
    + + +

    {"Container properties"}

    +
      +
    • {"direction: "}{"which direction are placing the items. Options include in "}{"Direction"}{". Required"}
    • +
    • {"wrap: "}{"set a wrap for the items. Options included in "}{"Wrap"}{". Default "}{"Wrap"}
    • +
    • {"justify_content: "}{"set how will be justified the content. Options included in "}{"JustifyContent"}{". Default "}{"FlexStart(No Mode)"}
    • +
    • {"align_content: "}{"set how will be aligned the content. Options included in "}{"AlignContent"}{". Default "}{"Stretch(NoMode)"}
    • +
    • {"align_items: "}{"set how will be aligned the items. Options included in "}{"AlignItems"}{". Default "}{"Stretch(NoMode)"}
    • +
    • {"mode: "}{"safe postion handler which is additional option for justify_content, align_content and align_items. Options included in "}{"Mode"}{". Default "}{"NoMode"}
    • +
    +
    + + +

    {"Item properties"}

    +
      +
    • {"layouts: "}{"percent of the layout that will take the item. The value is a vector "}{"Vec"}{". Required"}
    • +
    • {"align_self: "}{"align the item itself. Options include in "}{"AlignSelf"}{". Default "}{"Auto"}
    • +
    • {"onsignal: "}{"click event for the item. Default "}{"noop()"}
    • +
    +
    + + +

    {"Visual examples"}

    +

    {"Wrap"}

    {(1..13).map(|x| LayoutsPageModel.get_items(x)).collect::()} -

    {"No wrap"}

    +

    {"No wrap"}

    {(1..13).map(|x| LayoutsPageModel.get_items(x)).collect::()} -

    {"Wrap reverse"}

    +

    {"Wrap reverse"}

    {(1..13).map(|x| LayoutsPageModel.get_items(x)).collect::()} -

    {"Row direction:"}

    +

    {"Row direction:"}

    {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} -

    {"Row reverse direction:"}

    +

    {"Row reverse direction:"}

    {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} -

    {"Column direction:"}

    +

    {"Column direction:"}

    {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} -

    {"Column reverse direction:"}

    +

    {"Column reverse direction:"}

    {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} -

    {"Combination of column and row direction"}

    +

    {"Combination of column and row direction"}

    -

    {"Justify Content"}

    +

    {"Justify Content"}

    {"To know about more options please visit "} {"Justify Content"}

    -

    {"Align Content"}

    +

    {"Align Content"}

    {"To know about more options please visit "} {"Align Content"}

    -

    {"Align Items"}

    +

    {"Align Items"}

    {"To know about more options please visit "} {"Align Items"}

    -

    {"Align self"}

    +

    {"Align self"}

    {"start"}

    diff --git a/crate/yew_styles/Cargo.toml b/crate/yew_styles/Cargo.toml index 78b0b25..c16be5c 100644 --- a/crate/yew_styles/Cargo.toml +++ b/crate/yew_styles/Cargo.toml @@ -20,7 +20,7 @@ web_sys = ["web-sys", "yew/web_sys"] wasm-bindgen = "0.2.60" yew = { version="0.14.2", features = ["toml", "yaml", "msgpack", "cbor"], optional = true } stdweb = { version = "0.4", optional = true} -web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"], optional=true} +web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"], optional= true} uuid = {version= "0.8", features=["v4", "wasm-bindgen", "stdweb"]} [dev-dependencies] From a1b29bcb94c0a10e3c8aed5cc6694d3108d0ae08 Mon Sep 17 00:00:00 2001 From: spieljs Date: Thu, 23 Apr 2020 23:57:17 +0200 Subject: [PATCH 10/16] add documentation for layouts --- .../src/components/layouts/container.rs | 69 +++++++++++++++++++ .../yew_styles/src/components/layouts/item.rs | 64 +++++++++++++++++ 2 files changed, 133 insertions(+) diff --git a/crate/yew_styles/src/components/layouts/container.rs b/crate/yew_styles/src/components/layouts/container.rs index 7522cce..a50b26f 100644 --- a/crate/yew_styles/src/components/layouts/container.rs +++ b/crate/yew_styles/src/components/layouts/container.rs @@ -1,6 +1,64 @@ use crate::utils::create_style; use yew::prelude::*; +/// # Container component +/// +/// ## Example +/// +/// The layouts in yew styles is base in flexbox +/// you can fine more information about the properties options +/// [here](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox) +/// +/// ```rust +/// use yew::prelude::*; +/// use yew_styles::{ +/// layouts::{ +/// container::{Wrap, Direction}, +/// item::{ItenLayout, AlignSelf} +/// } +/// }; +/// +/// pub struct App { +/// link: ComponentLink, +/// } +/// +/// pub enum Msg { +/// Clicked(String), +/// } +/// #[derive(Clone, Properties)] +/// pub struct Props {} +/// +/// impl Component for App { +/// type Message = Msg; +/// type Properties = Props; +/// +/// fn create(_props: Self::Properties, link: ComponentLink) -> Self { +/// App { +/// link +/// } +/// } +/// +/// fn update(&mut self, msg: Self::Message) -> ShouldRender { +/// false +/// } +/// +/// fn view(&self) -> Html { +/// html! { +/// +/// +///

    {"start"}

    +///
    +/// +///

    {"center"}

    +///
    +/// +///

    {"end"}

    +///
    +///
    +/// } +/// } +/// } +/// ``` pub struct Container { props: Props, } @@ -8,6 +66,7 @@ pub struct Container { #[derive(Clone, Copy)] struct ContainerModel; +/// Which direction are placing the items #[derive(Clone)] pub enum Direction { Row, @@ -16,6 +75,7 @@ pub enum Direction { ColumnReverse, } +/// Set a wrap for the items #[derive(Clone)] pub enum Wrap { Nowrap, @@ -30,6 +90,7 @@ pub enum Mode { NoMode, } +/// Set how will be justified the content #[derive(Clone)] pub enum JustifyContent { FlexStart(Mode), @@ -44,6 +105,7 @@ pub enum JustifyContent { Rigth(Mode), } +/// Set how will be aligned the items #[derive(Clone)] pub enum AlignItems { Stretch(Mode), @@ -59,6 +121,7 @@ pub enum AlignItems { SelfEnd(Mode), } +/// set how will be aligned the content #[derive(Clone)] pub enum AlignContent { FlexStart(Mode), @@ -79,16 +142,22 @@ pub enum Msg {} #[derive(Clone, Properties)] pub struct Props { + /// Which direction are placing the items pub direction: Direction, + /// Set a wrap for the items pub wrap: Wrap, #[prop_or_default] pub index: i16, + /// Set how will be justified the content #[prop_or(JustifyContent::FlexStart(Mode::NoMode))] pub justify_content: JustifyContent, + /// Set how will be aligned the content #[prop_or(AlignContent::Stretch(Mode::NoMode))] pub align_content: AlignContent, + /// Set how will be aligned the items #[prop_or(AlignItems::Stretch(Mode::NoMode))] pub align_items: AlignItems, + /// General property to add custom class styles #[prop_or_default] pub class_name: String, #[prop_or_default] diff --git a/crate/yew_styles/src/components/layouts/item.rs b/crate/yew_styles/src/components/layouts/item.rs index aa5b0ca..eb86458 100644 --- a/crate/yew_styles/src/components/layouts/item.rs +++ b/crate/yew_styles/src/components/layouts/item.rs @@ -1,6 +1,7 @@ use crate::utils::create_style; use yew::prelude::*; +/// Percent of the layout that will take the item. #[derive(Clone)] pub enum ItemLayout { ItXs(i8), @@ -10,6 +11,7 @@ pub enum ItemLayout { ItXl(i8), } +/// Align the item itself #[derive(Clone)] pub enum AlignSelf { Auto, @@ -24,6 +26,64 @@ pub enum Msg { Clicked, } +/// # Item component +/// +/// The layouts in yew styles is base in flexbox +/// you can fine more information about the properties options +/// [here](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Flexible_Box_Layout/Basic_Concepts_of_Flexbox) +/// +/// ## Example +/// +/// ```rust +/// use yew::prelude::*; +/// use yew_styles::{ +/// layouts::{ +/// container::{Wrap, Direction}, +/// item::{ItenLayout, AlignSelf} +/// } +/// }; +/// +/// pub struct App { +/// link: ComponentLink, +/// } +/// +/// pub enum Msg { +/// Clicked(String), +/// } +/// #[derive(Clone, Properties)] +/// pub struct Props {} +/// +/// impl Component for App { +/// type Message = Msg; +/// type Properties = Props; +/// +/// fn create(_props: Self::Properties, link: ComponentLink) -> Self { +/// App { +/// link +/// } +/// } +/// +/// fn update(&mut self, msg: Self::Message) -> ShouldRender { +/// false +/// } +/// +/// fn view(&self) -> Html { +/// html! { +/// +/// +///

    {"start"}

    +///
    +/// +///

    {"center"}

    +///
    +/// +///

    {"end"}

    +///
    +///
    +/// } +/// } +/// } +/// ``` pub struct Item { link: ComponentLink, props: Props, @@ -42,15 +102,19 @@ struct ItemModel; #[derive(Clone, Properties)] pub struct Props { + /// Percent of the layout that will take the item. pub layouts: Vec, #[prop_or(AlignSelf::Auto)] + /// Align the item itself pub align_self: AlignSelf, #[prop_or_default] pub name: String, + /// General property to add custom class styles #[prop_or_default] pub class_name: String, #[prop_or_default] pub index: i16, + /// Click event for the item #[prop_or(Callback::noop())] pub onsignal: Callback<()>, pub children: Children, From 4afb42264076bc71bc969a026ded65db29e3a991 Mon Sep 17 00:00:00 2001 From: spieljs Date: Fri, 24 Apr 2020 00:31:38 +0200 Subject: [PATCH 11/16] remove stdweb support --- crate/yew_styles/.cargo/config | 4 ++-- crate/yew_styles/Cargo.lock | 2 -- crate/yew_styles/Cargo.toml | 9 ++------- crate/yew_styles/build.rs | 9 --------- crate/yew_styles/src/assets.rs | 1 - crate/yew_styles/src/utils.rs | 33 ++++++++------------------------- 6 files changed, 12 insertions(+), 46 deletions(-) delete mode 100644 crate/yew_styles/build.rs diff --git a/crate/yew_styles/.cargo/config b/crate/yew_styles/.cargo/config index a20c8ca..91cd80c 100644 --- a/crate/yew_styles/.cargo/config +++ b/crate/yew_styles/.cargo/config @@ -1,2 +1,2 @@ -[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'] -runner = 'wasm-bindgen-test-runner' \ No newline at end of file +[build] +target="wasm32-unknown-unknown" \ No newline at end of file diff --git a/crate/yew_styles/Cargo.lock b/crate/yew_styles/Cargo.lock index b752bed..eb5ff74 100644 --- a/crate/yew_styles/Cargo.lock +++ b/crate/yew_styles/Cargo.lock @@ -705,7 +705,6 @@ dependencies = [ "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", @@ -731,7 +730,6 @@ dependencies = [ name = "yew_styles" version = "0.2.1" dependencies = [ - "stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-test 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/crate/yew_styles/Cargo.toml b/crate/yew_styles/Cargo.toml index c16be5c..d286a4e 100644 --- a/crate/yew_styles/Cargo.toml +++ b/crate/yew_styles/Cargo.toml @@ -12,15 +12,10 @@ repository = "https://github.com/spielrs/yew-styles-page/tree/master/crate/yew_s [lib] crate-type = ["cdylib", "rlib"] -[features] -std_web = ["stdweb", "yew/std_web"] -web_sys = ["web-sys", "yew/web_sys"] - [dependencies] wasm-bindgen = "0.2.60" -yew = { version="0.14.2", features = ["toml", "yaml", "msgpack", "cbor"], optional = true } -stdweb = { version = "0.4", optional = true} -web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"], optional= true} +yew = { version="0.14", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"] } +web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"]} uuid = {version= "0.8", features=["v4", "wasm-bindgen", "stdweb"]} [dev-dependencies] diff --git a/crate/yew_styles/build.rs b/crate/yew_styles/build.rs deleted file mode 100644 index bbe0527..0000000 --- a/crate/yew_styles/build.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub fn main() { - let using_web_sys = cfg!(feature = "web_sys"); - let using_std_web = cfg!(feature = "std_web"); - if using_web_sys && using_std_web { - panic!("Yew does not allow the `web_sys` and `std_web` cargo features to be used simultaneously"); - } else if !using_web_sys && !using_std_web { - panic!("Yew requires selecting either the `web_sys` or `std_web` cargo feature"); - } -} diff --git a/crate/yew_styles/src/assets.rs b/crate/yew_styles/src/assets.rs index 879c524..e6bf85a 100644 --- a/crate/yew_styles/src/assets.rs +++ b/crate/yew_styles/src/assets.rs @@ -1,4 +1,3 @@ -#[cfg(any(feature = "std_web", feature = "web_sys"))] use yew::prelude::*; #[derive(Clone)] diff --git a/crate/yew_styles/src/utils.rs b/crate/yew_styles/src/utils.rs index 40abbca..2c12c08 100644 --- a/crate/yew_styles/src/utils.rs +++ b/crate/yew_styles/src/utils.rs @@ -1,33 +1,16 @@ -#[cfg(feature = "std_web")] -extern crate stdweb; extern crate wasm_bindgen; -#[cfg(feature = "web_sys")] extern crate web_sys; - -#[cfg(feature = "std_web")] -use stdweb::js; -#[cfg(feature = "web_sys")] use wasm_bindgen::JsCast; -#[cfg(feature = "web_sys")] use web_sys::{window, HtmlElement}; pub fn create_style(style: String, value: String, wrap: String) { - #[cfg(feature = "web_sys")] - { - let document = window().unwrap().document().unwrap(); - let element = document - .get_elements_by_class_name(&wrap) - .get_with_index(0) - .unwrap() - .dyn_into::() - .unwrap(); - - element.style().set_property(&style, &value).unwrap(); - } + let document = window().unwrap().document().unwrap(); + let element = document + .get_elements_by_class_name(&wrap) + .get_with_index(0) + .unwrap() + .dyn_into::() + .unwrap(); - #[cfg(feature = "std_web")] - js! { - const element = document.getElementsByClassName(@{wrap})[0]; - element.style[@{style}] = @{value}; - }; + element.style().set_property(&style, &value).unwrap(); } From 9eee63e8b64eb4ebdb61d9457ce4be273f1e5d80 Mon Sep 17 00:00:00 2001 From: spieljs Date: Fri, 24 Apr 2020 01:57:04 +0200 Subject: [PATCH 12/16] meke dynamic the layouts --- crate/Cargo.lock | 1 + crate/Cargo.toml | 2 +- crate/src/app.rs | 7 +-- crate/src/page/layouts_page.rs | 50 +++++++-------- crate/yew_styles/Cargo.lock | 1 + crate/yew_styles/Cargo.toml | 1 + .../src/components/layouts/container.rs | 62 ++++++------------- .../yew_styles/src/components/layouts/item.rs | 39 ++++-------- .../src/components/navbar/navbar_container.rs | 5 +- crate/yew_styles/src/utils.rs | 9 +++ 10 files changed, 72 insertions(+), 105 deletions(-) diff --git a/crate/Cargo.lock b/crate/Cargo.lock index e560f86..2a81335 100644 --- a/crate/Cargo.lock +++ b/crate/Cargo.lock @@ -922,6 +922,7 @@ dependencies = [ name = "yew_styles" version = "0.2.1" dependencies = [ + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/crate/Cargo.toml b/crate/Cargo.toml index 598446e..62fc4a1 100644 --- a/crate/Cargo.toml +++ b/crate/Cargo.toml @@ -24,4 +24,4 @@ yew = { version="0.14.2", features = ["toml", "yaml", "msgpack", "cbor", "web_sy yew-router = {version = "0.11", features = ["web_sys"] } web-sys = "0.3" yew_prism = "0.1" -yew_styles= {path= "./yew_styles", version = "0.2.0", features = ["web_sys"]} +yew_styles= {path= "./yew_styles", version = "0.2.0"} diff --git a/crate/src/app.rs b/crate/src/app.rs index 6620410..cb5dc4f 100644 --- a/crate/src/app.rs +++ b/crate/src/app.rs @@ -36,10 +36,9 @@ impl Component for App { fn view(&self) -> Html { html! { - - + + - + render = Router::render(|switch: AppRouter | { match switch { diff --git a/crate/src/page/layouts_page.rs b/crate/src/page/layouts_page.rs index 3bff245..bfe2665 100644 --- a/crate/src/page/layouts_page.rs +++ b/crate/src/page/layouts_page.rs @@ -61,46 +61,46 @@ impl Component for LayoutsPage {

    {"Visual examples"}

    {"Wrap"}

    - + {(1..13).map(|x| LayoutsPageModel.get_items(x)).collect::()}

    {"No wrap"}

    - + {(1..13).map(|x| LayoutsPageModel.get_items(x)).collect::()}

    {"Wrap reverse"}

    - + {(1..13).map(|x| LayoutsPageModel.get_items(x)).collect::()}

    {"Row direction:"}

    - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()}

    {"Row reverse direction:"}

    - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()}

    {"Column direction:"}

    - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()}

    {"Column reverse direction:"}

    - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()}

    {"Combination of column and row direction"}

    - + - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} @@ -108,20 +108,19 @@ impl Component for LayoutsPage {

    {"Justify Content"}

    - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} @@ -132,21 +131,21 @@ impl Component for LayoutsPage {

    {"Align Content"}

    - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} @@ -155,14 +154,14 @@ impl Component for LayoutsPage { {"Align Content"}

    {"Align Items"}

    - + {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} @@ -172,8 +171,7 @@ impl Component for LayoutsPage { > {(1..5).map(|x| LayoutsPageModel.get_items(x)).collect::()} @@ -185,13 +183,13 @@ impl Component for LayoutsPage {

    {"Align self"}

    - +

    {"start"}

    - +

    {"center"}

    - +

    {"end"}

    diff --git a/crate/yew_styles/Cargo.lock b/crate/yew_styles/Cargo.lock index eb5ff74..5074137 100644 --- a/crate/yew_styles/Cargo.lock +++ b/crate/yew_styles/Cargo.lock @@ -730,6 +730,7 @@ dependencies = [ name = "yew_styles" version = "0.2.1" dependencies = [ + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-test 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/crate/yew_styles/Cargo.toml b/crate/yew_styles/Cargo.toml index d286a4e..c814c36 100644 --- a/crate/yew_styles/Cargo.toml +++ b/crate/yew_styles/Cargo.toml @@ -17,6 +17,7 @@ wasm-bindgen = "0.2.60" yew = { version="0.14", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"] } web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"]} uuid = {version= "0.8", features=["v4", "wasm-bindgen", "stdweb"]} +rand = "0.7" [dev-dependencies] wasm-bindgen-test = "0.3" diff --git a/crate/yew_styles/src/components/layouts/container.rs b/crate/yew_styles/src/components/layouts/container.rs index a50b26f..8bd2c97 100644 --- a/crate/yew_styles/src/components/layouts/container.rs +++ b/crate/yew_styles/src/components/layouts/container.rs @@ -1,4 +1,4 @@ -use crate::utils::create_style; +use crate::utils::{create_style, get_hash}; use yew::prelude::*; /// # Container component @@ -61,6 +61,7 @@ use yew::prelude::*; /// ``` pub struct Container { props: Props, + hash: String, } #[derive(Clone, Copy)] @@ -146,8 +147,6 @@ pub struct Props { pub direction: Direction, /// Set a wrap for the items pub wrap: Wrap, - #[prop_or_default] - pub index: i16, /// Set how will be justified the content #[prop_or(JustifyContent::FlexStart(Mode::NoMode))] pub justify_content: JustifyContent, @@ -160,8 +159,6 @@ pub struct Props { /// General property to add custom class styles #[prop_or_default] pub class_name: String, - #[prop_or_default] - pub name: String, pub children: Children, } @@ -170,11 +167,13 @@ impl Component for Container { type Properties = Props; fn create(props: Self::Properties, _link: ComponentLink) -> Self { - Container { props } + let hash = get_hash(10); + + Container { props, hash } } fn mounted(&mut self) -> ShouldRender { - ContainerModel.init(self.props.clone()); + ContainerModel.init(self.props.clone(), self.hash.clone()); true } @@ -190,12 +189,7 @@ impl Component for Container { fn view(&self) -> Html { html! { -
    {self.props.children.render()}
    @@ -204,14 +198,14 @@ impl Component for Container { } impl ContainerModel { - fn init(self, props: Props) { - self.get_flow(props.direction, props.wrap, props.index, props.name.clone()); - self.get_justify_content(props.justify_content, props.index, props.name.clone()); - self.get_align_content(props.align_content, props.index, props.name.clone()); - self.get_align_items(props.align_items, props.index, props.name); + fn init(self, props: Props, hash: String) { + self.get_flow(props.direction, props.wrap, hash.clone()); + self.get_justify_content(props.justify_content, hash.clone()); + self.get_align_content(props.align_content, hash.clone()); + self.get_align_items(props.align_items, hash); } - fn get_flow(self, direction: Direction, wrap: Wrap, index: i16, name: String) { + fn get_flow(self, direction: Direction, wrap: Wrap, hash: String) { let direction = match direction { Direction::Row => "row".to_string(), Direction::RowReverse => "row-reverse".to_string(), @@ -230,11 +224,7 @@ impl ContainerModel { create_style( String::from("flex-flow"), value, - if name == "" { - format!("container-{}", index) - } else { - format!("container-{}-{}", name, index) - }, + format!("container-{}", hash), ); } @@ -246,7 +236,7 @@ impl ContainerModel { } } - fn get_justify_content(self, justify_content: JustifyContent, index: i16, name: String) { + fn get_justify_content(self, justify_content: JustifyContent, hash: String) { let value = match justify_content { JustifyContent::FlexStart(mode) => format!("flex-start{}", self.get_mode(mode)), JustifyContent::FlexEnd(mode) => format!("flex-end{}", self.get_mode(mode)), @@ -263,15 +253,11 @@ impl ContainerModel { create_style( String::from("justify-content"), value, - if name == "" { - format!("container-{}", index) - } else { - format!("container-{}-{}", name, index) - }, + format!("container-{}", hash), ); } - fn get_align_content(self, align_content: AlignContent, index: i16, name: String) { + fn get_align_content(self, align_content: AlignContent, hash: String) { let value = match align_content { AlignContent::Stretch(mode) => format!("stretch{}", self.get_mode(mode)), AlignContent::FlexStart(mode) => format!("flex-start{}", self.get_mode(mode)), @@ -290,15 +276,11 @@ impl ContainerModel { create_style( String::from("align-content"), value, - if name == "" { - format!("container-{}", index) - } else { - format!("container-{}-{}", name, index) - }, + format!("container-{}", hash), ); } - fn get_align_items(self, align_items: AlignItems, index: i16, name: String) { + fn get_align_items(self, align_items: AlignItems, hash: String) { let value = match align_items { AlignItems::Stretch(mode) => format!("stretch{}", self.get_mode(mode)), AlignItems::Baseline(mode) => format!("baseline{}", self.get_mode(mode)), @@ -316,11 +298,7 @@ impl ContainerModel { create_style( String::from("align-items"), value, - if name == "" { - format!("container-{}", index) - } else { - format!("container-{}-{}", name, index) - }, + format!("container-{}", hash), ); } } diff --git a/crate/yew_styles/src/components/layouts/item.rs b/crate/yew_styles/src/components/layouts/item.rs index eb86458..5f9ca71 100644 --- a/crate/yew_styles/src/components/layouts/item.rs +++ b/crate/yew_styles/src/components/layouts/item.rs @@ -1,4 +1,4 @@ -use crate::utils::create_style; +use crate::utils::{create_style, get_hash}; use yew::prelude::*; /// Percent of the layout that will take the item. @@ -87,13 +87,12 @@ pub enum Msg { pub struct Item { link: ComponentLink, props: Props, + hash: String, } #[derive(Clone)] struct ItemProps { layouts_classes: String, - name: String, - index: i16, class_name: String, } @@ -107,13 +106,9 @@ pub struct Props { #[prop_or(AlignSelf::Auto)] /// Align the item itself pub align_self: AlignSelf, - #[prop_or_default] - pub name: String, /// General property to add custom class styles #[prop_or_default] pub class_name: String, - #[prop_or_default] - pub index: i16, /// Click event for the item #[prop_or(Callback::noop())] pub onsignal: Callback<()>, @@ -125,11 +120,13 @@ impl Component for Item { type Properties = Props; fn create(props: Self::Properties, link: ComponentLink) -> Self { - Item { link, props } + let hash = get_hash(10); + + Item { link, props, hash } } fn mounted(&mut self) -> ShouldRender { - ItemModel.init(self.props.clone()); + ItemModel.init(self.props.align_self.clone(), self.hash.clone()); true } @@ -154,11 +151,7 @@ impl Component for Item { html! {
    @@ -172,16 +165,14 @@ impl From for ItemProps { fn from(props: Props) -> Self { ItemProps { layouts_classes: ItemModel.get_layout_classes(props.layouts), - name: props.name, - index: props.index, class_name: props.class_name, } } } impl ItemModel { - fn init(self, props: Props) { - self.get_item_align(props.align_self, props.index, props.name); + fn init(self, align_self: AlignSelf, hash: String) { + self.get_item_align(align_self, hash); } fn get_layout_classes(self, layouts_prop: Vec) -> String { @@ -204,7 +195,7 @@ impl ItemModel { } } - fn get_item_align(self, align: AlignSelf, index: i16, name: String) { + fn get_item_align(self, align: AlignSelf, hash: String) { let value = match align { AlignSelf::Auto => "auto".to_string(), AlignSelf::Baseline => "baseline".to_string(), @@ -214,14 +205,6 @@ impl ItemModel { AlignSelf::Stretch => "stretch".to_string(), }; - create_style( - String::from("align-self"), - value, - if name == "" { - format!("item-{}", index) - } else { - format!("item-{}-{}", name, index) - }, - ); + create_style(String::from("align-self"), value, format!("item-{}", hash)); } } diff --git a/crate/yew_styles/src/components/navbar/navbar_container.rs b/crate/yew_styles/src/components/navbar/navbar_container.rs index 99a8218..20dcef7 100644 --- a/crate/yew_styles/src/components/navbar/navbar_container.rs +++ b/crate/yew_styles/src/components/navbar/navbar_container.rs @@ -1,8 +1,6 @@ use crate::layouts::container::{Container, Direction, JustifyContent, Mode, Wrap}; use yew::prelude::*; -use uuid::Uuid; - pub enum Msg { Clicked, } @@ -40,8 +38,7 @@ impl Component for NavbarContainer { class_name=format!("navbar-container {}", self.props.class_name) direction=self.props.direction.clone() wrap=Wrap::Wrap - justify_content=self.props.justify_content.clone() - name=format!("{}", Uuid::new_v4())> + justify_content=self.props.justify_content.clone()> {self.props.children.render()} } diff --git a/crate/yew_styles/src/utils.rs b/crate/yew_styles/src/utils.rs index 2c12c08..9e854b7 100644 --- a/crate/yew_styles/src/utils.rs +++ b/crate/yew_styles/src/utils.rs @@ -1,5 +1,7 @@ +extern crate rand; extern crate wasm_bindgen; extern crate web_sys; +use rand::{distributions::Alphanumeric, thread_rng, Rng}; use wasm_bindgen::JsCast; use web_sys::{window, HtmlElement}; @@ -14,3 +16,10 @@ pub fn create_style(style: String, value: String, wrap: String) { element.style().set_property(&style, &value).unwrap(); } + +pub fn get_hash(len: usize) -> String { + thread_rng() + .sample_iter(&Alphanumeric) + .take(len) + .collect::() +} From 9945cf952fecfa52f6a46183ffc1beb54e10d11d Mon Sep 17 00:00:00 2001 From: "F.J. Navarro" Date: Sat, 25 Apr 2020 03:49:10 +0200 Subject: [PATCH 13/16] Documentation (#17) --- README.md | 52 ++++----- crate/Cargo.lock | 87 +------------- crate/Cargo.toml | 6 +- crate/src/app.rs | 10 +- crate/src/page/button_page.rs | 8 +- crate/src/page/highlighters.rs | 32 ++++++ crate/src/page/home_page.rs | 67 +++++++++++ crate/src/page/layouts_page.rs | 14 +-- crate/src/page/mod.rs | 2 + crate/src/page/navbar_page.rs | 46 +++++++- crate/yew_styles/.cargo/config | 5 +- crate/yew_styles/Cargo.lock | 107 +----------------- crate/yew_styles/Cargo.toml | 8 +- crate/yew_styles/README.md | 27 +++++ .../src/components/layouts/container.rs | 6 +- .../yew_styles/src/components/layouts/item.rs | 6 +- crate/yew_styles/src/components/mod.rs | 2 +- .../src/components/navbar/navbar_component.rs | 89 +++++++++++++++ .../src/components/navbar/navbar_container.rs | 86 ++++++++++++++ .../src/components/navbar/navbar_item.rs | 85 ++++++++++++++ crate/yew_styles/src/lib.rs | 34 ++++++ crate/yew_styles/src/styles.rs | 2 + crate/yew_styles/src/utils.rs | 2 +- crate/yew_styles/tests/layouts.rs | 10 +- crate/yew_styles/tests/utils.rs | 28 ++++- 25 files changed, 561 insertions(+), 260 deletions(-) create mode 100644 crate/src/page/home_page.rs create mode 100644 crate/yew_styles/README.md diff --git a/README.md b/README.md index d4c4b12..dd35731 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,27 @@ -# `yewstyle` - -This is an initial project of a framework style for yew - -you can run the project with: - -* `npm start` - -To install yew-styles in your project, execute in the root path: - -* `npm install yew-styles` - -* after import the css in your index.js/index.ts file: - -```javascript -import 'node_modules/yew-styles/main.css'; +# Yew Styles +Yew Styles is a style framework for yew + +## Motivation +The purpose of developing this project is first, +provide a style framework for yew because there isn't not many options currently, +also to create a layout system which is not far of the flexbox concept, and, +to take the rust benefits and implement a properties selected by enumeration +in the most of the cases which makes fast for developing applications and avoids the practice try and error + +## How it works +Each component is splited in two parts, the logical yew component and its sass module, +however, it is not necessary to worry about the sass module only it needs to be include in the project +### How install it +1. Install the sass module: `npm install yew-styles` +2. Add the yew_style crate in Cargo.toml file: `yew_styles = "0.3.0"` +3. Import the main.css file in you main javascript/typescript file project: +```typescript + import 'node_modules/yew-styles/main.css'; ``` +4. Ready to import and use in your project 🚀 +In the left side there is a list of links where each one access to a correspondent component documentation, +there, shows how to use it. -* include in your Cargo.toml if you want to use web-sys feature this: - -```toml -yew_styles= {path= "./yew_styles", version = "0.2.0", features = ["web_sys"]} -``` - -or this if you want to use stdweb instead - -```toml -yew_styles= {path= "./yew_styles", version = "0.2.0", features = ["std_web"]} -``` \ No newline at end of file +## Development phase +Yew style is in early phase, currently doesn't have enough components to cover all the requirements that could need a website/web application. +All contributions are appreciated. \ No newline at end of file diff --git a/crate/Cargo.lock b/crate/Cargo.lock index 2a81335..d5318b2 100644 --- a/crate/Cargo.lock +++ b/crate/Cargo.lock @@ -43,11 +43,6 @@ dependencies = [ "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "base-x" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "bincode" version = "1.2.1" @@ -101,11 +96,6 @@ dependencies = [ "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "dotenv" version = "0.15.0" @@ -230,7 +220,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.65 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -564,11 +553,6 @@ dependencies = [ "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sha1" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "slab" version = "0.4.2" @@ -579,53 +563,6 @@ name = "static_assertions" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "discard 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb-derive 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb-internal-macros 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", - "stdweb-internal-runtime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base-x 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "syn" version = "1.0.11" @@ -678,14 +615,6 @@ name = "unicode-xid" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "uuid" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "version_check" version = "0.9.1" @@ -901,7 +830,7 @@ dependencies = [ [[package]] name = "yew_style_page" -version = "0.2.0" +version = "0.3.0" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -915,15 +844,15 @@ dependencies = [ "yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", "yew-router 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "yew_prism 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "yew_styles 0.2.1", + "yew_styles 0.3.0", ] [[package]] name = "yew_styles" -version = "0.2.1" +version = "0.3.0" dependencies = [ + "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", "yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -936,7 +865,6 @@ dependencies = [ "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" "checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" -"checksum base-x 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" "checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" "checksum boolinator 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" "checksum bumpalo 3.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb8038c1ddc0a5f73787b130f4cc75151e96ed33e417fde765eb5a81e3532f4" @@ -946,7 +874,6 @@ dependencies = [ "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum cfg-match 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8100e46ff92eb85bf6dc2930c73f2a4f7176393c84a9446b3d501e1b354e7b34" "checksum console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" -"checksum discard 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" "checksum dotenv 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" "checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" "checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" @@ -1004,20 +931,14 @@ dependencies = [ "checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" "checksum serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "9371ade75d4c2d6cb154141b9752cf3781ec9c05e0e5cf35060e1e70ee7b9c25" "checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" -"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum static_assertions 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" -"checksum stdweb 0.4.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -"checksum stdweb-derive 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -"checksum stdweb-internal-macros 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -"checksum stdweb-internal-runtime 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" "checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" "checksum synstructure 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203" "checksum thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ee14bf8e6767ab4c687c9e8bc003879e042a96fd67a3ba5934eadb6536bef4db" "checksum thiserror-impl 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "a7b51e1fbc44b5a0840be594fbc0f960be09050f2617e61e6aa43bef97cd3ef4" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" "checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" -"checksum uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" "checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "2cc57ce05287f8376e998cbddfb4c8cb43b84a7ec55cf4551d7c00eef317a47f" diff --git a/crate/Cargo.toml b/crate/Cargo.toml index 62fc4a1..7ee6e6e 100644 --- a/crate/Cargo.toml +++ b/crate/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0/MIT" name = "yew_style_page" readme = "./README.md" repository = "https://github.com/spielrs/yew-styles-page.git" -version = "0.2.0" +version = "0.3.0" [lib] crate-type = ["cdylib"] @@ -20,8 +20,8 @@ serde = "1.0" serde_derive = "1.0" dotenv = "0.15" failure = "0.1" -yew = { version="0.14.2", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"]} +yew = { version="0.14", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"]} yew-router = {version = "0.11", features = ["web_sys"] } web-sys = "0.3" yew_prism = "0.1" -yew_styles= {path= "./yew_styles", version = "0.2.0"} +yew_styles= {path= "./yew_styles"} diff --git a/crate/src/app.rs b/crate/src/app.rs index cb5dc4f..f22ee48 100644 --- a/crate/src/app.rs +++ b/crate/src/app.rs @@ -1,4 +1,4 @@ -use page::{ButtonPage, LayoutsPage, NavbarPage}; +use page::{ButtonPage, HomePage, LayoutsPage, NavbarPage}; use yew::prelude::*; use yew_router::{prelude::*, route::Route, switch::Permissive, Switch}; use yew_styles::layouts::{ @@ -44,7 +44,7 @@ impl Component for App { wrap=Wrap::Wrap > -

    {"Yew Styles Component"}

    +

    {"Documentation"}

    route=AppRouter::RootPath>{"Let's start"}> @@ -64,11 +64,7 @@ impl Component for App { render = Router::render(|switch: AppRouter | { match switch { - AppRouter::RootPath => html!{ -
    -

    {"Welcome to Yew Style"}

    -
    - }, + AppRouter::RootPath => html!{}, AppRouter::ButtonPath => html!{}, AppRouter::LayoutsPath => html!{}, AppRouter::NavbarPath => html!{}, diff --git a/crate/src/page/button_page.rs b/crate/src/page/button_page.rs index 9400341..f8a3f57 100644 --- a/crate/src/page/button_page.rs +++ b/crate/src/page/button_page.rs @@ -57,10 +57,10 @@ impl Component for ButtonPage {

    {"Propeties"}

      -
    • {"button_type: "}{"type botton style. Options included in "}{"Pallete"}{". Default "}{"Standard"}
    • -
    • {"size: "}{"three diffent button standard sizes. Options included in "}{"Size"}{". Default "}{"Medium"}
    • -
    • {"button_style: "}{"button styles. Options included in "}{"Style"}{". Default "}{"Regular"}
    • -
    • {"onsignal: "}{"click event for button. Required"}
    • +
    • {"button_type: "}{"type botton style. Options included in "}{"Pallete"}{". Default "}{"Standard"}{"."}
    • +
    • {"size: "}{"three diffent button standard sizes. Options included in "}{"Size"}{". Default "}{"Medium"}{"."}
    • +
    • {"button_style: "}{"button styles. Options included in "}{"Style"}{". Default "}{"Regular"}{"."}
    • +
    • {"onsignal: "}{"click event for button. Required."}
    diff --git a/crate/src/page/highlighters.rs b/crate/src/page/highlighters.rs index 2aec457..67f275b 100644 --- a/crate/src/page/highlighters.rs +++ b/crate/src/page/highlighters.rs @@ -23,3 +23,35 @@ pub fn container_code() -> String { " .to_string() } + +pub fn navbar_code() -> String { + "}> + + + {\"Home\"} + + + {\"Shop\"} + + + {\"Shop\"} + + + {\"About us\"} + + + {\"Contact\"} + + +" + .to_string() +} diff --git a/crate/src/page/home_page.rs b/crate/src/page/home_page.rs new file mode 100644 index 0000000..76ece95 --- /dev/null +++ b/crate/src/page/home_page.rs @@ -0,0 +1,67 @@ +use yew::prelude::*; +use yew_styles::layouts::{ + container::{Container, Direction, Wrap}, + item::{Item, ItemLayout}, +}; + +pub struct HomePage; + +impl Component for HomePage { + type Message = (); + type Properties = (); + + fn create(_props: Self::Properties, _link: ComponentLink) -> Self { + HomePage {} + } + + fn update(&mut self, _: Self::Message) -> ShouldRender { + false + } + + fn view(&self) -> Html { + html! { + + +

    {"Yew Styles"}

    +
    + +

    {"Yew Styles is a style framework for yew"}

    +
    + +

    {"Motivation"}

    +

    {"The purpose of developing this project is first, provide a style framework for yew + because there isn't not many options currently, also to create a layout system which is not + far of the flexbox concept, and, to take the rust benefits and implement a properties + selected by enumeration in the most of the cases which makes fast for developing applications + and avoids the practice try and error"}

    +
    + +

    {"How it works"}

    +

    {"Each component is splited in two parts, the logical yew component and its sass module, however, + it is not necessary to worry about the sass module only it needs to be include in the project"}

    + +

    {"How install it"}

    +
      +
    1. {"Install the sass module: "}{"npm install yew-styles"}
    2. +
    3. {"Add the yew_style crate in Cargo.toml file: "} + {"yew_styles = \"0.3.0\""} +
    4. +
    5. {"Import the main.css file in you main javascript/typescript file project: "} + {"import 'node_modules/yew-styles/main.css';"} +
    6. +
    7. {"Ready to import and use in your project \u{1F680}"}
    8. +
    + +

    {"In the left side there is a list of links where each one access to a correspondent component documentation, + there, shows how to use it."}

    +
    + +

    {"Development phase"}

    +

    {"Yew style is in early phase, currently doesn't have enough components to cover all the requirements + that could need a website/web application. All contributions are appreciated."}

    +
    +
    + } + } +} diff --git a/crate/src/page/layouts_page.rs b/crate/src/page/layouts_page.rs index bfe2665..b5085dc 100644 --- a/crate/src/page/layouts_page.rs +++ b/crate/src/page/layouts_page.rs @@ -26,7 +26,7 @@ impl Component for LayoutsPage { html! {
    -

    {"Layouts components"}

    +

    {"Layouts Components"}

    @@ -40,12 +40,12 @@ impl Component for LayoutsPage {

    {"Container properties"}

      -
    • {"direction: "}{"which direction are placing the items. Options include in "}{"Direction"}{". Required"}
    • -
    • {"wrap: "}{"set a wrap for the items. Options included in "}{"Wrap"}{". Default "}{"Wrap"}
    • -
    • {"justify_content: "}{"set how will be justified the content. Options included in "}{"JustifyContent"}{". Default "}{"FlexStart(No Mode)"}
    • -
    • {"align_content: "}{"set how will be aligned the content. Options included in "}{"AlignContent"}{". Default "}{"Stretch(NoMode)"}
    • -
    • {"align_items: "}{"set how will be aligned the items. Options included in "}{"AlignItems"}{". Default "}{"Stretch(NoMode)"}
    • -
    • {"mode: "}{"safe postion handler which is additional option for justify_content, align_content and align_items. Options included in "}{"Mode"}{". Default "}{"NoMode"}
    • +
    • {"direction: "}{"which direction are placing the items. Options include in "}{"Direction"}{". Required."}
    • +
    • {"wrap: "}{"set a wrap for the items. Options included in "}{"Wrap"}{". Default "}{"Wrap"}{"."}
    • +
    • {"justify_content: "}{"set how will be justified the content. Options included in "}{"JustifyContent"}{". Default "}{"FlexStart(No Mode)"}{"."}
    • +
    • {"align_content: "}{"set how will be aligned the content. Options included in "}{"AlignContent"}{". Default "}{"Stretch(NoMode)"}{"."}
    • +
    • {"align_items: "}{"set how will be aligned the items. Options included in "}{"AlignItems"}{". Default "}{"Stretch(NoMode)"}{"."}
    • +
    • {"mode: "}{"safe postion handler which is additional option for justify_content, align_content and align_items. Options included in "}{"Mode"}{". Default "}{"NoMode"}{"."}
    diff --git a/crate/src/page/mod.rs b/crate/src/page/mod.rs index 5148fc2..c6bb1de 100644 --- a/crate/src/page/mod.rs +++ b/crate/src/page/mod.rs @@ -1,8 +1,10 @@ pub mod button_page; mod highlighters; +pub mod home_page; pub mod layouts_page; pub mod navbar_page; pub use self::button_page::ButtonPage; +pub use self::home_page::HomePage; pub use self::layouts_page::LayoutsPage; pub use self::navbar_page::NavbarPage; diff --git a/crate/src/page/navbar_page.rs b/crate/src/page/navbar_page.rs index 484edfc..517f5bd 100644 --- a/crate/src/page/navbar_page.rs +++ b/crate/src/page/navbar_page.rs @@ -1,6 +1,11 @@ +use super::highlighters::navbar_code; use yew::prelude::*; +use yew_prism::Prism; use yew_styles::{ - layouts::container::{JustifyContent, Mode}, + layouts::{ + container::{JustifyContent, Mode}, + item::{Item, ItemLayout}, + }, navbar::{ navbar_component::{Fixed, Navbar}, navbar_container::NavbarContainer, @@ -61,6 +66,43 @@ impl Component for NavbarPage { fn view(&self) -> Html { html! {
    + +

    {"Navbar Components"}

    +
    + + +

    {"Code example"}

    + +
    + + +

    {"Navbar properties"}

    +
      +
    • {"navbar_type: "}{"type navbar style. Options included in "}{"Pallete"}{". Default "}{"Standard"}
    • +
    • {"button_style: "}{"navbar styles. Options included in "}{"Style"}{". Default "}{"Regular"}{"."}
    • +
    • {"fixed: "}{"the location of the navbar which is fixed .Options included in "}{"Fixed"}{". Default "}{"Top"}{"."}
    • +
    • {"branch: "}{"vnode embedded in the beginning of the navbar, useful to include a branch logo. Optional"}
    • +
    +
    + +

    {"Navbar Container properties"}

    +
      +
    • {"justify_content: "}{"set how will be justified the navbar items. Options included in "}{"JustifyContent"}{". Default "}{"FlexStart(No Mode)"}{"."}
    • +
    • {"direction: "}{"which direction are placing the navbar items. Options include in "}{"Direction"}{". Default "}{"Row"}{"."}
    • +
    • {"mode: "}{"safe postion handler which is additional option for justify_content. Options included in "}{"Mode"}{". Default "}{"NoMode"}{"."}
    • +
    +
    + +

    {"Navbar Item properties"}

    +
      +
    • {"onsignal: "}{"click event for navbar item. Default "}{"noop()"}
    • +
    +
    + +

    {"Visual examples"}

    {get_style(self.link.clone(), self.navbar_menu.clone())}
    } @@ -143,7 +185,7 @@ fn get_navbar_type( .map(|navbar_type| { let element = html! {
    -

    {format!("{} {}",style.name.clone(), navbar_type.name)}

    +

    {format!("{} {}",style.name.clone(), navbar_type.name)}

    "] edition = "2018" license = "MIT" @@ -16,8 +17,7 @@ crate-type = ["cdylib", "rlib"] wasm-bindgen = "0.2.60" yew = { version="0.14", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"] } web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"]} -uuid = {version= "0.8", features=["v4", "wasm-bindgen", "stdweb"]} -rand = "0.7" - +rand = {version="0.7", features = ["getrandom"]} +getrandom = {version = "0.1", features= ["wasm-bindgen"]} [dev-dependencies] wasm-bindgen-test = "0.3" diff --git a/crate/yew_styles/README.md b/crate/yew_styles/README.md new file mode 100644 index 0000000..dd35731 --- /dev/null +++ b/crate/yew_styles/README.md @@ -0,0 +1,27 @@ +# Yew Styles +Yew Styles is a style framework for yew + +## Motivation +The purpose of developing this project is first, +provide a style framework for yew because there isn't not many options currently, +also to create a layout system which is not far of the flexbox concept, and, +to take the rust benefits and implement a properties selected by enumeration +in the most of the cases which makes fast for developing applications and avoids the practice try and error + +## How it works +Each component is splited in two parts, the logical yew component and its sass module, +however, it is not necessary to worry about the sass module only it needs to be include in the project +### How install it +1. Install the sass module: `npm install yew-styles` +2. Add the yew_style crate in Cargo.toml file: `yew_styles = "0.3.0"` +3. Import the main.css file in you main javascript/typescript file project: +```typescript + import 'node_modules/yew-styles/main.css'; +``` +4. Ready to import and use in your project 🚀 +In the left side there is a list of links where each one access to a correspondent component documentation, +there, shows how to use it. + +## Development phase +Yew style is in early phase, currently doesn't have enough components to cover all the requirements that could need a website/web application. +All contributions are appreciated. \ No newline at end of file diff --git a/crate/yew_styles/src/components/layouts/container.rs b/crate/yew_styles/src/components/layouts/container.rs index 8bd2c97..cfc4dbf 100644 --- a/crate/yew_styles/src/components/layouts/container.rs +++ b/crate/yew_styles/src/components/layouts/container.rs @@ -1,4 +1,4 @@ -use crate::utils::{create_style, get_hash}; +use crate::utils::{create_style, get_random_string}; use yew::prelude::*; /// # Container component @@ -61,7 +61,7 @@ use yew::prelude::*; /// ``` pub struct Container { props: Props, - hash: String, + pub hash: String, } #[derive(Clone, Copy)] @@ -167,7 +167,7 @@ impl Component for Container { type Properties = Props; fn create(props: Self::Properties, _link: ComponentLink) -> Self { - let hash = get_hash(10); + let hash = get_random_string(10); Container { props, hash } } diff --git a/crate/yew_styles/src/components/layouts/item.rs b/crate/yew_styles/src/components/layouts/item.rs index 5f9ca71..92a8e5d 100644 --- a/crate/yew_styles/src/components/layouts/item.rs +++ b/crate/yew_styles/src/components/layouts/item.rs @@ -1,4 +1,4 @@ -use crate::utils::{create_style, get_hash}; +use crate::utils::{create_style, get_random_string}; use yew::prelude::*; /// Percent of the layout that will take the item. @@ -87,7 +87,7 @@ pub enum Msg { pub struct Item { link: ComponentLink, props: Props, - hash: String, + pub hash: String, } #[derive(Clone)] @@ -120,7 +120,7 @@ impl Component for Item { type Properties = Props; fn create(props: Self::Properties, link: ComponentLink) -> Self { - let hash = get_hash(10); + let hash = get_random_string(10); Item { link, props, hash } } diff --git a/crate/yew_styles/src/components/mod.rs b/crate/yew_styles/src/components/mod.rs index 6aa42eb..6af846b 100644 --- a/crate/yew_styles/src/components/mod.rs +++ b/crate/yew_styles/src/components/mod.rs @@ -1,4 +1,4 @@ -extern crate uuid; +extern crate getrandom; pub mod button; pub mod layouts; pub mod navbar; diff --git a/crate/yew_styles/src/components/navbar/navbar_component.rs b/crate/yew_styles/src/components/navbar/navbar_component.rs index 266da3a..c23aced 100644 --- a/crate/yew_styles/src/components/navbar/navbar_component.rs +++ b/crate/yew_styles/src/components/navbar/navbar_component.rs @@ -6,6 +6,7 @@ use crate::styles::{get_pallete, get_style, Palette, Style}; use crate::utils::create_style; use yew::prelude::*; +/// the location of the navbar which is fixed #[derive(Clone, PartialEq)] pub enum Fixed { None, @@ -17,6 +18,89 @@ pub enum Msg { TroggleMenu, } +/// # Navbar component +/// +/// ## Example +/// +/// ```rust +/// use yew::prelude::*; +/// use yew::services::ConsoleService; +/// use yew_styles::{ +/// navbar::{ +/// navbar_component::{Fixed, Navbar}, +/// navbar_container::NavbarContainer, +/// navbar_item::NavbarItem, +/// }, +/// styles::{Palette, Style}, +/// layouts::{ +/// container::{JustifyContent, Mode}, +/// }, +/// }; +/// +/// pub struct App { +/// link: ComponentLink, +/// } +/// +/// pub enum Msg { +/// ChangeMenu(String), +/// } +/// #[derive(Clone, Properties)] +/// pub struct Props {} +/// +/// impl Component for App { +/// type Message = Msg; +/// type Properties = Props; +/// +/// fn create(_props: Self::Properties, link: ComponentLink) -> Self { +/// App { +/// link +/// } +/// } +/// +/// fn update(&mut self, msg: Self::Message) -> ShouldRender { +/// match msg { +/// Msg::ChangeMenu(menu) => { +/// let mut console = ConsoleService::new(); +/// console.log(format!("{}", menu)) +/// } +/// } +/// false +/// } +/// +/// fn view(&self) -> Html { +/// html! { +/// }> +/// +/// +/// {"Home"} +/// +/// +/// {"Shop"} +/// +/// +/// {"Shop"} +/// +/// +/// {"About us"} +/// +/// +/// {"Contact"} +/// +/// +/// +/// } +/// } +/// } +/// ``` pub struct Navbar { pub link: ComponentLink, pub props: NavbarProps, @@ -27,14 +111,19 @@ struct NavbarModel; #[derive(Clone, Properties)] pub struct Props { + /// Type navbar style #[prop_or(Palette::Standard)] pub navbar_type: Palette, + /// Navbar styles #[prop_or(Style::Regular)] pub navbar_style: Style, + /// General property to add custom class styles #[prop_or_default] pub class_name: String, + /// The location of the navbar which is fixed #[prop_or(Fixed::Top)] pub fixed: Fixed, + /// Vnode embedded in the beginning of the navbar, useful to include a branch logo #[prop_or_default] pub branch: Html, pub children: Children, diff --git a/crate/yew_styles/src/components/navbar/navbar_container.rs b/crate/yew_styles/src/components/navbar/navbar_container.rs index 20dcef7..2f9e8fe 100644 --- a/crate/yew_styles/src/components/navbar/navbar_container.rs +++ b/crate/yew_styles/src/components/navbar/navbar_container.rs @@ -7,15 +7,101 @@ pub enum Msg { #[derive(Clone, Properties)] pub struct Props { + /// set how will be justified the navbar items #[prop_or(JustifyContent::FlexStart(Mode::NoMode))] pub justify_content: JustifyContent, + /// which direction are placing the navbar items #[prop_or(Direction::Row)] pub direction: Direction, pub children: Children, #[prop_or_default] + /// General property to add custom class styles pub class_name: String, } +/// # Navbar Container component +/// +/// ## Example +/// +/// ```rust +/// use yew::prelude::*; +/// use yew::services::ConsoleService; +/// use yew_styles::{ +/// navbar::{ +/// navbar_component::{Fixed, Navbar}, +/// navbar_container::NavbarContainer, +/// navbar_item::NavbarItem, +/// }, +/// styles::{Palette, Style}, +/// layouts::{ +/// container::{JustifyContent, Mode}, +/// }, +/// }; +/// +/// pub struct App { +/// link: ComponentLink, +/// } +/// +/// pub enum Msg { +/// ChangeMenu(String), +/// } +/// #[derive(Clone, Properties)] +/// pub struct Props {} +/// +/// impl Component for App { +/// type Message = Msg; +/// type Properties = Props; +/// +/// fn create(_props: Self::Properties, link: ComponentLink) -> Self { +/// App { +/// link +/// } +/// } +/// +/// fn update(&mut self, msg: Self::Message) -> ShouldRender { +/// match msg { +/// Msg::ChangeMenu(menu) => { +/// let mut console = ConsoleService::new(); +/// console.log(format!("{}", menu)) +/// } +/// } +/// false +/// } +/// +/// fn view(&self) -> Html { +/// html! { +/// }> +/// +/// +/// {"Home"} +/// +/// +/// {"Shop"} +/// +/// +/// {"Shop"} +/// +/// +/// {"About us"} +/// +/// +/// {"Contact"} +/// +/// +/// +/// } +/// } +/// } +/// ``` pub struct NavbarContainer { pub props: Props, } diff --git a/crate/yew_styles/src/components/navbar/navbar_item.rs b/crate/yew_styles/src/components/navbar/navbar_item.rs index 6e864c9..7dc3c71 100644 --- a/crate/yew_styles/src/components/navbar/navbar_item.rs +++ b/crate/yew_styles/src/components/navbar/navbar_item.rs @@ -4,6 +4,89 @@ pub enum Msg { Clicked, } +/// # Navbar Item component +/// +/// ## Example +/// +/// ```rust +/// use yew::prelude::*; +/// use yew::services::ConsoleService; +/// use yew_styles::{ +/// navbar::{ +/// navbar_component::{Fixed, Navbar}, +/// navbar_container::NavbarContainer, +/// navbar_item::NavbarItem, +/// }, +/// styles::{Palette, Style}, +/// layouts::{ +/// container::{JustifyContent, Mode}, +/// }, +/// }; +/// +/// pub struct App { +/// link: ComponentLink, +/// } +/// +/// pub enum Msg { +/// ChangeMenu(String), +/// } +/// #[derive(Clone, Properties)] +/// pub struct Props {} +/// +/// impl Component for App { +/// type Message = Msg; +/// type Properties = Props; +/// +/// fn create(_props: Self::Properties, link: ComponentLink) -> Self { +/// App { +/// link +/// } +/// } +/// +/// fn update(&mut self, msg: Self::Message) -> ShouldRender { +/// match msg { +/// Msg::ChangeMenu(menu) => { +/// let mut console = ConsoleService::new(); +/// console.log(format!("{}", menu)) +/// } +/// } +/// false +/// } +/// +/// fn view(&self) -> Html { +/// html! { +/// }> +/// +/// +/// {"Home"} +/// +/// +/// {"Shop"} +/// +/// +/// {"Shop"} +/// +/// +/// {"About us"} +/// +/// +/// {"Contact"} +/// +/// +/// +/// } +/// } +/// } +/// ``` pub struct NavbarItem { link: ComponentLink, props: Props, @@ -11,8 +94,10 @@ pub struct NavbarItem { #[derive(Clone, Properties)] pub struct Props { + /// General property to add custom class styles #[prop_or_default] pub class_name: String, + /// click event for navbar item #[prop_or(Callback::noop())] pub onsignal: Callback<()>, pub children: Children, diff --git a/crate/yew_styles/src/lib.rs b/crate/yew_styles/src/lib.rs index be7b77b..1326acc 100644 --- a/crate/yew_styles/src/lib.rs +++ b/crate/yew_styles/src/lib.rs @@ -1,3 +1,37 @@ +//! # Yew Styles +//! +//! Yew Styles is a style framework for yew +//! +//! ## Motivation +//! +//! The purpose of developing this project is first, +//! provide a style framework for yew because there isn't not many options currently, +//! also to create a layout system which is not far of the flexbox concept, and, +//! to take the rust benefits and implement a properties selected by enumeration +//! in the most of the cases which makes fast for developing applications and avoids the practice try and error +//! +//! ## How it works +//! +//! Each component is splited in two parts, the logical yew component and its sass module, +//! however, it is not necessary to worry about the sass module only it needs to be include in the project +//! +//! ### How install it +//! +//! 1. Install the sass module: `npm install yew-styles` +//! 2. Add the yew_style crate in Cargo.toml file: `yew_styles = "0.3.0"` +//! 3. Import the main.css file in you main javascript/typescript file project: +//! ```typescript +//! import 'node_modules/yew-styles/main.css'; +//! ``` +//! 4. Ready to import and use in your project 🚀 +//! +//! In the left side there is a list of links where each one access to a correspondent component documentation, +//! there, shows how to use it. +//! +//! ## Development phase +//! +//! Yew style is in early phase, currently doesn't have enough components to cover all the requirements that could need a website/web application. +//! All contributions are appreciated. #![recursion_limit = "512"] pub mod assets; mod components; diff --git a/crate/yew_styles/src/styles.rs b/crate/yew_styles/src/styles.rs index beb3a26..6a98910 100644 --- a/crate/yew_styles/src/styles.rs +++ b/crate/yew_styles/src/styles.rs @@ -1,3 +1,4 @@ +/// Palette of styles according with the purpose #[derive(Clone)] pub enum Palette { Primary, @@ -23,6 +24,7 @@ pub fn get_pallete(palette: Palette) -> String { } } +/// Standars button styles #[derive(Clone)] pub enum Style { Regular, diff --git a/crate/yew_styles/src/utils.rs b/crate/yew_styles/src/utils.rs index 9e854b7..df79f58 100644 --- a/crate/yew_styles/src/utils.rs +++ b/crate/yew_styles/src/utils.rs @@ -17,7 +17,7 @@ pub fn create_style(style: String, value: String, wrap: String) { element.style().set_property(&style, &value).unwrap(); } -pub fn get_hash(len: usize) -> String { +pub fn get_random_string(len: usize) -> String { thread_rng() .sample_iter(&Alphanumeric) .take(len) diff --git a/crate/yew_styles/tests/layouts.rs b/crate/yew_styles/tests/layouts.rs index 90cdbd5..6704d3d 100644 --- a/crate/yew_styles/tests/layouts.rs +++ b/crate/yew_styles/tests/layouts.rs @@ -16,12 +16,10 @@ fn should_create_a_container() { let props_container = PropsContainer { direction: Direction::Row, wrap: Wrap::Wrap, - index: 0, justify_content: JustifyContent::Center(Mode::NoMode), align_content: AlignContent::Center(Mode::NoMode), align_items: AlignItems::Center(Mode::NoMode), class_name: String::from("layout-test"), - name: String::from("layout-test"), children: Children::new(vec![html! {
    {"Container"}
    }]), @@ -34,7 +32,7 @@ fn should_create_a_container() { let container_vnode = container.render(); let vnode_expected = html! { -
    +
    <>
    {"Container"}
    @@ -49,9 +47,7 @@ fn should_create_item() { let props_item = PropsItem { layouts: vec![ItemLayout::ItXs(12)], align_self: AlignSelf::Center, - name: "item-test".to_string(), class_name: "item-test".to_string(), - index: 0, onsignal: Callback::noop(), children: Children::new(vec![html! {
    {"Item"}
    @@ -67,7 +63,7 @@ fn should_create_item() { let vnode_expected = html! {
    + class=format!("item item-{} it-xs-12 item-test", item.hash)> <>
    {"Item"}
    @@ -97,9 +93,7 @@ fn should_create_clickable_item() { let props_item = PropsItem { layouts: vec![ItemLayout::ItXs(12)], align_self: AlignSelf::Center, - name: "item-test".to_string(), class_name: "item-test".to_string(), - index: 0, onsignal: on_add_item_div, children: Children::new(vec![html! {
    {"Item"}
    diff --git a/crate/yew_styles/tests/utils.rs b/crate/yew_styles/tests/utils.rs index da5c4d4..2c106ed 100644 --- a/crate/yew_styles/tests/utils.rs +++ b/crate/yew_styles/tests/utils.rs @@ -1,7 +1,7 @@ use wasm_bindgen::JsCast; use wasm_bindgen_test::*; use web_sys::{window, HtmlElement}; -use yew_styles::utils::create_style; +use yew_styles::utils::{create_style, get_random_string}; wasm_bindgen_test_configure!(run_in_browser); @@ -40,3 +40,29 @@ fn should_set_style_prop() { assert_eq!(value, "10px"); } + +#[wasm_bindgen_test] +fn should_generate_random_string() { + let mut random_values: Vec = vec![]; + let mut i = 0; + loop { + random_values.push(get_random_string(10)); + i += 1; + + if i == 1000 { + break; + } + } + + let mut i = 0; + for value in &random_values { + let mut index = 0; + let repeat = &random_values.iter().any(move |random_value| { + let exist = random_value.to_string() == value.to_string() && i != index; + index += 1; + exist + }); + assert_eq!(*repeat, false); + i += 1; + } +} From c4a182fb88d05fcd19426e5e5d30ce06bae099e4 Mon Sep 17 00:00:00 2001 From: "F.J. Navarro" Date: Sun, 26 Apr 2020 00:39:06 +0200 Subject: [PATCH 14/16] implement CI (#18) --- .cargo/config | 5 + .travis.yml | 45 ++-- LICENSE-MIT => LICENSE | 2 +- LICENSE-APACHE | 201 ------------------ README.md | 10 + ci/clear_cache.sh | 23 ++ ci/run_checks.sh | 7 + crate/yew_styles/Cargo.toml | 1 - crate/yew_styles/LICENSE | 25 +++ crate/yew_styles/README.md | 1 + crate/yew_styles/src/components/button.rs | 108 ++++++++++ .../src/components/layouts/container.rs | 34 +++ .../yew_styles/src/components/layouts/item.rs | 76 +++++++ .../src/components/navbar/navbar_item.rs | 72 +++++++ crate/yew_styles/src/lib.rs | 2 +- crate/yew_styles/src/utils.rs | 65 ++++++ crate/yew_styles/tests/button.rs | 113 ---------- crate/yew_styles/tests/layouts.rs | 115 ---------- crate/yew_styles/tests/navbar.rs | 74 ------- crate/yew_styles/tests/utils.rs | 68 ------ 20 files changed, 456 insertions(+), 591 deletions(-) create mode 100644 .cargo/config rename LICENSE-MIT => LICENSE (95%) delete mode 100644 LICENSE-APACHE create mode 100755 ci/clear_cache.sh create mode 100755 ci/run_checks.sh create mode 100644 crate/yew_styles/LICENSE delete mode 100644 crate/yew_styles/tests/button.rs delete mode 100644 crate/yew_styles/tests/layouts.rs delete mode 100644 crate/yew_styles/tests/navbar.rs delete mode 100644 crate/yew_styles/tests/utils.rs diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000..8049fb7 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,5 @@ +[build] +target="wasm32-unknown-unknown" + +[target.'cfg(all(target_arch = "wasm32", not(cargo_web)))'] +runner = 'wasm-bindgen-test-runner' \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index adb24da..1adf70f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,32 @@ +branches: + only: + - development + - master + language: rust sudo: false +addons: + firefox: latest + +cache: cargo + +before_cache: + - ./ci/clear_cache.sh + +rust: + - 1.43.0 + - stable -INSTALL_NODE_VIA_NVM: &INSTALL_NODE_VIA_NVM - | - rustup target add wasm32-unknown-unknown - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash - source ~/.nvm/nvm.sh - nvm install v10.5 - matrix: - include: - # tests pass on nightly - - rust: nightly - env: JOB=test-template - install: - - *INSTALL_NODE_VIA_NVM - - cargo install wasm-pack - - npm install - script: - - npm run build + fast_finish: true + +install: + - rustup component add rustfmt + - rustup component add clippy + - rustup install stable + - rustup target add wasm32-unknown-unknown + - curl --retry 5 -LO https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz + - tar -xzf geckodriver-v0.26.0-linux64.tar.gz + +script: + - GECKODRIVER=$(pwd)/geckodriver ./ci/run_checks.sh \ No newline at end of file diff --git a/LICENSE-MIT b/LICENSE similarity index 95% rename from LICENSE-MIT rename to LICENSE index e69282e..cf246f1 100644 --- a/LICENSE-MIT +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015 The Rust Project Developers +Copyright (c) 2020 Francisco Jesus Navarro Cortes Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/LICENSE-APACHE b/LICENSE-APACHE deleted file mode 100644 index 16fe87b..0000000 --- a/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/README.md b/README.md index dd35731..5adbd3e 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,16 @@ however, it is not necessary to worry about the sass module only it needs to be In the left side there is a list of links where each one access to a correspondent component documentation, there, shows how to use it. +## Run the documentation page +Inside of the project run: + +`npm start` + +## Run the tests +Inside of the project run: + +`cargo test --target wasm32-unknown-unknown --manifest-path=crate/yew_styles/Cargo.toml` + ## Development phase Yew style is in early phase, currently doesn't have enough components to cover all the requirements that could need a website/web application. All contributions are appreciated. \ No newline at end of file diff --git a/ci/clear_cache.sh b/ci/clear_cache.sh new file mode 100755 index 0000000..4135c71 --- /dev/null +++ b/ci/clear_cache.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -x + +# inspired by https://github.com/rust-analyzer/rust-analyzer/blob/master/.travis.yml +find ./crate/yew_styles/target/debug -maxdepth 1 -type f -delete +find ./crate/yew_styles/target/tests/target/debug -maxdepth 1 -type f -delete +find ./crate/yew_styles/target/asmjs-unknown-emscripten/debug -maxdepth 1 -type f -delete +find ./crate/yew_styles/target/wasm32-unknown-emscripten/debug -maxdepth 1 -type f -delete +find ./crate/yew_styles/target/wasm32-unknown-unknown/debug -maxdepth 1 -type f -delete +rm -fr ./crate/yew_styles/target/debug/{deps,.fingerprint}/{*yew*,*\.was,*\.js*,*test*} +rm -fr ./crate/yew_styles/target/tests/target/debug/{deps,.fingerprint}/{*yew*,*\.was,*\.js*,*test*} +rm -fr ./crate/yew_styles/target/asmjs-unknown-emscripten/debug/{deps,.fingerprint}/{*yew*,*\.was,*\.js*,*test*} +rm -fr ./crate/yew_styles/target/wasm32-unknown-emscripten/debug/{deps,.fingerprint}/{*yew*,*\.was*,*\.js*,*test*} +rm -fr ./crate/yew_styles/target/wasm32-unknown-unknown/debug/{deps,.fingerprint}/{*yew*,*\.was*,*\.js*,*test*} +rm -fr ./crate/yew_styles/target/debug/incremental +rm -fr ./crate/yew_styles/target/tests/target/debug/incremental +rm -fr ./crate/yew_styles/target/asmjs-unknown-emscripten/debug/incremental +rm -fr ./crate/yew_styles/target/wasm32-unknown-emscripten/debug/incremental +rm -fr ./crate/yew_styles/target/wasm32-unknown-unknown/debug/incremental +rm -f ./crate/yew_styles/target/.rustc_info.json +rm -f ./crate/yew_styles/target/tests/target/.rustc_info.json +rm -fr ./crate/yew_styles/target/wasm32-unknown-unknown/wbg-tmp +rm -fr /home/travis/.cargo/registry/index/github.com-* \ No newline at end of file diff --git a/ci/run_checks.sh b/ci/run_checks.sh new file mode 100755 index 0000000..414a7d9 --- /dev/null +++ b/ci/run_checks.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +cargo fmt --manifest-path=crate/yew_styles/Cargo.toml --all -- --check +cargo clippy --manifest-path=crate/yew_styles/Cargo.toml --all -- --deny=warnings +cargo test --target wasm32-unknown-unknown --manifest-path=crate/yew_styles/Cargo.toml diff --git a/crate/yew_styles/Cargo.toml b/crate/yew_styles/Cargo.toml index fc36bcd..33b5c7c 100644 --- a/crate/yew_styles/Cargo.toml +++ b/crate/yew_styles/Cargo.toml @@ -19,5 +19,4 @@ yew = { version="0.14", features = ["toml", "yaml", "msgpack", "cbor", "web_sys" web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"]} rand = {version="0.7", features = ["getrandom"]} getrandom = {version = "0.1", features= ["wasm-bindgen"]} -[dev-dependencies] wasm-bindgen-test = "0.3" diff --git a/crate/yew_styles/LICENSE b/crate/yew_styles/LICENSE new file mode 100644 index 0000000..cf246f1 --- /dev/null +++ b/crate/yew_styles/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2020 Francisco Jesus Navarro Cortes + +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crate/yew_styles/README.md b/crate/yew_styles/README.md index dd35731..1590cae 100644 --- a/crate/yew_styles/README.md +++ b/crate/yew_styles/README.md @@ -11,6 +11,7 @@ in the most of the cases which makes fast for developing applications and avoids ## How it works Each component is splited in two parts, the logical yew component and its sass module, however, it is not necessary to worry about the sass module only it needs to be include in the project + ### How install it 1. Install the sass module: `npm install yew-styles` 2. Add the yew_style crate in Cargo.toml file: `yew_styles = "0.3.0"` diff --git a/crate/yew_styles/src/components/button.rs b/crate/yew_styles/src/components/button.rs index 23696cf..37ce2f5 100644 --- a/crate/yew_styles/src/components/button.rs +++ b/crate/yew_styles/src/components/button.rs @@ -1,4 +1,6 @@ use crate::styles::{get_pallete, get_style, Palette, Style}; +use wasm_bindgen_test::*; +use web_sys::window; use yew::prelude::*; /// The standard sizes for button @@ -162,3 +164,109 @@ impl Component for Button { } } } + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn should_trigger_action_when_button_clicked() { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + element.set_text_content(Some("home")); + element.set_id("menu"); + + body.append_child(&element).unwrap(); + + let onchange_name = Callback::from(|_| { + let content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("menu") + .unwrap(); + + content.set_text_content(Some("about")); + }); + + let props = Props { + class_name: String::from("test-button"), + size: Size::Medium, + button_style: Style::Regular, + onsignal: onchange_name, + button_type: Palette::Standard, + children: Children::new(vec![html! {}]), + }; + + let link = ComponentLink::new(); + + let mut button = Button::create(props.clone(), link); + + props.onsignal.emit(()); + + button.change(props); + + let updated_content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("menu") + .unwrap() + .text_content() + .unwrap(); + + assert_eq!(updated_content, String::from("about")); +} + +#[wasm_bindgen_test] +fn should_create_button_component() { + let on_add_child = Callback::from(|_| { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let child_element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + + child_element.set_text_content(Some("child")); + child_element.set_id("child"); + body.append_child(&child_element).unwrap(); + }); + + let props = Props { + class_name: String::from("test-button"), + size: Size::Medium, + button_style: Style::Regular, + onsignal: on_add_child, + button_type: Palette::Standard, + children: Children::new(vec![html! {
    {"parent"}
    }]), + }; + + let link = ComponentLink::new(); + + let mut button = Button::create(props.clone(), link.clone()); + + props.onsignal.emit(()); + + button.change(props); + + let button_vnode = button.render(); + + let vnode_expected = html! { + + }; + + assert_eq!(button_vnode, vnode_expected); +} diff --git a/crate/yew_styles/src/components/layouts/container.rs b/crate/yew_styles/src/components/layouts/container.rs index cfc4dbf..06de742 100644 --- a/crate/yew_styles/src/components/layouts/container.rs +++ b/crate/yew_styles/src/components/layouts/container.rs @@ -1,4 +1,5 @@ use crate::utils::{create_style, get_random_string}; +use wasm_bindgen_test::*; use yew::prelude::*; /// # Container component @@ -302,3 +303,36 @@ impl ContainerModel { ); } } + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn should_create_a_container() { + let props_container = Props { + direction: Direction::Row, + wrap: Wrap::Wrap, + justify_content: JustifyContent::Center(Mode::NoMode), + align_content: AlignContent::Center(Mode::NoMode), + align_items: AlignItems::Center(Mode::NoMode), + class_name: String::from("layout-test"), + children: Children::new(vec![html! { +
    {"Container"}
    + }]), + }; + + let link = ComponentLink::new(); + + let container = Container::create(props_container, link); + + let container_vnode = container.render(); + + let vnode_expected = html! { +
    + <> +
    {"Container"}
    + +
    + }; + + assert_eq!(container_vnode, vnode_expected); +} diff --git a/crate/yew_styles/src/components/layouts/item.rs b/crate/yew_styles/src/components/layouts/item.rs index 92a8e5d..a1253ff 100644 --- a/crate/yew_styles/src/components/layouts/item.rs +++ b/crate/yew_styles/src/components/layouts/item.rs @@ -1,4 +1,6 @@ use crate::utils::{create_style, get_random_string}; +use wasm_bindgen_test::*; +use web_sys::window; use yew::prelude::*; /// Percent of the layout that will take the item. @@ -208,3 +210,77 @@ impl ItemModel { create_style(String::from("align-self"), value, format!("item-{}", hash)); } } + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn should_create_item() { + let props_item = Props { + layouts: vec![ItemLayout::ItXs(12)], + align_self: AlignSelf::Center, + class_name: "item-test".to_string(), + onsignal: Callback::noop(), + children: Children::new(vec![html! { +
    {"Item"}
    + }]), + }; + + let link = ComponentLink::new(); + + let item = Item::create(props_item, link); + + let item_vnode = item.render(); + + let vnode_expected = html! { +
    + <> +
    {"Item"}
    + +
    + }; + + assert_eq!(item_vnode, vnode_expected); +} + +#[wasm_bindgen_test] +fn should_create_clickable_item() { + let on_add_item_div = Callback::from(|_| { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let child_element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + + child_element.set_text_content(Some("item2")); + child_element.set_id("item2"); + body.append_child(&child_element).unwrap(); + }); + + let props_item = Props { + layouts: vec![ItemLayout::ItXs(12)], + align_self: AlignSelf::Center, + class_name: "item-test".to_string(), + onsignal: on_add_item_div, + children: Children::new(vec![html! { +
    {"Item"}
    + }]), + }; + + props_item.onsignal.emit(()); + + let updated_content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("item2") + .unwrap() + .text_content() + .unwrap(); + + assert_eq!(updated_content, "item2".to_string()); +} diff --git a/crate/yew_styles/src/components/navbar/navbar_item.rs b/crate/yew_styles/src/components/navbar/navbar_item.rs index 7dc3c71..7238346 100644 --- a/crate/yew_styles/src/components/navbar/navbar_item.rs +++ b/crate/yew_styles/src/components/navbar/navbar_item.rs @@ -1,3 +1,5 @@ +use wasm_bindgen_test::*; +use web_sys::window; use yew::prelude::*; pub enum Msg { @@ -142,3 +144,73 @@ impl Component for NavbarItem { } } } + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn should_create_navbar_item() { + let navbar_item_props = Props { + class_name: "navbar-item-test".to_string(), + onsignal: Callback::noop(), + children: Children::new(vec![html! { +
    {"Item"}
    + }]), + }; + + let link = ComponentLink::new(); + let navbar_item = NavbarItem::create(navbar_item_props, link); + let navbar_item_vnode = navbar_item.render(); + + let vnode_expected = html! { + + }; + + assert_eq!(navbar_item_vnode, vnode_expected); +} + +#[wasm_bindgen_test] +fn should_create_clickable_navbar_item() { + let on_add_item_div = Callback::from(|_| { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let child_element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + + child_element.set_text_content(Some("item2")); + child_element.set_id("item2"); + body.append_child(&child_element).unwrap(); + }); + + let navbar_item_props = Props { + class_name: "navbar-item-test".to_string(), + onsignal: on_add_item_div, + children: Children::new(vec![html! { +
    {"Item"}
    + }]), + }; + + navbar_item_props.onsignal.emit(()); + + let updated_content = window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("item2") + .unwrap() + .text_content() + .unwrap(); + + assert_eq!(updated_content, "item2".to_string()); +} diff --git a/crate/yew_styles/src/lib.rs b/crate/yew_styles/src/lib.rs index 1326acc..0766a4b 100644 --- a/crate/yew_styles/src/lib.rs +++ b/crate/yew_styles/src/lib.rs @@ -36,6 +36,6 @@ pub mod assets; mod components; pub mod styles; -pub mod utils; +mod utils; pub use components::{button, layouts, navbar}; diff --git a/crate/yew_styles/src/utils.rs b/crate/yew_styles/src/utils.rs index df79f58..08d00c0 100644 --- a/crate/yew_styles/src/utils.rs +++ b/crate/yew_styles/src/utils.rs @@ -3,6 +3,7 @@ extern crate wasm_bindgen; extern crate web_sys; use rand::{distributions::Alphanumeric, thread_rng, Rng}; use wasm_bindgen::JsCast; +use wasm_bindgen_test::*; use web_sys::{window, HtmlElement}; pub fn create_style(style: String, value: String, wrap: String) { @@ -23,3 +24,67 @@ pub fn get_random_string(len: usize) -> String { .take(len) .collect::() } + +wasm_bindgen_test_configure!(run_in_browser); + +#[wasm_bindgen_test] +fn should_set_style_prop() { + let body = window().unwrap().document().unwrap().body().unwrap(); + + let element = window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + + element.set_text_content(Some("item")); + element.set_class_name("item"); + body.append_child(&element).unwrap(); + + create_style( + "padding".to_string(), + "10px".to_string(), + "item".to_string(), + ); + + let item = window() + .unwrap() + .document() + .unwrap() + .get_elements_by_class_name("item") + .get_with_index(0) + .unwrap() + .dyn_into::() + .unwrap(); + + let value = item.style().get_property_value("padding").unwrap(); + + assert_eq!(value, "10px"); +} + +#[wasm_bindgen_test] +fn should_generate_random_string() { + let mut random_values: Vec = vec![]; + let mut i = 0; + loop { + random_values.push(get_random_string(10)); + i += 1; + + if i == 1000 { + break; + } + } + + let mut i = 0; + for value in &random_values { + let mut index = 0; + let repeat = &random_values.iter().any(move |random_value| { + let exist = random_value == value && i != index; + index += 1; + exist + }); + assert_eq!(*repeat, false); + i += 1; + } +} diff --git a/crate/yew_styles/tests/button.rs b/crate/yew_styles/tests/button.rs deleted file mode 100644 index 1643ab6..0000000 --- a/crate/yew_styles/tests/button.rs +++ /dev/null @@ -1,113 +0,0 @@ -use wasm_bindgen_test::*; -use web_sys::window; -use yew::prelude::*; -use yew_styles::{ - button::{Button, Msg, Props, Size}, - styles::{Palette, Style}, -}; - -wasm_bindgen_test_configure!(run_in_browser); - -#[wasm_bindgen_test] -fn should_trigger_action_when_button_clicked() { - let body = window().unwrap().document().unwrap().body().unwrap(); - - let element = window() - .unwrap() - .document() - .unwrap() - .create_element("div") - .unwrap(); - element.set_text_content(Some("home")); - element.set_id("menu"); - - body.append_child(&element).unwrap(); - - let onchange_name = Callback::from(|_| { - let content = window() - .unwrap() - .document() - .unwrap() - .get_element_by_id("menu") - .unwrap(); - - content.set_text_content(Some("about")); - }); - - let props = Props { - class_name: String::from("test-button"), - size: Size::Medium, - button_style: Style::Regular, - onsignal: onchange_name, - button_type: Palette::Standard, - children: Children::new(vec![html! {}]), - }; - - let link = ComponentLink::new(); - - let mut button = Button::create(props.clone(), link); - - props.onsignal.emit(()); - - button.change(props); - - let updated_content = window() - .unwrap() - .document() - .unwrap() - .get_element_by_id("menu") - .unwrap() - .text_content() - .unwrap(); - - assert_eq!(updated_content, String::from("about")); -} - -#[wasm_bindgen_test] -fn should_create_button_component() { - let on_add_child = Callback::from(|_| { - let body = window().unwrap().document().unwrap().body().unwrap(); - - let child_element = window() - .unwrap() - .document() - .unwrap() - .create_element("div") - .unwrap(); - - child_element.set_text_content(Some("child")); - child_element.set_id("child"); - body.append_child(&child_element).unwrap(); - }); - - let props = Props { - class_name: String::from("test-button"), - size: Size::Medium, - button_style: Style::Regular, - onsignal: on_add_child.clone(), - button_type: Palette::Standard, - children: Children::new(vec![html! {
    {"parent"}
    }]), - }; - - let link = ComponentLink::new(); - - let mut button = Button::create(props.clone(), link.clone()); - - props.onsignal.emit(()); - - button.change(props); - - let button_vnode = button.render(); - - let vnode_expected = html! { - - }; - - assert_eq!(button_vnode, vnode_expected); -} diff --git a/crate/yew_styles/tests/layouts.rs b/crate/yew_styles/tests/layouts.rs deleted file mode 100644 index 6704d3d..0000000 --- a/crate/yew_styles/tests/layouts.rs +++ /dev/null @@ -1,115 +0,0 @@ -use wasm_bindgen_test::*; -use web_sys::window; -use yew::prelude::*; -use yew_styles::layouts::{ - container::{ - AlignContent, AlignItems, Container, Direction, JustifyContent, Mode, - Props as PropsContainer, Wrap, - }, - item::{AlignSelf, Item, ItemLayout, Props as PropsItem}, -}; - -wasm_bindgen_test_configure!(run_in_browser); - -#[wasm_bindgen_test] -fn should_create_a_container() { - let props_container = PropsContainer { - direction: Direction::Row, - wrap: Wrap::Wrap, - justify_content: JustifyContent::Center(Mode::NoMode), - align_content: AlignContent::Center(Mode::NoMode), - align_items: AlignItems::Center(Mode::NoMode), - class_name: String::from("layout-test"), - children: Children::new(vec![html! { -
    {"Container"}
    - }]), - }; - - let link = ComponentLink::new(); - - let container = Container::create(props_container, link.clone()); - - let container_vnode = container.render(); - - let vnode_expected = html! { -
    - <> -
    {"Container"}
    - -
    - }; - - assert_eq!(container_vnode, vnode_expected); -} - -#[wasm_bindgen_test] -fn should_create_item() { - let props_item = PropsItem { - layouts: vec![ItemLayout::ItXs(12)], - align_self: AlignSelf::Center, - class_name: "item-test".to_string(), - onsignal: Callback::noop(), - children: Children::new(vec![html! { -
    {"Item"}
    - }]), - }; - - let link = ComponentLink::new(); - - let item = Item::create(props_item, link.clone()); - - let item_vnode = item.render(); - - let vnode_expected = html! { -
    - <> -
    {"Item"}
    - -
    - }; - - assert_eq!(item_vnode, vnode_expected); -} - -#[wasm_bindgen_test] -fn should_create_clickable_item() { - let on_add_item_div = Callback::from(|_| { - let body = window().unwrap().document().unwrap().body().unwrap(); - - let child_element = window() - .unwrap() - .document() - .unwrap() - .create_element("div") - .unwrap(); - - child_element.set_text_content(Some("item2")); - child_element.set_id("item2"); - body.append_child(&child_element).unwrap(); - }); - - let props_item = PropsItem { - layouts: vec![ItemLayout::ItXs(12)], - align_self: AlignSelf::Center, - class_name: "item-test".to_string(), - onsignal: on_add_item_div, - children: Children::new(vec![html! { -
    {"Item"}
    - }]), - }; - - props_item.onsignal.emit(()); - - let updated_content = window() - .unwrap() - .document() - .unwrap() - .get_element_by_id("item2") - .unwrap() - .text_content() - .unwrap(); - - assert_eq!(updated_content, "item2".to_string()); -} diff --git a/crate/yew_styles/tests/navbar.rs b/crate/yew_styles/tests/navbar.rs deleted file mode 100644 index 6c839ee..0000000 --- a/crate/yew_styles/tests/navbar.rs +++ /dev/null @@ -1,74 +0,0 @@ -use wasm_bindgen_test::*; -use web_sys::window; -use yew::prelude::*; -use yew_styles::navbar::navbar_item::{NavbarItem, Props}; - -wasm_bindgen_test_configure!(run_in_browser); - -#[wasm_bindgen_test] -fn should_create_navbar_item() { - let navbar_item_props = Props { - class_name: "navbar-item-test".to_string(), - onsignal: Callback::noop(), - children: Children::new(vec![html! { -
    {"Item"}
    - }]), - }; - - let link = ComponentLink::new(); - let navbar_item = NavbarItem::create(navbar_item_props, link.clone()); - let navbar_item_vnode = navbar_item.render(); - - let vnode_expected = html! { - - }; - - assert_eq!(navbar_item_vnode, vnode_expected); -} - -#[wasm_bindgen_test] -fn should_create_clickable_navbar_item() { - let on_add_item_div = Callback::from(|_| { - let body = window().unwrap().document().unwrap().body().unwrap(); - - let child_element = window() - .unwrap() - .document() - .unwrap() - .create_element("div") - .unwrap(); - - child_element.set_text_content(Some("item2")); - child_element.set_id("item2"); - body.append_child(&child_element).unwrap(); - }); - - let navbar_item_props = Props { - class_name: "navbar-item-test".to_string(), - onsignal: on_add_item_div, - children: Children::new(vec![html! { -
    {"Item"}
    - }]), - }; - - navbar_item_props.onsignal.emit(()); - - let updated_content = window() - .unwrap() - .document() - .unwrap() - .get_element_by_id("item2") - .unwrap() - .text_content() - .unwrap(); - - assert_eq!(updated_content, "item2".to_string()); -} diff --git a/crate/yew_styles/tests/utils.rs b/crate/yew_styles/tests/utils.rs deleted file mode 100644 index 2c106ed..0000000 --- a/crate/yew_styles/tests/utils.rs +++ /dev/null @@ -1,68 +0,0 @@ -use wasm_bindgen::JsCast; -use wasm_bindgen_test::*; -use web_sys::{window, HtmlElement}; -use yew_styles::utils::{create_style, get_random_string}; - -wasm_bindgen_test_configure!(run_in_browser); - -#[wasm_bindgen_test] -fn should_set_style_prop() { - let body = window().unwrap().document().unwrap().body().unwrap(); - - let element = window() - .unwrap() - .document() - .unwrap() - .create_element("div") - .unwrap(); - - element.set_text_content(Some("item")); - element.set_class_name("item"); - body.append_child(&element).unwrap(); - - create_style( - "padding".to_string(), - "10px".to_string(), - "item".to_string(), - ); - - let item = window() - .unwrap() - .document() - .unwrap() - .get_elements_by_class_name("item") - .get_with_index(0) - .unwrap() - .dyn_into::() - .unwrap(); - - let value = item.style().get_property_value("padding").unwrap(); - - assert_eq!(value, "10px"); -} - -#[wasm_bindgen_test] -fn should_generate_random_string() { - let mut random_values: Vec = vec![]; - let mut i = 0; - loop { - random_values.push(get_random_string(10)); - i += 1; - - if i == 1000 { - break; - } - } - - let mut i = 0; - for value in &random_values { - let mut index = 0; - let repeat = &random_values.iter().any(move |random_value| { - let exist = random_value.to_string() == value.to_string() && i != index; - index += 1; - exist - }); - assert_eq!(*repeat, false); - i += 1; - } -} From 1842cdfa4b4859e61020c765f8ee9ce0c9ac2eaa Mon Sep 17 00:00:00 2001 From: "F.J. Navarro" Date: Wed, 29 Apr 2020 00:23:28 +0200 Subject: [PATCH 15/16] Update yew new version (#19) --- .github/workflows/rust.yml | 31 ++++++++ .travis.yml | 32 -------- README.md | 15 ++-- app/page-styles/_app.sass | 5 +- ci/clear_cache.sh | 23 ------ ci/run_checks.sh | 2 +- crate/.cargo/config | 2 +- crate/Cargo.lock | 76 +++++++++++++------ crate/Cargo.toml | 8 +- crate/src/app.rs | 6 +- crate/src/page/button_page.rs | 4 + crate/src/page/home_page.rs | 4 + crate/src/page/layouts_page.rs | 6 +- crate/src/page/navbar_page.rs | 4 + crate/yew_styles/Cargo.lock | 12 +-- crate/yew_styles/Cargo.toml | 3 +- crate/yew_styles/README.md | 2 - crate/yew_styles/src/assets.rs | 4 + crate/yew_styles/src/components/button.rs | 6 +- .../src/components/layouts/container.rs | 49 ++++++------ .../yew_styles/src/components/layouts/item.rs | 35 +++++---- .../src/components/navbar/navbar_component.rs | 22 +++--- .../src/components/navbar/navbar_container.rs | 8 ++ .../src/components/navbar/navbar_item.rs | 10 +-- crate/yew_styles/src/lib.rs | 3 - package.json | 6 +- 26 files changed, 215 insertions(+), 163 deletions(-) create mode 100644 .github/workflows/rust.yml delete mode 100644 .travis.yml delete mode 100755 ci/clear_cache.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..59b5a86 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,31 @@ +name: Yew Styles + +on: + pull_request: + branches: [ master, development ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: wasm-pack + uses: jetli/wasm-pack-action@v0.3.0 + with: + version: 'latest' + - name: install rustfmt + run: rustup component add rustfmt + - name: install clippy + run: rustup component add clippy + - name: install stable + run: rustup install stable + - name: add wasm32-unknown-unknown + run: rustup target add wasm32-unknown-unknown + - name: download geckodriver + run: curl --retry 5 -LO https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz + - name: uncompress geckodriver + run: tar -xzf geckodriver-v0.26.0-linux64.tar.gz + - name: execute CI + run: GECKODRIVER=$(pwd)/geckodriver ./ci/run_checks.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1adf70f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -branches: - only: - - development - - master - -language: rust -sudo: false -addons: - firefox: latest - -cache: cargo - -before_cache: - - ./ci/clear_cache.sh - -rust: - - 1.43.0 - - stable - -matrix: - fast_finish: true - -install: - - rustup component add rustfmt - - rustup component add clippy - - rustup install stable - - rustup target add wasm32-unknown-unknown - - curl --retry 5 -LO https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz - - tar -xzf geckodriver-v0.26.0-linux64.tar.gz - -script: - - GECKODRIVER=$(pwd)/geckodriver ./ci/run_checks.sh \ No newline at end of file diff --git a/README.md b/README.md index 5adbd3e..1373cc9 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,14 @@ however, it is not necessary to worry about the sass module only it needs to be import 'node_modules/yew-styles/main.css'; ``` 4. Ready to import and use in your project 🚀 -In the left side there is a list of links where each one access to a correspondent component documentation, -there, shows how to use it. ## Run the documentation page -Inside of the project run: +1. `git clone https://github.com/spielrs/yew_styles.git` +2. `cd yew_styles` +3. `npm start` -`npm start` +In the left side there is a list of links where each one access to a correspondent component documentation, +there, shows how to use it. ## Run the tests Inside of the project run: @@ -34,4 +35,8 @@ Inside of the project run: ## Development phase Yew style is in early phase, currently doesn't have enough components to cover all the requirements that could need a website/web application. -All contributions are appreciated. \ No newline at end of file +All contributions are appreciated. + +## License + +Yew Style is MIT licensed. See [license](LICENSE) \ No newline at end of file diff --git a/app/page-styles/_app.sass b/app/page-styles/_app.sass index 7b0eb6b..643ee32 100644 --- a/app/page-styles/_app.sass +++ b/app/page-styles/_app.sass @@ -8,4 +8,7 @@ &:hover background-color: rgb(230, 236, 241) - \ No newline at end of file +.container + .item + code + font-size: 1vw \ No newline at end of file diff --git a/ci/clear_cache.sh b/ci/clear_cache.sh deleted file mode 100755 index 4135c71..0000000 --- a/ci/clear_cache.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -set -x - -# inspired by https://github.com/rust-analyzer/rust-analyzer/blob/master/.travis.yml -find ./crate/yew_styles/target/debug -maxdepth 1 -type f -delete -find ./crate/yew_styles/target/tests/target/debug -maxdepth 1 -type f -delete -find ./crate/yew_styles/target/asmjs-unknown-emscripten/debug -maxdepth 1 -type f -delete -find ./crate/yew_styles/target/wasm32-unknown-emscripten/debug -maxdepth 1 -type f -delete -find ./crate/yew_styles/target/wasm32-unknown-unknown/debug -maxdepth 1 -type f -delete -rm -fr ./crate/yew_styles/target/debug/{deps,.fingerprint}/{*yew*,*\.was,*\.js*,*test*} -rm -fr ./crate/yew_styles/target/tests/target/debug/{deps,.fingerprint}/{*yew*,*\.was,*\.js*,*test*} -rm -fr ./crate/yew_styles/target/asmjs-unknown-emscripten/debug/{deps,.fingerprint}/{*yew*,*\.was,*\.js*,*test*} -rm -fr ./crate/yew_styles/target/wasm32-unknown-emscripten/debug/{deps,.fingerprint}/{*yew*,*\.was*,*\.js*,*test*} -rm -fr ./crate/yew_styles/target/wasm32-unknown-unknown/debug/{deps,.fingerprint}/{*yew*,*\.was*,*\.js*,*test*} -rm -fr ./crate/yew_styles/target/debug/incremental -rm -fr ./crate/yew_styles/target/tests/target/debug/incremental -rm -fr ./crate/yew_styles/target/asmjs-unknown-emscripten/debug/incremental -rm -fr ./crate/yew_styles/target/wasm32-unknown-emscripten/debug/incremental -rm -fr ./crate/yew_styles/target/wasm32-unknown-unknown/debug/incremental -rm -f ./crate/yew_styles/target/.rustc_info.json -rm -f ./crate/yew_styles/target/tests/target/.rustc_info.json -rm -fr ./crate/yew_styles/target/wasm32-unknown-unknown/wbg-tmp -rm -fr /home/travis/.cargo/registry/index/github.com-* \ No newline at end of file diff --git a/ci/run_checks.sh b/ci/run_checks.sh index 414a7d9..dab724c 100755 --- a/ci/run_checks.sh +++ b/ci/run_checks.sh @@ -4,4 +4,4 @@ set -euxo pipefail cargo fmt --manifest-path=crate/yew_styles/Cargo.toml --all -- --check cargo clippy --manifest-path=crate/yew_styles/Cargo.toml --all -- --deny=warnings -cargo test --target wasm32-unknown-unknown --manifest-path=crate/yew_styles/Cargo.toml +wasm-pack test --headless --firefox crate/yew_styles diff --git a/crate/.cargo/config b/crate/.cargo/config index 91cd80c..042e360 100644 --- a/crate/.cargo/config +++ b/crate/.cargo/config @@ -1,2 +1,2 @@ [build] -target="wasm32-unknown-unknown" \ No newline at end of file +target="wasm32-unknown-unknown" diff --git a/crate/Cargo.lock b/crate/Cargo.lock index d5318b2..39532c4 100644 --- a/crate/Cargo.lock +++ b/crate/Cargo.lock @@ -492,6 +492,11 @@ name = "ryu" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "semver" version = "0.9.0" @@ -685,6 +690,28 @@ name = "wasm-bindgen-shared" version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wasm-bindgen-test" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", + "scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-futures 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test-macro 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasm-bindgen-test-macro" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "web-sys" version = "0.3.36" @@ -734,7 +761,7 @@ dependencies = [ [[package]] name = "yew" -version = "0.14.3" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "anyhow 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)", @@ -763,12 +790,12 @@ dependencies = [ "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-futures 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-macro 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", + "yew-macro 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "yew-macro" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "boolinator 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -781,7 +808,7 @@ dependencies = [ [[package]] name = "yew-router" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -794,25 +821,25 @@ dependencies = [ "serde_json 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-router-macro 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-router-route-parser 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "yew 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "yew-router-macro 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "yew-router-route-parser 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "yew-router-macro" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-router-route-parser 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "yew-router-route-parser 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "yew-router-route-parser" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "nom 5.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -820,12 +847,13 @@ dependencies = [ [[package]] name = "yew_prism" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", + "yew 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -841,9 +869,9 @@ dependencies = [ "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", "wee_alloc 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-router 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "yew_prism 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "yew 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "yew-router 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "yew_prism 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "yew_styles 0.3.0", ] @@ -854,8 +882,9 @@ dependencies = [ "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-test 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", + "yew 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] @@ -924,6 +953,7 @@ dependencies = [ "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +"checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" @@ -947,15 +977,17 @@ dependencies = [ "checksum wasm-bindgen-macro 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "8bd151b63e1ea881bb742cd20e1d6127cef28399558f3b5d415289bc41eee3a4" "checksum wasm-bindgen-macro-support 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d68a5b36eef1be7868f668632863292e37739656a80fc4b9acec7b0bd35a4931" "checksum wasm-bindgen-shared 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639" +"checksum wasm-bindgen-test 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "98fd0ec352c44d1726b6c2bec524612b1c81e34a7d858f597a6c71f8e018c82e" +"checksum wasm-bindgen-test-macro 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "97837a6e83ab24a4b3a38d44a257e13335b54f4b4548b2c9d71edd0bf570cb4f" "checksum web-sys 0.3.36 (registry+https://github.com/rust-lang/crates.io-index)" = "721c6263e2c66fd44501cc5efbfa2b7dfa775d13e4ea38c46299646ed1f9c70a" "checksum wee_alloc 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" "checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" -"checksum yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e48bc6b264e30362e5d420cd6aa2cd24dd4c9131284bc24afc0a41c28c125f3" -"checksum yew-macro 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "074c652331c32cf6431b0c5c4b6cb6fbb2168a1be6022e51b32c95fefb70153c" -"checksum yew-router 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "19145953cfaa35cbd26a06ef5f589553d8e16d2a8d889d9c3e74516617ea7db8" -"checksum yew-router-macro 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e2b24468a3ea4ac70f2c46f6ca07a80b2cbb14eb725a16bc74eb5d759fbb3e7" -"checksum yew-router-route-parser 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6801d6eb8583313fb33f20b141627c51881d24225e8de1660571e971f268d8" -"checksum yew_prism 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd106672abd15d82f60486abaafcde1491c33ee5f3fcd138cb7429edf449850e" +"checksum yew 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7532a83ec6c2173cd72888bb3ac0e3656d0dd152476f71631f4b465481855391" +"checksum yew-macro 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28cf0535e956932124a66721a0f91a1f65a1654ab509c43c3b5d71eb10f20089" +"checksum yew-router 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "30c14c320554af8f6c9412606daca46e9fdac686b6be6f3563e7f4073c628f8e" +"checksum yew-router-macro 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88820ce667e8b1b17750c2294e69dc93932bdcfd76a7fec5b7b573131f3421c1" +"checksum yew-router-route-parser 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c4708315d2325182b9c3d8c9805e4f5293baf6e6103f9cd4f989ddedca192a" +"checksum yew_prism 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "18729acde7cdb3dea9acb4ef2e3610035f69c2795d0172f8def81718a85199de" diff --git a/crate/Cargo.toml b/crate/Cargo.toml index 7ee6e6e..afd438e 100644 --- a/crate/Cargo.toml +++ b/crate/Cargo.toml @@ -2,7 +2,7 @@ authors = ["The RustWasm Developers"] categories = ["wasm"] description = "My awesome Yew with Yew-Router and Parcel application!" -license = "Apache-2.0/MIT" +license = "MIT" name = "yew_style_page" readme = "./README.md" repository = "https://github.com/spielrs/yew-styles-page.git" @@ -20,8 +20,8 @@ serde = "1.0" serde_derive = "1.0" dotenv = "0.15" failure = "0.1" -yew = { version="0.14", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"]} -yew-router = {version = "0.11", features = ["web_sys"] } +yew = { version="0.15", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"]} +yew-router = {version="0.12", features = ["web_sys"] } web-sys = "0.3" -yew_prism = "0.1" +yew_prism = {version="0.2"} yew_styles= {path= "./yew_styles"} diff --git a/crate/src/app.rs b/crate/src/app.rs index f22ee48..0cb1318 100644 --- a/crate/src/app.rs +++ b/crate/src/app.rs @@ -31,7 +31,11 @@ impl Component for App { } fn update(&mut self, _: Self::Message) -> ShouldRender { - true + false + } + + fn change(&mut self, _props: Self::Properties) -> ShouldRender { + false } fn view(&self) -> Html { diff --git a/crate/src/page/button_page.rs b/crate/src/page/button_page.rs index f8a3f57..2fc1143 100644 --- a/crate/src/page/button_page.rs +++ b/crate/src/page/button_page.rs @@ -39,6 +39,10 @@ impl Component for ButtonPage { true } + fn change(&mut self, _props: Self::Properties) -> ShouldRender { + false + } + fn view(&self) -> Html { html! { <> diff --git a/crate/src/page/home_page.rs b/crate/src/page/home_page.rs index 76ece95..d7e7eeb 100644 --- a/crate/src/page/home_page.rs +++ b/crate/src/page/home_page.rs @@ -18,6 +18,10 @@ impl Component for HomePage { false } + fn change(&mut self, _props: Self::Properties) -> ShouldRender { + false + } + fn view(&self) -> Html { html! { ShouldRender { - true + false + } + + fn change(&mut self, _props: Self::Properties) -> ShouldRender { + false } fn view(&self) -> Html { diff --git a/crate/src/page/navbar_page.rs b/crate/src/page/navbar_page.rs index 517f5bd..f942589 100644 --- a/crate/src/page/navbar_page.rs +++ b/crate/src/page/navbar_page.rs @@ -53,6 +53,10 @@ impl Component for NavbarPage { } } + fn change(&mut self, _props: Self::Properties) -> ShouldRender { + false + } + fn update(&mut self, msg: Self::Message) -> ShouldRender { match msg { Msg::ChangeType(index, navbar_menu) => { diff --git a/crate/yew_styles/Cargo.lock b/crate/yew_styles/Cargo.lock index 1dca82f..c8b0c70 100644 --- a/crate/yew_styles/Cargo.lock +++ b/crate/yew_styles/Cargo.lock @@ -589,7 +589,7 @@ dependencies = [ [[package]] name = "yew" -version = "0.14.3" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "anyhow 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -618,12 +618,12 @@ dependencies = [ "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-futures 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", - "yew-macro 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", + "yew-macro 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "yew-macro" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "boolinator 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -643,7 +643,7 @@ dependencies = [ "wasm-bindgen 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-test 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)", - "yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)", + "yew 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] @@ -722,5 +722,5 @@ dependencies = [ "checksum wasm-bindgen-test-macro 0.3.10 (registry+https://github.com/rust-lang/crates.io-index)" = "cf2f86cd78a2aa7b1fb4bb6ed854eccb7f9263089c79542dca1576a1518a8467" "checksum web-sys 0.3.37 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6f51648d8c56c366144378a33290049eafdd784071077f6fe37dae64c1c4cb" "checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" -"checksum yew 0.14.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e48bc6b264e30362e5d420cd6aa2cd24dd4c9131284bc24afc0a41c28c125f3" -"checksum yew-macro 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "074c652331c32cf6431b0c5c4b6cb6fbb2168a1be6022e51b32c95fefb70153c" +"checksum yew 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7532a83ec6c2173cd72888bb3ac0e3656d0dd152476f71631f4b465481855391" +"checksum yew-macro 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28cf0535e956932124a66721a0f91a1f65a1654ab509c43c3b5d71eb10f20089" diff --git a/crate/yew_styles/Cargo.toml b/crate/yew_styles/Cargo.toml index 33b5c7c..488c432 100644 --- a/crate/yew_styles/Cargo.toml +++ b/crate/yew_styles/Cargo.toml @@ -7,6 +7,7 @@ authors = ["Francisco Jesus Navarro Cortes "] edition = "2018" license = "MIT" repository = "https://github.com/spielrs/yew-styles-page/tree/master/crate/yew_styles" +readme = "README.md" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -15,7 +16,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] wasm-bindgen = "0.2.60" -yew = { version="0.14", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"] } +yew = { version="0.15", features = ["toml", "yaml", "msgpack", "cbor", "web_sys"] } web-sys = {version = "0.3.36", features = ["HtmlDocument", "HtmlCollection", "CssStyleDeclaration", "HtmlElement", "Node"]} rand = {version="0.7", features = ["getrandom"]} getrandom = {version = "0.1", features= ["wasm-bindgen"]} diff --git a/crate/yew_styles/README.md b/crate/yew_styles/README.md index 1590cae..f52007b 100644 --- a/crate/yew_styles/README.md +++ b/crate/yew_styles/README.md @@ -20,8 +20,6 @@ however, it is not necessary to worry about the sass module only it needs to be import 'node_modules/yew-styles/main.css'; ``` 4. Ready to import and use in your project 🚀 -In the left side there is a list of links where each one access to a correspondent component documentation, -there, shows how to use it. ## Development phase Yew style is in early phase, currently doesn't have enough components to cover all the requirements that could need a website/web application. diff --git a/crate/yew_styles/src/assets.rs b/crate/yew_styles/src/assets.rs index e6bf85a..9829e3c 100644 --- a/crate/yew_styles/src/assets.rs +++ b/crate/yew_styles/src/assets.rs @@ -30,6 +30,10 @@ impl Component for Assets { false } + fn change(&mut self, _props: Self::Properties) -> ShouldRender { + false + } + fn view(&self) -> Html { get_icon(self.props.asset.clone(), self.props.class_name.clone()) } diff --git a/crate/yew_styles/src/components/button.rs b/crate/yew_styles/src/components/button.rs index 37ce2f5..6e75030 100644 --- a/crate/yew_styles/src/components/button.rs +++ b/crate/yew_styles/src/components/button.rs @@ -53,6 +53,10 @@ pub enum Size { /// false /// } /// +/// fn change(&mut self, _props: Self::Properties) -> ShouldRender { +/// false +/// } +/// /// fn view(&self) -> Html { /// html! { ///