@opentui/core
Advanced tools
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
+9
-2
| import { RGBA } from "./lib/RGBA.js"; | ||
| import { type EditorViewHandle, type RenderLib, type VisualCursor, type LineInfo } from "./zig.js"; | ||
| import type { EditBuffer } from "./edit-buffer.js"; | ||
| import type { SelectionBehavior, SelectionOccupancy } from "./types.js"; | ||
| export interface Viewport { | ||
@@ -37,5 +38,10 @@ offsetY: number; | ||
| hasSelection(): boolean; | ||
| setLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, updateCursor?: boolean, followCursor?: boolean): boolean; | ||
| updateLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, updateCursor?: boolean, followCursor?: boolean): boolean; | ||
| setLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, updateCursor?: boolean, followCursor?: boolean, behavior?: SelectionBehavior): boolean; | ||
| updateLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, updateCursor?: boolean, followCursor?: boolean, behavior?: SelectionBehavior): boolean; | ||
| resetLocalSelection(): void; | ||
| convertSelectionToCell(): boolean; | ||
| setSelectionOccupancy(occupancy: SelectionOccupancy): void; | ||
| getSelectionOccupancy(): SelectionOccupancy; | ||
| setSelectionInclusive(start: number, end: number, bgColor?: RGBA, fgColor?: RGBA): void; | ||
| setSelectionColors(bgColor?: RGBA, fgColor?: RGBA): void; | ||
| getSelectedText(): string; | ||
@@ -57,2 +63,3 @@ getCursor(): { | ||
| getVisualEOL(): VisualCursor; | ||
| gotoVisualLineEnd(): void; | ||
| getLineInfo(): LineInfo; | ||
@@ -59,0 +66,0 @@ getLogicalLineInfo(): LineInfo; |
| import { Renderable } from "../Renderable.js"; | ||
| import type { ViewportBounds } from "../types.js"; | ||
| import type { SelectionBehavior, ViewportBounds } from "../types.js"; | ||
| import { fonts } from "./ascii.font.js"; | ||
@@ -12,2 +12,3 @@ export declare class Selection { | ||
| private _isStart; | ||
| behavior: SelectionBehavior; | ||
| constructor(anchorRenderable: Renderable, anchor: { | ||
@@ -19,3 +20,3 @@ x: number; | ||
| y: number; | ||
| }); | ||
| }, behavior?: SelectionBehavior); | ||
| get isStart(): boolean; | ||
@@ -52,2 +53,3 @@ set isStart(value: boolean); | ||
| isActive: boolean; | ||
| behavior: SelectionBehavior; | ||
| } | ||
@@ -54,0 +56,0 @@ export declare function convertGlobalToLocalSelection(globalSelection: Selection | null, localX: number, localY: number): LocalSelectionBounds | null; |
+9
-9
@@ -7,3 +7,3 @@ { | ||
| "type": "module", | ||
| "version": "0.5.6", | ||
| "version": "0.5.7", | ||
| "description": "OpenTUI is a TypeScript library on a native Zig core for building terminal user interfaces (TUIs)", | ||
@@ -79,11 +79,11 @@ "license": "MIT", | ||
| "optionalDependencies": { | ||
| "@opentui/core-darwin-x64": "0.5.6", | ||
| "@opentui/core-darwin-arm64": "0.5.6", | ||
| "@opentui/core-linux-x64": "0.5.6", | ||
| "@opentui/core-linux-arm64": "0.5.6", | ||
| "@opentui/core-win32-x64": "0.5.6", | ||
| "@opentui/core-win32-arm64": "0.5.6", | ||
| "@opentui/core-linux-x64-musl": "0.5.6", | ||
| "@opentui/core-linux-arm64-musl": "0.5.6" | ||
| "@opentui/core-darwin-x64": "0.5.7", | ||
| "@opentui/core-darwin-arm64": "0.5.7", | ||
| "@opentui/core-linux-x64": "0.5.7", | ||
| "@opentui/core-linux-arm64": "0.5.7", | ||
| "@opentui/core-win32-x64": "0.5.7", | ||
| "@opentui/core-win32-arm64": "0.5.7", | ||
| "@opentui/core-linux-x64-musl": "0.5.7", | ||
| "@opentui/core-linux-arm64-musl": "0.5.7" | ||
| } | ||
| } |
@@ -6,3 +6,3 @@ import { Renderable, type RenderableOptions } from "../Renderable.js"; | ||
| import { RGBA } from "../lib/RGBA.js"; | ||
| import type { RenderContext, Highlight, CursorStyleOptions, LineInfoProvider, LineInfo } from "../types.js"; | ||
| import type { RenderContext, Highlight, CursorStyleOptions, LineInfoProvider, LineInfo, SelectionOccupancy } from "../types.js"; | ||
| import type { OptimizedBuffer } from "../buffer.js"; | ||
@@ -40,2 +40,3 @@ import type { SyntaxStyle } from "../syntax-style.js"; | ||
| cursorStyle?: CursorStyleOptions; | ||
| selectionOccupancy?: SelectionOccupancy; | ||
| syntaxStyle?: SyntaxStyle; | ||
@@ -125,2 +126,4 @@ tabIndicator?: string | number; | ||
| set cursorStyle(style: CursorStyleOptions); | ||
| get selectionOccupancy(): SelectionOccupancy; | ||
| set selectionOccupancy(value: SelectionOccupancy | null | undefined); | ||
| get tabIndicator(): string | number | undefined; | ||
@@ -159,2 +162,3 @@ set tabIndicator(value: string | number | undefined); | ||
| deleteLine(): boolean; | ||
| private collapseSelectionToEdge; | ||
| moveCursorLeft(options?: { | ||
@@ -161,0 +165,0 @@ select?: boolean; |
+5
-2
| import { Renderable, RootRenderable } from "./Renderable.js"; | ||
| import { DebugOverlayCorner, type CursorStyleOptions, type MousePointerStyle, type RenderContext, type TerminalCapabilities, type ThemeMode, type WidthMethod } from "./types.js"; | ||
| import { DebugOverlayCorner, type CursorStyleOptions, type MousePointerStyle, type RenderContext, type TerminalCapabilities, type ThemeMode, type SelectionBehavior, type WidthMethod } from "./types.js"; | ||
| import { RGBA, type ColorInput } from "./lib/RGBA.js"; | ||
@@ -298,2 +298,3 @@ import { OptimizedBuffer } from "./buffer.js"; | ||
| private selectionContainers; | ||
| private lastClick; | ||
| private clipboard; | ||
@@ -589,2 +590,3 @@ private _splitHeight; | ||
| clearSelection(): void; | ||
| private clearSelectionState; | ||
| /** | ||
@@ -594,3 +596,4 @@ * Start a new selection at the given coordinates. | ||
| */ | ||
| startSelection(renderable: Renderable, x: number, y: number): void; | ||
| startSelection(renderable: Renderable, x: number, y: number, behavior?: SelectionBehavior): void; | ||
| private nextClickBehavior; | ||
| updateSelection(currentRenderable: Renderable | undefined, x: number, y: number, options?: { | ||
@@ -597,0 +600,0 @@ finishDragging?: boolean; |
+2
-2
@@ -5,7 +5,7 @@ // @bun | ||
| CliRenderer | ||
| } from "./chunk-bun-da1keqyp.js"; | ||
| } from "./chunk-bun-z4gs6jzg.js"; | ||
| import { | ||
| SystemClock, | ||
| TreeSitterClient | ||
| } from "./chunk-bun-9335djz2.js"; | ||
| } from "./chunk-bun-xmsp0nqq.js"; | ||
@@ -12,0 +12,0 @@ // src/testing/mock-keys.ts |
+2
-2
| import { | ||
| ANSI, | ||
| CliRenderer | ||
| } from "./chunk-node-ks0581vk.js"; | ||
| } from "./chunk-node-591ssncm.js"; | ||
| import { | ||
| SystemClock, | ||
| TreeSitterClient | ||
| } from "./chunk-node-2h23nsbj.js"; | ||
| } from "./chunk-node-267dafd8.js"; | ||
@@ -10,0 +10,0 @@ // src/testing/mock-keys.ts |
| import { RGBA } from "./lib/RGBA.js"; | ||
| import { type LineInfo, type MeasureResult, type RenderLib, type TextBufferViewHandle } from "./zig.js"; | ||
| import type { TextBuffer } from "./text-buffer.js"; | ||
| import type { SelectionBehavior, SelectionOccupancy } from "./types.js"; | ||
| export declare class TextBufferView { | ||
@@ -21,5 +22,7 @@ private lib; | ||
| hasSelection(): boolean; | ||
| setLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA): boolean; | ||
| updateLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA): boolean; | ||
| setLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, behavior?: SelectionBehavior): boolean; | ||
| updateLocalSelection(anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor?: RGBA, fgColor?: RGBA, behavior?: SelectionBehavior): boolean; | ||
| resetLocalSelection(): void; | ||
| setSelectionOccupancy(occupancy: SelectionOccupancy): void; | ||
| getSelectionOccupancy(): SelectionOccupancy; | ||
| setWrapWidth(width: number | null): void; | ||
@@ -26,0 +29,0 @@ setWrapMode(mode: "none" | "char" | "word"): void; |
+10
-1
@@ -27,2 +27,11 @@ import type { RGBA } from "./lib/RGBA.js"; | ||
| export type CursorStyle = "block" | "line" | "underline" | "default"; | ||
| /** How a selection occupies cells between stored anchor and focus offsets. | ||
| * Independent of `cursorStyle` (CSI `q` is paint). Default `cell` includes | ||
| * the grapheme under the max endpoint. `boundary` is the half-open insert | ||
| * range `[min, max)`. */ | ||
| export type SelectionOccupancy = "cell" | "boundary"; | ||
| /** How local cell coordinates expand into a highlight range. | ||
| * `cell` is the current inclusive press/drag. `word` and `line` expand | ||
| * each endpoint through native selectWord / selectLine. */ | ||
| export type SelectionBehavior = "cell" | "word" | "line"; | ||
| export type MousePointerStyle = "default" | "pointer" | "text" | "crosshair" | "move" | "not-allowed"; | ||
@@ -132,3 +141,3 @@ export interface CursorStyleOptions { | ||
| clearSelection: () => void; | ||
| startSelection: (renderable: Renderable, x: number, y: number) => void; | ||
| startSelection: (renderable: Renderable, x: number, y: number, behavior?: SelectionBehavior) => void; | ||
| updateSelection: (currentRenderable: Renderable | undefined, x: number, y: number, options?: { | ||
@@ -135,0 +144,0 @@ finishDragging?: boolean; |
+1
-1
@@ -96,3 +96,3 @@ // @bun | ||
| yoga_default | ||
| } from "./chunk-bun-9335djz2.js"; | ||
| } from "./chunk-bun-xmsp0nqq.js"; | ||
| export { | ||
@@ -99,0 +99,0 @@ yoga_default as default, |
+1
-1
@@ -95,3 +95,3 @@ import { | ||
| yoga_default | ||
| } from "./chunk-node-2h23nsbj.js"; | ||
| } from "./chunk-node-267dafd8.js"; | ||
| export { | ||
@@ -98,0 +98,0 @@ yoga_default as default, |
+12
-5
| import { type FFICallbackInstance, type Pointer } from "./platform/ffi.js"; | ||
| import { type CursorStyle, type CursorStyleOptions, type TargetChannel, type DebugOverlayCorner, type WidthMethod, type TerminalCapabilities, type Highlight, type LineInfo, type ImageRenderProtocol } from "./types.js"; | ||
| import { type CursorStyle, type CursorStyleOptions, type SelectionOccupancy, type SelectionBehavior, type TargetChannel, type DebugOverlayCorner, type WidthMethod, type TerminalCapabilities, type Highlight, type LineInfo, type ImageRenderProtocol } from "./types.js"; | ||
| export type { LineInfo, AllocatorStats, AudioStreamCreateOptions, BuildOptions, NativeAudioCaptureStats, NativeAudioStreamStats, NativeRenderStats, }; | ||
@@ -477,6 +477,8 @@ import { RGBA } from "./lib/RGBA.js"; | ||
| } | null; | ||
| textBufferViewSetLocalSelection: (view: TextBufferViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null) => boolean; | ||
| textBufferViewSetLocalSelection: (view: TextBufferViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, behavior?: SelectionBehavior) => boolean; | ||
| textBufferViewUpdateSelection: (view: TextBufferViewHandle, end: number, bgColor: RGBA | null, fgColor: RGBA | null) => void; | ||
| textBufferViewUpdateLocalSelection: (view: TextBufferViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null) => boolean; | ||
| textBufferViewUpdateLocalSelection: (view: TextBufferViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, behavior?: SelectionBehavior) => boolean; | ||
| textBufferViewResetLocalSelection: (view: TextBufferViewHandle) => void; | ||
| textBufferViewSetSelectionOccupancy: (view: TextBufferViewHandle, occupancy: SelectionOccupancy) => void; | ||
| textBufferViewGetSelectionOccupancy: (view: TextBufferViewHandle) => SelectionOccupancy; | ||
| textBufferViewSetWrapWidth: (view: TextBufferViewHandle, width: number) => void; | ||
@@ -577,6 +579,10 @@ textBufferViewSetWrapMode: (view: TextBufferViewHandle, mode: "none" | "char" | "word") => void; | ||
| } | null; | ||
| editorViewSetLocalSelection: (view: EditorViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, updateCursor: boolean, followCursor: boolean) => boolean; | ||
| editorViewSetLocalSelection: (view: EditorViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, updateCursor: boolean, followCursor: boolean, behavior?: SelectionBehavior) => boolean; | ||
| editorViewUpdateSelection: (view: EditorViewHandle, end: number, bgColor: RGBA | null, fgColor: RGBA | null) => void; | ||
| editorViewUpdateLocalSelection: (view: EditorViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, updateCursor: boolean, followCursor: boolean) => boolean; | ||
| editorViewUpdateLocalSelection: (view: EditorViewHandle, anchorX: number, anchorY: number, focusX: number, focusY: number, bgColor: RGBA | null, fgColor: RGBA | null, updateCursor: boolean, followCursor: boolean, behavior?: SelectionBehavior) => boolean; | ||
| editorViewResetLocalSelection: (view: EditorViewHandle) => void; | ||
| editorViewConvertSelectionToCell: (view: EditorViewHandle) => boolean; | ||
| editorViewSetSelectionOccupancy: (view: EditorViewHandle, occupancy: SelectionOccupancy) => void; | ||
| editorViewSetSelectionInclusive: (view: EditorViewHandle, start: number, end: number, bgColor: RGBA | null, fgColor: RGBA | null) => void; | ||
| editorViewSetSelectionColors: (view: EditorViewHandle, bgColor: RGBA | null, fgColor: RGBA | null) => void; | ||
| editorViewGetSelectedTextBytes: (view: EditorViewHandle, maxLength: number) => Uint8Array | null; | ||
@@ -598,2 +604,3 @@ editorViewGetCursor: (view: EditorViewHandle) => { | ||
| editorViewGetVisualEOL: (view: EditorViewHandle) => VisualCursor; | ||
| editorViewGotoVisualLineEnd: (view: EditorViewHandle) => void; | ||
| editorViewGetLineInfo: (view: EditorViewHandle) => LineInfo; | ||
@@ -600,0 +607,0 @@ editorViewGetLogicalLineInfo: (view: EditorViewHandle) => LineInfo; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
13496977
0.3%106629
0.29%53
3.92%