@opentui/core 0.0.0-20250922-cfcd1c78 → 0.0.0-20250924-d06b64fa
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/animation/Timeline.d.ts +2 -1
- package/ansi.d.ts +0 -16
- package/{index-eqy4135c.js → index-6kvgbzah.js} +235 -61
- package/{index-eqy4135c.js.map → index-6kvgbzah.js.map} +10 -9
- package/index.js +12 -2
- package/index.js.map +3 -3
- package/lib/env.d.ts +41 -0
- package/lib/index.d.ts +1 -0
- 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/{singleton.d.ts → lib/singleton.d.ts} +0 -0
package/3d.js
CHANGED
package/animation/Timeline.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CliRenderer } from "../renderer";
|
|
1
2
|
export interface TimelineOptions {
|
|
2
3
|
duration?: number;
|
|
3
4
|
loop?: boolean;
|
|
@@ -111,7 +112,7 @@ declare class TimelineEngine {
|
|
|
111
112
|
defaults: {
|
|
112
113
|
frameRate: number;
|
|
113
114
|
};
|
|
114
|
-
attach(renderer:
|
|
115
|
+
attach(renderer: CliRenderer): void;
|
|
115
116
|
detach(): void;
|
|
116
117
|
private updateLiveState;
|
|
117
118
|
private onTimelineStateChange;
|
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
|
|
|
@@ -4838,6 +4814,166 @@ class ASCIIFontSelectionHelper {
|
|
|
4838
4814
|
return previousSelection?.start !== this.localSelection?.start || previousSelection?.end !== this.localSelection?.end;
|
|
4839
4815
|
}
|
|
4840
4816
|
}
|
|
4817
|
+
|
|
4818
|
+
// src/lib/singleton.ts
|
|
4819
|
+
var singletonCacheSymbol = Symbol.for("@opentui/core/singleton");
|
|
4820
|
+
function singleton(key, factory) {
|
|
4821
|
+
const bag = globalThis[singletonCacheSymbol] ??= {};
|
|
4822
|
+
if (!(key in bag)) {
|
|
4823
|
+
bag[key] = factory();
|
|
4824
|
+
}
|
|
4825
|
+
return bag[key];
|
|
4826
|
+
}
|
|
4827
|
+
|
|
4828
|
+
// src/lib/env.ts
|
|
4829
|
+
var envRegistry = {};
|
|
4830
|
+
function registerEnvVar(config) {
|
|
4831
|
+
const existing = envRegistry[config.name];
|
|
4832
|
+
if (existing) {
|
|
4833
|
+
if (existing.description !== config.description || existing.type !== config.type || existing.default !== config.default) {
|
|
4834
|
+
throw new Error(`Environment variable "${config.name}" is already registered with different configuration. ` + `Existing: ${JSON.stringify(existing)}, New: ${JSON.stringify(config)}`);
|
|
4835
|
+
}
|
|
4836
|
+
return;
|
|
4837
|
+
}
|
|
4838
|
+
envRegistry[config.name] = config;
|
|
4839
|
+
}
|
|
4840
|
+
function normalizeBoolean(value) {
|
|
4841
|
+
const lowerValue = value.toLowerCase();
|
|
4842
|
+
return ["true", "1", "on", "yes"].includes(lowerValue);
|
|
4843
|
+
}
|
|
4844
|
+
function parseEnvValue(config) {
|
|
4845
|
+
const envValue = process.env[config.name];
|
|
4846
|
+
if (envValue === undefined && config.default !== undefined) {
|
|
4847
|
+
return config.default;
|
|
4848
|
+
}
|
|
4849
|
+
if (envValue === undefined) {
|
|
4850
|
+
throw new Error(`Required environment variable ${config.name} is not set. ${config.description}`);
|
|
4851
|
+
}
|
|
4852
|
+
switch (config.type) {
|
|
4853
|
+
case "boolean":
|
|
4854
|
+
return typeof envValue === "boolean" ? envValue : normalizeBoolean(envValue);
|
|
4855
|
+
case "number":
|
|
4856
|
+
const numValue = Number(envValue);
|
|
4857
|
+
if (isNaN(numValue)) {
|
|
4858
|
+
throw new Error(`Environment variable ${config.name} must be a valid number, got: ${envValue}`);
|
|
4859
|
+
}
|
|
4860
|
+
return numValue;
|
|
4861
|
+
case "string":
|
|
4862
|
+
default:
|
|
4863
|
+
return envValue;
|
|
4864
|
+
}
|
|
4865
|
+
}
|
|
4866
|
+
|
|
4867
|
+
class EnvStore {
|
|
4868
|
+
parsedValues = new Map;
|
|
4869
|
+
get(key) {
|
|
4870
|
+
if (this.parsedValues.has(key)) {
|
|
4871
|
+
return this.parsedValues.get(key);
|
|
4872
|
+
}
|
|
4873
|
+
if (!(key in envRegistry)) {
|
|
4874
|
+
throw new Error(`Environment variable ${key} is not registered.`);
|
|
4875
|
+
}
|
|
4876
|
+
try {
|
|
4877
|
+
const value = parseEnvValue(envRegistry[key]);
|
|
4878
|
+
this.parsedValues.set(key, value);
|
|
4879
|
+
return value;
|
|
4880
|
+
} catch (error) {
|
|
4881
|
+
throw new Error(`Failed to parse env var ${key}: ${error instanceof Error ? error.message : String(error)}`);
|
|
4882
|
+
}
|
|
4883
|
+
}
|
|
4884
|
+
has(key) {
|
|
4885
|
+
return key in envRegistry;
|
|
4886
|
+
}
|
|
4887
|
+
}
|
|
4888
|
+
var envStore = singleton("env-store", () => new EnvStore);
|
|
4889
|
+
function generateEnvMarkdown() {
|
|
4890
|
+
const configs = Object.values(envRegistry);
|
|
4891
|
+
if (configs.length === 0) {
|
|
4892
|
+
return `# Environment Variables
|
|
4893
|
+
|
|
4894
|
+
No environment variables registered.
|
|
4895
|
+
`;
|
|
4896
|
+
}
|
|
4897
|
+
let markdown = `# Environment Variables
|
|
4898
|
+
|
|
4899
|
+
`;
|
|
4900
|
+
for (const config of configs) {
|
|
4901
|
+
markdown += `## ${config.name}
|
|
4902
|
+
|
|
4903
|
+
`;
|
|
4904
|
+
markdown += `${config.description}
|
|
4905
|
+
|
|
4906
|
+
`;
|
|
4907
|
+
markdown += `**Type:** \`${config.type || "string"}\`
|
|
4908
|
+
`;
|
|
4909
|
+
if (config.default !== undefined) {
|
|
4910
|
+
const defaultValue = typeof config.default === "string" ? `"${config.default}"` : String(config.default);
|
|
4911
|
+
markdown += `**Default:** \`${defaultValue}\`
|
|
4912
|
+
`;
|
|
4913
|
+
} else {
|
|
4914
|
+
markdown += `**Default:** *Required*
|
|
4915
|
+
`;
|
|
4916
|
+
}
|
|
4917
|
+
markdown += `
|
|
4918
|
+
`;
|
|
4919
|
+
}
|
|
4920
|
+
return markdown;
|
|
4921
|
+
}
|
|
4922
|
+
function generateEnvColored() {
|
|
4923
|
+
const configs = Object.values(envRegistry);
|
|
4924
|
+
if (configs.length === 0) {
|
|
4925
|
+
return `\x1B[1;36mEnvironment Variables\x1B[0m
|
|
4926
|
+
|
|
4927
|
+
No environment variables registered.
|
|
4928
|
+
`;
|
|
4929
|
+
}
|
|
4930
|
+
let output = `\x1B[1;36mEnvironment Variables\x1B[0m
|
|
4931
|
+
|
|
4932
|
+
`;
|
|
4933
|
+
for (const config of configs) {
|
|
4934
|
+
output += `\x1B[1;33m${config.name}\x1B[0m
|
|
4935
|
+
`;
|
|
4936
|
+
output += `${config.description}
|
|
4937
|
+
`;
|
|
4938
|
+
output += `\x1B[32mType:\x1B[0m \x1B[36m${config.type || "string"}\x1B[0m
|
|
4939
|
+
`;
|
|
4940
|
+
if (config.default !== undefined) {
|
|
4941
|
+
const defaultValue = typeof config.default === "string" ? `"${config.default}"` : String(config.default);
|
|
4942
|
+
output += `\x1B[32mDefault:\x1B[0m \x1B[35m${defaultValue}\x1B[0m
|
|
4943
|
+
`;
|
|
4944
|
+
} else {
|
|
4945
|
+
output += `\x1B[32mDefault:\x1B[0m \x1B[31mRequired\x1B[0m
|
|
4946
|
+
`;
|
|
4947
|
+
}
|
|
4948
|
+
output += `
|
|
4949
|
+
`;
|
|
4950
|
+
}
|
|
4951
|
+
return output;
|
|
4952
|
+
}
|
|
4953
|
+
var env = new Proxy({}, {
|
|
4954
|
+
get(target, prop) {
|
|
4955
|
+
if (typeof prop !== "string") {
|
|
4956
|
+
return;
|
|
4957
|
+
}
|
|
4958
|
+
return envStore.get(prop);
|
|
4959
|
+
},
|
|
4960
|
+
has(target, prop) {
|
|
4961
|
+
return envStore.has(prop);
|
|
4962
|
+
},
|
|
4963
|
+
ownKeys() {
|
|
4964
|
+
return Object.keys(envRegistry);
|
|
4965
|
+
},
|
|
4966
|
+
getOwnPropertyDescriptor(target, prop) {
|
|
4967
|
+
if (envStore.has(prop)) {
|
|
4968
|
+
return {
|
|
4969
|
+
enumerable: true,
|
|
4970
|
+
configurable: true,
|
|
4971
|
+
get: () => envStore.get(prop)
|
|
4972
|
+
};
|
|
4973
|
+
}
|
|
4974
|
+
return;
|
|
4975
|
+
}
|
|
4976
|
+
});
|
|
4841
4977
|
// src/zig.ts
|
|
4842
4978
|
import { dlopen, toArrayBuffer as toArrayBuffer2, JSCallback, ptr } from "bun:ffi";
|
|
4843
4979
|
import { existsSync } from "fs";
|
|
@@ -5044,6 +5180,18 @@ var targetLibPath = module.default;
|
|
|
5044
5180
|
if (!existsSync(targetLibPath)) {
|
|
5045
5181
|
throw new Error(`opentui is not supported on the current platform: ${process.platform}-${process.arch}`);
|
|
5046
5182
|
}
|
|
5183
|
+
registerEnvVar({
|
|
5184
|
+
name: "OTUI_DEBUG_FFI",
|
|
5185
|
+
description: "Enable debug logging for the FFI bindings.",
|
|
5186
|
+
type: "boolean",
|
|
5187
|
+
default: false
|
|
5188
|
+
});
|
|
5189
|
+
registerEnvVar({
|
|
5190
|
+
name: "OTUI_TRACE_FFI",
|
|
5191
|
+
description: "Enable tracing for the FFI bindings.",
|
|
5192
|
+
type: "boolean",
|
|
5193
|
+
default: false
|
|
5194
|
+
});
|
|
5047
5195
|
function getOpenTUILib(libPath) {
|
|
5048
5196
|
const resolvedLibPath = libPath || targetLibPath;
|
|
5049
5197
|
const rawSymbols = dlopen(resolvedLibPath, {
|
|
@@ -5091,6 +5239,10 @@ function getOpenTUILib(libPath) {
|
|
|
5091
5239
|
args: ["ptr"],
|
|
5092
5240
|
returns: "ptr"
|
|
5093
5241
|
},
|
|
5242
|
+
queryPixelResolution: {
|
|
5243
|
+
args: ["ptr"],
|
|
5244
|
+
returns: "void"
|
|
5245
|
+
},
|
|
5094
5246
|
createOptimizedBuffer: {
|
|
5095
5247
|
args: ["u32", "u32", "bool", "u8", "ptr", "usize"],
|
|
5096
5248
|
returns: "ptr"
|
|
@@ -5380,7 +5532,7 @@ function getOpenTUILib(libPath) {
|
|
|
5380
5532
|
returns: "void"
|
|
5381
5533
|
}
|
|
5382
5534
|
});
|
|
5383
|
-
if (
|
|
5535
|
+
if (env.OTUI_DEBUG_FFI || env.OTUI_TRACE_FFI) {
|
|
5384
5536
|
return {
|
|
5385
5537
|
symbols: convertToDebugSymbols(rawSymbols.symbols)
|
|
5386
5538
|
};
|
|
@@ -5394,7 +5546,7 @@ function convertToDebugSymbols(symbols) {
|
|
|
5394
5546
|
Object.entries(symbols).forEach(([key, value]) => {
|
|
5395
5547
|
debugSymbols[key] = value;
|
|
5396
5548
|
});
|
|
5397
|
-
if (
|
|
5549
|
+
if (env.OTUI_DEBUG_FFI) {
|
|
5398
5550
|
Object.entries(symbols).forEach(([key, value]) => {
|
|
5399
5551
|
if (typeof value === "function") {
|
|
5400
5552
|
debugSymbols[key] = (...args) => {
|
|
@@ -5406,7 +5558,7 @@ function convertToDebugSymbols(symbols) {
|
|
|
5406
5558
|
}
|
|
5407
5559
|
});
|
|
5408
5560
|
}
|
|
5409
|
-
if (
|
|
5561
|
+
if (env.OTUI_TRACE_FFI) {
|
|
5410
5562
|
hasTracing = true;
|
|
5411
5563
|
Object.entries(symbols).forEach(([key, value]) => {
|
|
5412
5564
|
if (typeof value === "function") {
|
|
@@ -5768,6 +5920,9 @@ class FFIRenderLib {
|
|
|
5768
5920
|
setupTerminal(renderer, useAlternateScreen) {
|
|
5769
5921
|
this.opentui.symbols.setupTerminal(renderer, useAlternateScreen);
|
|
5770
5922
|
}
|
|
5923
|
+
queryPixelResolution(renderer) {
|
|
5924
|
+
this.opentui.symbols.queryPixelResolution(renderer);
|
|
5925
|
+
}
|
|
5771
5926
|
createTextBuffer(widthMethod) {
|
|
5772
5927
|
const widthMethodCode = widthMethod === "wcwidth" ? 0 : 1;
|
|
5773
5928
|
const bufferPtr = this.opentui.symbols.createTextBuffer(widthMethodCode);
|
|
@@ -7564,16 +7719,6 @@ class CapturedWritableStream extends Writable {
|
|
|
7564
7719
|
}
|
|
7565
7720
|
}
|
|
7566
7721
|
|
|
7567
|
-
// src/singleton.ts
|
|
7568
|
-
var singletonCacheSymbol = Symbol.for("@opentui/core/singleton");
|
|
7569
|
-
function singleton(key, factory) {
|
|
7570
|
-
const bag = globalThis[singletonCacheSymbol] ??= {};
|
|
7571
|
-
if (!(key in bag)) {
|
|
7572
|
-
bag[key] = factory();
|
|
7573
|
-
}
|
|
7574
|
-
return bag[key];
|
|
7575
|
-
}
|
|
7576
|
-
|
|
7577
7722
|
// src/console.ts
|
|
7578
7723
|
function getCallerInfo() {
|
|
7579
7724
|
const err = new Error;
|
|
@@ -7594,6 +7739,18 @@ function getCallerInfo() {
|
|
|
7594
7739
|
return { functionName, fullPath, fileName, lineNumber, columnNumber };
|
|
7595
7740
|
}
|
|
7596
7741
|
var capture = singleton("ConsoleCapture", () => new Capture);
|
|
7742
|
+
registerEnvVar({
|
|
7743
|
+
name: "OTUI_USE_CONSOLE",
|
|
7744
|
+
description: "Whether to use the console. Will not capture console output if set to false.",
|
|
7745
|
+
type: "boolean",
|
|
7746
|
+
default: true
|
|
7747
|
+
});
|
|
7748
|
+
registerEnvVar({
|
|
7749
|
+
name: "SHOW_CONSOLE",
|
|
7750
|
+
description: "Show the console at startup if set to true.",
|
|
7751
|
+
type: "boolean",
|
|
7752
|
+
default: false
|
|
7753
|
+
});
|
|
7597
7754
|
|
|
7598
7755
|
class TerminalConsoleCache extends EventEmitter4 {
|
|
7599
7756
|
_cachedLogs = [];
|
|
@@ -7611,7 +7768,7 @@ class TerminalConsoleCache extends EventEmitter4 {
|
|
|
7611
7768
|
this.overrideConsoleMethods();
|
|
7612
7769
|
}
|
|
7613
7770
|
setupConsoleCapture() {
|
|
7614
|
-
if (
|
|
7771
|
+
if (!env.OTUI_USE_CONSOLE)
|
|
7615
7772
|
return;
|
|
7616
7773
|
const mockStdout = new CapturedWritableStream("stdout", capture);
|
|
7617
7774
|
const mockStderr = new CapturedWritableStream("stderr", capture);
|
|
@@ -7776,7 +7933,7 @@ class TerminalConsole extends EventEmitter4 {
|
|
|
7776
7933
|
terminalConsoleCache.on("entry", (logEntry) => {
|
|
7777
7934
|
this._handleNewLog(logEntry);
|
|
7778
7935
|
});
|
|
7779
|
-
if (
|
|
7936
|
+
if (env.SHOW_CONSOLE) {
|
|
7780
7937
|
this.show();
|
|
7781
7938
|
}
|
|
7782
7939
|
}
|
|
@@ -8254,6 +8411,19 @@ function getObjectsInViewport(viewport, objects, direction = "column", padding =
|
|
|
8254
8411
|
}
|
|
8255
8412
|
|
|
8256
8413
|
// src/renderer.ts
|
|
8414
|
+
registerEnvVar({
|
|
8415
|
+
name: "OTUI_DUMP_CAPTURES",
|
|
8416
|
+
description: "Dump captured output when the renderer exits.",
|
|
8417
|
+
type: "boolean",
|
|
8418
|
+
default: false
|
|
8419
|
+
});
|
|
8420
|
+
registerEnvVar({
|
|
8421
|
+
name: "OTUI_NO_NATIVE_RENDER",
|
|
8422
|
+
description: "Disable native rendering. This will not actually output ansi and is useful for debugging.",
|
|
8423
|
+
type: "boolean",
|
|
8424
|
+
default: false
|
|
8425
|
+
});
|
|
8426
|
+
|
|
8257
8427
|
class MouseEvent {
|
|
8258
8428
|
type;
|
|
8259
8429
|
button;
|
|
@@ -8481,14 +8651,14 @@ Captured output:
|
|
|
8481
8651
|
this.realStdoutWrite.call(this.stdout, capturedOutput + `
|
|
8482
8652
|
`);
|
|
8483
8653
|
}
|
|
8654
|
+
this.realStdoutWrite.call(this.stdout, ANSI.reset);
|
|
8484
8655
|
}
|
|
8485
8656
|
exitHandler = (() => {
|
|
8486
|
-
|
|
8487
|
-
|
|
8488
|
-
|
|
8657
|
+
this.destroy();
|
|
8658
|
+
if (env.OTUI_DUMP_CAPTURES) {
|
|
8659
|
+
this.dumpOutputCache(`=== CAPTURED OUTPUT ===
|
|
8489
8660
|
`);
|
|
8490
8661
|
}
|
|
8491
|
-
this.destroy();
|
|
8492
8662
|
}).bind(this);
|
|
8493
8663
|
warningHandler = ((warning) => {
|
|
8494
8664
|
console.warn(JSON.stringify(warning.message, null, 2));
|
|
@@ -8552,7 +8722,7 @@ Captured output:
|
|
|
8552
8722
|
global.window = {};
|
|
8553
8723
|
}
|
|
8554
8724
|
global.window.requestAnimationFrame = requestAnimationFrame;
|
|
8555
|
-
if (
|
|
8725
|
+
if (env.OTUI_NO_NATIVE_RENDER) {
|
|
8556
8726
|
this.renderNative = () => {
|
|
8557
8727
|
if (this._splitHeight > 0) {
|
|
8558
8728
|
this.flushStdoutCache(this._splitHeight);
|
|
@@ -8755,11 +8925,6 @@ Captured output:
|
|
|
8755
8925
|
if (this._terminalIsSetup)
|
|
8756
8926
|
return;
|
|
8757
8927
|
this._terminalIsSetup = true;
|
|
8758
|
-
if (this.stdin.setRawMode) {
|
|
8759
|
-
this.stdin.setRawMode(true);
|
|
8760
|
-
}
|
|
8761
|
-
this.stdin.resume();
|
|
8762
|
-
this.stdin.setEncoding("utf8");
|
|
8763
8928
|
await new Promise((resolve) => {
|
|
8764
8929
|
const timeout = setTimeout(() => {
|
|
8765
8930
|
this.stdin.off("data", capListener);
|
|
@@ -8806,6 +8971,11 @@ Captured output:
|
|
|
8806
8971
|
this.emit("key", data);
|
|
8807
8972
|
}).bind(this);
|
|
8808
8973
|
setupInput() {
|
|
8974
|
+
if (this.stdin.setRawMode) {
|
|
8975
|
+
this.stdin.setRawMode(true);
|
|
8976
|
+
}
|
|
8977
|
+
this.stdin.resume();
|
|
8978
|
+
this.stdin.setEncoding("utf8");
|
|
8809
8979
|
this.stdin.on("data", this.stdinListener);
|
|
8810
8980
|
}
|
|
8811
8981
|
handleMouseData(data) {
|
|
@@ -8971,7 +9141,7 @@ Captured output:
|
|
|
8971
9141
|
}
|
|
8972
9142
|
queryPixelResolution() {
|
|
8973
9143
|
this.waitingForPixelResolution = true;
|
|
8974
|
-
this.
|
|
9144
|
+
this.lib.queryPixelResolution(this.rendererPtr);
|
|
8975
9145
|
}
|
|
8976
9146
|
processResize(width, height) {
|
|
8977
9147
|
if (width === this._terminalWidth && height === this._terminalHeight)
|
|
@@ -9034,9 +9204,6 @@ Captured output:
|
|
|
9034
9204
|
this.lib.setDebugOverlay(this.rendererPtr, this.debugOverlay.enabled, this.debugOverlay.corner);
|
|
9035
9205
|
this.requestRender();
|
|
9036
9206
|
}
|
|
9037
|
-
clearTerminal() {
|
|
9038
|
-
this.lib.clearTerminal(this.rendererPtr);
|
|
9039
|
-
}
|
|
9040
9207
|
setTerminalTitle(title) {
|
|
9041
9208
|
this.lib.setTerminalTitle(this.rendererPtr, title);
|
|
9042
9209
|
}
|
|
@@ -9149,7 +9316,6 @@ Captured output:
|
|
|
9149
9316
|
}
|
|
9150
9317
|
}
|
|
9151
9318
|
destroy() {
|
|
9152
|
-
this.stdin.removeListener("data", this.stdinListener);
|
|
9153
9319
|
process.removeListener("SIGWINCH", this.sigwinchHandler);
|
|
9154
9320
|
process.removeListener("uncaughtException", this.handleError);
|
|
9155
9321
|
process.removeListener("unhandledRejection", this.handleError);
|
|
@@ -9158,12 +9324,14 @@ Captured output:
|
|
|
9158
9324
|
if (this.memorySnapshotTimer) {
|
|
9159
9325
|
clearInterval(this.memorySnapshotTimer);
|
|
9160
9326
|
}
|
|
9161
|
-
if (this.stdin.setRawMode) {
|
|
9162
|
-
this.stdin.setRawMode(false);
|
|
9163
|
-
}
|
|
9164
9327
|
if (this.isDestroyed)
|
|
9165
9328
|
return;
|
|
9166
9329
|
this.isDestroyed = true;
|
|
9330
|
+
if (this.renderTimeout) {
|
|
9331
|
+
clearTimeout(this.renderTimeout);
|
|
9332
|
+
this.renderTimeout = null;
|
|
9333
|
+
}
|
|
9334
|
+
this._isRunning = false;
|
|
9167
9335
|
this.waitingForPixelResolution = false;
|
|
9168
9336
|
this.capturedRenderable = undefined;
|
|
9169
9337
|
this.root.destroyRecursively();
|
|
@@ -9173,6 +9341,10 @@ Captured output:
|
|
|
9173
9341
|
if (this._splitHeight > 0) {
|
|
9174
9342
|
this.flushStdoutCache(this._splitHeight, true);
|
|
9175
9343
|
}
|
|
9344
|
+
if (this.stdin.setRawMode) {
|
|
9345
|
+
this.stdin.setRawMode(false);
|
|
9346
|
+
}
|
|
9347
|
+
this.stdin.removeListener("data", this.stdinListener);
|
|
9176
9348
|
this.lib.destroyRenderer(this.rendererPtr);
|
|
9177
9349
|
rendererTracker.removeRenderer(this);
|
|
9178
9350
|
}
|
|
@@ -9231,7 +9403,9 @@ Captured output:
|
|
|
9231
9403
|
postProcessFn(this.nextRenderBuffer, deltaTime);
|
|
9232
9404
|
}
|
|
9233
9405
|
this._console.renderToBuffer(this.nextRenderBuffer);
|
|
9234
|
-
this.
|
|
9406
|
+
if (!this.isDestroyed) {
|
|
9407
|
+
this.renderNative();
|
|
9408
|
+
}
|
|
9235
9409
|
const overallFrameTime = performance.now() - overallStart;
|
|
9236
9410
|
this.lib.updateStats(this.rendererPtr, overallFrameTime, this.renderStats.fps, this.renderStats.frameCallbackTime);
|
|
9237
9411
|
if (this.gatherStats) {
|
|
@@ -9398,7 +9572,7 @@ Captured output:
|
|
|
9398
9572
|
}
|
|
9399
9573
|
}
|
|
9400
9574
|
|
|
9401
|
-
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 };
|
|
9575
|
+
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, envRegistry, registerEnvVar, generateEnvMarkdown, generateEnvColored, env, 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
9576
|
|
|
9403
|
-
//# debugId=
|
|
9404
|
-
//# sourceMappingURL=index-
|
|
9577
|
+
//# debugId=FA47EE78BCA83E8664756E2164756E21
|
|
9578
|
+
//# sourceMappingURL=index-6kvgbzah.js.map
|