@simon_he/vue-tui 1.1.5 → 1.1.6
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/dist/agent.cjs +477 -147
- package/dist/agent.js +3 -3
- package/dist/{block-source-DhzajB9H.js → block-source-DByORvKG.js} +244 -51
- package/dist/cli.cjs +33 -18
- package/dist/cli.js +53 -13
- package/dist/experimental.cjs +1 -0
- package/dist/experimental.js +2 -2
- package/dist/markdown.cjs +475 -146
- package/dist/markdown.js +2 -2
- package/dist/{mermaid-N3kGTHFy.js → mermaid-CWy4wtCL.js} +91 -7
- package/dist/mermaid.cjs +77 -6
- package/dist/mermaid.js +2 -2
- package/dist/{terminal-graphics-2FTRg9x3.js → terminal-graphics-D6KErRBY.js} +2 -2
- package/dist/{tlog-theme-B91Wv7Zj.js → tlog-theme-DIrlCw6m.js} +1 -1
- package/dist/vue/components/TAgentTerminalGraphic.d.ts +3 -0
- package/dist/vue/components/TVirtualMarkdown.d.ts +10 -0
- package/dist/vue/markdown/render.d.ts +18 -1
- package/package.json +12 -1
package/dist/markdown.js
CHANGED
|
@@ -5,8 +5,8 @@ import "./env-Cl8qmNFN.js";
|
|
|
5
5
|
import "./terminal-selection-4W1SJj4c.js";
|
|
6
6
|
import "./debug-logger-CmsGI4of.js";
|
|
7
7
|
import "./wheel-scroll-DASkEZr-.js";
|
|
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-
|
|
8
|
+
import { getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, subscribeTerminalGraphicsOutput } from "./terminal-graphics-D6KErRBY.js";
|
|
9
|
+
import { TVirtualMarkdown, buildMarkdownBlocks, buildMarkdownVisualRows, clearMarkdownImageGraphics, collectVisibleMarkdownImageGraphicIds, createMarkdownBlockSource, createTuiMarkdownParser, findMarkdownImageActionAt, findMarkdownLinkActionAt, findMarkdownMathActionAt, isSafeMarkdownLink, layoutMarkdownBlocks, loadMarkdownMathRenderer, markdownThemeSignature, paintMarkdownVisualRow, subscribeMarkdownMathRenderer } from "./block-source-DByORvKG.js";
|
|
10
10
|
import { clearMarkdownMathImageCache, enqueueMarkdownMathImages, getCachedMarkdownMathImage, getMarkdownMathImage, isMarkdownMathImageRendererReady, loadMarkdownMathImageRenderer, resolveMarkdownMathColor, setMarkdownMathRasterizer, subscribeMarkdownMathImage } from "./math-image-BZhmfUeu.js";
|
|
11
11
|
import { computed, defineComponent, getCurrentInstance, h, inject, markRaw, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
12
12
|
|
|
@@ -1,6 +1,6 @@
|
|
|
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
2
|
import { TMermaidText$1 as TMermaidText, isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal, tMermaidTextProps } from "./TMermaidText-wLnMMvVS.js";
|
|
3
|
-
import { createTerminalGraphicPngSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, stableTerminalGraphicNumericId, subscribeTerminalGraphicsOutput } from "./terminal-graphics-
|
|
3
|
+
import { createTerminalGraphicPngSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, stableTerminalGraphicNumericId, subscribeTerminalGraphicsOutput } from "./terminal-graphics-D6KErRBY.js";
|
|
4
4
|
import { resolveMarkdownMathColor } from "./math-image-BZhmfUeu.js";
|
|
5
5
|
import { computed, defineComponent, getCurrentInstance, h, inject, markRaw, onBeforeUnmount, shallowRef, watch } from "vue";
|
|
6
6
|
|
|
@@ -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
|
@@ -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
3
|
import { isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal } from "./TMermaidText-wLnMMvVS.js";
|
|
4
|
-
import "./terminal-graphics-
|
|
4
|
+
import "./terminal-graphics-D6KErRBY.js";
|
|
5
5
|
import "./math-image-BZhmfUeu.js";
|
|
6
|
-
import { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidImage, TMermaidText, beautifulMermaidRenderer, clearMermaidImageCache, createBeautifulMermaidRenderer, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, resolveMermaidSvgForResvg, setMermaidImageRasterizer, subscribeMermaidImage } from "./mermaid-
|
|
6
|
+
import { TBeautifulMermaid, TBeautifulMermaidText, TMermaid, TMermaidImage, TMermaidText, beautifulMermaidRenderer, clearMermaidImageCache, createBeautifulMermaidRenderer, getCachedMermaidImage, getMermaidImage, isMermaidImageRendererReady, loadMermaidImageRenderer, normalizeMermaidImageOptions, resolveMermaidImageColor, resolveMermaidSvgForResvg, setMermaidImageRasterizer, subscribeMermaidImage } from "./mermaid-CWy4wtCL.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 };
|
|
@@ -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
|
}
|
|
@@ -5,7 +5,7 @@ import { TView, TuiThemeContextKey, createFrameMailbox, defaultActiveStyle, link
|
|
|
5
5
|
import { framePerfNow } from "./frame-perf-CHpWhbC4.js";
|
|
6
6
|
import { terminalSelectionRowSpans, terminalSelectionVisibleRowSpans } from "./terminal-selection-4W1SJj4c.js";
|
|
7
7
|
import { applyWheelScroll, createWheelScrollState, resetWheelScrollState } from "./wheel-scroll-DASkEZr-.js";
|
|
8
|
-
import { canDrawTerminalGraphicRect, createKittyDeleteGraphicsSequence, createKittyPlacementSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, isSafeTerminalGraphicsSequence, isTerminalGraphicsProtocol, normalizeTerminalGraphicSize, sanitizeTerminalFallbackText, stableTerminalGraphicNumericId, subscribeTerminalGraphicsOutput } from "./terminal-graphics-
|
|
8
|
+
import { canDrawTerminalGraphicRect, createKittyDeleteGraphicsSequence, createKittyPlacementSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, isSafeTerminalGraphicsSequence, isTerminalGraphicsProtocol, normalizeTerminalGraphicSize, sanitizeTerminalFallbackText, stableTerminalGraphicNumericId, subscribeTerminalGraphicsOutput } from "./terminal-graphics-D6KErRBY.js";
|
|
9
9
|
import { computed, defineComponent, getCurrentInstance, h, inject, markRaw, onBeforeUnmount, provide, ref, shallowReactive, shallowRef, watch, watchEffect } from "vue";
|
|
10
10
|
|
|
11
11
|
//#region src/vue/utils/row-scroll.ts
|
|
@@ -155,6 +155,7 @@ export declare const tAgentTerminalGraphicProps: {
|
|
|
155
155
|
readonly type: NumberConstructor;
|
|
156
156
|
readonly default: 0;
|
|
157
157
|
};
|
|
158
|
+
/** Advanced Kitty-only opt-in for moving an unchanged image via a reusable placement sequence. */
|
|
158
159
|
readonly placementMoveWithoutClear: {
|
|
159
160
|
readonly type: BooleanConstructor;
|
|
160
161
|
readonly default: false;
|
|
@@ -278,6 +279,7 @@ export declare const TAgentTerminalGraphic: import("vue").DefineComponent<import
|
|
|
278
279
|
readonly type: NumberConstructor;
|
|
279
280
|
readonly default: 0;
|
|
280
281
|
};
|
|
282
|
+
/** Advanced Kitty-only opt-in for moving an unchanged image via a reusable placement sequence. */
|
|
281
283
|
readonly placementMoveWithoutClear: {
|
|
282
284
|
readonly type: BooleanConstructor;
|
|
283
285
|
readonly default: false;
|
|
@@ -401,6 +403,7 @@ export declare const TAgentTerminalGraphic: import("vue").DefineComponent<import
|
|
|
401
403
|
readonly type: NumberConstructor;
|
|
402
404
|
readonly default: 0;
|
|
403
405
|
};
|
|
406
|
+
/** Advanced Kitty-only opt-in for moving an unchanged image via a reusable placement sequence. */
|
|
404
407
|
readonly placementMoveWithoutClear: {
|
|
405
408
|
readonly type: BooleanConstructor;
|
|
406
409
|
readonly default: false;
|
|
@@ -3,6 +3,7 @@ import type { Style } from "../../core/types.js";
|
|
|
3
3
|
import type { Rect, TerminalKeyboardEvent } from "../../events/manager/types.js";
|
|
4
4
|
import { type TuiMarkdownThemeOverrides } from "../markdown/theme.js";
|
|
5
5
|
import type { TuiMarkdownBlock, TuiMarkdownImageActionPayload, TuiMarkdownImageResolver, TuiMarkdownLinkActionPayload, TuiMarkdownMathActionPayload } from "../markdown/types.js";
|
|
6
|
+
import type { TVirtualRowsRowScrollMode } from "./TVirtualRows.js";
|
|
6
7
|
export declare const TVirtualMarkdown: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
7
8
|
x: {
|
|
8
9
|
type: NumberConstructor;
|
|
@@ -132,6 +133,10 @@ export declare const TVirtualMarkdown: import("vue").DefineComponent<import("vue
|
|
|
132
133
|
type: PropType<readonly Rect[]>;
|
|
133
134
|
default: undefined;
|
|
134
135
|
};
|
|
136
|
+
rowScrollMode: {
|
|
137
|
+
type: PropType<TVirtualRowsRowScrollMode>;
|
|
138
|
+
default: string;
|
|
139
|
+
};
|
|
135
140
|
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
136
141
|
[key: string]: any;
|
|
137
142
|
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -272,6 +277,10 @@ export declare const TVirtualMarkdown: import("vue").DefineComponent<import("vue
|
|
|
272
277
|
type: PropType<readonly Rect[]>;
|
|
273
278
|
default: undefined;
|
|
274
279
|
};
|
|
280
|
+
rowScrollMode: {
|
|
281
|
+
type: PropType<TVirtualRowsRowScrollMode>;
|
|
282
|
+
default: string;
|
|
283
|
+
};
|
|
275
284
|
}>> & Readonly<{
|
|
276
285
|
onKeydown?: ((_event: TerminalKeyboardEvent) => any) | undefined;
|
|
277
286
|
onFocus?: (() => any) | undefined;
|
|
@@ -355,6 +364,7 @@ export declare const TVirtualMarkdown: import("vue").DefineComponent<import("vue
|
|
|
355
364
|
content: string;
|
|
356
365
|
final: boolean;
|
|
357
366
|
streaming: boolean;
|
|
367
|
+
rowScrollMode: TVirtualRowsRowScrollMode;
|
|
358
368
|
scrollTop: number;
|
|
359
369
|
customHtmlTags: readonly string[];
|
|
360
370
|
theme: Readonly<Partial<{
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Style, Terminal } from "../../core/types.js";
|
|
2
2
|
import type { TuiMarkdownVisualRow } from "./types.js";
|
|
3
|
-
|
|
3
|
+
type MarkdownImageGraphic = NonNullable<TuiMarkdownVisualRow["segments"][number]["graphic"]>;
|
|
4
|
+
export declare function markdownImageGraphicId(segment: MarkdownImageGraphic, identity: string): string;
|
|
4
5
|
export declare function clearMarkdownImageGraphics(terminal: Terminal, rect?: Readonly<{
|
|
5
6
|
x: number;
|
|
6
7
|
y: number;
|
|
@@ -21,6 +22,20 @@ export declare function collectVisibleMarkdownImageGraphicIds(rows: readonly Tui
|
|
|
21
22
|
h: number;
|
|
22
23
|
}>) => boolean;
|
|
23
24
|
}>): ReadonlySet<string>;
|
|
25
|
+
export declare function queueClippedVisibleMarkdownImageGraphics(terminal: Terminal, rows: readonly TuiMarkdownVisualRow[], options: Readonly<{
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
w: number;
|
|
29
|
+
h: number;
|
|
30
|
+
rowOffset: number;
|
|
31
|
+
clipStart: number;
|
|
32
|
+
isGraphicCovered?: (rect: Readonly<{
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
w: number;
|
|
36
|
+
h: number;
|
|
37
|
+
}>) => boolean;
|
|
38
|
+
}>): ReadonlySet<string>;
|
|
24
39
|
export declare function paintMarkdownVisualRow(terminal: Terminal, row: TuiMarkdownVisualRow | undefined, options: Readonly<{
|
|
25
40
|
x: number;
|
|
26
41
|
y: number;
|
|
@@ -29,6 +44,7 @@ export declare function paintMarkdownVisualRow(terminal: Terminal, row: TuiMarkd
|
|
|
29
44
|
baseStyle: Style;
|
|
30
45
|
clear?: boolean;
|
|
31
46
|
keepGraphicIds?: ReadonlySet<string>;
|
|
47
|
+
prequeuedGraphicIds?: ReadonlySet<string>;
|
|
32
48
|
isGraphicCovered?: (rect: Readonly<{
|
|
33
49
|
x: number;
|
|
34
50
|
y: number;
|
|
@@ -36,3 +52,4 @@ export declare function paintMarkdownVisualRow(terminal: Terminal, row: TuiMarkd
|
|
|
36
52
|
h: number;
|
|
37
53
|
}>) => boolean;
|
|
38
54
|
}>): void;
|
|
55
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simon_he/vue-tui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Vue 3 terminal UI components and renderers for browser DOM, CLI stdout, logs, markdown transcripts, and agent consoles",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-console",
|
|
@@ -346,6 +346,16 @@
|
|
|
346
346
|
"example:3d:smoke": "VT_SMOKE=1 bun examples/t3d-terminal-badge.ts",
|
|
347
347
|
"run:flappy:terminal": "tsx examples/flappy-bird-terminal.ts",
|
|
348
348
|
"example:flappy:smoke": "VT_SMOKE=1 tsx examples/flappy-bird-terminal.ts",
|
|
349
|
+
"run:contra:terminal": "tsx examples/contra-graphics-terminal.ts",
|
|
350
|
+
"example:contra:smoke": "VT_SMOKE=1 tsx examples/contra-graphics-terminal.ts",
|
|
351
|
+
"run:contra-text:terminal": "tsx examples/contra-terminal.ts",
|
|
352
|
+
"example:contra-text:smoke": "VT_SMOKE=1 tsx examples/contra-terminal.ts",
|
|
353
|
+
"run:nes:terminal": "tsx examples/nes-terminal.ts",
|
|
354
|
+
"example:nes:smoke": "VT_SMOKE=1 tsx examples/nes-terminal.ts",
|
|
355
|
+
"check:nes:rom": "tsx examples/nes/check-rom.ts",
|
|
356
|
+
"check:nes:input": "tsx examples/nes/input-flip-check.ts",
|
|
357
|
+
"check:nes:share": "tsx examples/nes/share-check.ts",
|
|
358
|
+
"check:nes:share-browser": "tsx examples/nes/share-browser-check.ts",
|
|
349
359
|
"test:3d:bun": "bun scripts/smoke-bun-3d.ts",
|
|
350
360
|
"run:image-showcase:terminal": "tsx examples/image-showcase.ts",
|
|
351
361
|
"run:katex-showcase:terminal": "tsx examples/katex-showcase.ts",
|
|
@@ -413,6 +423,7 @@
|
|
|
413
423
|
"bench:baseline:timing": "BENCH_TIMING=1 tsx scripts/check-bench-baselines.ts",
|
|
414
424
|
"bench:phase2": "tsx scripts/bench-phase2.ts",
|
|
415
425
|
"bench:scroll-mailbox": "tsx scripts/bench-scroll-mailbox.ts",
|
|
426
|
+
"bench:markdown-graphics": "tsx scripts/bench-markdown-graphics.ts",
|
|
416
427
|
"bench:stdout-column-diff": "tsx scripts/bench-stdout-column-diff.ts",
|
|
417
428
|
"unicode:eaw:generate": "tsx scripts/generate-eaw-ranges.ts",
|
|
418
429
|
"unicode:eaw:check": "tsx scripts/generate-eaw-ranges.ts && git diff --exit-code -- src/core/buffer/eaw-ranges-unicode-17.ts",
|