OpenTUI 0.5.12
Added
- core:
textAlignaligns each line of a text renderable to"left","center", or"right". It works withwrapModeset to"char"or"word". Alignment applies after wrapping.TextBufferView.setTextAlign()sets it on a view. See Text. (#1507) - core:
MousePointerStyleaccepts the full set of CSS cursor names, such as"grab","wait","help", and"col-resize". Terminals differ in which OSC 22 pointer styles they support. See Interaction, focus, and selection. (#1037) - core:
EmbeddedTerminalRenderablehas atransparentBackgroundoption,falseby default. When it istrue, cells with no explicit background use the host terminal background. Cells with an explicit background stay opaque. You can change it after creation. See Embedded terminal. (#1502) - core:
EditorView.isDestroyedreports whether the view has been destroyed. See Editing buffers and views. (#1504) - core:
TextTableRenderablehas anfgproperty that sets the text color of existing cells. See TextTable. (#1503)
Fixed
- core:
MarkdownRenderablepasses itsfgto tables. Table text no longer always uses the#FFFFFFdefault, and a later change tofgrecolors existing tables. See Markdown. (#1503) - core: Reading the cursor of a destroyed editor returns an empty cursor. Listeners that run during destruction no longer throw. See Editing buffers and views. (#1504)
- core: Shrinking the width of a split footer no longer leaves stale rows on screen. Cleanup now starts at the visible footer origin. See Renderer. (#1488)
- core: A scrollback snapshot that starts in the middle of a line stays aligned with the text already written before it. Rendering and hit testing now use the same cells. See Text and terminal cells. (#1511)
- core: A worker error that arrives while the worker is terminating no longer becomes an uncaught exception in Node. See Lifecycle and cleanup. (#1508)
API changes#
@opentui/core#
Added
method TextBufferView.setTextAlign(alignment: "left" | "center" | "right"): voidreadonly property EditorView.isDestroyed: booleanproperty EmbeddedTerminalOptions.transparentBackground?: booleanproperty EmbeddedTerminalRenderable.transparentBackground: booleanproperty RenderLib.embeddedTerminalSetTransparentBackground: (handle: EmbeddedTerminalHandle, transparent: boolean) => voidproperty RenderLib.textBufferViewSetTextAlign: (view: TextBufferViewHandle, alignment: "left" | "center" | "right") => voidproperty TextBufferOptions.textAlign?: "left" | "center" | "right"protected property TextBufferRenderable._textAlign: "left" | "center" | "right"property TextBufferRenderable.textAlign: "left" | "center" | "right"property TextTableRenderable.fg: RGBA
Changed
protected property TextBufferRenderable._defaultOptions: { fg: RGBA; bg: RGBA; selectionBg: undefined; selectionFg: undefined; selectable: true; attributes: number; wrapMode: "none" | "char" | "word"; tabIndicator: undefined; tabIndicatorColor: undefined; truncate: false; }protected property TextBufferRenderable._defaultOptions: { fg: RGBA; bg: RGBA; selectionBg: undefined; selectionFg: undefined; selectable: true; attributes: number; wrapMode: "none" | "char" | "word"; textAlign: "left" | "center" | "right"; tabIndicator: undefined; tabIndicatorColor: undefined; truncate: false; }type MousePointerStyle = "default" | "pointer" | "text" | "crosshair" | "move" | "not-allowed"type MousePointerStyle = "auto" | "default" | "none" | "context-menu" | "help" | "pointer" | "progress" | "wait" | "cell" | "crosshair" | "text" | "vertical-text" | "alias" | "copy" | "move" | "no-drop" | "not-allowed" | "grab" | "grabbing" | "all-scroll" | "col-resize" | "row-resize" | "n-resize" | "e-resize" | "s-resize" | "w-resize" | "ne-resize" | "nw-resize" | "se-resize" | "sw-resize" | "ew-resize" | "ns-resize" | "nesw-resize" | "nwse-resize" | "zoom-in" | "zoom-out"