@simon_he/vue-tui 1.1.14 → 1.1.16

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.
@@ -1,7 +1,7 @@
1
1
  import { charCellWidth, getPlaneTerminal } from "./create-terminal-Db_-UGVQ.js";
2
2
  import { hasEncodedControl } from "./hyperlink-clbb_ha_.js";
3
3
  import { DialogContextKey, EventZIndexContextKey, ImeAnchorContextKey, LayoutContextKey, RenderPlaneContextKey, RenderStackKey, TInputPluginsContextKey, TerminalContextKey, forEachTextCellSegment, graphemeRangeAt, hasTextWidthAsciiFastPath, intersectRect, repeatChar, sanitizeInlineText, sanitizeTextBlock, sliceByCells, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useRenderStack, useTerminal, useTerminalNode, useVisibility, withTextWidthProvider } from "./rect-Dfevd15m.js";
4
- import { mergeStyle } from "./linkify-DF96jKWy.js";
4
+ import { mergeStyle } from "./linkify-BDKc1DWZ.js";
5
5
  import { TText, TView } from "./frame-mailbox-6XHw-P8Q.js";
6
6
  import { isAbsolutePath, normalizeNewlines, normalizePath, resolvePath } from "./path-BI9W15Zt.js";
7
7
  import { computed, defineComponent, h, inject, nextTick, onBeforeUnmount, onMounted, provide, ref, shallowReactive, shallowRef, watch, watchEffect } from "vue";
@@ -6021,4 +6021,4 @@ const TSelect = defineComponent({
6021
6021
  });
6022
6022
 
6023
6023
  //#endregion
6024
- export { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, clamp$1, computeCommandPaletteMatchRanges, createOverlayFocusStack, isCommitMention, isWhitespace, mentionChipStyle, padEndByCells, resolveOverlayPlacement, sliceByCellsWindow, textCellWidth$1 as textCellWidth };
6024
+ export { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, clamp$1 as clamp, computeCommandPaletteMatchRanges, createOverlayFocusStack, isCommitMention, isWhitespace, mentionChipStyle, padEndByCells, resolveOverlayPlacement, sliceByCellsWindow, textCellWidth$1 as textCellWidth };
@@ -2,14 +2,14 @@ import { TERMINAL_RENDER_PLANES, createTerminal, getPlaneTerminal, resetPlaneRow
2
2
  import { sanitizeDomHref } from "./hyperlink-clbb_ha_.js";
3
3
  import { DOM_RENDERER_CAPABILITIES, createDomRenderer } from "./dom-renderer-BfwAEQMf.js";
4
4
  import { EventZIndexContextKey, ImeAnchorContextKey, LayoutContextKey, RenderStackKey, TInputPluginsContextKey, TPathPickerProviderContextKey, TerminalContextKey, VisibilityContextKey, clearTextCaches, forEachTextCellSegment, formatInlineCellLine, injectionKey, intersectRect, normalizeCellRect, padEndByCells$1 as padEndByCells, sanitizeInlineText, sanitizeTextBlock, sliceByCells, sliceByCellsRange, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useTerminal, useTerminalNode, useVisibility, withTextRenderPass } from "./rect-Dfevd15m.js";
5
- import { TuiThemeContextKey, clamp, createTheme, defaultActiveStyle, defaultDimStyle, fitCellText, linkifyTextSegments, mergeStyle, repeatToCells, tuiDefaultTheme } from "./linkify-DF96jKWy.js";
5
+ import { TuiThemeContextKey, clamp$1 as clamp, createTheme, defaultActiveStyle, defaultDimStyle, fitCellText, linkifyTextSegments, mergeStyle, repeatToCells, tuiDefaultTheme } from "./linkify-BDKc1DWZ.js";
6
6
  import { SUPPRESS_TERMINAL_POINTER_DOWN, SUPPRESS_TERMINAL_POINTER_MOVE, SUPPRESS_TERMINAL_POINTER_UP, createEventManager, createRuntime } from "./runtime-Byf8XXOT.js";
7
7
  import { framePerfNow, mergeFramePerfReason } from "./frame-perf-CHpWhbC4.js";
8
8
  import { createFramePerfStore, createTraceStore } from "./trace-Bh8WnoMo.js";
9
9
  import { envFlag, envString, firstNonEmptyEnv } from "./env-Cl8qmNFN.js";
10
10
  import { createTerminalSelectionController } from "./terminal-selection-4W1SJj4c.js";
11
11
  import { createDebugLogger, isDebugEnabled } from "./debug-logger-CmsGI4of.js";
12
- import { TBox, TInput, TRenderPlane, resolveOverlayPlacement } from "./TSelect-CnBJET_C.js";
12
+ import { TBox, TInput, TRenderPlane, resolveOverlayPlacement } from "./TSelect-BQkGJMKf.js";
13
13
  import { TText, TView, createFrameMailbox } from "./frame-mailbox-6XHw-P8Q.js";
14
14
  import { applyWheelScroll, createWheelScrollState, resetWheelScrollState } from "./wheel-scroll-CQ22Hcyj.js";
15
15
  import { computed, defineComponent, effectScope, getCurrentInstance, h, inject, nextTick, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, ref, shallowReactive, shallowRef, toRef, watch, watchEffect } from "vue";
package/dist/agent.cjs CHANGED
@@ -9826,7 +9826,7 @@ var EMPTY_LAYOUT = Object.freeze({
9826
9826
  regions: Object.freeze([]),
9827
9827
  fixedRows: !1,
9828
9828
  rowCount: 0
9829
- }), MAX_KEYED_ROW_LAYOUT_CACHE_ENTRIES = 2048;
9829
+ }), MAX_KEYED_ROW_LAYOUT_CACHE_ENTRIES = 2048, RETAINED_ROW_LAYOUT_MARGIN_ROWS = 512;
9830
9830
  function clamp9(n, min, max) {
9831
9831
  return Math.max(min, Math.min(max, n));
9832
9832
  }
