@simon_he/vue-tui 1.0.1 → 1.1.1

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.
Files changed (107) hide show
  1. package/README.md +99 -46
  2. package/dist/TMermaidText-CXm_L969.js +885 -0
  3. package/dist/{TSelect-HzILuti9.js → TSelect-CiyMvwl-.js} +60 -81
  4. package/dist/{TTree-ChOot2Bh.js → TTree-DKGiuIcM.js} +140 -103
  5. package/dist/agent/mermaid.cjs +2 -0
  6. package/dist/agent/mermaid.d.cts +2 -0
  7. package/dist/agent/mermaid.d.ts +2 -0
  8. package/dist/agent/mermaid.js +1 -0
  9. package/dist/agent.cjs +31184 -24907
  10. package/dist/agent.d.cts +11 -1
  11. package/dist/agent.d.ts +11 -1
  12. package/dist/agent.js +1700 -13
  13. package/dist/block-source-5CQp4tF8.js +3230 -0
  14. package/dist/cli/stdin-buffer.d.ts +1 -1
  15. package/dist/cli.cjs +5363 -6178
  16. package/dist/cli.d.cts +5 -1
  17. package/dist/cli.d.ts +5 -1
  18. package/dist/cli.js +3569 -302
  19. package/dist/core/buffer/buffer.d.ts +2 -2
  20. package/dist/core/buffer/eaw-ranges-unicode-17.d.ts +14 -0
  21. package/dist/core/perf/instrumentation-noop.d.ts +48 -0
  22. package/dist/core/perf/instrumentation.d.ts +136 -0
  23. package/dist/core/terminal/create-terminal.d.ts +1 -0
  24. package/dist/core/types.d.ts +0 -4
  25. package/dist/core.cjs +851 -1462
  26. package/dist/core.js +6 -6
  27. package/dist/{create-terminal-C2oiWFJU.js → create-terminal-DXuZ2fci.js} +54 -19
  28. package/dist/debug-logger-ChY_PXVk.js +74 -0
  29. package/dist/{dom-renderer-BqGijQID.js → dom-renderer-DNzmg2As.js} +2 -2
  30. package/dist/experimental.cjs +4115 -5928
  31. package/dist/experimental.d.cts +2 -0
  32. package/dist/experimental.d.ts +2 -0
  33. package/dist/experimental.js +1490 -9
  34. package/dist/frame-perf-BBhE-iuS.js +111 -0
  35. package/dist/{sgr-BmzxEjAO.js → hyperlink-B35-O-cW.js} +100 -1
  36. package/dist/index.cjs +5025 -10332
  37. package/dist/index.js +16 -14
  38. package/dist/{linkify-D_gzn9Xq.js → linkify-CuuquMQT.js} +32 -3
  39. package/dist/markdown.cjs +21295 -12691
  40. package/dist/markdown.d.cts +1 -1
  41. package/dist/markdown.d.ts +1 -1
  42. package/dist/markdown.js +211 -51
  43. package/dist/mermaid-CWto52Wk.js +123 -0
  44. package/dist/mermaid.cjs +1707 -0
  45. package/dist/mermaid.d.cts +3 -0
  46. package/dist/mermaid.d.ts +3 -0
  47. package/dist/mermaid.js +6 -0
  48. package/dist/observability/frame-perf-store.d.ts +2 -1
  49. package/dist/observability/frame-perf.d.ts +33 -0
  50. package/dist/observability.cjs +106 -107
  51. package/dist/observability.d.cts +2 -2
  52. package/dist/observability.d.ts +2 -2
  53. package/dist/observability.js +3 -3
  54. package/dist/{path-suggest-BNqcuE3-.js → path-suggest-fPzRsgPv.js} +1 -1
  55. package/dist/{wheel-scroll-vBRaQ7p-.js → rect-Ng-3eKzF.js} +253 -117
  56. package/dist/renderer/cli/index.d.ts +1 -1
  57. package/dist/renderer/cli/stdout-metrics.d.ts +10 -0
  58. package/dist/renderer/cli/stdout-renderer.d.ts +53 -7
  59. package/dist/renderer/terminal-graphic-render-queue.d.ts +50 -0
  60. package/dist/renderer/terminal-graphics-trace.d.ts +53 -0
  61. package/dist/renderer/terminal-graphics.d.ts +146 -0
  62. package/dist/renderer-dom.cjs +364 -903
  63. package/dist/renderer-dom.js +4 -4
  64. package/dist/runtime/index.d.ts +2 -0
  65. package/dist/{runtime-rfcZCyJq.js → runtime-D77C03RM.js} +28 -15
  66. package/dist/runtime.cjs +427 -889
  67. package/dist/runtime.js +2 -2
  68. package/dist/{terminal-selection-DBinO6p5.js → terminal-selection-CQYr--26.js} +4 -1
  69. package/dist/{tlog-theme-CvLFNMwk.js → tlog-theme-CopRt9SC.js} +37 -6
  70. package/dist/{trace-CjzYeIxN.js → trace-CYHDKM1m.js} +5 -0
  71. package/dist/vue/agent/create-png-terminal-graphic-renderer.d.ts +19 -0
  72. package/dist/vue/components/TAgentTerminalGraphic.d.ts +481 -0
  73. package/dist/vue/components/TCharts.d.ts +1121 -0
  74. package/dist/vue/components/TFeedback.d.ts +1 -1
  75. package/dist/vue/components/TFlex.d.ts +389 -0
  76. package/dist/vue/components/TForm.d.ts +4 -4
  77. package/dist/vue/components/TLogSearchBar.d.ts +3 -3
  78. package/dist/vue/components/TLogSearchPager.d.ts +2 -2
  79. package/dist/vue/components/TMarkdownText.d.ts +162 -4
  80. package/dist/vue/components/TMermaidText.d.ts +900 -0
  81. package/dist/vue/components/TVirtualList.d.ts +9 -0
  82. package/dist/vue/components/TVirtualMarkdown.d.ts +170 -9
  83. package/dist/vue/components/TVirtualRows.d.ts +9 -0
  84. package/dist/vue/components/TerminalProvider.d.ts +2 -0
  85. package/dist/vue/context.d.ts +24 -0
  86. package/dist/vue/index.d.ts +5 -0
  87. package/dist/vue/layout/flex.d.ts +67 -0
  88. package/dist/vue/markdown/ast.d.ts +5 -2
  89. package/dist/vue/markdown/document.d.ts +5 -0
  90. package/dist/vue/markdown/image-actions.d.ts +14 -0
  91. package/dist/vue/markdown/image.d.ts +11 -0
  92. package/dist/vue/markdown/link-actions.d.ts +14 -0
  93. package/dist/vue/markdown/math-actions.d.ts +14 -0
  94. package/dist/vue/markdown/math.d.ts +6 -0
  95. package/dist/vue/markdown/render.d.ts +28 -0
  96. package/dist/vue/markdown/types.d.ts +78 -0
  97. package/dist/vue/mermaid/beautiful-mermaid.d.ts +1436 -0
  98. package/dist/vue/render/render-manager.d.ts +7 -0
  99. package/dist/vue.cjs +7215 -12430
  100. package/dist/vue.js +706 -39
  101. package/dist/wheel-scroll-CQ22Hcyj.js +106 -0
  102. package/dist/{hyperlink-Bn02UXJb.js → width-GqllnV8C.js} +166 -111
  103. package/package.json +107 -18
  104. package/dist/block-source-CKUOnkgT.js +0 -1663
  105. package/dist/frame-perf-C6Xfg85O.js +0 -24
  106. /package/dist/{env-Cl8qmNFN.js → env-DNCzvX8b.js} +0 -0
  107. /package/dist/{path-mnSgEpCm.js → path-BI9W15Zt.js} +0 -0
@@ -1,8 +1,9 @@
1
- import { getPlaneTerminal } from "./create-terminal-C2oiWFJU.js";
2
- import { charCellWidth, hasEncodedControl } from "./hyperlink-Bn02UXJb.js";
3
- import { DialogContextKey, EventZIndexContextKey, ImeAnchorContextKey, LayoutContextKey, RenderPlaneContextKey, RenderStackKey, TInputPluginsContextKey, TerminalContextKey, forEachTextCellSegment, graphemeRangeAt, hasTextWidthAsciiFastPath, intersectRect, padEndByCells$1 as padEndByCells, repeatChar, sanitizeInlineText, sanitizeTextBlock, sliceByCells, sliceByCellsRange, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useRenderStack, useTerminal, useTerminalNode, useVisibility, withTextWidthProvider, wrapByCells } from "./wheel-scroll-vBRaQ7p-.js";
4
- import { TView } from "./linkify-D_gzn9Xq.js";
5
- import { isAbsolutePath, normalizeNewlines, normalizePath, resolvePath } from "./path-mnSgEpCm.js";
1
+ import { getPlaneTerminal } from "./create-terminal-DXuZ2fci.js";
2
+ import { charCellWidth } from "./width-GqllnV8C.js";
3
+ import { hasEncodedControl } from "./hyperlink-B35-O-cW.js";
4
+ import { DialogContextKey, EventZIndexContextKey, ImeAnchorContextKey, LayoutContextKey, RenderPlaneContextKey, RenderStackKey, TInputPluginsContextKey, TerminalContextKey, forEachTextCellSegment, graphemeRangeAt, hasTextWidthAsciiFastPath, intersectRect, padEndByCells$1 as padEndByCells, repeatChar, sanitizeInlineText, sanitizeTextBlock, sliceByCells, sliceByCellsRange, spaces, textCellWidth$1 as textCellWidth, translateRect, useLayout, useRenderNode, useRenderStack, useTerminal, useTerminalNode, useVisibility, withTextWidthProvider, wrapByCells } from "./rect-Ng-3eKzF.js";
5
+ import { TView, mergeStyle } from "./linkify-CuuquMQT.js";
6
+ import { isAbsolutePath, normalizeNewlines, normalizePath, resolvePath } from "./path-BI9W15Zt.js";
6
7
  import { computed, defineComponent, h, inject, nextTick, onBeforeUnmount, onMounted, provide, ref, shallowReactive, shallowRef, watch, watchEffect } from "vue";
