cb5bbbf382
- Eliminated core/ directory (252 files, 23 subdirs → distributed)
- Reduced max nesting from 9 levels to 5 levels
- Promoted tool subdirs to top level: exa/, lsp/, patch/, task/, web/
- Merged web-scrapers/ + web-search/ into web/{scrapers,search}/
- Flattened modes/interactive/ to modes/
- Split execution/ into: ipy/ (python), exec/ (bash), ssh/
- Renamed ipy/python-*.ts to ipy/*.ts (executor, kernel, etc.)
- Flattened cursor/exec-bridge.ts to cursor.ts
- Created logical groupings: config/, session/, extensibility/, export/
- Updated all imports across 500+ files
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { CancellableLoader, Container, Spacer, Text, type TUI } from "@oh-my-pi/pi-tui";
|
|
import type { Theme } from "$c/modes/theme/theme";
|
|
import { DynamicBorder } from "./dynamic-border";
|
|
|
|
/** Loader wrapped with borders for hook UI */
|
|
export class BorderedLoader extends Container {
|
|
private loader: CancellableLoader;
|
|
|
|
constructor(tui: TUI, theme: Theme, message: string) {
|
|
super();
|
|
const borderColor = (s: string) => theme.fg("border", s);
|
|
this.addChild(new DynamicBorder(borderColor));
|
|
this.loader = new CancellableLoader(
|
|
tui,
|
|
(s) => theme.fg("accent", s),
|
|
(s) => theme.fg("muted", s),
|
|
message,
|
|
);
|
|
this.addChild(this.loader);
|
|
this.addChild(new Spacer(1));
|
|
this.addChild(new Text(theme.fg("muted", "esc cancel"), 1, 0));
|
|
this.addChild(new Spacer(1));
|
|
this.addChild(new DynamicBorder(borderColor));
|
|
}
|
|
|
|
get signal(): AbortSignal {
|
|
return this.loader.signal;
|
|
}
|
|
|
|
set onAbort(fn: (() => void) | undefined) {
|
|
this.loader.onAbort = fn;
|
|
}
|
|
|
|
handleInput(data: string): void {
|
|
this.loader.handleInput(data);
|
|
}
|
|
|
|
dispose(): void {
|
|
this.loader.dispose();
|
|
}
|
|
}
|