@averyyy/pi-tui 0.87.0-piclient.2 → 0.87.1-piclient.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -213,7 +213,7 @@ interface Component {
|
|
|
213
213
|
render(width: number): string[];
|
|
214
214
|
handleInput?(data: string): void;
|
|
215
215
|
handleMouse?(event: TuiMouseEvent): TuiMouseEventResult | undefined;
|
|
216
|
-
invalidate
|
|
216
|
+
invalidate(): void;
|
|
217
217
|
}
|
|
218
218
|
```
|
|
219
219
|
|
|
@@ -222,7 +222,7 @@ interface Component {
|
|
|
222
222
|
| `render(width)` | Returns an array of strings, one per line. Each line **must not exceed `width`** or the TUI will error. Use `truncateToWidth()` or manual wrapping to ensure this. |
|
|
223
223
|
| `handleInput?(data)` | Called when the component has focus and receives keyboard input. The `data` string contains raw terminal input (may include ANSI escape sequences). |
|
|
224
224
|
| `handleMouse?(event)` | Called by `TuiAltScreen` for normalized pointer input targeted at the component. |
|
|
225
|
-
| `invalidate
|
|
225
|
+
| `invalidate()` | Required. Clear any cached render state so the next `render()` starts from scratch. Components without cached render state can use an empty implementation. |
|
|
226
226
|
|
|
227
227
|
The TUI appends a full SGR reset and OSC 8 reset at the end of each rendered line. Styles do not carry across lines. If you emit multi-line text with styling, reapply styles per line or use `wrapTextWithAnsi()` so styles are preserved for each wrapped line.
|
|
228
228
|
|
|
@@ -280,6 +280,8 @@ class MyInput implements Component, Focusable {
|
|
|
280
280
|
// Emit marker right before the fake cursor
|
|
281
281
|
return [`> ${beforeCursor}${marker}\x1b[7m${atCursor}\x1b[27m${afterCursor}`];
|
|
282
282
|
}
|
|
283
|
+
|
|
284
|
+
invalidate(): void {}
|
|
283
285
|
}
|
|
284
286
|
```
|
|
285
287
|
|
|
@@ -790,6 +792,8 @@ class MyInteractiveComponent implements Component {
|
|
|
790
792
|
return truncateToWidth(prefix + item, width);
|
|
791
793
|
});
|
|
792
794
|
}
|
|
795
|
+
|
|
796
|
+
invalidate(): void {}
|
|
793
797
|
}
|
|
794
798
|
```
|
|
795
799
|
|
|
@@ -821,6 +825,8 @@ class MyComponent implements Component {
|
|
|
821
825
|
// Pad to exact width (optional, for backgrounds)
|
|
822
826
|
return [line + " ".repeat(width - visible)];
|
|
823
827
|
}
|
|
828
|
+
|
|
829
|
+
invalidate(): void {}
|
|
824
830
|
}
|
|
825
831
|
```
|
|
826
832
|
|
package/package.json
CHANGED