generated from ElnuDev/rust-project
dyesub-tool: leptos 0.4.8 -> 0.5.0-beta
This commit is contained in:
parent
c8969adee2
commit
79ac6ac9b0
7 changed files with 39 additions and 41 deletions
40
Cargo.lock
generated
40
Cargo.lock
generated
|
@ -1008,9 +1008,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos"
|
name = "leptos"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2d08fd7674758f996050217a8aff9e584d033c2e5c882cd3f52fb5090dc361dd"
|
checksum = "f6905045d7c9ed459f7761859e82960e52549bcd39f1d756640ccd4943e9a702"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"leptos_config",
|
"leptos_config",
|
||||||
|
@ -1025,9 +1025,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_config"
|
name = "leptos_config"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1e5c13a1ae92b5a545cc013205288751fb2fef521de5a092067fd8429ad343e8"
|
checksum = "1db9792d1e5c3be1090ce96da436cffaf83febb7eb58087565283e87f2efafab"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"config",
|
"config",
|
||||||
"regex",
|
"regex",
|
||||||
|
@ -1038,9 +1038,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_dom"
|
name = "leptos_dom"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "35994afab1dca68a46c7b40a29d40d84a2e06e1b1fa0d5c5915ade4f4f2611ee"
|
checksum = "bc51de6faa61807da1e3ede5f7b77fc523323fa027f0e6d50868c1a2bd82508e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-recursion",
|
"async-recursion",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
@ -1068,9 +1068,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_hot_reload"
|
name = "leptos_hot_reload"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2a088a4dd5489941a9cc73719148f217c78f0d761a50e025739653c3b7f9d484"
|
checksum = "f0016ea39f34998122c125582832c88eb4e373461c75374b23f5e2f1bb5dc9e3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"camino",
|
"camino",
|
||||||
|
@ -1086,9 +1086,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_macro"
|
name = "leptos_macro"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0bdd7a21d20ca21bb12d67d050d4b0ad9973b156bce98f499f8b1789f11959dd"
|
checksum = "34f5ed09f4eed18fe3641b89e94cb3c67e80b30b21231fba626059bf741e81d6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"attribute-derive",
|
"attribute-derive",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
@ -1109,9 +1109,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_reactive"
|
name = "leptos_reactive"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5a5500318e457b4ab841722a5988e8db0def1ee7ac66b816ba9073c100c4984a"
|
checksum = "e0820be045a1fbfbef25d8254cbac41420acaca7598b4278335ed01d91d9612c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.2",
|
"base64 0.21.2",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
|
@ -1133,9 +1133,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "leptos_server"
|
name = "leptos_server"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a28d958deee3c7ffda892a67ac4a47500aebbaf00b11d217cfe6fd494c297818"
|
checksum = "bb64816036984a6dc5f55336bed41a8a1376cb604e824c3b3588fd751f086df0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"inventory",
|
"inventory",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
|
@ -1806,9 +1806,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server_fn"
|
name = "server_fn"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "644216cf54c944da2d7fc7a75337a35dc39de19130be3fd88fd58674719a1b5b"
|
checksum = "eb6bab18d064306dd6a2bfb37ab26f4ab343903a83c6f08b77fd8c72e6d8b853"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ciborium",
|
"ciborium",
|
||||||
"const_format",
|
"const_format",
|
||||||
|
@ -1830,9 +1830,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server_fn_macro"
|
name = "server_fn_macro"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1db2cd1a054f5c6ec168982241f6cdad083591d6c68449e666c839ec421bfc54"
|
checksum = "3a708788598b6d7f8e764e88903ed24ae48d98dc2d7a8acaacac6f7770f46956"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const_format",
|
"const_format",
|
||||||
"proc-macro-error",
|
"proc-macro-error",
|
||||||
|
@ -1845,9 +1845,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server_fn_macro_default"
|
name = "server_fn_macro_default"
|
||||||
version = "0.4.8"
|
version = "0.5.0-beta"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "35ee7b18c66e7a30b1855096cee24d540925825ce91193f42fae322033b109c1"
|
checksum = "8d419921b81515dc593fd2d2f48ca687e354ca92944379b89b221eb6be9dccd6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"server_fn_macro",
|
"server_fn_macro",
|
||||||
"syn 2.0.28",
|
"syn 2.0.28",
|
||||||
|
|
|
@ -8,7 +8,7 @@ svg-units = { path = "../svg-units" }
|
||||||
class_list = "0.1.1"
|
class_list = "0.1.1"
|
||||||
kle-serial = "0.2.2"
|
kle-serial = "0.2.2"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
leptos = { version = "0.4.8", features = ["csr", "nightly"] }
|
leptos = { version = "0.5.0-beta", features = ["csr", "nightly"] }
|
||||||
serde_json = "1.0.105"
|
serde_json = "1.0.105"
|
||||||
strum = "0.25.0"
|
strum = "0.25.0"
|
||||||
strum_macros = "0.25.2"
|
strum_macros = "0.25.2"
|
||||||
|
|
|
@ -10,12 +10,11 @@ use crate::{
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn KeyboardFromFile(
|
pub fn KeyboardFromFile(
|
||||||
cx: Scope,
|
|
||||||
set_keyboard: WriteSignal<Option<kle_serial::Keyboard>>,
|
set_keyboard: WriteSignal<Option<kle_serial::Keyboard>>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
let file_input = create_node_ref::<Input>(cx);
|
let file_input = create_node_ref::<Input>();
|
||||||
let (file, set_file) = create_signal(cx, Option::<File>::None);
|
let (file, set_file) = create_signal(Option::<File>::None);
|
||||||
let (result_message, set_result_message) = create_signal(cx, Option::<ResultMessageData>::None);
|
let (result_message, set_result_message) = create_signal(Option::<ResultMessageData>::None);
|
||||||
let on_submit = move || {
|
let on_submit = move || {
|
||||||
spawn_local(async move {
|
spawn_local(async move {
|
||||||
match read_kle_from_file(file).await {
|
match read_kle_from_file(file).await {
|
||||||
|
@ -40,7 +39,7 @@ pub fn KeyboardFromFile(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
view! { cx,
|
view! {
|
||||||
<h3>"Load KLE JSON from file"</h3>
|
<h3>"Load KLE JSON from file"</h3>
|
||||||
<ResultMessage message=result_message />
|
<ResultMessage message=result_message />
|
||||||
<input
|
<input
|
||||||
|
|
|
@ -13,11 +13,10 @@ async fn fetch_layout(url: &str) -> Result<kle_serial::Keyboard, FetchKleError>
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn KeyboardFromWeb(
|
pub fn KeyboardFromWeb(
|
||||||
cx: Scope,
|
|
||||||
set_keyboard: WriteSignal<Option<kle_serial::Keyboard>>,
|
set_keyboard: WriteSignal<Option<kle_serial::Keyboard>>,
|
||||||
) -> impl IntoView {
|
) -> impl IntoView {
|
||||||
let (result_message, set_result_message) = create_signal(cx, Option::<ResultMessageData>::None);
|
let (result_message, set_result_message) = create_signal(Option::<ResultMessageData>::None);
|
||||||
let input_element: NodeRef<Input> = create_node_ref(cx);
|
let input_element: NodeRef<Input> = create_node_ref();
|
||||||
let on_submit = move |e: SubmitEvent| {
|
let on_submit = move |e: SubmitEvent| {
|
||||||
e.prevent_default();
|
e.prevent_default();
|
||||||
spawn_local(async move {
|
spawn_local(async move {
|
||||||
|
@ -44,7 +43,7 @@ pub fn KeyboardFromWeb(
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
view! { cx,
|
view! {
|
||||||
<h3>"Load KLE JSON from web"</h3>
|
<h3>"Load KLE JSON from web"</h3>
|
||||||
<ResultMessage message=result_message />
|
<ResultMessage message=result_message />
|
||||||
<form class="f-row align-items:center" on:submit=on_submit>
|
<form class="f-row align-items:center" on:submit=on_submit>
|
||||||
|
|
|
@ -25,16 +25,16 @@ impl From<Box<dyn Error>> for ResultMessageData {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn ResultMessage(cx: Scope, message: ReadSignal<Option<ResultMessageData>>) -> impl IntoView {
|
pub fn ResultMessage(message: ReadSignal<Option<ResultMessageData>>) -> impl IntoView {
|
||||||
let (open, set_open) = create_signal(cx, true);
|
let (open, set_open) = create_signal(true);
|
||||||
create_effect(cx, move |_| {
|
create_effect(move |_| {
|
||||||
message.track();
|
message.track();
|
||||||
set_open(true);
|
set_open(true);
|
||||||
});
|
});
|
||||||
move || {
|
move || {
|
||||||
view! { cx,
|
view! {
|
||||||
<Show when=open fallback=|_| ()>
|
<Show when=open fallback=|| ()>
|
||||||
{move || message().map(|ResultMessageData { title, message, colorway }| view! { cx,
|
{move || message().map(|ResultMessageData { title, message, colorway }| view! {
|
||||||
<div class=class_list!["box", colorway] style="position: relative">
|
<div class=class_list!["box", colorway] style="position: relative">
|
||||||
<strong class="block titlebar">{title}</strong>
|
<strong class="block titlebar">{title}</strong>
|
||||||
<button class="iconbutton" on:click=move |_| set_open(false) style="position: absolute; bottom: 0.5em; right: 0.5em">"×"</button>
|
<button class="iconbutton" on:click=move |_| set_open(false) style="position: absolute; bottom: 0.5em; right: 0.5em">"×"</button>
|
||||||
|
|
|
@ -11,10 +11,10 @@ use wasm_bindgen::JsCast;
|
||||||
use components::*;
|
use components::*;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
fn App(cx: Scope) -> impl IntoView {
|
fn App() -> impl IntoView {
|
||||||
let (_keyboard, set_keyboard) = create_signal(cx, None);
|
let (_keyboard, set_keyboard) = create_signal(None);
|
||||||
|
|
||||||
view! { cx,
|
view! {
|
||||||
<KeyboardFromFile set_keyboard />
|
<KeyboardFromFile set_keyboard />
|
||||||
<KeyboardFromWeb set_keyboard />
|
<KeyboardFromWeb set_keyboard />
|
||||||
}
|
}
|
||||||
|
@ -22,5 +22,5 @@ fn App(cx: Scope) -> impl IntoView {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let root = document().query_selector("main").unwrap().unwrap();
|
let root = document().query_selector("main").unwrap().unwrap();
|
||||||
mount_to(root.unchecked_into(), |cx| view! { cx, <App/> });
|
mount_to(root.unchecked_into(), || view! { <App/> });
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ Updating `cargoHash`:
|
||||||
pname = "dyesub-cli";
|
pname = "dyesub-cli";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
buildAndTestSubdir = "dyesub-cli";
|
buildAndTestSubdir = "dyesub-cli";
|
||||||
cargoHash = "sha256-3i+msqsUkNtVAx1eOZFftYRCDg+nVFZDhbdOIC8xvxM=";
|
cargoHash = "sha256-+3qFlfcIm7DtqxVeXbThxn0TELL3pBZ9etI6AivE8qA=";
|
||||||
meta = meta // {
|
meta = meta // {
|
||||||
description = "A tool for generating dye sublimation transfer sheet SVGs for Japanese thumb shift 拇指シフト keycaps.";
|
description = "A tool for generating dye sublimation transfer sheet SVGs for Japanese thumb shift 拇指シフト keycaps.";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue