@opentui/core 0.0.0-20250922-1555550d → 0.0.0-20250923-da12fb15
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 +1 -1
- package/ansi.d.ts +0 -16
- package/{index-eqy4135c.js → index-ce0mn4wa.js} +30 -43
- package/{index-eqy4135c.js.map → index-ce0mn4wa.js.map} +7 -7
- package/index.js +4 -3
- package/index.js.map +3 -3
- package/package.json +7 -7
- package/renderer.d.ts +0 -1
- package/testing/test-renderer.d.ts +1 -0
- package/testing.js +10 -5
- package/testing.js.map +3 -3
- package/zig.d.ts +1 -0
package/3d.js
CHANGED
package/ansi.d.ts
CHANGED
|
@@ -2,28 +2,12 @@ export declare const ANSI: {
|
|
|
2
2
|
switchToAlternateScreen: string;
|
|
3
3
|
switchToMainScreen: string;
|
|
4
4
|
reset: string;
|
|
5
|
-
hideCursor: string;
|
|
6
|
-
showCursor: string;
|
|
7
|
-
resetCursorColor: string;
|
|
8
|
-
saveCursorState: string;
|
|
9
|
-
restoreCursorState: string;
|
|
10
|
-
queryPixelSize: string;
|
|
11
5
|
scrollDown: (lines: number) => string;
|
|
12
6
|
scrollUp: (lines: number) => string;
|
|
13
7
|
moveCursor: (row: number, col: number) => string;
|
|
14
8
|
moveCursorAndClear: (row: number, col: number) => string;
|
|
15
|
-
clearFromCursor: string;
|
|
16
9
|
setRgbBackground: (r: number, g: number, b: number) => string;
|
|
17
10
|
resetBackground: string;
|
|
18
|
-
enableMouseTracking: string;
|
|
19
|
-
disableMouseTracking: string;
|
|
20
|
-
enableButtonEventTracking: string;
|
|
21
|
-
disableButtonEventTracking: string;
|
|
22
|
-
enableAnyEventTracking: string;
|
|
23
|
-
disableAnyEventTracking: string;
|
|
24
|
-
enableSGRMouseMode: string;
|
|
25
|
-
disableSGRMouseMode: string;
|
|
26
|
-
clearRendererSpace: (height: number) => string;
|
|
27
11
|
bracketedPasteStart: string;
|
|
28
12
|
bracketedPasteEnd: string;
|
|
29
13
|
};
|
|
@@ -2180,28 +2180,12 @@ var ANSI = {
|
|
|
2180
2180
|
switchToAlternateScreen: "\x1B[?1049h",
|
|
2181
2181
|
switchToMainScreen: "\x1B[?1049l",
|
|
2182
2182
|
reset: "\x1B[0m",
|
|
2183
|
-
hideCursor: "\x1B[?25l",
|
|
2184
|
-
showCursor: "\x1B[?25h",
|
|
2185
|
-
resetCursorColor: "\x1B]12;default\x07",
|
|
2186
|
-
saveCursorState: "\x1B[s",
|
|
2187
|
-
restoreCursorState: "\x1B[u",
|
|
2188
|
-
queryPixelSize: "\x1B[14t",
|
|
2189
2183
|
scrollDown: (lines) => `\x1B[${lines}T`,
|
|
2190
2184
|
scrollUp: (lines) => `\x1B[${lines}S`,
|
|
2191
2185
|
moveCursor: (row, col) => `\x1B[${row};${col}H`,
|
|
2192
2186
|
moveCursorAndClear: (row, col) => `\x1B[${row};${col}H\x1B[J`,
|
|
2193
|
-
clearFromCursor: "\x1B[J",
|
|
2194
2187
|
setRgbBackground: (r, g, b) => `\x1B[48;2;${r};${g};${b}m`,
|
|
2195
2188
|
resetBackground: "\x1B[49m",
|
|
2196
|
-
enableMouseTracking: "\x1B[?1000h",
|
|
2197
|
-
disableMouseTracking: "\x1B[?1000l",
|
|
2198
|
-
enableButtonEventTracking: "\x1B[?1002h",
|
|
2199
|
-
disableButtonEventTracking: "\x1B[?1002l",
|
|
2200
|
-
enableAnyEventTracking: "\x1B[?1003h",
|
|
2201
|
-
disableAnyEventTracking: "\x1B[?1003l",
|
|
2202
|
-
enableSGRMouseMode: "\x1B[?1006h",
|
|
2203
|
-
disableSGRMouseMode: "\x1B[?1006l",
|
|
2204
|
-
clearRendererSpace: (height) => `\x1B[${height}A\x1B[1G\x1B[J`,
|
|
2205
2189
|
bracketedPasteStart: "\x1B[200~",
|
|
2206
2190
|
bracketedPasteEnd: "\x1B[201~"
|
|
2207
2191
|
};
|
|
@@ -2217,11 +2201,6 @@ class KeyHandler extends EventEmitter {
|
|
|
2217
2201
|
super();
|
|
2218
2202
|
this.stdin = stdin || process.stdin;
|
|
2219
2203
|
this.useKittyKeyboard = useKittyKeyboard;
|
|
2220
|
-
if (this.stdin.setRawMode) {
|
|
2221
|
-
this.stdin.setRawMode(true);
|
|
2222
|
-
}
|
|
2223
|
-
this.stdin.resume();
|
|
2224
|
-
this.stdin.setEncoding("utf8");
|
|
2225
2204
|
this.listener = (key) => {
|
|
2226
2205
|
let data = key.toString();
|
|
2227
2206
|
if (data.startsWith(ANSI.bracketedPasteStart)) {
|
|
@@ -2256,9 +2235,6 @@ class KeyHandler extends EventEmitter {
|
|
|
2256
2235
|
}
|
|
2257
2236
|
destroy() {
|
|
2258
2237
|
this.stdin.removeListener("data", this.listener);
|
|
2259
|
-
if (this.stdin.setRawMode) {
|
|
2260
|
-
this.stdin.setRawMode(false);
|
|
2261
|
-
}
|
|
2262
2238
|
}
|
|
2263
2239
|
}
|
|
2264
2240
|
|
|
@@ -5091,6 +5067,10 @@ function getOpenTUILib(libPath) {
|
|
|
5091
5067
|
args: ["ptr"],
|
|
5092
5068
|
returns: "ptr"
|
|
5093
5069
|
},
|
|
5070
|
+
queryPixelResolution: {
|
|
5071
|
+
args: ["ptr"],
|
|
5072
|
+
returns: "void"
|
|
5073
|
+
},
|
|
5094
5074
|
createOptimizedBuffer: {
|
|
5095
5075
|
args: ["u32", "u32", "bool", "u8", "ptr", "usize"],
|
|
5096
5076
|
returns: "ptr"
|
|
@@ -5768,6 +5748,9 @@ class FFIRenderLib {
|
|
|
5768
5748
|
setupTerminal(renderer, useAlternateScreen) {
|
|
5769
5749
|
this.opentui.symbols.setupTerminal(renderer, useAlternateScreen);
|
|
5770
5750
|
}
|
|
5751
|
+
queryPixelResolution(renderer) {
|
|
5752
|
+
this.opentui.symbols.queryPixelResolution(renderer);
|
|
5753
|
+
}
|
|
5771
5754
|
createTextBuffer(widthMethod) {
|
|
5772
5755
|
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
5773
5756
|
const bufferPtr = this.opentui.symbols.createTextBuffer(widthMethodCode);
|
|
@@ -8481,14 +8464,14 @@ Captured output:
|
|
|
8481
8464
|
this.realStdoutWrite.call(this.stdout, capturedOutput + `
|
|
8482
8465
|
`);
|
|
8483
8466
|
}
|
|
8467
|
+
this.realStdoutWrite.call(this.stdout, ANSI.reset);
|
|
8484
8468
|
}
|
|
8485
8469
|
exitHandler = (() => {
|
|
8470
|
+
this.destroy();
|
|
8486
8471
|
if (true) {
|
|
8487
|
-
this.dumpOutputCache(
|
|
8488
|
-
=== UNHANDLED OUTPUT (this is only printed in non-production environments) ===
|
|
8472
|
+
this.dumpOutputCache(`=== UNHANDLED OUTPUT (this is only printed in non-production environments) ===
|
|
8489
8473
|
`);
|
|
8490
8474
|
}
|
|
8491
|
-
this.destroy();
|
|
8492
8475
|
}).bind(this);
|
|
8493
8476
|
warningHandler = ((warning) => {
|
|
8494
8477
|
console.warn(JSON.stringify(warning.message, null, 2));
|
|
@@ -8755,11 +8738,6 @@ Captured output:
|
|
|
8755
8738
|
if (this._terminalIsSetup)
|
|
8756
8739
|
return;
|
|
8757
8740
|
this._terminalIsSetup = true;
|
|
8758
|
-
if (this.stdin.setRawMode) {
|
|
8759
|
-
this.stdin.setRawMode(true);
|
|
8760
|
-
}
|
|
8761
|
-
this.stdin.resume();
|
|
8762
|
-
this.stdin.setEncoding("utf8");
|
|
8763
8741
|
await new Promise((resolve) => {
|
|
8764
8742
|
const timeout = setTimeout(() => {
|
|
8765
8743
|
this.stdin.off("data", capListener);
|
|
@@ -8806,6 +8784,11 @@ Captured output:
|
|
|
8806
8784
|
this.emit("key", data);
|
|
8807
8785
|
}).bind(this);
|
|
8808
8786
|
setupInput() {
|
|
8787
|
+
if (this.stdin.setRawMode) {
|
|
8788
|
+
this.stdin.setRawMode(true);
|
|
8789
|
+
}
|
|
8790
|
+
this.stdin.resume();
|
|
8791
|
+
this.stdin.setEncoding("utf8");
|
|
8809
8792
|
this.stdin.on("data", this.stdinListener);
|
|
8810
8793
|
}
|
|
8811
8794
|
handleMouseData(data) {
|
|
@@ -8971,7 +8954,7 @@ Captured output:
|
|
|
8971
8954
|
}
|
|
8972
8955
|
queryPixelResolution() {
|
|
8973
8956
|
this.waitingForPixelResolution = true;
|
|
8974
|
-
this.
|
|
8957
|
+
this.lib.queryPixelResolution(this.rendererPtr);
|
|
8975
8958
|
}
|
|
8976
8959
|
processResize(width, height) {
|
|
8977
8960
|
if (width === this._terminalWidth && height === this._terminalHeight)
|
|
@@ -9034,9 +9017,6 @@ Captured output:
|
|
|
9034
9017
|
this.lib.setDebugOverlay(this.rendererPtr, this.debugOverlay.enabled, this.debugOverlay.corner);
|
|
9035
9018
|
this.requestRender();
|
|
9036
9019
|
}
|
|
9037
|
-
clearTerminal() {
|
|
9038
|
-
this.lib.clearTerminal(this.rendererPtr);
|
|
9039
|
-
}
|
|
9040
9020
|
setTerminalTitle(title) {
|
|
9041
9021
|
this.lib.setTerminalTitle(this.rendererPtr, title);
|
|
9042
9022
|
}
|
|
@@ -9149,7 +9129,6 @@ Captured output:
|
|
|
9149
9129
|
}
|
|
9150
9130
|
}
|
|
9151
9131
|
destroy() {
|
|
9152
|
-
this.stdin.removeListener("data", this.stdinListener);
|
|
9153
9132
|
process.removeListener("SIGWINCH", this.sigwinchHandler);
|
|
9154
9133
|
process.removeListener("uncaughtException", this.handleError);
|
|
9155
9134
|
process.removeListener("unhandledRejection", this.handleError);
|
|
@@ -9158,12 +9137,14 @@ Captured output:
|
|
|
9158
9137
|
if (this.memorySnapshotTimer) {
|
|
9159
9138
|
clearInterval(this.memorySnapshotTimer);
|
|
9160
9139
|
}
|
|
9161
|
-
if (this.stdin.setRawMode) {
|
|
9162
|
-
this.stdin.setRawMode(false);
|
|
9163
|
-
}
|
|
9164
9140
|
if (this.isDestroyed)
|
|
9165
9141
|
return;
|
|
9166
9142
|
this.isDestroyed = true;
|
|
9143
|
+
if (this.renderTimeout) {
|
|
9144
|
+
clearTimeout(this.renderTimeout);
|
|
9145
|
+
this.renderTimeout = null;
|
|
9146
|
+
}
|
|
9147
|
+
this._isRunning = false;
|
|
9167
9148
|
this.waitingForPixelResolution = false;
|
|
9168
9149
|
this.capturedRenderable = undefined;
|
|
9169
9150
|
this.root.destroyRecursively();
|
|
@@ -9173,6 +9154,10 @@ Captured output:
|
|
|
9173
9154
|
if (this._splitHeight > 0) {
|
|
9174
9155
|
this.flushStdoutCache(this._splitHeight, true);
|
|
9175
9156
|
}
|
|
9157
|
+
if (this.stdin.setRawMode) {
|
|
9158
|
+
this.stdin.setRawMode(false);
|
|
9159
|
+
}
|
|
9160
|
+
this.stdin.removeListener("data", this.stdinListener);
|
|
9176
9161
|
this.lib.destroyRenderer(this.rendererPtr);
|
|
9177
9162
|
rendererTracker.removeRenderer(this);
|
|
9178
9163
|
}
|
|
@@ -9231,7 +9216,9 @@ Captured output:
|
|
|
9231
9216
|
postProcessFn(this.nextRenderBuffer, deltaTime);
|
|
9232
9217
|
}
|
|
9233
9218
|
this._console.renderToBuffer(this.nextRenderBuffer);
|
|
9234
|
-
this.
|
|
9219
|
+
if (!this.isDestroyed) {
|
|
9220
|
+
this.renderNative();
|
|
9221
|
+
}
|
|
9235
9222
|
const overallFrameTime = performance.now() - overallStart;
|
|
9236
9223
|
this.lib.updateStats(this.rendererPtr, overallFrameTime, this.renderStats.fps, this.renderStats.frameCallbackTime);
|
|
9237
9224
|
if (this.gatherStats) {
|
|
@@ -9400,5 +9387,5 @@ Captured output:
|
|
|
9400
9387
|
|
|
9401
9388
|
export { __toESM, __commonJS, __export, __require, Edge, Gutter, exports_src, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, ANSI, KeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, DebugOverlayCorner, createTextAttributes, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, t, SyntaxStyle, hastToStyledText, parseAlign, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, CliRenderer };
|
|
9402
9389
|
|
|
9403
|
-
//# debugId=
|
|
9404
|
-
//# sourceMappingURL=index-
|
|
9390
|
+
//# debugId=E1BF4DFE4379457164756E2164756E21
|
|
9391
|
+
//# sourceMappingURL=index-ce0mn4wa.js.map
|