@chengchenccc/tui 0.1.1-rc.1

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 (226) hide show
  1. package/dist/autocomplete.d.ts +56 -0
  2. package/dist/autocomplete.d.ts.map +1 -0
  3. package/dist/autocomplete.js +647 -0
  4. package/dist/components/box.d.ts +22 -0
  5. package/dist/components/box.d.ts.map +1 -0
  6. package/dist/components/box.js +103 -0
  7. package/dist/components/card.d.ts +33 -0
  8. package/dist/components/card.d.ts.map +1 -0
  9. package/dist/components/card.js +49 -0
  10. package/dist/components/editor.d.ts +257 -0
  11. package/dist/components/editor.d.ts.map +1 -0
  12. package/dist/components/editor.js +1980 -0
  13. package/dist/components/input.d.ts +37 -0
  14. package/dist/components/input.d.ts.map +1 -0
  15. package/dist/components/input.js +389 -0
  16. package/dist/components/loader.d.ts +33 -0
  17. package/dist/components/loader.d.ts.map +1 -0
  18. package/dist/components/loader.js +100 -0
  19. package/dist/components/markdown.d.ts +108 -0
  20. package/dist/components/markdown.d.ts.map +1 -0
  21. package/dist/components/markdown.js +847 -0
  22. package/dist/components/markdown.test.d.ts +2 -0
  23. package/dist/components/markdown.test.d.ts.map +1 -0
  24. package/dist/components/markdown.test.js +81 -0
  25. package/dist/components/output-block.d.ts +44 -0
  26. package/dist/components/output-block.d.ts.map +1 -0
  27. package/dist/components/output-block.js +131 -0
  28. package/dist/components/select-list.d.ts +50 -0
  29. package/dist/components/select-list.d.ts.map +1 -0
  30. package/dist/components/select-list.js +166 -0
  31. package/dist/components/spacer.d.ts +12 -0
  32. package/dist/components/spacer.d.ts.map +1 -0
  33. package/dist/components/spacer.js +22 -0
  34. package/dist/components/statusline.d.ts +30 -0
  35. package/dist/components/statusline.d.ts.map +1 -0
  36. package/dist/components/statusline.js +46 -0
  37. package/dist/components/text.d.ts +19 -0
  38. package/dist/components/text.d.ts.map +1 -0
  39. package/dist/components/text.js +90 -0
  40. package/dist/components/truncated-text.d.ts +13 -0
  41. package/dist/components/truncated-text.d.ts.map +1 -0
  42. package/dist/components/truncated-text.js +50 -0
  43. package/dist/editor-component.d.ts +39 -0
  44. package/dist/editor-component.d.ts.map +1 -0
  45. package/dist/editor-component.js +1 -0
  46. package/dist/fuzzy.d.ts +16 -0
  47. package/dist/fuzzy.d.ts.map +1 -0
  48. package/dist/fuzzy.js +109 -0
  49. package/dist/index.d.ts +25 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +36 -0
  52. package/dist/keybindings.d.ts +193 -0
  53. package/dist/keybindings.d.ts.map +1 -0
  54. package/dist/keybindings.js +191 -0
  55. package/dist/keys.d.ts +184 -0
  56. package/dist/keys.d.ts.map +1 -0
  57. package/dist/keys.js +1191 -0
  58. package/dist/kill-ring.d.ts +28 -0
  59. package/dist/kill-ring.d.ts.map +1 -0
  60. package/dist/kill-ring.js +43 -0
  61. package/dist/mermaid.d.ts +23 -0
  62. package/dist/mermaid.d.ts.map +1 -0
  63. package/dist/mermaid.js +77 -0
  64. package/dist/mouse.d.ts +40 -0
  65. package/dist/mouse.d.ts.map +1 -0
  66. package/dist/mouse.js +39 -0
  67. package/dist/mouse.test.d.ts +2 -0
  68. package/dist/mouse.test.d.ts.map +1 -0
  69. package/dist/mouse.test.js +36 -0
  70. package/dist/native-modifiers.d.ts +3 -0
  71. package/dist/native-modifiers.d.ts.map +1 -0
  72. package/dist/native-modifiers.js +52 -0
  73. package/dist/stdin-buffer.d.ts +50 -0
  74. package/dist/stdin-buffer.d.ts.map +1 -0
  75. package/dist/stdin-buffer.js +360 -0
  76. package/dist/terminal-colors.d.ts +10 -0
  77. package/dist/terminal-colors.d.ts.map +1 -0
  78. package/dist/terminal-colors.js +58 -0
  79. package/dist/terminal-image.d.ts +90 -0
  80. package/dist/terminal-image.d.ts.map +1 -0
  81. package/dist/terminal-image.js +375 -0
  82. package/dist/terminal.d.ts +110 -0
  83. package/dist/terminal.d.ts.map +1 -0
  84. package/dist/terminal.js +432 -0
  85. package/dist/tui-scrollback.test.d.ts +2 -0
  86. package/dist/tui-scrollback.test.d.ts.map +1 -0
  87. package/dist/tui-scrollback.test.js +51 -0
  88. package/dist/tui.d.ts +330 -0
  89. package/dist/tui.d.ts.map +1 -0
  90. package/dist/tui.js +1568 -0
  91. package/dist/undo-stack.d.ts +17 -0
  92. package/dist/undo-stack.d.ts.map +1 -0
  93. package/dist/undo-stack.js +24 -0
  94. package/dist/utils.d.ts +85 -0
  95. package/dist/utils.d.ts.map +1 -0
  96. package/dist/utils.js +1066 -0
  97. package/dist/vendor/mermaid-ascii/ascii/ansi.d.ts +42 -0
  98. package/dist/vendor/mermaid-ascii/ascii/ansi.d.ts.map +1 -0
  99. package/dist/vendor/mermaid-ascii/ascii/ansi.js +361 -0
  100. package/dist/vendor/mermaid-ascii/ascii/canvas.d.ts +90 -0
  101. package/dist/vendor/mermaid-ascii/ascii/canvas.d.ts.map +1 -0
  102. package/dist/vendor/mermaid-ascii/ascii/canvas.js +414 -0
  103. package/dist/vendor/mermaid-ascii/ascii/class-diagram.d.ts +8 -0
  104. package/dist/vendor/mermaid-ascii/ascii/class-diagram.d.ts.map +1 -0
  105. package/dist/vendor/mermaid-ascii/ascii/class-diagram.js +623 -0
  106. package/dist/vendor/mermaid-ascii/ascii/converter.d.ts +13 -0
  107. package/dist/vendor/mermaid-ascii/ascii/converter.d.ts.map +1 -0
  108. package/dist/vendor/mermaid-ascii/ascii/converter.js +233 -0
  109. package/dist/vendor/mermaid-ascii/ascii/draw.d.ts +67 -0
  110. package/dist/vendor/mermaid-ascii/ascii/draw.d.ts.map +1 -0
  111. package/dist/vendor/mermaid-ascii/ascii/draw.js +1313 -0
  112. package/dist/vendor/mermaid-ascii/ascii/edge-bundling.d.ts +49 -0
  113. package/dist/vendor/mermaid-ascii/ascii/edge-bundling.d.ts.map +1 -0
  114. package/dist/vendor/mermaid-ascii/ascii/edge-bundling.js +289 -0
  115. package/dist/vendor/mermaid-ascii/ascii/edge-routing.d.ts +44 -0
  116. package/dist/vendor/mermaid-ascii/ascii/edge-routing.d.ts.map +1 -0
  117. package/dist/vendor/mermaid-ascii/ascii/edge-routing.js +302 -0
  118. package/dist/vendor/mermaid-ascii/ascii/er-diagram.d.ts +8 -0
  119. package/dist/vendor/mermaid-ascii/ascii/er-diagram.d.ts.map +1 -0
  120. package/dist/vendor/mermaid-ascii/ascii/er-diagram.js +380 -0
  121. package/dist/vendor/mermaid-ascii/ascii/grid.d.ts +57 -0
  122. package/dist/vendor/mermaid-ascii/ascii/grid.d.ts.map +1 -0
  123. package/dist/vendor/mermaid-ascii/ascii/grid.js +516 -0
  124. package/dist/vendor/mermaid-ascii/ascii/index.d.ts +66 -0
  125. package/dist/vendor/mermaid-ascii/ascii/index.d.ts.map +1 -0
  126. package/dist/vendor/mermaid-ascii/ascii/index.js +133 -0
  127. package/dist/vendor/mermaid-ascii/ascii/multiline-utils.d.ts +28 -0
  128. package/dist/vendor/mermaid-ascii/ascii/multiline-utils.d.ts.map +1 -0
  129. package/dist/vendor/mermaid-ascii/ascii/multiline-utils.js +60 -0
  130. package/dist/vendor/mermaid-ascii/ascii/pathfinder.d.ts +18 -0
  131. package/dist/vendor/mermaid-ascii/ascii/pathfinder.d.ts.map +1 -0
  132. package/dist/vendor/mermaid-ascii/ascii/pathfinder.js +224 -0
  133. package/dist/vendor/mermaid-ascii/ascii/sequence.d.ts +8 -0
  134. package/dist/vendor/mermaid-ascii/ascii/sequence.d.ts.map +1 -0
  135. package/dist/vendor/mermaid-ascii/ascii/sequence.js +416 -0
  136. package/dist/vendor/mermaid-ascii/ascii/shapes/circle.d.ts +12 -0
  137. package/dist/vendor/mermaid-ascii/ascii/shapes/circle.d.ts.map +1 -0
  138. package/dist/vendor/mermaid-ascii/ascii/shapes/circle.js +22 -0
  139. package/dist/vendor/mermaid-ascii/ascii/shapes/corners.d.ts +35 -0
  140. package/dist/vendor/mermaid-ascii/ascii/shapes/corners.d.ts.map +1 -0
  141. package/dist/vendor/mermaid-ascii/ascii/shapes/corners.js +91 -0
  142. package/dist/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts +12 -0
  143. package/dist/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts.map +1 -0
  144. package/dist/vendor/mermaid-ascii/ascii/shapes/diamond.js +22 -0
  145. package/dist/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts +12 -0
  146. package/dist/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts.map +1 -0
  147. package/dist/vendor/mermaid-ascii/ascii/shapes/hexagon.js +22 -0
  148. package/dist/vendor/mermaid-ascii/ascii/shapes/index.d.ts +27 -0
  149. package/dist/vendor/mermaid-ascii/ascii/shapes/index.d.ts.map +1 -0
  150. package/dist/vendor/mermaid-ascii/ascii/shapes/index.js +66 -0
  151. package/dist/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts +32 -0
  152. package/dist/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts.map +1 -0
  153. package/dist/vendor/mermaid-ascii/ascii/shapes/rectangle.js +149 -0
  154. package/dist/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts +12 -0
  155. package/dist/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts.map +1 -0
  156. package/dist/vendor/mermaid-ascii/ascii/shapes/rounded.js +22 -0
  157. package/dist/vendor/mermaid-ascii/ascii/shapes/special.d.ts +60 -0
  158. package/dist/vendor/mermaid-ascii/ascii/shapes/special.d.ts.map +1 -0
  159. package/dist/vendor/mermaid-ascii/ascii/shapes/special.js +253 -0
  160. package/dist/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts +18 -0
  161. package/dist/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts.map +1 -0
  162. package/dist/vendor/mermaid-ascii/ascii/shapes/stadium.js +103 -0
  163. package/dist/vendor/mermaid-ascii/ascii/shapes/state.d.ts +31 -0
  164. package/dist/vendor/mermaid-ascii/ascii/shapes/state.d.ts.map +1 -0
  165. package/dist/vendor/mermaid-ascii/ascii/shapes/state.js +167 -0
  166. package/dist/vendor/mermaid-ascii/ascii/shapes/types.d.ts +56 -0
  167. package/dist/vendor/mermaid-ascii/ascii/shapes/types.d.ts.map +1 -0
  168. package/dist/vendor/mermaid-ascii/ascii/shapes/types.js +4 -0
  169. package/dist/vendor/mermaid-ascii/ascii/types.d.ts +207 -0
  170. package/dist/vendor/mermaid-ascii/ascii/types.d.ts.map +1 -0
  171. package/dist/vendor/mermaid-ascii/ascii/types.js +39 -0
  172. package/dist/vendor/mermaid-ascii/ascii/validate.d.ts +52 -0
  173. package/dist/vendor/mermaid-ascii/ascii/validate.d.ts.map +1 -0
  174. package/dist/vendor/mermaid-ascii/ascii/validate.js +97 -0
  175. package/dist/vendor/mermaid-ascii/ascii/xychart.d.ts +3 -0
  176. package/dist/vendor/mermaid-ascii/ascii/xychart.d.ts.map +1 -0
  177. package/dist/vendor/mermaid-ascii/ascii/xychart.js +719 -0
  178. package/dist/vendor/mermaid-ascii/class/parser.d.ts +7 -0
  179. package/dist/vendor/mermaid-ascii/class/parser.d.ts.map +1 -0
  180. package/dist/vendor/mermaid-ascii/class/parser.js +265 -0
  181. package/dist/vendor/mermaid-ascii/class/types.d.ts +103 -0
  182. package/dist/vendor/mermaid-ascii/class/types.d.ts.map +1 -0
  183. package/dist/vendor/mermaid-ascii/class/types.js +7 -0
  184. package/dist/vendor/mermaid-ascii/er/parser.d.ts +7 -0
  185. package/dist/vendor/mermaid-ascii/er/parser.d.ts.map +1 -0
  186. package/dist/vendor/mermaid-ascii/er/parser.js +162 -0
  187. package/dist/vendor/mermaid-ascii/er/types.d.ts +77 -0
  188. package/dist/vendor/mermaid-ascii/er/types.d.ts.map +1 -0
  189. package/dist/vendor/mermaid-ascii/er/types.js +7 -0
  190. package/dist/vendor/mermaid-ascii/index.d.ts +2 -0
  191. package/dist/vendor/mermaid-ascii/index.d.ts.map +1 -0
  192. package/dist/vendor/mermaid-ascii/index.js +13 -0
  193. package/dist/vendor/mermaid-ascii/multiline-utils.d.ts +10 -0
  194. package/dist/vendor/mermaid-ascii/multiline-utils.d.ts.map +1 -0
  195. package/dist/vendor/mermaid-ascii/multiline-utils.js +29 -0
  196. package/dist/vendor/mermaid-ascii/parser.d.ts +8 -0
  197. package/dist/vendor/mermaid-ascii/parser.d.ts.map +1 -0
  198. package/dist/vendor/mermaid-ascii/parser.js +558 -0
  199. package/dist/vendor/mermaid-ascii/sequence/parser.d.ts +7 -0
  200. package/dist/vendor/mermaid-ascii/sequence/parser.d.ts.map +1 -0
  201. package/dist/vendor/mermaid-ascii/sequence/parser.js +182 -0
  202. package/dist/vendor/mermaid-ascii/sequence/types.d.ts +131 -0
  203. package/dist/vendor/mermaid-ascii/sequence/types.d.ts.map +1 -0
  204. package/dist/vendor/mermaid-ascii/sequence/types.js +7 -0
  205. package/dist/vendor/mermaid-ascii/text-metrics.d.ts +24 -0
  206. package/dist/vendor/mermaid-ascii/text-metrics.d.ts.map +1 -0
  207. package/dist/vendor/mermaid-ascii/text-metrics.js +69 -0
  208. package/dist/vendor/mermaid-ascii/types.d.ts +115 -0
  209. package/dist/vendor/mermaid-ascii/types.d.ts.map +1 -0
  210. package/dist/vendor/mermaid-ascii/types.js +4 -0
  211. package/dist/vendor/mermaid-ascii/xychart/colors.d.ts +26 -0
  212. package/dist/vendor/mermaid-ascii/xychart/colors.d.ts.map +1 -0
  213. package/dist/vendor/mermaid-ascii/xychart/colors.js +145 -0
  214. package/dist/vendor/mermaid-ascii/xychart/parser.d.ts +7 -0
  215. package/dist/vendor/mermaid-ascii/xychart/parser.d.ts.map +1 -0
  216. package/dist/vendor/mermaid-ascii/xychart/parser.js +105 -0
  217. package/dist/vendor/mermaid-ascii/xychart/types.d.ts +146 -0
  218. package/dist/vendor/mermaid-ascii/xychart/types.d.ts.map +1 -0
  219. package/dist/vendor/mermaid-ascii/xychart/types.js +8 -0
  220. package/dist/virtual-terminal.d.ts +80 -0
  221. package/dist/virtual-terminal.d.ts.map +1 -0
  222. package/dist/virtual-terminal.js +284 -0
  223. package/dist/word-navigation.d.ts +25 -0
  224. package/dist/word-navigation.d.ts.map +1 -0
  225. package/dist/word-navigation.js +97 -0
  226. package/package.json +38 -0
