Files
rustui-playground/Cargo.toml
zhangheng f76d341501 feat(terminal): Chinese / IME input (P3)
Implement IME composition support and migrate regular character input to
a hidden textarea, matching the xterm.js approach.

Key changes:
- Add a hidden, absolutely-positioned `<textarea>` inside `.terminal-screen`
  that follows the terminal cursor cell. It receives focus on click, connect,
  and resize so the OS/browser IME candidate window appears at the cursor.
- `on:input` now sends regular printable characters; `on:keydown` only handles
  special keys (arrows, Enter, Esc, Backspace, F-keys, Ctrl combos).
- `on:compositionstart/end` track IME sessions and send the final composed
  string at the end, avoiding partial pinyin/jamo/kana leaks.
- Move `on:paste` and `on:keydown` from `.terminal-screen` to the textarea so
  focus stays on the IME target.
- Replace `.terminal-screen:focus` with `:focus-within` since the screen div
  no longer holds focus.
- Add `is_regular_text_input` helper and unit test.

Web-sys features extended with `InputEvent` and `CompositionEvent`.

Tests: 24/24 pass, clippy clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 16:09:45 +08:00

84 lines
2.3 KiB
TOML

[workspace]
resolver = "2"
members = ["app", "server", "app_config"]
[workspace.dependencies]
app_config = { path = "app_config" }
icons = { path = "../ui/crates/icons", features = ["leptos"] }
registry = { path = "../ui/app_crates/registry" }
leptos_ui = { path = "../ui/crates/leptos_ui" }
tw_merge = { path = "../ui/crates/tw_merge/tw_merge", features = ["variant"] }
tw_merge_variants = { path = "../ui/crates/tw_merge/tw_merge_variants" }
axum = { version = "0.8", features = ["ws"] }
console_error_panic_hook = "0.1"
console_log = "1"
futures-util = "0.3"
leptos = { version = "0.8", features = ["nightly"] }
leptos_axum = "0.8"
leptos_meta = "0.8"
leptos_router = { version = "0.8", features = ["nightly"] }
log = "0.4"
portable-pty = "0.9"
redis = { version = "0.32", features = ["tokio-comp"] }
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
strum = { version = "0.27", features = ["derive"] }
time = { version = "0.3", features = ["serde", "wasm-bindgen"] }
tokio = { version = "1", features = ["rt-multi-thread", "sync"] }
tower = "0.5"
tower-http = { version = "0.6", features = ["fs"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
validator = { version = "0.20", features = ["derive"] }
vt100 = "0.15"
heck = "0.5"
js-sys = "0.3"
wasm-bindgen = "0.2"
wasm-bindgen-futures = "0.4"
web-sys = { version = "0.3", default-features = false, features = [
"BinaryType",
"Clipboard",
"ClipboardEvent",
"CloseEvent",
"CompositionEvent",
"console",
"DataTransfer",
"Document",
"DomRect",
"DomRectReadOnly",
"Element",
"ErrorEvent",
"Event",
"EventTarget",
"HtmlElement",
"InputEvent",
"KeyboardEvent",
"Location",
"MessageEvent",
"MouseEvent",
"Navigator",
"ResizeObserver",
"ResizeObserverEntry",
"WebSocket",
"WheelEvent",
"Window",
] }
[[workspace.metadata.leptos]]
name = "base_path_demo"
bin-package = "server"
lib-package = "app"
site-root = "target/site"
site-pkg-dir = "pkg"
tailwind-input-file = "style/tailwind.css"
assets-dir = "public"
site-addr = "127.0.0.1:3100"
reload-port = 3101
browserquery = "defaults"
bin-features = []
bin-default-features = false
lib-features = ["hydrate"]
lib-default-features = false