@gajae-code/tui 0.18.8 → 0.18.10

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 CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.18.10] - 2026-10-12
6
+
7
+ ### Fixed
8
+
9
+ - TUI no longer goes blank after stop/restart cycles: `#hardwareCursorRow` is now properly reset during `stop()` to prevent stale cursor position state from corrupting viewport calculations on the next `start()`.
10
+
11
+ - With `clearOnShrink` enabled, a live block that shrinks after the transcript has scrolled into history no longer leaves blank spacer rows above the pinned composer until the next resize. The contraction now clears the screen and history and replays the frame, so the viewport is filled again and no row appears twice in history.
12
+
13
+ ## [0.18.9] - 2026-10-11
14
+
15
+ ### Added
16
+
17
+ - With mouse support on, dragging over Markdown copies the original Markdown instead of the painted glyphs: prose is joined across soft wraps, fully selected blocks copy their original Markdown (code with its original tabs, quotes with `>`), a selection inside a single code block drops the fences and presentation indent, and a partial table selection copies tab-separated cells without box drawing.
18
+ - A held drag keeps extending while the wheel scrolls the transcript, and auto-scrolls while the pointer rests on the top or bottom transcript edge. A drag that leaves the window or crosses editor chrome keeps its selection instead of clearing it.
19
+
20
+ ### Fixed
21
+
22
+ - Preserve the committed viewport frontier through bottom-pinned frame contractions and temporary manual-history handoffs, preventing scrolled-off transcript rows from being added to scrollback twice.
23
+
5
24
  ## [0.18.8] - 2026-10-08
6
25
 
7
26
  ## [0.18.7] - 2026-10-04
@@ -500,6 +500,8 @@ export declare class TUI extends Container {
500
500
  /** Refresh terminal cell metrics for a verified external image transport. */
501
501
  refreshImageCellSize(): void;
502
502
  stop(): void;
503
+ /** Temporarily releases terminal modes for foreground handoff and preserves viewport state for restart. */
504
+ suspend(): void;
503
505
  /**
504
506
  * Viewport-repaint-aware resize render request.
505
507
  *
@@ -46,7 +46,77 @@ export interface ViewportAnchorAnnotation {
46
46
  nextCell: number;
47
47
  token: string;
48
48
  }
49
+ export interface CopyRowAnnotation {
50
+ token: number;
51
+ kind: string;
52
+ /** Actual logical source line corresponding to this row, never a token copy. */
53
+ source: string;
54
+ /**
55
+ * Present on the token's last row (also while streaming), for complete-token
56
+ * reconstruction. Only the growing tail token's last row changes per delta, and
57
+ * ending a stream leaves already-painted rows byte-identical.
58
+ */
59
+ tokenSource?: string;
60
+ /**
61
+ * This row's position among its token's rendered rows. A container that shows
62
+ * only part of a rendered token (a clipped preview) keeps it, so a selection can
63
+ * tell it does not start at the token's first row.
64
+ */
65
+ tokenRow: number;
66
+ /** The token's rendered row count; present with `tokenSource` on the last row only. */
67
+ tokenRows?: number;
68
+ /** `source` is this code row's original-spelling slice (tabs intact), at any nesting depth. */
69
+ originalCode?: true;
70
+ joinGap: string;
71
+ contentStart: number;
72
+ contentEnd: number;
73
+ continuation: boolean;
74
+ prefixColumns: number;
75
+ fence: boolean;
76
+ quoteDepth: number;
77
+ ranges?: Array<[number, number]>;
78
+ /**
79
+ * On a table row that continues the wrapped cells of the row above: per cell,
80
+ * the source text the soft wrap removed before this row's fragment.
81
+ */
82
+ cellGaps?: string[];
83
+ }
49
84
  export declare const VIEWPORT_ANCHOR_PREFIX = "\u001B_AGJC_ANCHOR:";
85
+ /**
86
+ * Copy annotations are emitted only while a TUI that copies mouse selections is
87
+ * running. The switch is process-wide: while it is on, every Markdown render in
88
+ * the process carries zero-width copy APCs, which TUI.#emit strips at the
89
+ * terminal write boundary. With no such TUI running, render() output is
90
+ * byte-identical to the stock renderer. Returns an idempotent release.
91
+ */
92
+ export declare function retainCopyAnnotations(): () => void;
93
+ export declare function copyAnnotationsEnabled(): boolean;
94
+ /** Remove all copy APCs; applied to bytes at the terminal write boundary. */
95
+ export declare function stripCopyApcs(data: string): string;
96
+ /** Zero-width content origin; parent containers may prepend visible columns. */
97
+ export declare function annotateCopyOrigin(line: string): string;
98
+ /** Attach renderer-owned semantic copy data after a row's visible content. */
99
+ export declare function annotateCopyRow(line: string, sourceId: string, annotation: CopyRowAnnotation): string;
100
+ /** Read the annotation carried by this exact rendered row. */
101
+ export declare function extractCopyRowAnnotation(line: string): {
102
+ line: string;
103
+ sourceId: string;
104
+ annotation: CopyRowAnnotation;
105
+ originColumn: number;
106
+ } | null;
107
+ /**
108
+ * Detach copy APCs from a row without decoding payloads: the visible line, the
109
+ * column of this process's origin marker, and the verbatim row APCs. Re-attaching
110
+ * `origin` at `originColumn` and `rows` after the content restores the annotations.
111
+ */
112
+ export declare function splitCopyAnnotations(line: string): {
113
+ line: string;
114
+ origin: string;
115
+ originColumn: number;
116
+ rows: string;
117
+ };
118
+ /** Rebind cached semantic row data to the component that emitted this frame. */
119
+ export declare function replaceCopyAnnotationSourceId(line: string, sourceId: string): string;
50
120
  /**
51
121
  * Tag every visible grapheme with an APC marker that survives ANSI-aware
52
122
  * wrapping. The marker contains source grapheme and monotonic cell offsets.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/tui",
4
- "version": "0.18.8",
4
+ "version": "0.18.10",
5
5
  "description": "Terminal User Interface library with differential rendering for efficient text-based applications",
6
6
  "homepage": "https://gajae-code.com",
7
7
  "author": "Yeachan-Heo and Gajae Code Contributors",
@@ -36,8 +36,8 @@
36
36
  "fmt": "biome format --write ."
37
37
  },
38
38
  "dependencies": {
39
- "@gajae-code/natives": "0.18.8",
40
- "@gajae-code/utils": "0.18.8",
39
+ "@gajae-code/natives": "0.18.10",
40
+ "@gajae-code/utils": "0.18.10",
41
41
  "lru-cache": "11.3.6",
42
42
  "marked": "18.0.6"
43
43
  },