Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
215 changes: 96 additions & 119 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,23 @@ smallvec = "1"
thin-vec = "0.2"

# DioxusLabs dependencies
dioxus = { version = "0.7.3" }
dioxus-core = { version = "0.7.3" }
dioxus-html = { version = "0.7.3" }
dioxus-hooks = { version = "0.7.3" }
dioxus-signals = { version = "0.7.3" }
dioxus-stores = { version = "0.7.3" }
dioxus-asset-resolver = { version = "0.7.3" }
manganis = { version = "0.7.3" }
dioxus-document = { version = "0.7.3" }
dioxus-history = { version = "0.7.3" }
dioxus = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
dioxus-core = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
dioxus-html = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
dioxus-hooks = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
dioxus-signals = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
dioxus-stores = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
dioxus-asset-resolver = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
manganis = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
dioxus-document = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
dioxus-history = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }

# Dioxus hot reload
dioxus-devtools = { version = "0.7.3" }
dioxus-cli-config = { version = "0.7.3" }
dioxus-devtools = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }
dioxus-cli-config = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }

# Dioxus Prelude
dioxus-core-macro = { version = "0.7.3" }
dioxus-core-macro = { git = "https://github.com/DioxusLabs/dioxus", rev = "24f6a829df0dfa203961a98ea4cae21c2ff27e28" }

