@simon_he/vue-tui 1.0.1 → 1.1.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 (128) hide show
  1. package/README.md +139 -46
  2. package/dist/TMermaidText-frVr8Ysb.js +885 -0
  3. package/dist/{TSelect-HzILuti9.js → TSelect-tJ87rKPM.js} +59 -242
  4. package/dist/{TTree-ChOot2Bh.js → TTree-CGdE-CYu.js} +138 -102
  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 +31188 -24907
  10. package/dist/agent.d.cts +11 -1
  11. package/dist/agent.d.ts +11 -1
  12. package/dist/agent.js +516 -11
  13. package/dist/{block-source-CKUOnkgT.js → block-source-CrlmaBM5.js} +1039 -66
  14. package/dist/cli/input.d.ts +8 -0
  15. package/dist/cli/stdin-buffer.d.ts +1 -1
  16. package/dist/cli/video/ffmpeg-frame-source.d.ts +10 -0
  17. package/dist/cli/video/png-frame-parser.d.ts +4 -0
  18. package/dist/cli/video/raw-frame-parser.d.ts +1 -0
  19. package/dist/cli/video/yt-dlp-frame-source.d.ts +11 -0
  20. package/dist/cli.cjs +5470 -6176
  21. package/dist/cli.d.cts +6 -2
  22. package/dist/cli.d.ts +6 -2
  23. package/dist/cli.js +3747 -350
  24. package/dist/core/buffer/buffer.d.ts +2 -2
  25. package/dist/core/buffer/eaw-ranges-unicode-17.d.ts +14 -0
  26. package/dist/core/perf/instrumentation-noop.d.ts +48 -0
  27. package/dist/core/perf/instrumentation.d.ts +136 -0
  28. package/dist/core/terminal/create-terminal.d.ts +1 -0
  29. package/dist/core/types.d.ts +0 -4
  30. package/dist/core.cjs +851 -1462
  31. package/dist/core.js +4 -5
  32. package/dist/create-terminal-app.d.ts +24 -1
  33. package/dist/debug-logger-CmsGI4of.js +74 -0
  34. package/dist/{dom-renderer-BqGijQID.js → dom-renderer-DXx8fWzD.js} +2 -3
  35. package/dist/experimental/3d/bun/contributor-avatar-atlas.d.ts +12 -0
  36. package/dist/experimental/3d/bun/png.d.ts +1 -0
  37. package/dist/experimental/3d/bun/terminal-badge-scene.d.ts +11 -0
  38. package/dist/experimental/3d/bun/terminal-badge.wgsl.d.ts +1 -0
  39. package/dist/experimental/3d/bun/webgpu-renderer.d.ts +26 -0
  40. package/dist/experimental/3d/bun.cjs +7271 -0
  41. package/dist/experimental/3d/bun.d.cts +4 -0
  42. package/dist/experimental/3d/bun.d.ts +4 -0
  43. package/dist/experimental/3d/bun.js +7390 -0
  44. package/dist/experimental/video/node.cjs +497 -0
  45. package/dist/experimental/video/node.d.cts +4 -0
  46. package/dist/experimental/video/node.d.ts +4 -0
  47. package/dist/experimental/video/node.js +610 -0
  48. package/dist/experimental.cjs +6876 -6192
  49. package/dist/experimental.d.cts +7 -0
  50. package/dist/experimental.d.ts +7 -0
  51. package/dist/experimental.js +3005 -9
  52. package/dist/frame-perf-CHpWhbC4.js +111 -0
  53. package/dist/{create-terminal-C2oiWFJU.js → hyperlink-_1FAj7Wq.js} +455 -19
  54. package/dist/index.cjs +5025 -10332
  55. package/dist/index.js +14 -13
  56. package/dist/{linkify-D_gzn9Xq.js → linkify-D68T7rdW.js} +193 -3
  57. package/dist/markdown.cjs +21295 -12691
  58. package/dist/markdown.d.cts +1 -1
  59. package/dist/markdown.d.ts +1 -1
  60. package/dist/markdown.js +211 -51
  61. package/dist/mermaid-BNhM1jAZ.js +123 -0
  62. package/dist/mermaid.cjs +1707 -0
  63. package/dist/mermaid.d.cts +3 -0
  64. package/dist/mermaid.d.ts +3 -0
  65. package/dist/mermaid.js +6 -0
  66. package/dist/observability/frame-perf-store.d.ts +2 -1
  67. package/dist/observability/frame-perf.d.ts +33 -0
  68. package/dist/observability.cjs +106 -107
  69. package/dist/observability.d.cts +2 -2
  70. package/dist/observability.d.ts +2 -2
  71. package/dist/observability.js +3 -3
  72. package/dist/{wheel-scroll-vBRaQ7p-.js → rect-DUpeDfBg.js} +253 -117
  73. package/dist/renderer/cli/index.d.ts +1 -1
  74. package/dist/renderer/cli/stdout-metrics.d.ts +10 -0
  75. package/dist/renderer/cli/stdout-renderer.d.ts +53 -7
  76. package/dist/renderer/terminal-graphic-render-queue.d.ts +50 -0
  77. package/dist/renderer/terminal-graphics-trace.d.ts +53 -0
  78. package/dist/renderer/terminal-graphics.d.ts +147 -0
  79. package/dist/renderer-dom.cjs +364 -903
  80. package/dist/renderer-dom.js +4 -5
  81. package/dist/runtime/index.d.ts +2 -0
  82. package/dist/{runtime-rfcZCyJq.js → runtime-Byf8XXOT.js} +28 -15
  83. package/dist/runtime.cjs +427 -889
  84. package/dist/runtime.js +2 -2
  85. package/dist/terminal-graphics-Bbe83wSr.js +597 -0
  86. package/dist/{terminal-selection-DBinO6p5.js → terminal-selection-4W1SJj4c.js} +4 -1
  87. package/dist/{tlog-theme-CvLFNMwk.js → tlog-theme-Bul2Na3u.js} +1237 -12
  88. package/dist/{trace-CjzYeIxN.js → trace-Bh8WnoMo.js} +5 -0
  89. package/dist/vue/agent/create-png-terminal-graphic-renderer.d.ts +19 -0
  90. package/dist/vue/components/T3DViewport.d.ts +473 -0
  91. package/dist/vue/components/TAgentTerminalGraphic.d.ts +494 -0
  92. package/dist/vue/components/TCharts.d.ts +1121 -0
  93. package/dist/vue/components/TFeedback.d.ts +1 -1
  94. package/dist/vue/components/TFlex.d.ts +389 -0
  95. package/dist/vue/components/TForm.d.ts +4 -4
  96. package/dist/vue/components/TLogSearchBar.d.ts +3 -3
  97. package/dist/vue/components/TLogSearchPager.d.ts +2 -2
  98. package/dist/vue/components/TMarkdownText.d.ts +162 -4
  99. package/dist/vue/components/TMermaidText.d.ts +900 -0
  100. package/dist/vue/components/TVideo.d.ts +291 -0
  101. package/dist/vue/components/TVirtualList.d.ts +9 -0
  102. package/dist/vue/components/TVirtualMarkdown.d.ts +170 -9
  103. package/dist/vue/components/TVirtualRows.d.ts +9 -0
  104. package/dist/vue/components/TerminalProvider.d.ts +2 -0
  105. package/dist/vue/context.d.ts +24 -0
  106. package/dist/vue/index.d.ts +5 -0
  107. package/dist/vue/layout/flex.d.ts +67 -0
  108. package/dist/vue/markdown/ast.d.ts +5 -2
  109. package/dist/vue/markdown/document.d.ts +5 -0
  110. package/dist/vue/markdown/image-actions.d.ts +14 -0
  111. package/dist/vue/markdown/image.d.ts +11 -0
  112. package/dist/vue/markdown/link-actions.d.ts +14 -0
  113. package/dist/vue/markdown/math-actions.d.ts +14 -0
  114. package/dist/vue/markdown/math.d.ts +6 -0
  115. package/dist/vue/markdown/render.d.ts +28 -0
  116. package/dist/vue/markdown/types.d.ts +78 -0
  117. package/dist/vue/mermaid/beautiful-mermaid.d.ts +1436 -0
  118. package/dist/vue/render/render-manager.d.ts +7 -0
  119. package/dist/vue/video/types.d.ts +39 -0
  120. package/dist/vue.cjs +7215 -12430
  121. package/dist/vue.js +704 -38
  122. package/dist/wheel-scroll-DASkEZr-.js +106 -0
  123. package/dist/{hyperlink-Bn02UXJb.js → width-GqllnV8C.js} +166 -111
  124. package/package.json +141 -18
  125. package/dist/frame-perf-C6Xfg85O.js +0 -24
  126. package/dist/sgr-BmzxEjAO.js +0 -304
  127. /package/dist/{ansi-palette-CNXqFciC.js → ansi-palette-CH6jc2Z7.js} +0 -0
  128. /package/dist/{path-suggest-BNqcuE3-.js → path-suggest-Dndu4dTi.js} +0 -0
