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
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ratatui = { version = "0.30", default-features = false, features = ["all-widgets
console_error_panic_hook = "0.1.7"
thiserror = "2.0.18"
bitvec = { version = "1.0.1", default-features = false, features = ["alloc", "std"] }
beamterm-renderer = "0.13.0"
beamterm-renderer = "0.15.0"
unicode-width = "0.2.2"

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ exclude = [
ratzilla = { path = "../" }
examples-shared = { path = "shared" }
console_error_panic_hook = "0.1.7"
tachyonfx = { version = "0.22.0", default-features = false, features = ["web-time"] }
tachyonfx = { version = "0.23.0", default-features = false, features = ["wasm"] }
web-time = "1.1.0"
palette = "0.7.6"
rand = { version = "0.9.2", default-features = false }
wasm-bindgen = "0.2.104"
wasm-bindgen = "0.2.108"
wasm-bindgen-futures = "0.4.54"
web-sys = "0.3.81"

Expand Down
2 changes: 1 addition & 1 deletion examples/clipboard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false
[dependencies]
color-eyre = "0.6.5"
console_error_panic_hook.workspace = true
ratatui = { version = "0.30.0", default-features = false }
ratatui = { version = "0.30.0", default-features = false, features = ["layout-cache"] }
ratzilla.workspace = true
examples-shared.workspace = true
wasm-bindgen.workspace = true
Expand Down
12 changes: 8 additions & 4 deletions examples/clipboard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ use ratatui::{
Frame, Terminal,
};

use ratzilla::{
event::{KeyCode, KeyEvent},
WebRenderer,
};
use ratzilla::{event::{KeyCode, KeyEvent}, SelectionMode, WebRenderer};
use examples_shared::backend::{BackendType, MultiBackendBuilder};
use ratzilla::backend::webgl2::WebGl2BackendOptions;

fn main() -> io::Result<()> {
std::panic::set_hook(Box::new(console_error_panic_hook::hook));

let webgl2_options = WebGl2BackendOptions::new()
.enable_mouse_selection_with_mode(SelectionMode::Linear)
.measure_performance(true);

let terminal = MultiBackendBuilder::with_fallback(BackendType::Dom)
.webgl2_options(webgl2_options)
.build_terminal()?;

let state = Rc::new(App::default());
Expand Down
9 changes: 9 additions & 0 deletions examples/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Ratzilla Demo</title>
<style>
html {
height: 100%;
}
body {
height: calc(100% - 40px);
margin: 20px;
display: flex;
flex-direction: column;
Expand All @@ -14,6 +18,11 @@
align-content: center;
background-color: #121212;
}
canvas {
display: block;
width: calc(100vw - 40px);
height: 100%;
}
pre {
font-family: "Fira Code", monospace;
font-size: 16px;
Expand Down
6 changes: 1 addition & 5 deletions examples/demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,13 @@ mod ui;
fn main() -> Result<()> {
let app_state = Rc::new(RefCell::new(App::new("Demo", true)));

// Create backend with explicit size like main branch (1600x900)
let canvas_options = CanvasBackendOptions::new().size((1600, 900));

let webgl2_options = WebGl2BackendOptions::new()
.measure_performance(true)
.enable_console_debug_api()
.enable_mouse_selection()
.size((1600, 900));
.disable_auto_css_resize(); // canvas size managed by css in index.html

let terminal = MultiBackendBuilder::with_fallback(BackendType::WebGl2)
.canvas_options(canvas_options)
.webgl2_options(webgl2_options)
.build_terminal()?;

Expand Down
13 changes: 11 additions & 2 deletions examples/unicode/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@ use ratzilla::ratatui::{
widgets::{Block, Paragraph},
};

use ratzilla::WebRenderer;
use ratzilla::{FontAtlasConfig, SelectionMode, WebRenderer};

use examples_shared::backend::{BackendType, MultiBackendBuilder};
use ratzilla::backend::webgl2::WebGl2BackendOptions;

fn main() -> io::Result<()> {
let terminal = MultiBackendBuilder::with_fallback(BackendType::Dom).build_terminal()?;
let webgl2_options = WebGl2BackendOptions::new()
.enable_mouse_selection_with_mode(SelectionMode::Block)
.enable_console_debug_api()
.measure_performance(true)
.font_atlas_config(FontAtlasConfig::dynamic(&["Maple Mono NF CN"], 15.0));

let terminal = MultiBackendBuilder::with_fallback(BackendType::Dom)
.webgl2_options(webgl2_options)
.build_terminal()?;

terminal.draw_web(move |f| {
f.render_widget(
Expand Down
Loading
Loading