chore: migrate pi packages to earendil works scope

This commit is contained in:
Mario Zechner
2026-05-07 15:59:42 +02:00
parent 801db80b65
commit 3e5ad67e0f
324 changed files with 958 additions and 1062 deletions

View File

@@ -1,4 +1,4 @@
# @mariozechner/pi-tui
# @earendil-works/pi-tui
Minimal terminal UI framework with differential rendering and synchronized output for flicker-free interactive CLI applications.
@@ -16,7 +16,7 @@ Minimal terminal UI framework with differential rendering and synchronized outpu
## Quick Start
```typescript
import { TUI, Text, Editor, ProcessTerminal, matchesKey } from "@mariozechner/pi-tui";
import { TUI, Text, Editor, ProcessTerminal, matchesKey } from "@earendil-works/pi-tui";
// Create terminal
const terminal = new ProcessTerminal();
@@ -159,7 +159,7 @@ The TUI appends a full SGR reset and OSC 8 reset at the end of each rendered lin
Components that display a text cursor and need IME (Input Method Editor) support should implement the `Focusable` interface:
```typescript
import { CURSOR_MARKER, type Component, type Focusable } from "@mariozechner/pi-tui";
import { CURSOR_MARKER, type Component, type Focusable } from "@earendil-works/pi-tui";
class MyInput implements Component, Focusable {
focused: boolean = false; // Set by TUI when focus changes
@@ -183,7 +183,7 @@ This enables IME candidate windows to appear at the correct position for CJK inp
**Container components with embedded inputs:** When a container component (dialog, selector, etc.) contains an `Input` or `Editor` child, the container must implement `Focusable` and propagate the focus state to the child:
```typescript
import { Container, type Focusable, Input } from "@mariozechner/pi-tui";
import { Container, type Focusable, Input } from "@earendil-works/pi-tui";
class SearchDialog extends Container implements Focusable {
private searchInput: Input;
@@ -530,7 +530,7 @@ Supported formats: PNG, JPEG, GIF, WebP. Dimensions are parsed from the image he
Supports both slash commands and file paths.
```typescript
import { CombinedAutocompleteProvider } from "@mariozechner/pi-tui";
import { CombinedAutocompleteProvider } from "@earendil-works/pi-tui";
const provider = new CombinedAutocompleteProvider(
[
@@ -555,7 +555,7 @@ editor.setAutocompleteProvider(provider);
Use `matchesKey()` with the `Key` helper for detecting keyboard input (supports Kitty keyboard protocol):
```typescript
import { matchesKey, Key } from "@mariozechner/pi-tui";
import { matchesKey, Key } from "@earendil-works/pi-tui";
if (matchesKey(data, Key.ctrl("c"))) {
process.exit(0);
@@ -613,7 +613,7 @@ interface Terminal {
## Utilities
```typescript
import { visibleWidth, truncateToWidth, wrapTextWithAnsi } from "@mariozechner/pi-tui";
import { visibleWidth, truncateToWidth, wrapTextWithAnsi } from "@earendil-works/pi-tui";
// Get visible width of string (ignoring ANSI codes)
const width = visibleWidth("\x1b[31mHello\x1b[0m"); // 5
@@ -638,8 +638,8 @@ When creating custom components, **each line returned by `render()` must not exc
Use `matchesKey()` with the `Key` helper for keyboard input:
```typescript
import { matchesKey, Key, truncateToWidth } from "@mariozechner/pi-tui";
import type { Component } from "@mariozechner/pi-tui";
import { matchesKey, Key, truncateToWidth } from "@earendil-works/pi-tui";
import type { Component } from "@earendil-works/pi-tui";
class MyInteractiveComponent implements Component {
private selectedIndex = 0;
@@ -674,8 +674,8 @@ class MyInteractiveComponent implements Component {
Use the provided utilities to ensure lines fit:
```typescript
import { visibleWidth, truncateToWidth } from "@mariozechner/pi-tui";
import type { Component } from "@mariozechner/pi-tui";
import { visibleWidth, truncateToWidth } from "@earendil-works/pi-tui";
import type { Component } from "@earendil-works/pi-tui";
class MyComponent implements Component {
private text: string;