@@ -0,0 +1,67 @@
1
+ import type { Rect } from "../../events/manager/types.js";
2
+ export type TFlexDirection = "row" | "column";
3
+ export type TFlexAlign = "start" | "center" | "end" | "stretch";
4
+ export type TFlexJustify = "start" | "center" | "end" | "space-between";
5
+ export type TFlexAlignContent = "start" | "center" | "end" | "space-between" | "stretch";
6
+ export type TFlexSize = number | string;
7
+ export type TFlexMeasureConstraints = Readonly<{
8
+ maxWidth: number;
9
+ maxHeight: number;
10
+ direction: TFlexDirection;
11
+ }>;
12
+ export type TFlexMeasureResult = Readonly<{
13
+ width?: number;
14
+ height?: number;
15
+ w?: number;
16
+ h?: number;
17
+ }>;
18
+ export type TFlexMeasure = (constraints: TFlexMeasureConstraints) => TFlexMeasureResult;
19
+ export type TFlexItemSlotProps = Readonly<{
20
+ rect: Rect;
21
+ }>;
22
+ export type BoxEdges = Readonly<{
23
+ top: number;
24
+ right: number;
25
+ bottom: number;
26
+ left: number;
27
+ }>;
28
+ export type FlexLayoutInputItem = Readonly<{
29
+ grow: number;
30
+ shrink: number;
31
+ basis: TFlexSize | undefined;
32
+ width: TFlexSize | undefined;
33
+ height: TFlexSize | undefined;
34
+ minWidth: TFlexSize | undefined;
35
+ minHeight: TFlexSize | undefined;
36
+ maxWidth: TFlexSize | undefined;
37
+ maxHeight: TFlexSize | undefined;
38
+ measure: TFlexMeasure | undefined;
39
+ measureCache: Map<string, {
40
+ main: number | undefined;
41
+ cross: number | undefined;
42
+ }> | undefined;
43
+ marginTop: number;
44
+ marginRight: number;
45
+ marginBottom: number;
46
+ marginLeft: number;
47
+ alignSelf: TFlexAlign | undefined;
48
+ }>;
49
+ export type FlexLayoutItem<TItem extends FlexLayoutInputItem = FlexLayoutInputItem> = Readonly<{
50
+ item: TItem;
51
+ rect: Rect;
52
+ }>;
53
+ export declare function normalizeCellCount(value: unknown, fallback?: number): number;
54
+ export declare function normalizeOptionalCellCount(value: unknown): number | undefined;
55
+ export declare function normalizeRatio(value: unknown, fallback: number): number;
56
+ export declare function layoutFlexItems<TItem extends FlexLayoutInputItem>(items: readonly TItem[], options: Readonly<{
57
+ w: number;
58
+ h: number;
59
+ direction: TFlexDirection;
60
+ mainGap: number;
61
+ crossGap: number;
62
+ padding: BoxEdges;
63
+ alignItems: TFlexAlign;
64
+ justifyContent: TFlexJustify;
65
+ alignContent: TFlexAlignContent;
66
+ wrap: boolean;
67
+ }>): FlexLayoutItem<TItem>[];
@@ -1,3 +1,6 @@
1
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[];
2
+ import type { TuiMarkdownBlock, TuiMarkdownImageResolver, TuiMarkdownImageSize, TuiMarkdownNode } from "./types.js";
3
+ export declare function markdownAstToBlocks(nodes: readonly TuiMarkdownNode[], theme: TuiMarkdownTheme, options?: Readonly<{
4
+ imageResolver?: TuiMarkdownImageResolver;
5
+ imageSize?: TuiMarkdownImageSize;
6
+ }>): readonly TuiMarkdownBlock[];
@@ -1,3 +1,4 @@
1
+ import type { TuiMarkdownImageResolver, TuiMarkdownImageSize } from "./types.js";
1
2
  import { type TuiMarkdownParser } from "./parser.js";
