phi-code-tui 0.56.3 → 0.74.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 (102) hide show
  1. package/README.md +29 -11
  2. package/dist/index.js +3 -3
  3. package/package.json +2 -2
  4. package/dist/autocomplete.d.ts +0 -50
  5. package/dist/autocomplete.d.ts.map +0 -1
  6. package/dist/autocomplete.js +0 -593
  7. package/dist/autocomplete.js.map +0 -1
  8. package/dist/components/box.d.ts +0 -22
  9. package/dist/components/box.d.ts.map +0 -1
  10. package/dist/components/box.js +0 -99
  11. package/dist/components/box.js.map +0 -1
  12. package/dist/components/cancellable-loader.d.ts +0 -22
  13. package/dist/components/cancellable-loader.d.ts.map +0 -1
  14. package/dist/components/cancellable-loader.js +0 -36
  15. package/dist/components/cancellable-loader.js.map +0 -1
  16. package/dist/components/editor.d.ts +0 -205
  17. package/dist/components/editor.d.ts.map +0 -1
  18. package/dist/components/editor.js +0 -1632
  19. package/dist/components/editor.js.map +0 -1
  20. package/dist/components/image.d.ts +0 -28
  21. package/dist/components/image.d.ts.map +0 -1
  22. package/dist/components/image.js +0 -61
  23. package/dist/components/image.js.map +0 -1
  24. package/dist/components/input.d.ts +0 -37
  25. package/dist/components/input.d.ts.map +0 -1
  26. package/dist/components/input.js +0 -443
  27. package/dist/components/input.js.map +0 -1
  28. package/dist/components/loader.d.ts +0 -21
  29. package/dist/components/loader.d.ts.map +0 -1
  30. package/dist/components/loader.js +0 -46
  31. package/dist/components/loader.js.map +0 -1
  32. package/dist/components/markdown.d.ts +0 -95
  33. package/dist/components/markdown.d.ts.map +0 -1
  34. package/dist/components/markdown.js +0 -641
  35. package/dist/components/markdown.js.map +0 -1
  36. package/dist/components/select-list.d.ts +0 -32
  37. package/dist/components/select-list.d.ts.map +0 -1
  38. package/dist/components/select-list.js +0 -148
  39. package/dist/components/select-list.js.map +0 -1
  40. package/dist/components/settings-list.d.ts +0 -50
  41. package/dist/components/settings-list.d.ts.map +0 -1
  42. package/dist/components/settings-list.js +0 -177
  43. package/dist/components/settings-list.js.map +0 -1
  44. package/dist/components/spacer.d.ts +0 -12
  45. package/dist/components/spacer.d.ts.map +0 -1
  46. package/dist/components/spacer.js +0 -22
  47. package/dist/components/spacer.js.map +0 -1
  48. package/dist/components/text.d.ts +0 -19
  49. package/dist/components/text.d.ts.map +0 -1
  50. package/dist/components/text.js +0 -81
  51. package/dist/components/text.js.map +0 -1
  52. package/dist/components/truncated-text.d.ts +0 -13
  53. package/dist/components/truncated-text.d.ts.map +0 -1
  54. package/dist/components/truncated-text.js +0 -48
  55. package/dist/components/truncated-text.js.map +0 -1
  56. package/dist/editor-component.d.ts +0 -39
  57. package/dist/editor-component.d.ts.map +0 -1
  58. package/dist/editor-component.js +0 -2
  59. package/dist/editor-component.js.map +0 -1
  60. package/dist/fuzzy.d.ts +0 -16
  61. package/dist/fuzzy.d.ts.map +0 -1
  62. package/dist/fuzzy.js +0 -107
  63. package/dist/fuzzy.js.map +0 -1
  64. package/dist/index.d.ts +0 -23
  65. package/dist/index.d.ts.map +0 -1
  66. package/dist/index.js.map +0 -1
  67. package/dist/keybindings.d.ts +0 -39
  68. package/dist/keybindings.d.ts.map +0 -1
  69. package/dist/keybindings.js +0 -113
  70. package/dist/keybindings.js.map +0 -1
  71. package/dist/keys.d.ts +0 -175
  72. package/dist/keys.d.ts.map +0 -1
  73. package/dist/keys.js +0 -1015
  74. package/dist/keys.js.map +0 -1
  75. package/dist/kill-ring.d.ts +0 -28
  76. package/dist/kill-ring.d.ts.map +0 -1
  77. package/dist/kill-ring.js +0 -46
  78. package/dist/kill-ring.js.map +0 -1
  79. package/dist/stdin-buffer.d.ts +0 -48
  80. package/dist/stdin-buffer.d.ts.map +0 -1
  81. package/dist/stdin-buffer.js +0 -316
  82. package/dist/stdin-buffer.js.map +0 -1
  83. package/dist/terminal-image.d.ts +0 -68
  84. package/dist/terminal-image.d.ts.map +0 -1
  85. package/dist/terminal-image.js +0 -288
  86. package/dist/terminal-image.js.map +0 -1
  87. package/dist/terminal.d.ts +0 -84
  88. package/dist/terminal.d.ts.map +0 -1
  89. package/dist/terminal.js +0 -267
  90. package/dist/terminal.js.map +0 -1
  91. package/dist/tui.d.ts +0 -211
  92. package/dist/tui.d.ts.map +0 -1
  93. package/dist/tui.js +0 -961
  94. package/dist/tui.js.map +0 -1
  95. package/dist/undo-stack.d.ts +0 -17
  96. package/dist/undo-stack.d.ts.map +0 -1
  97. package/dist/undo-stack.js +0 -27
  98. package/dist/undo-stack.js.map +0 -1
  99. package/dist/utils.d.ts +0 -78
  100. package/dist/utils.d.ts.map +0 -1
  101. package/dist/utils.js +0 -817
  102. package/dist/utils.js.map +0 -1
