@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.
- package/README.md +1 -0
- package/dist/TAgentTerminalGraphic-B8-YZfuP.js +1198 -0
- package/dist/{TSelect-CMBOOFwK.js → TSelect-CCsjjCOr.js} +41 -12
- package/dist/{TTree-kk8ntrpg.js → TTree-3W5A2_EH.js} +4 -3
- package/dist/TVideo-D9AOiyq2.js +948 -0
- package/dist/agent.cjs +5204 -4312
- package/dist/agent.js +11 -9
- package/dist/{block-source-DhzajB9H.js → block-source-BhvdZomx.js} +246 -53
- package/dist/cli.cjs +41 -26
- package/dist/cli.js +68 -18
- package/dist/core.js +2 -2
- package/dist/experimental/browser.cjs +3705 -0
- package/dist/experimental/browser.d.cts +3 -0
- package/dist/experimental/browser.d.ts +3 -0
- package/dist/experimental/browser.js +413 -0
- package/dist/experimental.cjs +2 -1
- package/dist/experimental.js +9 -947
- package/dist/{linkify-CL9wwnZN.js → frame-mailbox-DaTrfyaF.js} +2 -297
- package/dist/index.cjs +25 -8
- package/dist/index.js +6 -5
- package/dist/linkify-CklfA1vp.js +298 -0
- package/dist/markdown.cjs +5196 -4322
- package/dist/markdown.js +4 -4
- package/dist/{mermaid-N3kGTHFy.js → mermaid-D0ov4_A1.js} +93 -9
- package/dist/mermaid.cjs +78 -7
- package/dist/mermaid.js +4 -4
- package/dist/{path-suggest-Dndu4dTi.js → path-suggest-fPzRsgPv.js} +1 -1
- package/dist/renderer/terminal-graphics.d.ts +1 -1
- package/dist/{terminal-graphics-2FTRg9x3.js → terminal-graphics-DpSL29OQ.js} +3 -3
- package/dist/{tlog-theme-B91Wv7Zj.js → tlog-theme-BnILsD3n.js} +10 -1203
- package/dist/vue/browser/types.d.ts +52 -0
- package/dist/vue/components/TAgentTerminalGraphic.d.ts +3 -0
- package/dist/vue/components/TBrowser.d.ts +231 -0
- package/dist/vue/components/TVirtualMarkdown.d.ts +10 -0
- package/dist/vue/markdown/render.d.ts +18 -1
- package/dist/vue.cjs +25 -8
- package/dist/vue.js +8 -7
- package/package.json +27 -2
- /package/dist/{TMermaidText-wLnMMvVS.js → TMermaidText-C1akgJPU.js} +0 -0
- /package/dist/{math-image-BZhmfUeu.js → math-image-CcUpBnW0.js} +0 -0
- /package/dist/{path-mnSgEpCm.js → path-BI9W15Zt.js} +0 -0
- /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 {
|
|
5
|
-
import {
|
|
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
|
|
2958
|
-
const
|
|
2959
|
-
|
|
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,
|
|
2965
|
-
const tokenEnd = countMultilineTokens(value,
|
|
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,
|
|
2972
|
-
const mentionEnd = countMentionTokens(value,
|
|
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,
|
|
2980
|
+
const next = value.slice(0, from) + value.slice(to);
|
|
2979
2981
|
return {
|
|
2980
2982
|
value: next,
|
|
2981
|
-
cursor:
|
|
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 &&
|
|
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 {
|
|
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-
|
|
13
|
-
import {
|
|
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
|