From a1c37ac5267f4905e3ae9952991ef27deefa714a Mon Sep 17 00:00:00 2001 From: marc2332 Date: Wed, 9 Oct 2024 14:47:08 +0200 Subject: [PATCH] chore: Replace dioxus-sdk with dioxus-clipboard --- Cargo.toml | 4 ++-- crates/components/src/native_container.rs | 8 +++++++- crates/components/src/popup.rs | 5 ++++- crates/components/src/slider.rs | 1 + crates/components/src/tile.rs | 1 + crates/hooks/Cargo.toml | 2 +- crates/hooks/src/rope_editor.rs | 2 +- crates/hooks/src/text_editor.rs | 2 +- crates/hooks/src/use_editable.rs | 8 ++++---- examples/text_editors.rs | 2 +- 10 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 315f39f6a..313e95cce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ dioxus-signals = { version = "0.5" } dioxus-core = { version = "0.5" } dioxus-hot-reload = { version = "0.5", features = ["file_watcher"], default-features = false } dioxus-router = { version = "0.5", default-features = false } -dioxus-sdk = { version = "0.5", features = ["clipboard"]} +dioxus-clipboard = "0.1" skia-safe = { version = "0.75.0", features = ["gl", "textlayout", "svg"] } @@ -96,7 +96,7 @@ tree-sitter-highlight = "0.23.0" tree-sitter-rust = "0.23.0" rfd = "0.14.1" bytes = "1.5.0" -dioxus-sdk = { workspace = true } +dioxus-clipboard = { workspace = true } winit = { workspace = true } [profile.release] diff --git a/crates/components/src/native_container.rs b/crates/components/src/native_container.rs index 82d2b6db8..dc06f6f54 100644 --- a/crates/components/src/native_container.rs +++ b/crates/components/src/native_container.rs @@ -2,7 +2,13 @@ use dioxus::prelude::*; use freya_core::prelude::EventMessage; use freya_elements::{ elements as dioxus_elements, - events::KeyboardEvent, + events::{ + keyboard::{ + Key, + Modifiers, + }, + KeyboardEvent, + }, }; use freya_hooks::{ use_init_native_platform, diff --git a/crates/components/src/popup.rs b/crates/components/src/popup.rs index 68885634b..67f52af72 100644 --- a/crates/components/src/popup.rs +++ b/crates/components/src/popup.rs @@ -1,7 +1,10 @@ use dioxus::prelude::*; use freya_elements::{ elements as dioxus_elements, - events::KeyboardEvent, + events::{ + keyboard::Key, + KeyboardEvent, + }, }; use freya_hooks::{ theme_with, diff --git a/crates/components/src/slider.rs b/crates/components/src/slider.rs index ce3a9d3b3..e656e66fe 100644 --- a/crates/components/src/slider.rs +++ b/crates/components/src/slider.rs @@ -2,6 +2,7 @@ use dioxus::prelude::*; use freya_elements::{ elements as dioxus_elements, events::{ + keyboard::Key, KeyboardEvent, MouseEvent, WheelEvent, diff --git a/crates/components/src/tile.rs b/crates/components/src/tile.rs index 17cd1aa52..ed0222806 100644 --- a/crates/components/src/tile.rs +++ b/crates/components/src/tile.rs @@ -2,6 +2,7 @@ use dioxus::prelude::*; use freya_elements::{ elements as dioxus_elements, events::{ + keyboard::Key, KeyboardEvent, MouseEvent, }, diff --git a/crates/hooks/Cargo.toml b/crates/hooks/Cargo.toml index 301dc163d..7c581176b 100644 --- a/crates/hooks/Cargo.toml +++ b/crates/hooks/Cargo.toml @@ -29,7 +29,7 @@ torin = { workspace = true } dioxus-hooks = { workspace = true } dioxus-signals = { workspace = true } dioxus-core = { workspace = true } -dioxus-sdk = { workspace = true } +dioxus-clipboard = { workspace = true } tokio = { workspace = true } winit = { workspace = true } diff --git a/crates/hooks/src/rope_editor.rs b/crates/hooks/src/rope_editor.rs index 017e95e0f..b46d992d3 100644 --- a/crates/hooks/src/rope_editor.rs +++ b/crates/hooks/src/rope_editor.rs @@ -4,7 +4,7 @@ use std::{ ops::Range, }; -use dioxus_sdk::clipboard::UseClipboard; +use dioxus_clipboard::prelude::UseClipboard; use ropey::iter::Lines; pub use ropey::Rope; diff --git a/crates/hooks/src/text_editor.rs b/crates/hooks/src/text_editor.rs index 936c3f13f..bbb48fdaa 100644 --- a/crates/hooks/src/text_editor.rs +++ b/crates/hooks/src/text_editor.rs @@ -5,7 +5,7 @@ use std::{ ops::Range, }; -use dioxus_sdk::clipboard::UseClipboard; +use dioxus_clipboard::prelude::UseClipboard; use freya_elements::events::keyboard::{ Code, Key, diff --git a/crates/hooks/src/use_editable.rs b/crates/hooks/src/use_editable.rs index a2af7ce88..d2008489a 100644 --- a/crates/hooks/src/use_editable.rs +++ b/crates/hooks/src/use_editable.rs @@ -1,14 +1,14 @@ use std::rc::Rc; +use dioxus_clipboard::prelude::{ + use_clipboard, + UseClipboard, +}; use dioxus_core::{ prelude::spawn, use_hook, AttributeValue, }; -use dioxus_sdk::clipboard::{ - use_clipboard, - UseClipboard, -}; use dioxus_signals::{ Readable, Signal, diff --git a/examples/text_editors.rs b/examples/text_editors.rs index 8ca01547a..58535b08e 100644 --- a/examples/text_editors.rs +++ b/examples/text_editors.rs @@ -3,7 +3,7 @@ windows_subsystem = "windows" )] -use dioxus_sdk::clipboard::use_clipboard; +use dioxus_clipboard::prelude::use_clipboard; use freya::prelude::*; fn main() {