@vincemakes/kiso-tui 0.22.0 → 0.23.0
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/dist/editor.d.ts +1 -0
- package/dist/editor.js +24 -0
- package/dist/transcript.js +1 -1
- package/package.json +2 -2
package/dist/editor.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export declare class Editor {
|
|
|
74
74
|
* keeping it out of the draft; deciding what a report MEANS belongs to
|
|
75
75
|
* whoever asked the question.
|
|
76
76
|
*/
|
|
77
|
+
onColorScheme(cb: (scheme: "dark" | "light") => void): void;
|
|
77
78
|
onOsc(cb: (body: string) => void): void;
|
|
78
79
|
onLine(cb: (line: string) => void): void;
|
|
79
80
|
onSigint(cb: () => void): void;
|
package/dist/editor.js
CHANGED
|
@@ -351,6 +351,11 @@ export class Editor {
|
|
|
351
351
|
#pending = ""; // an incomplete ESC/CSI/OSC prefix across chunks
|
|
352
352
|
/** DC-7: the terminal's own reports (OSC). Never a keystroke. */
|
|
353
353
|
#oscCb = null;
|
|
354
|
+
/** The terminal's own account of its colour scheme (`CSI ? 997 ; 1|2 n`).
|
|
355
|
+
* Its OWN channel, never `#oscCb`: OSC 11 reports a COLOUR that kiso
|
|
356
|
+
* reads a ground out of, this reports the GROUND itself, and a
|
|
357
|
+
* listener wanting one must not be handed the other. */
|
|
358
|
+
#colorSchemeCb = null;
|
|
354
359
|
#decoder = new TextDecoder();
|
|
355
360
|
#entered = false;
|
|
356
361
|
#onData;
|
|
@@ -371,6 +376,9 @@ export class Editor {
|
|
|
371
376
|
* keeping it out of the draft; deciding what a report MEANS belongs to
|
|
372
377
|
* whoever asked the question.
|
|
373
378
|
*/
|
|
379
|
+
onColorScheme(cb) {
|
|
380
|
+
this.#colorSchemeCb = cb;
|
|
381
|
+
}
|
|
374
382
|
onOsc(cb) {
|
|
375
383
|
this.#oscCb = cb;
|
|
376
384
|
}
|
|
@@ -1507,6 +1515,22 @@ export class Editor {
|
|
|
1507
1515
|
this.#mouseEvent(params, final === "M");
|
|
1508
1516
|
return;
|
|
1509
1517
|
}
|
|
1518
|
+
// The terminal's colour-scheme REPORT — `CSI ? 997 ; 1 n` (dark) or
|
|
1519
|
+
// `; 2 n` (light), answering the `CSI ? 996 n` sent at startup.
|
|
1520
|
+
//
|
|
1521
|
+
// Routed high and narrow, for the mouse branch's reason: a report
|
|
1522
|
+
// is never a key and must never fall through to one. It used to
|
|
1523
|
+
// reach the END of this method instead, which dropped it in
|
|
1524
|
+
// silence — the terminal answered and nothing could hear it. The
|
|
1525
|
+
// pattern is exact (997 only, 1 or 2 only) because `n` is a final
|
|
1526
|
+
// that device-status reports share.
|
|
1527
|
+
if (final === "n") {
|
|
1528
|
+
const scheme = /^\?997;([12])$/.exec(params);
|
|
1529
|
+
if (scheme !== null) {
|
|
1530
|
+
this.#colorSchemeCb?.(scheme[1] === "1" ? "dark" : "light");
|
|
1531
|
+
return;
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1510
1534
|
// R3a — Shift+Tab (CSI Z, the universal back-tab encoding) cycles
|
|
1511
1535
|
// the approval tier. Composer-idle ONLY: a panel, picker, menu,
|
|
1512
1536
|
// history browse or question owns its keys first (the W21 gate),
|
package/dist/transcript.js
CHANGED
|
@@ -143,7 +143,7 @@ export function viewerRows(entries, state, W, rows) {
|
|
|
143
143
|
* An open entry's rows take the VERBATIM SURFACE — `wash`, the same
|
|
144
144
|
* background DC-3 gave the human's own words and inline code. It is
|
|
145
145
|
* ground-resolved already, and with no ground it degrades to reverse
|
|
146
|
-
* video, which is correct on any ground (ground.ts rung
|
|
146
|
+
* video, which is correct on any ground (ground.ts's last rung).
|
|
147
147
|
*
|
|
148
148
|
* Padded to the full width so the block reads as ONE thing rather than
|
|
149
149
|
* a ragged stack. Under NO_COLOR `wash` is empty and the row's bytes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-tui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "kiso tui — the pure terminal layer (cell renderer, dock, raw editor, diff, palette). Zero runtime dependencies: input is data, output is bytes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/vincemakes/kiso/tree/main/packages/tui#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@vincemakes/kiso-tui-cells": "0.
|
|
38
|
+
"@vincemakes/kiso-tui-cells": "0.23.0"
|
|
39
39
|
}
|
|
40
40
|
}
|