@oh-my-pi/pi-tui 17.4.2 → 18.0.1
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 +67 -0
- package/README.md +1 -1
- package/dist/types/autocomplete.d.ts +17 -6
- package/dist/types/components/editor.d.ts +42 -5
- package/dist/types/components/image.d.ts +2 -5
- package/dist/types/components/markdown.d.ts +18 -24
- package/dist/types/components/select-list.d.ts +9 -0
- package/dist/types/components/text.d.ts +0 -1
- package/dist/types/keybindings.d.ts +5 -0
- package/dist/types/terminal-capabilities.d.ts +10 -3
- package/dist/types/terminal.d.ts +42 -2
- package/dist/types/tui.d.ts +63 -218
- package/dist/types/utils.d.ts +3 -2
- package/package.json +4 -4
- package/src/autocomplete.ts +147 -61
- package/src/components/editor.ts +407 -157
- package/src/components/image.ts +4 -6
- package/src/components/loader.ts +1 -9
- package/src/components/markdown.ts +133 -417
- package/src/components/select-list.ts +67 -15
- package/src/components/text.ts +8 -18
- package/src/fuzzy.ts +63 -6
- package/src/keybindings.ts +5 -0
- package/src/stdin-buffer.ts +130 -20
- package/src/terminal-capabilities.ts +20 -3
- package/src/terminal.ts +147 -22
- package/src/tui.ts +628 -3510
- package/src/utils.ts +12 -3
package/src/components/image.ts
CHANGED
|
@@ -363,11 +363,8 @@ export class ImageBudget {
|
|
|
363
363
|
* Restart every placement epoch after a destructive history clear (`CSI 3 J`
|
|
364
364
|
* full paint). The clear destroys all placement cells — scrollback rows are
|
|
365
365
|
* gone and the replay rewrites the viewport — so no archive remains to
|
|
366
|
-
* protect. Reverting to epoch 1 lets the replay
|
|
367
|
-
*
|
|
368
|
-
* and the highest epoch it reached so the caller can delete all of its
|
|
369
|
-
* registry entries explicitly (`d=i` keeps the transmitted data) — an image
|
|
370
|
-
* absent from the replay never re-places, so even its epoch-1 entry must go.
|
|
366
|
+
* protect. Reverting to epoch 1 lets the replay recreate every visible
|
|
367
|
+
* placement after the terminal-wide cleanup.
|
|
371
368
|
*/
|
|
372
369
|
resetPlacementEpochs(): ReadonlyArray<{ imageId: number; lastEpoch: number }> {
|
|
373
370
|
let stale: Array<{ imageId: number; lastEpoch: number }> | undefined;
|
|
@@ -532,7 +529,8 @@ export class Image implements Component {
|
|
|
532
529
|
this.#cachedImageProtocol === imageProtocol &&
|
|
533
530
|
this.#cachedCellWidthPx === cellDimensions.widthPx &&
|
|
534
531
|
this.#cachedCellHeightPx === cellDimensions.heightPx &&
|
|
535
|
-
this.#cachedKittyUnicodePlaceholders === kittyUnicodePlaceholders
|
|
532
|
+
this.#cachedKittyUnicodePlaceholders === kittyUnicodePlaceholders &&
|
|
533
|
+
(this.#imageId == null || this.#budget?.shouldTransmit(this.#imageId) !== true)
|
|
536
534
|
) {
|
|
537
535
|
return this.#cachedLines;
|
|
538
536
|
}
|
package/src/components/loader.ts
CHANGED
|
@@ -160,14 +160,6 @@ export class Loader extends Text {
|
|
|
160
160
|
if (!this.#ui) {
|
|
161
161
|
return;
|
|
162
162
|
}
|
|
163
|
-
|
|
164
|
-
// update the already-positioned rows without driving the full
|
|
165
|
-
// compose/prepare/diff pipeline. Lightweight test stubs may not carry the
|
|
166
|
-
// newer API; keep their legacy component-scoped path working.
|
|
167
|
-
if (typeof this.#ui.requestDirectWrite === "function") {
|
|
168
|
-
this.#ui.requestDirectWrite(this);
|
|
169
|
-
} else {
|
|
170
|
-
this.#ui.requestComponentRender(this);
|
|
171
|
-
}
|
|
163
|
+
this.#ui.requestComponentRender(this);
|
|
172
164
|
}
|
|
173
165
|
}
|