Skip to content

Commit

Permalink
release: Prepare v0.1 (#283)
Browse files Browse the repository at this point in the history
* release: Prepare v0.1

* bump freya version

* minor tweaks

* update crates

* tweak

* use_editable fix

* improvements

* fixes

* feat: Default use_camera's FPS to 30

* chore: Use crab emoji

* chore: Update deps

* chore: Fix readme typo

* chore: Remove unused deps of layout crate

* chore: Fix core dev path of freya-testing

* chore: Fix core dev path of freya-testing

* chore: Fix core dev path of freya-testing
  • Loading branch information
marc2332 authored Aug 16, 2023
1 parent 1d3975d commit e2202fe
Show file tree
Hide file tree
Showing 34 changed files with 176 additions and 168 deletions.
26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ devtools = ["freya/devtools"]
use_camera = ["freya/use_camera"]

[workspace.dependencies]
freya = { path = "freya", version = "0.1.0" }
freya-devtools = { path = "devtools", version = "0.1.0" }
freya-node-state = { path = "state", version = "0.1.0" }
freya-layout = { path = "layout", version = "0.1.0" }
freya-renderer = { path = "renderer", version = "0.1.0" }
freya-elements = { path = "elements", version = "0.1.0" }
freya-common = { path = "common", version = "0.1.0" }
freya-hooks = { path = "hooks" }
freya-core = { path = "core" }
freya-components = { path = "components" }
freya-dom = { path = "dom", version = "0.1.0" }
freya-testing = { path = "testing", version = "0.1.0" }
torin = { path = "torin", version = "0.1.0" }
freya = { path = "freya", version = "0.1" }
freya-devtools = { path = "devtools", version = "0.1" }
freya-node-state = { path = "state", version = "0.1" }
freya-layout = { path = "layout", version = "0.1" }
freya-renderer = { path = "renderer", version = "0.1" }
freya-elements = { path = "elements", version = "0.1" }
freya-common = { path = "common", version = "0.1" }
freya-hooks = { path = "hooks", version = "0.1" }
freya-core = { path = "core", version = "0.1" }
freya-components = { path = "components", version = "0.1" }
freya-dom = { path = "dom", version = "0.1" }
freya-testing = { path = "testing", version = "0.1" }
torin = { path = "torin", version = "0.1" }

dioxus = { version = "0.4" }
dioxus-native-core-macro = { version = "0.4" }
Expand Down
41 changes: 18 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Freya :crab:
# Freya 🦀

<a href="https://freyaui.dev/"><img align="right" src="logo.svg" alt="Freya logo" width="150"/></a>

Expand Down Expand Up @@ -68,38 +68,33 @@ cargo run --example counter
You can also try [`freya-template`](https://github.com/marc2332/freya-template)

### Usage 📜
Add Freya as a dependency via git (it's not published on [crates.io](https://crates.io/) yet) in your `Cargo.toml`:
Add Freya and Dioxus as dependencies:

```toml
freya = { git = "https://github.com/marc2332/freya" }
freya = "0.1"
dioxus = { version = "0.4", features = ["macro", "hooks"] }
```

### Features ✨
- Support for Windows, Linux and MacOS
- Text, containers, images, svg, etc
- Headless testing
- Hot reload
- Optional DevTools panel
- Easy multiline text editing
- Components crate (with theming support)
- Scroll views
- Virtualized scroll views
- Button
- Slider
- Switch
- Dropdown
- and a few more
- Keyboard and Mouse events
- Hooks crate for text editing, animating, theming..
- ⛏️ Built-in **components** (button, scroll views, switch and more)
- 🚇 Built-in **hooks** library (animations, text editing and more)
- 🔍 Built-in **devtools** panel (experimental ⚠️) (experimental ⚠️)
- 🧰 Built-in **headless testing** runner for components
- 🎨 **Theming** support (not extensible yet ⚠️)
- 🛩️ Cross-platform (Windows, Linux, MacOS)
- 🖼️ SKSL **Shaders** support
- 🔄️ Dioxus **Hot-reload** support
- 📒 Multi-line **text editing** (experimental ⚠️)
- 🦾 Basic **Accessibility** Support (experimental ⚠️)
- 🧩Compatible with dioxus-std and other Dioxus renderer-agnostic libraries

### Goals 😁
- Performant and low memory usage
- Good developer experience
- Cross-platform
- Provide accessibility APIs
- Provide testing APIs
- Provide useful built-in components and hooks
- Cross-platform support
- Decent Accessibility support
- Useful testing APIs
- Useful and extensible components and hooks

## Status ⌚

Expand Down
2 changes: 2 additions & 0 deletions book/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@
- [Testing](./guides/testing.md)
- [Animating](./guides/animating.md)
- [Virtualizing](./guides/virtualizing.md)
- [Devtools](./guides/devtools.md)
- [Publishing]()

17 changes: 10 additions & 7 deletions book/src/differences_with_dioxus.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

**Freya** uses most of the core packages of Dioxus, but not all them.

These are the main differences:
- Freya has it's own elements, attributes and events, instead of `HTML`.
- Freya uses it's own UI layout library called [`torin`](https://github.com/marc2332/freya/tree/main/torin), instead of [`taffy`](https://github.com/DioxusLabs/taffy).
- Freya uses Skia, instead of webview or other graphics libraries used by Dioxus.
- Freya comes with it's own set of components and hooks, on the other hand Dioxus web/desktop can take advantage of existing CSS libraries and HTML elements.
- Freya has an integrated devtools panel, dioxus web/desktop already have the browser/webview devtools.
- Freya comes with a headless testing runner.
These are the main differences between Freya and the different Dioxus renderers for Desktop (webview and Blitz):

| Category | Freya | Dioxus |
|--------------------------------------|------------------|---------------------------------|
| **Elements, attributes and events** | Custom | HTML |
| **Layout** | Custom ([`torin`](https://github.com/marc2332/freya/tree/main/torin)) | WebView and [`taffy`](https://github.com/DioxusLabs/taffy) |
| **Renderer** | Skia | WebView or WGPU |
| **Components library** | Custom | None, but can use CSS libraries |
| **Devtools** | Custom | Provided in Webview |
| **Headless testing runner** | Custom | None |
13 changes: 13 additions & 0 deletions book/src/guides/devtools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Devtools

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


```toml
// Cargo.toml

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

```

9 changes: 6 additions & 3 deletions book/src/guides/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Getting started

I encourage you to learn how [Dioxus works](https://dioxuslabs.com/docs/0.3/guide/en/describing_ui/index.html), when you are done you can continue here. Also make sure you have the followed the [environment setup](../setup.html) guide.
I encourage you to learn how [Dioxus works](https://dioxuslabs.com/learn/0.4/guide/your_first_component), when you are done you can continue here. Also make sure you have the followed the [environment setup](../setup.html) guide.

Now, let's start by creating a hello world project.

Expand All @@ -23,7 +23,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
freya = { git = "https://github.com/marc2332/freya" }
freya = "0.1"
dioxus = { version = "0.4", features = ["macro", "hooks"] }
```

Expand All @@ -48,7 +48,6 @@ fn app(cx: Scope) -> Element {
render!(
rect {
overflow: "clip",
height: "100%",
width: "100%",
background: "rgb(35, 35, 35)",
Expand All @@ -67,3 +66,7 @@ Simply run with `cargo`:
```sh
cargo run
```

Nice! You have created your first Freya app.

You can learn more with the [examples](https://github.com/marc2332/freya/tree/main/examples) in the repository.
2 changes: 1 addition & 1 deletion book/src/guides/hot_reload.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hot reload

Freya supports Dioxus [hot reload](https://dioxuslabs.com/docs/0.3/guide/en/getting_started/hot_reload.html), this means you can update the `layout` and `styling` of your app on the fly, without having to compile any rust code.
Freya supports Dioxus hot reload, this means you can update the `layout` and `styling` of your app on the fly, without having to compile any rust code.

## Setup

Expand Down
2 changes: 1 addition & 1 deletion book/src/guides/layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Learn how the layout attributes work.
- [`min_width & min_height`](#min_width_&_min_height)
- [`max_width & max_height`](#max_width_&_max_height)
- [`Size units`](#size_units)
- [`Static values`](#static-values)
- [`Logical pixels`](#logical-pixels)
- [`Percentages`](#percentages)
- [`calc()`](#calc)
- [`direction`](#direction)
Expand Down
18 changes: 9 additions & 9 deletions book/src/guides/style.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

Learn how the style attributes work.

- [background](#background)
- [shadow](#shadow)
- [corner\_radius & corner\_smoothing](#corner_radius-&-corner_smoothing)
- [border](#border)
- [overflow](#overflow)
- [Color syntax](#color-syntax)
- [Static colors](#static-colors)
- [rgb() / hsl()](#rgb--hsl)
- [Inheritance](#inheritance)
- [`background`](#background)
- [`shadow`](#shadow)
- [`corner radius & corner smoothing`](#corner_radius--corner_smoothing)
- [`border`](#border)
- [`overflow`](#overflow)
- [`Color syntax`](#color-syntax)
- [`Static colors`](#static-colors)
- [`rgb() / hsl(`)](#rgb--hsl)
- [`Inheritance`](#inheritance)

### background

Expand Down
8 changes: 4 additions & 4 deletions book/src/guides/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Here, the component has a state that is `false` by default, but, once mounted it
async fn dynamic_test() {
fn dynamic_component(cx: Scope) -> Element {
let state = use_state(cx, || false);
let state_setter = state.setter();
use_effect(cx, (), move |_| async move {
state_setter(true);
use_effect(cx, (), |_| {
state.set(true);
async move { }
});
render!(
Expand Down Expand Up @@ -123,7 +123,7 @@ async fn event_test() {

## Testing configuration

The `launch_test` comes with a default configuration, but you can also pass your own with the `launch_test_with_config` function.
The `launch_test` comes with a default configuration, but you can also pass your own config with the `launch_test_with_config` function.

Here is an example of how to can set our custom window size:

Expand Down
19 changes: 11 additions & 8 deletions book/src/what_is_freya.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# What is Freya?

**Freya** is native **GUI** library built on top of 🧬 [Dioxus](https://dioxuslabs.com)'s core, it also uses 🎨 [Skia](https://skia.org/) as a graphics library, for 🦀 Rust.
**Freya** is native **GUI** library for Rust🦀, built on top of 🧬 [Dioxus](https://dioxuslabs.com)'s core and powered by 🎨 [Skia](https://skia.org/) as a graphics library.

### Features
- ⛏️ Built-in components and hooks library
- 🔍 Integrated devtools
- 🧰 Built-in testing runner for components.
- ⛏️ Built-in **components** (button, scroll views, switch and more)
- 🚇 Built-in **hooks** library (animations, text editing and more)
- 🔍 Built-in **devtools** panel (experimental ⚠️)
- 🧰 Built-in **headless testing** runner for components
- 🎨 **Theming** support (not extensible yet ⚠️)
- 🛩️ Cross-platform (Windows, Linux, MacOS)
- 🥸 Easy to use
- 🖼️ Shaders support
- 🔄️ Hot-reload
- 📒 Multi line text editing
- 🖼️ SKSL **Shaders** support
- 🔄️ Dioxus **Hot-reload** support
- 📒 Multi-line **text editing** (experimental ⚠️)
- 🦾 Basic **Accessibility** Support (experimental ⚠️)
- 🧩Compatible with dioxus-std and other Dioxus renderer-agnostic libraries

### Why 🧬 Dioxus?

Expand Down
8 changes: 4 additions & 4 deletions common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "freya-common"
description = "Cross-platform GUI Library."
description = "Internal common utilities for Freya."
version = "0.1.0"
edition = "2021"
license = "MIT"
authors = ["Marc Espín <[email protected]>"]
readme = "../readme.md"
homepage = "https://github.com/marc2332/freya"
homepage = "https://freyaui.dev/"
repository = "https://github.com/marc2332/freya"
keywords = ["gui", "ui", "cross-platform", "dioxus", "skia", "graphics"]
categories = ["GUI"]
keywords = ["gui", "ui", "desktop", "skia", "dioxus"]
categories = ["gui", "asynchronous"]

[dependencies]
torin = { workspace = true }
Expand Down
12 changes: 6 additions & 6 deletions components/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "freya-components"
description = "Cross-platform GUI Library."
description = "Components library desgined for Freya."
version = "0.1.0"
edition = "2021"
license = "MIT"
authors = ["Marc Espín <[email protected]>"]
readme = "../readme.md"
homepage = "https://github.com/marc2332/freya"
homepage = "https://freyaui.dev/"
repository = "https://github.com/marc2332/freya"
keywords = ["gui", "ui", "cross-platform", "dioxus", "skia", "graphics"]
categories = ["GUI"]
keywords = ["gui", "ui", "desktop", "skia", "dioxus"]
categories = ["gui", "asynchronous"]

[dependencies]
freya-elements = { workspace = true }
Expand All @@ -30,5 +30,5 @@ open = "1"
reqwest = { version = "0.11.13", features = ["json"] }

[dev-dependencies]
freya = { workspace = true }
freya-testing = { workspace = true }
freya = { path = "../freya" }
freya-testing = { path = "../testing" }
2 changes: 1 addition & 1 deletion components/src/button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ pub fn Button<'a>(cx: Scope<'a, ButtonProps<'a>>) -> Element {
height: "auto",
direction: "both",
color: "{color}",
shadow: "0 5 20 0 rgb(0, 0, 0, 100)",
shadow: "0 2 10 1 rgb(0, 0, 0, 45)",
corner_radius: "5",
padding: "8",
background: "{background}",
Expand Down
6 changes: 2 additions & 4 deletions components/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ pub fn Input<'a>(cx: Scope<'a, InputProps<'a>>) -> Element {
to_owned![editable];
move |_: MouseEvent| {
editable.process_event(&EditableEvent::Click);
focus_manager.focus();
}
};

Expand All @@ -129,9 +130,7 @@ pub fn Input<'a>(cx: Scope<'a, InputProps<'a>>) -> Element {
icon: CursorIcon::Text,
rect {
onkeydown: onkeydown,
onclick: move |_| {
focus_manager.focus();
},
onclick: onclick,
width: "auto",
height: "auto",
direction: "both",
Expand All @@ -156,7 +155,6 @@ pub fn Input<'a>(cx: Scope<'a, InputProps<'a>>) -> Element {
cursor_mode: "editable",
cursor_color: "{color}",
max_lines: "{max_lines}",
onclick: onclick,
onmouseover: onmouseover,
onmousedown: onmousedown,
highlights: highlights_attr,
Expand Down
12 changes: 6 additions & 6 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "freya-core"
description = "Cross-platform GUI Library."
description = "Internal core funcionatilies for Freya."
version = "0.1.0"
edition = "2021"
license = "MIT"
authors = ["Marc Espín <[email protected]>"]
readme = "../readme.md"
homepage = "https://github.com/marc2332/freya"
homepage = "https://freyaui.dev/"
repository = "https://github.com/marc2332/freya"
keywords = ["gui", "ui", "cross-platform", "dioxus", "skia", "graphics"]
categories = ["GUI"]
keywords = ["gui", "ui", "desktop", "skia", "dioxus"]
categories = ["gui", "asynchronous"]

[features]
devtools = []
Expand Down Expand Up @@ -43,5 +43,5 @@ tracing = { workspace = true }

[dev-dependencies]
dioxus = { workspace = true }
freya = { workspace = true }
freya-testing = { workspace = true }
freya = { path = "../freya" }
freya-testing = { path = "../testing" }
2 changes: 1 addition & 1 deletion core/src/accessibility_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl AccessibilityState {
Self::default()
}

/// Wrap it in a Arc<Mutex<T>>.
/// Wrap it in a `Arc<Mutex<T>>`.
pub fn wrap(self) -> SharedAccessibilityState {
Arc::new(Mutex::new(self))
}
Expand Down
Loading

0 comments on commit e2202fe

Please sign in to comment.