@oh-my-pi/pi-tui 13.18.0 → 14.0.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/package.json +11 -6
- package/src/components/editor.ts +8 -3
- package/src/keys.ts +1 -1
- package/src/utils.ts +3 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-tui",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "14.0.2",
|
|
5
5
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
6
6
|
"homepage": "https://github.com/can1357/oh-my-pi",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -29,12 +29,16 @@
|
|
|
29
29
|
"main": "./src/index.ts",
|
|
30
30
|
"types": "./src/index.ts",
|
|
31
31
|
"scripts": {
|
|
32
|
-
"check": "
|
|
33
|
-
"
|
|
32
|
+
"check": "biome check . && bun run check:types",
|
|
33
|
+
"check:types": "tsgo -p tsconfig.json --noEmit",
|
|
34
|
+
"lint": "biome lint .",
|
|
35
|
+
"test": "bun test test/*.test.ts",
|
|
36
|
+
"fix": "biome check --write --unsafe .",
|
|
37
|
+
"fmt": "biome format --write ."
|
|
34
38
|
},
|
|
35
39
|
"dependencies": {
|
|
36
|
-
"@oh-my-pi/pi-natives": "
|
|
37
|
-
"@oh-my-pi/pi-utils": "
|
|
40
|
+
"@oh-my-pi/pi-natives": "14.0.2",
|
|
41
|
+
"@oh-my-pi/pi-utils": "14.0.2",
|
|
38
42
|
"marked": "^17.0"
|
|
39
43
|
},
|
|
40
44
|
"devDependencies": {
|
|
@@ -61,6 +65,7 @@
|
|
|
61
65
|
"./components/*": {
|
|
62
66
|
"types": "./src/components/*.ts",
|
|
63
67
|
"import": "./src/components/*.ts"
|
|
64
|
-
}
|
|
68
|
+
},
|
|
69
|
+
"./*.js": "./src/*.ts"
|
|
65
70
|
}
|
|
66
71
|
}
|
package/src/components/editor.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getProjectDir } from "@oh-my-pi/pi-utils";
|
|
1
|
+
import { getProjectDir, logger } from "@oh-my-pi/pi-utils";
|
|
2
2
|
import type { AutocompleteProvider, CombinedAutocompleteProvider } from "../autocomplete";
|
|
3
3
|
import { BracketedPasteHandler } from "../bracketed-paste";
|
|
4
4
|
import { getKeybindings, type KeybindingsManager } from "../keybindings";
|
|
@@ -304,7 +304,7 @@ interface HistoryEntry {
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
interface HistoryStorage {
|
|
307
|
-
add(prompt: string, cwd?: string): void
|
|
307
|
+
add(prompt: string, cwd?: string): Promise<void>;
|
|
308
308
|
getRecent(limit: number): HistoryEntry[];
|
|
309
309
|
}
|
|
310
310
|
|
|
@@ -478,7 +478,12 @@ export class Editor implements Component, Focusable {
|
|
|
478
478
|
this.#history.pop();
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
-
this.#historyStorage
|
|
481
|
+
const stor = this.#historyStorage;
|
|
482
|
+
if (stor) {
|
|
483
|
+
stor.add(trimmed, getProjectDir()).catch(error => {
|
|
484
|
+
logger.error("HistoryStorage add failed", { error: String(error) });
|
|
485
|
+
});
|
|
486
|
+
}
|
|
482
487
|
}
|
|
483
488
|
|
|
484
489
|
#isEditorEmpty(): boolean {
|
package/src/keys.ts
CHANGED
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
* - isKittyProtocolActive() - Query global Kitty protocol state
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
+
import type { KeyEventType } from "@oh-my-pi/pi-natives";
|
|
21
22
|
import {
|
|
22
|
-
type KeyEventType,
|
|
23
23
|
matchesKey as matchesKeyNative,
|
|
24
24
|
parseKey as parseKeyNative,
|
|
25
25
|
parseKittySequence as parseKittySequenceNative,
|
package/src/utils.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { sliceWithWidth } from "@oh-my-pi/pi-natives";
|
|
2
|
-
import { getDefaultTabWidth, getIndentation } from "@oh-my-pi/pi-utils";
|
|
1
|
+
import { getDefaultTabWidth, getIndentation, sliceWithWidth } from "@oh-my-pi/pi-natives";
|
|
3
2
|
|
|
4
3
|
export { Ellipsis, extractSegments, sliceWithWidth, truncateToWidth, wrapTextWithAnsi } from "@oh-my-pi/pi-natives";
|
|
5
4
|
|
|
@@ -9,8 +8,8 @@ const SPACE_BUFFER = " ".repeat(512);
|
|
|
9
8
|
/*
|
|
10
9
|
* Replace tabs with configured spacing for consistent rendering.
|
|
11
10
|
*/
|
|
12
|
-
export function replaceTabs(text: string): string {
|
|
13
|
-
return text.replaceAll("\t", getIndentation());
|
|
11
|
+
export function replaceTabs(text: string, file?: string): string {
|
|
12
|
+
return text.replaceAll("\t", " ".repeat(getIndentation(file)));
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
/**
|