Skip to content

Commit

Permalink
chore: Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 committed Jan 9, 2025
2 parents e7a6ee4 + 5a34889 commit 47ee90f
Show file tree
Hide file tree
Showing 105 changed files with 2,198 additions and 826 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- 'crates/**/*'
- '.github/workflows/deploy_docs.yml'

env:
RUSTDOCFLAGS: "-D warnings"

jobs:
deploy:
name: Deploy
Expand All @@ -23,7 +26,7 @@ jobs:
prefix-key: "3"

- name: cargo doc
run: cargo doc --no-deps --workspace
run: cargo doc --no-deps --workspace --features docs

- name: Upload to Deno Deploy
uses: denoland/deployctl@v1
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/dioxus_rust.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/release.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Check examples
run: cargo check --examples
- name: Lint
run: cargo clippy --workspace -- -D warnings
run: cargo clippy --workspace --examples --features docs -- -D warnings
- name: Format
run: cargo +nightly fmt --all --check -- --error-on-unformatted --unstable-features
- name: Run Linux tests
Expand All @@ -50,7 +50,7 @@ jobs:
if: runner.os != 'Linux'
run: cargo nextest run --workspace --exclude examples
- name: Run doctests
run: cargo test --workspace --doc
run: cargo test --workspace --doc --features docs
- name: Run coverage
if: runner.os == 'Linux'
run: |
Expand Down
33 changes: 18 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "examples"
version = "0.0.0"
edition = "2021"
publish = false

[workspace]
members = ["crates/renderer", "crates/state", "crates/freya", "crates/elements", "crates/components", "crates/hooks", "crates/common", "crates/core", "crates/testing", "crates/devtools", "crates/torin", "crates/engine", "./examples/installer", "crates/native-core", "crates/native-core-macro"]
Expand All @@ -15,6 +16,7 @@ custom-tokio-rt = ["freya/custom-tokio-rt"]
performance-overlay = ["freya/performance-overlay"]
fade-cached-incremental-areas = ["freya/fade-cached-incremental-areas"]
disable-zoom-shortcuts = ["freya/disable-zoom-shortcuts"]
docs = ["freya/docs"]

[patch.crates-io]
# dioxus = { git = "https://github.com/DioxusLabs/dioxus", rev = "7beacdf9c76ae5412d3c2bcd55f7c5d87f486a0f" }
Expand All @@ -27,21 +29,21 @@ disable-zoom-shortcuts = ["freya/disable-zoom-shortcuts"]
# dioxus-router = { git = "https://github.com/DioxusLabs/dioxus", rev = "7beacdf9c76ae5412d3c2bcd55f7c5d87f486a0f" }

[workspace.dependencies]
freya = { path = "crates/freya", version = "0.2" }
freya-devtools = { path = "crates/devtools", version = "0.2" }
freya-node-state = { path = "crates/state", version = "0.2" }
freya-renderer = { path = "crates/renderer", version = "0.2" }
freya-elements = { path = "crates/elements", version = "0.2" }
freya-common = { path = "crates/common", version = "0.2" }
freya-hooks = { path = "crates/hooks", version = "0.2" }
freya-core = { path = "crates/core", version = "0.2" }
freya-components = { path = "crates/components", version = "0.2" }
freya-testing = { path = "crates/testing", version = "0.2" }
freya-engine = { path = "crates/engine", version = "0.2" }
torin = { path = "crates/torin", version = "0.2" }
freya = { path = "crates/freya", version = "0.3.0-rc.0" }
freya-devtools = { path = "crates/devtools", version = "0.3.0-rc.0" }
freya-node-state = { path = "crates/state", version = "0.3.0-rc.0" }
freya-renderer = { path = "crates/renderer", version = "0.3.0-rc.0" }
freya-elements = { path = "crates/elements", version = "0.3.0-rc.0" }
freya-common = { path = "crates/common", version = "0.3.0-rc.0" }
freya-hooks = { path = "crates/hooks", version = "0.3.0-rc.0" }
freya-core = { path = "crates/core", version = "0.3.0-rc.0" }
freya-components = { path = "crates/components", version = "0.3.0-rc.0" }
freya-testing = { path = "crates/testing", version = "0.3.0-rc.0" }
freya-engine = { path = "crates/engine", version = "0.3.0-rc.0" }
torin = { path = "crates/torin", version = "0.3.0-rc.0" }

freya-native-core-macro = { path = "crates/native-core-macro", version = "0.2" }
freya-native-core = { path = "crates/native-core", version = "0.2" }
freya-native-core-macro = { path = "crates/native-core-macro", version = "0.3.0-rc.0" }
freya-native-core = { path = "crates/native-core", version = "0.3.0-rc.0" }

