@opentui/core 0.0.0-20260106-bb82df43 → 0.0.0-20260107-eacc730b
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
CHANGED
|
@@ -8963,8 +8963,8 @@ function createExtmarksController(editBuffer, editorView) {
|
|
|
8963
8963
|
}
|
|
8964
8964
|
|
|
8965
8965
|
// src/lib/terminal-palette.ts
|
|
8966
|
-
var OSC4_RESPONSE = /\x1b]4;(\d+);(?:(?:rgb:)([0-9a-fA-F]+)\/([0-9a-fA-F]+)\/([0-9a-fA-F]+)|#([0-9a-fA-F]{6}))(?:\x07|\x1b\\)/g;
|
|
8967
|
-
var OSC_SPECIAL_RESPONSE = /\x1b](\d+);(?:(?:rgb:)([0-9a-fA-F]+)\/([0-9a-fA-F]+)\/([0-9a-fA-F]+)|#([0-9a-fA-F]{6}))(?:\x07|\x1b\\)/g;
|
|
8966
|
+
var OSC4_RESPONSE = /\x1b\]4;(\d+);(?:(?:rgb:)([0-9a-fA-F]+)\/([0-9a-fA-F]+)\/([0-9a-fA-F]+)|#([0-9a-fA-F]{6}))(?:\x07|\x1b\\)/g;
|
|
8967
|
+
var OSC_SPECIAL_RESPONSE = /\x1b\](\d+);(?:(?:rgb:)([0-9a-fA-F]+)\/([0-9a-fA-F]+)\/([0-9a-fA-F]+)|#([0-9a-fA-F]{6}))(?:\x07|\x1b\\)/g;
|
|
8968
8968
|
function scaleComponent(comp) {
|
|
8969
8969
|
const val = parseInt(comp, 16);
|
|
8970
8970
|
const maxIn = (1 << 4 * comp.length) - 1;
|
|
@@ -8988,15 +8988,17 @@ class TerminalPalette {
|
|
|
8988
8988
|
writeFn;
|
|
8989
8989
|
activeListeners = [];
|
|
8990
8990
|
activeTimers = [];
|
|
8991
|
-
|
|
8992
|
-
|
|
8991
|
+
inTmux;
|
|
8992
|
+
useTmuxPassthrough = null;
|
|
8993
|
+
constructor(stdin, stdout, writeFn, inTmux) {
|
|
8993
8994
|
this.stdin = stdin;
|
|
8994
8995
|
this.stdout = stdout;
|
|
8995
8996
|
this.writeFn = writeFn || ((data) => stdout.write(data));
|
|
8996
|
-
this.
|
|
8997
|
+
this.inTmux = inTmux ?? false;
|
|
8997
8998
|
}
|
|
8998
|
-
writeOsc(osc) {
|
|
8999
|
-
const
|
|
8999
|
+
writeOsc(osc, forceWrapped) {
|
|
9000
|
+
const useWrapped = forceWrapped ?? this.useTmuxPassthrough ?? false;
|
|
9001
|
+
const data = useWrapped ? wrapForTmux(osc) : osc;
|
|
9000
9002
|
return this.writeFn(data);
|
|
9001
9003
|
}
|
|
9002
9004
|
cleanup() {
|
|
@@ -9009,7 +9011,7 @@ class TerminalPalette {
|
|
|
9009
9011
|
}
|
|
9010
9012
|
this.activeTimers = [];
|
|
9011
9013
|
}
|
|
9012
|
-
async
|
|
9014
|
+
async tryDetectOSCSupport(timeoutMs, useWrapped) {
|
|
9013
9015
|
const out = this.stdout;
|
|
9014
9016
|
const inp = this.stdin;
|
|
9015
9017
|
if (!out.isTTY || !inp.isTTY)
|
|
@@ -9042,9 +9044,31 @@ class TerminalPalette {
|
|
|
9042
9044
|
this.activeTimers.push(timer);
|
|
9043
9045
|
inp.on("data", onData);
|
|
9044
9046
|
this.activeListeners.push({ event: "data", handler: onData });
|
|
9045
|
-
this.writeOsc("\x1B]4;0;?\x07");
|
|
9047
|
+
this.writeOsc("\x1B]4;0;?\x07", useWrapped);
|
|
9046
9048
|
});
|
|
9047
9049
|
}
|
|
9050
|
+
async detectOSCSupport(timeoutMs = 300) {
|
|
9051
|
+
const out = this.stdout;
|
|
9052
|
+
const inp = this.stdin;
|
|
9053
|
+
if (!out.isTTY || !inp.isTTY)
|
|
9054
|
+
return false;
|
|
9055
|
+
if (this.useTmuxPassthrough !== null) {
|
|
9056
|
+
return this.tryDetectOSCSupport(timeoutMs, this.useTmuxPassthrough);
|
|
9057
|
+
}
|
|
9058
|
+
const bareWorks = await this.tryDetectOSCSupport(timeoutMs, false);
|
|
9059
|
+
if (bareWorks) {
|
|
9060
|
+
this.useTmuxPassthrough = false;
|
|
9061
|
+
return true;
|
|
9062
|
+
}
|
|
9063
|
+
if (this.inTmux) {
|
|
9064
|
+
const wrappedWorks = await this.tryDetectOSCSupport(timeoutMs, true);
|
|
9065
|
+
if (wrappedWorks) {
|
|
9066
|
+
this.useTmuxPassthrough = true;
|
|
9067
|
+
return true;
|
|
9068
|
+
}
|
|
9069
|
+
}
|
|
9070
|
+
return false;
|
|
9071
|
+
}
|
|
9048
9072
|
async queryPalette(indices, timeoutMs = 1200) {
|
|
9049
9073
|
const out = this.stdout;
|
|
9050
9074
|
const inp = this.stdin;
|
|
@@ -9055,11 +9079,9 @@ class TerminalPalette {
|
|
|
9055
9079
|
}
|
|
9056
9080
|
return new Promise((resolve4) => {
|
|
9057
9081
|
let buffer = "";
|
|
9058
|
-
let lastResponseTime = Date.now();
|
|
9059
9082
|
let idleTimer = null;
|
|
9060
9083
|
const onData = (chunk) => {
|
|
9061
9084
|
buffer += chunk.toString();
|
|
9062
|
-
lastResponseTime = Date.now();
|
|
9063
9085
|
let m;
|
|
9064
9086
|
OSC4_RESPONSE.lastIndex = 0;
|
|
9065
9087
|
while (m = OSC4_RESPONSE.exec(buffer)) {
|
|
@@ -9233,8 +9255,8 @@ class TerminalPalette {
|
|
|
9233
9255
|
};
|
|
9234
9256
|
}
|
|
9235
9257
|
}
|
|
9236
|
-
function createTerminalPalette(stdin, stdout, writeFn,
|
|
9237
|
-
return new TerminalPalette(stdin, stdout, writeFn,
|
|
9258
|
+
function createTerminalPalette(stdin, stdout, writeFn, inTmux) {
|
|
9259
|
+
return new TerminalPalette(stdin, stdout, writeFn, inTmux);
|
|
9238
9260
|
}
|
|
9239
9261
|
// src/zig.ts
|
|
9240
9262
|
import { dlopen, toArrayBuffer as toArrayBuffer4, JSCallback, ptr as ptr3 } from "bun:ffi";
|
|
@@ -16700,8 +16722,8 @@ Captured output:
|
|
|
16700
16722
|
return this._paletteDetectionPromise;
|
|
16701
16723
|
}
|
|
16702
16724
|
if (!this._paletteDetector) {
|
|
16703
|
-
const
|
|
16704
|
-
this._paletteDetector = createTerminalPalette(this.stdin, this.stdout, this.writeOut.bind(this),
|
|
16725
|
+
const inTmux = this.capabilities?.terminal?.name?.toLowerCase()?.includes("tmux") ?? false;
|
|
16726
|
+
this._paletteDetector = createTerminalPalette(this.stdin, this.stdout, this.writeOut.bind(this), inTmux);
|
|
16705
16727
|
}
|
|
16706
16728
|
this._paletteDetectionPromise = this._paletteDetector.detect(options).then((result) => {
|
|
16707
16729
|
this._cachedPalette = result;
|
|
@@ -16714,5 +16736,5 @@ Captured output:
|
|
|
16714
16736
|
|
|
16715
16737
|
export { __toESM, __commonJS, __export, __require, Edge, Gutter, MeasureMode, exports_src, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, ATTRIBUTE_BASE_BITS, ATTRIBUTE_BASE_MASK, getBaseAttributes, DebugOverlayCorner, createTextAttributes, attributesWithLink, getLinkId, 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, link, t, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, StdinBuffer, parseAlign, parseAlignItems, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extToFiletype, pathToFiletype, main, getTreeSitterClient, ExtmarksController, createExtmarksController, TerminalPalette, createTerminalPalette, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, ANSI, defaultKeyAliases, mergeKeyAliases, mergeKeyBindings, getKeyBindingKey, buildKeyBindingsMap, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, buildKittyKeyboardFlags, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, RendererControlState, CliRenderer };
|
|
16716
16738
|
|
|
16717
|
-
//# debugId=
|
|
16718
|
-
//# sourceMappingURL=index-
|
|
16739
|
+
//# debugId=DC7B02D3278C479364756E2164756E21
|
|
16740
|
+
//# sourceMappingURL=index-1tnk6s5e.js.map
|