@opentui/core 0.1.85 → 0.1.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/testing.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  CliRenderer,
5
5
  TreeSitterClient,
6
6
  resolveRenderLib
7
- } from "./index-2yz42vd4.js";
7
+ } from "./index-0wbvecnk.js";
8
8
 
9
9
  // src/testing/test-renderer.ts
10
10
  import { Readable } from "stream";
@@ -35,7 +35,7 @@ export declare class TextBufferView {
35
35
  setTruncate(truncate: boolean): void;
36
36
  measureForDimensions(width: number, height: number): {
37
37
  lineCount: number;
38
- maxWidth: number;
38
+ widthColsMax: number;
39
39
  } | null;
40
40
  getVirtualLineCount(): number;
41
41
  destroy(): void;
package/types.d.ts CHANGED
@@ -22,7 +22,7 @@ export declare const ATTRIBUTE_BASE_MASK = 255;
22
22
  */
23
23
  export declare function getBaseAttributes(attr: number): number;
24
24
  export type ThemeMode = "dark" | "light";
25
- export type CursorStyle = "block" | "line" | "underline";
25
+ export type CursorStyle = "block" | "line" | "underline" | "default";
26
26
  export type MousePointerStyle = "default" | "pointer" | "text" | "crosshair" | "move" | "not-allowed";
27
27
  export interface CursorStyleOptions {
28
28
  style?: CursorStyle;
@@ -96,10 +96,15 @@ export interface Highlight {
96
96
  hlRef?: number | null;
97
97
  }
98
98
  export interface LineInfo {
99
- lineStarts: number[];
100
- lineWidths: number[];
101
- maxLineWidth: number;
99
+ /** Display-column offset for each visual line start. */
100
+ lineStartCols: number[];
101
+ /** Display-column width for each visual line. */
102
+ lineWidthCols: number[];
103
+ /** Maximum display-column width across the reported lines. */
104
+ lineWidthColsMax: number;
105
+ /** Source logical line index for each visual line. */
102
106
  lineSources: number[];
107
+ /** Wrap index within each source logical line. */
103
108
  lineWraps: number[];
104
109
  }
105
110
  export interface LineInfoProvider {
package/zig-structs.d.ts CHANGED
@@ -44,16 +44,16 @@ export declare const TerminalCapabilitiesStruct: import("bun-ffi-structs").Defin
44
44
  readonly lengthOf: "term_version";
45
45
  }], readonly ["term_from_xtversion", "bool_u8"]], {}>;
46
46
  export declare const EncodedCharStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["width", "u8"], readonly ["char", "u32"]], {}>;
47
- export declare const LineInfoStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["starts", readonly ["u32"]], readonly ["startsLen", "u32", {
48
- readonly lengthOf: "starts";
49
- }], readonly ["widths", readonly ["u32"]], readonly ["widthsLen", "u32", {
50
- readonly lengthOf: "widths";
47
+ export declare const LineInfoStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["startCols", readonly ["u32"]], readonly ["startColsLen", "u32", {
48
+ readonly lengthOf: "startCols";
49
+ }], readonly ["widthCols", readonly ["u32"]], readonly ["widthColsLen", "u32", {
50
+ readonly lengthOf: "widthCols";
51
51
  }], readonly ["sources", readonly ["u32"]], readonly ["sourcesLen", "u32", {
52
52
  readonly lengthOf: "sources";
53
53
  }], readonly ["wraps", readonly ["u32"]], readonly ["wrapsLen", "u32", {
54
54
  readonly lengthOf: "wraps";
55
- }], readonly ["maxWidth", "u32"]], {}>;
56
- export declare const MeasureResultStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["lineCount", "u32"], readonly ["maxWidth", "u32"]], {}>;
55
+ }], readonly ["widthColsMax", "u32"]], {}>;
56
+ export declare const MeasureResultStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["lineCount", "u32"], readonly ["widthColsMax", "u32"]], {}>;
57
57
  export declare const CursorStateStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["x", "u32"], readonly ["y", "u32"], readonly ["visible", "bool_u8"], readonly ["style", "u8"], readonly ["blinking", "bool_u8"], readonly ["r", "f32"], readonly ["g", "f32"], readonly ["b", "f32"], readonly ["a", "f32"]], {}>;
58
58
  export declare const CursorStyleOptionsStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["style", "u8", {
59
59
  readonly default: 255;
package/zig.d.ts CHANGED
@@ -172,7 +172,7 @@ export interface RenderLib {
172
172
  textBufferViewSetTruncate: (view: Pointer, truncate: boolean) => void;
173
173
  textBufferViewMeasureForDimensions: (view: Pointer, width: number, height: number) => {
174
174
  lineCount: number;
175
- maxWidth: number;
175
+ widthColsMax: number;
176
176
  } | null;
177
177
  textBufferViewGetVirtualLineCount: (view: Pointer) => number;
178
178
  readonly encoder: TextEncoder;
@@ -1,44 +0,0 @@
1
- /**
2
- * StdinBuffer buffers input and emits complete sequences.
3
- *
4
- * This is necessary because stdin data events can arrive in partial chunks,
5
- * especially for escape sequences like mouse events. Without buffering,
6
- * partial sequences can be misinterpreted as regular keypresses.
7
- *
8
- * For example, the mouse SGR sequence `\x1b[<35;20;5m` might arrive as:
9
- * - Event 1: `\x1b`
10
- * - Event 2: `[<35`
11
- * - Event 3: `;20;5m`
12
- *
13
- * The buffer accumulates these until a complete sequence is detected.
14
- * Call the `process()` method to feed input data.
15
- */
16
- import { EventEmitter } from "events";
17
- export type StdinBufferOptions = {
18
- /**
19
- * Maximum time to wait for sequence completion (default: 10ms)
20
- * After this time, the buffer is flushed even if incomplete
21
- */
22
- timeout?: number;
23
- };
24
- export type StdinBufferEventMap = {
25
- data: [string];
26
- paste: [string];
27
- };
28
- /**
29
- * Buffers stdin input and emits complete sequences via the 'data' event.
30
- * Handles partial escape sequences that arrive across multiple chunks.
31
- */
32
- export declare class StdinBuffer extends EventEmitter<StdinBufferEventMap> {
33
- private buffer;
34
- private timeout;
35
- private readonly timeoutMs;
36
- private pasteMode;
37
- private pasteBuffer;
38
- constructor(options?: StdinBufferOptions);
39
- process(data: string | Buffer): void;
40
- flush(): string[];
41
- clear(): void;
42
- getBuffer(): string;
43
- destroy(): void;
44
- }