2
3
  import { type TuiMarkdownThemeOverrides } from "./theme.js";
3
4
  import type { TuiMarkdownBlock, TuiMarkdownNode, TuiMarkdownVisualRow } from "./types.js";
@@ -9,6 +10,8 @@ import type { WidthProvider } from "../../core/buffer/width.js";
9
10
  export declare function buildMarkdownBlocks(content: string, parser: TuiMarkdownParser, options?: Readonly<{
10
11
  final?: boolean;
11
12
  theme?: TuiMarkdownThemeOverrides;
13
+ imageResolver?: TuiMarkdownImageResolver;
14
+ imageSize?: TuiMarkdownImageSize;
12
15
  }>): Readonly<{
13
16
  nodes: readonly TuiMarkdownNode[];
14
17
  blocks: readonly TuiMarkdownBlock[];
@@ -17,4 +20,6 @@ export declare function buildMarkdownVisualRows(content: string, width: number,
17
20
  final?: boolean;
18
21
  theme?: TuiMarkdownThemeOverrides;
19
22
  widthProvider?: WidthProvider;
23
+ imageResolver?: TuiMarkdownImageResolver;
24
+ imageSize?: TuiMarkdownImageSize;
20
25
  }>): readonly TuiMarkdownVisualRow[];
@@ -0,0 +1,14 @@
1
+ import type { TuiMarkdownImageActionPayload, TuiMarkdownVisualRow } from "./types.js";
2
+ export declare function findMarkdownImageActionAt(rows: readonly TuiMarkdownVisualRow[], point: Readonly<{
3
+ cellX: number;
4
+ cellY: number;
5
+ }>, options: Readonly<{
6
+ screenRect: Readonly<{
7
+ x: number;
8
+ y: number;
9
+ w: number;
10
+ h: number;
11
+ }>;
12
+ rowOffset: number;
13
+ clipStart: number;
14
+ }>): TuiMarkdownImageActionPayload | null;
@@ -0,0 +1,11 @@
1
+ export type TuiMarkdownImageSource = Readonly<{
2
+ src: string;
3
+ mime?: string;
4
+ base64?: string;
5
+ }>;
6
+ export type TuiMarkdownImageDimensions = Readonly<{
7
+ width: number;
8
+ height: number;
9
+ }>;
10
+ export declare function sanitizeMarkdownImageSource(src: unknown): TuiMarkdownImageSource | null;
11
+ export declare function readMarkdownImageDimensions(base64: string | undefined): TuiMarkdownImageDimensions | null;
@@ -0,0 +1,14 @@
1
+ import type { TuiMarkdownLinkActionPayload, TuiMarkdownVisualRow } from "./types.js";
2
+ export declare function findMarkdownLinkActionAt(rows: readonly TuiMarkdownVisualRow[], point: Readonly<{
3
+ cellX: number;
4
+ cellY: number;
5
+ }>, options: Readonly<{
6
+ screenRect: Readonly<{
7
+ x: number;
8
+ y: number;
9
+ w: number;
10
+ h: number;
11
+ }>;
12
+ rowOffset: number;
13
+ clipStart: number;
14
+ }>): TuiMarkdownLinkActionPayload | null;
@@ -0,0 +1,14 @@
1
+ import type { TuiMarkdownMathActionPayload, TuiMarkdownVisualRow } from "./types.js";
2
+ export declare function findMarkdownMathActionAt(rows: readonly TuiMarkdownVisualRow[], point: Readonly<{
3
+ cellX: number;
4
+ cellY: number;
5
+ }>, options: Readonly<{
6
+ screenRect: Readonly<{
7
+ x: number;
8
+ y: number;
9
+ w: number;
10
+ h: number;
11
+ }>;
12
+ rowOffset: number;
13
+ clipStart: number;
14
+ }>): TuiMarkdownMathActionPayload | null;
@@ -0,0 +1,6 @@
1
+ export type TuiMarkdownInlineMathRender = Readonly<{
2
+ text: string;
3
+ supported: boolean;
4
+ }>;
5
+ export declare function renderMarkdownInlineMathSegment(tex: string): TuiMarkdownInlineMathRender;
6
+ export declare function renderMarkdownInlineMath(tex: string): string;
@@ -1,5 +1,26 @@
1
1
  import type { Style, Terminal } from "../../core/types.js";
