The built-in WYSIWYG styling module for smidr.widgets.UITextArea. Install an instance as the editor's styler and it renders the UITextStyle bit vocabulary as real formatting: bold / italic / underline / outline runs, a colour palette, inline size tiers, heading sizes, and bullet / numbered list markers with indentation. The static helpers (toggleInline, setBlock, setColor, setSize, inlineAt, blockAt) drive a UIStyledText from a toolbar, so the editor itself stays free of any WYSIWYG knowledge.

Static variables

@:value([0x00000000, 0xFFF05C7C, 0xFFFFCA6E, 0xFF63D68A, 0xFF5A8CFF, 0xFFC558D6, 0xFFE9E7EF, 0xFF7F7D8A])staticPALETTE:Array<Int> = [0x00000000, 0xFFF05C7C, 0xFFFFCA6E, 0xFF63D68A, 0xFF5A8CFF, 0xFFC558D6, 0xFFE9E7EF, 0xFF7F7D8A]

Inline colour palette. Index 0 is the "default" sentinel (resolves to the theme/editor text colour); 1+ are fixed ARGB colours a colour control cycles through.

Static methods

staticblockAt(target:UIStyledText):Int

The block type of the caret's paragraph (for reflecting the heading/list buttons).

staticclearFormatting(target:UIStyledText):Void

Clears character formatting (flags, size, colour) on the selection, keeping the paragraph style.

staticfontSizeAt(target:UIStyledText):Int

The explicit font size at the caret in points, or 0 when it inherits the base size.

staticinlineAt(target:UIStyledText):Int

The inline flags currently in effect at the caret (for reflecting toolbar toggle state).

staticsetBlock(target:UIStyledText, blockType:Int):Void

Sets the block type (UITextStyle.BLOCK_*) on every paragraph the selection touches.

staticsetColor(target:UIStyledText, index:Int):Void

Sets the inline colour palette index over the selection, or for new input.

staticsetFontSize(target:UIStyledText, points:Int):Void

Sets an explicit font size (points; 0 = inherit) over the selection, or for new input.

statictoggleInline(target:UIStyledText, flag:Int):Void

Toggles an inline flag (UITextStyle.BOLD etc.) over the selection, or for new input.

Constructor

new()

Methods

format(attr:Int, baseSize:Int, defaultColor:Int):TextFormat

outlined(attr:Int):Bool

paragraphIndent(attr:Int):Float

paragraphMarker(text:String, attrs:Array<Int>, paragraphStart:Int):Null<String>

styleForNewLine(previousWord:Int):Int