mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-22 12:13:04 +00:00
Move the manganis into attribute value implementation into dioxus core (#2765)
This commit is contained in:
parent
e0bb67b476
commit
9dbdf74a1e
4 changed files with 11 additions and 1 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2578,6 +2578,7 @@ dependencies = [
|
|||
"futures-util",
|
||||
"generational-box",
|
||||
"longest-increasing-subsequence",
|
||||
"manganis",
|
||||
"pretty_assertions",
|
||||
"rand 0.8.5",
|
||||
"reqwest 0.12.5",
|
||||
|
|
|
@ -25,6 +25,7 @@ generational-box = { workspace = true }
|
|||
rustversion = "1.0.17"
|
||||
const_format = { workspace = true }
|
||||
warnings = { workspace = true }
|
||||
manganis = { workspace = true, default-features = false, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { workspace = true, features = ["full"] }
|
||||
|
@ -47,6 +48,7 @@ features = [
|
|||
|
||||
[features]
|
||||
serialize = ["dep:serde"]
|
||||
manganis = ["dep:manganis"]
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
cargo-args = ["-Zunstable-options", "-Zrustdoc-scrape-examples"]
|
||||
|
|
|
@ -1096,6 +1096,13 @@ impl<T: IntoAttributeValue> IntoAttributeValue for Option<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "manganis")]
|
||||
impl IntoAttributeValue for manganis::ImageAsset {
|
||||
fn into_value(self) -> AttributeValue {
|
||||
AttributeValue::Text(self.path().to_string())
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait for anything that has a dynamic list of attributes
|
||||
pub trait HasAttributes {
|
||||
/// Push an attribute onto the list of attributes
|
||||
|
|
|
@ -43,7 +43,7 @@ hooks = ["dep:dioxus-hooks"]
|
|||
hot-reload = ["dep:dioxus-hot-reload", "dioxus-web?/hot_reload", "dioxus-fullstack?/hot-reload"]
|
||||
mounted = ["dioxus-web?/mounted", "dioxus-html?/mounted"]
|
||||
file_engine = ["dioxus-web?/file_engine"]
|
||||
asset = ["dep:manganis"]
|
||||
asset = ["dep:manganis", "dioxus-core/manganis"]
|
||||
document = ["dioxus-web?/document", "dioxus-html?/document"]
|
||||
|
||||
launch = ["dep:dioxus-config-macro"]
|
||||
|
|
Loading…
Reference in a new issue