2
2
  import type { TuiMarkdownVisualRow } from "./types.js";
3
+ export declare function markdownImageGraphicId(segment: NonNullable<TuiMarkdownVisualRow["segments"][number]["graphic"]>, identity: string): string;
4
+ export declare function clearMarkdownImageGraphics(terminal: Terminal, rect?: Readonly<{
5
+ x: number;
6
+ y: number;
7
+ w: number;
8
+ h: number;
9
+ }>): void;
10
+ export declare function collectVisibleMarkdownImageGraphicIds(rows: readonly TuiMarkdownVisualRow[], options: Readonly<{
11
+ x: number;
12
+ y: number;
13
+ w: number;
14
+ h: number;
15
+ rowOffset: number;
16
+ clipStart: number;
17
+ isGraphicCovered?: (rect: Readonly<{
18
+ x: number;
19
+ y: number;
20
+ w: number;
21
+ h: number;
22
+ }>) => boolean;
23
+ }>): ReadonlySet<string>;
3
24
  export declare function paintMarkdownVisualRow(terminal: Terminal, row: TuiMarkdownVisualRow | undefined, options: Readonly<{
4
25
  x: number;
5
26
  y: number;
@@ -7,4 +28,11 @@ export declare function paintMarkdownVisualRow(terminal: Terminal, row: TuiMarkd
7
28
  clipStart?: number;
8
29
  baseStyle: Style;
9
30
  clear?: boolean;
31
+ keepGraphicIds?: ReadonlySet<string>;
32
+ isGraphicCovered?: (rect: Readonly<{
33
+ x: number;
34
+ y: number;
35
+ w: number;
36
+ h: number;
37
+ }>) => boolean;
10
38
  }>): void;
@@ -5,10 +5,84 @@ export type TuiMarkdownNode = Readonly<{
5
5
  children?: readonly TuiMarkdownNode[];
6
6
  [key: string]: unknown;
7
7
  }>;
8
+ export type TuiMarkdownImageSize = Readonly<{
9
+ minWidth?: number;
10
+ maxWidth?: number;
11
+ minHeight?: number;
12
+ maxHeight?: number;
13
+ preserveAspectRatio?: boolean;
14
+ }>;
15
+ export type TuiMarkdownGraphicSegment = Readonly<{
16
+ kind: "image";
17
+ src: string;
18
+ alt?: string;
19
+ mime?: string;
20
+ base64?: string;
21
+ originalBase64?: string;
22
+ originalMime?: string;
23
+ naturalWidth?: number;
24
+ naturalHeight?: number;
25
+ displayWidth?: number;
26
+ displayHeight?: number;
27
+ }>;
28
+ export type TuiMarkdownImageResolverResult = string | null | undefined | Readonly<{
29
+ base64: string;
30
+ originalBase64?: string;
31
+ mime?: string;
32
+ originalMime?: string;
33
+ }>;
34
+ export type TuiMarkdownImageResolver = (image: TuiMarkdownGraphicSegment) => TuiMarkdownImageResolverResult;
35
+ export type TuiMarkdownImageActionPayload = Readonly<{
36
+ image: TuiMarkdownGraphicSegment;
37
+ rect: Readonly<{
38
+ x: number;
39
+ y: number;
40
+ w: number;
41
+ h: number;
42
+ }>;
43
+ cellX: number;
44
+ cellY: number;
45
+ rowIndex: number;
46
+ segmentIndex: number;
47
+ }>;
48
+ export type TuiMarkdownLinkActionPayload = Readonly<{
49
+ href: string;
50
+ text: string;
51
+ rect: Readonly<{
52
+ x: number;
53
+ y: number;
54
+ w: number;
55
+ h: number;
56
+ }>;
57
+ cellX: number;
58
+ cellY: number;
59
+ rowIndex: number;
60
+ segmentIndex: number;
61
+ }>;
62
+ export type TuiMarkdownMathSegment = Readonly<{
63
+ source: string;
64
+ raw: string;
65
+ rendered: boolean;
66
+ }>;
67
+ export type TuiMarkdownMathActionPayload = Readonly<{
68
+ math: TuiMarkdownMathSegment;
69
+ rect: Readonly<{
70
+ x: number;
71
+ y: number;
72
+ w: number;
73
+ h: number;
74
+ }>;
75
+ cellX: number;
76
+ cellY: number;
77
+ rowIndex: number;
78
+ segmentIndex: number;
79
+ }>;
8
80
  export type TuiMarkdownInlineSegment = Readonly<{
9
81
  text: string;
10
82
  style?: Style;
11
83
  hardBreak?: boolean;
84
+ graphic?: TuiMarkdownGraphicSegment;
85
+ mathAction?: TuiMarkdownMathSegment;
12
86
  }>;
13
87
  export type TuiMarkdownTableCellAlign = "left" | "center" | "right";
14
88
  export type TuiMarkdownTableCell = Readonly<{
@@ -25,6 +99,7 @@ export type TuiMarkdownBlock = Readonly<{
25
99
  type: "code_block";
26
100
  key: string;
27
101
  lines: readonly string[];
102
+ language?: string;
28
103
  style?: Style;
29
104
  prefixSegments?: readonly TuiMarkdownInlineSegment[];
30
105
  continuationPrefixSegments?: readonly TuiMarkdownInlineSegment[];
@@ -49,6 +124,9 @@ export type TuiMarkdownVisualSegment = Readonly<{
49
124
  text: string;
50
125
  style?: Style;
51
126
  cells: number;
127
+ graphic?: TuiMarkdownGraphicSegment;
128
+ mathAction?: TuiMarkdownMathSegment;
129
+ fallbackText?: string;
52
130
  }>;
53
131
  export type TuiMarkdownVisualRow = Readonly<{
54
132
  key: string;