dioxus = { version = "0.5", default-features = false, features = ["macro", "signals", "hooks"]}
dioxus-rsx = { version = "0.5", features = ["hot_reload"] }
Expand All @@ -52,6 +54,7 @@ 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-clipboard = "0.1"
dioxus-i18n = "0.3"

skia-safe = { version = "0.80.0", features = ["gl", "textlayout", "svg"] }

Expand Down Expand Up @@ -84,7 +87,7 @@ freya-core = { workspace = true }
freya-testing = { workspace = true }
reqwest = { version = "0.12.0", features = ["json"] }
serde = "1.0.189"
dioxus-i18n = "0.2"
dioxus-i18n = { workspace = true }
rand = "0.8.5"
dioxus-router = { workspace = true }
itertools = "0.13.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ If you are interested in supporting the development of this project feel free to

Thanks to my sponsors for supporting this project! 😄

<!-- sponsors --><!-- sponsors -->
<!-- sponsors --><a href="https://github.com/piny4man"><img src="https:&#x2F;&#x2F;github.com&#x2F;piny4man.png" width="60px" alt="User avatar: " /></a><a href="https://github.com/gqf2008"><img src="https:&#x2F;&#x2F;github.com&#x2F;gqf2008.png" width="60px" alt="User avatar: 高庆丰" /></a><a href="https://github.com/lino-levan"><img src="https:&#x2F;&#x2F;github.com&#x2F;lino-levan.png" width="60px" alt="User avatar: Lino Le Van" /></a><!-- sponsors -->

### Special thanks 💪

Expand Down
4 changes: 1 addition & 3 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Summary

# Introduction

- [Overview](./index.md)
Expand All @@ -14,4 +12,4 @@
# Other
- [Differences with Dioxus](differences_with_dioxus.md)
- [FAQ](./faq.md)
- [Contact](./contact.md)
- [Contact](./contact.md)
22 changes: 11 additions & 11 deletions book/src/differences_with_dioxus.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
# Differences with Dioxus

**Freya** is built on top of the **core** crates from Dioxus, this means that you will effectively be creating Dioxus components, using RSX and hooks.
**Freya** is built on top of the **core** crates from Dioxus. This means that you will effectively be creating Dioxus components using RSX and hooks.

**But**, thanks to Dioxus being a renderer-agnostic library you will **NOT** be using JavaScript, HTML, OR CSS, or any other abstraction that ends up using one of those or anything close to web.
However, thanks to Dioxus being a renderer-agnostic library, you will **NOT** be using JavaScript, HTML, CSS, or any other abstraction that ends up using one of those or other web technologies.

Freya does everything on its own when it comes to:
Freya does everything on its own when it comes to:
- Elements
- Styling
- Layout
- Events
- Rendering
- Testing
- Built-in components and hooks,
- Built-in components and hooks
- Editing
- Animating

And more. Dioxus only is only used to run the app components (hooks, lifecycle, state, rsx), **everything else is managed by Freya**.
...and more. Dioxus is only used for managing app components (hooks, lifecycle, state, RSX), while **everything else is managed by Freya**.

**Freya is not mean to be drop-in alternative to Dioxus renderers but as GUI library on its own.**
**Freya is not meant to be a drop-in alternative to Dioxus renderers but a GUI library on its own.**

Here is the list of the main differences between Freya and the official Dioxus renderers for Desktop (WebView and Blitz):
Below is a comparison of the main differences between Freya and the official Dioxus renderers for Desktop (WebView and Blitz):