@@ -0,0 +1,37 @@
1
+ import { type Component, type Focusable } from "../tui.ts";
2
+ /**
3
+ * Input component - single-line text input with horizontal scrolling
4
+ */
5
+ export declare class Input implements Component, Focusable {
6
+ private value;
7
+ private cursor;
8
+ onSubmit?: (value: string) => void;
9
+ onEscape?: () => void;
10
+ /** Focusable interface - set by TUI when focus changes */
11
+ focused: boolean;
12
+ private pasteBuffer;
13
+ private isInPaste;
14
+ private killRing;
15
+ private lastAction;
16
+ private undoStack;
17
+ getValue(): string;
18
+ setValue(value: string): void;
19
+ handleInput(data: string): void;
20
+ private insertCharacter;
21
+ private handleBackspace;
22
+ private handleForwardDelete;
23
+ private deleteToLineStart;
24
+ private deleteToLineEnd;
25
+ private deleteWordBackwards;
26
+ private deleteWordForward;
27
+ private yank;
28
+ private yankPop;
29
+ private pushUndo;
30
+ private undo;
31
+ private moveWordBackwards;
32
+ private moveWordForwards;
33
+ private handlePaste;
34
+ invalidate(): void;
35
+ render(width: number): string[];
36
+ }
37
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAiB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAY1E;;GAEG;AACH,qBAAa,KAAM,YAAW,SAAS,EAAE,SAAS;IAChD,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,MAAM,CAAa;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAE7B,0DAA0D;IAC1D,OAAO,EAAE,OAAO,CAAS;IAGzB,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,SAAS,CAAkB;IAGnC,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,UAAU,CAA8C;IAGhE,OAAO,CAAC,SAAS,CAA+B;IAEhD,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAK7B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAqK/B,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,eAAe;IAcvB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,mBAAmB;IAqB3B,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,IAAI;IAWZ,OAAO,CAAC,OAAO;IAkBf,OAAO,CAAC,QAAQ;IAIhB,OAAO,CAAC,IAAI;IAQZ,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,WAAW;IAgBnB,UAAU,IAAI,IAAI;IAIlB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;CA0EhC"}
@@ -0,0 +1,389 @@
1
+ import { getKeybindings } from "../keybindings.js";
2
+ import { decodeKittyPrintable } from "../keys.js";
3
+ import { KillRing } from "../kill-ring.js";
4
+ import { CURSOR_MARKER } from "../tui.js";
5
+ import { UndoStack } from "../undo-stack.js";
6
+ import { getGraphemeSegmenter, isWhitespaceChar, sliceByColumn, visibleWidth } from "../utils.js";
7
+ import { findWordBackward, findWordForward } from "../word-navigation.js";
8
+ const segmenter = getGraphemeSegmenter();
9
+ /**
10
+ * Input component - single-line text input with horizontal scrolling
11
+ */
12
+ export class Input {
13
+ value = "";
14
+ cursor = 0; // Cursor position in the value
15
+ onSubmit;
16
+ onEscape;
17
+ /** Focusable interface - set by TUI when focus changes */
18
+ focused = false;
19
+ // Bracketed paste mode buffering
20
+ pasteBuffer = "";
21
+ isInPaste = false;
22
+ // Kill ring for Emacs-style kill/yank operations
23
+ killRing = new KillRing();
24
+ lastAction = null;
25
+ // Undo support
26
+ undoStack = new UndoStack();
27
+ getValue() {
28
+ return this.value;
29
+ }
30
+ setValue(value) {
31
+ this.value = value;
32
+ this.cursor = Math.min(this.cursor, value.length);
33
+ }
34
+ handleInput(data) {
35
+ // Handle bracketed paste mode
36
+ // Start of paste: \x1b[200~
37
+ // End of paste: \x1b[201~
38
+ // Check if we're starting a bracketed paste
39
+ if (data.includes("\x1b[200~")) {
40
+ this.isInPaste = true;
41
+ this.pasteBuffer = "";
42
+ data = data.replace("\x1b[200~", "");
43
+ }
44
+ // If we're in a paste, buffer the data
45
+ if (this.isInPaste) {
46
+ // Check if this chunk contains the end marker
47
+ this.pasteBuffer += data;
48
+ const endIndex = this.pasteBuffer.indexOf("\x1b[201~");
49
+ if (endIndex !== -1) {
50
+ // Extract the pasted content
51
+ const pasteContent = this.pasteBuffer.substring(0, endIndex);
52
+ // Process the complete paste
53
+ this.handlePaste(pasteContent);
54
+ // Reset paste state
55
+ this.isInPaste = false;
56
+ // Handle any remaining input after the paste marker
57
+ const remaining = this.pasteBuffer.substring(endIndex + 6); // 6 = length of \x1b[201~
58
+ this.pasteBuffer = "";
59
+ if (remaining) {
60
+ this.handleInput(remaining);
61
+ }
62
+ }
63
+ return;
64
+ }
65
+ const kb = getKeybindings();
66
+ // Escape/Cancel
67
+ if (kb.matches(data, "tui.select.cancel")) {
68
+ if (this.onEscape)
69
+ this.onEscape();
70
+ return;
71
+ }
72
+ // Undo
73
+ if (kb.matches(data, "tui.editor.undo")) {
74
+ this.undo();
75
+ return;
76
+ }
77
+ // Submit
78
+ if (kb.matches(data, "tui.input.submit") || data === "\n") {
79
+ if (this.onSubmit)
80
+ this.onSubmit(this.value);
81
+ return;
82
+ }
83
+ // Deletion
84
+ if (kb.matches(data, "tui.editor.deleteCharBackward")) {
85
+ this.handleBackspace();
86
+ return;
87
+ }
88
+ if (kb.matches(data, "tui.editor.deleteCharForward")) {
89
+ this.handleForwardDelete();
90
+ return;
91
+ }
92
+ if (kb.matches(data, "tui.editor.deleteWordBackward")) {
93
+ this.deleteWordBackwards();
94
+ return;
95
+ }
96
+ if (kb.matches(data, "tui.editor.deleteWordForward")) {
97
+ this.deleteWordForward();
98
+ return;
99
+ }
100
+ if (kb.matches(data, "tui.editor.deleteToLineStart")) {
101
+ this.deleteToLineStart();
102
+ return;
103
+ }
104
+ if (kb.matches(data, "tui.editor.deleteToLineEnd")) {
105
+ this.deleteToLineEnd();
106
+ return;
107
+ }
108
+ // Kill ring actions
109
+ if (kb.matches(data, "tui.editor.yank")) {
110
+ this.yank();
111
+ return;
112
+ }
113
+ if (kb.matches(data, "tui.editor.yankPop")) {
114
+ this.yankPop();
115
+ return;
116
+ }
117
+ // Cursor movement
118
+ if (kb.matches(data, "tui.editor.cursorLeft")) {
119
+ this.lastAction = null;
120
+ if (this.cursor > 0) {
121
+ const beforeCursor = this.value.slice(0, this.cursor);
122
+ const graphemes = [...segmenter.segment(beforeCursor)];
123
+ const lastGrapheme = graphemes[graphemes.length - 1];
124
+ this.cursor -= lastGrapheme ? lastGrapheme.segment.length : 1;
125
+ }
126
+ return;
127
+ }
128
+ if (kb.matches(data, "tui.editor.cursorRight")) {
129
+ this.lastAction = null;
130
+ if (this.cursor < this.value.length) {
131
+ const afterCursor = this.value.slice(this.cursor);
132
+ const graphemes = [...segmenter.segment(afterCursor)];
133
+ const firstGrapheme = graphemes[0];
134
+ this.cursor += firstGrapheme ? firstGrapheme.segment.length : 1;
135
+ }
136
+ return;
137
+ }
138
+ if (kb.matches(data, "tui.editor.cursorLineStart")) {
139
+ this.lastAction = null;
140
+ this.cursor = 0;
141
+ return;
142
+ }
143
+ if (kb.matches(data, "tui.editor.cursorLineEnd")) {
144
+ this.lastAction = null;
145
+ this.cursor = this.value.length;
146
+ return;
147
+ }
148
+ if (kb.matches(data, "tui.editor.cursorWordLeft")) {
149
+ this.moveWordBackwards();
150
+ return;
151
+ }
152
+ if (kb.matches(data, "tui.editor.cursorWordRight")) {
153
+ this.moveWordForwards();
154
+ return;
155
+ }
156
+ // Kitty CSI-u printable character (e.g. \x1b[97u for 'a').
157
+ // Terminals with Kitty protocol flag 1 (disambiguate) send CSI-u for all keys,
158
+ // including plain printable characters. Decode before the control-char check
159
+ // since CSI-u sequences contain \x1b which would be rejected.
160
+ const kittyPrintable = decodeKittyPrintable(data);
161
+ if (kittyPrintable !== undefined) {
162
+ this.insertCharacter(kittyPrintable);
163
+ return;
164
+ }
165
+ // Regular character input - accept printable characters including Unicode,
166
+ // but reject control characters (C0: 0x00-0x1F, DEL: 0x7F, C1: 0x80-0x9F)
167
+ const hasControlChars = [...data].some((ch) => {
168
+ const code = ch.charCodeAt(0);
169
+ return code < 32 || code === 0x7f || (code >= 0x80 && code <= 0x9f);
170
+ });
171
+ if (!hasControlChars) {
172
+ this.insertCharacter(data);
173
+ }
174
+ }
175
+ insertCharacter(char) {
176
+ // Undo coalescing: consecutive word chars coalesce into one undo unit
177
+ if (isWhitespaceChar(char) || this.lastAction !== "type-word") {
178
+ this.pushUndo();
179
+ }
180
+ this.lastAction = "type-word";
181
+ this.value = this.value.slice(0, this.cursor) + char + this.value.slice(this.cursor);
182
+ this.cursor += char.length;
183
+ }
184
+ handleBackspace() {
185
+ this.lastAction = null;
186
+ if (this.cursor > 0) {
187
+ this.pushUndo();
188
+ const beforeCursor = this.value.slice(0, this.cursor);
189
+ const graphemes = [...segmenter.segment(beforeCursor)];
190
+ const lastGrapheme = graphemes[graphemes.length - 1];
191
+ const graphemeLength = lastGrapheme ? lastGrapheme.segment.length : 1;
192
+ this.value =
193
+ this.value.slice(0, this.cursor - graphemeLength) + this.value.slice(this.cursor);
194
+ this.cursor -= graphemeLength;
195
+ }
196
+ }
197
+ handleForwardDelete() {
198
+ this.lastAction = null;
199
+ if (this.cursor < this.value.length) {
200
+ this.pushUndo();
201
+ const afterCursor = this.value.slice(this.cursor);
202
+ const graphemes = [...segmenter.segment(afterCursor)];
203
+ const firstGrapheme = graphemes[0];
204
+ const graphemeLength = firstGrapheme ? firstGrapheme.segment.length : 1;
205
+ this.value =
206
+ this.value.slice(0, this.cursor) + this.value.slice(this.cursor + graphemeLength);
207
+ }
208
+ }
209
+ deleteToLineStart() {
210
+ if (this.cursor === 0)
211
+ return;
212
+ this.pushUndo();
213
+ const deletedText = this.value.slice(0, this.cursor);
214
+ this.killRing.push(deletedText, {
215
+ prepend: true,
216
+ accumulate: this.lastAction === "kill",
217
+ });
218
+ this.lastAction = "kill";
219
+ this.value = this.value.slice(this.cursor);
220
+ this.cursor = 0;
221
+ }
222
+ deleteToLineEnd() {
223
+ if (this.cursor >= this.value.length)
224
+ return;
225
+ this.pushUndo();
226
+ const deletedText = this.value.slice(this.cursor);
227
+ this.killRing.push(deletedText, {
228
+ prepend: false,
229
+ accumulate: this.lastAction === "kill",
230
+ });
231
+ this.lastAction = "kill";
232
+ this.value = this.value.slice(0, this.cursor);
233
+ }
234
+ deleteWordBackwards() {
235
+ if (this.cursor === 0)
236
+ return;
237
+ // Save lastAction before cursor movement (moveWordBackwards resets it)
238
+ const wasKill = this.lastAction === "kill";
239
+ this.pushUndo();
240
+ const oldCursor = this.cursor;
241
+ this.moveWordBackwards();
242
+ const deleteFrom = this.cursor;
243
+ this.cursor = oldCursor;
244
+ const deletedText = this.value.slice(deleteFrom, this.cursor);
245
+ this.killRing.push(deletedText, { prepend: true, accumulate: wasKill });
246
+ this.lastAction = "kill";
247
+ this.value = this.value.slice(0, deleteFrom) + this.value.slice(this.cursor);
248
+ this.cursor = deleteFrom;
249
+ }
250
+ deleteWordForward() {
251
+ if (this.cursor >= this.value.length)
252
+ return;
253
+ // Save lastAction before cursor movement (moveWordForwards resets it)
254
+ const wasKill = this.lastAction === "kill";
255
+ this.pushUndo();
256
+ const oldCursor = this.cursor;
257
+ this.moveWordForwards();
258
+ const deleteTo = this.cursor;
259
+ this.cursor = oldCursor;
260
+ const deletedText = this.value.slice(this.cursor, deleteTo);
261
+ this.killRing.push(deletedText, { prepend: false, accumulate: wasKill });
262
+ this.lastAction = "kill";
263
+ this.value = this.value.slice(0, this.cursor) + this.value.slice(deleteTo);
264
+ }
265
+ yank() {
266
+ const text = this.killRing.peek();
267
+ if (!text)
268
+ return;
269
+ this.pushUndo();
270
+ this.value = this.value.slice(0, this.cursor) + text + this.value.slice(this.cursor);
271
+ this.cursor += text.length;
272
+ this.lastAction = "yank";
273
+ }
274
+ yankPop() {
275
+ if (this.lastAction !== "yank" || this.killRing.length <= 1)
276
+ return;
277
+ this.pushUndo();
278
+ // Delete the previously yanked text (still at end of ring before rotation)
279
+ const prevText = this.killRing.peek() || "";
280
+ this.value = this.value.slice(0, this.cursor - prevText.length) + this.value.slice(this.cursor);
281
+ this.cursor -= prevText.length;
282
+ // Rotate and insert new entry
283
+ this.killRing.rotate();
284
+ const text = this.killRing.peek() || "";
285
+ this.value = this.value.slice(0, this.cursor) + text + this.value.slice(this.cursor);
286
+ this.cursor += text.length;
287
+ this.lastAction = "yank";
288
+ }
289
+ pushUndo() {
290
+ this.undoStack.push({ value: this.value, cursor: this.cursor });
291
+ }
292
+ undo() {
293
+ const snapshot = this.undoStack.pop();
294
+ if (!snapshot)
295
+ return;
296
+ this.value = snapshot.value;
297
+ this.cursor = snapshot.cursor;
298
+ this.lastAction = null;
299
+ }
300
+ moveWordBackwards() {
301
+ if (this.cursor === 0)
302
+ return;
303
+ this.lastAction = null;
304
+ this.cursor = findWordBackward(this.value, this.cursor);
305
+ }
306
+ moveWordForwards() {
307
+ if (this.cursor >= this.value.length)
308
+ return;
309
+ this.lastAction = null;
310
+ this.cursor = findWordForward(this.value, this.cursor);
311
+ }
312
+ handlePaste(pastedText) {
313
+ this.lastAction = null;
314
+ this.pushUndo();
315
+ // Clean the pasted text - remove newlines and carriage returns
316
+ const cleanText = pastedText
317
+ .replace(/\r\n/g, "")
318
+ .replace(/\r/g, "")
319
+ .replace(/\n/g, "")
320
+ .replace(/\t/g, " ");
321
+ // Insert at cursor position
322
+ this.value = this.value.slice(0, this.cursor) + cleanText + this.value.slice(this.cursor);
323
+ this.cursor += cleanText.length;
324
+ }
325
+ invalidate() {
326
+ // No cached state to invalidate currently
327
+ }
328
+ render(width) {
329
+ // Calculate visible window
330
+ const prompt = "> ";
331
+ const availableWidth = width - prompt.length;
332
+ if (availableWidth <= 0) {
333
+ return [prompt];
334
+ }
335
+ let visibleText = "";
336
+ let cursorDisplay = this.cursor;
337
+ const totalWidth = visibleWidth(this.value);
338
+ if (totalWidth < availableWidth) {
339
+ // Everything fits (leave room for cursor at end)
340
+ visibleText = this.value;
341
+ }
342
+ else {
343
+ // Need horizontal scrolling
344
+ // Reserve one column for cursor if it's at the end
345
+ const scrollWidth = this.cursor === this.value.length ? availableWidth - 1 : availableWidth;
346
+ const cursorCol = visibleWidth(this.value.slice(0, this.cursor));
347
+ if (scrollWidth > 0) {
348
+ const halfWidth = Math.floor(scrollWidth / 2);
349
+ let startCol = 0;
350
+ if (cursorCol < halfWidth) {
351
+ // Cursor near start
352
+ startCol = 0;
353
+ }
354
+ else if (cursorCol > totalWidth - halfWidth) {
355
+ // Cursor near end
356
+ startCol = Math.max(0, totalWidth - scrollWidth);
357
+ }
358
+ else {
359
+ // Cursor in middle
360
+ startCol = Math.max(0, cursorCol - halfWidth);
361
+ }
362
+ visibleText = sliceByColumn(this.value, startCol, scrollWidth, true);
363
+ const beforeCursor = sliceByColumn(this.value, startCol, Math.max(0, cursorCol - startCol), true);
364
+ cursorDisplay = beforeCursor.length;
365
+ }
366
+ else {
367
+ visibleText = "";
368
+ cursorDisplay = 0;
369
+ }
370
+ }
371
+ // Build line with fake cursor
372
+ // Insert cursor character at cursor position
373
+ const graphemes = [...segmenter.segment(visibleText.slice(cursorDisplay))];
374
+ const cursorGrapheme = graphemes[0];
375
+ const beforeCursor = visibleText.slice(0, cursorDisplay);
376
+ const atCursor = cursorGrapheme?.segment ?? " "; // Character at cursor, or space if at end
377
+ const afterCursor = visibleText.slice(cursorDisplay + atCursor.length);
378
+ // Hardware cursor marker (zero-width, emitted before fake cursor for IME positioning)
379
+ const marker = this.focused ? CURSOR_MARKER : "";
380
+ // Use inverse video to show cursor
381
+ const cursorChar = `\x1b[7m${atCursor}\x1b[27m`; // ESC[7m = reverse video, ESC[27m = normal
382
+ const textWithCursor = beforeCursor + marker + cursorChar + afterCursor;
383
+ // Calculate visual width
384
+ const visualLength = visibleWidth(textWithCursor);
385
+ const padding = " ".repeat(Math.max(0, availableWidth - visualLength));
386
+ const line = prompt + textWithCursor + padding;
387
+ return [line];
388
+ }
389
+ }
@@ -0,0 +1,33 @@
1
+ import type { TUI } from "../tui.ts";
2
+ import { Text } from "./text.ts";
3
+ export interface LoaderIndicatorOptions {
4
+ /** Animation frames. Use an empty array to hide the indicator. */
5
+ frames?: string[];
6
+ /** Frame interval in milliseconds for animated indicators. */
7
+ intervalMs?: number;
8
+ }
9
+ /**
10
+ * Loader component that updates with an optional spinning animation.
11
+ */
12
+ export declare class Loader extends Text {
13
+ private frames;
14
+ private intervalMs;
15
+ private currentFrame;
16
+ private intervalId;
17
+ private ui;
18
+ private renderIndicatorVerbatim;
19
+ private spinnerColorFn;
20
+ private messageColorFn;
21
+ private message;
22
+ constructor(ui: TUI, spinnerColorFn: (str: string) => string, messageColorFn: (str: string) => string, message?: string, indicator?: LoaderIndicatorOptions);
23
+ render(width: number): string[];
24
+ start(): void;
25
+ stop(): void;
26
+ setMessage(message: string): void;
27
+ setIndicator(indicator?: LoaderIndicatorOptions): void;
28
+ private restartAnimation;
29
+ /** Moving light sweep across the message (omp shimmer-lite). */
30
+ private animateMessage;
31
+ private updateDisplay;
32
+ }
33
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/components/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,WAAW,sBAAsB;IACrC,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAKD;;GAEG;AACH,qBAAa,MAAO,SAAQ,IAAI;IAC9B,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,EAAE,CAAoB;IAC9B,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,cAAc,CAA0B;IAChD,OAAO,CAAC,OAAO,CAAwB;gBAGrC,EAAE,EAAE,GAAG,EACP,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,EACvC,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,EACvC,OAAO,GAAE,MAAqB,EAC9B,SAAS,CAAC,EAAE,sBAAsB;IAU3B,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAOxC,KAAK,IAAI,IAAI;IAKb,IAAI,IAAI,IAAI;IAOZ,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMjC,YAAY,CAAC,SAAS,CAAC,EAAE,sBAAsB,GAAG,IAAI;IAWtD,OAAO,CAAC,gBAAgB;IAWxB,gEAAgE;IAChE,OAAO,CAAC,cAAc;IAqBtB,OAAO,CAAC,aAAa;CAStB"}
@@ -0,0 +1,100 @@
1
+ import { Text } from "./text.js";
2
+ const DEFAULT_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
3
+ const DEFAULT_INTERVAL_MS = 80;
4
+ /**
5
+ * Loader component that updates with an optional spinning animation.
6
+ */
7
+ export class Loader extends Text {
8
+ frames = [...DEFAULT_FRAMES];
9
+ intervalMs = DEFAULT_INTERVAL_MS;
10
+ currentFrame = 0;
11
+ intervalId = null;
12
+ ui = null;
13
+ renderIndicatorVerbatim = false;
14
+ spinnerColorFn;
15
+ messageColorFn;
16
+ message = "Loading...";
17
+ constructor(ui, spinnerColorFn, messageColorFn, message = "Loading...", indicator) {
18
+ super("", 1, 0);
19
+ this.ui = ui;
20
+ this.spinnerColorFn = spinnerColorFn;
21
+ this.messageColorFn = messageColorFn;
22
+ this.message = message;
23
+ this.setIndicator(indicator);
24
+ }
25
+ render(width) {
26
+ // omp's Loader reserves a blank row above the spinner so the working
27
+ // status does not sit flush against the transcript; add a trailing row
28
+ // too so it does not crowd the editor's top border.
29
+ return ["", ...super.render(width), ""];
30
+ }
31
+ start() {
32
+ this.updateDisplay();
33
+ this.restartAnimation();
34
+ }
35
+ stop() {
36
+ if (this.intervalId) {
37
+ clearInterval(this.intervalId);
38
+ this.intervalId = null;
39
+ }
40
+ }
41
+ setMessage(message) {
42
+ if (message === this.message)
43
+ return;
44
+ this.message = message;
45
+ this.updateDisplay();
46
+ }
47
+ setIndicator(indicator) {
48
+ this.renderIndicatorVerbatim = indicator !== undefined;
49
+ this.frames = indicator?.frames !== undefined ? [...indicator.frames] : [...DEFAULT_FRAMES];
50
+ this.intervalMs =
51
+ indicator?.intervalMs && indicator.intervalMs > 0
52
+ ? indicator.intervalMs
53
+ : DEFAULT_INTERVAL_MS;
54
+ this.currentFrame = 0;
55
+ this.start();
56
+ }
57
+ restartAnimation() {
58
+ this.stop();
59
+ if (this.frames.length <= 1) {
60
+ return;
61
+ }
62
+ this.intervalId = setInterval(() => {
63
+ this.currentFrame = (this.currentFrame + 1) % this.frames.length;
64
+ this.updateDisplay();
65
+ }, this.intervalMs);
66
+ }
67
+ /** Moving light sweep across the message (omp shimmer-lite). */
68
+ animateMessage(message) {
69
+ if (!message)
70
+ return "";
71
+ // Sweep a short accent band across the text; the rest stays in the
72
+ // base message color so the line stays legible while it moves.
73
+ const base = this.messageColorFn;
74
+ const period = message.length + 4;
75
+ const start = this.currentFrame % period;
76
+ let out = "";
77
+ for (let i = 0; i < message.length; i++) {
78
+ const dist = Math.abs(i - start);
79
+ if (dist < 1) {
80
+ out += `\u001b[1m\u001b[36m${message[i]}\u001b[0m`;
81
+ }
82
+ else if (dist < 2) {
83
+ out += `\u001b[36m${message[i]}\u001b[0m`;
84
+ }
85
+ else {
86
+ out += base(message[i]);
87
+ }
88
+ }
89
+ return out;
90
+ }
91
+ updateDisplay() {
92
+ const frame = this.frames[this.currentFrame] ?? "";
93
+ const renderedFrame = this.renderIndicatorVerbatim ? frame : this.spinnerColorFn(frame);
94
+ const indicator = frame.length > 0 ? `${renderedFrame} ` : "";
95
+ this.setText(`${indicator}${this.animateMessage(this.message)}`);
96
+ if (this.ui) {
97
+ this.ui.requestRender();
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,108 @@
1
+ import type { Component } from "../tui.ts";
2
+ /**
3
+ * Default text styling for markdown content.
4
+ * Applied to all text unless overridden by markdown formatting.
5
+ */
6
+ export interface DefaultTextStyle {
7
+ /** Foreground color function */
8
+ color?: (text: string) => string;
9
+ /** Background color function */
10
+ bgColor?: (text: string) => string;
11
+ /** Bold text */
12
+ bold?: boolean;
13
+ /** Italic text */
14
+ italic?: boolean;
15
+ /** Strikethrough text */
16
+ strikethrough?: boolean;
17
+ /** Underline text */
18
+ underline?: boolean;
19
+ }
20
+ /**
21
+ * Theme functions for markdown elements.
22
+ * Each function takes text and returns styled text with ANSI codes.
23
+ */
24
+ export interface MarkdownTheme {
25
+ heading: (text: string) => string;
26
+ link: (text: string) => string;
27
+ linkUrl: (text: string) => string;
28
+ code: (text: string) => string;
29
+ codeBlock: (text: string) => string;
30
+ codeBlockBorder: (text: string) => string;
31
+ quote: (text: string) => string;
32
+ quoteBorder: (text: string) => string;
33
+ hr: (text: string) => string;
34
+ listBullet: (text: string) => string;
35
+ bold: (text: string) => string;
36
+ italic: (text: string) => string;
37
+ strikethrough: (text: string) => string;
38
+ underline: (text: string) => string;
39
+ highlightCode?: (code: string, lang?: string) => string[];
40
+ /** Prefix applied to each rendered code block line (default: " ") */
41
+ codeBlockIndent?: string;
42
+ }
43
+ export interface MarkdownOptions {
44
+ /** Preserve source list markers instead of normalizing them. */
45
+ preserveOrderedListMarkers?: boolean;
46
+ }
47
+ export declare class Markdown implements Component {
48
+ private text;
49
+ private paddingX;
50
+ private paddingY;
51
+ private defaultTextStyle?;
52
+ private theme;
53
+ private options;
54
+ private defaultStylePrefix?;
55
+ private cachedText?;
56
+ private cachedWidth?;
57
+ private cachedLines?;
58
+ private streamPrefixText?;
59
+ private streamPrefixTokens?;
60
+ constructor(text: string, paddingX: number, paddingY: number, theme: MarkdownTheme, defaultTextStyle?: DefaultTextStyle, options?: MarkdownOptions);
61
+ setText(text: string): void;
62
+ invalidate(): void;
63
+ render(width: number): string[];
64
+ /** Lex markdown into block tokens, reusing the frozen streaming prefix when
65
+ * the text only grew (append-only reveal). Falls back to a full lex on any
66
+ * non-append edit, tab normalization, or a prefix that starts inside an
67
+ * open code fence. */
68
+ private lexTokens;
69
+ /** Freeze the largest blank-line-bounded prefix that is not inside an open
70
+ * fenced code block. The frozen prefix is lexed once; later frames lex only
71
+ * the growing tail after it. */
72
+ private freezeStablePrefix;
73
+ /**
74
+ * Apply default text style to a string.
75
+ * This is the base styling applied to all text content.
76
+ * NOTE: Background color is NOT applied here - it's applied at the padding stage
77
+ * to ensure it extends to the full line width.
78
+ */
79
+ private applyDefaultStyle;
80
+ private getDefaultStylePrefix;
81
+ private getStylePrefix;
82
+ private getDefaultInlineStyleContext;
83
+ private renderToken;
84
+ private renderInlineTokens;
85
+ private getOrderedListMarker;
86
+ private getUnorderedListMarker;
87
+ /**
88
+ * Render a list with proper nesting support
89
+ */
90
+ private renderList;
91
+ /**
92
+ * Get the visible width of the longest word in a string.
93
+ */
94
+ private getLongestWordWidth;
95
+ /**
96
+ * Wrap a table cell to fit into a column.
97
+ *
98
+ * Delegates to wrapTextWithAnsi() so ANSI codes + long tokens are handled
99
+ * consistently with the rest of the renderer.
100
+ */
101
+ private wrapCellText;
102
+ /**
103
+ * Render a table with width-aware cell wrapping.
104
+ * Cells that don't fit are wrapped to multiple lines.
105
+ */
106
+ private renderTable;
107
+ }
108
+ //# sourceMappingURL=markdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/components/markdown.ts"],"names":[],"mappings":"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"}