@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.
Files changed (207) hide show
  1. package/README.md +222 -444
  2. package/dist/TSelect-BmSkar0D.js +8697 -0
  3. package/dist/ansi-palette-Bv5Vqr4k.js +1499 -0
  4. package/dist/ansi-styles.d.ts +200 -0
  5. package/dist/cli/headless-renderer.d.ts +29 -0
  6. package/dist/cli/input.d.ts +49 -0
  7. package/dist/cli/node-file-writers.d.ts +12 -0
  8. package/dist/cli/node-module.d.ts +2 -0
  9. package/dist/cli/parse-kitty.d.ts +2 -0
  10. package/dist/cli/parse-mouse.d.ts +2 -0
  11. package/dist/cli/parse-utils.d.ts +14 -0
  12. package/dist/cli/parse-xterm.d.ts +2 -0
  13. package/dist/cli/path-provider-types.d.ts +1 -0
  14. package/dist/cli/path-provider.d.ts +4 -0
  15. package/dist/cli/path-suggest-core.d.ts +1 -0
  16. package/dist/cli/path-suggest.d.ts +15 -0
  17. package/dist/cli/recording.d.ts +4 -0
  18. package/dist/cli/stdin-buffer.d.ts +33 -0
  19. package/dist/cli.cjs +10664 -0
  20. package/dist/cli.d.cts +22 -0
  21. package/dist/cli.d.ts +22 -0
  22. package/dist/cli.js +9521 -0
  23. package/dist/core/ansi/capability.d.ts +20 -0
  24. package/dist/core/ansi/colors.d.ts +41 -0
  25. package/dist/core/ansi/sgr.d.ts +7 -0
  26. package/dist/core/ansi/theme.d.ts +6 -0
  27. package/dist/core/ansi-palette.d.ts +14 -0
  28. package/dist/core/buffer/buffer.d.ts +54 -0
  29. package/dist/core/buffer/width.d.ts +4 -0
  30. package/dist/core/debug-logger.d.ts +18 -0
  31. package/dist/core/hyperlink.d.ts +9 -0
  32. package/dist/core/index.d.ts +4 -0
  33. package/dist/core/path-provider-types.d.ts +24 -0
  34. package/dist/core/path-suggest.d.ts +35 -0
  35. package/dist/core/render-plane.d.ts +3 -0
  36. package/dist/core/terminal/create-terminal.d.ts +7 -0
  37. package/dist/core/terminal/emitter.d.ts +7 -0
  38. package/dist/core/types.d.ts +107 -0
  39. package/dist/core.cjs +3072 -0
  40. package/dist/core.d.cts +14 -0
  41. package/dist/core.d.ts +14 -0
  42. package/dist/core.js +422 -0
  43. package/dist/create-terminal-app.d.ts +34 -0
  44. package/dist/dom-renderer-CDVQIcIL.js +1172 -0
  45. package/dist/events/index.d.ts +6 -0
  46. package/dist/events/manager/cli-event-manager.d.ts +22 -0
  47. package/dist/events/manager/event-manager.d.ts +30 -0
  48. package/dist/events/manager/selection-suppression.d.ts +3 -0
  49. package/dist/events/manager/types.d.ts +108 -0
  50. package/dist/events/recording.d.ts +44 -0
  51. package/dist/experimental.cjs +9380 -0
  52. package/dist/experimental.d.cts +39 -0
  53. package/dist/experimental.d.ts +39 -0
  54. package/dist/experimental.js +7624 -0
  55. package/dist/frame-perf-C-w8mjJL.js +98 -0
  56. package/dist/hyperlink-B5PD7a3Q.js +331 -0
  57. package/dist/index.cjs +12037 -16507
  58. package/dist/index.d.cts +13 -0
  59. package/dist/index.d.ts +13 -1353
  60. package/dist/index.js +13 -18738
  61. package/dist/markdown.cjs +21929 -0
  62. package/dist/markdown.d.cts +10 -0
  63. package/dist/markdown.d.ts +10 -0
  64. package/dist/markdown.js +1649 -0
  65. package/dist/observability/cli-latency-node.d.ts +3 -0
  66. package/dist/observability/cli-latency-types.d.ts +41 -0
  67. package/dist/observability/cli-latency.d.ts +3 -0
  68. package/dist/observability/frame-perf-store.d.ts +13 -0
  69. package/dist/observability/frame-perf.d.ts +40 -0
  70. package/dist/observability/trace.d.ts +40 -0
  71. package/dist/observability/tui-profiler.d.ts +33 -0
  72. package/dist/observability.cjs +99 -0
  73. package/dist/observability.d.cts +6 -0
  74. package/dist/observability.d.ts +6 -0
  75. package/dist/observability.js +3 -0
  76. package/dist/path-DDiSCXrQ.js +99 -0
  77. package/dist/path-suggest-0Q2BDsuj.js +274 -0
  78. package/dist/path-suggest-Dk9TRLh5.js +3 -0
  79. package/dist/{path-suggest-CZQYJIIg.js → path-suggest-bvR9SY6Q.js} +86 -18
  80. package/dist/renderer/capabilities.d.ts +13 -0
  81. package/dist/renderer/cli/index.d.ts +2 -0
  82. package/dist/renderer/cli/stdout-metrics.d.ts +18 -0
  83. package/dist/renderer/cli/stdout-renderer.d.ts +48 -0
  84. package/dist/renderer/dom/dom-renderer.d.ts +157 -0
  85. package/dist/renderer/dom/index.d.ts +2 -0
  86. package/dist/renderer/index.d.ts +2 -0
  87. package/dist/renderer-dom.cjs +1511 -0
  88. package/dist/renderer-dom.d.cts +4 -0
  89. package/dist/renderer-dom.d.ts +4 -0
  90. package/dist/renderer-dom.js +6 -0
  91. package/dist/runtime/index.d.ts +36 -0
  92. package/dist/runtime/osc52.d.ts +9 -0
  93. package/dist/runtime-DtrcQidD.js +1197 -0
  94. package/dist/runtime.cjs +1697 -0
  95. package/dist/runtime.d.cts +9 -0
  96. package/dist/runtime.d.ts +9 -0
  97. package/dist/runtime.js +4 -0
  98. package/dist/selection/terminal-selection.d.ts +122 -0
  99. package/dist/sgr-DMK2AvuT.js +304 -0
  100. package/dist/style-cache-i0ZABZRq.js +178 -0
  101. package/dist/terminal-selection-BCOh9jsL.js +329 -0
  102. package/dist/utils/env.d.ts +3 -0
  103. package/dist/utils/newlines.d.ts +1 -0
  104. package/dist/utils/path.d.ts +7 -0
  105. package/dist/utils/url-safety.d.ts +2 -0
  106. package/dist/vue/components/TAnchor.d.ts +108 -0
  107. package/dist/vue/components/TBox.d.ts +144 -0
  108. package/dist/vue/components/TDebugOverlay.d.ts +43 -0
  109. package/dist/vue/components/TDialog.d.ts +256 -0
  110. package/dist/vue/components/TFlow.d.ts +85 -0
  111. package/dist/vue/components/TInput.d.ts +554 -0
  112. package/dist/vue/components/TInputBox.d.ts +158 -0
  113. package/dist/vue/components/TJsonEditor.d.ts +165 -0
  114. package/dist/vue/components/TList.d.ts +119 -0
  115. package/dist/vue/components/TLogLinksPanel.d.ts +238 -0
  116. package/dist/vue/components/TLogMinimap.d.ts +263 -0
  117. package/dist/vue/components/TLogScrollbar.d.ts +236 -0
  118. package/dist/vue/components/TLogSearchBar.d.ts +267 -0
  119. package/dist/vue/components/TLogSearchPager.d.ts +162 -0
  120. package/dist/vue/components/TLogSearchResults.d.ts +200 -0
  121. package/dist/vue/components/TLogView.d.ts +502 -0
  122. package/dist/vue/components/TLogVirtualLinksPanel.d.ts +141 -0
  123. package/dist/vue/components/TLogVirtualSearchResults.d.ts +146 -0
  124. package/dist/vue/components/TMarkdownText.d.ts +134 -0
  125. package/dist/vue/components/TMultilineModal.d.ts +62 -0
  126. package/dist/vue/components/TPathPicker.d.ts +213 -0
  127. package/dist/vue/components/TRenderLayer.d.ts +16 -0
  128. package/dist/vue/components/TRenderPlane.d.ts +17 -0
  129. package/dist/vue/components/TSelect.d.ts +215 -0
  130. package/dist/vue/components/TText.d.ts +116 -0
  131. package/dist/vue/components/TTransition.d.ts +83 -0
  132. package/dist/vue/components/TView.d.ts +127 -0
  133. package/dist/vue/components/TVirtualList.d.ts +182 -0
  134. package/dist/vue/components/TVirtualMarkdown.d.ts +168 -0
  135. package/dist/vue/components/TerminalProvider.d.ts +195 -0
  136. package/dist/vue/components/input/host.d.ts +17 -0
  137. package/dist/vue/components/input/plugins/hostPlugin.d.ts +7 -0
  138. package/dist/vue/components/input/plugins/hostPlugin.node.d.ts +15 -0
  139. package/dist/vue/components/input/plugins/mentionUtils.d.ts +17 -0
  140. package/dist/vue/components/input/plugins/nodeMentionPathProvider.d.ts +2 -0
  141. package/dist/vue/components/input/plugins/promptMentionPlugin.d.ts +8 -0
  142. package/dist/vue/components/input/plugins/promptMentionState.d.ts +98 -0
  143. package/dist/vue/components/input/plugins/restrictText.d.ts +27 -0
  144. package/dist/vue/components/input/plugins/types.d.ts +90 -0
  145. package/dist/vue/components/input/utils/inlineText.d.ts +57 -0
  146. package/dist/vue/components/input/utils/inlineTextTokens.d.ts +34 -0
  147. package/dist/vue/components/input/utils/primitives.d.ts +3 -0
  148. package/dist/vue/components/input/utils/wordNavigation.d.ts +6 -0
  149. package/dist/vue/components/list/list-geometry.d.ts +16 -0
  150. package/dist/vue/components/list/list-paint.d.ts +1 -0
  151. package/dist/vue/components/list/scroll-state.d.ts +25 -0
  152. package/dist/vue/components/list/selection-state.d.ts +6 -0
  153. package/dist/vue/components/terminal-provider/copy-toast.d.ts +6 -0
  154. package/dist/vue/components/terminal-provider/portals.d.ts +17 -0
  155. package/dist/vue/components/terminal-provider/scheduler.d.ts +29 -0
  156. package/dist/vue/components/terminal-provider/selection-config.d.ts +15 -0
  157. package/dist/vue/components/terminal-provider/utils.d.ts +5 -0
  158. package/dist/vue/composables/use-layout.d.ts +2 -0
  159. package/dist/vue/composables/use-render-node.d.ts +19 -0
  160. package/dist/vue/composables/use-render-stack.d.ts +3 -0
  161. package/dist/vue/composables/use-runtime.d.ts +5 -0
  162. package/dist/vue/composables/use-terminal-node.d.ts +14 -0
  163. package/dist/vue/composables/use-terminal.d.ts +2 -0
  164. package/dist/vue/composables/use-visibility.d.ts +12 -0
  165. package/dist/vue/context.d.ts +153 -0
  166. package/dist/vue/index.d.ts +39 -0
  167. package/dist/vue/injection-key.d.ts +2 -0
  168. package/dist/vue/log/append-only-log-store.d.ts +2 -0
  169. package/dist/vue/log/tlog-keymap.d.ts +28 -0
  170. package/dist/vue/log/tlog-plugins.d.ts +144 -0
  171. package/dist/vue/log/tlog-session.d.ts +81 -0
  172. package/dist/vue/log/tlog-theme.d.ts +68 -0
  173. package/dist/vue/log/types.d.ts +43 -0
  174. package/dist/vue/log/use-tlog-link-controller.d.ts +31 -0
  175. package/dist/vue/log/use-tlog-retained-index.d.ts +26 -0
  176. package/dist/vue/log/use-tlog-search-controller.d.ts +51 -0
  177. package/dist/vue/log/use-tlog-search-results-page.d.ts +31 -0
  178. package/dist/vue/log/use-tlog-virtual-search-results.d.ts +22 -0
  179. package/dist/vue/markdown/ast.d.ts +3 -0
  180. package/dist/vue/markdown/block-source.d.ts +22 -0
  181. package/dist/vue/markdown/document.d.ts +18 -0
  182. package/dist/vue/markdown/layout.d.ts +16 -0
  183. package/dist/vue/markdown/parser.d.ts +11 -0
  184. package/dist/vue/markdown/render.d.ts +10 -0
  185. package/dist/vue/markdown/theme.d.ts +186 -0
  186. package/dist/vue/markdown/types.d.ts +47 -0
  187. package/dist/vue/render/context.d.ts +3 -0
  188. package/dist/vue/render/render-manager.d.ts +94 -0
  189. package/dist/vue/router/RouterView.d.ts +25 -0
  190. package/dist/vue/router/composables.d.ts +4 -0
  191. package/dist/vue/router/context.d.ts +4 -0
  192. package/dist/vue/router/router.d.ts +7 -0
  193. package/dist/vue/router/types.d.ts +29 -0
  194. package/dist/vue/scheduler/frame-mailbox.d.ts +55 -0
  195. package/dist/vue/scheduler/frame-scheduler.d.ts +51 -0
  196. package/dist/vue/utils/frame-task.d.ts +6 -0
  197. package/dist/vue/utils/rect.d.ts +4 -0
  198. package/dist/vue/utils/style-cache.d.ts +3 -0
  199. package/dist/vue/utils/text.d.ts +26 -0
  200. package/dist/vue/utils/wheel-scroll.d.ts +18 -0
  201. package/dist/vue.cjs +18882 -0
  202. package/dist/vue.d.cts +3 -0
  203. package/dist/vue.d.ts +3 -0
  204. package/dist/vue.js +3066 -0
  205. package/dist/wheel-scroll-B-WlFuNB.js +819 -0
  206. package/package.json +226 -58
  207. package/dist/path-suggest-DIMby3r0.js +0 -3
