@opentui/core 0.1.7 → 0.1.8
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/WGPURenderer.d.ts +2 -2
- package/3d.js +225 -6497
- package/3d.js.map +154 -0
- package/Renderable.d.ts +41 -3
- package/buffer.d.ts +1 -1
- package/index.d.ts +0 -3
- package/index.js +2287 -1890
- package/index.js.map +44 -0
- package/lib/RGBA.d.ts +24 -0
- package/lib/ascii.font.d.ts +1 -1
- package/lib/border.d.ts +1 -1
- package/lib/hast-styled-text.d.ts +1 -1
- package/lib/index.d.ts +6 -0
- package/lib/styled-text.d.ts +6 -5
- package/package.json +9 -10
- package/renderables/ASCIIFont.d.ts +2 -1
- package/renderables/Box.d.ts +1 -2
- package/renderables/Input.d.ts +1 -1
- package/renderables/Select.d.ts +1 -1
- package/renderables/TabSelect.d.ts +1 -1
- package/renderables/Text.d.ts +2 -1
- package/renderer.d.ts +11 -2
- package/text-buffer.d.ts +1 -1
- package/types.d.ts +0 -20
- package/utils.d.ts +0 -5
- package/zig.d.ts +1 -1
package/lib/RGBA.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare class RGBA {
|
|
2
|
+
buffer: Float32Array;
|
|
3
|
+
constructor(buffer: Float32Array);
|
|
4
|
+
static fromArray(array: Float32Array): RGBA;
|
|
5
|
+
static fromValues(r: number, g: number, b: number, a?: number): RGBA;
|
|
6
|
+
static fromInts(r: number, g: number, b: number, a?: number): RGBA;
|
|
7
|
+
static fromHex(hex: string): RGBA;
|
|
8
|
+
toInts(): [number, number, number, number];
|
|
9
|
+
get r(): number;
|
|
10
|
+
set r(value: number);
|
|
11
|
+
get g(): number;
|
|
12
|
+
set g(value: number);
|
|
13
|
+
get b(): number;
|
|
14
|
+
set b(value: number);
|
|
15
|
+
get a(): number;
|
|
16
|
+
set a(value: number);
|
|
17
|
+
map<R>(fn: (value: number) => R): R[];
|
|
18
|
+
toString(): string;
|
|
19
|
+
}
|
|
20
|
+
export type ColorInput = string | RGBA;
|
|
21
|
+
export declare function hexToRgb(hex: string): RGBA;
|
|
22
|
+
export declare function rgbToHex(rgb: RGBA): string;
|
|
23
|
+
export declare function hsvToRgb(h: number, s: number, v: number): RGBA;
|
|
24
|
+
export declare function parseColor(color: ColorInput): RGBA;
|
package/lib/ascii.font.d.ts
CHANGED
package/lib/border.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -3,3 +3,9 @@ export * from "./TrackedNode";
|
|
|
3
3
|
export * from "./KeyHandler";
|
|
4
4
|
export * from "./ascii.font";
|
|
5
5
|
export * from "./hast-styled-text";
|
|
6
|
+
export * from "./RGBA";
|
|
7
|
+
export * from "./parse.keypress";
|
|
8
|
+
export * from "./styled-text";
|
|
9
|
+
export * from "./yoga.options";
|
|
10
|
+
export * from "./parse.mouse";
|
|
11
|
+
export * from "./selection";
|
package/lib/styled-text.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TextChunk } from "../text-buffer";
|
|
2
|
-
import type
|
|
2
|
+
import { type ColorInput } from "./RGBA";
|
|
3
3
|
export type Color = ColorInput;
|
|
4
4
|
export interface StyleAttrs {
|
|
5
5
|
fg?: Color;
|
|
@@ -17,10 +17,11 @@ export declare class StyledText {
|
|
|
17
17
|
private _plainText;
|
|
18
18
|
constructor(chunks: TextChunk[]);
|
|
19
19
|
toString(): string;
|
|
20
|
-
private
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
private static _createInstance;
|
|
21
|
+
private static _chunksToPlainText;
|
|
22
|
+
insert(chunk: TextChunk, index?: number): StyledText;
|
|
23
|
+
remove(chunk: TextChunk): StyledText;
|
|
24
|
+
replace(chunk: TextChunk, oldChunk: TextChunk): StyledText;
|
|
24
25
|
}
|
|
25
26
|
export declare function stringToStyledText(content: string): StyledText;
|
|
26
27
|
export type StylableInput = string | number | boolean | TextChunk;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "0.1.
|
|
7
|
+
"version": "0.1.8",
|
|
8
8
|
"description": "OpenTUI is a TypeScript library for building terminal user interfaces (TUIs)",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -30,20 +30,19 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/bun": "latest",
|
|
33
|
-
"@types/three": "
|
|
34
|
-
"commander": "^13.1.0"
|
|
35
|
-
"prettier": "3.6.2"
|
|
33
|
+
"@types/three": "0.177.0",
|
|
34
|
+
"commander": "^13.1.0"
|
|
36
35
|
},
|
|
37
36
|
"optionalDependencies": {
|
|
38
37
|
"@dimforge/rapier2d-simd-compat": "^0.17.3",
|
|
39
38
|
"bun-webgpu": "0.1.3",
|
|
40
39
|
"planck": "^1.4.2",
|
|
41
40
|
"three": "0.177.0",
|
|
42
|
-
"@opentui/core-darwin-x64": "0.1.
|
|
43
|
-
"@opentui/core-darwin-arm64": "0.1.
|
|
44
|
-
"@opentui/core-linux-x64": "0.1.
|
|
45
|
-
"@opentui/core-linux-arm64": "0.1.
|
|
46
|
-
"@opentui/core-win32-x64": "0.1.
|
|
47
|
-
"@opentui/core-win32-arm64": "0.1.
|
|
41
|
+
"@opentui/core-darwin-x64": "0.1.8",
|
|
42
|
+
"@opentui/core-darwin-arm64": "0.1.8",
|
|
43
|
+
"@opentui/core-linux-x64": "0.1.8",
|
|
44
|
+
"@opentui/core-linux-arm64": "0.1.8",
|
|
45
|
+
"@opentui/core-win32-x64": "0.1.8",
|
|
46
|
+
"@opentui/core-win32-arm64": "0.1.8"
|
|
48
47
|
}
|
|
49
48
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { RenderableOptions } from "../Renderable";
|
|
2
|
-
import { RGBA, type SelectionState } from "../types";
|
|
3
2
|
import { type fonts } from "../lib/ascii.font";
|
|
3
|
+
import { RGBA } from "../lib/RGBA";
|
|
4
4
|
import { FrameBufferRenderable } from "./FrameBuffer";
|
|
5
|
+
import type { SelectionState } from "../types";
|
|
5
6
|
export interface ASCIIFontOptions extends RenderableOptions {
|
|
6
7
|
text?: string;
|
|
7
8
|
font?: "tiny" | "block" | "shade" | "slick";
|
package/renderables/Box.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type RenderableOptions, Renderable } from "../Renderable";
|
|
2
2
|
import type { OptimizedBuffer } from "../buffer";
|
|
3
|
-
import { RGBA } from "../
|
|
3
|
+
import { RGBA, type ColorInput } from "../lib/RGBA";
|
|
4
4
|
import { type BorderStyle, type BorderSides, type BorderCharacters, type BorderSidesConfig } from "../lib";
|
|
5
|
-
import type { ColorInput } from "../types";
|
|
6
5
|
export interface BoxOptions extends RenderableOptions {
|
|
7
6
|
backgroundColor?: string | RGBA;
|
|
8
7
|
borderStyle?: BorderStyle;
|
package/renderables/Input.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Renderable, type RenderableOptions } from "../Renderable";
|
|
2
2
|
import { OptimizedBuffer } from "../buffer";
|
|
3
3
|
import type { ParsedKey } from "../lib/parse.keypress";
|
|
4
|
-
import type
|
|
4
|
+
import { type ColorInput } from "../lib/RGBA";
|
|
5
5
|
export interface InputRenderableOptions extends RenderableOptions {
|
|
6
6
|
backgroundColor?: ColorInput;
|
|
7
7
|
textColor?: ColorInput;
|
package/renderables/Select.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Renderable, type RenderableOptions } from "../Renderable";
|
|
|
2
2
|
import { OptimizedBuffer } from "../buffer";
|
|
3
3
|
import { fonts } from "../lib/ascii.font";
|
|
4
4
|
import type { ParsedKey } from "../lib/parse.keypress";
|
|
5
|
-
import type
|
|
5
|
+
import { type ColorInput } from "../lib/RGBA";
|
|
6
6
|
export interface SelectOption {
|
|
7
7
|
name: string;
|
|
8
8
|
description: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Renderable, type RenderableOptions } from "../Renderable";
|
|
2
2
|
import { OptimizedBuffer } from "../buffer";
|
|
3
|
-
import type
|
|
3
|
+
import { type ColorInput } from "../lib/RGBA";
|
|
4
4
|
import type { ParsedKey } from "../lib/parse.keypress";
|
|
5
5
|
export interface TabSelectOption {
|
|
6
6
|
name: string;
|
package/renderables/Text.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Renderable, type RenderableOptions } from "../Renderable";
|
|
2
2
|
import { StyledText } from "../lib/styled-text";
|
|
3
|
-
import { RGBA
|
|
3
|
+
import { RGBA } from "../lib/RGBA";
|
|
4
|
+
import type { SelectionState } from "../types";
|
|
4
5
|
import type { OptimizedBuffer } from "../buffer";
|
|
5
6
|
export interface TextOptions extends RenderableOptions {
|
|
6
7
|
content?: StyledText | string;
|
package/renderer.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Renderable, RootRenderable } from "./Renderable";
|
|
2
|
-
import { type
|
|
2
|
+
import { type CursorStyle, DebugOverlayCorner } from "./types";
|
|
3
|
+
import { RGBA, type ColorInput } from "./lib/RGBA";
|
|
3
4
|
import type { Pointer } from "bun:ffi";
|
|
4
5
|
import { OptimizedBuffer } from "./buffer";
|
|
5
6
|
import { type RenderLib } from "./zig";
|
|
@@ -84,7 +85,6 @@ export declare class CliRenderer extends EventEmitter {
|
|
|
84
85
|
private postProcessFns;
|
|
85
86
|
private backgroundColor;
|
|
86
87
|
private waitingForPixelResolution;
|
|
87
|
-
private shutdownRequested;
|
|
88
88
|
private rendering;
|
|
89
89
|
private renderingNative;
|
|
90
90
|
private renderTimeout;
|
|
@@ -95,6 +95,8 @@ export declare class CliRenderer extends EventEmitter {
|
|
|
95
95
|
private targetFrameTime;
|
|
96
96
|
private immediateRerenderRequested;
|
|
97
97
|
private updateScheduled;
|
|
98
|
+
private liveRequestCounter;
|
|
99
|
+
private controlState;
|
|
98
100
|
private frameCallbacks;
|
|
99
101
|
private renderStats;
|
|
100
102
|
debugOverlay: {
|
|
@@ -139,6 +141,8 @@ export declare class CliRenderer extends EventEmitter {
|
|
|
139
141
|
get useMouse(): boolean;
|
|
140
142
|
set useMouse(useMouse: boolean);
|
|
141
143
|
get experimental_splitHeight(): number;
|
|
144
|
+
get liveRequestCount(): number;
|
|
145
|
+
get currentControlState(): string;
|
|
142
146
|
set experimental_splitHeight(splitHeight: number);
|
|
143
147
|
private interceptStdoutWrite;
|
|
144
148
|
private disableStdoutInterception;
|
|
@@ -176,9 +180,14 @@ export declare class CliRenderer extends EventEmitter {
|
|
|
176
180
|
setFrameCallback(callback: (deltaTime: number) => Promise<void>): void;
|
|
177
181
|
removeFrameCallback(callback: (deltaTime: number) => Promise<void>): void;
|
|
178
182
|
clearFrameCallbacks(): void;
|
|
183
|
+
requestLive(): void;
|
|
184
|
+
dropLive(): void;
|
|
179
185
|
start(): void;
|
|
186
|
+
private internalStart;
|
|
180
187
|
pause(): void;
|
|
188
|
+
private internalPause;
|
|
181
189
|
stop(): void;
|
|
190
|
+
private internalStop;
|
|
182
191
|
destroy(): void;
|
|
183
192
|
private startRenderLoop;
|
|
184
193
|
private loop;
|
package/text-buffer.d.ts
CHANGED
package/types.d.ts
CHANGED
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
export declare class RGBA {
|
|
2
|
-
buffer: Float32Array;
|
|
3
|
-
constructor(buffer: Float32Array);
|
|
4
|
-
static fromArray(array: Float32Array): RGBA;
|
|
5
|
-
static fromValues(r: number, g: number, b: number, a?: number): RGBA;
|
|
6
|
-
static fromInts(r: number, g: number, b: number, a?: number): RGBA;
|
|
7
|
-
static fromHex(hex: string): RGBA;
|
|
8
|
-
toInts(): [number, number, number, number];
|
|
9
|
-
get r(): number;
|
|
10
|
-
set r(value: number);
|
|
11
|
-
get g(): number;
|
|
12
|
-
set g(value: number);
|
|
13
|
-
get b(): number;
|
|
14
|
-
set b(value: number);
|
|
15
|
-
get a(): number;
|
|
16
|
-
set a(value: number);
|
|
17
|
-
map<R>(fn: (value: number) => R): R[];
|
|
18
|
-
toString(): string;
|
|
19
|
-
}
|
|
20
|
-
export type ColorInput = string | RGBA;
|
|
21
1
|
export declare const TextAttributes: {
|
|
22
2
|
NONE: number;
|
|
23
3
|
BOLD: number;
|
package/utils.d.ts
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { type ColorInput, RGBA } from "./types";
|
|
2
|
-
export declare function hexToRgb(hex: string): RGBA;
|
|
3
|
-
export declare function rgbToHex(rgb: RGBA): string;
|
|
4
|
-
export declare function hsvToRgb(h: number, s: number, v: number): RGBA;
|
|
5
|
-
export declare function parseColor(color: ColorInput): RGBA;
|
|
6
1
|
export declare function createTextAttributes({ bold, italic, underline, dim, blink, inverse, hidden, strikethrough, }?: {
|
|
7
2
|
bold?: boolean;
|
|
8
3
|
italic?: boolean;
|
package/zig.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Pointer } from "bun:ffi";
|
|
2
2
|
import type { CursorStyle, DebugOverlayCorner } from "./types";
|
|
3
|
-
import { RGBA } from "./
|
|
3
|
+
import { RGBA } from "./lib/RGBA";
|
|
4
4
|
import { OptimizedBuffer } from "./buffer";
|
|
5
5
|
import { TextBuffer } from "./text-buffer";
|
|
6
6
|
export interface RenderLib {
|