@@ -1,95 +0,0 @@
1
- import type { Component } from "../tui.js";
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 declare class Markdown implements Component {
44
- private text;
45
- private paddingX;
46
- private paddingY;
47
- private defaultTextStyle?;
48
- private theme;
49
- private defaultStylePrefix?;
50
- private cachedText?;
51
- private cachedWidth?;
52
- private cachedLines?;
53
- constructor(text: string, paddingX: number, paddingY: number, theme: MarkdownTheme, defaultTextStyle?: DefaultTextStyle);
54
- setText(text: string): void;
55
- invalidate(): void;
56
- render(width: number): string[];
57
- /**
58
- * Apply default text style to a string.
59
- * This is the base styling applied to all text content.
60
- * NOTE: Background color is NOT applied here - it's applied at the padding stage
61
- * to ensure it extends to the full line width.
62
- */
63
- private applyDefaultStyle;
64
- private getDefaultStylePrefix;
65
- private getStylePrefix;
66
- private getDefaultInlineStyleContext;
67
- private renderToken;
68
- private renderInlineTokens;
69
- /**
70
- * Render a list with proper nesting support
71
- */
72
- private renderList;
73
- /**
74
- * Render list item tokens, handling nested lists
75
- * Returns lines WITHOUT the parent indent (renderList will add it)
76
- */
77
- private renderListItem;
78
- /**
79
- * Get the visible width of the longest word in a string.
80
- */
81
- private getLongestWordWidth;
82
- /**
83
- * Wrap a table cell to fit into a column.
84
- *
85
- * Delegates to wrapTextWithAnsi() so ANSI codes + long tokens are handled
86
- * consistently with the rest of the renderer.
87
- */
88
- private wrapCellText;
89
- /**
90
- * Render a table with width-aware cell wrapping.
91
- * Cells that don't fit are wrapped to multiple lines.
92
- */
93
- private renderTable;
94
- }
95
- //# sourceMappingURL=markdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/components/markdown.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAG3C;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,gCAAgC;IAChC,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACjC,gCAAgC;IAChC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,gBAAgB;IAChB,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