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 struct MarkdownBlockView {
name : String
matches : (MarkdownBlock) -> Bool
project : (MarkdownBlock, MarkdownBlockViewContext) -> MarkdownBlockViewProjection?
}pub(all) struct MarkdownDocumentBlock {
id : Int
revision : Int
source_range : MarkdownSourceRange
content_range : MarkdownSourceRange
kind : MarkdownBlockKind
text : String
fingerprint : UInt64
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)fn MarkdownDocumentBlockHeightMetric::not_equal(x : MarkdownDocumentBlockHeightMetric, y : MarkdownDocumentBlockHeightMetric) -> Boolfn MarkdownDocumentDirtyRange::equal(MarkdownDocumentDirtyRange, MarkdownDocumentDirtyRange) -> Boolfn MarkdownDocumentDirtyRange::not_equal(x : MarkdownDocumentDirtyRange, y : MarkdownDocumentDirtyRange) -> Boolpub(all) struct MarkdownDocumentHeightIndex {
visual_content_units : Double
source_content_units : Double
blocks : Array[MarkdownDocumentBlockHeightMetric]
} derive(Eq, ToJson, Debug)fn MarkdownDocumentHeightIndex::equal(MarkdownDocumentHeightIndex, MarkdownDocumentHeightIndex) -> Boolfn MarkdownDocumentHeightIndex::not_equal(x : MarkdownDocumentHeightIndex, y : MarkdownDocumentHeightIndex) -> Boolpub(all) struct MarkdownDocumentLayoutBlock {
block_id : Int
block_index : Int
revision : Int
top : Double
height : Double
source_range : MarkdownSourceRange
} derive(Eq, ToJson, Debug)fn MarkdownDocumentLayoutBlock::equal(MarkdownDocumentLayoutBlock, MarkdownDocumentLayoutBlock) -> Boolfn MarkdownDocumentLayoutBlock::not_equal(x : MarkdownDocumentLayoutBlock, y : MarkdownDocumentLayoutBlock) -> Boolpub(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::equal(MarkdownDocumentLayoutCache, MarkdownDocumentLayoutCache) -> Boolfn MarkdownDocumentLayoutCache::not_equal(x : MarkdownDocumentLayoutCache, y : MarkdownDocumentLayoutCache) -> Boolpub(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
clip_lines : Int
} derive(Eq, ToJson, Debug)fn MarkdownDocumentRichTextWindow::not_equal(x : MarkdownDocumentRichTextWindow, y : MarkdownDocumentRichTextWindow) -> Boolpub(all) struct MarkdownDocumentSession {
text_store : MarkdownDocumentTextStore
source_length : Int
source_digest : UInt64
document_identity : 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, content_width? : Double) -> Doublefn MarkdownDocumentSession::not_equal(x : MarkdownDocumentSession, y : MarkdownDocumentSession) -> Boolfn 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, content_width? : 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, content_width? : Double) -> 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 MarkdownDocumentTextStore {
segments : Ref[Array[MarkdownTextSegment]]
revision : Ref[Int]
materialized : Ref[(Int, String)]
}impl Eq for MarkdownDocumentTextStoreimpl ToJson for MarkdownDocumentTextStoreimpl Debug for MarkdownDocumentTextStorefn MarkdownDocumentTextStore::edit(self : MarkdownDocumentTextStore, range : MarkdownSourceRange, replacement : String) -> Unitfn MarkdownDocumentTextStore::equal(self : MarkdownDocumentTextStore, other : MarkdownDocumentTextStore) -> Boolfn MarkdownDocumentTextStore::not_equal(x : MarkdownDocumentTextStore, y : MarkdownDocumentTextStore) -> Boolfn MarkdownDocumentTextStore::segmented(source : String, boundaries : Array[Int]) -> MarkdownDocumentTextStorefn MarkdownDocumentTextStore::text_of(self : MarkdownDocumentTextStore, start : Int, end : Int) -> Stringpub(all) struct MarkdownEditTransaction {
previous_source : String
source : String
edit_range : MarkdownSourceRange
replacement : String
deleted : String
caret : Int
selection : TextRange?
reason : MarkdownEditReason
} derive(Eq, ToJson, Debug)fn MarkdownEditTransaction::from_edit(previous_source : String, source : String, start : Int, deleted~ : String, replacement~ : String, caret~ : Int, selection? : TextRange?, reason? : MarkdownEditReason) -> MarkdownEditTransactionfn 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::not_equal(x : MarkdownEditTransaction, y : MarkdownEditTransaction) -> Boolfn 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) enum MarkdownEditorCommand {
Bold
Italic
Code
Strikethrough
Highlight
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 MarkdownEditorEditResult {
source : String
caret : Int
selection : TextRange?
edit_range : MarkdownSourceRange?
} derive(Eq, ToJson, Debug)fn MarkdownEditorEditResult::not_equal(x : MarkdownEditorEditResult, y : MarkdownEditorEditResult) -> Boolfn MarkdownEditorHtmlBlockParseResult::not_equal(x : MarkdownEditorHtmlBlockParseResult, y : MarkdownEditorHtmlBlockParseResult) -> Boolfn MarkdownEditorIndentedCodeParseResult::not_equal(x : MarkdownEditorIndentedCodeParseResult, y : MarkdownEditorIndentedCodeParseResult) -> Boolpub(all) struct MarkdownEditorInputContext {
blocks : Array[MarkdownEditorBlock]
store : MarkdownDocumentTextStore
}fn MarkdownEditorOutlineItem::not_equal(x : MarkdownEditorOutlineItem, y : MarkdownEditorOutlineItem) -> Boolfn MarkdownEditorParagraphParseResult::not_equal(x : MarkdownEditorParagraphParseResult, y : MarkdownEditorParagraphParseResult) -> Boolfn MarkdownEditorRunSourceRange::equal(MarkdownEditorRunSourceRange, MarkdownEditorRunSourceRange) -> Boolfn MarkdownEditorRunSourceRange::not_equal(x : MarkdownEditorRunSourceRange, y : MarkdownEditorRunSourceRange) -> Boolfn MarkdownEditorSelection::not_equal(x : MarkdownEditorSelection, y : MarkdownEditorSelection) -> Boolfn MarkdownEditorSetextHeadingParseResult::not_equal(x : MarkdownEditorSetextHeadingParseResult, y : MarkdownEditorSetextHeadingParseResult) -> Boolpub(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::not_equal(x : MarkdownEditorSnapshot, y : MarkdownEditorSnapshot) -> Boolfn MarkdownEditorSnapshot::parse_with_font(source : String, base : FontSpec, base_dir? : String?) -> MarkdownEditorSnapshotfn MarkdownHtmlBlockParseResult::equal(MarkdownHtmlBlockParseResult, MarkdownHtmlBlockParseResult) -> Boolfn MarkdownHtmlBlockParseResult::not_equal(x : MarkdownHtmlBlockParseResult, y : MarkdownHtmlBlockParseResult) -> Boolfn MarkdownHtmlEntityDecodeResult::not_equal(x : MarkdownHtmlEntityDecodeResult, y : MarkdownHtmlEntityDecodeResult) -> Boolfn MarkdownIndentedCodeParseResult::not_equal(x : MarkdownIndentedCodeParseResult, y : MarkdownIndentedCodeParseResult) -> Boolpub(all) struct MarkdownInline {
text : String
kind : MarkdownInlineKind
target : String?
} derive(Eq, ToJson, Debug)fn MarkdownParagraphParseResult::equal(MarkdownParagraphParseResult, MarkdownParagraphParseResult) -> Boolfn MarkdownParagraphParseResult::not_equal(x : MarkdownParagraphParseResult, y : MarkdownParagraphParseResult) -> Boolpub(all) struct MarkdownReferenceContext {
range : TextRange
bounds : MarkdownLinkBounds
} derive(Eq, Debug)fn MarkdownReferenceContext::not_equal(x : MarkdownReferenceContext, y : MarkdownReferenceContext) -> Boolfn MarkdownScrollGlide::display_offset(self : MarkdownScrollGlide, now_ms : Double, compensation? : Double, scale? : Double) -> Doublefn MarkdownScrollGlide::new(from_y~ : Double, to_y~ : Double, start_ms~ : Double, tau_ms? : Double) -> MarkdownScrollGlidefn MarkdownScrollGlide::offset_at(self : MarkdownScrollGlide, now_ms : Double, scale? : Double) -> Doublefn MarkdownScrollGlide::offset_at_with_compensation(self : MarkdownScrollGlide, now_ms : Double, compensation : Double, scale? : Double) -> Doublefn MarkdownScrollGlide::with_anchor_compensation(self : MarkdownScrollGlide, compensation : Double, max_offset : Double, now_ms? : Double) -> MarkdownScrollGlidefn MarkdownSetextHeadingParseResult::not_equal(x : MarkdownSetextHeadingParseResult, y : MarkdownSetextHeadingParseResult) -> Boolpub(all) struct RichTextBlock {
runs : Array[RichTextRun]
table : RichTextTable?
prefix : String
marker : RichTextMarker?
font : FontSpec?
color : Color?
background : Brush?
border_left : BorderStyle?
inset : Insets
line_height : Double?
corner_radius : Double
rule : Bool
line_align : TextAlign?
source_range : RichTextSourceRange?
content_range : RichTextSourceRange?
} derive(Eq, ToJson, Debug)fn RichTextBlock::new(runs~ : Array[RichTextRun], table? : RichTextTable?, prefix? : String, marker? : RichTextMarker?, 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?, line_align? : TextAlign?) -> RichTextBlockpub(all) struct RichTextInputTransform {
text : String
caret : Int
selection : TextRange?
edit_range : MarkdownSourceRange?
} derive(Eq, ToJson, Debug)fn RichTextInputTransform::new(text~ : String, caret~ : Int, selection? : TextRange?, edit_range? : MarkdownSourceRange?) -> RichTextInputTransformfn RichTextInputTransform::not_equal(x : RichTextInputTransform, y : RichTextInputTransform) -> Boolpub(all) struct RichTextRun {
text : String
visual_text : String?
image_source : String?
image_size : Size?
image_width_fraction : Double?
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?, image_width_fraction? : Double?) -> RichTextRunpub(all) struct RichTextTableCell {
text : String
runs : Array[RichTextRun]
header : Bool
align : TextAlign?
source_range : RichTextSourceRange?
} derive(Eq, ToJson, Debug)fn[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, scroll_glide? : MarkdownScrollGlide, on_scroll? : (Double, Double) -> Msg?, visible_viewport_height? : Double, visible_overscan? : Double, 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, on_scroll? : (Double) -> Msg?, visible_viewport_height? : Double, visible_overscan? : Double, 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~ : 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, context? : MarkdownEditorInputContext?, split_paragraph_on_enter? : Bool) -> RichTextInputTransform?fn markdown_image_metrics_note_bytes(source : String, bytes : Bytes) -> Boolfn markdown_scroll_peek_geometry_compensation() -> Doublefn markdown_scroll_publish_frame_time(now_ms : Double) -> Unitfn markdown_scroll_publish_geometry_compensation(delta : Double) -> Unitfn markdown_scroll_take_geometry_compensation() -> Doublefn markdown_set_image_metrics_reader(reader : (String) -> Bytes?) -> Unitfn markdown_set_remote_image_reader(reader : (String) -> Bytes?) -> Unitfn 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, block_width? : Double) -> DoubleInstall
Download zipOptional rich text and markdown addon for MoUI
Dependencies