diff --git a/Cargo.toml b/Cargo.toml index c1dc0d43..cd1720ae 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,8 @@ app_units = "0.7.5" # DioxusLabs dependencies dioxus = { version = "0.6" } -dioxus-ssr = { version = "0.6" } +dioxus-core = { version = "0.6" } +dioxus-html = { version = "0.6" } dioxus-cli-config = { version = "0.6" } dioxus-devtools = { version = "0.6" } taffy = { version = "0.6", default-features = false, features = ["std", "flexbox", "grid", "block_layout", "content_size"] } diff --git a/packages/dioxus-native/Cargo.toml b/packages/dioxus-native/Cargo.toml index 0537a1e1..8967cd41 100644 --- a/packages/dioxus-native/Cargo.toml +++ b/packages/dioxus-native/Cargo.toml @@ -20,7 +20,8 @@ blitz-traits = { path = "../blitz-traits" } blitz-shell = { path = "../blitz-shell" } # DioxusLabs dependencies -dioxus = { workspace = true } +dioxus-core = { workspace = true } +dioxus-html = { workspace = true } dioxus-cli-config = { workspace = true, optional = true } dioxus-devtools = { workspace = true, optional = true } diff --git a/packages/dioxus-native/src/dioxus_document.rs b/packages/dioxus-native/src/dioxus_document.rs index f656866a..61b89322 100644 --- a/packages/dioxus-native/src/dioxus_document.rs +++ b/packages/dioxus-native/src/dioxus_document.rs @@ -12,11 +12,8 @@ use blitz_dom::{ }; use blitz_traits::net::NetProvider; -use dioxus::{ - dioxus_core::{ElementId, Event, VirtualDom}, - html::{FormValue, PlatformEventData}, - prelude::set_event_converter, -}; +use dioxus_core::{ElementId, Event, VirtualDom}; +use dioxus_html::{set_event_converter, FormValue, PlatformEventData}; use futures_util::{pin_mut, FutureExt}; use super::event_handler::{NativeClickData, NativeConverter, NativeFormData}; diff --git a/packages/dioxus-native/src/event_handler.rs b/packages/dioxus-native/src/event_handler.rs index 0d322d31..5390a162 100644 --- a/packages/dioxus-native/src/event_handler.rs +++ b/packages/dioxus-native/src/event_handler.rs @@ -1,49 +1,57 @@ use std::collections::HashMap; -use dioxus::{ - html::{FormValue, HasFileData, HasFormData}, - prelude::{HtmlEventConverter, PlatformEventData}, +use dioxus_html::{ + geometry::{ClientPoint, ElementPoint, PagePoint, ScreenPoint}, + input_data::{MouseButton, MouseButtonSet}, + point_interaction::{ + InteractionElementOffset, InteractionLocation, ModifiersInteraction, PointerInteraction, + }, + AnimationData, ClipboardData, CompositionData, DragData, FocusData, FormData, FormValue, + HasFileData, HasFormData, HasMouseData, HtmlEventConverter, ImageData, KeyboardData, MediaData, + MountedData, MouseData, PlatformEventData, PointerData, ResizeData, ScrollData, SelectionData, + ToggleData, TouchData, TransitionData, VisibleData, WheelData, }; +use keyboard_types::Modifiers; use super::keyboard_event::BlitzKeyboardData; #[derive(Clone)] pub struct NativeClickData; -impl dioxus::html::point_interaction::InteractionLocation for NativeClickData { - fn client_coordinates(&self) -> dioxus::prelude::dioxus_elements::geometry::ClientPoint { +impl InteractionLocation for NativeClickData { + fn client_coordinates(&self) -> ClientPoint { todo!() } - fn screen_coordinates(&self) -> dioxus::prelude::dioxus_elements::geometry::ScreenPoint { + fn screen_coordinates(&self) -> ScreenPoint { todo!() } - fn page_coordinates(&self) -> dioxus::prelude::dioxus_elements::geometry::PagePoint { + fn page_coordinates(&self) -> PagePoint { todo!() } } -impl dioxus::html::point_interaction::InteractionElementOffset for NativeClickData { - fn element_coordinates(&self) -> dioxus::prelude::dioxus_elements::geometry::ElementPoint { +impl InteractionElementOffset for NativeClickData { + fn element_coordinates(&self) -> ElementPoint { todo!() } } -impl dioxus::html::point_interaction::ModifiersInteraction for NativeClickData { - fn modifiers(&self) -> dioxus::prelude::Modifiers { +impl ModifiersInteraction for NativeClickData { + fn modifiers(&self) -> Modifiers { todo!() } } -impl dioxus::html::point_interaction::PointerInteraction for NativeClickData { - fn trigger_button(&self) -> Option { +impl PointerInteraction for NativeClickData { + fn trigger_button(&self) -> Option { todo!() } - fn held_buttons(&self) -> dioxus::prelude::dioxus_elements::input_data::MouseButtonSet { + fn held_buttons(&self) -> MouseButtonSet { todo!() } } -impl dioxus::html::HasMouseData for NativeClickData { +impl HasMouseData for NativeClickData { fn as_any(&self) -> &dyn std::any::Any { self as &dyn std::any::Any } @@ -52,92 +60,86 @@ impl dioxus::html::HasMouseData for NativeClickData { pub struct NativeConverter {} impl HtmlEventConverter for NativeConverter { - fn convert_animation_data(&self, _event: &PlatformEventData) -> dioxus::prelude::AnimationData { + fn convert_animation_data(&self, _event: &PlatformEventData) -> AnimationData { todo!() } - fn convert_clipboard_data(&self, _event: &PlatformEventData) -> dioxus::prelude::ClipboardData { + fn convert_clipboard_data(&self, _event: &PlatformEventData) -> ClipboardData { todo!() } - fn convert_composition_data( - &self, - _event: &PlatformEventData, - ) -> dioxus::prelude::CompositionData { + fn convert_composition_data(&self, _event: &PlatformEventData) -> CompositionData { todo!() } - fn convert_drag_data(&self, _event: &PlatformEventData) -> dioxus::prelude::DragData { + fn convert_drag_data(&self, _event: &PlatformEventData) -> DragData { todo!() } - fn convert_focus_data(&self, _event: &PlatformEventData) -> dioxus::prelude::FocusData { + fn convert_focus_data(&self, _event: &PlatformEventData) -> FocusData { todo!() } - fn convert_form_data(&self, event: &PlatformEventData) -> dioxus::prelude::FormData { + fn convert_form_data(&self, event: &PlatformEventData) -> FormData { let o = event.downcast::().unwrap().clone(); - dioxus::prelude::FormData::from(o) + FormData::from(o) } - fn convert_image_data(&self, _event: &PlatformEventData) -> dioxus::prelude::ImageData { + fn convert_image_data(&self, _event: &PlatformEventData) -> ImageData { todo!() } - fn convert_keyboard_data(&self, event: &PlatformEventData) -> dioxus::prelude::KeyboardData { + fn convert_keyboard_data(&self, event: &PlatformEventData) -> KeyboardData { let data = event.downcast::().unwrap().clone(); - dioxus::prelude::KeyboardData::from(data) + KeyboardData::from(data) } - fn convert_media_data(&self, _event: &PlatformEventData) -> dioxus::prelude::MediaData { + fn convert_media_data(&self, _event: &PlatformEventData) -> MediaData { todo!() } - fn convert_mounted_data(&self, _event: &PlatformEventData) -> dioxus::prelude::MountedData { + fn convert_mounted_data(&self, _event: &PlatformEventData) -> MountedData { todo!() } - fn convert_mouse_data(&self, event: &PlatformEventData) -> dioxus::prelude::MouseData { + fn convert_mouse_data(&self, event: &PlatformEventData) -> MouseData { let o = event.downcast::().unwrap().clone(); - dioxus::prelude::MouseData::from(o) + MouseData::from(o) } - fn convert_pointer_data(&self, _event: &PlatformEventData) -> dioxus::prelude::PointerData { + fn convert_pointer_data(&self, _event: &PlatformEventData) -> PointerData { todo!() } - fn convert_scroll_data(&self, _event: &PlatformEventData) -> dioxus::prelude::ScrollData { + fn convert_scroll_data(&self, _event: &PlatformEventData) -> ScrollData { todo!() } - fn convert_selection_data(&self, _event: &PlatformEventData) -> dioxus::prelude::SelectionData { + fn convert_selection_data(&self, _event: &PlatformEventData) -> SelectionData { todo!() } - fn convert_toggle_data(&self, _event: &PlatformEventData) -> dioxus::prelude::ToggleData { + fn convert_toggle_data(&self, _event: &PlatformEventData) -> ToggleData { todo!() } - fn convert_touch_data(&self, _event: &PlatformEventData) -> dioxus::prelude::TouchData { + fn convert_touch_data(&self, _event: &PlatformEventData) -> TouchData { todo!() } - fn convert_transition_data( - &self, - _event: &PlatformEventData, - ) -> dioxus::prelude::TransitionData { + fn convert_transition_data(&self, _event: &PlatformEventData) -> TransitionData { todo!() } - fn convert_wheel_data(&self, _event: &PlatformEventData) -> dioxus::prelude::WheelData { + fn convert_wheel_data(&self, _event: &PlatformEventData) -> WheelData { todo!() } - fn convert_resize_data(&self, _event: &PlatformEventData) -> dioxus::prelude::ResizeData { + fn convert_resize_data(&self, _event: &PlatformEventData) -> ResizeData { todo!() } - fn convert_visible_data(&self, _event: &PlatformEventData) -> dioxus::prelude::VisibleData { + fn convert_visible_data(&self, _event: &PlatformEventData) -> VisibleData { todo!() } } diff --git a/packages/dioxus-native/src/keyboard_event.rs b/packages/dioxus-native/src/keyboard_event.rs index 25375036..9c87fe55 100644 --- a/packages/dioxus-native/src/keyboard_event.rs +++ b/packages/dioxus-native/src/keyboard_event.rs @@ -1,6 +1,6 @@ use std::any::Any; -use dioxus::events::{HasKeyboardData, ModifiersInteraction}; +use dioxus_html::{point_interaction::ModifiersInteraction, HasKeyboardData}; use keyboard_types::{Code, Key, Location, Modifiers}; use winit::event::KeyEvent as WinitKeyEvent; diff --git a/packages/dioxus-native/src/lib.rs b/packages/dioxus-native/src/lib.rs index ae61debb..0b8a2578 100644 --- a/packages/dioxus-native/src/lib.rs +++ b/packages/dioxus-native/src/lib.rs @@ -26,15 +26,11 @@ use blitz_shell::{ create_default_event_loop, BlitzEvent, BlitzShellNetCallback, Config, WindowConfig, }; use blitz_traits::net::SharedCallback; -use dioxus::prelude::{ComponentFunction, Element, VirtualDom}; +use dioxus_core::{ComponentFunction, Element, VirtualDom}; use std::sync::Arc; type NodeId = usize; -pub mod exports { - pub use dioxus; -} - /// Launch an interactive HTML/CSS renderer driven by the Dioxus virtualdom pub fn launch(root: fn() -> Element) { launch_cfg(root, Config::default()) diff --git a/packages/dioxus-native/src/mutation_writer.rs b/packages/dioxus-native/src/mutation_writer.rs index 1a2ae8e9..1c74df27 100644 --- a/packages/dioxus-native/src/mutation_writer.rs +++ b/packages/dioxus-native/src/mutation_writer.rs @@ -4,9 +4,8 @@ use blitz_dom::{ node::{Attribute, NodeSpecificData}, ns, Document, ElementNodeData, NodeData, QualName, RestyleHint, }; -use dioxus::{ - dioxus_core::{AttributeValue, ElementId, Template, WriteMutations}, - prelude::{TemplateAttribute, TemplateNode}, +use dioxus_core::{ + AttributeValue, ElementId, Template, TemplateAttribute, TemplateNode, WriteMutations, }; use rustc_hash::FxHashMap; use std::collections::HashSet;