# Taffy + Parley + Fontations
taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "4ae4219b34e0ad22fd907cb1a7fa9a68c1ea1621", default-features = false, features = [
Expand Down
6 changes: 3 additions & 3 deletions apps/browser/src/browser_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ impl BrowsingHistory {

#[store(pub)]
impl<Lens> Store<BrowsingHistory, Lens> {
fn record_visit(&self, entry: HistoryEntry) -> HistoryEntryId
pub fn record_visit(&self, entry: HistoryEntry) -> HistoryEntryId
where
Lens: Writable,
{
record_visit_inner(&mut self.entries().write(), entry)
}

fn set_favicon_by_id(&self, id: HistoryEntryId, favicon_url: Url)
pub fn set_favicon_by_id(&self, id: HistoryEntryId, favicon_url: Url)
where
Lens: Writable,
{
set_favicon_by_id_inner(&mut self.entries().write(), id, favicon_url);
}

fn clear(&self)
pub fn clear(&self)
where
Lens: Writable,
{
Expand Down
2 changes: 1 addition & 1 deletion apps/browser/src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl History {
}
}

#[store]
#[store(pub(self))]
impl<Lens> Store<History, Lens> {
fn current_idx(&self) -> usize {
*self.current().read()
Expand Down
16 changes: 8 additions & 8 deletions apps/browser/src/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,42 +38,42 @@ pub struct Tab {

#[store(pub)]
impl<Lens> Store<Tab, Lens> {
fn nav_history(&self) -> SyncStore<History> {
pub fn nav_history(&self) -> SyncStore<History> {
*self.history().read()
}

fn loader_rc(&self) -> Rc<DocumentLoader> {
pub fn loader_rc(&self) -> Rc<DocumentLoader> {
// `open_tab` always assigns Some(loader) immediately after pushing the
// tab, so by the time any view code can call this the loader is set.
#[allow(clippy::expect_used)]
self.loader().cloned().expect("loader uninitialized")
}

fn tab_id(&self) -> TabId {
pub fn tab_id(&self) -> TabId {
*self.id().read()
}

fn navigate(&self, req: Request) {
pub fn navigate(&self, req: Request) {
self.nav_history().navigate(req);
}

fn reload(&self) {
pub fn reload(&self) {
self.loader_rc().reload();
}

fn go_back(&self) {
pub fn go_back(&self) {
self.nav_history().go_back();
}

fn go_forward(&self) {
pub fn go_forward(&self) {
self.nav_history().go_forward();
}

// Chrome state (title, favicon) for about pages. About URLs never go
// through the document loader, so this is the only place their title is
// set and the only place a stale favicon from a previous real page gets
// cleared.
fn commit_about_chrome(&self, page: AboutPage)
pub fn commit_about_chrome(&self, page: AboutPage)
where
Lens: Writable,
{
Expand Down
12 changes: 4 additions & 8 deletions examples/transforms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn app() -> Element {
let coords = evt.client_coordinates();
if evt
.held_buttons()
.contains(dioxus_elements::input_data::MouseButton::Auxiliary)
.contains(dioxus_html::input_data::MouseButton::Auxiliary)
{
active_pointer.set(true);
last.set([coords.x as f32, coords.y as f32]);
Expand Down Expand Up @@ -88,13 +88,9 @@ fn app() -> Element {
let sensitivity = 0.001;

let delta = match e.delta() {
dioxus_elements::geometry::WheelDelta::Pixels(data) => data.y as f32 * sensitivity,
dioxus_elements::geometry::WheelDelta::Lines(data) => {
data.y as f32 * sensitivity * 16.0
}
dioxus_elements::geometry::WheelDelta::Pages(data) => {
data.y as f32 * sensitivity * 400.0
}
dioxus_html::geometry::WheelDelta::Pixels(data) => data.y as f32 * sensitivity,
dioxus_html::geometry::WheelDelta::Lines(data) => data.y as f32 * sensitivity * 16.0,
dioxus_html::geometry::WheelDelta::Pages(data) => data.y as f32 * sensitivity * 400.0,
};

let factor = (1.0 + delta).clamp(0.8, 1.2);
Expand Down
8 changes: 4 additions & 4 deletions packages/dioxus-native-dom/src/dioxus_document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::events::{
BlitzKeyboardData, NativeConverter, NativeFocusData, NativeFormData, NativePointerData,
NativeScrollData, NativeTouchData, NativeWheelData, NodeHandle,
};
use crate::mutation_writer::{DioxusState, MutationWriter};
use crate::mutation_writer::DioxusState;
use crate::qual_name;
use blitz_dom::{
Attribute, BaseDocument, DEFAULT_CSS, DocGuard, DocGuardMut, Document, DocumentConfig,
Expand Down Expand Up @@ -33,7 +33,7 @@ fn get_dioxus_id(node: &Node) -> Option<ElementId> {
.iter()
.find(|attr| *attr.name.local == *"data-dioxus-id")
.and_then(|attr| attr.value.parse::<usize>().ok())
.map(ElementId)
.map(ElementId::from_raw)
}

/// Integrates [`BaseDocument`] from [`blitz-dom`](blitz_dom) with [`VirtualDom`] from [`dioxus-core`](dioxus_core)
Expand Down Expand Up @@ -145,7 +145,7 @@ impl DioxusDocument {
/// Run an initial build of the Dioxus vdom
pub fn initial_build(&mut self) {
let mut inner = self.inner.borrow_mut();
let mut writer = MutationWriter::new(&mut inner, &mut self.vdom_state);
let mut writer = self.vdom_state.writer(&mut inner);
self.vdom.rebuild(&mut writer);
drop(writer);
drop(inner);
Expand Down Expand Up @@ -241,7 +241,7 @@ impl Document for DioxusDocument {
}

let mut inner = self.inner.borrow_mut();
let mut writer = MutationWriter::new(&mut inner, &mut self.vdom_state);
let mut writer = self.vdom_state.writer(&mut inner);
self.vdom.render_immediate(&mut writer);
drop(writer);
drop(inner);
Expand Down
12 changes: 9 additions & 3 deletions packages/dioxus-native-dom/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use blitz_traits::events::{
BlitzWheelEvent, MouseEventButton,
};
use dioxus_html::{
AnimationData, CancelData, ClipboardData, CompositionData, DragData, FocusData, FormData,
FormValue, HasFileData, HasFocusData, HasFormData, HasKeyboardData, HasMouseData,
HasPointerData, HasScrollData, HasTouchData, HasTouchPointData, HasWheelData,
AnimationData, BeforeInputData, CancelData, ClipboardData, CompositionData, DragData,
FocusData, FormData, FormValue, HasFileData, HasFocusData, HasFormData, HasKeyboardData,
HasMouseData, HasPointerData, HasScrollData, HasTouchData, HasTouchPointData, HasWheelData,
HtmlEventConverter, ImageData, KeyboardData, MediaData, MountedData, MountedError,
MountedResult, MouseData, PlatformEventData, PointerData, RenderedElementBacking, ResizeData,
ScrollBehavior, ScrollData, ScrollLogicalPosition, ScrollToOptions, SelectionData, ToggleData,
Expand Down Expand Up @@ -71,6 +71,12 @@ impl HtmlEventConverter for NativeConverter {
unimplemented!("todo: convert_animation_data in dioxus-native. requires support in blitz")
}

fn convert_before_input_data(&self, _event: &PlatformEventData) -> BeforeInputData {
unimplemented!(
"todo: convert_before_input_data in dioxus-native. requires support in blitz"
)
}

fn convert_clipboard_data(&self, _event: &PlatformEventData) -> ClipboardData {
unimplemented!("todo: convert_clipboard_data in dioxus-native. requires support in blitz")
}
Expand Down
Loading
Loading