Expand description
Core module for text editing logic and state management in Tessera UI.
This module provides the foundational structures and functions for building text editing components,
including text buffer management, selection and cursor handling, rendering logic, and keyboard event mapping.
It is designed to be shared across UI components via Arc<RwLock<TextEditorState>>
, enabling consistent
and efficient text editing experiences.
Typical use cases include single-line and multi-line text editors, input fields, and any UI element requiring advanced text manipulation, selection, and IME support.
The module integrates with the Tessera component system and rendering pipelines, supporting selection highlighting, cursor blinking, clipboard operations, and extensible keyboard shortcuts.
Most applications should interact with TextEditorState
for state management and text_edit_core()
for rendering and layout within a component tree.
Structs§
- RectDef
- Definition of a rectangular selection highlight Defines a rectangular region for text selection highlighting.
- Text
Editor State - Core text editing state, shared between components Core state for text editing, including content, selection, cursor, and interaction state.
Enums§
- Click
Type - Types of mouse clicks Represents the type of mouse click detected in the editor.
Functions§
- map_
key_ event_ to_ action - Map keyboard events to text editing actions Maps a keyboard event to a list of text editing actions for the editor.
- text_
edit_ core - Core text editing component for rendering text, selection, and cursor.