| Category | Freya | Dioxus Renderers |
|--------------------------------------|------------------|---------------------------------|
| **Elements, attributes and events** | Custom | HTML |
| **Elements, attributes, and events** | Custom | HTML |
| **Layout** | Custom ([`Torin`](https://github.com/marc2332/freya/tree/main/crates/torin)) | CSS or [`Taffy`](https://github.com/DioxusLabs/taffy) |
| **Styling** | Custom | CSS |
| **Renderer** | Skia | WebView or WGPU |
| **Components library** | Custom ([`freya-comonents`](https://github.com/marc2332/freya/tree/main/crates/components)) | None, but can use HTML elements and CSS libraries |
| **Devtools** | Custom ([`freya-devtools`](https://github.com/marc2332/freya/tree/main/crates/devtools)) | Provided in Webview |
| **Headless testing runner** | Custom ([`freya-testing`](https://github.com/marc2332/freya/tree/main/crates/testing)) | None, but there is Playwright and similar |
| **Components library** | Custom ([`freya-components`](https://github.com/marc2332/freya/tree/main/crates/components)) | None, but can use HTML elements and CSS libraries |
| **Devtools** | Custom ([`freya-devtools`](https://github.com/marc2332/freya/tree/main/crates/devtools)) | Provided in WebView |
| **Headless testing runner** | Custom ([`freya-testing`](https://github.com/marc2332/freya/tree/main/crates/testing)) | None, but tools like Playwright and similar are available |
24 changes: 12 additions & 12 deletions book/src/guides/devtools.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Devtools

Devtools can be enabled by enabling the `devtools` to Freya.

```toml
// Cargo.toml

[dependencies]
freya = { version = "0.2", features = ["devtools"] }

```

# Devtools

Devtools can be enabled by enabling the `devtools` to Freya.

```toml
// Cargo.toml

[dependencies]
freya = { version = "0.2", features = ["devtools"] }

```

2 changes: 1 addition & 1 deletion crates/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "freya-common"
description = "Internal common utilities for Freya."
version = "0.2.1"
version = "0.3.0-rc.0"
edition = "2021"
license = "MIT"
authors = ["Marc Espín <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion crates/components/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "freya-components"
description = "Components library desgined for Freya."
version = "0.2.1"
version = "0.3.0-rc.0"
edition = "2021"
license = "MIT"
authors = ["Marc Espín <[email protected]>"]
Expand Down
14 changes: 6 additions & 8 deletions crates/components/src/accordion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,16 @@ pub struct AccordionProps {
pub fn Accordion(props: AccordionProps) -> Element {
let theme = use_applied_theme!(&props.theme, accordion);
let mut open = use_signal(|| false);
let animation = use_animation(move |ctx| {
ctx.with(
AnimNum::new(0., 100.)
.time(300)
.function(Function::Expo)
.ease(Ease::Out),
)
let animation = use_animation(move |_conf| {
AnimNum::new(0., 100.)
.time(300)
.function(Function::Expo)
.ease(Ease::Out)
});
let mut status = use_signal(AccordionStatus::default);
let platform = use_platform();

let animation_value = animation.get().read().as_f32();
let animation_value = animation.get().read().read();
let AccordionTheme {
background,
color,
Expand Down
34 changes: 15 additions & 19 deletions crates/components/src/animated_position.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,26 @@ pub fn AnimatedPosition(
let mut render_element = use_signal(|| false);
let (reference, size, old_size) = use_node_signal_with_prev();

let animations = use_animation_with_dependencies(
let animation = use_animation_with_dependencies(
&(function, duration, ease),
move |ctx, (function, duration, ease)| {
move |_conf, (function, duration, ease)| {
let old_size = old_size().unwrap_or_default();
let size = size().unwrap_or_default();
(
ctx.with(
AnimNum::new(size.area.origin.x, old_size.area.origin.x)
.duration(duration)
.ease(ease)
.function(function),
),
ctx.with(
AnimNum::new(size.area.origin.y, old_size.area.origin.y)
.duration(duration)
.ease(ease)
.function(function),
),
AnimNum::new(size.area.origin.x, old_size.area.origin.x)
.duration(duration)
.ease(ease)
.function(function),
AnimNum::new(size.area.origin.y, old_size.area.origin.y)
.duration(duration)
.ease(ease)
.function(function),
)
},
);

use_effect(move || {
if animations.is_running() {
if animation.is_running() {
render_element.set(true);
}
});
Expand All @@ -55,15 +51,15 @@ pub fn AnimatedPosition(
let has_size = size.read().is_some();
let has_old_size = old_size.read().is_some();
if has_size && has_old_size {
animations.run(AnimDirection::Reverse);
animation.run(AnimDirection::Reverse);
} else if has_size {
render_element.set(true);
}
});

let (offset_x, offset_y) = animations.get();
let offset_x = offset_x.read().as_f32();
let offset_y = offset_y.read().as_f32();
let (offset_x, offset_y) = &*animation.get().read_unchecked();
let offset_x = offset_x.read();
let offset_y = offset_y.read();

rsx!(
rect {
Expand Down
2 changes: 2 additions & 0 deletions crates/components/src/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ pub struct BaseButtonProps {
/// Inner children for the button.
pub children: Element,
/// Event handler for when the button is pressed.
///
/// This will fire upon **mouse click** or pressing the **enter key**.
pub onpress: Option<EventHandler<PressEvent>>,
/// Event handler for when the button is clicked. Not recommended, use `onpress` instead.
pub onclick: Option<EventHandler<()>>,
Expand Down
Loading

0 comments on commit 47ee90f

Please sign in to comment.