Module text_editor

Source
Expand description

Multi-line text editor component for the Tessera UI framework.

This module provides a robust, customizable multi-line text editor designed for integration into Tessera-based applications. It features a two-layer architecture: a surface layer for visual container and click area, and a core layer for text rendering and editing logic.

§Features

  • Unicode multi-line text editing
  • Full cursor and selection management (mouse, keyboard, drag, double/triple click)
  • IME/preedit support for CJK and complex input
  • Customizable appearance (background, border, shape, padding, selection color)
  • Focus management and event handling
  • Scroll support via mouse wheel or keyboard

§Usage

The editor state is managed externally via TextEditorState (typically wrapped in Arc<RwLock<...>>). The text_editor component can be configured using TextEditorArgs for layout and appearance customization.

Typical use cases include form inputs, code editors, chat boxes, and any scenario requiring rich text input within a Tessera UI application.

Re-exports§

pub use crate::text_edit_core::TextEditorState;

Structs§

TextEditorArgs
Arguments for the text_editor component.
TextEditorArgsBuilder
Builder for TextEditorArgs.

Enums§

TextEditorArgsBuilderError
Error type for TextEditorArgsBuilder

Functions§

text_editor
A text editor component with two-layer architecture: