@simon_he/vue-tui 1.1.5 → 1.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +1 -0
  2. package/dist/TAgentTerminalGraphic-B8-YZfuP.js +1198 -0
  3. package/dist/{TSelect-CMBOOFwK.js → TSelect-CCsjjCOr.js} +41 -12
  4. package/dist/{TTree-kk8ntrpg.js → TTree-3W5A2_EH.js} +4 -3
  5. package/dist/TVideo-D9AOiyq2.js +948 -0
  6. package/dist/agent.cjs +5204 -4312
  7. package/dist/agent.js +11 -9
  8. package/dist/{block-source-DhzajB9H.js → block-source-BhvdZomx.js} +246 -53
  9. package/dist/cli.cjs +41 -26
  10. package/dist/cli.js +68 -18
  11. package/dist/core.js +2 -2
  12. package/dist/experimental/browser.cjs +3705 -0
  13. package/dist/experimental/browser.d.cts +3 -0
  14. package/dist/experimental/browser.d.ts +3 -0
  15. package/dist/experimental/browser.js +413 -0
  16. package/dist/experimental.cjs +2 -1
  17. package/dist/experimental.js +9 -947
  18. package/dist/{linkify-CL9wwnZN.js → frame-mailbox-DaTrfyaF.js} +2 -297
  19. package/dist/index.cjs +25 -8
  20. package/dist/index.js +6 -5
  21. package/dist/linkify-CklfA1vp.js +298 -0
  22. package/dist/markdown.cjs +5196 -4322
  23. package/dist/markdown.js +4 -4
  24. package/dist/{mermaid-N3kGTHFy.js → mermaid-D0ov4_A1.js} +93 -9
  25. package/dist/mermaid.cjs +78 -7
  26. package/dist/mermaid.js +4 -4
  27. package/dist/{path-suggest-Dndu4dTi.js → path-suggest-fPzRsgPv.js} +1 -1
  28. package/dist/renderer/terminal-graphics.d.ts +1 -1
  29. package/dist/{terminal-graphics-2FTRg9x3.js → terminal-graphics-DpSL29OQ.js} +3 -3
  30. package/dist/{tlog-theme-B91Wv7Zj.js → tlog-theme-BnILsD3n.js} +10 -1203
  31. package/dist/vue/browser/types.d.ts +52 -0
  32. package/dist/vue/components/TAgentTerminalGraphic.d.ts +3 -0
  33. package/dist/vue/components/TBrowser.d.ts +231 -0
  34. package/dist/vue/components/TVirtualMarkdown.d.ts +10 -0
  35. package/dist/vue/markdown/render.d.ts +18 -1
  36. package/dist/vue.cjs +25 -8
  37. package/dist/vue.js +8 -7
  38. package/package.json +27 -2
  39. /package/dist/{TMermaidText-wLnMMvVS.js → TMermaidText-C1akgJPU.js} +0 -0
  40. /package/dist/{math-image-BZhmfUeu.js → math-image-CcUpBnW0.js} +0 -0
  41. /package/dist/{path-mnSgEpCm.js → path-BI9W15Zt.js} +0 -0
  42. /package/dist/{wheel-scroll-DASkEZr-.js → wheel-scroll-CQ22Hcyj.js} +0 -0
@@ -1,8 +1,9 @@
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-JzWMJxxc.js";
4
- import { TText, TView, mergeStyle } from "./linkify-CL9wwnZN.js";
5
- import { isAbsolutePath, normalizeNewlines, normalizePath, resolvePath } from "./path-mnSgEpCm.js";
4
+ import { mergeStyle } from "./linkify-CklfA1vp.js";
5
+ import { TText, TView } from "./frame-mailbox-DaTrfyaF.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
@@ -2954,34 +2955,51 @@ const TInput = defineComponent({
2954
2955
  scheduler.invalidate();
2955
2956
  }
2956
2957
  }
2957
- function deleteSelectionIfAny(value) {
2958
- const sel = selection.value;
2959
- if (!sel) return {
2958
+ function deleteRangeIfAny(value, start, end) {
2959
+ const from = clamp$1(Math.min(start, end), 0, value.length);
2960
+ const to = clamp$1(Math.max(start, end), 0, value.length);
2961
+ if (to <= from) return {
2960
2962
  value,
2961
2963
  cursor: cursor.value,
2962
2964
  deleted: false
2963
2965
  };
2964
- const tokenStart = countMultilineTokens(value, sel.start);
2965
- const tokenEnd = countMultilineTokens(value, sel.end);
2966
+ const tokenStart = countMultilineTokens(value, from);
2967
+ const tokenEnd = countMultilineTokens(value, to);
2966
2968
  if (tokenEnd > tokenStart) {
2967
2969
  const current = props.multilineTexts ?? [];
2968
2970
  const nextMultiline = [...current.slice(0, tokenStart), ...current.slice(tokenEnd)];
2969
2971
  emit("update:multilineTexts", nextMultiline);
2970
2972
  }
2971
- const mentionStart = countMentionTokens(value, sel.start);
2972
- const mentionEnd = countMentionTokens(value, sel.end);
2973
+ const mentionStart = countMentionTokens(value, from);
2974
+ const mentionEnd = countMentionTokens(value, to);
2973
2975
  if (mentionEnd > mentionStart) {
2974
2976
  const current = pendingMentions.value ?? props.mentions ?? [];
2975
2977
  const nextMentions = [...current.slice(0, mentionStart), ...current.slice(mentionEnd)];
2976
2978
  emitMentions(nextMentions);
2977
2979
  }
2978
- const next = value.slice(0, sel.start) + value.slice(sel.end);
2980
+ const next = value.slice(0, from) + value.slice(to);
2979
2981
  return {
2980
2982
  value: next,
2981
- cursor: sel.start,
2983
+ cursor: from,
2982
2984
  deleted: true
2983
2985
  };
2984
2986
  }
2987
+ function deleteSelectionIfAny(value) {
2988
+ const sel = selection.value;
2989
+ if (!sel) return {
2990
+ value,
2991
+ cursor: cursor.value,
2992
+ deleted: false
2993
+ };
2994
+ return deleteRangeIfAny(value, sel.start, sel.end);
2995
+ }
2996
+ function deleteToLineBoundary(value, direction) {
2997
+ const sel = selection.value;
2998
+ if (sel) return deleteRangeIfAny(value, sel.start, sel.end);
2999
+ const { line, lines } = indexToLineCellCol(value, cursor.value);
3000
+ const target = direction === "start" ? lines[line].start : lines[line].end;
3001
+ return deleteRangeIfAny(value, cursor.value, target);
3002
+ }
2985
3003
  function insertText(rawText) {
2986
3004
  let text = rawText || "";
2987
3005
  if (!text) return;
@@ -3645,7 +3663,17 @@ const TInput = defineComponent({
3645
3663
  }
3646
3664
  return;
3647
3665
  }
3648
- const clearWithDeleteOrBackspace = Boolean(!e.altKey && (e.ctrlKey && !e.metaKey || e.metaKey && !e.ctrlKey));
3666
+ const clearWithDeleteOrBackspace = Boolean(!e.altKey && e.ctrlKey && !e.metaKey);
3667
+ if (e.metaKey && !e.ctrlKey && !e.altKey && (e.key === "Backspace" || e.key === "Delete")) {
3668
+ e.preventDefault();
3669
+ e.stopPropagation();
3670
+ const next = deleteToLineBoundary(value, e.key === "Backspace" ? "start" : "end");
3671
+ if (next.deleted) {
3672
+ pushUndoSnapshot(next.value);
3673
+ applyEdit(next.value, next.cursor);
3674
+ }
3675
+ return;
3676
+ }
3649
3677
  if (e.key === "Delete" && clearWithDeleteOrBackspace) {
3650
3678
  e.preventDefault();
3651
3679
  e.stopPropagation();
@@ -4238,6 +4266,7 @@ const TInput = defineComponent({
4238
4266
  }));
4239
4267
  onBeforeUnmount(() => {
4240
4268
  stopBlink();
4269
+ if (imeAnchor?.value?.ownerId === imeOwnerId) imeAnchor.value = null;
4241
4270
  });
4242
4271
  return () => h("span", rootProps);
4243
4272
  }
@@ -2,15 +2,16 @@ 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-JzWMJxxc.js";
5
- import { TText, TView, TuiThemeContextKey, clamp, createFrameMailbox, createTheme, defaultActiveStyle, defaultDimStyle, fitCellText, linkifyTextSegments, mergeStyle, repeatToCells, tuiDefaultTheme } from "./linkify-CL9wwnZN.js";
5
+ import { TuiThemeContextKey, clamp, createTheme, defaultActiveStyle, defaultDimStyle, fitCellText, linkifyTextSegments, mergeStyle, repeatToCells, tuiDefaultTheme } from "./linkify-CklfA1vp.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-CMBOOFwK.js";
13
- import { applyWheelScroll, createWheelScrollState, resetWheelScrollState } from "./wheel-scroll-DASkEZr-.js";
12
+ import { TBox, TInput, TRenderPlane, resolveOverlayPlacement } from "./TSelect-CCsjjCOr.js";
13
+ import { TText, TView, createFrameMailbox } from "./frame-mailbox-DaTrfyaF.js";
14
+ import { applyWheelScroll, createWheelScrollState, resetWheelScrollState } from "./wheel-scroll-CQ22Hcyj.js";
14
15
  import { computed, defineComponent, effectScope, getCurrentInstance, h, inject, nextTick, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, ref, shallowReactive, shallowRef, toRef, watch, watchEffect } from "vue";
15
16
 
16
17
  //#region src/observability/tui-profiler.ts