@simon_he/vue-tui 0.0.7 → 1.0.0-rc.0
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 +222 -444
- package/dist/TSelect-BmSkar0D.js +8697 -0
- package/dist/ansi-palette-Bv5Vqr4k.js +1499 -0
- package/dist/ansi-styles.d.ts +200 -0
- package/dist/cli/headless-renderer.d.ts +29 -0
- package/dist/cli/input.d.ts +49 -0
- package/dist/cli/node-file-writers.d.ts +12 -0
- package/dist/cli/node-module.d.ts +2 -0
- package/dist/cli/parse-kitty.d.ts +2 -0
- package/dist/cli/parse-mouse.d.ts +2 -0
- package/dist/cli/parse-utils.d.ts +14 -0
- package/dist/cli/parse-xterm.d.ts +2 -0
- package/dist/cli/path-provider-types.d.ts +1 -0
- package/dist/cli/path-provider.d.ts +4 -0
- package/dist/cli/path-suggest-core.d.ts +1 -0
- package/dist/cli/path-suggest.d.ts +15 -0
- package/dist/cli/recording.d.ts +4 -0
- package/dist/cli/stdin-buffer.d.ts +33 -0
- package/dist/cli.cjs +10664 -0
- package/dist/cli.d.cts +22 -0
- package/dist/cli.d.ts +22 -0
- package/dist/cli.js +9521 -0
- package/dist/core/ansi/capability.d.ts +20 -0
- package/dist/core/ansi/colors.d.ts +41 -0
- package/dist/core/ansi/sgr.d.ts +7 -0
- package/dist/core/ansi/theme.d.ts +6 -0
- package/dist/core/ansi-palette.d.ts +14 -0
- package/dist/core/buffer/buffer.d.ts +54 -0
- package/dist/core/buffer/width.d.ts +4 -0
- package/dist/core/debug-logger.d.ts +18 -0
- package/dist/core/hyperlink.d.ts +9 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/path-provider-types.d.ts +24 -0
- package/dist/core/path-suggest.d.ts +35 -0
- package/dist/core/render-plane.d.ts +3 -0
- package/dist/core/terminal/create-terminal.d.ts +7 -0
- package/dist/core/terminal/emitter.d.ts +7 -0
- package/dist/core/types.d.ts +107 -0
- package/dist/core.cjs +3072 -0
- package/dist/core.d.cts +14 -0
- package/dist/core.d.ts +14 -0
- package/dist/core.js +422 -0
- package/dist/create-terminal-app.d.ts +34 -0
- package/dist/dom-renderer-CDVQIcIL.js +1172 -0
- package/dist/events/index.d.ts +6 -0
- package/dist/events/manager/cli-event-manager.d.ts +22 -0
- package/dist/events/manager/event-manager.d.ts +30 -0
- package/dist/events/manager/selection-suppression.d.ts +3 -0
- package/dist/events/manager/types.d.ts +108 -0
- package/dist/events/recording.d.ts +44 -0
- package/dist/experimental.cjs +9380 -0
- package/dist/experimental.d.cts +39 -0
- package/dist/experimental.d.ts +39 -0
- package/dist/experimental.js +7624 -0
- package/dist/frame-perf-C-w8mjJL.js +98 -0
- package/dist/hyperlink-B5PD7a3Q.js +331 -0
- package/dist/index.cjs +12037 -16507
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -1353
- package/dist/index.js +13 -18738
- package/dist/markdown.cjs +21929 -0
- package/dist/markdown.d.cts +10 -0
- package/dist/markdown.d.ts +10 -0
- package/dist/markdown.js +1649 -0
- package/dist/observability/cli-latency-node.d.ts +3 -0
- package/dist/observability/cli-latency-types.d.ts +41 -0
- package/dist/observability/cli-latency.d.ts +3 -0
- package/dist/observability/frame-perf-store.d.ts +13 -0
- package/dist/observability/frame-perf.d.ts +40 -0
- package/dist/observability/trace.d.ts +40 -0
- package/dist/observability/tui-profiler.d.ts +33 -0
- package/dist/observability.cjs +99 -0
- package/dist/observability.d.cts +6 -0
- package/dist/observability.d.ts +6 -0
- package/dist/observability.js +3 -0
- package/dist/path-DDiSCXrQ.js +99 -0
- package/dist/path-suggest-0Q2BDsuj.js +274 -0
- package/dist/path-suggest-Dk9TRLh5.js +3 -0
- package/dist/{path-suggest-CZQYJIIg.js → path-suggest-bvR9SY6Q.js} +86 -18
- package/dist/renderer/capabilities.d.ts +13 -0
- package/dist/renderer/cli/index.d.ts +2 -0
- package/dist/renderer/cli/stdout-metrics.d.ts +18 -0
- package/dist/renderer/cli/stdout-renderer.d.ts +48 -0
- package/dist/renderer/dom/dom-renderer.d.ts +157 -0
- package/dist/renderer/dom/index.d.ts +2 -0
- package/dist/renderer/index.d.ts +2 -0
- package/dist/renderer-dom.cjs +1511 -0
- package/dist/renderer-dom.d.cts +4 -0
- package/dist/renderer-dom.d.ts +4 -0
- package/dist/renderer-dom.js +6 -0
- package/dist/runtime/index.d.ts +36 -0
- package/dist/runtime/osc52.d.ts +9 -0
- package/dist/runtime-DtrcQidD.js +1197 -0
- package/dist/runtime.cjs +1697 -0
- package/dist/runtime.d.cts +9 -0
- package/dist/runtime.d.ts +9 -0
- package/dist/runtime.js +4 -0
- package/dist/selection/terminal-selection.d.ts +122 -0
- package/dist/sgr-DMK2AvuT.js +304 -0
- package/dist/style-cache-i0ZABZRq.js +178 -0
- package/dist/terminal-selection-BCOh9jsL.js +329 -0
- package/dist/utils/env.d.ts +3 -0
- package/dist/utils/newlines.d.ts +1 -0
- package/dist/utils/path.d.ts +7 -0
- package/dist/utils/url-safety.d.ts +2 -0
- package/dist/vue/components/TAnchor.d.ts +108 -0
- package/dist/vue/components/TBox.d.ts +144 -0
- package/dist/vue/components/TDebugOverlay.d.ts +43 -0
- package/dist/vue/components/TDialog.d.ts +256 -0
- package/dist/vue/components/TFlow.d.ts +85 -0
- package/dist/vue/components/TInput.d.ts +554 -0
- package/dist/vue/components/TInputBox.d.ts +158 -0
- package/dist/vue/components/TJsonEditor.d.ts +165 -0
- package/dist/vue/components/TList.d.ts +119 -0
- package/dist/vue/components/TLogLinksPanel.d.ts +238 -0
- package/dist/vue/components/TLogMinimap.d.ts +263 -0
- package/dist/vue/components/TLogScrollbar.d.ts +236 -0
- package/dist/vue/components/TLogSearchBar.d.ts +267 -0
- package/dist/vue/components/TLogSearchPager.d.ts +162 -0
- package/dist/vue/components/TLogSearchResults.d.ts +200 -0
- package/dist/vue/components/TLogView.d.ts +502 -0
- package/dist/vue/components/TLogVirtualLinksPanel.d.ts +141 -0
- package/dist/vue/components/TLogVirtualSearchResults.d.ts +146 -0
- package/dist/vue/components/TMarkdownText.d.ts +134 -0
- package/dist/vue/components/TMultilineModal.d.ts +62 -0
- package/dist/vue/components/TPathPicker.d.ts +213 -0
- package/dist/vue/components/TRenderLayer.d.ts +16 -0
- package/dist/vue/components/TRenderPlane.d.ts +17 -0
- package/dist/vue/components/TSelect.d.ts +215 -0
- package/dist/vue/components/TText.d.ts +116 -0
- package/dist/vue/components/TTransition.d.ts +83 -0
- package/dist/vue/components/TView.d.ts +127 -0
- package/dist/vue/components/TVirtualList.d.ts +182 -0
- package/dist/vue/components/TVirtualMarkdown.d.ts +168 -0
- package/dist/vue/components/TerminalProvider.d.ts +195 -0
- package/dist/vue/components/input/host.d.ts +17 -0
- package/dist/vue/components/input/plugins/hostPlugin.d.ts +7 -0
- package/dist/vue/components/input/plugins/hostPlugin.node.d.ts +15 -0
- package/dist/vue/components/input/plugins/mentionUtils.d.ts +17 -0
- package/dist/vue/components/input/plugins/nodeMentionPathProvider.d.ts +2 -0
- package/dist/vue/components/input/plugins/promptMentionPlugin.d.ts +8 -0
- package/dist/vue/components/input/plugins/promptMentionState.d.ts +98 -0
- package/dist/vue/components/input/plugins/restrictText.d.ts +27 -0
- package/dist/vue/components/input/plugins/types.d.ts +90 -0
- package/dist/vue/components/input/utils/inlineText.d.ts +57 -0
- package/dist/vue/components/input/utils/inlineTextTokens.d.ts +34 -0
- package/dist/vue/components/input/utils/primitives.d.ts +3 -0
- package/dist/vue/components/input/utils/wordNavigation.d.ts +6 -0
- package/dist/vue/components/list/list-geometry.d.ts +16 -0
- package/dist/vue/components/list/list-paint.d.ts +1 -0
- package/dist/vue/components/list/scroll-state.d.ts +25 -0
- package/dist/vue/components/list/selection-state.d.ts +6 -0
- package/dist/vue/components/terminal-provider/copy-toast.d.ts +6 -0
- package/dist/vue/components/terminal-provider/portals.d.ts +17 -0
- package/dist/vue/components/terminal-provider/scheduler.d.ts +29 -0
- package/dist/vue/components/terminal-provider/selection-config.d.ts +15 -0
- package/dist/vue/components/terminal-provider/utils.d.ts +5 -0
- package/dist/vue/composables/use-layout.d.ts +2 -0
- package/dist/vue/composables/use-render-node.d.ts +19 -0
- package/dist/vue/composables/use-render-stack.d.ts +3 -0
- package/dist/vue/composables/use-runtime.d.ts +5 -0
- package/dist/vue/composables/use-terminal-node.d.ts +14 -0
- package/dist/vue/composables/use-terminal.d.ts +2 -0
- package/dist/vue/composables/use-visibility.d.ts +12 -0
- package/dist/vue/context.d.ts +153 -0
- package/dist/vue/index.d.ts +39 -0
- package/dist/vue/injection-key.d.ts +2 -0
- package/dist/vue/log/append-only-log-store.d.ts +2 -0
- package/dist/vue/log/tlog-keymap.d.ts +28 -0
- package/dist/vue/log/tlog-plugins.d.ts +144 -0
- package/dist/vue/log/tlog-session.d.ts +81 -0
- package/dist/vue/log/tlog-theme.d.ts +68 -0
- package/dist/vue/log/types.d.ts +43 -0
- package/dist/vue/log/use-tlog-link-controller.d.ts +31 -0
- package/dist/vue/log/use-tlog-retained-index.d.ts +26 -0
- package/dist/vue/log/use-tlog-search-controller.d.ts +51 -0
- package/dist/vue/log/use-tlog-search-results-page.d.ts +31 -0
- package/dist/vue/log/use-tlog-virtual-search-results.d.ts +22 -0
- package/dist/vue/markdown/ast.d.ts +3 -0
- package/dist/vue/markdown/block-source.d.ts +22 -0
- package/dist/vue/markdown/document.d.ts +18 -0
- package/dist/vue/markdown/layout.d.ts +16 -0
- package/dist/vue/markdown/parser.d.ts +11 -0
- package/dist/vue/markdown/render.d.ts +10 -0
- package/dist/vue/markdown/theme.d.ts +186 -0
- package/dist/vue/markdown/types.d.ts +47 -0
- package/dist/vue/render/context.d.ts +3 -0
- package/dist/vue/render/render-manager.d.ts +94 -0
- package/dist/vue/router/RouterView.d.ts +25 -0
- package/dist/vue/router/composables.d.ts +4 -0
- package/dist/vue/router/context.d.ts +4 -0
- package/dist/vue/router/router.d.ts +7 -0
- package/dist/vue/router/types.d.ts +29 -0
- package/dist/vue/scheduler/frame-mailbox.d.ts +55 -0
- package/dist/vue/scheduler/frame-scheduler.d.ts +51 -0
- package/dist/vue/utils/frame-task.d.ts +6 -0
- package/dist/vue/utils/rect.d.ts +4 -0
- package/dist/vue/utils/style-cache.d.ts +3 -0
- package/dist/vue/utils/text.d.ts +26 -0
- package/dist/vue/utils/wheel-scroll.d.ts +18 -0
- package/dist/vue.cjs +18882 -0
- package/dist/vue.d.cts +3 -0
- package/dist/vue.d.ts +3 -0
- package/dist/vue.js +3066 -0
- package/dist/wheel-scroll-B-WlFuNB.js +819 -0
- package/package.json +226 -58
- package/dist/path-suggest-DIMby3r0.js +0 -3
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from "vue";
|
|
2
|
+
import type { FsEntryKind } from "../../../../core/path-provider-types.js";
|
|
3
|
+
import type { PathPickMode, PathSuggestion } from "../../../../core/path-suggest.js";
|
|
4
|
+
import type { Terminal } from "../../../../core/types.js";
|
|
5
|
+
import type { Rect } from "../../../../events/manager/types.js";
|
|
6
|
+
export type PromptSuggestion = Readonly<{
|
|
7
|
+
value: string;
|
|
8
|
+
insert?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
detail?: string;
|
|
11
|
+
keywords?: readonly string[];
|
|
12
|
+
mentionValue?: string;
|
|
13
|
+
mentionBehavior?: "collect" | "inline";
|
|
14
|
+
onSelect?: (info: Readonly<{
|
|
15
|
+
value: string;
|
|
16
|
+
query: string;
|
|
17
|
+
}>) => void | boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export type MentionSuggestionProvider = (info: Readonly<{
|
|
20
|
+
query: string;
|
|
21
|
+
tokenText: string;
|
|
22
|
+
trigger: string;
|
|
23
|
+
workspace: string;
|
|
24
|
+
maxItems: number;
|
|
25
|
+
}>) => readonly PromptSuggestion[] | Promise<readonly PromptSuggestion[]>;
|
|
26
|
+
export type MentionPathProvider = Readonly<{
|
|
27
|
+
stat?: (absPath: string) => FsEntryKind | null | undefined | Promise<FsEntryKind | null | undefined>;
|
|
28
|
+
suggest?: (info: Readonly<{
|
|
29
|
+
workspaceAbs: string;
|
|
30
|
+
input: string;
|
|
31
|
+
mode: PathPickMode;
|
|
32
|
+
max: number;
|
|
33
|
+
showHidden: boolean;
|
|
34
|
+
maxDepth: number;
|
|
35
|
+
}>) => readonly PathSuggestion[] | Promise<readonly PathSuggestion[]>;
|
|
36
|
+
}>;
|
|
37
|
+
export type PromptContext = Readonly<{
|
|
38
|
+
tokenStart: number;
|
|
39
|
+
tokenEnd: number;
|
|
40
|
+
tokenText: string;
|
|
41
|
+
query: string;
|
|
42
|
+
key: string;
|
|
43
|
+
trigger: string;
|
|
44
|
+
}>;
|
|
45
|
+
type PromptMatch = Readonly<{
|
|
46
|
+
item: PromptSuggestion;
|
|
47
|
+
score: number;
|
|
48
|
+
order: number;
|
|
49
|
+
}>;
|
|
50
|
+
export declare function fuzzyScore(query: string, candidate: string): number | null;
|
|
51
|
+
export type UsePromptMentionStateOptions = Readonly<{
|
|
52
|
+
props: Readonly<{
|
|
53
|
+
promptSuggestions: readonly PromptSuggestion[];
|
|
54
|
+
promptTrigger: string;
|
|
55
|
+
promptTriggers?: readonly string[];
|
|
56
|
+
promptMaxItems: number;
|
|
57
|
+
promptAlign: "input" | "center";
|
|
58
|
+
mentionTrigger: string;
|
|
59
|
+
mentionWorkspace: string;
|
|
60
|
+
mentionMode: PathPickMode;
|
|
61
|
+
mentionShowHidden: boolean;
|
|
62
|
+
mentionSuggestions: readonly PromptSuggestion[];
|
|
63
|
+
mentionMaxItems: number;
|
|
64
|
+
mentions: readonly string[];
|
|
65
|
+
skillTrigger?: string;
|
|
66
|
+
skillSuggestions?: readonly PromptSuggestion[];
|
|
67
|
+
}>;
|
|
68
|
+
mentionSuggestionProviders?: readonly MentionSuggestionProvider[];
|
|
69
|
+
mentionPathProvider?: MentionPathProvider;
|
|
70
|
+
focused: Ref<boolean>;
|
|
71
|
+
cursor: Ref<number>;
|
|
72
|
+
getValue: () => string;
|
|
73
|
+
rawAbsRect: ComputedRef<Rect>;
|
|
74
|
+
terminal: Terminal;
|
|
75
|
+
scheduler: Readonly<{
|
|
76
|
+
invalidate: () => void;
|
|
77
|
+
}>;
|
|
78
|
+
multilineToken: string;
|
|
79
|
+
mentionToken: string;
|
|
80
|
+
}>;
|
|
81
|
+
export declare function usePromptMentionState(options: UsePromptMentionStateOptions): Readonly<{
|
|
82
|
+
promptActive: Ref<number>;
|
|
83
|
+
promptSuppressedKey: Ref<string | null>;
|
|
84
|
+
mentionKindByPath: Map<string, "file" | "directory" | "other">;
|
|
85
|
+
mentionKindVersion: Ref<number>;
|
|
86
|
+
promptContext: ComputedRef<PromptContext | null>;
|
|
87
|
+
mentionContext: ComputedRef<PromptContext | null>;
|
|
88
|
+
activeContext: ComputedRef<PromptContext | null>;
|
|
89
|
+
/** Full match list (not windowed). */
|
|
90
|
+
promptMatches: ComputedRef<readonly PromptMatch[]>;
|
|
91
|
+
/** Windowed list used for rendering and click mapping. */
|
|
92
|
+
promptMatchesVisible: ComputedRef<readonly PromptMatch[]>;
|
|
93
|
+
promptWindowStart: ComputedRef<number>;
|
|
94
|
+
promptActiveVisible: ComputedRef<number>;
|
|
95
|
+
promptVisible: ComputedRef<boolean>;
|
|
96
|
+
promptRect: ComputedRef<Rect>;
|
|
97
|
+
}>;
|
|
98
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TInputPlugin } from "./types.js";
|
|
2
|
+
export type TextRestrictionRule = Readonly<{
|
|
3
|
+
allowChars: RegExp;
|
|
4
|
+
} | {
|
|
5
|
+
denyChars: RegExp;
|
|
6
|
+
} | {
|
|
7
|
+
replace: Readonly<{
|
|
8
|
+
from: RegExp;
|
|
9
|
+
to: string;
|
|
10
|
+
}>;
|
|
11
|
+
} | {
|
|
12
|
+
allow: RegExp;
|
|
13
|
+
} | {
|
|
14
|
+
filter: (info: Readonly<{
|
|
15
|
+
text: string;
|
|
16
|
+
value: string;
|
|
17
|
+
cursor: number;
|
|
18
|
+
selection: null | Readonly<{
|
|
19
|
+
start: number;
|
|
20
|
+
end: number;
|
|
21
|
+
}>;
|
|
22
|
+
}>) => string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function createTextRestrictionPlugin(options: Readonly<{
|
|
25
|
+
name?: string;
|
|
26
|
+
rules: readonly TextRestrictionRule[];
|
|
27
|
+
}>): TInputPlugin;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from "vue";
|
|
2
|
+
import type { PathPickMode } from "../../../../core/path-suggest.js";
|
|
3
|
+
import type { TerminalRenderPlane } from "../../../../core/render-plane.js";
|
|
4
|
+
import type { Style, Terminal } from "../../../../core/types.js";
|
|
5
|
+
import type { Rect, TerminalKeyboardEvent } from "../../../../events/manager/types.js";
|
|
6
|
+
import type { TerminalScheduler } from "../../../context.js";
|
|
7
|
+
import type { TInputHostAdapter } from "../host.js";
|
|
8
|
+
export type PromptSuggestion = Readonly<{
|
|
9
|
+
value: string;
|
|
10
|
+
insert?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
detail?: string;
|
|
13
|
+
keywords?: readonly string[];
|
|
14
|
+
mentionValue?: string;
|
|
15
|
+
mentionBehavior?: "collect" | "inline";
|
|
16
|
+
onSelect?: (info: Readonly<{
|
|
17
|
+
value: string;
|
|
18
|
+
query: string;
|
|
19
|
+
}>) => void | boolean;
|
|
20
|
+
}>;
|
|
21
|
+
export type TInputPluginContext = Readonly<{
|
|
22
|
+
getProps: () => Readonly<{
|
|
23
|
+
zIndex: number;
|
|
24
|
+
style?: Style;
|
|
25
|
+
promptSuggestions: readonly PromptSuggestion[];
|
|
26
|
+
promptTrigger: string;
|
|
27
|
+
promptTriggers?: readonly string[];
|
|
28
|
+
promptMaxItems: number;
|
|
29
|
+
promptAlign: "input" | "center";
|
|
30
|
+
promptSelectedStyle?: Style;
|
|
31
|
+
promptPopupStyle?: Style;
|
|
32
|
+
promptPopupBorderStyle?: Style;
|
|
33
|
+
promptPopupMatchStyle?: Style;
|
|
34
|
+
mentionTrigger: string;
|
|
35
|
+
mentionWorkspace: string;
|
|
36
|
+
mentionMode: PathPickMode;
|
|
37
|
+
mentionShowHidden: boolean;
|
|
38
|
+
mentionSuggestions: readonly PromptSuggestion[];
|
|
39
|
+
mentionMaxItems: number;
|
|
40
|
+
mentionChipStyle?: Style;
|
|
41
|
+
collectMentions: boolean;
|
|
42
|
+
mentions: readonly string[];
|
|
43
|
+
skillTrigger?: string;
|
|
44
|
+
skillSuggestions?: readonly PromptSuggestion[];
|
|
45
|
+
}>;
|
|
46
|
+
emit: (event: string, ...args: any[]) => void;
|
|
47
|
+
terminal: Terminal;
|
|
48
|
+
scheduler: TerminalScheduler;
|
|
49
|
+
defaultStyle: Ref<Style>;
|
|
50
|
+
render: Readonly<{
|
|
51
|
+
rootStack: any;
|
|
52
|
+
createStack: (parent: any, z: number) => any;
|
|
53
|
+
invalidatePlane: (plane: TerminalRenderPlane) => void;
|
|
54
|
+
}>;
|
|
55
|
+
visible: Ref<boolean>;
|
|
56
|
+
rawAbsRect: ComputedRef<Rect>;
|
|
57
|
+
eventZ: ComputedRef<number>;
|
|
58
|
+
focused: Ref<boolean>;
|
|
59
|
+
cursor: Ref<number>;
|
|
60
|
+
getValue: () => string;
|
|
61
|
+
insertText: (text: string) => void;
|
|
62
|
+
pushUndoSnapshot: (nextValue: string) => void;
|
|
63
|
+
applyEdit: (nextValue: string, nextCursor: number) => void;
|
|
64
|
+
registerKeydownInterceptor: (fn: (e: TerminalKeyboardEvent) => boolean) => void;
|
|
65
|
+
registerTextFilter: (fn: (info: Readonly<{
|
|
66
|
+
text: string;
|
|
67
|
+
value: string;
|
|
68
|
+
cursor: number;
|
|
69
|
+
selection: null | Readonly<{
|
|
70
|
+
start: number;
|
|
71
|
+
end: number;
|
|
72
|
+
}>;
|
|
73
|
+
}>) => string) => void;
|
|
74
|
+
registerChipStyleProvider: (provider: Readonly<{
|
|
75
|
+
getStyle: (baseStyle: Style, chip: Readonly<{
|
|
76
|
+
kind: "multiline" | "mention";
|
|
77
|
+
absPath?: string;
|
|
78
|
+
}>) => Style | null | undefined;
|
|
79
|
+
version: Ref<number>;
|
|
80
|
+
}> | null) => void;
|
|
81
|
+
registerHostAdapter: (adapter: TInputHostAdapter | null) => void;
|
|
82
|
+
resolvePath: (input: string, opts?: Readonly<{
|
|
83
|
+
preserveBackslash?: boolean;
|
|
84
|
+
}>) => string;
|
|
85
|
+
mentionToken: string;
|
|
86
|
+
}>;
|
|
87
|
+
export type TInputPlugin = Readonly<{
|
|
88
|
+
name: string;
|
|
89
|
+
install: (ctx: TInputPluginContext) => void;
|
|
90
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { textCellWidth as baseTextCellWidth } from "../../../utils/text.js";
|
|
2
|
+
export declare const textCellWidth: typeof baseTextCellWidth;
|
|
3
|
+
export declare function padEndByCells(text: string, width: number): string;
|
|
4
|
+
export declare function sliceByCellsWindow(text: string, startCell: number, width: number): string;
|
|
5
|
+
export type LineInfo = Readonly<{
|
|
6
|
+
start: number;
|
|
7
|
+
end: number;
|
|
8
|
+
}>;
|
|
9
|
+
export type WrappedLineInfo = Readonly<{
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
}>;
|
|
13
|
+
export declare function computeLines(value: string): LineInfo[];
|
|
14
|
+
export declare function countMultilineTokens(value: string, multilineToken: string, endIndex?: number): number;
|
|
15
|
+
export declare function countMentionTokens(value: string, mentionToken: string, endIndex?: number): number;
|
|
16
|
+
export declare function tokenIndexAt(value: string, multilineToken: string, index: number): number;
|
|
17
|
+
export declare function mentionIndexAt(value: string, mentionToken: string, index: number): number;
|
|
18
|
+
export declare function textCellWidthInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, start: number, end: number): number;
|
|
19
|
+
export declare function wrapToLinesInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, width: number): WrappedLineInfo[];
|
|
20
|
+
export declare function wrapToLinesFirstWidthInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, firstWidth: number, width: number): WrappedLineInfo[];
|
|
21
|
+
export declare function indexToWrappedCellColFirstWidthInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, index: number, firstWidth: number, width: number): {
|
|
22
|
+
line: number;
|
|
23
|
+
col: number;
|
|
24
|
+
lines: WrappedLineInfo[];
|
|
25
|
+
};
|
|
26
|
+
export declare function indexToLineCellColInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, index: number): {
|
|
27
|
+
line: number;
|
|
28
|
+
col: number;
|
|
29
|
+
lines: LineInfo[];
|
|
30
|
+
};
|
|
31
|
+
export type InlineHit = Readonly<{
|
|
32
|
+
kind: "multiline" | "mention";
|
|
33
|
+
index: number;
|
|
34
|
+
}>;
|
|
35
|
+
export declare function lineCellColToIndexInline(value: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, col: number): {
|
|
36
|
+
index: number;
|
|
37
|
+
hit: InlineHit | null;
|
|
38
|
+
};
|
|
39
|
+
export type InlineChipRender = Readonly<{
|
|
40
|
+
startCell: number;
|
|
41
|
+
label: string;
|
|
42
|
+
kind: "multiline" | "mention";
|
|
43
|
+
index: number;
|
|
44
|
+
absPath?: string;
|
|
45
|
+
}>;
|
|
46
|
+
export declare function buildInlineRow(value: string, displayValue: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, rowTextW: number, offX: number): {
|
|
47
|
+
text: string;
|
|
48
|
+
chips: InlineChipRender[];
|
|
49
|
+
};
|
|
50
|
+
export type InlineSelectionSegment = Readonly<{
|
|
51
|
+
startCell: number;
|
|
52
|
+
text: string;
|
|
53
|
+
}>;
|
|
54
|
+
export declare function buildInlineSelectionSegments(value: string, displayValue: string, multilineToken: string, mentionToken: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, selection: Readonly<{
|
|
55
|
+
start: number;
|
|
56
|
+
end: number;
|
|
57
|
+
}>, rowTextW: number, offX: number): InlineSelectionSegment[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { InlineHit, LineInfo, WrappedLineInfo } from "./inlineText.js";
|
|
2
|
+
import { buildInlineRow as buildInlineRowCore, buildInlineSelectionSegments as buildInlineSelectionSegmentsCore } from "./inlineText.js";
|
|
3
|
+
export declare const MULTILINE_TOKEN = "\uFFFC";
|
|
4
|
+
export declare const MENTION_TOKEN = "\uFFF9";
|
|
5
|
+
export declare function isMultilineToken(value: string, index: number): boolean;
|
|
6
|
+
export declare function isMentionToken(value: string, index: number): boolean;
|
|
7
|
+
export declare function countMultilineTokens(value: string, endIndex?: number): number;
|
|
8
|
+
export declare function countMentionTokens(value: string, endIndex?: number): number;
|
|
9
|
+
export declare function tokenIndexAt(value: string, index: number): number;
|
|
10
|
+
export declare function mentionIndexAt(value: string, index: number): number;
|
|
11
|
+
export declare function wrapToLinesFirstWidthInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, firstWidth: number, width: number): WrappedLineInfo[];
|
|
12
|
+
export declare function indexToWrappedCellColFirstWidthInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, index: number, firstWidth: number, width: number): {
|
|
13
|
+
line: number;
|
|
14
|
+
col: number;
|
|
15
|
+
lines: WrappedLineInfo[];
|
|
16
|
+
};
|
|
17
|
+
export declare function indexToLineCellColInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, index: number): {
|
|
18
|
+
line: number;
|
|
19
|
+
col: number;
|
|
20
|
+
lines: LineInfo[];
|
|
21
|
+
};
|
|
22
|
+
export declare function lineCellColToIndexInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, col: number): {
|
|
23
|
+
index: number;
|
|
24
|
+
hit: InlineHit | null;
|
|
25
|
+
};
|
|
26
|
+
export declare function wrappedCellColToIndexInline(value: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, info: WrappedLineInfo, col: number): {
|
|
27
|
+
index: number;
|
|
28
|
+
hit: InlineHit | null;
|
|
29
|
+
};
|
|
30
|
+
export declare function buildInlineRow(value: string, displayValue: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, rowTextW: number, offX: number): ReturnType<typeof buildInlineRowCore>;
|
|
31
|
+
export declare function buildInlineSelectionSegments(value: string, displayValue: string, multilineTexts: readonly string[] | undefined, mentions: readonly string[] | undefined, lineStart: number, lineEnd: number, selection: Readonly<{
|
|
32
|
+
start: number;
|
|
33
|
+
end: number;
|
|
34
|
+
}>, rowTextW: number, offX: number): ReturnType<typeof buildInlineSelectionSegmentsCore>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Rect } from "../../../events/manager/types.js";
|
|
2
|
+
export type ListClipOffsets = Readonly<{
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
}>;
|
|
6
|
+
export type ListVisibleRange = Readonly<{
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
h: number;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function clipOffsets(full: Rect, clip: Rect): ListClipOffsets;
|
|
12
|
+
export declare function maxScrollTop(itemsLength: number, clipY: number, clipH: number): number;
|
|
13
|
+
export declare function maxScrollTopForClamp(fullH: number, clipH: number, itemsLength: number, clipY: number): number | null;
|
|
14
|
+
export declare function clampScrollTop(value: number, max: number | null): number;
|
|
15
|
+
export declare function visibleRange(scrollTop: number, itemsLength: number, full: Rect, clip: Rect): ListVisibleRange;
|
|
16
|
+
export declare function hasPaintableViewport(visible: boolean, rect: Rect): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatClippedInlineCellLine(raw: string, fullWidth: number, clipX: number, width: number): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type ScrollTopChange = Readonly<{
|
|
2
|
+
changed: boolean;
|
|
3
|
+
dirty: boolean;
|
|
4
|
+
top: number;
|
|
5
|
+
}>;
|
|
6
|
+
export type ActiveChange = Readonly<{
|
|
7
|
+
changedActive: boolean;
|
|
8
|
+
changedScroll: boolean;
|
|
9
|
+
dirty: boolean;
|
|
10
|
+
next: number;
|
|
11
|
+
}>;
|
|
12
|
+
export type SyncModelResult = Readonly<{
|
|
13
|
+
canceledPendingWheel: boolean;
|
|
14
|
+
reattached: boolean;
|
|
15
|
+
changedActive: boolean;
|
|
16
|
+
changedScroll: boolean;
|
|
17
|
+
dirty: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function getWheelScrollInput(e: {
|
|
20
|
+
deltaY?: number;
|
|
21
|
+
deltaMode?: number;
|
|
22
|
+
}): {
|
|
23
|
+
deltaY: number;
|
|
24
|
+
mode: "auto" | "line" | "pixel";
|
|
25
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ListVisibleRange } from "./list-geometry.js";
|
|
2
|
+
export declare function normalizeListIndex(value: unknown, itemsLength: number): number;
|
|
3
|
+
export declare function isActiveVisible(active: number, range: ListVisibleRange): boolean;
|
|
4
|
+
export declare function anchorActiveToViewport(active: number, itemsLength: number, range: ListVisibleRange, direction: -1 | 1): number;
|
|
5
|
+
export declare function pageAnchor(active: number, itemsLength: number, range: ListVisibleRange, direction: -1 | 1): number;
|
|
6
|
+
export declare function nearestVisibleActive(active: number, itemsLength: number, range: ListVisibleRange): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import type { TerminalRenderPlane } from "../../../core/render-plane.js";
|
|
3
|
+
import type { TerminalRuntimeHandle, TerminalSchedulerInvalidateOptions } from "../../context.js";
|
|
4
|
+
export interface Portal {
|
|
5
|
+
id: string;
|
|
6
|
+
component: Component;
|
|
7
|
+
plane: TerminalRenderPlane;
|
|
8
|
+
props: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createTerminalPortals(invalidate: (options?: TerminalSchedulerInvalidateOptions) => void): {
|
|
11
|
+
readonly portals: import("vue").ShallowReactive<Portal[]>;
|
|
12
|
+
readonly runtime: Readonly<{
|
|
13
|
+
mount: (component: Component, props: Record<string, unknown>, options?: Readonly<{
|
|
14
|
+
plane?: TerminalRenderPlane;
|
|
15
|
+
}>) => TerminalRuntimeHandle;
|
|
16
|
+
}>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ShallowRef } from "vue";
|
|
2
|
+
import type { Terminal } from "../../../core/types.js";
|
|
3
|
+
import type { FramePerfStore } from "../../../observability/frame-perf-store.js";
|
|
4
|
+
import type { TuiProfiler } from "../../../observability/tui-profiler.js";
|
|
5
|
+
import type { DomRenderer } from "../../../renderer/dom/dom-renderer.js";
|
|
6
|
+
import type { TerminalSchedulerInvalidateOptions } from "../../context.js";
|
|
7
|
+
import type { RenderManager } from "../../render/render-manager.js";
|
|
8
|
+
export declare function createTerminalProviderScheduler(options: {
|
|
9
|
+
terminal: Terminal;
|
|
10
|
+
renderer: ShallowRef<DomRenderer | null>;
|
|
11
|
+
render: RenderManager;
|
|
12
|
+
framePerf: FramePerfStore;
|
|
13
|
+
profiler: TuiProfiler | null;
|
|
14
|
+
isUnmounting: () => boolean;
|
|
15
|
+
afterFlush: () => void;
|
|
16
|
+
}): {
|
|
17
|
+
readonly api: Readonly<{
|
|
18
|
+
invalidate: (options?: TerminalSchedulerInvalidateOptions) => void;
|
|
19
|
+
flush: () => void;
|
|
20
|
+
flushNow: () => void;
|
|
21
|
+
configure: (options: import("../../context.js").TerminalSchedulerConfig) => void;
|
|
22
|
+
queueFrameTask: (task: import("../../context.js").TerminalFrameTask) => boolean | void;
|
|
23
|
+
cancelFrameTask?: (id: string) => boolean | void;
|
|
24
|
+
requestLive: (reason: string) => () => void;
|
|
25
|
+
dropLive: (reason: string) => void;
|
|
26
|
+
isInsideFrame: () => boolean;
|
|
27
|
+
}>;
|
|
28
|
+
readonly dispose: () => void;
|
|
29
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TerminalSelectionCopyPayload, TerminalSelectionOptions } from "../../../selection/terminal-selection.js";
|
|
2
|
+
import type { Style } from "../../../core/types.js";
|
|
3
|
+
export type ResolvedTerminalSelectionConfig = Readonly<{
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
autoCopy: boolean;
|
|
6
|
+
copyOnMouseUp: boolean;
|
|
7
|
+
style: Style;
|
|
8
|
+
toast: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export type TerminalProviderSelectionOptions = TerminalSelectionOptions & Readonly<{
|
|
11
|
+
toast?: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export type TerminalProviderSelectionConfig = boolean | TerminalProviderSelectionOptions;
|
|
14
|
+
export declare function resolveSelectionConfig(config: TerminalProviderSelectionConfig): ResolvedTerminalSelectionConfig;
|
|
15
|
+
export declare function selectionCopyToastText(payload: TerminalSelectionCopyPayload): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DomRendererOptions } from "../../../renderer/dom/dom-renderer.js";
|
|
2
|
+
export declare function isPlainObject(v: unknown): v is Record<string, unknown>;
|
|
3
|
+
export declare function shallowEqualRecord(a: Record<string, unknown>, b: Record<string, unknown>): boolean;
|
|
4
|
+
export declare function warnDev(message: string): void;
|
|
5
|
+
export declare function pickInitOnlyDomOptions(options: DomRendererOptions | undefined): Record<string, unknown>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
|
+
import type { TerminalSchedulerPriority } from "../context.js";
|
|
3
|
+
import type { RenderRect, RenderStack } from "../render/render-manager.js";
|
|
4
|
+
export interface RenderNodeOptions {
|
|
5
|
+
zIndex?: number;
|
|
6
|
+
stack?: RenderStack;
|
|
7
|
+
rect?: RenderRect | null;
|
|
8
|
+
/**
|
|
9
|
+
* One-shot absolute terminal rows for row-local content changes on this node's plane only.
|
|
10
|
+
* Omit this when geometry, z-order, style, data identity, or paint semantics changed.
|
|
11
|
+
*/
|
|
12
|
+
dirtyRowsHint?: readonly number[];
|
|
13
|
+
priority?: TerminalSchedulerPriority;
|
|
14
|
+
deps?: unknown;
|
|
15
|
+
paint: (dirtyRows?: readonly number[]) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function useRenderNode(getOptions: () => RenderNodeOptions): {
|
|
18
|
+
id: Ref<string | null>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function useTerminalRuntime(): Readonly<{
|
|
2
|
+
mount: (component: import("vue").Component, props: Record<string, unknown>, options?: Readonly<{
|
|
3
|
+
plane?: import("../../core.js").TerminalRenderPlane;
|
|
4
|
+
}>) => import("../context.js").TerminalRuntimeHandle;
|
|
5
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Ref } from "vue";
|
|
2
|
+
import type { Rect, TerminalEventHandlerMap } from "../../events/manager/types.js";
|
|
3
|
+
export interface TerminalNodeOptions {
|
|
4
|
+
rect: Rect;
|
|
5
|
+
zIndex?: number;
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
focusable?: boolean;
|
|
8
|
+
selectable?: boolean;
|
|
9
|
+
selectionScrollBy?: (deltaRows: number) => boolean | void;
|
|
10
|
+
handlers?: TerminalEventHandlerMap;
|
|
11
|
+
}
|
|
12
|
+
export declare function useTerminalNode(getOptions: () => TerminalNodeOptions): {
|
|
13
|
+
id: Ref<string | null>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ComputedRef, VNode } from "vue";
|
|
2
|
+
export type VisibilityRootProps = Readonly<{
|
|
3
|
+
style: Readonly<Record<string, string | number>>;
|
|
4
|
+
onVnodeBeforeMount: (vnode: VNode) => void;
|
|
5
|
+
onVnodeBeforeUnmount: (vnode: VNode) => void;
|
|
6
|
+
}>;
|
|
7
|
+
export declare function useVisibility(options?: {
|
|
8
|
+
provide?: boolean;
|
|
9
|
+
}): Readonly<{
|
|
10
|
+
visible: ComputedRef<boolean>;
|
|
11
|
+
rootProps: VisibilityRootProps;
|
|
12
|
+
}>;
|