@simon_he/vue-tui 1.1.2 → 1.1.3
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/{TSelect-tJ87rKPM.js → TSelect-Dx34M1pF.js} +2 -2
- package/dist/{TTree-CGdE-CYu.js → TTree-DdAjCPHu.js} +2 -2
- package/dist/agent.cjs +3396 -13388
- package/dist/agent.js +4 -4
- package/dist/{block-source-CrlmaBM5.js → block-source-Crro3mxi.js} +185 -124
- package/dist/experimental.js +2 -2
- package/dist/index.js +3 -3
- package/dist/{linkify-D68T7rdW.js → linkify-BjI4zVfY.js} +1 -1
- package/dist/markdown.cjs +2929 -12918
- package/dist/markdown.d.cts +1 -0
- package/dist/markdown.d.ts +1 -0
- package/dist/markdown.js +6 -2
- package/dist/{tlog-theme-Bul2Na3u.js → tlog-theme-i6S_Oftd.js} +1 -1
- package/dist/vue/markdown/math.d.ts +2 -0
- package/dist/vue.js +3 -3
- package/package.json +7 -3
package/dist/agent.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import "./hyperlink-_1FAj7Wq.js";
|
|
2
2
|
import "./width-GqllnV8C.js";
|
|
3
3
|
import { forEachTextCellSegment, recordTerminalGraphicTrace, sanitizeInlineText, sanitizeTextBlock, sliceByCells, spaces, textCellWidth$1 as textCellWidth, useTerminal, withTextWidthProvider } from "./rect-DUpeDfBg.js";
|
|
4
|
-
import { TText, TView } from "./linkify-
|
|
4
|
+
import { TText, TView } from "./linkify-BjI4zVfY.js";
|
|
5
5
|
import "./frame-perf-CHpWhbC4.js";
|
|
6
6
|
import "./env-Cl8qmNFN.js";
|
|
7
7
|
import "./terminal-selection-4W1SJj4c.js";
|
|
8
8
|
import "./debug-logger-CmsGI4of.js";
|
|
9
|
-
import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-
|
|
9
|
+
import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-Dx34M1pF.js";
|
|
10
10
|
import "./path-mnSgEpCm.js";
|
|
11
11
|
import "./wheel-scroll-DASkEZr-.js";
|
|
12
12
|
import { TMermaid$1 as TMermaid, TMermaidText$1 as TMermaidText, isSimpleMermaidFlowchartSource, markMermaidRenderErrorFatal } from "./TMermaidText-frVr8Ysb.js";
|
|
13
13
|
import { createIterm2InlineImageSequence, createKittyDeleteGraphicsSequence, createKittyGraphicsSequence, createKittyPlacementSequence, detectTerminalGraphicsCapabilities, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, hashTerminalGraphicsString, isSafeTerminalGraphicsSequence, normalizeTerminalGraphicSize, sanitizeTerminalFallbackText, subscribeTerminalGraphicsOutput } from "./terminal-graphics-Bbe83wSr.js";
|
|
14
|
-
import { TVirtualMarkdown, createMarkdownBlockSource } from "./block-source-
|
|
15
|
-
import { TAgentTerminalGraphic, TLogLinksPanel, TLogMinimap, TLogScrollbar, TLogSearchBar, TLogSearchPager, TLogSearchResults, TLogView, TLogVirtualLinksPanel, TLogVirtualSearchResults, TTranscriptView, TVirtualList, createAppendOnlyLogStore, createTLogDensityBucketsFromMarkers, createTLogLevelPlugin, createTLogLineMatcherPlugin, createTLogLinkActionPlugin, createTLogOsc8LinkPlugin, createTLogUrlPlugin, detectTLogUrls, dispatchTLogPluginLinkAction, getTLogPluginMetadata, parseTLogAnnotatedText, resolveTLogLinksPanelTheme, resolveTLogMinimapTheme, resolveTLogScrollbarTheme, resolveTLogSearchBarTheme, resolveTLogSearchPagerTheme, resolveTLogSearchResultsTheme, resolveTLogViewTheme, stripTLogAnsiText, tlogDarkPreset, tlogDarkTheme, tlogDefaultPreset, tlogDefaultTheme, tlogHighContrastPreset, tlogHighContrastTheme, toTLogExternalLinkFromVisibleLink, useTLogLinkController, useTLogRetainedIndex, useTLogSearchController, useTLogSearchResultsPage, useTLogVirtualSearchResults } from "./tlog-theme-
|
|
14
|
+
import { TVirtualMarkdown, createMarkdownBlockSource } from "./block-source-Crro3mxi.js";
|
|
15
|
+
import { TAgentTerminalGraphic, TLogLinksPanel, TLogMinimap, TLogScrollbar, TLogSearchBar, TLogSearchPager, TLogSearchResults, TLogView, TLogVirtualLinksPanel, TLogVirtualSearchResults, TTranscriptView, TVirtualList, createAppendOnlyLogStore, createTLogDensityBucketsFromMarkers, createTLogLevelPlugin, createTLogLineMatcherPlugin, createTLogLinkActionPlugin, createTLogOsc8LinkPlugin, createTLogUrlPlugin, detectTLogUrls, dispatchTLogPluginLinkAction, getTLogPluginMetadata, parseTLogAnnotatedText, resolveTLogLinksPanelTheme, resolveTLogMinimapTheme, resolveTLogScrollbarTheme, resolveTLogSearchBarTheme, resolveTLogSearchPagerTheme, resolveTLogSearchResultsTheme, resolveTLogViewTheme, stripTLogAnsiText, tlogDarkPreset, tlogDarkTheme, tlogDefaultPreset, tlogDefaultTheme, tlogHighContrastPreset, tlogHighContrastTheme, toTLogExternalLinkFromVisibleLink, useTLogLinkController, useTLogRetainedIndex, useTLogSearchController, useTLogSearchResultsPage, useTLogVirtualSearchResults } from "./tlog-theme-i6S_Oftd.js";
|
|
16
16
|
import { computed, defineComponent, h } from "vue";
|
|
17
17
|
|
|
18
18
|
//#region src/vue/agent/view-models.ts
|
|
@@ -5,7 +5,6 @@ import { createDebugLogger, isDebugEnabled } from "./debug-logger-CmsGI4of.js";
|
|
|
5
5
|
import { applyWheelScroll, createWheelScrollState, resetWheelScrollState } from "./wheel-scroll-DASkEZr-.js";
|
|
6
6
|
import { createIterm2InlineImageSequence, createKittyDeleteGraphicsSequence, createKittyGraphicsSequence, createKittyPlacementSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, isTerminalGraphicsProtocol, stableTerminalGraphicNumericId, subscribeTerminalGraphicsOutput } from "./terminal-graphics-Bbe83wSr.js";
|
|
7
7
|
import { computed, defineComponent, getCurrentInstance, h, inject, markRaw, onBeforeUnmount, ref, shallowRef, watch, watchEffect } from "vue";
|
|
8
|
-
import katex from "katex";
|
|
9
8
|
import { getMarkdown, parseMarkdownToStructure } from "stream-markdown-parser";
|
|
10
9
|
|
|
11
10
|
//#region src/vue/markdown/image.ts
|
|
@@ -116,6 +115,29 @@ function readMarkdownImageDimensions(base64) {
|
|
|
116
115
|
|
|
117
116
|
//#endregion
|
|
118
117
|
//#region src/vue/markdown/math.ts
|
|
118
|
+
let loadedKatex = null;
|
|
119
|
+
let katexLoad = null;
|
|
120
|
+
const katexListeners = new Set();
|
|
121
|
+
function resolveKatexRenderer(value) {
|
|
122
|
+
if (!value || typeof value !== "object") return null;
|
|
123
|
+
const renderToString = value.renderToString;
|
|
124
|
+
return typeof renderToString === "function" ? { renderToString } : null;
|
|
125
|
+
}
|
|
126
|
+
function subscribeMarkdownMathRenderer(listener) {
|
|
127
|
+
katexListeners.add(listener);
|
|
128
|
+
return () => katexListeners.delete(listener);
|
|
129
|
+
}
|
|
130
|
+
async function loadMarkdownMathRenderer() {
|
|
131
|
+
if (loadedKatex) return true;
|
|
132
|
+
if (!katexLoad) katexLoad = import("katex").then((mod) => {
|
|
133
|
+
const renderer = resolveKatexRenderer(mod.default) ?? resolveKatexRenderer(mod);
|
|
134
|
+
if (!renderer) return false;
|
|
135
|
+
loadedKatex = renderer;
|
|
136
|
+
for (const listener of katexListeners) listener();
|
|
137
|
+
return true;
|
|
138
|
+
}).catch(() => false);
|
|
139
|
+
return katexLoad;
|
|
140
|
+
}
|
|
119
141
|
const KATEX_TEXT_OPTIONS = Object.freeze({
|
|
120
142
|
output: "mathml",
|
|
121
143
|
throwOnError: false,
|
|
@@ -244,7 +266,7 @@ function approximateTexToUnicode(tex) {
|
|
|
244
266
|
out = out.replace(/\s+/g, " ").trim();
|
|
245
267
|
return sanitizeInlineText(out.replace(/[<>]/g, ""));
|
|
246
268
|
}
|
|
247
|
-
function canRenderTerminalMath(tex) {
|
|
269
|
+
function canRenderTerminalMath(tex, katex) {
|
|
248
270
|
const source = String(tex ?? "").trim();
|
|
249
271
|
if (!source || source.length > 160) return false;
|
|
250
272
|
if (/\\(?:begin|end|left|right|matrix|cases|array|align|color|href|html|includegraphics|class|style|tag|text|operatorname)\b/.test(source)) return false;
|
|
@@ -263,7 +285,15 @@ function renderMarkdownInlineMathSegment(tex) {
|
|
|
263
285
|
text: "",
|
|
264
286
|
supported: false
|
|
265
287
|
};
|
|
266
|
-
|
|
288
|
+
const katex = loadedKatex;
|
|
289
|
+
if (!katex) {
|
|
290
|
+
loadMarkdownMathRenderer();
|
|
291
|
+
return {
|
|
292
|
+
text: "",
|
|
293
|
+
supported: false
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
if (!canRenderTerminalMath(source, katex)) return {
|
|
267
297
|
text: "",
|
|
268
298
|
supported: false
|
|
269
299
|
};
|
|
@@ -370,6 +400,15 @@ function stringProp(node, key) {
|
|
|
370
400
|
const value = node[key];
|
|
371
401
|
return typeof value === "string" ? value : "";
|
|
372
402
|
}
|
|
403
|
+
/**
|
|
404
|
+
* Temporary fallback: stream-markdown-parser only recovers ``
|
|
405
|
+
* destinations (Windows drive letters, fixed in 1.1.8). Unix-style `file:///...`
|
|
406
|
+
* destinations at inline start are still emitted as `text("!") + link`. Remove this
|
|
407
|
+
* once the parser covers all `file://` destinations.
|
|
408
|
+
*/
|
|
409
|
+
function isUnixFileUrlNeedingImageFallback(href) {
|
|
410
|
+
return /^file:\/\//i.test(href) && !/^file:\/\/\/[a-z]:\//i.test(href);
|
|
411
|
+
}
|
|
373
412
|
function imageSourceFromRaw(raw) {
|
|
374
413
|
if (!raw.startsWith(";
|
|
@@ -466,132 +505,150 @@ function codeBlockLanguage(node) {
|
|
|
466
505
|
}
|
|
467
506
|
function inlineNodeSegments(nodes, theme, inheritedStyle, options = {}) {
|
|
468
507
|
const out = [];
|
|
469
|
-
for (
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
break;
|
|
486
|
-
case "strikethrough":
|
|
487
|
-
out.push(...inlineNodeSegments(nodeChildren(node), theme, mergeStyle$1(inheritedStyle, theme.strikethrough), options));
|
|
488
|
-
break;
|
|
489
|
-
case "highlight":
|
|
490
|
-
case "insert":
|
|
491
|
-
case "subscript":
|
|
492
|
-
case "superscript":
|
|
493
|
-
out.push(...inlineNodeSegments(nodeChildren(node), theme, inheritedStyle, options));
|
|
494
|
-
break;
|
|
495
|
-
case "inline_code":
|
|
496
|
-
pushTextSegments(out, stringProp(node, "code"), mergeStyle$1(inheritedStyle, theme.inlineCode));
|
|
497
|
-
break;
|
|
498
|
-
case "hardbreak":
|
|
499
|
-
out.push(HARD_BREAK_SEGMENT);
|
|
500
|
-
break;
|
|
501
|
-
case "link": {
|
|
502
|
-
const href = stringProp(node, "href");
|
|
503
|
-
const safeHref = href ? sanitizeMarkdownLink(href) : null;
|
|
504
|
-
const linkStyle = safeHref ? mergeStyle$1(inheritedStyle, {
|
|
505
|
-
...theme.link,
|
|
506
|
-
href: safeHref
|
|
507
|
-
}) : inheritedStyle;
|
|
508
|
-
const children = nodeChildren(node);
|
|
509
|
-
if (children.length) out.push(...inlineNodeSegments(children, theme, linkStyle, options));
|
|
510
|
-
else pushTextSegments(out, stringProp(node, "text"), linkStyle);
|
|
511
|
-
break;
|
|
508
|
+
for (let index = 0; index < nodes.length; index++) {
|
|
509
|
+
let node = nodes[index];
|
|
510
|
+
const next = nodes[index + 1];
|
|
511
|
+
const text = node.type === "text" ? stringProp(node, "content") : "";
|
|
512
|
+
if (node.type === "text" && text.endsWith("!") && stringProp(node, "raw").endsWith("!") && next?.type === "link" && isUnixFileUrlNeedingImageFallback(stringProp(next, "href"))) {
|
|
513
|
+
const src = stringProp(next, "href");
|
|
514
|
+
if (sanitizeMarkdownImageSource(src)) {
|
|
515
|
+
pushTextSegments(out, text.slice(0, -1), inheritedStyle);
|
|
516
|
+
node = {
|
|
517
|
+
type: "image",
|
|
518
|
+
src,
|
|
519
|
+
alt: stringProp(next, "text"),
|
|
520
|
+
raw: `!${stringProp(next, "raw")}`
|
|
521
|
+
};
|
|
522
|
+
index++;
|
|
523
|
+
}
|
|
512
524
|
}
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
525
|
+
switch (node.type) {
|
|
526
|
+
case "text":
|
|
527
|
+
pushTextSegments(out, stringProp(node, "content"), inheritedStyle);
|
|
528
|
+
break;
|
|
529
|
+
case "inline":
|
|
530
|
+
case "paragraph":
|
|
531
|
+
case "heading":
|
|
532
|
+
case "list_item":
|
|
533
|
+
case "blockquote":
|
|
534
|
+
out.push(...inlineNodeSegments(nodeChildren(node), theme, inheritedStyle, options));
|
|
535
|
+
break;
|
|
536
|
+
case "strong":
|
|
537
|
+
out.push(...inlineNodeSegments(nodeChildren(node), theme, mergeStyle$1(inheritedStyle, theme.strong), options));
|
|
538
|
+
break;
|
|
539
|
+
case "emphasis":
|
|
540
|
+
out.push(...inlineNodeSegments(nodeChildren(node), theme, mergeStyle$1(inheritedStyle, theme.emphasis), options));
|
|
541
|
+
break;
|
|
542
|
+
case "strikethrough":
|
|
543
|
+
out.push(...inlineNodeSegments(nodeChildren(node), theme, mergeStyle$1(inheritedStyle, theme.strikethrough), options));
|
|
544
|
+
break;
|
|
545
|
+
case "highlight":
|
|
546
|
+
case "insert":
|
|
547
|
+
case "subscript":
|
|
548
|
+
case "superscript":
|
|
549
|
+
out.push(...inlineNodeSegments(nodeChildren(node), theme, inheritedStyle, options));
|
|
550
|
+
break;
|
|
551
|
+
case "inline_code":
|
|
552
|
+
pushTextSegments(out, stringProp(node, "code"), mergeStyle$1(inheritedStyle, theme.inlineCode));
|
|
553
|
+
break;
|
|
554
|
+
case "hardbreak":
|
|
555
|
+
out.push(HARD_BREAK_SEGMENT);
|
|
556
|
+
break;
|
|
557
|
+
case "link": {
|
|
558
|
+
const href = stringProp(node, "href");
|
|
559
|
+
const safeHref = href ? sanitizeMarkdownLink(href) : null;
|
|
560
|
+
const linkStyle = safeHref ? mergeStyle$1(inheritedStyle, {
|
|
521
561
|
...theme.link,
|
|
522
|
-
href:
|
|
523
|
-
});
|
|
524
|
-
const
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
const
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
...
|
|
546
|
-
...
|
|
547
|
-
...
|
|
548
|
-
naturalWidth:
|
|
549
|
-
naturalHeight:
|
|
562
|
+
href: safeHref
|
|
563
|
+
}) : inheritedStyle;
|
|
564
|
+
const children = nodeChildren(node);
|
|
565
|
+
if (children.length) out.push(...inlineNodeSegments(children, theme, linkStyle, options));
|
|
566
|
+
else pushTextSegments(out, stringProp(node, "text"), linkStyle);
|
|
567
|
+
break;
|
|
568
|
+
}
|
|
569
|
+
case "image": {
|
|
570
|
+
const raw = stringProp(node, "raw");
|
|
571
|
+
const rawSource = stringProp(node, "src") || imageSourceFromRaw(raw);
|
|
572
|
+
const source = sanitizeMarkdownImageSource(rawSource);
|
|
573
|
+
const alt = stringProp(node, "alt") || imageFallbackText(raw, rawSource, source?.src);
|
|
574
|
+
if (source) {
|
|
575
|
+
const size = options.imageSize;
|
|
576
|
+
const imageLinkStyle = mergeStyle$1(inheritedStyle, {
|
|
577
|
+
...theme.link,
|
|
578
|
+
href: source.src
|
|
579
|
+
});
|
|
580
|
+
const sourceDimensions = readMarkdownImageDimensions(source.base64);
|
|
581
|
+
const graphicBase = {
|
|
582
|
+
kind: "image",
|
|
583
|
+
src: source.src,
|
|
584
|
+
alt,
|
|
585
|
+
...source.mime ? { mime: source.mime } : {},
|
|
586
|
+
...source.base64 ? { base64: source.base64 } : {},
|
|
587
|
+
...sourceDimensions ? {
|
|
588
|
+
naturalWidth: sourceDimensions.width,
|
|
589
|
+
naturalHeight: sourceDimensions.height
|
|
550
590
|
} : {},
|
|
551
|
-
...resolveImageDisplaySize(alt, size,
|
|
591
|
+
...resolveImageDisplaySize(alt, size, sourceDimensions?.width, sourceDimensions?.height)
|
|
552
592
|
};
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
raw,
|
|
573
|
-
rendered: rendered.supported
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
break;
|
|
577
|
-
case "reference":
|
|
578
|
-
case "footnote_reference":
|
|
579
|
-
case "footnote_anchor":
|
|
580
|
-
pushTextSegments(out, stringProp(node, "raw"), inheritedStyle);
|
|
581
|
-
break;
|
|
582
|
-
case "html_inline":
|
|
583
|
-
pushTextSegments(out, stringProp(node, "content"), mergeStyle$1(inheritedStyle, theme.html));
|
|
584
|
-
break;
|
|
585
|
-
case "html_block":
|
|
586
|
-
pushTextSegments(out, stringProp(node, "content"), mergeStyle$1(inheritedStyle, theme.html));
|
|
587
|
-
break;
|
|
588
|
-
default:
|
|
589
|
-
if (nodeChildren(node).length) {
|
|
590
|
-
out.push(...inlineNodeSegments(nodeChildren(node), theme, inheritedStyle, options));
|
|
593
|
+
const resolved = normalizeImageResolverResult(options.imageResolver?.(graphicBase));
|
|
594
|
+
const base64 = resolved.base64 || source.base64;
|
|
595
|
+
if (base64) {
|
|
596
|
+
const dimensions = readMarkdownImageDimensions(base64) ?? sourceDimensions;
|
|
597
|
+
const graphic = {
|
|
598
|
+
...graphicBase,
|
|
599
|
+
base64,
|
|
600
|
+
...resolved.originalBase64 ? { originalBase64: resolved.originalBase64 } : {},
|
|
601
|
+
...resolved.mime ? { mime: resolved.mime } : {},
|
|
602
|
+
...resolved.originalMime ? { originalMime: resolved.originalMime } : {},
|
|
603
|
+
...dimensions ? {
|
|
604
|
+
naturalWidth: dimensions.width,
|
|
605
|
+
naturalHeight: dimensions.height
|
|
606
|
+
} : {},
|
|
607
|
+
...resolveImageDisplaySize(alt, size, dimensions?.width, dimensions?.height)
|
|
608
|
+
};
|
|
609
|
+
pushTextSegments(out, alt, imageLinkStyle, graphic);
|
|
610
|
+
} else pushTextSegments(out, alt, imageLinkStyle);
|
|
611
|
+
} else pushTextSegments(out, alt, mergeStyle$1(inheritedStyle, theme.link));
|
|
591
612
|
break;
|
|
592
613
|
}
|
|
593
|
-
|
|
594
|
-
|
|
614
|
+
case "checkbox":
|
|
615
|
+
case "checkbox_input":
|
|
616
|
+
pushTextSegments(out, booleanProp(node, "checked") ? "[x]" : "[ ]", inheritedStyle);
|
|
617
|
+
break;
|
|
618
|
+
case "emoji":
|
|
619
|
+
pushTextSegments(out, stringProp(node, "markup") || stringProp(node, "name"), inheritedStyle);
|
|
620
|
+
break;
|
|
621
|
+
case "math_inline":
|
|
622
|
+
{
|
|
623
|
+
const source = stringProp(node, "content");
|
|
624
|
+
const raw = stringProp(node, "raw") || `$${source}$`;
|
|
625
|
+
const rendered = renderMarkdownInlineMathSegment(source);
|
|
626
|
+
pushTextSegments(out, rendered.supported ? rendered.text : raw, mergeStyle$1(inheritedStyle, theme.inlineCode), void 0, {
|
|
627
|
+
source,
|
|
628
|
+
raw,
|
|
629
|
+
rendered: rendered.supported
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
break;
|
|
633
|
+
case "reference":
|
|
634
|
+
case "footnote_reference":
|
|
635
|
+
case "footnote_anchor":
|
|
636
|
+
pushTextSegments(out, stringProp(node, "raw"), inheritedStyle);
|
|
637
|
+
break;
|
|
638
|
+
case "html_inline":
|
|
639
|
+
pushTextSegments(out, stringProp(node, "content"), mergeStyle$1(inheritedStyle, theme.html));
|
|
640
|
+
break;
|
|
641
|
+
case "html_block":
|
|
642
|
+
pushTextSegments(out, stringProp(node, "content"), mergeStyle$1(inheritedStyle, theme.html));
|
|
643
|
+
break;
|
|
644
|
+
default:
|
|
645
|
+
if (nodeChildren(node).length) {
|
|
646
|
+
out.push(...inlineNodeSegments(nodeChildren(node), theme, inheritedStyle, options));
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
pushTextSegments(out, stringProp(node, "raw"), inheritedStyle);
|
|
650
|
+
break;
|
|
651
|
+
}
|
|
595
652
|
}
|
|
596
653
|
return out;
|
|
597
654
|
}
|
|
@@ -2082,6 +2139,9 @@ const TVirtualMarkdown = defineComponent({
|
|
|
2082
2139
|
const unsubscribeGraphicsOutput = subscribeTerminalGraphicsOutput(terminal, () => {
|
|
2083
2140
|
graphicsOutputVersion.value = getTerminalGraphicsOutputVersion(terminal);
|
|
2084
2141
|
});
|
|
2142
|
+
const unsubscribeMathRenderer = subscribeMarkdownMathRenderer(() => {
|
|
2143
|
+
scheduleRebuild();
|
|
2144
|
+
});
|
|
2085
2145
|
watch(() => `${props.streaming ? 1 : 0}:${(props.customHtmlTags ?? []).join("\0")}`, () => {
|
|
2086
2146
|
parser.value = markRaw(createTuiMarkdownParser({
|
|
2087
2147
|
streaming: props.streaming,
|
|
@@ -2449,6 +2509,7 @@ const TVirtualMarkdown = defineComponent({
|
|
|
2449
2509
|
alive = false;
|
|
2450
2510
|
rebuildVersion++;
|
|
2451
2511
|
unsubscribeGraphicsOutput();
|
|
2512
|
+
unsubscribeMathRenderer();
|
|
2452
2513
|
clearMarkdownImageGraphics(terminal, fullRect.value);
|
|
2453
2514
|
});
|
|
2454
2515
|
useRenderNode(() => ({
|
|
@@ -2633,4 +2694,4 @@ function createMarkdownBlockSource(options) {
|
|
|
2633
2694
|
}
|
|
2634
2695
|
|
|
2635
2696
|
//#endregion
|
|
2636
|
-
export { TVirtualMarkdown, buildMarkdownBlocks, buildMarkdownVisualRows, clearMarkdownImageGraphics, collectVisibleMarkdownImageGraphicIds, createMarkdownBlockSource, createTuiMarkdownParser, findMarkdownImageActionAt, findMarkdownLinkActionAt, findMarkdownMathActionAt, isSafeMarkdownLink, layoutMarkdownBlocks, markdownThemeSignature, paintMarkdownVisualRow };
|
|
2697
|
+
export { TVirtualMarkdown, buildMarkdownBlocks, buildMarkdownVisualRows, clearMarkdownImageGraphics, collectVisibleMarkdownImageGraphicIds, createMarkdownBlockSource, createTuiMarkdownParser, findMarkdownImageActionAt, findMarkdownLinkActionAt, findMarkdownMathActionAt, isSafeMarkdownLink, layoutMarkdownBlocks, loadMarkdownMathRenderer, markdownThemeSignature, paintMarkdownVisualRow, subscribeMarkdownMathRenderer };
|
package/dist/experimental.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { sanitizeTerminalHref } from "./hyperlink-_1FAj7Wq.js";
|
|
2
2
|
import "./width-GqllnV8C.js";
|
|
3
3
|
import { EventZIndexContextKey, TerminalGraphicsActivityKey, forEachTextCellSegment, intersectRect, sanitizeInlineText, sliceByCells, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useTerminal, useTerminalNode, useVisibility } from "./rect-DUpeDfBg.js";
|
|
4
|
-
import { TText, TView, createFrameMailbox, mergeStyle } from "./linkify-
|
|
4
|
+
import { TText, TView, createFrameMailbox, mergeStyle } from "./linkify-BjI4zVfY.js";
|
|
5
5
|
import "./frame-perf-CHpWhbC4.js";
|
|
6
6
|
import "./terminal-selection-4W1SJj4c.js";
|
|
7
7
|
import "./wheel-scroll-DASkEZr-.js";
|
|
8
8
|
import { createIterm2InlineImageSequence, createKittyDeleteGraphicsSequence, createKittyGraphicsSequence, createKittyPlacementSequence, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, subscribeTerminalGraphicsOutput } from "./terminal-graphics-Bbe83wSr.js";
|
|
9
|
-
import { TAgentTerminalGraphic, TLogLinksPanel, TLogMinimap, TLogScrollbar, TLogSearchBar, TLogSearchPager, TLogSearchResults, TLogView, TLogVirtualLinksPanel, TLogVirtualSearchResults, TTranscriptView, TVirtualList, createAppendOnlyLogStore, createTLogDensityBucketsFromMarkers, createTLogLevelPlugin, createTLogLineMatcherPlugin, createTLogLinkActionPlugin, createTLogOsc8LinkPlugin, createTLogUrlPlugin, detectTLogUrls, dispatchTLogPluginLinkAction, getTLogPluginMetadata, handleTLogKeymapEvent, matchesTLogKeyBinding, parseTLogAnnotatedText, resolveTLogLinksPanelTheme, resolveTLogMinimapTheme, resolveTLogScrollbarTheme, resolveTLogSearchBarTheme, resolveTLogSearchPagerTheme, resolveTLogSearchResultsTheme, resolveTLogViewTheme, stripTLogAnsiText, tlogDarkPreset, tlogDarkTheme, tlogDefaultKeymap, tlogDefaultPreset, tlogDefaultTheme, tlogHighContrastKeymap, tlogHighContrastPreset, tlogHighContrastTheme, toTLogExternalLinkFromVisibleLink, useTLogLinkController, useTLogRetainedIndex, useTLogSearchController, useTLogSearchResultsPage, useTLogVirtualSearchResults } from "./tlog-theme-
|
|
9
|
+
import { TAgentTerminalGraphic, TLogLinksPanel, TLogMinimap, TLogScrollbar, TLogSearchBar, TLogSearchPager, TLogSearchResults, TLogView, TLogVirtualLinksPanel, TLogVirtualSearchResults, TTranscriptView, TVirtualList, createAppendOnlyLogStore, createTLogDensityBucketsFromMarkers, createTLogLevelPlugin, createTLogLineMatcherPlugin, createTLogLinkActionPlugin, createTLogOsc8LinkPlugin, createTLogUrlPlugin, detectTLogUrls, dispatchTLogPluginLinkAction, getTLogPluginMetadata, handleTLogKeymapEvent, matchesTLogKeyBinding, parseTLogAnnotatedText, resolveTLogLinksPanelTheme, resolveTLogMinimapTheme, resolveTLogScrollbarTheme, resolveTLogSearchBarTheme, resolveTLogSearchPagerTheme, resolveTLogSearchResultsTheme, resolveTLogViewTheme, stripTLogAnsiText, tlogDarkPreset, tlogDarkTheme, tlogDefaultKeymap, tlogDefaultPreset, tlogDefaultTheme, tlogHighContrastKeymap, tlogHighContrastPreset, tlogHighContrastTheme, toTLogExternalLinkFromVisibleLink, useTLogLinkController, useTLogRetainedIndex, useTLogSearchController, useTLogSearchResultsPage, useTLogVirtualSearchResults } from "./tlog-theme-i6S_Oftd.js";
|
|
10
10
|
import { computed, defineComponent, getCurrentInstance, h, inject, markRaw, onBeforeUnmount, onUnmounted, ref, shallowRef, watch } from "vue";
|
|
11
11
|
|
|
12
12
|
//#region src/vue/components/TVideo.ts
|
package/dist/index.js
CHANGED
|
@@ -3,15 +3,15 @@ import "./width-GqllnV8C.js";
|
|
|
3
3
|
import "./ansi-palette-CH6jc2Z7.js";
|
|
4
4
|
import { createDomRenderer } from "./dom-renderer-DXx8fWzD.js";
|
|
5
5
|
import "./rect-DUpeDfBg.js";
|
|
6
|
-
import { TText, TView, createTheme, linkifyTextSegments, tuiDefaultTheme } from "./linkify-
|
|
6
|
+
import { TText, TView, createTheme, linkifyTextSegments, tuiDefaultTheme } from "./linkify-BjI4zVfY.js";
|
|
7
7
|
import "./runtime-Byf8XXOT.js";
|
|
8
8
|
import "./frame-perf-CHpWhbC4.js";
|
|
9
9
|
import "./trace-Bh8WnoMo.js";
|
|
10
10
|
import "./env-Cl8qmNFN.js";
|
|
11
|
-
import { TAutocompleteInput, TBadge, TCheckbox, TCode, TDataTable, TDivider, TFormField, TLink, TLinkifyText, TList, TPasswordInput, TRadioGroup, TSlider, TSwitch, TTable, TTag, TTree, TerminalProvider, createTInputHostPlugin } from "./TTree-
|
|
11
|
+
import { TAutocompleteInput, TBadge, TCheckbox, TCode, TDataTable, TDivider, TFormField, TLink, TLinkifyText, TList, TPasswordInput, TRadioGroup, TSlider, TSwitch, TTable, TTag, TTree, TerminalProvider, createTInputHostPlugin } from "./TTree-DdAjCPHu.js";
|
|
12
12
|
import "./terminal-selection-4W1SJj4c.js";
|
|
13
13
|
import "./debug-logger-CmsGI4of.js";
|
|
14
|
-
import { TBox, TCommandPalette, TDialog, TInput, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-
|
|
14
|
+
import { TBox, TCommandPalette, TDialog, TInput, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-Dx34M1pF.js";
|
|
15
15
|
import "./path-mnSgEpCm.js";
|
|
16
16
|
import "./wheel-scroll-DASkEZr-.js";
|
|
17
17
|
|
|
@@ -749,4 +749,4 @@ function linkifyTextSegments(text, options = {}) {
|
|
|
749
749
|
}
|
|
750
750
|
|
|
751
751
|
//#endregion
|
|
752
|
-
export { TText, TView, TuiThemeContextKey, clamp, createFrameMailbox, createTheme, defaultActiveStyle, defaultDimStyle, fitCellText, linkifyTextSegments, mergeStyle, repeatToCells, tuiDefaultTheme };
|
|
752
|
+
export { TText, TView, TuiThemeContextKey, clamp as clamp$1, createFrameMailbox, createTheme, defaultActiveStyle, defaultDimStyle, fitCellText, linkifyTextSegments, mergeStyle, repeatToCells, tuiDefaultTheme };
|