@@ -9930,7 +9930,7 @@ var TTranscriptView = (0, import_vue23.defineComponent)({
9930
9930
  "hoverRegion"
9931
9931
  ],
9932
9932
  setup(props, { emit, expose }) {
9933
- let { defaultStyle, observability } = useTerminal(), instance = (0, import_vue23.getCurrentInstance)(), rowsRef = (0, import_vue23.ref)(null), innerScrollTop = (0, import_vue23.ref)(normalizeInt2(props.defaultScrollTop)), hoveredRegion = (0, import_vue23.ref)(null), focusedRegion = (0, import_vue23.ref)(null), rowLayoutCache = /* @__PURE__ */ new Map(), keyedRowLayoutCache = /* @__PURE__ */ new Map(), previousWrappedLayout = null, previousWrappedDeps = null, canUseWrappedChangedRangeRepaint = !1, warnedLargeFlattenedRows = !1;
9933
+ let { defaultStyle, observability } = useTerminal(), instance = (0, import_vue23.getCurrentInstance)(), rowsRef = (0, import_vue23.ref)(null), innerScrollTop = (0, import_vue23.ref)(normalizeInt2(props.defaultScrollTop)), hoveredRegion = (0, import_vue23.ref)(null), focusedRegion = (0, import_vue23.ref)(null), rowLayoutCache = /* @__PURE__ */ new Map(), keyedRowLayoutCache = /* @__PURE__ */ new Map(), retainedWindow = null, previousWrappedLayout = null, previousWrappedDeps = null, canUseWrappedChangedRangeRepaint = !1, warnedLargeFlattenedRows = !1;
9934
9934
  function isScrollControlled() {
9935
9935
  return Object.prototype.hasOwnProperty.call(instance?.vnode.props ?? {}, "scrollTop");
9936
9936
  }
@@ -9986,6 +9986,18 @@ var TTranscriptView = (0, import_vue23.defineComponent)({
9986
9986
  for (let rowIndex of rowLayoutCache.keys())
9987
9987
  rowIndex >= count && rowLayoutCache.delete(rowIndex);
9988
9988
  }
9989
+ function pruneRowLayoutCacheOutsideWindow(count, top, bottom) {
9990
+ let start = Math.max(0, top - RETAINED_ROW_LAYOUT_MARGIN_ROWS), end = Math.min(count, bottom + RETAINED_ROW_LAYOUT_MARGIN_ROWS);
9991
+ if (!(retainedWindow && retainedWindow.start === start && retainedWindow.end === end)) {
9992
+ retainedWindow = { start, end };
9993
+ for (let [rowIndex, entry] of rowLayoutCache) {
9994
+ if (rowIndex >= start && rowIndex < end)
9995
+ continue;
9996
+ let identity = rowLayoutIdentityKey(entry.rowKey, entry.rowVersion);
9997
+ keyedRowLayoutCache.get(identity) === entry && keyedRowLayoutCache.delete(identity), rowLayoutCache.delete(rowIndex);
9998
+ }
9999
+ }
10000
+ }
9989
10001
  function sameWrappedDeps(a, b) {
9990
10002
  return !!a && a.width === b.width && a.baseStyle === b.baseStyle && a.hoverStyle === b.hoverStyle && a.focusStyle === b.focusStyle && a.hoverRegionId === b.hoverRegionId && a.focusedRegionId === b.focusedRegionId;
9991
10003
  }
@@ -10042,7 +10054,7 @@ var TTranscriptView = (0, import_vue23.defineComponent)({
10042
10054
  props.version, canUseWrappedChangedRangeRepaint = !1;
10043
10055
  let perfEnabled = observability.framePerf.enabled.value, perfStartedAt = perfEnabled ? framePerfNow() : 0, width = Math.max(1, Math.floor(props.w)), count = Math.max(0, normalizeInt2(props.source.rowCount()));
10044
10056
  if (!count)
10045
- return rowLayoutCache.clear(), keyedRowLayoutCache.clear(), previousWrappedLayout = null, previousWrappedDeps = null, perfEnabled && observability.framePerf.recordComponent({
10057
+ return rowLayoutCache.clear(), keyedRowLayoutCache.clear(), retainedWindow = null, previousWrappedLayout = null, previousWrappedDeps = null, perfEnabled && observability.framePerf.recordComponent({
10046
10058
  name: "TTranscriptView",
10047
10059
  id: instance?.uid == null ? void 0 : String(instance.uid),
10048
10060
  phase: "layout",
@@ -10079,6 +10091,7 @@ var TTranscriptView = (0, import_vue23.defineComponent)({
10079
10091
  let row = result.rows[0];
10080
10092
  visualRows[rowIndex] = row, regions.push(...row.hitRegions);
10081
10093
  }
10094
+ pruneRowLayoutCacheOutsideWindow(count, top, bottom);
10082
10095
  } else {
10083
10096
  let incremental = tryUpdateWrappedLayoutFromChangedRange(
10084
10097
  count,
package/dist/agent.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import "./create-terminal-Db_-UGVQ.js";
2
2
  import "./hyperlink-clbb_ha_.js";
3
3
  import { forEachTextCellSegment, recordTerminalGraphicTrace, sanitizeInlineText, sanitizeTextBlock, sliceByCells, spaces, textCellWidth$1 as textCellWidth, useTerminal, withTextWidthProvider } from "./rect-Dfevd15m.js";
4
- import "./linkify-DF96jKWy.js";
4
+ import "./linkify-BDKc1DWZ.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-CnBJET_C.js";
9
+ import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-BQkGJMKf.js";
10
10
  import { TText, TView } from "./frame-mailbox-6XHw-P8Q.js";
11
11
  import "./path-BI9W15Zt.js";
12
12
  import "./wheel-scroll-CQ22Hcyj.js";
@@ -14,7 +14,7 @@ import { TMermaid$1 as TMermaid, TMermaidText$1 as TMermaidText, isSimpleMermaid
14
14
  import { createIterm2InlineImageSequence, createKittyDeleteGraphicsSequence, createKittyGraphicsSequence, createKittyPlacementSequence, createTerminalGraphicPngSequence, detectTerminalGraphicsCapabilities, getTerminalGraphicsOutput, getTerminalGraphicsOutputVersion, hashTerminalGraphicsString, isSafeTerminalGraphicsSequence, normalizeTerminalGraphicSize, sanitizeTerminalFallbackText, subscribeTerminalGraphicsOutput } from "./terminal-graphics-DpSL29OQ.js";
15
15
  import { TVirtualMarkdown, createMarkdownBlockSource } from "./block-source-BGTRldY7.js";
16
16
  import "./math-image-CcUpBnW0.js";
17
- import { 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-DKq1YOQF.js";
17
+ import { 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-BgB9yXVS.js";
18
18
  import { TAgentTerminalGraphic } from "./TAgentTerminalGraphic-BKDAoGoE.js";
19
19
  import { computed, defineComponent, h } from "vue";
20
20
 
@@ -6540,7 +6540,7 @@ var EMPTY_LAYOUT = Object.freeze({
6540
6540
  regions: Object.freeze([]),
6541
6541
  fixedRows: !1,
6542
6542
  rowCount: 0
6543
- }), MAX_KEYED_ROW_LAYOUT_CACHE_ENTRIES = 2048;
6543
+ }), MAX_KEYED_ROW_LAYOUT_CACHE_ENTRIES = 2048, RETAINED_ROW_LAYOUT_MARGIN_ROWS = 512;
6544
6544
  function clamp4(n, min, max) {
6545
6545
  return Math.max(min, Math.min(max, n));
6546
6546
  }
@@ -6644,7 +6644,7 @@ var TTranscriptView = (0, import_vue17.defineComponent)({
6644
6644
  "hoverRegion"
6645
6645
  ],
6646
6646
  setup(props, { emit, expose }) {
6647
- let { defaultStyle, observability } = useTerminal(), instance = (0, import_vue17.getCurrentInstance)(), rowsRef = (0, import_vue17.ref)(null), innerScrollTop = (0, import_vue17.ref)(normalizeInt2(props.defaultScrollTop)), hoveredRegion = (0, import_vue17.ref)(null), focusedRegion = (0, import_vue17.ref)(null), rowLayoutCache = /* @__PURE__ */ new Map(), keyedRowLayoutCache = /* @__PURE__ */ new Map(), previousWrappedLayout = null, previousWrappedDeps = null, canUseWrappedChangedRangeRepaint = !1, warnedLargeFlattenedRows = !1;
6647
+ let { defaultStyle, observability } = useTerminal(), instance = (0, import_vue17.getCurrentInstance)(), rowsRef = (0, import_vue17.ref)(null), innerScrollTop = (0, import_vue17.ref)(normalizeInt2(props.defaultScrollTop)), hoveredRegion = (0, import_vue17.ref)(null), focusedRegion = (0, import_vue17.ref)(null), rowLayoutCache = /* @__PURE__ */ new Map(), keyedRowLayoutCache = /* @__PURE__ */ new Map(), retainedWindow = null, previousWrappedLayout = null, previousWrappedDeps = null, canUseWrappedChangedRangeRepaint = !1, warnedLargeFlattenedRows = !1;
6648
6648
  function isScrollControlled() {
6649
6649
  return Object.prototype.hasOwnProperty.call(instance?.vnode.props ?? {}, "scrollTop");
6650
6650
  }
@@ -6700,6 +6700,18 @@ var TTranscriptView = (0, import_vue17.defineComponent)({
6700
6700
  for (let rowIndex of rowLayoutCache.keys())
6701
6701
  rowIndex >= count && rowLayoutCache.delete(rowIndex);
6702
6702
  }
6703
+ function pruneRowLayoutCacheOutsideWindow(count, top, bottom) {
6704
+ let start = Math.max(0, top - RETAINED_ROW_LAYOUT_MARGIN_ROWS), end = Math.min(count, bottom + RETAINED_ROW_LAYOUT_MARGIN_ROWS);
6705
+ if (!(retainedWindow && retainedWindow.start === start && retainedWindow.end === end)) {
6706
+ retainedWindow = { start, end };
6707
+ for (let [rowIndex, entry] of rowLayoutCache) {
6708
+ if (rowIndex >= start && rowIndex < end)
6709
+ continue;
6710
+ let identity = rowLayoutIdentityKey(entry.rowKey, entry.rowVersion);
6711
+ keyedRowLayoutCache.get(identity) === entry && keyedRowLayoutCache.delete(identity), rowLayoutCache.delete(rowIndex);
6712
+ }
6713
+ }
6714
+ }
6703
6715
  function sameWrappedDeps(a, b) {
6704
6716
  return !!a && a.width === b.width && a.baseStyle === b.baseStyle && a.hoverStyle === b.hoverStyle && a.focusStyle === b.focusStyle && a.hoverRegionId === b.hoverRegionId && a.focusedRegionId === b.focusedRegionId;
6705
6717
  }
@@ -6756,7 +6768,7 @@ var TTranscriptView = (0, import_vue17.defineComponent)({
6756
6768
  props.version, canUseWrappedChangedRangeRepaint = !1;
6757
6769
  let perfEnabled = observability.framePerf.enabled.value, perfStartedAt = perfEnabled ? framePerfNow() : 0, width = Math.max(1, Math.floor(props.w)), count = Math.max(0, normalizeInt2(props.source.rowCount()));
6758
6770
  if (!count)
6759
- return rowLayoutCache.clear(), keyedRowLayoutCache.clear(), previousWrappedLayout = null, previousWrappedDeps = null, perfEnabled && observability.framePerf.recordComponent({
6771
+ return rowLayoutCache.clear(), keyedRowLayoutCache.clear(), retainedWindow = null, previousWrappedLayout = null, previousWrappedDeps = null, perfEnabled && observability.framePerf.recordComponent({
6760
6772
  name: "TTranscriptView",
6761
6773
  id: instance?.uid == null ? void 0 : String(instance.uid),
6762
6774
  phase: "layout",
@@ -6793,6 +6805,7 @@ var TTranscriptView = (0, import_vue17.defineComponent)({
6793
6805
  let row = result.rows[0];
6794
6806
  visualRows[rowIndex] = row, regions.push(...row.hitRegions);
6795
6807
  }
6808
+ pruneRowLayoutCacheOutsideWindow(count, top, bottom);
6796
6809
  } else {
6797
6810
  let incremental = tryUpdateWrappedLayoutFromChangedRange(
6798
6811
  count,
@@ -1,13 +1,13 @@
1
1
  import "./create-terminal-Db_-UGVQ.js";
2
2
  import { sanitizeTerminalHref } from "./hyperlink-clbb_ha_.js";
3
3
  import { EventZIndexContextKey, forEachTextCellSegment, intersectRect, sanitizeInlineText, sliceByCells, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useTerminal, useTerminalNode, useVisibility } from "./rect-Dfevd15m.js";
4
- import { mergeStyle } from "./linkify-DF96jKWy.js";
4
+ import { mergeStyle } from "./linkify-BDKc1DWZ.js";
5
5
  import "./frame-perf-CHpWhbC4.js";
6
6
  import "./terminal-selection-4W1SJj4c.js";
7
7
  import { TView } from "./frame-mailbox-6XHw-P8Q.js";
8
8
  import "./wheel-scroll-CQ22Hcyj.js";
9
9
  import "./terminal-graphics-DpSL29OQ.js";
10
- import { 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-DKq1YOQF.js";
10
+ import { 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-BgB9yXVS.js";
11
11
  import "./TAgentTerminalGraphic-BKDAoGoE.js";
12
12
  import { TVideo } from "./TVideo-C3gnTlFD.js";
13
13
  import { computed, defineComponent, h, inject, onBeforeUnmount, onUnmounted, ref, watch } from "vue";
package/dist/index.js CHANGED
@@ -3,15 +3,15 @@ import "./ansi-palette-BHF1rN7R.js";
3
3
  import "./hyperlink-clbb_ha_.js";
4
4
  import { createDomRenderer } from "./dom-renderer-BfwAEQMf.js";
5
5
  import "./rect-Dfevd15m.js";
6
- import { createTheme, linkifyTextSegments, tuiDefaultTheme } from "./linkify-DF96jKWy.js";
6
+ import { createTheme, linkifyTextSegments, tuiDefaultTheme } from "./linkify-BDKc1DWZ.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-DqyzDB0h.js";
11
+ import { TAutocompleteInput, TBadge, TCheckbox, TCode, TDataTable, TDivider, TFormField, TLink, TLinkifyText, TList, TPasswordInput, TRadioGroup, TSlider, TSwitch, TTable, TTag, TTree, TerminalProvider, createTInputHostPlugin } from "./TTree-hjaePulf.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-CnBJET_C.js";
14
+ import { TBox, TCommandPalette, TDialog, TInput, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-BQkGJMKf.js";
15
15
  import { TText, TView } from "./frame-mailbox-6XHw-P8Q.js";
16
16
  import "./path-BI9W15Zt.js";
17
17
  import "./wheel-scroll-CQ22Hcyj.js";
@@ -295,4 +295,4 @@ function linkifyTextSegments(text, options = {}) {
295
295
  }
296
296
 
297
297
  //#endregion
298
- export { TuiThemeContextKey, clamp, createTheme, defaultActiveStyle, defaultDimStyle, fitCellText, linkifyTextSegments, mergeStyle, repeatToCells, tuiDefaultTheme };
298
+ export { TuiThemeContextKey, clamp as clamp$1, createTheme, defaultActiveStyle, defaultDimStyle, fitCellText, linkifyTextSegments, mergeStyle, repeatToCells, tuiDefaultTheme };
@@ -1,7 +1,7 @@
1
1
  import { applyAnsiSgrStyle, parseAnsiSgr } from "./create-terminal-Db_-UGVQ.js";
2
2
  import { sanitizeTerminalHref } from "./hyperlink-clbb_ha_.js";
3
3
  import { EventZIndexContextKey, LayoutContextKey, RenderPlaneContextKey, RenderStackKey, TerminalGraphicsActivityKey, createCombinedTerminalGraphicsActivity, createTerminalGraphicsActivity, forEachTextCellSegment, formatInlineCellLine, intersectRect, normalizeCellRect, padEndByCells$1 as padEndByCells, sanitizeInlineText, sliceByCellsRange, sliceByCellsRangeForSelection, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useRenderStack, useTerminal, useTerminalNode, useVisibility, wrapByCells } from "./rect-Dfevd15m.js";
4
- import { TuiThemeContextKey, defaultActiveStyle, linkifyTextSegments, tuiDefaultTheme } from "./linkify-DF96jKWy.js";
4
+ import { TuiThemeContextKey, defaultActiveStyle, linkifyTextSegments, tuiDefaultTheme } from "./linkify-BDKc1DWZ.js";
5
5
  import { framePerfNow } from "./frame-perf-CHpWhbC4.js";
6
6
  import { terminalSelectionRowSpans, terminalSelectionVisibleRowSpans } from "./terminal-selection-4W1SJj4c.js";
7
7
  import { TView, createFrameMailbox } from "./frame-mailbox-6XHw-P8Q.js";
@@ -1787,6 +1787,20 @@ const EMPTY_LAYOUT = Object.freeze({
1787
1787
  rowCount: 0
1788
1788
  });
1789
1789
  const MAX_KEYED_ROW_LAYOUT_CACHE_ENTRIES = 2048;
1790
+ /**
1791
+ * How far outside the drawn window a fixed-row transcript keeps a row's layout.
1792
+ *
1793
+ * The fixed-row path lays a frame's rows out on demand, so its cache is the one structure that
1794
+ * grows with a transcript nobody re-reads: a reply appended while the view follows the bottom draws
1795
+ * every one of its new rows exactly once, and without a retention margin every one of them stayed
1796
+ * for the life of the component (measured in an agent TUI: ~2 MB of retained layout per turn of
1797
+ * 152 KB of appended code). The margin is what makes releasing them safe to do: scrolling back
1798
+ * within it still finds its layouts, and a row that returns after it is laid out again on demand —
1799
+ * the same work its first draw did — while the retained row space stays bounded at the drawn window
1800
+ * plus this margin on each side. The wrapped path is untouched: it keeps its layouts for the whole
1801
+ * row space in `previousWrappedLayout`, which its incremental repaint reads.
1802
+ */
1803
+ const RETAINED_ROW_LAYOUT_MARGIN_ROWS = 512;
1790
1804
  function clamp$9(n, min, max) {
1791
1805
  return Math.max(min, Math.min(max, n));
1792
1806
  }
@@ -1957,6 +1971,8 @@ const TTranscriptView = defineComponent({
1957
1971
  const focusedRegion = ref(null);
1958
1972
  const rowLayoutCache = new Map();
1959
1973
  const keyedRowLayoutCache = new Map();
1974
+ /** The retained row window the last release ran for (see `pruneRowLayoutCacheOutsideWindow`). */
1975
+ let retainedWindow = null;
1960
1976
  let previousWrappedLayout = null;
1961
1977
  let previousWrappedDeps = null;
1962
1978
  let canUseWrappedChangedRangeRepaint = false;
@@ -2053,6 +2069,34 @@ const TTranscriptView = defineComponent({
2053
2069
  function pruneRowLayoutCache(count) {
2054
2070
  for (const rowIndex of rowLayoutCache.keys()) if (rowIndex >= count) rowLayoutCache.delete(rowIndex);
2055
2071
  }
2072
+ /**
2073
+ * Drops the layouts of rows that scrolled out of the drawn window's retention margin.
2074
+ *
2075
+ * The alternative — letting the cache keep every row it ever laid out — makes a followed
2076
+ * transcript's retention follow its row space, without bound, so the release has to happen here,
2077
+ * where rows are laid out per frame on demand. A released row is laid out again when it is drawn
2078
+ * again, and its identity entry goes with it: that map holds the same entry object, so leaving it
2079
+ * behind would keep the row retained through the keyed cache instead of releasing it.
2080
+ *
2081
+ * The scan runs when the retained window changes, which is exactly when rows can fall out of it
2082
+ * (a jump, a scroll, a grown or shrunk row space); a repaint of the same window finds nothing to
2083
+ * release, so it does not pay for the walk.
2084
+ */
2085
+ function pruneRowLayoutCacheOutsideWindow(count, top, bottom) {
2086
+ const start = Math.max(0, top - RETAINED_ROW_LAYOUT_MARGIN_ROWS);
2087
+ const end = Math.min(count, bottom + RETAINED_ROW_LAYOUT_MARGIN_ROWS);
2088
+ if (retainedWindow && retainedWindow.start === start && retainedWindow.end === end) return;
2089
+ retainedWindow = {
2090
+ start,
2091
+ end
2092
+ };
2093
+ for (const [rowIndex, entry] of rowLayoutCache) {
2094
+ if (rowIndex >= start && rowIndex < end) continue;
2095
+ const identity = rowLayoutIdentityKey(entry.rowKey, entry.rowVersion);
2096
+ if (keyedRowLayoutCache.get(identity) === entry) keyedRowLayoutCache.delete(identity);
2097
+ rowLayoutCache.delete(rowIndex);
2098
+ }
2099
+ }
2056
2100
  function sameWrappedDeps(a, b) {
2057
2101
  return Boolean(a) && a.width === b.width && a.baseStyle === b.baseStyle && a.hoverStyle === b.hoverStyle && a.focusStyle === b.focusStyle && a.hoverRegionId === b.hoverRegionId && a.focusedRegionId === b.focusedRegionId;
2058
2102
  }
@@ -2135,6 +2179,7 @@ const TTranscriptView = defineComponent({
2135
2179
  if (!count) {
2136
2180
  rowLayoutCache.clear();
2137
2181
  keyedRowLayoutCache.clear();
2182
+ retainedWindow = null;
2138
2183
  previousWrappedLayout = null;
2139
2184
  previousWrappedDeps = null;
2140
2185
  if (perfEnabled) observability.framePerf.recordComponent({
@@ -2191,6 +2236,7 @@ const TTranscriptView = defineComponent({
2191
2236
  visualRows[rowIndex] = row;
2192
2237
  regions.push(...row.hitRegions);
2193
2238
  }
2239
+ pruneRowLayoutCacheOutsideWindow(count, top, bottom);
2194
2240
  } else {
2195
2241
  const incremental = tryUpdateWrappedLayoutFromChangedRange(count, sourceChangedRange, wrappedDeps);
2196
2242
  if (incremental) {
@@ -1,8 +1,14 @@
1
+ import type { Style } from "../../../../core/types.js";
1
2
  import type { MentionPathProvider, MentionSuggestionProvider } from "./promptMentionState.js";
2
3
  import type { TInputPlugin } from "./types.js";
3
4
  export type { MentionPathProvider, MentionSuggestionProvider } from "./promptMentionState.js";
4
5
  export type PromptMentionPluginOptions = Readonly<{
5
6
  mentionSuggestionProviders?: readonly MentionSuggestionProvider[];
6
7
  mentionPathProvider?: MentionPathProvider;
8
+ /**
9
+ * Style for the `›` gutter marker drawn on the selected popup row.
10
+ * Called on every paint, so a theme lookup stays live; omit it to keep the popup gutter-free.
11
+ */
12
+ selectedMarkerStyle?: () => Style;
7
13
  }>;
8
14
  export declare function createPromptMentionPlugin(options?: PromptMentionPluginOptions): TInputPlugin;
package/dist/vue.cjs CHANGED
@@ -1798,6 +1798,7 @@ function usePromptMentionState(options) {
1798
1798
  }
1799
1799
 
1800
1800
  // src/vue/components/input/plugins/promptMentionPlugin.ts
1801
+ var SELECTED_ROW_MARKER = "\u203A";
1801
1802
  function omitInverse(style) {
1802
1803
  if (!style)
1803
1804
  return {};
@@ -2081,7 +2082,8 @@ function createPromptMentionPlugin(options = {}) {
2081
2082
  getProps().promptSelectedStyle,
2082
2083
  getProps().zIndex,
2083
2084
  ctx.defaultStyle.value,
2084
- promptMention.mentionKindVersion.value
2085
+ promptMention.mentionKindVersion.value,
2086
+ options.selectedMarkerStyle?.()
2085
2087
  ],
2086
2088
  paint: () => {
2087
2089
  if (!ctx.visible.value || !promptMention.promptVisible.value)
@@ -2111,7 +2113,7 @@ function createPromptMentionPlugin(options = {}) {
2111
2113
  emptyStyle
2112
2114
  }, cacheKey && derivedStyleCache.set(cacheKey, derived);
2113
2115
  }
2114
- let x0 = Math.floor(r.x), y0 = Math.floor(r.y), w = Math.max(0, Math.floor(r.w)), h30 = Math.max(0, Math.floor(r.h)), innerW = Math.max(0, w - 2), sidePad = innerW >= 4 ? 1 : 0, contentW = Math.max(0, innerW - sidePad * 2), contentX = x0 + 1 + sidePad, borderStyle = derived.borderStyle;
2116
+ let x0 = Math.floor(r.x), y0 = Math.floor(r.y), w = Math.max(0, Math.floor(r.w)), h30 = Math.max(0, Math.floor(r.h)), innerW = Math.max(0, w - 2), sidePad = innerW >= 4 ? 1 : 0, markerW = options.selectedMarkerStyle && innerW >= 6 ? 1 : 0, contentW = Math.max(0, innerW - sidePad * 2 - markerW), contentX = x0 + 1 + sidePad + markerW, borderStyle = derived.borderStyle;
2115
2117
  lastTopClampedRect && y0 > 0 && (ctx.terminal.write(spaces(lastTopClampedRect.w), {
2116
2118
  x: lastTopClampedRect.x,
2117
2119
  y: 0,
@@ -2141,7 +2143,7 @@ function createPromptMentionPlugin(options = {}) {
2141
2143
  let match = list[row], isSelected = row === promptMention.promptActiveVisible.value, rawValue = sanitizeInlineText(match.item.value), rawDetail = match.item.detail ? sanitizeInlineText(match.item.detail) : "", highlightRanges = query ? computeHighlightRanges(rawValue, query) : [], valueCells = textCellWidth2(rawValue), detailCells = rawDetail ? textCellWidth2(rawDetail) : 0, availableForDetail = contentW - valueCells - 2;
2142
2144
  if (rawDetail && availableForDetail >= 4) {
2143
2145
  let valueStyle = isSelected ? derived.selectedStyle : derived.itemStyle, highlightStyle = buildPromptMatchHighlightStyle(valueStyle, popupMatchStyle), rowStyle = valueStyle;
2144
- sidePad > 0 && ctx.terminal.write(spaces(sidePad), {
2146
+ sidePad > 0 && ctx.terminal.write(spaces(sidePad + markerW), {
2145
2147
  x: x0 + 1,
2146
2148
  y,
2147
2149
  style: rowStyle
@@ -2173,7 +2175,7 @@ function createPromptMentionPlugin(options = {}) {
2173
2175
  });
2174
2176
  } else {
2175
2177
  let style = isSelected ? derived.selectedStyle : derived.itemStyle, highlightStyle = buildPromptMatchHighlightStyle(style, popupMatchStyle);
2176
- sidePad > 0 && ctx.terminal.write(spaces(sidePad), {
2178
+ sidePad > 0 && ctx.terminal.write(spaces(sidePad + markerW), {
2177
2179
  x: x0 + 1,
2178
2180
  y,
2179
2181
  style
@@ -2198,12 +2200,16 @@ function createPromptMentionPlugin(options = {}) {
2198
2200
  style
2199
2201
  });
2200
2202
  }
2203
+ markerW && isSelected && ctx.terminal.put(x0 + 1, y, SELECTED_ROW_MARKER, {
2204
+ ...derived.selectedStyle,
2205
+ ...options.selectedMarkerStyle?.()
2206
+ });
2201
2207
  }
2202
2208
  if (list.length === 0 && contentH > 0) {
2203
2209
  let y = y0 + 1;
2204
2210
  ctx.terminal.put(x0, y, "\u2502", borderStyle), ctx.terminal.put(x0 + w - 1, y, "\u2502", borderStyle);
2205
2211
  let msg = padEndByCells2(sliceByCellsWindow("(no matches)", 0, contentW), contentW);
2206
- sidePad > 0 && ctx.terminal.write(spaces(sidePad), {
2212
+ sidePad > 0 && ctx.terminal.write(spaces(sidePad + markerW), {
2207
2213
  x: x0 + 1,
2208
2214
  y,
2209
2215
  style: derived.emptyStyle
package/dist/vue.js CHANGED
@@ -3,15 +3,15 @@ import "./ansi-palette-BHF1rN7R.js";
3
3
  import "./hyperlink-clbb_ha_.js";
4
4
  import "./dom-renderer-BfwAEQMf.js";
5
5
  import { EventZIndexContextKey, LayoutContextKey, RenderStackKey, TInputPluginsContextKey, TPathPickerProviderContextKey, VisibilityContextKey, injectionKey, intersectRect, padEndByCells$1 as padEndByCells, repeatChar, sanitizeInlineText, sanitizeTextBlock, sliceByCells, sliceByCellsRange, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useRenderStack, useTerminal, useTerminalNode, useVisibility, wrapByCells } from "./rect-Dfevd15m.js";
6
- import { clamp, createTheme, fitCellText, linkifyTextSegments, mergeStyle, tuiDefaultTheme } from "./linkify-DF96jKWy.js";
6
+ import { clamp$1 as clamp, createTheme, fitCellText, linkifyTextSegments, mergeStyle, tuiDefaultTheme } from "./linkify-BDKc1DWZ.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, TForm, TFormContextKey, TFormField, TLink, TLinkifyText, TList, TPasswordInput, TProgress, TRadioGroup, TSlider, TSpinner, TSwitch, TTable, TTag, TToastViewport, TTree, TerminalProvider, createTInputHostPlugin, useTForm } from "./TTree-DqyzDB0h.js";
11
+ import { TAutocompleteInput, TBadge, TCheckbox, TCode, TDataTable, TDivider, TForm, TFormContextKey, TFormField, TLink, TLinkifyText, TList, TPasswordInput, TProgress, TRadioGroup, TSlider, TSpinner, TSwitch, TTable, TTag, TToastViewport, TTree, TerminalProvider, createTInputHostPlugin, useTForm } from "./TTree-hjaePulf.js";
12
12
  import "./terminal-selection-4W1SJj4c.js";
13
13
  import "./debug-logger-CmsGI4of.js";
14
- import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, clamp$1, computeCommandPaletteMatchRanges, createOverlayFocusStack, isCommitMention, isWhitespace, mentionChipStyle, padEndByCells as padEndByCells$1, resolveOverlayPlacement, sliceByCellsWindow, textCellWidth as textCellWidth$1 } from "./TSelect-CnBJET_C.js";
14
+ import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, clamp as clamp$1, computeCommandPaletteMatchRanges, createOverlayFocusStack, isCommitMention, isWhitespace, mentionChipStyle, padEndByCells as padEndByCells$1, resolveOverlayPlacement, sliceByCellsWindow, textCellWidth as textCellWidth$1 } from "./TSelect-BQkGJMKf.js";
15
15
  import { TText, TView } from "./frame-mailbox-6XHw-P8Q.js";
16
16
  import { normalizePath, stripTrailingSlash } from "./path-BI9W15Zt.js";
17
17
  import { applyWheelScroll, createWheelScrollState } from "./wheel-scroll-CQ22Hcyj.js";
@@ -419,6 +419,7 @@ function usePromptMentionState(options) {
419
419
 
420
420
  //#endregion
421
421
  //#region src/vue/components/input/plugins/promptMentionPlugin.ts
422
+ const SELECTED_ROW_MARKER = "›";
422
423
  function omitInverse(style) {
423
424
  if (!style) return {};
424
425
  const { inverse: _inverse,...rest } = style;
@@ -845,7 +846,8 @@ function createPromptMentionPlugin(options = {}) {
845
846
  getProps().promptSelectedStyle,
846
847
  getProps().zIndex,
847
848
  ctx.defaultStyle.value,
848
- promptMention.mentionKindVersion.value
849
+ promptMention.mentionKindVersion.value,
850
+ options.selectedMarkerStyle?.()
849
851
  ],
850
852
  paint: () => {
851
853
  if (!ctx.visible.value || !promptMention.promptVisible.value) return;
@@ -903,8 +905,9 @@ function createPromptMentionPlugin(options = {}) {
903
905
  const h$1 = Math.max(0, Math.floor(r.h));
904
906
  const innerW = Math.max(0, w - 2);
905
907
  const sidePad = innerW >= 4 ? 1 : 0;
906
- const contentW = Math.max(0, innerW - sidePad * 2);
907
- const contentX = x0 + 1 + sidePad;
908
+ const markerW = options.selectedMarkerStyle && innerW >= 6 ? 1 : 0;
909
+ const contentW = Math.max(0, innerW - sidePad * 2 - markerW);
910
+ const contentX = x0 + 1 + sidePad + markerW;
908
911
  const borderStyle = derived.borderStyle;
909
912
  if (lastTopClampedRect && y0 > 0) {
910
913
  ctx.terminal.write(spaces(lastTopClampedRect.w), {
@@ -964,7 +967,7 @@ function createPromptMentionPlugin(options = {}) {
964
967
  const valueStyle = isSelected ? derived.selectedStyle : derived.itemStyle;
965
968
  const highlightStyle = buildPromptMatchHighlightStyle(valueStyle, popupMatchStyle);
966
969
  const rowStyle = valueStyle;
967
- if (sidePad > 0) ctx.terminal.write(spaces(sidePad), {
970
+ if (sidePad > 0) ctx.terminal.write(spaces(sidePad + markerW), {
968
971
  x: x0 + 1,
969
972
  y,
970
973
  style: rowStyle
@@ -1001,7 +1004,7 @@ function createPromptMentionPlugin(options = {}) {
1001
1004
  } else {
1002
1005
  const style = isSelected ? derived.selectedStyle : derived.itemStyle;
1003
1006
  const highlightStyle = buildPromptMatchHighlightStyle(style, popupMatchStyle);
1004
- if (sidePad > 0) ctx.terminal.write(spaces(sidePad), {
1007
+ if (sidePad > 0) ctx.terminal.write(spaces(sidePad + markerW), {
1005
1008
  x: x0 + 1,
1006
1009
  y,
1007
1010
  style
@@ -1028,13 +1031,17 @@ function createPromptMentionPlugin(options = {}) {
1028
1031
  style
1029
1032
  });
1030
1033
  }
1034
+ if (markerW && isSelected) ctx.terminal.put(x0 + 1, y, SELECTED_ROW_MARKER, {
1035
+ ...derived.selectedStyle,
1036
+ ...options.selectedMarkerStyle?.()
1037
+ });
1031
1038
  }
1032
1039
  if (list.length === 0 && contentH > 0) {
1033
1040
  const y = y0 + 1;
1034
1041
  ctx.terminal.put(x0, y, "│", borderStyle);
1035
1042
  ctx.terminal.put(x0 + w - 1, y, "│", borderStyle);
1036
1043
  const msg = padEndByCells$1(sliceByCellsWindow("(no matches)", 0, contentW), contentW);
1037
- if (sidePad > 0) ctx.terminal.write(spaces(sidePad), {
1044
+ if (sidePad > 0) ctx.terminal.write(spaces(sidePad + markerW), {
1038
1045
  x: x0 + 1,
1039
1046
  y,
1040
1047
  style: derived.emptyStyle
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simon_he/vue-tui",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
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",