WysiwygEditor

fun WysiwygEditor(state: RichTextState, modifier: Modifier = Modifier, enabled: Boolean = true, readOnly: Boolean = false, textStyle: TextStyle = TextStyle.Default, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, onKeyboardAction: KeyboardActionHandler? = null, lineLimits: TextFieldLineLimits = TextFieldLineLimits.Default, onTextLayout: Density.(getResult: () -> TextLayoutResult?) -> Unit? = null, scrollState: ScrollState = rememberScrollState(), interactionSource: MutableInteractionSource? = null, cursorBrush: Brush = SolidColor(Color.Black), decorator: TextFieldDecorator? = null, styleResolver: AttributeStyleResolver = DefaultAttributeStyleResolver, listMarkerResolver: ListMarkerResolver = DefaultListMarkerResolver, onSpanClick: (SpanClickEvent) -> Unit? = null, autocompleteTriggers: List<AutocompleteTrigger> = emptyList(), onAutocompleteChange: (AutocompleteMatch?) -> Unit? = null)

A WYSIWYG text editor component that automatically formats Markdown syntax into rich text styling in real time.

Parameters

state

The RichTextState holding the text and its attributes.

modifier

The modifier to be applied to the text field.

enabled

Controls the enabled state of the text field.

readOnly

Controls whether the editor is in read-only mode.

textStyle

The default text style applied to the text field.

keyboardOptions

Software keyboard options.

onKeyboardAction

Called when the user performs an action on the software keyboard.

lineLimits

Whether the text field is single line or multiline.

onTextLayout

Callback invoked when text layout is calculated.

scrollState

The scroll state for scrolling text.

interactionSource

The MutableInteractionSource representing the stream of Interactions for this text field.

cursorBrush

The brush used to draw the cursor.

decorator

Allows adding decorations around the text field.

styleResolver

A resolver that specifies how AttributeContainers should be translated into visually rendered Compose styles.

listMarkerResolver

A resolver that specifies how list markers should be rendered.

onSpanClick

Optional callback invoked when a dev.mkeeda.arranger.richtext.RichSpan is tapped or clicked.

autocompleteTriggers

The list of AutocompleteTrigger patterns to observe during typing.

onAutocompleteChange

Callback invoked whenever the active AutocompleteMatch changes, or null when no trigger is matched.