feat: Update leptos to v0.5.3 (#27)

This commit is contained in:
luoxiaozero 2023-11-28 15:49:02 +08:00 committed by GitHub
parent 64b4e64835
commit 227a3211ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 14 additions and 50 deletions

View file

@ -13,8 +13,8 @@ license = "MIT"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
leptos = { version = "0.5.2" } leptos = { version = "0.5.3" }
leptos_meta = { version = "0.5.2", optional = true } leptos_meta = { version = "0.5.3", optional = true }
web-sys = { version = "0.3.63", features = [ web-sys = { version = "0.3.63", features = [
"DomRect", "DomRect",
"File", "File",

View file

@ -7,9 +7,9 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
leptos = { version = "0.5.2" } leptos = { version = "0.5.3" }
leptos_meta = { version = "0.5.2" } leptos_meta = { version = "0.5.3" }
leptos_router = { version = "0.5.2" } leptos_router = { version = "0.5.3" }
leptos_devtools = "0.0.1" leptos_devtools = "0.0.1"
thaw = { path = "../", default-features = false } thaw = { path = "../", default-features = false }
icondata = { version = "0.1.0", features = [ icondata = { version = "0.1.0", features = [

View file

@ -43,7 +43,9 @@ pub fn Demo(demo_code: DemoCode, children: Children) -> impl IntoView {
for node in frag.nodes { for node in frag.nodes {
match node { match node {
View::Text(text) => html.push_str(&text.content), View::Text(text) => html.push_str(&text.content),
_ => leptos::logging::warn!("Only text nodes are supported as children of <DemoCode />."), _ => {
leptos::logging::warn!("Only text nodes are supported as children of <DemoCode />.")
}
} }
} }

View file

@ -1,11 +1,7 @@
mod breadcrumb_item; mod breadcrumb_item;
mod theme; mod theme;
use crate::{ use crate::{use_theme, utils::mount_style, Theme};
use_theme,
utils::{mount_style, Provider},
Theme,
};
pub use breadcrumb_item::BreadcrumbItem; pub use breadcrumb_item::BreadcrumbItem;
use leptos::*; use leptos::*;
pub use theme::BreadcrumbTheme; pub use theme::BreadcrumbTheme;

View file

@ -1,4 +1,3 @@
use crate::utils::Provider;
use leptos::*; use leptos::*;
use std::collections::HashSet; use std::collections::HashSet;

View file

@ -1,6 +1,5 @@
mod grid_item; mod grid_item;
use crate::utils::Provider;
pub use grid_item::*; pub use grid_item::*;
use leptos::*; use leptos::*;

View file

@ -1,8 +1,5 @@
use super::{LoadingBar, LoadingBarRef}; use super::{LoadingBar, LoadingBarRef};
use crate::{ use crate::{components::Teleport, utils::ComponentRef};
components::Teleport,
utils::{ComponentRef, Provider},
};
use leptos::*; use leptos::*;
#[component] #[component]

View file

@ -2,7 +2,6 @@ mod menu_group;
mod menu_item; mod menu_item;
mod theme; mod theme;
use crate::utils::Provider;
use leptos::*; use leptos::*;
pub use menu_group::MenuGroup; pub use menu_group::MenuGroup;
pub use menu_item::*; pub use menu_item::*;

View file

@ -1,10 +1,7 @@
use std::time::Duration; use std::time::Duration;
use super::{message_environment::MessageEnvironment, MessageVariant}; use super::{message_environment::MessageEnvironment, MessageVariant};
use crate::{ use crate::{components::Teleport, utils::mount_style};
components::Teleport,
utils::{mount_style, Provider},
};
use leptos::*; use leptos::*;
use uuid::Uuid; use uuid::Uuid;

View file

@ -1,11 +1,7 @@
mod tabbar_item; mod tabbar_item;
mod theme; mod theme;
use crate::{ use crate::{use_theme, utils::mount_style, Theme};
use_theme,
utils::{mount_style, Provider},
Theme,
};
use leptos::*; use leptos::*;
pub use tabbar_item::*; pub use tabbar_item::*;
pub use theme::TabbarTheme; pub use theme::TabbarTheme;

View file

@ -1,10 +1,6 @@
mod tab; mod tab;
use crate::{ use crate::{theme::use_theme, utils::mount_style, Theme};
theme::use_theme,
utils::{mount_style, Provider},
Theme,
};
use leptos::*; use leptos::*;
pub use tab::*; pub use tab::*;

View file

@ -3,7 +3,6 @@ mod common;
use self::common::CommonTheme; use self::common::CommonTheme;
use crate::{ use crate::{
mobile::{NavBarTheme, TabbarTheme}, mobile::{NavBarTheme, TabbarTheme},
utils::Provider,
AlertTheme, AutoCompleteTheme, AvatarTheme, BreadcrumbTheme, ButtonTheme, ColorPickerTheme, AlertTheme, AutoCompleteTheme, AvatarTheme, BreadcrumbTheme, ButtonTheme, ColorPickerTheme,
InputTheme, MenuTheme, MessageTheme, ProgressTheme, SelectTheme, SkeletionTheme, SliderTheme, InputTheme, MenuTheme, MessageTheme, ProgressTheme, SelectTheme, SkeletionTheme, SliderTheme,
SwitchTheme, TableTheme, TagTheme, TypographyTheme, UploadTheme, SwitchTheme, TableTheme, TagTheme, TypographyTheme, UploadTheme,

View file

@ -24,7 +24,6 @@ pub fn Text(#[prop(optional)] code: bool, children: Children) -> impl IntoView {
} }
.into_any(); .into_any();
} else { } else {
view! { <span class="thaw-text">{children()}</span> } view! { <span class="thaw-text">{children()}</span> }.into_any()
.into_any()
} }
} }

View file

@ -2,7 +2,6 @@
mod component_ref; mod component_ref;
mod event_listener; mod event_listener;
mod mount_style; mod mount_style;
mod provider;
mod signal; mod signal;
mod stored_maybe_signal; mod stored_maybe_signal;
@ -10,7 +9,6 @@ mod stored_maybe_signal;
pub(crate) use component_ref::ComponentRef; pub(crate) use component_ref::ComponentRef;
pub(crate) use event_listener::*; pub(crate) use event_listener::*;
pub(crate) use mount_style::mount_style; pub(crate) use mount_style::mount_style;
pub(crate) use provider::Provider;
pub use signal::SignalWatch; pub use signal::SignalWatch;
pub(crate) use stored_maybe_signal::*; pub(crate) use stored_maybe_signal::*;

View file

@ -1,13 +0,0 @@
/// https://github.com/leptos-rs/leptos/issues/2038
use leptos::*;
#[component]
pub fn Provider<T>(value: T, children: Children) -> impl IntoView
where
T: Clone + 'static,
{
run_as_child(move || {
provide_context(value);
children()
})
}