@@ -0,0 +1,51 @@
1
+ import type { Ref } from "vue";
2
+ import type { TLogSearchBarMode, TLogSearchBarState } from "../components/TLogSearchBar.js";
3
+ import type { TLogViewHandle, TLogViewScrollMetrics, TLogViewSearchMarker, TLogViewSearchState } from "../components/TLogView.js";
4
+ import type { UseTLogSearchResultsPageOptions } from "./use-tlog-search-results-page.js";
5
+ import { useTLogSearchResultsPage } from "./use-tlog-search-results-page.js";
6
+ export type TLogSavedSearch = Readonly<{
7
+ id: string;
8
+ label?: string;
9
+ query: string;
10
+ mode: TLogSearchBarMode;
11
+ caseSensitive?: boolean;
12
+ wholeWord?: boolean;
13
+ regexFlags?: string;
14
+ }>;
15
+ export type UseTLogSearchControllerOptions = Readonly<UseTLogSearchResultsPageOptions & {
16
+ initialQuery?: string;
17
+ initialMode?: TLogSearchBarMode;
18
+ initialCaseSensitive?: boolean;
19
+ initialWholeWord?: boolean;
20
+ initialRegexFlags?: string;
21
+ maxHistory?: number;
22
+ initialSavedSearches?: readonly TLogSavedSearch[];
23
+ }>;
24
+ export declare function useTLogSearchController(logView: Ref<TLogViewHandle | null>, options?: UseTLogSearchControllerOptions): {
25
+ query: Ref<string>;
26
+ mode: Ref<TLogSearchBarMode>;
27
+ caseSensitive: Ref<boolean>;
28
+ wholeWord: Ref<boolean>;
29
+ regexFlags: Ref<string>;
30
+ searchState: Ref<TLogViewSearchState>;
31
+ searchBarState: Ref<TLogSearchBarState>;
32
+ resultsPage: ReturnType<typeof useTLogSearchResultsPage>;
33
+ markers: Ref<readonly TLogViewSearchMarker[]>;
34
+ metrics: Ref<TLogViewScrollMetrics | null>;
35
+ searchHistory: Ref<readonly string[]>;
36
+ savedSearches: Ref<readonly TLogSavedSearch[]>;
37
+ updateQuery: (value: string) => void;
38
+ updateMode: (value: TLogSearchBarMode) => void;
39
+ updateCaseSensitive: (value: boolean) => void;
40
+ updateWholeWord: (value: boolean) => void;
41
+ updateRegexFlags: (value: string) => void;
42
+ nextMatch: () => void;
43
+ previousMatch: () => void;
44
+ clearSearch: () => void;
45
+ selectMatch: (matchIndex: number) => boolean;
46
+ refresh: () => void;
47
+ saveCurrentSearch: (label?: string) => TLogSavedSearch | null;
48
+ applySavedSearch: (id: string) => boolean;
49
+ setSearchHistory: (value: readonly string[]) => void;
50
+ setSavedSearches: (value: readonly TLogSavedSearch[]) => void;
51
+ };
@@ -0,0 +1,31 @@
1
+ import type { Ref } from "vue";
2
+ import type { TLogSearchResultItem } from "../components/TLogSearchResults.js";
3
+ import type { TLogViewHandle, TLogViewSearchError, TLogViewSearchState } from "../components/TLogView.js";
4
+ export type UseTLogSearchResultsPageOptions = Readonly<{
5
+ pageSize?: number;
6
+ includePreview?: boolean;
7
+ previewWidth?: number;
8
+ contextCells?: number;
9
+ }>;
10
+ export type TLogSearchResultsPageState = Readonly<{
11
+ page: number;
12
+ pageSize: number;
13
+ pageCount: number;
14
+ matchCount: number;
15
+ offset: number;
16
+ activeIndex: number;
17
+ currentMatchIndex: number;
18
+ status: TLogViewSearchState["status"];
19
+ error: TLogViewSearchError | null;
20
+ results: readonly TLogSearchResultItem[];
21
+ }>;
22
+ export declare function useTLogSearchResultsPage(logView: Ref<TLogViewHandle | null>, options?: UseTLogSearchResultsPageOptions): {
23
+ state: Ref<TLogSearchResultsPageState>;
24
+ refresh: () => void;
25
+ clear: (status?: TLogViewSearchState["status"], error?: TLogViewSearchError | null) => void;
26
+ setPage: (page: number) => void;
27
+ nextPage: () => void;
28
+ previousPage: () => void;
29
+ syncPageToCurrentMatch: () => void;
30
+ selectResult: (matchIndex: number) => boolean;
31
+ };
@@ -0,0 +1,22 @@
1
+ import type { Ref } from "vue";
2
+ import type { TLogSearchResultItem } from "../components/TLogSearchResults.js";
3
+ import type { TLogViewHandle, TLogViewSearchError, TLogViewSearchState } from "../components/TLogView.js";
4
+ export type UseTLogVirtualSearchResultsOptions = Readonly<{
5
+ includePreview?: boolean;
6
+ previewWidth?: number;
7
+ contextCells?: number;
8
+ }>;
9
+ export type TLogVirtualSearchResultsState = Readonly<{
10
+ itemCount: number;
11
+ itemVersion: number;
12
+ activeIndex: number;
13
+ currentMatchIndex: number;
14
+ status: TLogViewSearchState["status"];
15
+ error: TLogViewSearchError | null;
16
+ }>;
17
+ export declare function useTLogVirtualSearchResults(logView: Ref<TLogViewHandle | null>, options?: UseTLogVirtualSearchResultsOptions): {
18
+ state: Ref<TLogVirtualSearchResultsState>;
19
+ refresh: () => void;
20
+ getItem: (index: number) => TLogSearchResultItem | null;
21
+ select: (matchIndex: number) => boolean;
22
+ };
@@ -0,0 +1,3 @@
1
+ import { type TuiMarkdownTheme } from "./theme.js";
2
+ import type { TuiMarkdownBlock, TuiMarkdownNode } from "./types.js";
3
+ export declare function markdownAstToBlocks(nodes: readonly TuiMarkdownNode[], theme: TuiMarkdownTheme): readonly TuiMarkdownBlock[];
@@ -0,0 +1,22 @@
1
+ import { type TuiMarkdownParser } from "./parser.js";
2
+ import type { TuiMarkdownThemeOverrides } from "./theme.js";
3
+ import type { TuiMarkdownBlock } from "./types.js";
4
+ export type TuiMarkdownBlockSourceSnapshot = Readonly<{
5
+ version: number;
6
+ blocks: readonly TuiMarkdownBlock[];
7
+ }>;
8
+ export type TuiMarkdownBlockSource = Readonly<{
9
+ version: number;
10
+ blocks: readonly TuiMarkdownBlock[];
11
+ appendDelta: (text: string) => void;
12
+ replaceTailBlock: (text: string) => void;
13
+ finalizeBlock: () => void;
14
+ clear: () => void;
15
+ snapshot: () => TuiMarkdownBlockSourceSnapshot;
16
+ }>;
17
+ export type TuiMarkdownBlockSourceOptions = Readonly<{
18
+ parser?: TuiMarkdownParser;
19
+ customHtmlTags?: readonly string[];
20
+ theme?: TuiMarkdownThemeOverrides;
21
+ }>;
22
+ export declare function createMarkdownBlockSource(options?: TuiMarkdownBlockSourceOptions): TuiMarkdownBlockSource;
@@ -0,0 +1,18 @@
1
+ import { type TuiMarkdownParser } from "./parser.js";
2
+ import { type TuiMarkdownThemeOverrides } from "./theme.js";
3
+ import type { TuiMarkdownBlock, TuiMarkdownNode, TuiMarkdownVisualRow } from "./types.js";
4
+ /**
5
+ * This helper always builds visual rows from the full source string. Components
6
+ * that need streaming reuse can call buildMarkdownBlocks and cache block layout.
7
+ */
8
+ export declare function buildMarkdownBlocks(content: string, parser: TuiMarkdownParser, options?: Readonly<{
9
+ final?: boolean;
10
+ theme?: TuiMarkdownThemeOverrides;
11
+ }>): Readonly<{
12
+ nodes: readonly TuiMarkdownNode[];
13
+ blocks: readonly TuiMarkdownBlock[];
14
+ }>;
15
+ export declare function buildMarkdownVisualRows(content: string, width: number, parser: TuiMarkdownParser, options?: Readonly<{
16
+ final?: boolean;
17
+ theme?: TuiMarkdownThemeOverrides;
18
+ }>): readonly TuiMarkdownVisualRow[];
@@ -0,0 +1,16 @@
1
+ import type { TuiMarkdownBlock, TuiMarkdownVisualRow } from "./types.js";
2
+ export type TuiMarkdownLayoutCache = Readonly<{
3
+ width: number;
4
+ entries: ReadonlyMap<string, TuiMarkdownLayoutCacheEntry>;
5
+ }>;
6
+ type TuiMarkdownLayoutCacheEntry = Readonly<{
7
+ signature: string;
8
+ rows: readonly TuiMarkdownVisualRow[];
9
+ }>;
10
+ export declare function layoutMarkdownBlock(block: TuiMarkdownBlock, width: number): readonly TuiMarkdownVisualRow[];
11
+ export declare function layoutMarkdownBlocksCached(blocks: readonly TuiMarkdownBlock[], width: number, previous?: TuiMarkdownLayoutCache): Readonly<{
12
+ rows: readonly TuiMarkdownVisualRow[];
13
+ cache: TuiMarkdownLayoutCache;
14
+ }>;
15
+ export declare function layoutMarkdownBlocks(blocks: readonly TuiMarkdownBlock[], width: number): readonly TuiMarkdownVisualRow[];
16
+ export {};
@@ -0,0 +1,11 @@
1
+ import type { TuiMarkdownNode } from "./types.js";
2
+ export interface TuiMarkdownParseConfig {
3
+ streaming?: boolean;
4
+ customHtmlTags?: readonly string[];
5
+ }
6
+ export interface TuiMarkdownParser {
7
+ parse: (content: string, final: boolean) => TuiMarkdownNode[];
8
+ }
9
+ export declare function sanitizeMarkdownLink(url: string): string | null;
10
+ export declare function isSafeMarkdownLink(url: string): boolean;
11
+ export declare function createTuiMarkdownParser(config?: TuiMarkdownParseConfig): TuiMarkdownParser;
@@ -0,0 +1,10 @@
1
+ import type { Style, Terminal } from "../../core/types.js";
2
+ import type { TuiMarkdownVisualRow } from "./types.js";
3
+ export declare function paintMarkdownVisualRow(terminal: Terminal, row: TuiMarkdownVisualRow | undefined, options: Readonly<{
4
+ x: number;
5
+ y: number;
6
+ w: number;
7
+ clipStart?: number;
8
+ baseStyle: Style;
9
+ clear?: boolean;
10
+ }>): void;
@@ -0,0 +1,186 @@
1
+ import type { Style } from "../../core/types.js";
2
+ export type TuiMarkdownTheme = Readonly<{
3
+ heading: readonly [Style, Style, Style, Style, Style, Style];
4
+ strong: Style;
5
+ emphasis: Style;
6
+ strikethrough: Style;
7
+ inlineCode: Style;
8
+ link: Style;
9
+ blockquote: Style;
10
+ listMarker: Style;
11
+ codeBlock: Style;
12
+ thematicBreak: Style;
13
+ html: Style;
14
+ }>;
15
+ export type TuiMarkdownThemeOverrides = Readonly<Partial<{
16
+ heading: readonly Partial<Style>[];
17
+ strong: Partial<Style>;
18
+ emphasis: Partial<Style>;
19
+ strikethrough: Partial<Style>;
20
+ inlineCode: Partial<Style>;
21
+ link: Partial<Style>;
22
+ blockquote: Partial<Style>;
23
+ listMarker: Partial<Style>;
24
+ codeBlock: Partial<Style>;
25
+ thematicBreak: Partial<Style>;
26
+ html: Partial<Style>;
27
+ }>>;
28
+ export declare const DEFAULT_TUI_MARKDOWN_THEME: Readonly<{
29
+ heading: readonly [Readonly<{
30
+ fg?: string;
31
+ bg?: string;
32
+ bold?: boolean;
33
+ dim?: boolean;
34
+ italic?: boolean;
35
+ underline?: boolean;
36
+ inverse?: boolean;
37
+ href?: string;
38
+ }>, Readonly<{
39
+ fg?: string;
40
+ bg?: string;
41
+ bold?: boolean;
42
+ dim?: boolean;
43
+ italic?: boolean;
44
+ underline?: boolean;
45
+ inverse?: boolean;
46
+ href?: string;
47
+ }>, Readonly<{
48
+ fg?: string;
49
+ bg?: string;
50
+ bold?: boolean;
51
+ dim?: boolean;
52
+ italic?: boolean;
53
+ underline?: boolean;
54
+ inverse?: boolean;
55
+ href?: string;
56
+ }>, Readonly<{
57
+ fg?: string;
58
+ bg?: string;
59
+ bold?: boolean;
60
+ dim?: boolean;
61
+ italic?: boolean;
62
+ underline?: boolean;
63
+ inverse?: boolean;
64
+ href?: string;
65
+ }>, Readonly<{
66
+ fg?: string;
67
+ bg?: string;
68
+ bold?: boolean;
69
+ dim?: boolean;
70
+ italic?: boolean;
71
+ underline?: boolean;
72
+ inverse?: boolean;
73
+ href?: string;
74
+ }>, Readonly<{
75
+ fg?: string;
76
+ bg?: string;
77
+ bold?: boolean;
78
+ dim?: boolean;
79
+ italic?: boolean;
80
+ underline?: boolean;
81
+ inverse?: boolean;
82
+ href?: string;
83
+ }>];
84
+ strong: Readonly<{
85
+ fg?: string;
86
+ bg?: string;
87
+ bold?: boolean;
88
+ dim?: boolean;
89
+ italic?: boolean;
90
+ underline?: boolean;
91
+ inverse?: boolean;
92
+ href?: string;
93
+ }>;
94
+ emphasis: Readonly<{
95
+ fg?: string;
96
+ bg?: string;
97
+ bold?: boolean;
98
+ dim?: boolean;
99
+ italic?: boolean;
100
+ underline?: boolean;
101
+ inverse?: boolean;
102
+ href?: string;
103
+ }>;
104
+ strikethrough: Readonly<{
105
+ fg?: string;
106
+ bg?: string;
107
+ bold?: boolean;
108
+ dim?: boolean;
109
+ italic?: boolean;
110
+ underline?: boolean;
111
+ inverse?: boolean;
112
+ href?: string;
113
+ }>;
114
+ inlineCode: Readonly<{
115
+ fg?: string;
116
+ bg?: string;
117
+ bold?: boolean;
118
+ dim?: boolean;
119
+ italic?: boolean;
120
+ underline?: boolean;
121
+ inverse?: boolean;
122
+ href?: string;
123
+ }>;
124
+ link: Readonly<{
125
+ fg?: string;
126
+ bg?: string;
127
+ bold?: boolean;
128
+ dim?: boolean;
129
+ italic?: boolean;
130
+ underline?: boolean;
131
+ inverse?: boolean;
132
+ href?: string;
133
+ }>;
134
+ blockquote: Readonly<{
135
+ fg?: string;
136
+ bg?: string;
137
+ bold?: boolean;
138
+ dim?: boolean;
139
+ italic?: boolean;
140
+ underline?: boolean;
141
+ inverse?: boolean;
142
+ href?: string;
143
+ }>;
144
+ listMarker: Readonly<{
145
+ fg?: string;
146
+ bg?: string;
147
+ bold?: boolean;
148
+ dim?: boolean;
149
+ italic?: boolean;
150
+ underline?: boolean;
151
+ inverse?: boolean;
152
+ href?: string;
153
+ }>;
154
+ codeBlock: Readonly<{
155
+ fg?: string;
156
+ bg?: string;
157
+ bold?: boolean;
158
+ dim?: boolean;
159
+ italic?: boolean;
160
+ underline?: boolean;
161
+ inverse?: boolean;
162
+ href?: string;
163
+ }>;
164
+ thematicBreak: Readonly<{
165
+ fg?: string;
166
+ bg?: string;
167
+ bold?: boolean;
168
+ dim?: boolean;
169
+ italic?: boolean;
170
+ underline?: boolean;
171
+ inverse?: boolean;
172
+ href?: string;
173
+ }>;
174
+ html: Readonly<{
175
+ fg?: string;
176
+ bg?: string;
177
+ bold?: boolean;
178
+ dim?: boolean;
179
+ italic?: boolean;
180
+ underline?: boolean;
181
+ inverse?: boolean;
182
+ href?: string;
183
+ }>;
184
+ }>;
185
+ export declare function markdownThemeSignature(overrides?: TuiMarkdownThemeOverrides): string;
186
+ export declare function resolveTuiMarkdownTheme(overrides?: TuiMarkdownThemeOverrides): TuiMarkdownTheme;
@@ -0,0 +1,47 @@
1
+ import type { Style } from "../../core/types.js";
2
+ export type TuiMarkdownNode = Readonly<{
3
+ type: string;
4
+ raw?: string;
5
+ children?: readonly TuiMarkdownNode[];
6
+ [key: string]: unknown;
7
+ }>;
8
+ export type TuiMarkdownInlineSegment = Readonly<{
9
+ text: string;
10
+ style?: Style;
11
+ hardBreak?: boolean;
12
+ }>;
13
+ export type TuiMarkdownBlock = Readonly<{
14
+ type: "inline";
15
+ key: string;
16
+ segments: readonly TuiMarkdownInlineSegment[];
17
+ prefixSegments?: readonly TuiMarkdownInlineSegment[];
18
+ continuationPrefixSegments?: readonly TuiMarkdownInlineSegment[];
19
+ }> | Readonly<{
20
+ type: "code_block";
21
+ key: string;
22
+ lines: readonly string[];
23
+ style?: Style;
24
+ prefixSegments?: readonly TuiMarkdownInlineSegment[];
25
+ continuationPrefixSegments?: readonly TuiMarkdownInlineSegment[];
26
+ }> | Readonly<{
27
+ type: "thematic_break";
28
+ key: string;
29
+ char?: string;
30
+ style?: Style;
31
+ prefixSegments?: readonly TuiMarkdownInlineSegment[];
32
+ }> | Readonly<{
33
+ type: "blank";
34
+ key: string;
35
+ }>;
36
+ export type TuiMarkdownVisualSegment = Readonly<{
37
+ text: string;
38
+ style?: Style;
39
+ cells: number;
40
+ }>;
41
+ export type TuiMarkdownVisualRow = Readonly<{
42
+ key: string;
43
+ blockKey: string;
44
+ rowInBlock: number;
45
+ plainText: string;
46
+ segments: readonly TuiMarkdownVisualSegment[];
47
+ }>;
@@ -0,0 +1,3 @@
1
+ import type { InjectionKey, Ref } from "vue";
2
+ import type { RenderStack } from "./render-manager.js";
3
+ export declare const RenderStackKey: InjectionKey<Ref<RenderStack>>;
@@ -0,0 +1,94 @@
1
+ import type { TerminalRenderPlane, TerminalRenderPlanes } from "../../core/render-plane.js";
2
+ import type { Terminal } from "../../core/types.js";
3
+ import type { WidthProvider } from "../../core/buffer/width.js";
4
+ import { type CreateTuiProfilerOptions } from "../../observability/tui-profiler.js";
5
+ export type RenderRect = Readonly<{
6
+ x: number;
7
+ y: number;
8
+ w: number;
9
+ h: number;
10
+ }>;
11
+ export type RenderStack = Readonly<{
12
+ id: string;
13
+ parent: RenderStack | null;
14
+ zIndex: number;
15
+ order: number;
16
+ }>;
17
+ export type RenderNode = Readonly<{
18
+ id: string;
19
+ stack: RenderStack;
20
+ plane: TerminalRenderPlane;
21
+ zIndex: number;
22
+ order: number;
23
+ rect: RenderRect | null;
24
+ rectY0: number;
25
+ rectY1: number;
26
+ /**
27
+ * dirtyRows are absolute terminal rows for this node's plane.
28
+ * Components must ignore rows outside their rect.
29
+ */
30
+ paint: (dirtyRows?: readonly number[]) => void;
31
+ }>;
32
+ export type RenderManager = Readonly<{
33
+ rootStack: RenderStack;
34
+ createStack: (parent: RenderStack, zIndex: number) => RenderStack;
35
+ invalidatePlane: (plane: TerminalRenderPlane) => void;
36
+ /**
37
+ * Dangerous escape hatch: shifts whole terminal rows for the target plane, not a
38
+ * component-local region. Only call when the active renderer consumes terminal
39
+ * scrollOperations or when the caller repaints the whole affected viewport.
40
+ */
41
+ unsafeScrollPlaneRows: (plane: TerminalRenderPlane, startY: number, endY: number, delta: number) => void;
42
+ register: (node: {
43
+ stack: RenderStack;
44
+ plane?: TerminalRenderPlane;
45
+ zIndex?: number;
46
+ rect?: RenderRect | null;
47
+ paint: (dirtyRows?: readonly number[]) => void;
48
+ }) => RenderNode;
49
+ update: (id: string, next: Partial<{
50
+ stack: RenderStack;
51
+ plane: TerminalRenderPlane;
52
+ zIndex: number;
53
+ rect: RenderRect | null;
54
+ /**
55
+ * Consumed synchronously during update() and must not be retained.
56
+ * Callers may pass scratch arrays for hot-path invalidation.
57
+ * Rows are absolute terminal Y coordinates for the node's plane.
58
+ */
59
+ dirtyRowsHint: readonly number[];
60
+ paint: (dirtyRows?: readonly number[]) => void;
61
+ }>) => void;
62
+ /**
63
+ * Hot-path dirty row marker for stable nodes. Consumed synchronously and does
64
+ * not replace the RenderNode object.
65
+ *
66
+ * rows are absolute terminal Y coordinates, not local component row offsets.
67
+ * For rect-bound nodes, rows outside the node rect are ignored.
68
+ */
69
+ markDirtyRows: (id: string, rows: readonly number[]) => boolean;
70
+ unregister: (id: string) => void;
71
+ render: (options?: {
72
+ activePlanes?: TerminalRenderPlanes | null;
73
+ }) => RenderStats | null;
74
+ dispose: () => void;
75
+ }>;
76
+ export type CreateRenderManagerOptions = Readonly<{
77
+ profiler?: CreateTuiProfilerOptions;
78
+ widthProvider?: WidthProvider;
79
+ }>;
80
+ export type RowBucketFallback = Readonly<{
81
+ plane: TerminalRenderPlane;
82
+ reason: "dirty-ratio" | "candidate-ratio";
83
+ dirtyRows: number;
84
+ planeNodes: number;
85
+ candidates?: number;
86
+ }>;
87
+ export type RenderStats = Readonly<{
88
+ rows: number;
89
+ scannedNodes: number;
90
+ paintedNodes: number;
91
+ candidatePlanes: readonly TerminalRenderPlane[];
92
+ rowBucketFallbacks?: readonly RowBucketFallback[];
93
+ }>;
94
+ export declare function createRenderManager(terminal: Terminal, options?: CreateRenderManagerOptions): RenderManager;
@@ -0,0 +1,25 @@
1
+ import type { PropType } from "vue";
2
+ import type { TerminalRouteRecord } from "./types.js";
3
+ export declare const TRouterView: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ routes: {
5
+ type: PropType<TerminalRouteRecord[]>;
6
+ required: true;
7
+ };
8
+ forceRemount: {
9
+ type: BooleanConstructor;
10
+ default: boolean;
11
+ };
12
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
13
+ [key: string]: any;
14
+ }> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps), Readonly<import("vue").ExtractPropTypes<{
15
+ routes: {
16
+ type: PropType<TerminalRouteRecord[]>;
17
+ required: true;
18
+ };
19
+ forceRemount: {
20
+ type: BooleanConstructor;
21
+ default: boolean;
22
+ };
23
+ }>> & Readonly<{}>, {
24
+ forceRemount: boolean;
25
+ }, {}>;
@@ -0,0 +1,4 @@
1
+ import type { ComputedRef } from "vue";
2
+ import type { TerminalRoute, TerminalRouter } from "./types.js";
3
+ export declare function useRouter(): TerminalRouter;
4
+ export declare function useRoute(): ComputedRef<TerminalRoute>;
@@ -0,0 +1,4 @@
1
+ import type { InjectionKey, Ref } from "vue";
2
+ import type { TerminalRoute, TerminalRouter } from "./types.js";
3
+ export declare const TerminalRouterKey: InjectionKey<TerminalRouter>;
4
+ export declare const TerminalRouteKey: InjectionKey<Ref<TerminalRoute>>;
@@ -0,0 +1,7 @@
1
+ import type { Component } from "vue";
2
+ import type { TerminalRouteLocationRaw, TerminalRouter, TerminalRouteRecord } from "./types.js";
3
+ export declare function createTerminalRouter(options: Readonly<{
4
+ routes: readonly TerminalRouteRecord[];
5
+ initialRoute: TerminalRouteLocationRaw;
6
+ }>): TerminalRouter;
7
+ export declare function resolveTerminalRouteComponent(router: TerminalRouter, routes: readonly TerminalRouteRecord[]): Component | null;
@@ -0,0 +1,29 @@
1
+ import type { Component } from "vue";
2
+ export type TerminalRoute = Readonly<{
3
+ name: string;
4
+ params?: Readonly<Record<string, string>>;
5
+ meta?: unknown;
6
+ }>;
7
+ export type TerminalRouteRecord = Readonly<{
8
+ name: string;
9
+ component: Component;
10
+ meta?: unknown;
11
+ onEnter?: (to: TerminalRoute, from: TerminalRoute | null) => void | Promise<void>;
12
+ onLeave?: (to: TerminalRoute, from: TerminalRoute | null) => void | Promise<void>;
13
+ }>;
14
+ export type TerminalRouteLocationRaw = string | Readonly<{
15
+ name: string;
16
+ params?: Record<string, string>;
17
+ }>;
18
+ export type NavigationGuardReturn = void | boolean | TerminalRouteLocationRaw;
19
+ export type NavigationGuard = (to: TerminalRoute, from: TerminalRoute | null) => NavigationGuardReturn | Promise<NavigationGuardReturn>;
20
+ export type TerminalRouter = Readonly<{
21
+ currentRoute: import("vue").Ref<TerminalRoute>;
22
+ push: (to: TerminalRouteLocationRaw) => Promise<void>;
23
+ replace: (to: TerminalRouteLocationRaw) => Promise<void>;
24
+ back: () => Promise<void>;
25
+ beforeEach: (guard: NavigationGuard) => () => void;
26
+ beforeResolve: (guard: NavigationGuard) => () => void;
27
+ afterEach: (guard: (to: TerminalRoute, from: TerminalRoute | null) => void) => () => void;
28
+ install: (app: import("vue").App) => void;
29
+ }>;
@@ -0,0 +1,55 @@
1
+ import type { TerminalFrameContext, TerminalFrameTaskPriority, TerminalScheduler } from "../context.js";
2
+ import type { FramePerfReason } from "../../observability/frame-perf.js";
3
+ export type FrameMailboxApply<T> = (value: T, ctx: TerminalFrameContext, meta: {
4
+ queued: number;
5
+ dropped: number;
6
+ }) => void;
7
+ export type FrameMailboxOptions<T> = Readonly<{
8
+ scheduler: TerminalScheduler;
9
+ id: string | (() => string);
10
+ reason?: FramePerfReason;
11
+ priority?: TerminalFrameTaskPriority;
12
+ sync?: boolean;
13
+ merge?: (prev: T, next: T) => T;
14
+ apply: FrameMailboxApply<T>;
15
+ }>;
16
+ /**
17
+ * Coalesces many producer updates into a single scheduler frame task.
18
+ *
19
+ * This helper is currently internal to vue-tui. It is used by library
20
+ * components and internal tests, but it is not exported from the package root.
21
+ *
22
+ * Default behavior keeps only the latest queued value. If `merge` is provided,
23
+ * the pending value is updated with `merge(prev, next)`.
24
+ *
25
+ * Only the first queue() call in a pending cycle schedules a frame task.
26
+ * Later queue() calls update the pending payload and are reported as dropped
27
+ * producer updates when the frame task runs.
28
+ *
29
+ * droppedUpdates are reported after apply() succeeds. They only appear in
30
+ * framePerf when apply() also invalidates and produces a rendered frame sample.
31
+ * If apply() throws, scheduler error stats include mailbox queued/dropped
32
+ * metadata for the failed delivery attempt. The pending payload has already
33
+ * been cleared; mailbox delivery is fail-fast and does not retry stale payloads
34
+ * on later frames.
35
+ *
36
+ * cancel() is best-effort at scheduler level. The run callback still guards
37
+ * `disposed || !hasPending`, because a scheduler may already have taken a
38
+ * snapshot of tasks for the current frame.
39
+ *
40
+ * queue() returns false only when the scheduler explicitly rejects the task.
41
+ * Legacy void-returning schedulers are treated as accepted for compatibility.
42
+ * Owners should call dispose() before the component/scope that owns the
43
+ * mailbox is destroyed.
44
+ *
45
+ * id is scheduler-global. Components should include instance id and producer
46
+ * name, for example `TList:${uid}:wheel`.
47
+ */
48
+ export declare function createFrameMailbox<T>(options: FrameMailboxOptions<T>): {
49
+ readonly queue: (value: T) => boolean;
50
+ readonly replacePending: (value: T) => boolean;
51
+ readonly cancel: () => void;
52
+ readonly dispose: () => void;
53
+ readonly hasPending: () => boolean;
54
+ readonly peek: () => T | undefined;
55
+ };