@simon_he/vue-tui 1.1.5 → 1.1.7
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/README.md +1 -0
- package/dist/TAgentTerminalGraphic-B8-YZfuP.js +1198 -0
- package/dist/{TSelect-CMBOOFwK.js → TSelect-CCsjjCOr.js} +41 -12
- package/dist/{TTree-kk8ntrpg.js → TTree-3W5A2_EH.js} +4 -3
- package/dist/TVideo-D9AOiyq2.js +948 -0
- package/dist/agent.cjs +5204 -4312
- package/dist/agent.js +11 -9
- package/dist/{block-source-DhzajB9H.js → block-source-BhvdZomx.js} +246 -53
- package/dist/cli.cjs +41 -26
- package/dist/cli.js +68 -18
- package/dist/core.js +2 -2
- package/dist/experimental/browser.cjs +3705 -0
- package/dist/experimental/browser.d.cts +3 -0
- package/dist/experimental/browser.d.ts +3 -0
- package/dist/experimental/browser.js +413 -0
- package/dist/experimental.cjs +2 -1
- package/dist/experimental.js +9 -947
- package/dist/{linkify-CL9wwnZN.js → frame-mailbox-DaTrfyaF.js} +2 -297
- package/dist/index.cjs +25 -8
- package/dist/index.js +6 -5
- package/dist/linkify-CklfA1vp.js +298 -0
- package/dist/markdown.cjs +5196 -4322
- package/dist/markdown.js +4 -4
- package/dist/{mermaid-N3kGTHFy.js → mermaid-D0ov4_A1.js} +93 -9
- package/dist/mermaid.cjs +78 -7
- package/dist/mermaid.js +4 -4
- package/dist/{path-suggest-Dndu4dTi.js → path-suggest-fPzRsgPv.js} +1 -1
- package/dist/renderer/terminal-graphics.d.ts +1 -1
- package/dist/{terminal-graphics-2FTRg9x3.js → terminal-graphics-DpSL29OQ.js} +3 -3
- package/dist/{tlog-theme-B91Wv7Zj.js → tlog-theme-BnILsD3n.js} +10 -1203
- package/dist/vue/browser/types.d.ts +52 -0
- package/dist/vue/components/TAgentTerminalGraphic.d.ts +3 -0
- package/dist/vue/components/TBrowser.d.ts +231 -0
- package/dist/vue/components/TVirtualMarkdown.d.ts +10 -0
- package/dist/vue/markdown/render.d.ts +18 -1
- package/dist/vue.cjs +25 -8
- package/dist/vue.js +8 -7
- package/package.json +27 -2
- /package/dist/{TMermaidText-wLnMMvVS.js → TMermaidText-C1akgJPU.js} +0 -0
- /package/dist/{math-image-BZhmfUeu.js → math-image-CcUpBnW0.js} +0 -0
- /package/dist/{path-mnSgEpCm.js → path-BI9W15Zt.js} +0 -0
- /package/dist/{wheel-scroll-DASkEZr-.js → wheel-scroll-CQ22Hcyj.js} +0 -0
package/dist/markdown.js
CHANGED
|
@@ -4,10 +4,10 @@ import { EventZIndexContextKey, intersectRect, translateRect, useLayout, useRend
|
|
|
4
4
|
import "./env-Cl8qmNFN.js";
|
|
5
5
|
import "./terminal-selection-4W1SJj4c.js";
|
|
6
6
|
import "./debug-logger-CmsGI4of.js";
|
|
7
|
-
import "./wheel-scroll-
|
|
8
|
-
import { getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, subscribeTerminalGraphicsOutput } from "./terminal-graphics-
|
|
9
|
-
import { TVirtualMarkdown, buildMarkdownBlocks, buildMarkdownVisualRows, clearMarkdownImageGraphics, collectVisibleMarkdownImageGraphicIds, createMarkdownBlockSource, createTuiMarkdownParser, findMarkdownImageActionAt, findMarkdownLinkActionAt, findMarkdownMathActionAt, isSafeMarkdownLink, layoutMarkdownBlocks, loadMarkdownMathRenderer, markdownThemeSignature, paintMarkdownVisualRow, subscribeMarkdownMathRenderer } from "./block-source-
|
|
10
|
-
import { clearMarkdownMathImageCache, enqueueMarkdownMathImages, getCachedMarkdownMathImage, getMarkdownMathImage, isMarkdownMathImageRendererReady, loadMarkdownMathImageRenderer, resolveMarkdownMathColor, setMarkdownMathRasterizer, subscribeMarkdownMathImage } from "./math-image-
|
|
7
|
+
import "./wheel-scroll-CQ22Hcyj.js";
|
|
8
|
+
import { getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, subscribeTerminalGraphicsOutput } from "./terminal-graphics-DpSL29OQ.js";
|
|
9
|
+
import { TVirtualMarkdown, buildMarkdownBlocks, buildMarkdownVisualRows, clearMarkdownImageGraphics, collectVisibleMarkdownImageGraphicIds, createMarkdownBlockSource, createTuiMarkdownParser, findMarkdownImageActionAt, findMarkdownLinkActionAt, findMarkdownMathActionAt, isSafeMarkdownLink, layoutMarkdownBlocks, loadMarkdownMathRenderer, markdownThemeSignature, paintMarkdownVisualRow, subscribeMarkdownMathRenderer } from "./block-source-BhvdZomx.js";
|
|
10
|
+
import { clearMarkdownMathImageCache, enqueueMarkdownMathImages, getCachedMarkdownMathImage, getMarkdownMathImage, isMarkdownMathImageRendererReady, loadMarkdownMathImageRenderer, resolveMarkdownMathColor, setMarkdownMathRasterizer, subscribeMarkdownMathImage } from "./math-image-CcUpBnW0.js";
|
|
11
11
|
import { computed, defineComponent, getCurrentInstance, h, inject, markRaw, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
12
12
|
|
|
13
13
|
//#region src/vue/components/TMarkdownText.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventZIndexContextKey, intersectRect, padEndByCells$1 as padEndByCells, repeatChar, sanitizeInlineText, sanitizeTextBlock, sliceByCells, sliceByCellsRange, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useTerminal, useTerminalNode, useVisibility, withTextWidthProvider } from "./rect-JzWMJxxc.js";
|
|
2
|
-
import { TMermaidText$1 as TMermaidText, isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, tMermaidTextProps } from "./TMermaidText-
|
|
3
|
-
import { createTerminalGraphicPngSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, stableTerminalGraphicNumericId, subscribeTerminalGraphicsOutput } from "./terminal-graphics-
|
|
4
|
-
import { resolveMarkdownMathColor } from "./math-image-
|
|
2
|
+
import { TMermaidText$1 as TMermaidText, isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, tMermaidTextProps } from "./TMermaidText-C1akgJPU.js";
|
|
3
|
+
import { createTerminalGraphicPngSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, stableTerminalGraphicNumericId, subscribeTerminalGraphicsOutput } from "./terminal-graphics-DpSL29OQ.js";
|
|
4
|
+
import { resolveMarkdownMathColor } from "./math-image-CcUpBnW0.js";
|
|
5
5
|
import { computed, defineComponent, getCurrentInstance, h, inject, markRaw, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
6
6
|
|
|
7
7
|
//#region src/vue/mermaid/mermaid-image.ts
|
|
@@ -249,17 +249,101 @@ function extractSvgRootStyleColors(svg, fallbackBg, fallbackFg) {
|
|
|
249
249
|
fg
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
+
function isSvgVarNameChar(ch) {
|
|
253
|
+
const code = ch.charCodeAt(0);
|
|
254
|
+
return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || ch === "_" || ch === "-";
|
|
255
|
+
}
|
|
256
|
+
function isSvgWhitespace(ch) {
|
|
257
|
+
return ch === " " || ch === " " || ch === "\n" || ch === "\r" || ch === "\f";
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Find the next `<style ...>...</style>` block starting at or after `from`.
|
|
261
|
+
* Uses `indexOf` scans only (no regex backtracking), so untrusted SVG input
|
|
262
|
+
* cannot trigger ReDoS. Returns the outer range plus the inner content range,
|
|
263
|
+
* or null when no complete style block exists.
|
|
264
|
+
*/
|
|
265
|
+
function findSvgStyleBlock(svg, from = 0) {
|
|
266
|
+
const lower = svg.toLowerCase();
|
|
267
|
+
const open = lower.indexOf("<style", from);
|
|
268
|
+
if (open < 0) return null;
|
|
269
|
+
const tagEnd = svg.indexOf(">", open);
|
|
270
|
+
if (tagEnd < 0) return null;
|
|
271
|
+
const close = lower.indexOf("</style", tagEnd + 1);
|
|
272
|
+
if (close < 0) return null;
|
|
273
|
+
const closeEnd = svg.indexOf(">", close);
|
|
274
|
+
if (closeEnd < 0) return null;
|
|
275
|
+
return {
|
|
276
|
+
start: open,
|
|
277
|
+
contentStart: tagEnd + 1,
|
|
278
|
+
contentEnd: close,
|
|
279
|
+
end: closeEnd + 1
|
|
280
|
+
};
|
|
281
|
+
}
|
|
252
282
|
function extractSvgCssVariables(svg) {
|
|
253
283
|
const map = new Map();
|
|
254
|
-
const
|
|
255
|
-
if (!
|
|
256
|
-
const
|
|
257
|
-
let
|
|
258
|
-
while (
|
|
284
|
+
const block = findSvgStyleBlock(svg);
|
|
285
|
+
if (!block) return map;
|
|
286
|
+
const content = svg.slice(block.contentStart, block.contentEnd);
|
|
287
|
+
let cursor = 0;
|
|
288
|
+
while (cursor < content.length) {
|
|
289
|
+
const semi = content.indexOf(";", cursor);
|
|
290
|
+
if (semi < 0) break;
|
|
291
|
+
const statement = content.slice(cursor, semi);
|
|
292
|
+
let pos = 0;
|
|
293
|
+
while (pos < statement.length) {
|
|
294
|
+
const open = statement.indexOf("--", pos);
|
|
295
|
+
if (open < 0) break;
|
|
296
|
+
let nameEnd = open + 2;
|
|
297
|
+
while (nameEnd < statement.length && isSvgVarNameChar(statement[nameEnd])) nameEnd++;
|
|
298
|
+
if (nameEnd === open + 2) {
|
|
299
|
+
pos = open + 2;
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
let colonAt = nameEnd;
|
|
303
|
+
while (colonAt < statement.length && isSvgWhitespace(statement[colonAt])) colonAt++;
|
|
304
|
+
if (statement[colonAt] !== ":") {
|
|
305
|
+
pos = open + 2;
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
const value = statement.slice(colonAt + 1).trim();
|
|
309
|
+
if (value !== "" && !value.includes("{") && !value.includes("}")) map.set(statement.slice(open, nameEnd), value);
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
cursor = semi + 1;
|
|
313
|
+
}
|
|
259
314
|
return map;
|
|
260
315
|
}
|
|
316
|
+
/**
|
|
317
|
+
* True when the `<style` at `open` looks like a real element opener: the tag
|
|
318
|
+
* name must be followed by whitespace, "/" or ">".
|
|
319
|
+
*/
|
|
320
|
+
function isSvgStyleOpener(svg, open) {
|
|
321
|
+
const after = svg[open + 6];
|
|
322
|
+
return after === ">" || after === "/" || isSvgWhitespace(after);
|
|
323
|
+
}
|
|
261
324
|
function stripSvgStyleBlocks(svg) {
|
|
262
|
-
|
|
325
|
+
let result = svg;
|
|
326
|
+
let block = findSvgStyleBlock(result);
|
|
327
|
+
while (block) {
|
|
328
|
+
result = result.slice(0, block.start) + result.slice(block.end);
|
|
329
|
+
block = findSvgStyleBlock(result, block.start);
|
|
330
|
+
}
|
|
331
|
+
let open = result.toLowerCase().indexOf("<style");
|
|
332
|
+
while (open >= 0) {
|
|
333
|
+
if (!isSvgStyleOpener(result, open)) {
|
|
334
|
+
open = result.toLowerCase().indexOf("<style", open + 6);
|
|
335
|
+
continue;
|
|
336
|
+
}
|
|
337
|
+
const nextLt = result.indexOf("<", open + 6);
|
|
338
|
+
const tagEnd = result.indexOf(">", open);
|
|
339
|
+
if (tagEnd < 0 || nextLt >= 0 && nextLt < tagEnd) {
|
|
340
|
+
open = result.toLowerCase().indexOf("<style", open + 6);
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
result = result.slice(0, open) + result.slice(tagEnd + 1);
|
|
344
|
+
open = result.toLowerCase().indexOf("<style", open);
|
|
345
|
+
}
|
|
346
|
+
return result;
|
|
263
347
|
}
|
|
264
348
|
function findMatchingSvgParen(input, openIndex) {
|
|
265
349
|
let depth = 0;
|
package/dist/mermaid.cjs
CHANGED
|
@@ -1611,7 +1611,7 @@ function getRootTerminal(terminal) {
|
|
|
1611
1611
|
|
|
1612
1612
|
// src/renderer/terminal-graphics.ts
|
|
1613
1613
|
var ESC2 = "\x1B", BEL2 = "\x07", ST = `${ESC2}\\`, ESC_RE = "\\u001B", BEL_RE = "\\u0007", CSI_RE = new RegExp(`${ESC_RE}\\[[0-?]*[ -/]*[@-~]`, "g"), OSC_RE = new RegExp(`${ESC_RE}\\][\\s\\S]*?(?:${BEL_RE}|${ESC_RE}\\\\)`, "g"), DCS_RE = new RegExp(`${ESC_RE}P[\\s\\S]*?${ESC_RE}\\\\`, "g"), APC_RE = new RegExp(`${ESC_RE}_[\\s\\S]*?${ESC_RE}\\\\`, "g"), C1_CSI_RE = new RegExp("\\u009B[0-?]*[ -/]*[@-~]", "g"), C1_OSC_RE = new RegExp(`\\u009D[\\s\\S]*?(?:${BEL_RE}|\\u009C)`, "g"), C1_DCS_RE = new RegExp("\\u0090[\\s\\S]*?\\u009C", "g"), C1_APC_RE = new RegExp("\\u009F[\\s\\S]*?\\u009C", "g"), MAX_TERMINAL_GRAPHICS_SEQUENCE_CHARS = 16 * 1024 * 1024;
|
|
1614
|
-
var MAX_TERMINAL_GRAPHIC_CELLS =
|
|
1614
|
+
var MAX_TERMINAL_GRAPHIC_CELLS = 1e5, TERMINAL_GRAPHICS_REGISTRY = Symbol.for("@simon_he/vue-tui:v1:terminal-graphics"), terminalGraphicsGlobal = globalThis, terminalGraphicsRegistry = terminalGraphicsGlobal[TERMINAL_GRAPHICS_REGISTRY] ?? {
|
|
1615
1615
|
outputs: /* @__PURE__ */ new WeakMap(),
|
|
1616
1616
|
outputVersions: /* @__PURE__ */ new WeakMap(),
|
|
1617
1617
|
outputListeners: /* @__PURE__ */ new WeakMap()
|
|
@@ -2064,17 +2064,88 @@ function extractSvgRootStyleColors(svg, fallbackBg, fallbackFg) {
|
|
|
2064
2064
|
}
|
|
2065
2065
|
return { bg, fg };
|
|
2066
2066
|
}
|
|
2067
|
+
function isSvgVarNameChar(ch) {
|
|
2068
|
+
let code = ch.charCodeAt(0);
|
|
2069
|
+
return code >= 48 && code <= 57 || // 0-9
|
|
2070
|
+
code >= 65 && code <= 90 || // A-Z
|
|
2071
|
+
code >= 97 && code <= 122 || // a-z
|
|
2072
|
+
ch === "_" || ch === "-";
|
|
2073
|
+
}
|
|
2074
|
+
function isSvgWhitespace(ch) {
|
|
2075
|
+
return ch === " " || ch === " " || ch === `
|
|
2076
|
+
` || ch === "\r" || ch === "\f";
|
|
2077
|
+
}
|
|
2078
|
+
function findSvgStyleBlock(svg, from = 0) {
|
|
2079
|
+
let lower = svg.toLowerCase(), open = lower.indexOf("<style", from);
|
|
2080
|
+
if (open < 0)
|
|
2081
|
+
return null;
|
|
2082
|
+
let tagEnd = svg.indexOf(">", open);
|
|
2083
|
+
if (tagEnd < 0)
|
|
2084
|
+
return null;
|
|
2085
|
+
let close = lower.indexOf("</style", tagEnd + 1);
|
|
2086
|
+
if (close < 0)
|
|
2087
|
+
return null;
|
|
2088
|
+
let closeEnd = svg.indexOf(">", close);
|
|
2089
|
+
return closeEnd < 0 ? null : { start: open, contentStart: tagEnd + 1, contentEnd: close, end: closeEnd + 1 };
|
|
2090
|
+
}
|
|
2067
2091
|
function extractSvgCssVariables(svg) {
|
|
2068
|
-
let map = /* @__PURE__ */ new Map(),
|
|
2069
|
-
if (!
|
|
2092
|
+
let map = /* @__PURE__ */ new Map(), block = findSvgStyleBlock(svg);
|
|
2093
|
+
if (!block)
|
|
2070
2094
|
return map;
|
|
2071
|
-
let
|
|
2072
|
-
for (;
|
|
2073
|
-
|
|
2095
|
+
let content = svg.slice(block.contentStart, block.contentEnd), cursor = 0;
|
|
2096
|
+
for (; cursor < content.length; ) {
|
|
2097
|
+
let semi = content.indexOf(";", cursor);
|
|
2098
|
+
if (semi < 0)
|
|
2099
|
+
break;
|
|
2100
|
+
let statement = content.slice(cursor, semi), pos = 0;
|
|
2101
|
+
for (; pos < statement.length; ) {
|
|
2102
|
+
let open = statement.indexOf("--", pos);
|
|
2103
|
+
if (open < 0)
|
|
2104
|
+
break;
|
|
2105
|
+
let nameEnd = open + 2;
|
|
2106
|
+
for (; nameEnd < statement.length && isSvgVarNameChar(statement[nameEnd]); )
|
|
2107
|
+
nameEnd++;
|
|
2108
|
+
if (nameEnd === open + 2) {
|
|
2109
|
+
pos = open + 2;
|
|
2110
|
+
continue;
|
|
2111
|
+
}
|
|
2112
|
+
let colonAt = nameEnd;
|
|
2113
|
+
for (; colonAt < statement.length && isSvgWhitespace(statement[colonAt]); )
|
|
2114
|
+
colonAt++;
|
|
2115
|
+
if (statement[colonAt] !== ":") {
|
|
2116
|
+
pos = open + 2;
|
|
2117
|
+
continue;
|
|
2118
|
+
}
|
|
2119
|
+
let value = statement.slice(colonAt + 1).trim();
|
|
2120
|
+
value !== "" && !value.includes("{") && !value.includes("}") && map.set(statement.slice(open, nameEnd), value);
|
|
2121
|
+
break;
|
|
2122
|
+
}
|
|
2123
|
+
cursor = semi + 1;
|
|
2124
|
+
}
|
|
2074
2125
|
return map;
|
|
2075
2126
|
}
|
|
2127
|
+
function isSvgStyleOpener(svg, open) {
|
|
2128
|
+
let after = svg[open + 6];
|
|
2129
|
+
return after === ">" || after === "/" || isSvgWhitespace(after);
|
|
2130
|
+
}
|
|
2076
2131
|
function stripSvgStyleBlocks(svg) {
|
|
2077
|
-
|
|
2132
|
+
let result = svg, block = findSvgStyleBlock(result);
|
|
2133
|
+
for (; block; )
|
|
2134
|
+
result = result.slice(0, block.start) + result.slice(block.end), block = findSvgStyleBlock(result, block.start);
|
|
2135
|
+
let open = result.toLowerCase().indexOf("<style");
|
|
2136
|
+
for (; open >= 0; ) {
|
|
2137
|
+
if (!isSvgStyleOpener(result, open)) {
|
|
2138
|
+
open = result.toLowerCase().indexOf("<style", open + 6);
|
|
2139
|
+
continue;
|
|
2140
|
+
}
|
|
2141
|
+
let nextLt = result.indexOf("<", open + 6), tagEnd = result.indexOf(">", open);
|
|
2142
|
+
if (tagEnd < 0 || nextLt >= 0 && nextLt < tagEnd) {
|
|
2143
|
+
open = result.toLowerCase().indexOf("<style", open + 6);
|
|
2144
|
+
continue;
|
|
2145
|
+
}
|
|
2146
|
+
result = result.slice(0, open) + result.slice(tagEnd + 1), open = result.toLowerCase().indexOf("<style", open);
|
|
2147
|
+
}
|
|
2148
|
+
return result;
|
|
2078
2149
|
}
|
|
2079
2150
|
function findMatchingSvgParen(input, openIndex) {
|
|
2080
2151
|
let depth = 0;
|
package/dist/mermaid.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./create-terminal-Db_-UGVQ.js";
|
|
2
2
|
import "./rect-JzWMJxxc.js";
|
|
3
|
-
import { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal } from "./TMermaidText-
|
|
4
|
-
import "./terminal-graphics-
|
|
5
|
-
import "./math-image-
|
|
6
|
-
import { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidImage, TMermaidText, beautifulMermaidRenderer, clearMermaidImageCache, createBeautifulMermaidRenderer, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, resolveMermaidSvgForResvg, setMermaidImageRasterizer, subscribeMermaidImage } from "./mermaid-
|
|
3
|
+
import { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal } from "./TMermaidText-C1akgJPU.js";
|
|
4
|
+
import "./terminal-graphics-DpSL29OQ.js";
|
|
5
|
+
import "./math-image-CcUpBnW0.js";
|
|
6
|
+
import { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidImage, TMermaidText, beautifulMermaidRenderer, clearMermaidImageCache, createBeautifulMermaidRenderer, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, resolveMermaidSvgForResvg, setMermaidImageRasterizer, subscribeMermaidImage } from "./mermaid-D0ov4_A1.js";
|
|
7
7
|
|
|
8
8
|
export { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidImage, TMermaidText, beautifulMermaidRenderer, clearMermaidImageCache, createBeautifulMermaidRenderer, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, isSimpleMermaidFlowchartSource, loadMermaidImageRenderer, markMermaidRenderErrorFatal, normalizeMermaidImageOptions, resolveMermaidImageColor, resolveMermaidSvgForResvg, setMermaidImageRasterizer, subscribeMermaidImage };
|
|
@@ -72,7 +72,7 @@ export type TerminalGraphicsOutput = Readonly<{
|
|
|
72
72
|
}>;
|
|
73
73
|
export declare const MAX_TERMINAL_GRAPHICS_SEQUENCE_CHARS: number;
|
|
74
74
|
export declare const MAX_TERMINAL_GRAPHICS_FALLBACK_CHARS = 16384;
|
|
75
|
-
export declare const MAX_TERMINAL_GRAPHIC_CELLS =
|
|
75
|
+
export declare const MAX_TERMINAL_GRAPHIC_CELLS = 100000;
|
|
76
76
|
export declare function registerTerminalGraphicsOutput(terminal: Terminal, output: TerminalGraphicsOutput): () => void;
|
|
77
77
|
export declare function getTerminalGraphicsOutput(terminal: Terminal): TerminalGraphicsOutput | null;
|
|
78
78
|
export declare function getTerminalGraphicsOutputVersion(terminal: Terminal): number;
|
|
@@ -21,7 +21,7 @@ const C1_DCS_RE = new RegExp("\\u0090[\\s\\S]*?\\u009C", "g");
|
|
|
21
21
|
const C1_APC_RE = new RegExp("\\u009F[\\s\\S]*?\\u009C", "g");
|
|
22
22
|
const MAX_TERMINAL_GRAPHICS_SEQUENCE_CHARS = 16 * 1024 * 1024;
|
|
23
23
|
const MAX_TERMINAL_GRAPHICS_FALLBACK_CHARS = 16384;
|
|
24
|
-
const MAX_TERMINAL_GRAPHIC_CELLS =
|
|
24
|
+
const MAX_TERMINAL_GRAPHIC_CELLS = 1e5;
|
|
25
25
|
const TERMINAL_GRAPHICS_REGISTRY = Symbol.for("@simon_he/vue-tui:v1:terminal-graphics");
|
|
26
26
|
const terminalGraphicsGlobal = globalThis;
|
|
27
27
|
const terminalGraphicsRegistry = terminalGraphicsGlobal[TERMINAL_GRAPHICS_REGISTRY] ?? {
|
|
@@ -89,8 +89,8 @@ function detectCandidates(env) {
|
|
|
89
89
|
const term = String(envString(env, "TERM") ?? "").toLowerCase();
|
|
90
90
|
const termProgram = String(envString(env, "TERM_PROGRAM") ?? "").toLowerCase();
|
|
91
91
|
const termProgramVersion = String(envString(env, "TERM_PROGRAM_VERSION") ?? "").toLowerCase();
|
|
92
|
-
if (envString(env, "KITTY_WINDOW_ID") || envString(env, "GHOSTTY_RESOURCES_DIR") || /(?:^|-)kitty(?:-|$)/i.test(term) || term.includes("ghostty") || termProgram.includes("ghostty")) candidates.push("kitty");
|
|
93
|
-
if (termProgram.includes("iterm")
|
|
92
|
+
if (envString(env, "KITTY_WINDOW_ID") || envString(env, "GHOSTTY_RESOURCES_DIR") || /(?:^|-)kitty(?:-|$)/i.test(term) || term.includes("ghostty") || termProgram.includes("ghostty") || termProgram.includes("wezterm") || envString(env, "WEZTERM_PANE") || envString(env, "WEZTERM_EXECUTABLE")) candidates.push("kitty");
|
|
93
|
+
if (termProgram.includes("iterm")) candidates.push("iterm2");
|
|
94
94
|
if (truthy(envString(env, "VUE_TUI_SIXEL")) || truthy(envString(env, "VUE_TUI_GRAPHICS_SIXEL")) || String(envString(env, "TERMINAL_GRAPHICS") ?? "").toLowerCase().includes("sixel") || /\bsixel\b/i.test(`${term} ${termProgram} ${termProgramVersion}`)) candidates.push("sixel");
|
|
95
95
|
return uniqueProtocols(candidates);
|
|
96
96
|
}
|