@oh-my-pi/pi-tui 15.0.0 → 15.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/CHANGELOG.md +11 -0
- package/package.json +5 -5
- package/src/components/markdown.ts +5 -5
- package/src/keys.ts +94 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [15.0.2] - 2026-05-15
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Restored the `Key` runtime helper on `@oh-my-pi/pi-tui` to mirror upstream `@mariozechner/pi-tui`'s surface. `Key.enter`, `Key.escape`, `Key.tab`, … return the canonical key-name strings; modifier methods (`Key.ctrl(k)`, `Key.shift(k)`, `Key.ctrlShift(k)`, etc.) build precisely-typed `KeyId` literals like `"ctrl+c"`. Pure runtime convenience for typed key-id construction — plugins built against the upstream package surface that import `Key` (e.g. `@plannotator/pi-extension`, `@juicesharp/rpiv-ask-user-question`) load again now that the specifier shim remaps them onto this package.
|
|
10
|
+
|
|
11
|
+
## [15.0.1] - 2026-05-14
|
|
12
|
+
### Breaking Changes
|
|
13
|
+
|
|
14
|
+
- Increased the minimum required Bun version for the TUI package from >=1.3.7 to >=1.3.14
|
|
15
|
+
|
|
5
16
|
## [14.9.8] - 2026-05-12
|
|
6
17
|
|
|
7
18
|
### Added
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/pi-tui",
|
|
4
|
-
"version": "15.0.
|
|
4
|
+
"version": "15.0.2",
|
|
5
5
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
6
|
-
"homepage": "https://
|
|
6
|
+
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
8
8
|
"contributors": [
|
|
9
9
|
"Mario Zechner"
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"fmt": "biome format --write ."
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@oh-my-pi/pi-natives": "15.0.
|
|
41
|
-
"@oh-my-pi/pi-utils": "15.0.
|
|
40
|
+
"@oh-my-pi/pi-natives": "15.0.2",
|
|
41
|
+
"@oh-my-pi/pi-utils": "15.0.2",
|
|
42
42
|
"lru-cache": "11.3.6",
|
|
43
43
|
"marked": "^18.0.3"
|
|
44
44
|
},
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@xterm/headless": "^6.0.0"
|
|
48
48
|
},
|
|
49
49
|
"engines": {
|
|
50
|
-
"bun": ">=1.3.
|
|
50
|
+
"bun": ">=1.3.14"
|
|
51
51
|
},
|
|
52
52
|
"files": [
|
|
53
53
|
"src",
|
|
@@ -48,13 +48,13 @@ export function clearRenderCache(): void {
|
|
|
48
48
|
|
|
49
49
|
// Stable numeric IDs for structural theme/style objects (no ID field on type).
|
|
50
50
|
// WeakMap so GC can collect orphaned themes/styles without a leak.
|
|
51
|
-
const
|
|
52
|
-
let
|
|
51
|
+
const objectIds = new WeakMap<object, number>();
|
|
52
|
+
let nextObjectId = 0;
|
|
53
53
|
function objectId(o: object): number {
|
|
54
|
-
let id =
|
|
54
|
+
let id = objectIds.get(o);
|
|
55
55
|
if (id === undefined) {
|
|
56
|
-
id =
|
|
57
|
-
|
|
56
|
+
id = nextObjectId++;
|
|
57
|
+
objectIds.set(o, id);
|
|
58
58
|
}
|
|
59
59
|
return id;
|
|
60
60
|
}
|
package/src/keys.ts
CHANGED
|
@@ -186,6 +186,100 @@ type ModifiedKeyId<Key extends string, RemainingModifiers extends ModifierName =
|
|
|
186
186
|
*/
|
|
187
187
|
export type KeyId = BaseKey | ModifiedKeyId<BaseKey>;
|
|
188
188
|
|
|
189
|
+
/**
|
|
190
|
+
* Typed helper for constructing key identifiers with autocomplete.
|
|
191
|
+
*
|
|
192
|
+
* The runtime values are just the canonical key-name strings (so `Key.enter`
|
|
193
|
+
* is literally `"enter"`); the value of `Key` over a bag of magic strings is
|
|
194
|
+
* that each property is typed to the exact `KeyId` literal it produces and the
|
|
195
|
+
* modifier methods return precisely-typed concatenations (e.g. `Key.ctrl("c")`
|
|
196
|
+
* is `"ctrl+c"`, not just `string`). This mirrors the upstream
|
|
197
|
+
* `@mariozechner/pi-tui` `Key` export verbatim so plugins built against any
|
|
198
|
+
* scope alias (`@mariozechner`, `@earendil-works`, `@oh-my-pi`) keep working
|
|
199
|
+
* once the specifier shim remaps them to this package.
|
|
200
|
+
*/
|
|
201
|
+
export const Key = {
|
|
202
|
+
escape: "escape",
|
|
203
|
+
esc: "esc",
|
|
204
|
+
enter: "enter",
|
|
205
|
+
return: "return",
|
|
206
|
+
tab: "tab",
|
|
207
|
+
space: "space",
|
|
208
|
+
backspace: "backspace",
|
|
209
|
+
delete: "delete",
|
|
210
|
+
insert: "insert",
|
|
211
|
+
clear: "clear",
|
|
212
|
+
home: "home",
|
|
213
|
+
end: "end",
|
|
214
|
+
pageUp: "pageUp",
|
|
215
|
+
pageDown: "pageDown",
|
|
216
|
+
up: "up",
|
|
217
|
+
down: "down",
|
|
218
|
+
left: "left",
|
|
219
|
+
right: "right",
|
|
220
|
+
f1: "f1",
|
|
221
|
+
f2: "f2",
|
|
222
|
+
f3: "f3",
|
|
223
|
+
f4: "f4",
|
|
224
|
+
f5: "f5",
|
|
225
|
+
f6: "f6",
|
|
226
|
+
f7: "f7",
|
|
227
|
+
f8: "f8",
|
|
228
|
+
f9: "f9",
|
|
229
|
+
f10: "f10",
|
|
230
|
+
f11: "f11",
|
|
231
|
+
f12: "f12",
|
|
232
|
+
backtick: "`",
|
|
233
|
+
hyphen: "-",
|
|
234
|
+
equals: "=",
|
|
235
|
+
leftbracket: "[",
|
|
236
|
+
rightbracket: "]",
|
|
237
|
+
backslash: "\\",
|
|
238
|
+
semicolon: ";",
|
|
239
|
+
quote: "'",
|
|
240
|
+
comma: ",",
|
|
241
|
+
period: ".",
|
|
242
|
+
slash: "/",
|
|
243
|
+
exclamation: "!",
|
|
244
|
+
at: "@",
|
|
245
|
+
hash: "#",
|
|
246
|
+
dollar: "$",
|
|
247
|
+
percent: "%",
|
|
248
|
+
caret: "^",
|
|
249
|
+
ampersand: "&",
|
|
250
|
+
asterisk: "*",
|
|
251
|
+
leftparen: "(",
|
|
252
|
+
rightparen: ")",
|
|
253
|
+
underscore: "_",
|
|
254
|
+
plus: "+",
|
|
255
|
+
pipe: "|",
|
|
256
|
+
tilde: "~",
|
|
257
|
+
leftbrace: "{",
|
|
258
|
+
rightbrace: "}",
|
|
259
|
+
colon: ":",
|
|
260
|
+
lessthan: "<",
|
|
261
|
+
greaterthan: ">",
|
|
262
|
+
question: "?",
|
|
263
|
+
ctrl: <K extends BaseKey>(key: K) => `ctrl+${key}` as const,
|
|
264
|
+
shift: <K extends BaseKey>(key: K) => `shift+${key}` as const,
|
|
265
|
+
alt: <K extends BaseKey>(key: K) => `alt+${key}` as const,
|
|
266
|
+
super: <K extends BaseKey>(key: K) => `super+${key}` as const,
|
|
267
|
+
ctrlShift: <K extends BaseKey>(key: K) => `ctrl+shift+${key}` as const,
|
|
268
|
+
shiftCtrl: <K extends BaseKey>(key: K) => `shift+ctrl+${key}` as const,
|
|
269
|
+
ctrlAlt: <K extends BaseKey>(key: K) => `ctrl+alt+${key}` as const,
|
|
270
|
+
altCtrl: <K extends BaseKey>(key: K) => `alt+ctrl+${key}` as const,
|
|
271
|
+
shiftAlt: <K extends BaseKey>(key: K) => `shift+alt+${key}` as const,
|
|
272
|
+
altShift: <K extends BaseKey>(key: K) => `alt+shift+${key}` as const,
|
|
273
|
+
ctrlSuper: <K extends BaseKey>(key: K) => `ctrl+super+${key}` as const,
|
|
274
|
+
superCtrl: <K extends BaseKey>(key: K) => `super+ctrl+${key}` as const,
|
|
275
|
+
shiftSuper: <K extends BaseKey>(key: K) => `shift+super+${key}` as const,
|
|
276
|
+
superShift: <K extends BaseKey>(key: K) => `super+shift+${key}` as const,
|
|
277
|
+
altSuper: <K extends BaseKey>(key: K) => `alt+super+${key}` as const,
|
|
278
|
+
superAlt: <K extends BaseKey>(key: K) => `super+alt+${key}` as const,
|
|
279
|
+
ctrlShiftAlt: <K extends BaseKey>(key: K) => `ctrl+shift+alt+${key}` as const,
|
|
280
|
+
ctrlShiftSuper: <K extends BaseKey>(key: K) => `ctrl+shift+super+${key}` as const,
|
|
281
|
+
} as const;
|
|
282
|
+
|
|
189
283
|
// =============================================================================
|
|
190
284
|
// Kitty Protocol Parsing
|
|
191
285
|
// =============================================================================
|