@opentui/core 0.3.0 → 0.3.2
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/ansi.d.ts +4 -0
- package/{index-081xws23.js → index-218h9p3f.js} +198 -3
- package/{index-081xws23.js.map → index-218h9p3f.js.map} +7 -7
- package/{index-sq86yyfz.js → index-3mx8q5t1.js} +237 -106
- package/index-3mx8q5t1.js.map +35 -0
- package/{index-qwem5zxy.js → index-m0bc6bw1.js} +3 -3
- package/{index-dhbwkghw.js → index-vdnak5x1.js} +2 -2
- package/index.js +5 -3
- package/index.js.map +1 -1
- package/package.json +9 -7
- package/renderables/Code.d.ts +12 -1
- package/renderables/Diff.d.ts +5 -0
- package/renderables/Markdown.d.ts +11 -1
- package/renderables/ScrollBox.d.ts +1 -0
- package/renderer.d.ts +4 -0
- package/runtime-plugin-support-configure.js +4 -4
- package/runtime-plugin-support.js +4 -4
- package/runtime-plugin.js +3 -3
- package/testing.js +1 -1
- package/index-sq86yyfz.js.map +0 -35
- /package/{index-qwem5zxy.js.map → index-m0bc6bw1.js.map} +0 -0
- /package/{index-dhbwkghw.js.map → index-vdnak5x1.js.map} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
exports_src
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-3mx8q5t1.js";
|
|
5
5
|
import {
|
|
6
6
|
__require
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-218h9p3f.js";
|
|
8
8
|
|
|
9
9
|
// src/runtime-plugin.ts
|
|
10
10
|
import { existsSync, readFileSync, realpathSync } from "fs";
|
|
@@ -418,4 +418,4 @@ function createRuntimePlugin(input = {}) {
|
|
|
418
418
|
export { isCoreRuntimeModuleSpecifier, runtimeModuleIdForSpecifier, createRuntimePlugin };
|
|
419
419
|
|
|
420
420
|
//# debugId=4F4ECA92927B118964756E2164756E21
|
|
421
|
-
//# sourceMappingURL=index-
|
|
421
|
+
//# sourceMappingURL=index-m0bc6bw1.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
createRuntimePlugin
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-m0bc6bw1.js";
|
|
5
5
|
|
|
6
6
|
// src/runtime-plugin-support-configure.ts
|
|
7
7
|
var {plugin: registerBunPlugin } = globalThis.Bun;
|
|
@@ -41,4 +41,4 @@ function ensureRuntimePluginSupport(options = {}) {
|
|
|
41
41
|
export { ensureRuntimePluginSupport };
|
|
42
42
|
|
|
43
43
|
//# debugId=09C0597CB92E654F64756E2164756E21
|
|
44
|
-
//# sourceMappingURL=index-
|
|
44
|
+
//# sourceMappingURL=index-vdnak5x1.js.map
|
package/index.js
CHANGED
|
@@ -63,6 +63,7 @@ import {
|
|
|
63
63
|
applySaturation,
|
|
64
64
|
applyScanlines,
|
|
65
65
|
createCoreSlotRegistry,
|
|
66
|
+
createMarkdownCodeBlockRenderer,
|
|
66
67
|
createSlotRegistry,
|
|
67
68
|
createTimeline,
|
|
68
69
|
defaultTextareaKeyBindings,
|
|
@@ -71,7 +72,7 @@ import {
|
|
|
71
72
|
resolveCoreSlot,
|
|
72
73
|
setupAudio,
|
|
73
74
|
vstyles
|
|
74
|
-
} from "./index-
|
|
75
|
+
} from "./index-3mx8q5t1.js";
|
|
75
76
|
import {
|
|
76
77
|
ASCIIFontSelectionHelper,
|
|
77
78
|
ATTRIBUTE_BASE_BITS,
|
|
@@ -246,7 +247,7 @@ import {
|
|
|
246
247
|
white,
|
|
247
248
|
wrapWithDelegates,
|
|
248
249
|
yellow
|
|
249
|
-
} from "./index-
|
|
250
|
+
} from "./index-218h9p3f.js";
|
|
250
251
|
export {
|
|
251
252
|
yellow,
|
|
252
253
|
wrapWithDelegates,
|
|
@@ -339,6 +340,7 @@ export {
|
|
|
339
340
|
createTextAttributes,
|
|
340
341
|
createTerminalPalette,
|
|
341
342
|
createSlotRegistry,
|
|
343
|
+
createMarkdownCodeBlockRenderer,
|
|
342
344
|
createExtmarksController,
|
|
343
345
|
createCoreSlotRegistry,
|
|
344
346
|
createCliRenderer,
|
|
@@ -494,5 +496,5 @@ export {
|
|
|
494
496
|
ACHROMATOPSIA_MATRIX
|
|
495
497
|
};
|
|
496
498
|
|
|
497
|
-
//# debugId=
|
|
499
|
+
//# debugId=1D83681F895D51C264756E2164756E21
|
|
498
500
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
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.3.
|
|
7
|
+
"version": "0.3.2",
|
|
8
8
|
"description": "OpenTUI is a TypeScript library on a native Zig core for building terminal user interfaces (TUIs)",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -69,11 +69,13 @@
|
|
|
69
69
|
"web-tree-sitter": "0.25.10"
|
|
70
70
|
},
|
|
71
71
|
"optionalDependencies": {
|
|
72
|
-
"@opentui/core-darwin-x64": "0.3.
|
|
73
|
-
"@opentui/core-darwin-arm64": "0.3.
|
|
74
|
-
"@opentui/core-linux-x64": "0.3.
|
|
75
|
-
"@opentui/core-linux-arm64": "0.3.
|
|
76
|
-
"@opentui/core-win32-x64": "0.3.
|
|
77
|
-
"@opentui/core-win32-arm64": "0.3.
|
|
72
|
+
"@opentui/core-darwin-x64": "0.3.2",
|
|
73
|
+
"@opentui/core-darwin-arm64": "0.3.2",
|
|
74
|
+
"@opentui/core-linux-x64": "0.3.2",
|
|
75
|
+
"@opentui/core-linux-arm64": "0.3.2",
|
|
76
|
+
"@opentui/core-win32-x64": "0.3.2",
|
|
77
|
+
"@opentui/core-win32-arm64": "0.3.2",
|
|
78
|
+
"@opentui/core-linux-x64-musl": "0.3.2",
|
|
79
|
+
"@opentui/core-linux-arm64-musl": "0.3.2"
|
|
78
80
|
}
|
|
79
81
|
}
|
package/renderables/Code.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RenderContext } from "../types.js";
|
|
1
|
+
import { type LineInfo, type RenderContext } from "../types.js";
|
|
2
2
|
import { SyntaxStyle } from "../syntax-style.js";
|
|
3
3
|
import { TreeSitterClient } from "../lib/tree-sitter/index.js";
|
|
4
4
|
import { TextBufferRenderable, type TextBufferOptions } from "./TextBufferRenderable.js";
|
|
@@ -45,6 +45,8 @@ export declare class CodeRenderable extends TextBufferRenderable {
|
|
|
45
45
|
private _onHighlight?;
|
|
46
46
|
private _onChunks?;
|
|
47
47
|
private _highlightingPromise;
|
|
48
|
+
private _renderedLineSources?;
|
|
49
|
+
private _mappedLineInfo?;
|
|
48
50
|
protected _contentDefaultOptions: {
|
|
49
51
|
content: string;
|
|
50
52
|
conceal: true;
|
|
@@ -54,6 +56,11 @@ export declare class CodeRenderable extends TextBufferRenderable {
|
|
|
54
56
|
constructor(ctx: RenderContext, options: CodeOptions);
|
|
55
57
|
get content(): string;
|
|
56
58
|
set content(value: string);
|
|
59
|
+
get lineInfo(): LineInfo;
|
|
60
|
+
get wrapMode(): "none" | "char" | "word";
|
|
61
|
+
set wrapMode(value: "none" | "char" | "word");
|
|
62
|
+
protected onResize(width: number, height: number): void;
|
|
63
|
+
protected updateTextInfo(): void;
|
|
57
64
|
get filetype(): string | undefined;
|
|
58
65
|
set filetype(value: string | undefined);
|
|
59
66
|
get syntaxStyle(): SyntaxStyle;
|
|
@@ -77,6 +84,10 @@ export declare class CodeRenderable extends TextBufferRenderable {
|
|
|
77
84
|
protected transformChunks(chunks: TextChunk[], context: ChunkRenderContext): Promise<TextChunk[]>;
|
|
78
85
|
private ensureVisibleTextBeforeHighlight;
|
|
79
86
|
private startHighlight;
|
|
87
|
+
private setRenderedLineSources;
|
|
88
|
+
private static isIdentityLineSources;
|
|
89
|
+
private static getMergedConcealLineRanges;
|
|
90
|
+
private getConcealLinesSourceMap;
|
|
80
91
|
getLineHighlights(lineIdx: number): import("../types.js").Highlight[];
|
|
81
92
|
protected renderSelf(buffer: OptimizedBuffer): void;
|
|
82
93
|
}
|
package/renderables/Diff.d.ts
CHANGED
|
@@ -37,6 +37,8 @@ export declare class DiffRenderable extends Renderable {
|
|
|
37
37
|
private _view;
|
|
38
38
|
private _parsedDiff;
|
|
39
39
|
private _parseError;
|
|
40
|
+
private _hunkStartLines;
|
|
41
|
+
private _hunkRowOffsets;
|
|
40
42
|
private _fg?;
|
|
41
43
|
private _filetype?;
|
|
42
44
|
private _syntaxStyle?;
|
|
@@ -77,6 +79,7 @@ export declare class DiffRenderable extends Renderable {
|
|
|
77
79
|
private isInsideSide;
|
|
78
80
|
protected onResize(width: number, height: number): void;
|
|
79
81
|
private requestRebuild;
|
|
82
|
+
private invalidateHunkRowOffsets;
|
|
80
83
|
private rebuildView;
|
|
81
84
|
private handleLineInfoChange;
|
|
82
85
|
private attachLineInfoListeners;
|
|
@@ -139,4 +142,6 @@ export declare class DiffRenderable extends Renderable {
|
|
|
139
142
|
clearAllLineColors(): void;
|
|
140
143
|
highlightLines(startLine: number, endLine: number, color: string | RGBA | LineColorConfig): void;
|
|
141
144
|
clearHighlightLines(startLine: number, endLine: number): void;
|
|
145
|
+
getHunkRowOffsets(): number[];
|
|
146
|
+
private computeHunkRowOffsets;
|
|
142
147
|
}
|
|
@@ -3,7 +3,7 @@ import { type RenderContext } from "../types.js";
|
|
|
3
3
|
import { SyntaxStyle } from "../syntax-style.js";
|
|
4
4
|
import type { BorderStyle } from "../lib/border.js";
|
|
5
5
|
import { RGBA, type ColorInput } from "../lib/RGBA.js";
|
|
6
|
-
import { type MarkedToken, type Token } from "marked";
|
|
6
|
+
import { type MarkedToken, type Token, type Tokens } from "marked";
|
|
7
7
|
import { type TextTableColumnFitter, type TextTableColumnWidthMode, type TextTableContent } from "./TextTable.js";
|
|
8
8
|
import type { TreeSitterClient } from "../lib/tree-sitter/index.js";
|
|
9
9
|
import { type ParseState } from "./markdown-parser.js";
|
|
@@ -113,6 +113,9 @@ export interface RenderNodeContext {
|
|
|
113
113
|
/** Creates default renderable for this token */
|
|
114
114
|
defaultRender: () => Renderable | null;
|
|
115
115
|
}
|
|
116
|
+
export type MarkdownCodeBlockRenderer = (token: Tokens.Code, context: RenderNodeContext) => Renderable | undefined | null;
|
|
117
|
+
export type MarkdownCodeBlockRendererMap = ReadonlyMap<string, MarkdownCodeBlockRenderer> | Readonly<Record<string, MarkdownCodeBlockRenderer>>;
|
|
118
|
+
export declare function createMarkdownCodeBlockRenderer(renderers: MarkdownCodeBlockRendererMap): MarkdownOptions["renderNode"];
|
|
116
119
|
interface TableContentCache {
|
|
117
120
|
content: TextTableContent;
|
|
118
121
|
cellKeys: Uint32Array[];
|
|
@@ -124,6 +127,8 @@ export interface BlockState {
|
|
|
124
127
|
renderable: Renderable;
|
|
125
128
|
tableContentCache?: TableContentCache;
|
|
126
129
|
tracksInterBlockMargin?: boolean;
|
|
130
|
+
/** Whether built-in reconciliation can update this renderable without replacing it. */
|
|
131
|
+
canUpdateInPlace: boolean;
|
|
127
132
|
}
|
|
128
133
|
export type { ParseState };
|
|
129
134
|
export declare class MarkdownRenderable extends Renderable {
|
|
@@ -204,6 +209,7 @@ export declare class MarkdownRenderable extends Renderable {
|
|
|
204
209
|
private createMarkdownBlockToken;
|
|
205
210
|
private normalizeMarkdownBlockRaw;
|
|
206
211
|
private normalizeScrollbackMarkdownBlockRaw;
|
|
212
|
+
private isCodeBlockOnlyRenderer;
|
|
207
213
|
private buildRenderableTokens;
|
|
208
214
|
private buildTopLevelRenderBlocks;
|
|
209
215
|
private shouldAddTopLevelMargin;
|
|
@@ -228,6 +234,10 @@ export declare class MarkdownRenderable extends Renderable {
|
|
|
228
234
|
private createTopLevelDefaultRenderable;
|
|
229
235
|
private createTopLevelRenderable;
|
|
230
236
|
private createDefaultRenderable;
|
|
237
|
+
private createCustomRenderable;
|
|
238
|
+
private createTopLevelCustomRenderable;
|
|
239
|
+
private renderCustomNode;
|
|
240
|
+
private destroyUnusedDefaultRenderable;
|
|
231
241
|
private updateBlockRenderable;
|
|
232
242
|
private updateTopLevelBlocks;
|
|
233
243
|
private canUpdateBlockRenderable;
|
|
@@ -73,6 +73,7 @@ export declare class ScrollBoxRenderable extends BoxRenderable {
|
|
|
73
73
|
get scrollWidth(): number;
|
|
74
74
|
get scrollHeight(): number;
|
|
75
75
|
private updateStickyState;
|
|
76
|
+
private syncManualScrollState;
|
|
76
77
|
private applyStickyStart;
|
|
77
78
|
constructor(ctx: RenderContext, options: ScrollBoxOptions);
|
|
78
79
|
protected onUpdate(deltaTime: number): void;
|
package/renderer.d.ts
CHANGED
|
@@ -112,6 +112,9 @@ export interface ScrollbackSurface {
|
|
|
112
112
|
commitRows(startRow: number, endRowExclusive: number, options?: ScrollbackSurfaceCommitOptions): void;
|
|
113
113
|
destroy(): void;
|
|
114
114
|
}
|
|
115
|
+
export interface SplitFooterReplayResetOptions {
|
|
116
|
+
clearSavedLines?: boolean;
|
|
117
|
+
}
|
|
115
118
|
/**
|
|
116
119
|
* Kitty Keyboard Protocol configuration options
|
|
117
120
|
* See: https://sw.kovidgoyal.net/kitty/keyboard-protocol/#progressive-enhancement
|
|
@@ -423,6 +426,7 @@ export declare class CliRenderer extends EventEmitter implements RenderContext {
|
|
|
423
426
|
set useKittyKeyboard(use: boolean);
|
|
424
427
|
createScrollbackSurface(options?: ScrollbackSurfaceOptions): ScrollbackSurface;
|
|
425
428
|
writeToScrollback(write: ScrollbackWriter): void;
|
|
429
|
+
resetSplitFooterForReplay(options?: SplitFooterReplayResetOptions): void;
|
|
426
430
|
private getSnapshotWidth;
|
|
427
431
|
private getSnapshotHeight;
|
|
428
432
|
private getSnapshotRowWidths;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ensureRuntimePluginSupport
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-vdnak5x1.js";
|
|
5
5
|
import {
|
|
6
6
|
createRuntimePlugin,
|
|
7
7
|
runtimeModuleIdForSpecifier
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
8
|
+
} from "./index-m0bc6bw1.js";
|
|
9
|
+
import"./index-3mx8q5t1.js";
|
|
10
|
+
import"./index-218h9p3f.js";
|
|
11
11
|
export {
|
|
12
12
|
runtimeModuleIdForSpecifier,
|
|
13
13
|
ensureRuntimePluginSupport,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ensureRuntimePluginSupport
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-vdnak5x1.js";
|
|
5
5
|
import {
|
|
6
6
|
createRuntimePlugin,
|
|
7
7
|
runtimeModuleIdForSpecifier
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
8
|
+
} from "./index-m0bc6bw1.js";
|
|
9
|
+
import"./index-3mx8q5t1.js";
|
|
10
|
+
import"./index-218h9p3f.js";
|
|
11
11
|
// src/runtime-plugin-support.ts
|
|
12
12
|
ensureRuntimePluginSupport();
|
|
13
13
|
export {
|
package/runtime-plugin.js
CHANGED
|
@@ -3,9 +3,9 @@ import {
|
|
|
3
3
|
createRuntimePlugin,
|
|
4
4
|
isCoreRuntimeModuleSpecifier,
|
|
5
5
|
runtimeModuleIdForSpecifier
|
|
6
|
-
} from "./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
6
|
+
} from "./index-m0bc6bw1.js";
|
|
7
|
+
import"./index-3mx8q5t1.js";
|
|
8
|
+
import"./index-218h9p3f.js";
|
|
9
9
|
export {
|
|
10
10
|
runtimeModuleIdForSpecifier,
|
|
11
11
|
isCoreRuntimeModuleSpecifier,
|