@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/3d.js +4 -3
- package/3d.js.map +3 -3
- package/editor-view.d.ts +1 -1
- package/{index-2yz42vd4.js → index-0wbvecnk.js} +2309 -1636
- package/{index-2yz42vd4.js.map → index-0wbvecnk.js.map} +15 -14
- package/index.js +114 -9
- package/index.js.map +11 -10
- package/lib/KeyHandler.d.ts +1 -4
- package/lib/clock.d.ts +11 -0
- package/lib/index.d.ts +2 -1
- package/lib/parse.mouse.d.ts +2 -2
- package/lib/stdin-parser.d.ts +74 -0
- package/lib/terminal-palette.d.ts +9 -4
- package/lib/tree-sitter/download-utils.d.ts +1 -1
- package/package.json +7 -7
- package/parser.worker.js +7 -7
- package/parser.worker.js.map +3 -3
- package/renderables/Diff.d.ts +7 -0
- package/renderables/TimeToFirstDraw.d.ts +24 -0
- package/renderables/index.d.ts +1 -0
- package/renderer.d.ts +13 -4
- package/testing/manual-clock.d.ts +16 -0
- package/testing.js +1 -1
- package/text-buffer-view.d.ts +1 -1
- package/types.d.ts +9 -4
- package/zig-structs.d.ts +6 -6
- package/zig.d.ts +1 -1
- package/lib/stdin-buffer.d.ts +0 -44
package/testing.js
CHANGED
package/text-buffer-view.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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 ["
|
|
48
|
-
readonly lengthOf: "
|
|
49
|
-
}], readonly ["
|
|
50
|
-
readonly lengthOf: "
|
|
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 ["
|
|
56
|
-
export declare const MeasureResultStruct: import("bun-ffi-structs").DefineStructReturnType<[readonly ["lineCount", "u32"], readonly ["
|
|
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
|
-
|
|
175
|
+
widthColsMax: number;
|
|
176
176
|
} | null;
|
|
177
177
|
textBufferViewGetVirtualLineCount: (view: Pointer) => number;
|
|
178
178
|
readonly encoder: TextEncoder;
|
package/lib/stdin-buffer.d.ts
DELETED
|
@@ -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
|
-
}
|