Skip to main content

Module code_block

Module code_block 

Source
Expand description

Code Block module.

This public module implements the Liora syntax-highlighted code block component with copy and selection support. It keeps the reusable component logic inside liora-components rather than Gallery or Docs so downstream GPUI applications can compose the same behavior with their own app state, assets, and release policy.

§Usage model

Components in this module render native GPUI element trees. Stateless builder values can be constructed inline, while controls with focus, selection, popup, drag, or editing state should be stored as gpui::Entity<T> fields in the parent view so state survives GPUI render passes.

§Design contract

The implementation should use Liora theme tokens from liora-core and liora-theme, keep accessibility-oriented keyboard/pointer behavior close to the component, and avoid app-specific Gallery/Docs resources in this SDK crate.

Structs§

CodeBlock
Fluent native GPUI component for rendering Liora code block.
CodeCopy
Keyboard action that copies the selected code block text.
CodeSelectAll
Keyboard action that selects all code in the active code block.

Enums§

CodeFormat
Options that control code format behavior.
CodeHighlighter
Options that control code highlighter behavior.
CodeLanguage
Options that control code language behavior.
CodeTheme
Options that control code theme behavior.