Optional rich text and markdown addon for MoUI
Dependencies
wzzc-dev/moui_richtext does not have a README file
pub(all) struct MarkdownBlock {
kind : MarkdownBlockKind
text : String
inlines : Array[MarkdownInline]
table_alignments : Array[TextAlign?]
code_language : String?
} derive(Eq, ToJson, Debug)pub(all) struct MarkdownDocumentBlock {
id : Int
revision : Int
source_range : MarkdownSourceRange
content_range : MarkdownSourceRange
kind : MarkdownBlockKind
text : String
fingerprint : String
inline_count : Int
} derive(Eq, ToJson, Debug)pub(all) struct MarkdownDocumentBlockHeightMetric {
block_id : Int
block_index : Int
revision : Int
source_range : MarkdownSourceRange
visual_top_units : Double
visual_height_units : Double
source_top_units : Double
source_height_units : Double
} derive(Eq, ToJson, Debug)pub(all) struct MarkdownDocumentHeightIndex {
visual_content_units : Double
source_content_units : Double
blocks : Array[MarkdownDocumentBlockHeightMetric]
} derive(Eq, ToJson, Debug)pub(all) struct MarkdownDocumentLayoutBlock {
block_id : Int
block_index : Int
revision : Int
top : Double
height : Double
source_range : MarkdownSourceRange
} derive(Eq, ToJson, Debug)pub(all) struct MarkdownDocumentLayoutCache {
revision : Int
width : Double
scroll_y : Double
viewport_height : Double
overscan : Double
content_height : Double
visible_start : Int
visible_end : Int
blocks : Array[MarkdownDocumentLayoutBlock]
} derive(Eq, ToJson, Debug)fn MarkdownDocumentLayoutCache::new(session : MarkdownDocumentSession, document : RichTextDocument, base : FontSpec, width~ : Double, scroll_y~ : Double, viewport_height~ : Double, overscan? : Double, text_system? : TextSystem) -> MarkdownDocumentLayoutCachefn MarkdownDocumentLayoutCache::source_offset_y(self : MarkdownDocumentLayoutCache, source_offset : Int) -> Double?pub(all) struct MarkdownDocumentRichTextWindow {
document : RichTextDocument
content_height : Double
top_padding : Double
scroll_y : Double
viewport_height : Double
overscan : Double
visible_start : Int
visible_end : Int
block_count : Int
rendered_block_count : Int
} derive(Eq, ToJson, Debug)fn MarkdownDocumentRichTextWindow::caret_rect_at_source(self : MarkdownDocumentRichTextWindow, source_caret : Int, content : Rect, base_font : FontSpec, text_system? : TextSystem) -> Rect?fn MarkdownDocumentRichTextWindow::content_rect(self : MarkdownDocumentRichTextWindow, content : Rect) -> Rectpub(all) struct MarkdownDocumentSession {
source : String
source_length : Int
blocks : Array[MarkdownDocumentBlock]
editor_blocks : Array[MarkdownEditorBlock]
line_count : Int
word_count : Int
reading_minutes : Int
active_heading : String
metadata_title : String
metadata_tags : Array[String]
outline : Array[MarkdownEditorOutlineItem]
revision : Int
parse_count : Int
next_block_id : Int
dirty_range : MarkdownDocumentDirtyRange?
height_index : MarkdownDocumentHeightIndex
layout_cache : MarkdownDocumentLayoutCache?
} derive(Eq, ToJson, Debug)fn MarkdownDocumentSession::apply(self : MarkdownDocumentSession, transaction : MarkdownEditTransaction) -> MarkdownDocumentSessionfn MarkdownDocumentSession::estimated_content_height(self : MarkdownDocumentSession, base? : FontSpec, source_mode? : Bool) -> Doublefn MarkdownDocumentSession::replace_source(self : MarkdownDocumentSession, source : String, reason? : MarkdownEditReason) -> MarkdownDocumentSessionfn MarkdownDocumentSession::rich_text(self : MarkdownDocumentSession, selection : MarkdownEditorSelection, base? : FontSpec, source_mode? : Bool, focus_mode? : Bool, base_dir? : String?) -> RichTextDocumentfn MarkdownDocumentSession::rich_text_window(self : MarkdownDocumentSession, selection : MarkdownEditorSelection, base? : FontSpec, source_mode? : Bool, focus_mode? : Bool, base_dir? : String?, scroll_y? : Double, viewport_height? : Double, overscan? : Double) -> MarkdownDocumentRichTextWindowfn MarkdownDocumentSession::snapshot(self : MarkdownDocumentSession, base? : FontSpec, base_dir? : String?) -> MarkdownEditorSnapshotfn MarkdownDocumentSession::source_offset_y(self : MarkdownDocumentSession, source_offset : Int, base? : FontSpec, source_mode? : Bool) -> Doublefn MarkdownDocumentSession::with_layout_cache(self : MarkdownDocumentSession, document : RichTextDocument, base : FontSpec, width~ : Double, scroll_y~ : Double, viewport_height~ : Double, overscan? : Double, text_system? : TextSystem) -> MarkdownDocumentSessionpub(all) struct MarkdownEditTransaction {
previous_source : String
source : String
edit_range : MarkdownSourceRange
replacement : String
caret : Int
selection : TextRange?
reason : MarkdownEditReason
} derive(Eq, ToJson, Debug)fn MarkdownEditTransaction::from_edit_result(previous_source : String, result : MarkdownEditorEditResult, reason? : MarkdownEditReason) -> MarkdownEditTransactionfn MarkdownEditTransaction::from_input_transform(previous_source : String, transform : RichTextInputTransform, reason? : MarkdownEditReason) -> MarkdownEditTransactionfn MarkdownEditTransaction::from_sources(previous_source : String, source : String, caret? : Int, selection? : TextRange?, reason? : MarkdownEditReason) -> MarkdownEditTransactionfn MarkdownEditTransaction::replace_all(previous_source : String, source : String, caret? : Int, selection? : TextRange?, reason? : MarkdownEditReason) -> MarkdownEditTransactionpub(all) struct MarkdownEditorBlock {
block : MarkdownBlock
source_range : MarkdownSourceRange
content_range : MarkdownSourceRange
} derive(Eq, ToJson, Debug)pub(all) struct MarkdownEditorBlockGroup {
start_index : Int
end_index : Int
source_start : Int
source_end : Int
}pub(all) enum MarkdownEditorCommand {
Bold
Italic
Code
Strikethrough
Link
Image
SetLinkTarget(String)
SetImageTarget(String)
SetCodeLanguage(String)
SetFootnoteText(String)
SetHtmlBlockText(String)
Paragraph
Heading(Int)
BulletList
TaskList
OrderedList
Quote
CodeBlock
HorizontalRule
Table
InsertTableOfContents
InsertFrontMatter
DuplicateBlock
MoveBlockUp
MoveBlockDown
InsertTableRow
InsertTableColumn
DeleteTableRow
DeleteTableColumn
SetTableColumnAlignment(TextAlign?)
} derive(Eq, ToJson, Debug)pub(all) struct MarkdownEditorFootnoteDefinitionEdit {
source : String
anchor_delta : Int
}pub(all) struct MarkdownEditorFrontMatterParseResult {
block : MarkdownEditorBlock
next_index : Int
} derive(Eq, Debug)pub(all) struct MarkdownEditorLineBlockParts {
context_prefix : String
content_start : Int
content : String
}pub(all) struct MarkdownEditorPasteReferenceCommand {
command : MarkdownEditorCommand
target : String
reference_style : Bool
definition_text : String
}pub(all) struct MarkdownEditorPastedFootnoteDefinition {
label : String
text : String
}pub(all) struct MarkdownEditorPastedReferenceDefinition {
label : String
target : String
definition_text : String
}pub(all) struct MarkdownEditorPastedReferenceTarget {
target : String
image : Bool
reference_style : Bool
}pub(all) struct MarkdownEditorQuotedCodeBlock {
source_range : MarkdownSourceRange
content_range : MarkdownSourceRange
} derive(Eq, Debug)pub(all) struct MarkdownEditorReferenceMarkerTarget {
start : Int
end : Int
label : String
}pub(all) struct MarkdownEditorRenumberResult {
text : String
replacements : Array[MarkdownEditorOffsetReplacement]
} derive(Eq, Debug)pub(all) struct MarkdownEditorSnapshot {
source : String
blocks : Array[MarkdownEditorBlock]
rich_text : RichTextDocument
line_count : Int
word_count : Int
reading_minutes : Int
active_heading : String
metadata_title : String
metadata_tags : Array[String]
outline : Array[MarkdownEditorOutlineItem]
} derive(Eq, ToJson, Debug)fn MarkdownEditorSnapshot::parse_with_font(source : String, base : FontSpec, base_dir? : String?) -> MarkdownEditorSnapshotpub(all) struct MarkdownEditorTableParseResult {
block : MarkdownEditorBlock
end_index : Int
} derive(Eq, Debug)pub(all) struct MarkdownEditorTablePasteTarget {
row : Int
column : Int
}pub(all) struct MarkdownFrontMatterParseResult {
block : MarkdownBlock
next_index : Int
} derive(Eq, Debug)pub(all) struct MarkdownInline {
text : String
kind : MarkdownInlineKind
target : String?
} derive(Eq, ToJson, Debug)pub(all) struct MarkdownReferenceContext {
range : TextRange
bounds : MarkdownLinkBounds
} derive(Eq, Debug)pub(all) struct MarkdownTableCellPreviewRange {
text : String
start : Int
end : Int
}pub(all) struct RichTextBlock {
runs : Array[RichTextRun]
table : RichTextTable?
prefix : String
font : FontSpec?
color : Color?
background : Brush?
border_left : BorderStyle?
inset : Insets
line_height : Double?
corner_radius : Double
rule : Bool
source_range : RichTextSourceRange?
content_range : RichTextSourceRange?
} derive(Eq, ToJson, Debug)fn RichTextBlock::new(runs~ : Array[RichTextRun], table? : RichTextTable?, prefix? : String, font? : FontSpec?, color? : Color?, background? : Brush?, border_left? : BorderStyle?, inset? : Insets, line_height? : Double?, corner_radius? : Double, rule? : Bool, source_range? : RichTextSourceRange?, content_range? : RichTextSourceRange?) -> RichTextBlockfn RichTextInputTransform::new(text~ : String, caret~ : Int, selection? : TextRange?) -> RichTextInputTransformpub(all) struct RichTextRun {
text : String
visual_text : String?
image_source : String?
image_size : Size?
image_fit : ImageFit
font : FontSpec?
color : Color?
background : Brush?
background_radius : Double
decoration : RichTextDecoration?
source_range : RichTextSourceRange?
} derive(Eq, ToJson, Debug)fn RichTextRun::new(text~ : String, visual_text? : String?, image_source? : String?, image_size? : Size?, image_fit? : ImageFit, font? : FontSpec?, color? : Color?, background? : Brush?, background_radius? : Double, decoration? : RichTextDecoration?, source_range? : RichTextSourceRange?) -> RichTextRunpub(all) struct RichTextTableCell {
text : String
header : Bool
align : TextAlign?
source_range : RichTextSourceRange?
} derive(Eq, ToJson, Debug)fn code_highlight_supports_language(language : String) -> Boolfn[Msg] controlled_markdown_editor(value~ : String, on_input~ : (String) -> Msg, placeholder~ : String, size~ : Size, font~ : FontSpec, foreground~ : Color, placeholder_color~ : Color, background~ : Brush, border? : BorderStyle?, focused_border? : BorderStyle?, cursor_color~ : Color, corner_radius? : Double, on_selection_change? : (Int, TextRange?) -> Msg?, on_prefix_click? : (Int) -> Msg?, accepts_tab_input? : Bool, key? : String?) -> View[Msg]fn[Msg] controlled_markdown_session_editor(session~ : MarkdownDocumentSession, selection~ : MarkdownEditorSelection, on_transaction~ : (MarkdownEditTransaction) -> Msg, placeholder~ : String, size~ : Size, font~ : FontSpec, foreground~ : Color, placeholder_color~ : Color, background~ : Brush, border? : BorderStyle?, focused_border? : BorderStyle?, cursor_color~ : Color, corner_radius? : Double, source_mode? : Bool, focus_mode? : Bool, base_dir? : String?, on_selection_change? : (Int, TextRange?) -> Msg?, on_prefix_click? : (Int) -> Msg?, on_command_click? : (Int) -> Msg?, accepts_tab_input? : Bool, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? : ScrollState?, key? : String?) -> View[Msg]fn[Msg] controlled_rich_text_document_editor(value~ : String, document~ : RichTextDocument, on_input~ : (String) -> Msg, placeholder~ : String, size~ : Size, font~ : FontSpec, foreground~ : Color, placeholder_color~ : Color, background~ : Brush, border? : BorderStyle?, focused_border? : BorderStyle?, cursor_color~ : Color, corner_radius? : Double, on_selection_change? : (Int, TextRange?) -> Msg?, on_prefix_click? : (Int) -> Msg?, on_command_click? : (Int) -> Msg?, input_transform? : (String, Int, TextRange?, String) -> RichTextInputTransform??, accepts_tab_input? : Bool, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? : ScrollState?, selection_caret? : Int, selection_range? : TextRange?, kind? : String, key? : String?) -> View[Msg]fn[Msg] controlled_rich_text_editor(value~ : String, on_input~ : (String) -> Msg, placeholder~ : String, size~ : Size, format~ : (String) -> RichTextDocument, font~ : FontSpec, foreground~ : Color, placeholder_color~ : Color, background~ : Brush, border? : BorderStyle?, focused_border? : BorderStyle?, cursor_color~ : Color, corner_radius? : Double, on_selection_change? : (Int, TextRange?) -> Msg?, on_prefix_click? : (Int) -> Msg?, on_command_click? : (Int) -> Msg?, input_transform? : (String, Int, TextRange?, String) -> RichTextInputTransform??, accepts_tab_input? : Bool, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? : ScrollState?, selection_caret? : Int, selection_range? : TextRange?, kind? : String, key? : String?) -> View[Msg]fn markdown_block_to_rich_text(block : MarkdownBlock, base : FontSpec, base_dir? : String?) -> RichTextBlockfn[Msg] markdown_editor(value~ : Binding[String], placeholder~ : String, size~ : Size, font~ : FontSpec, foreground~ : Color, placeholder_color~ : Color, background~ : Brush, border? : BorderStyle?, focused_border? : BorderStyle?, cursor_color~ : Color, corner_radius? : Double, on_input? : (String) -> Msg?, on_selection_change? : (Int, TextRange?) -> Msg?, on_prefix_click? : (Int) -> Msg?, accepts_tab_input? : Bool, key? : String?) -> View[Msg]fn markdown_editor_active_block_label(source : String, selection : MarkdownEditorSelection) -> Stringfn markdown_editor_apply_command_at(source : String, command : MarkdownEditorCommand, selection : MarkdownEditorSelection?) -> MarkdownEditorEditResultfn markdown_editor_clamp_int(value : Int, min : Int, max : Int) -> Intfn markdown_editor_format(source : String, base? : FontSpec, base_dir? : String?) -> RichTextDocumentfn markdown_editor_format_for_selection(source : String, selection : MarkdownEditorSelection, base? : FontSpec, base_dir? : String?) -> RichTextDocumentfn markdown_editor_format_for_writing_mode(source : String, selection : MarkdownEditorSelection, base? : FontSpec, focus_mode~ : Bool, base_dir? : String?) -> RichTextDocumentfn markdown_editor_image_context(source : String, selection : MarkdownEditorSelection) -> MarkdownReferenceContext?fn markdown_editor_indent_lines(source : String, caret : Int, selection : TextRange?) -> RichTextInputTransformfn markdown_editor_inline_marker_pair_at_caret(source : String, caret : Int, marker : String) -> TextRange?fn markdown_editor_insert_hard_break(source : String, caret : Int, selection : TextRange?) -> RichTextInputTransform?fn markdown_editor_link_context(source : String, selection : MarkdownEditorSelection) -> MarkdownReferenceContext?fn markdown_editor_outdent_lines(source : String, caret : Int, selection : TextRange?) -> RichTextInputTransform?fn markdown_editor_range_has_inline_marker(source : String, range : TextRange, marker : String) -> Boolfn markdown_editor_selected_footnote_text(source : String, selection : MarkdownEditorSelection) -> String?fn markdown_editor_selected_html_block_text(source : String, selection : MarkdownEditorSelection) -> String?fn markdown_editor_selected_image_target(source : String, selection : MarkdownEditorSelection) -> String?fn markdown_editor_selected_link_target(source : String, selection : MarkdownEditorSelection) -> String?fn markdown_editor_substring(source : String, start : Int, end : Int) -> Stringfn markdown_editor_toggle_current_task(source : String, selection : MarkdownEditorSelection) -> MarkdownEditorEditResult?fn markdown_editor_toggle_task_at(source : String, content_offset : Int) -> MarkdownEditorEditResult?fn markdown_editor_transform_input(source : String, caret : Int, selection : TextRange?, input : String) -> RichTextInputTransform?fn markdown_input_transform(source : String, caret : Int, selection : TextRange?, inserted : String) -> RichTextInputTransform?fn[Msg] markdown_viewer(source~ : String, size~ : Size, font? : FontSpec, foreground? : Color, background? : Brush, corner_radius? : Double, on_link_click? : (String) -> Msg?, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? : ScrollState?, key? : String?) -> View[Msg]fn parse_markdown_inlines_with_definitions(text : String, definitions : Array[MarkdownReferenceDefinition]) -> Array[MarkdownInline]fn rich_text_document_caret_rect_at_source(document : RichTextDocument, source_caret : Int, content : Rect, base_font : FontSpec, text_system? : TextSystem) -> Rect?fn rich_text_document_height(document : RichTextDocument, base_font : FontSpec, text_system? : TextSystem) -> Doublefn[Msg] rich_text_editor(value~ : Binding[String], placeholder~ : String, size~ : Size, format~ : (String) -> RichTextDocument, font~ : FontSpec, foreground~ : Color, placeholder_color~ : Color, background~ : Brush, border? : BorderStyle?, focused_border? : BorderStyle?, cursor_color~ : Color, corner_radius? : Double, on_input? : (String) -> Msg?, on_input_edit? : (String, Int, TextRange?) -> Msg?, on_selection_change? : (Int, TextRange?) -> Msg?, on_prefix_click? : (Int) -> Msg?, on_command_click? : (Int) -> Msg?, input_transform? : (String, Int, TextRange?, String) -> RichTextInputTransform??, accepts_tab_input? : Bool, visible_scroll_y? : Double, visible_viewport_height? : Double, visible_overscan? : Double, visible_scroll_state? : ScrollState?, selection_caret? : Int, selection_range? : TextRange?, kind? : String, key? : String?) -> View[Msg]Optional rich text and markdown addon for MoUI
Dependencies