7
8
 
8
9
  //#region src/vue/components/TRenderPlane.ts
@@ -204,7 +205,7 @@ const TBox = defineComponent({
204
205
  const max = Math.max(0, w - 4);
205
206
  const safe = sanitizeInlineText(props.title);
206
207
  const title = sliceByCells(safe, max);
207
- const ts = titleStyle ?? (style.bg ? { bg: style.bg } : {});
208
+ const ts = titleStyle ?? style;
208
209
  terminal.write(` ${title} `, {
209
210
  x: x0 + 1,
210
211
  y: y0,
@@ -332,7 +333,7 @@ const TBox = defineComponent({
332
333
 
333
334
  //#endregion
334
335
  //#region src/vue/overlay.ts
335
- function clamp$5(n, min, max) {
336
+ function clamp$4(n, min, max) {
336
337
  return Math.max(min, Math.min(max, n));
337
338
  }
338
339
  function cellCount(value) {
@@ -439,8 +440,8 @@ function resolveOverlayPlacement(opts) {
439
440
  x,
440
441
  y
441
442
  } : {
442
- x: clamp$5(x, 0, maxX),
443
- y: clamp$5(y, 0, maxY)
443
+ x: clamp$4(x, 0, maxX),
444
+ y: clamp$4(y, 0, maxY)
444
445
  };
445
446
  }
446
447
  function createOverlayFocusStack() {
@@ -624,7 +625,7 @@ const TText = defineComponent({
624
625
 
625
626
  //#endregion
626
627
  //#region src/vue/components/TDialog.ts
627
- function clamp$4(n, min, max) {
628
+ function clamp$3(n, min, max) {
628
629
  return Math.max(min, Math.min(max, n));
629
630
  }
630
631
  function computePosition(opts) {
@@ -824,7 +825,7 @@ const DialogSurface = defineComponent({
824
825
  }
825
826
  },
826
827
  setup(props) {
827
- const { events, scheduler } = useTerminal();
828
+ const { events, scheduler, defaultStyle } = useTerminal();
828
829
  const layout = useLayout();
829
830
  const cols = computed(() => layout.clipRect?.w ?? 0);
830
831
  const rows = computed(() => layout.clipRect?.h ?? 0);
@@ -1091,7 +1092,15 @@ const DialogSurface = defineComponent({
1091
1092
  padding: props.padding,
1092
1093
  border: true
1093
1094
  });
1094
- const contentStyle = props.contentStyle ?? props.style;
1095
+ const dialogStyle = props.style && props.style.bg == null && defaultStyle.value.bg != null ? {
1096
+ ...props.style,
1097
+ bg: defaultStyle.value.bg
1098
+ } : props.style;
1099
+ const rawContentStyle = props.contentStyle ?? dialogStyle;
1100
+ const contentStyle = rawContentStyle && rawContentStyle.bg == null && defaultStyle.value.bg != null ? {
1101
+ ...rawContentStyle,
1102
+ bg: defaultStyle.value.bg
1103
+ } : rawContentStyle;
1095
1104
  const dialogBox = h(TView, {
1096
1105
  x,
1097
1106
  y,
@@ -1116,7 +1125,7 @@ const DialogSurface = defineComponent({
1116
1125
  clear: true,
1117
1126
  title: props.title,
1118
1127
  padding: props.padding,
1119
- style: props.style,
1128
+ style: dialogStyle,
1120
1129
  titleStyle: props.titleStyle
1121
1130
  }, () => [h(TText, {
1122
1131
  x: 0,
@@ -1244,7 +1253,7 @@ const TDialog = defineComponent({
1244
1253
  "confirm"
1245
1254
  ],
1246
1255
  setup(props, { emit, slots }) {
1247
- const { runtime, events, scheduler } = useTerminal();
1256
+ const { runtime, events, scheduler, defaultStyle } = useTerminal();
1248
1257
  const layout = useLayout();
1249
1258
  const cols = computed(() => layout.clipRect?.w ?? 0);
1250
1259
  const rows = computed(() => layout.clipRect?.h ?? 0);
@@ -1425,7 +1434,7 @@ const TDialog = defineComponent({
1425
1434
  const isDanger = b.kind === "danger";
1426
1435
  const isAccent = b.kind === "accent";
1427
1436
  const isMuted = b.kind === "muted";
1428
- const baseBg = b.style?.bg ?? props.contentStyle?.bg ?? props.style?.bg;
1437
+ const baseBg = b.style?.bg ?? props.contentStyle?.bg ?? props.style?.bg ?? defaultStyle.value.bg;
1429
1438
  const variantStyle = b.style ?? (isPrimary ? { bold: true } : isDanger ? { bold: true } : isAccent ? { underline: true } : isMuted ? { dim: true } : {});
1430
1439
  const style = {
1431
1440
  ...variantStyle,
@@ -1547,7 +1556,7 @@ const TDialog = defineComponent({
1547
1556
  }
1548
1557
  watch(() => props.modelValue, (next, prev) => {
1549
1558
  if (next && !prev) captureRestoreFocus();
1550
- if (next && !prev) selectedButtonIndex.value = clamp$4(defaultButtonIndex(), 0, Math.max(0, props.buttons.length - 1));
1559
+ if (next && !prev) selectedButtonIndex.value = clamp$3(defaultButtonIndex(), 0, Math.max(0, props.buttons.length - 1));
1551
1560
  if (!prev || next) return;
1552
1561
  const closeAlreadyEmitted = skipNextCloseEmit.value;
1553
1562
  skipNextCloseEmit.value = false;
@@ -1848,7 +1857,7 @@ function mentionChipStyle(baseStyle, _absPath, _fsKind) {
1848
1857
 
1849
1858
  //#endregion
1850
1859
  //#region src/vue/components/input/utils/inlineText.ts
1851
- function clamp$3(n, min, max) {
1860
+ function clamp$2(n, min, max) {
1852
1861
  return Math.max(min, Math.min(max, n));
1853
1862
  }
1854
1863
  function isAscii(text) {
@@ -1910,7 +1919,7 @@ function mentionLabelAt(mentions, mentionIndex) {
1910
1919
  }
1911
1920
  function countTokens(value, token, endIndex = value.length) {
1912
1921
  let count = 0;
1913
- const limit = clamp$3(endIndex, 0, value.length);
1922
+ const limit = clamp$2(endIndex, 0, value.length);
1914
1923
  for (let i = 0; i < limit; i++) if (value[i] === token) count++;
1915
1924
  return count;
1916
1925
  }
@@ -1925,8 +1934,8 @@ function nextInlineBoundary(value, multilineToken, mentionToken, start, end) {
1925
1934
  return next;
1926
1935
  }
1927
1936
  function forEachInlineUnit(value, multilineToken, mentionToken, multilineTexts, mentions, start, end, cb) {
1928
- const safeStart = clamp$3(start, 0, value.length);
1929
- const safeEnd = clamp$3(end, safeStart, value.length);
1937
+ const safeStart = clamp$2(start, 0, value.length);
1938
+ const safeEnd = clamp$2(end, safeStart, value.length);
1930
1939
  let tokenIndex = countMultilineTokens$1(value, multilineToken, safeStart);
1931
1940
  let mentionIndex = countMentionTokens$1(value, mentionToken, safeStart);
1932
1941
  for (let i = safeStart; i < safeEnd;) {
@@ -2009,8 +2018,8 @@ function mentionIndexAt$1(value, mentionToken, index) {
2009
2018
  return countMentionTokens$1(value, mentionToken, index);
2010
2019
  }
2011
2020
  function textCellWidthInline(value, multilineToken, mentionToken, multilineTexts, mentions, start, end) {
2012
- const safeStart = clamp$3(start, 0, value.length);
2013
- const safeEnd = clamp$3(end, safeStart, value.length);
2021
+ const safeStart = clamp$2(start, 0, value.length);
2022
+ const safeEnd = clamp$2(end, safeStart, value.length);
2014
2023
  let cells = 0;
2015
2024
  forEachInlineUnit(value, multilineToken, mentionToken, multilineTexts, mentions, 0, safeEnd, (unit) => {
2016
2025
  if (unit.end > safeStart) cells += unit.cells;
@@ -2118,7 +2127,7 @@ function wrapToLinesFirstWidthInline$1(value, multilineToken, mentionToken, mult
2118
2127
  }];
2119
2128
  }
2120
2129
  function indexToWrappedCellColFirstWidthInline$1(value, multilineToken, mentionToken, multilineTexts, mentions, index, firstWidth, width) {
2121
- const safe = clamp$3(index, 0, value.length);
2130
+ const safe = clamp$2(index, 0, value.length);
2122
2131
  const lines = wrapToLinesFirstWidthInline$1(value, multilineToken, mentionToken, multilineTexts, mentions, firstWidth, width);
2123
2132
  for (let i = 0; i < lines.length; i++) {
2124
2133
  const info = lines[i];
@@ -2139,7 +2148,7 @@ function indexToWrappedCellColFirstWidthInline$1(value, multilineToken, mentionT
2139
2148
  };
2140
2149
  }
2141
2150
  function indexToLineCellColInline$1(value, multilineToken, mentionToken, multilineTexts, mentions, index) {
2142
- const safe = clamp$3(index, 0, value.length);
2151
+ const safe = clamp$2(index, 0, value.length);
2143
2152
  const lines = computeLines$1(value);
2144
2153
  for (let i = 0; i < lines.length; i++) {
2145
2154
  const info = lines[i];
@@ -2315,7 +2324,7 @@ function buildInlineSelectionSegments(value, displayValue, multilineTexts, menti
2315
2324
 
2316
2325
  //#endregion
2317
2326
  //#region src/vue/components/input/utils/primitives.ts
2318
- function clamp$2(n, min, max) {
2327
+ function clamp$1(n, min, max) {
2319
2328
  return Math.max(min, Math.min(max, n));
2320
2329
  }
2321
2330
  function isWhitespace(ch) {
@@ -2328,7 +2337,7 @@ function isWordChar(ch) {
2328
2337
  //#endregion
2329
2338
  //#region src/vue/components/input/utils/wordNavigation.ts
2330
2339
  function findWordLeft(text, index) {
2331
- let i = clamp$2(index, 0, text.length);
2340
+ let i = clamp$1(index, 0, text.length);
2332
2341
  if (i === 0) return 0;
2333
2342
  while (i > 0 && isWhitespace(text[i - 1])) i--;
2334
2343
  if (i === 0) return 0;
@@ -2342,7 +2351,7 @@ function findWordLeft(text, index) {
2342
2351
  return i;
2343
2352
  }
2344
2353
  function findWordRight(text, index) {
2345
- let i = clamp$2(index, 0, text.length);
2354
+ let i = clamp$1(index, 0, text.length);
2346
2355
  if (i >= text.length) return text.length;
2347
2356
  while (i < text.length && isWhitespace(text[i])) i++;
2348
2357
  if (i >= text.length) return text.length;
@@ -2357,7 +2366,7 @@ function findWordRight(text, index) {
2357
2366
  }
2358
2367
  function tokenRangeAt(value, index) {
2359
2368
  if (!value) return null;
2360
- let i = clamp$2(index, 0, value.length);
2369
+ let i = clamp$1(index, 0, value.length);
2361
2370
  if (i === value.length) i = value.length - 1;
2362
2371
  if (i < 0) return null;
2363
2372
  const ch0 = value[i];
@@ -2406,7 +2415,7 @@ function computeLines(value) {
2406
2415
  return computeLines$1(value);
2407
2416
  }
2408
2417
  function indexToLineCellCol(value, index) {
2409
- const safe = clamp$2(index, 0, value.length);
2418
+ const safe = clamp$1(index, 0, value.length);
2410
2419
  const lines = computeLines(value);
2411
2420
  for (let i = 0; i < lines.length; i++) {
2412
2421
  const info = lines[i];
@@ -2670,7 +2679,7 @@ const TInput = defineComponent({
2670
2679
  function measureContent(r) {
2671
2680
  const wAll = Math.max(0, Math.floor(r.w));
2672
2681
  const hAll = Math.max(0, Math.floor(r.h));
2673
- const padX = clamp$2(PADDING_X, 0, Math.floor(wAll / 2));
2682
+ const padX = clamp$1(PADDING_X, 0, Math.floor(wAll / 2));
2674
2683
  const w = Math.max(0, wAll - padX * 2);
2675
2684
  return {
2676
2685
  wAll,
@@ -2772,8 +2781,8 @@ const TInput = defineComponent({
2772
2781
  cursor.value = nextLen;
2773
2782
  anchor.value = null;
2774
2783
  } else {
2775
- cursor.value = clamp$2(cursor.value, 0, nextLen);
2776
- if (anchor.value != null) anchor.value = clamp$2(anchor.value, 0, nextLen);
2784
+ cursor.value = clamp$1(cursor.value, 0, nextLen);
2785
+ if (anchor.value != null) anchor.value = clamp$1(anchor.value, 0, nextLen);
2777
2786
  }
2778
2787
  if (composing.value && next !== prev) {
2779
2788
  compositionBlocked.value = true;
@@ -2895,10 +2904,10 @@ const TInput = defineComponent({
2895
2904
  });
2896
2905
  const useCompositionEnd = typeof document !== "undefined";
2897
2906
  function getComposedTextAndCursor(value) {
2898
- const baseCursor = clamp$2(cursor.value, 0, value.length);
2907
+ const baseCursor = clamp$1(cursor.value, 0, value.length);
2899
2908
  if (composing.value && compositionText.value) {
2900
2909
  const text = `${value.slice(0, baseCursor)}${compositionText.value}${value.slice(baseCursor)}`;
2901
- const cursorIndex = useCompositionEnd ? clamp$2(baseCursor + compositionText.value.length, 0, text.length) : baseCursor;
2910
+ const cursorIndex = useCompositionEnd ? clamp$1(baseCursor + compositionText.value.length, 0, text.length) : baseCursor;
2902
2911
  return {
2903
2912
  text,
2904
2913
  cursor: cursorIndex
@@ -2928,9 +2937,9 @@ const TInput = defineComponent({
2928
2937
  else if (col > scrollX.value + viewW - 1) scrollX.value = Math.max(0, col - (viewW - 1));
2929
2938
  }
2930
2939
  const maxTop = Math.max(0, lines.length - height);
2931
- scrollY.value = clamp$2(scrollY.value, 0, maxTop);
2940
+ scrollY.value = clamp$1(scrollY.value, 0, maxTop);
2932
2941
  if (line < scrollY.value) scrollY.value = line;
2933
- else if (line > scrollY.value + height - 1) scrollY.value = clamp$2(line - (height - 1), 0, maxTop);
2942
+ else if (line > scrollY.value + height - 1) scrollY.value = clamp$1(line - (height - 1), 0, maxTop);
2934
2943
  });
2935
2944
  }
2936
2945
  function computeImeAnchorCell() {
@@ -2952,8 +2961,8 @@ const TInput = defineComponent({
2952
2961
  const pos = wrap ? indexToWrappedCellColFirstWidthInline(cursorText, props.multilineTexts, props.mentions, composed.cursor, firstWidth, width) : indexToLineCellColInline(cursorText, props.multilineTexts, props.mentions, composed.cursor);
2953
2962
  const cx0 = pos.col - offX;
2954
2963
  const cy = pos.line - offY;
2955
- const cx = clamp$2(cx0, 0, Math.max(0, width - 1));
2956
- const cyClamped = clamp$2(cy, 0, Math.max(0, r.h - 1));
2964
+ const cx = clamp$1(cx0, 0, Math.max(0, width - 1));
2965
+ const cyClamped = clamp$1(cy, 0, Math.max(0, r.h - 1));
2957
2966
  return {
2958
2967
  cellX: r.x + padX + cx,
2959
2968
  cellY: r.y + cyClamped
@@ -2981,8 +2990,8 @@ const TInput = defineComponent({
2981
2990
  const r = absRect.value;
2982
2991
  const { w: contentW, padX } = measureContent(r);
2983
2992
  const width = Math.max(1, contentW);
2984
- const localX = clamp$2(cellX - (r.x + padX), 0, Math.max(0, contentW - 1));
2985
- const localY = clamp$2(cellY - r.y, 0, Math.max(0, r.h - 1));
2993
+ const localX = clamp$1(cellX - (r.x + padX), 0, Math.max(0, contentW - 1));
2994
+ const localY = clamp$1(cellY - r.y, 0, Math.max(0, r.h - 1));
2986
2995
  const value = getValue();
2987
2996
  const wrap = wrapMode.value;
2988
2997
  const xText = localX;
@@ -2991,14 +3000,14 @@ const TInput = defineComponent({
2991
3000
  let hit = null;
2992
3001
  if (wrap) {
2993
3002
  const lines = wrapToLinesFirstWidthInline(value, props.multilineTexts, props.mentions, firstWidth, width);
2994
- const line = clamp$2(scrollY.value + localY, 0, lines.length - 1);
3003
+ const line = clamp$1(scrollY.value + localY, 0, lines.length - 1);
2995
3004
  const col = xText;
2996
3005
  const hit2 = wrappedCellColToIndexInline(value, props.multilineTexts, props.mentions, lines[line], col);
2997
3006
  next = hit2.index;
2998
3007
  hit = hit2.hit;
2999
3008
  } else {
3000
3009
  const lines = computeLines(value);
3001
- const line = clamp$2(scrollY.value + localY, 0, lines.length - 1);
3010
+ const line = clamp$1(scrollY.value + localY, 0, lines.length - 1);
3002
3011
  const col = scrollX.value + xText;
3003
3012
  const info = lines[line];
3004
3013
  const hit2 = lineCellColToIndexInline(value, props.multilineTexts, props.mentions, info.start, info.end, col);
@@ -3028,7 +3037,7 @@ const TInput = defineComponent({
3028
3037
  }
3029
3038
  function applyEdit(nextValue, nextCursor, commit = false) {
3030
3039
  withInputWidth(() => {
3031
- const c = clamp$2(nextCursor, 0, nextValue.length);
3040
+ const c = clamp$1(nextCursor, 0, nextValue.length);
3032
3041
  cursor.value = c;
3033
3042
  anchor.value = null;
3034
3043
  composing.value = false;
@@ -3058,7 +3067,7 @@ const TInput = defineComponent({
3058
3067
  if (extend) {
3059
3068
  if (anchor.value == null) anchor.value = prev;
3060
3069
  } else anchor.value = null;
3061
- cursor.value = clamp$2(nextCursor, 0, value.length);
3070
+ cursor.value = clamp$1(nextCursor, 0, value.length);
3062
3071
  if (wrapMode.value) {
3063
3072
  const { w: contentW } = measureContent(absRect.value);
3064
3073
  const w = Math.max(1, contentW);
@@ -3962,7 +3971,7 @@ const TInput = defineComponent({
3962
3971
  anchor.value = null;
3963
3972
  }
3964
3973
  hasFocusedOnce.value = true;
3965
- cursor.value = clamp$2(cursor.value, 0, valueLen);
3974
+ cursor.value = clamp$1(cursor.value, 0, valueLen);
3966
3975
  ensureCursorVisible();
3967
3976
  syncImeAnchorNow();
3968
3977
  startBlink();
@@ -4352,8 +4361,8 @@ const TInput = defineComponent({
4352
4361
  const cx0 = pos.col - offX;
4353
4362
  const cy = pos.line - offY;
4354
4363
  if (imeAnchor && focused.value) {
4355
- const cx = clamp$2(cx0, 0, Math.max(0, width - 1));
4356
- const cyClamped = clamp$2(cy, 0, Math.max(0, r.h - 1));
4364
+ const cx = clamp$1(cx0, 0, Math.max(0, width - 1));
4365
+ const cyClamped = clamp$1(cy, 0, Math.max(0, r.h - 1));
4357
4366
  imeAnchor.value = {
4358
4367
  cellX: r.x + padX + cx,
4359
4368
  cellY: r.y + cyClamped,
@@ -4396,35 +4405,6 @@ const TInput = defineComponent({
4396
4405
  }
4397
4406
  });
4398
4407
 
4399
- //#endregion
4400
- //#region src/vue/components/simple-utils.ts
4401
- function clamp$1(n, min, max) {
4402
- return Math.max(min, Math.min(max, n));
4403
- }
4404
- function mergeStyle(...styles) {
4405
- const out = {};
4406
- for (const style of styles) {
4407
- if (!style) continue;
4408
- Object.assign(out, style);
4409
- }
4410
- return out;
4411
- }
4412
- function fitCellText(value, width, align = "left") {
4413
- const w = Math.max(0, Math.floor(width));
4414
- if (w <= 0) return "";
4415
- const text = sliceByCells(sanitizeInlineText(String(value ?? "")), w);
4416
- if (align === "right") {
4417
- const cells = textCellWidth(text);
4418
- return `${" ".repeat(Math.max(0, w - cells))}${text}`;
4419
- }
4420
- return padEndByCells(text, w);
4421
- }
4422
- function repeatToCells(ch, width) {
4423
- const w = Math.max(0, Math.floor(width));
4424
- if (w <= 0) return "";
4425
- return ch.repeat(w);
4426
- }
4427
-
4428
4408
  //#endregion
4429
4409
  //#region src/vue/components/TCommandPalette.ts
4430
4410
  function computeCommandPaletteMatchRanges(text, query) {
@@ -5910,14 +5890,13 @@ const TSelect = defineComponent({
5910
5890
  const optDetailStyle = getOptionDetailStyle(opt);
5911
5891
  const rowDetailStyle = {
5912
5892
  ...rowBase,
5913
- ...optDetailStyle ?? {},
5914
- dim: true
5893
+ dim: true,
5894
+ ...optDetailStyle ?? {}
5915
5895
  };
5916
5896
  const optHighlightDetailStyle = getOptionHighlightDetailStyle(opt);
5917
5897
  const rowHighlightDetailStyle = {
5918
5898
  ...rowHighlightBase,
5919
- ...optHighlightDetailStyle ?? {},
5920
- dim: true
5899
+ ...optHighlightDetailStyle ?? {}
5921
5900
  };
5922
5901
  const optAccentStyle = getOptionAccentStyle(opt);
5923
5902
  const rowAccentStyle = optAccentStyle ? {
@@ -6135,4 +6114,4 @@ const TSelect = defineComponent({
6135
6114
  });
6136
6115
 
6137
6116
  //#endregion
6138
- export { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, TText, clamp$1 as clamp, clamp$2 as clamp$1, computeCommandPaletteMatchRanges, createOverlayFocusStack, fitCellText, isCommitMention, isWhitespace, mentionChipStyle, mergeStyle, padEndByCells$1 as padEndByCells, repeatToCells, resolveOverlayPlacement, sliceByCellsWindow, textCellWidth$1 as textCellWidth };
6117
+ export { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, TText, clamp$1, computeCommandPaletteMatchRanges, createOverlayFocusStack, isCommitMention, isWhitespace, mentionChipStyle, padEndByCells$1 as padEndByCells, resolveOverlayPlacement, sliceByCellsWindow, textCellWidth$1 as textCellWidth };