@bastani/atomic-tui 0.9.90 → 0.10.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/builtin-command-names.d.ts +1 -1
- package/dist/builtin-command-names.d.ts.map +1 -1
- package/dist/builtin-command-names.js +0 -2
- package/dist/builtin-command-names.js.map +1 -1
- package/dist/clickable-hints.d.ts.map +1 -1
- package/dist/clickable-hints.js +75 -19
- package/dist/clickable-hints.js.map +1 -1
- package/dist/components/editor.d.ts +39 -0
- package/dist/components/editor.d.ts.map +1 -1
- package/dist/components/editor.js +110 -0
- package/dist/components/editor.js.map +1 -1
- package/dist/components/scroll-view.d.ts +17 -0
- package/dist/components/scroll-view.d.ts.map +1 -1
- package/dist/components/scroll-view.js +40 -0
- package/dist/components/scroll-view.js.map +1 -1
- package/dist/components/windowed-container.d.ts +87 -0
- package/dist/components/windowed-container.d.ts.map +1 -1
- package/dist/components/windowed-container.js +212 -3
- package/dist/components/windowed-container.js.map +1 -1
- package/dist/editor-component.d.ts +9 -0
- package/dist/editor-component.d.ts.map +1 -1
- package/dist/editor-component.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/kill-ring.d.ts +2 -0
- package/dist/kill-ring.d.ts.map +1 -1
- package/dist/kill-ring.js +6 -0
- package/dist/kill-ring.js.map +1 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +6 -1
- package/dist/layout.js.map +1 -1
- package/dist/tui-alt-screen.d.ts +45 -1
- package/dist/tui-alt-screen.d.ts.map +1 -1
- package/dist/tui-alt-screen.js +550 -48
- package/dist/tui-alt-screen.js.map +1 -1
- package/dist/tui-main-screen.d.ts +27 -1
- package/dist/tui-main-screen.d.ts.map +1 -1
- package/dist/tui-main-screen.js +216 -15
- package/dist/tui-main-screen.js.map +1 -1
- package/dist/tui.d.ts +56 -4
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +58 -7
- package/dist/tui.js.map +1 -1
- package/dist/undo-stack.d.ts +2 -0
- package/dist/undo-stack.d.ts.map +1 -1
- package/dist/undo-stack.js +6 -0
- package/dist/undo-stack.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,8 @@ export interface ScrollViewOptions {
|
|
|
14
14
|
export interface ScrollViewScrollToOptions {
|
|
15
15
|
/** Keep follow-end disabled even when the target is the current content end. */
|
|
16
16
|
disableFollow?: boolean;
|
|
17
|
+
/** Show this row in the next frame even if rows above it change before then: a jump, not a held place. */
|
|
18
|
+
exact?: boolean;
|
|
17
19
|
}
|
|
18
20
|
export declare class ScrollView extends Container {
|
|
19
21
|
private readonly child;
|
|
@@ -25,6 +27,10 @@ export declare class ScrollView extends Container {
|
|
|
25
27
|
private currentScrollbar;
|
|
26
28
|
private readonly scrollbarHideDelayMs;
|
|
27
29
|
private currentScrollTop;
|
|
30
|
+
/** Rows `scrollBy` moved since the last layout; undefined once the view was moved to an absolute row. */
|
|
31
|
+
private movedSinceLayout;
|
|
32
|
+
/** Whether an exact jump was asked for since the last layout. */
|
|
33
|
+
private exactSinceLayout;
|
|
28
34
|
private contentHeight;
|
|
29
35
|
private currentViewportHeight;
|
|
30
36
|
private followingEnd;
|
|
@@ -33,8 +39,19 @@ export declare class ScrollView extends Container {
|
|
|
33
39
|
private transientScrollbarVisible;
|
|
34
40
|
private scrollbarActive;
|
|
35
41
|
private scrollbarHideTimer;
|
|
42
|
+
private historyNavigation?;
|
|
43
|
+
/** Observe explicit navigation, including a turn clamped at the edge of a partial transcript. Layout is silent. */
|
|
44
|
+
setHistoryNavigation(listener?: (action: "older" | "newer" | "start" | "end") => void): void;
|
|
36
45
|
constructor(component: Component, options?: ScrollViewOptions);
|
|
46
|
+
get hasHistoryNavigation(): boolean;
|
|
37
47
|
get scrollTop(): number;
|
|
48
|
+
/**
|
|
49
|
+
* Rows the reader scrolled by since the last layout, relative to the rows it showed then; undefined after a move to
|
|
50
|
+
* an absolute row. Content added or removed above those rows meanwhile does not move what the scroll lands on.
|
|
51
|
+
*/
|
|
52
|
+
get scrolledSinceLayout(): number | undefined;
|
|
53
|
+
/** Whether the next frame must show the row last jumped to with `exact`, whatever changed above it. */
|
|
54
|
+
get jumpedSinceLayout(): boolean;
|
|
38
55
|
get isFollowingEnd(): boolean;
|
|
39
56
|
get viewportHeight(): number;
|
|
40
57
|
get scrollbar(): ScrollViewScrollbar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-view.d.ts","sourceRoot":"","sources":["../../src/components/scroll-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAStD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IACjC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,yBAAyB;IACzC,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"scroll-view.d.ts","sourceRoot":"","sources":["../../src/components/scroll-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE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GAAG,IAAI,CAwBzE;IAED,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgB9B;IAED,aAAa,IAAI,IAAI,CAapB;IAED,WAAW,IAAI,IAAI,CAYlB;IAED,YAAY,CACX,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,IAAI,EACzB,iBAAiB,CAAC,EAAE,MAAM,GACxB,IAAI,CAcN;IAEQ,QAAQ,CAAC,UAAU,EAAE,SAAS,GAAG,IAAI,CAE7C;IAEQ,WAAW,CAAC,UAAU,EAAE,SAAS,GAAG,IAAI,CAEhD;IAEQ,KAAK,IAAI,IAAI,CAErB;IAEQ,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAIvC;IAED,CAAC,WAAW,CAAC,IAAI,gBAAgB,CAEhC;CACD"}
|
|
@@ -17,6 +17,10 @@ export class ScrollView extends Container {
|
|
|
17
17
|
currentScrollbar;
|
|
18
18
|
scrollbarHideDelayMs;
|
|
19
19
|
currentScrollTop = 0;
|
|
20
|
+
/** Rows `scrollBy` moved since the last layout; undefined once the view was moved to an absolute row. */
|
|
21
|
+
movedSinceLayout = 0;
|
|
22
|
+
/** Whether an exact jump was asked for since the last layout. */
|
|
23
|
+
exactSinceLayout = false;
|
|
20
24
|
contentHeight = 0;
|
|
21
25
|
currentViewportHeight = 0;
|
|
22
26
|
followingEnd;
|
|
@@ -25,6 +29,11 @@ export class ScrollView extends Container {
|
|
|
25
29
|
transientScrollbarVisible = false;
|
|
26
30
|
scrollbarActive = false;
|
|
27
31
|
scrollbarHideTimer;
|
|
32
|
+
historyNavigation;
|
|
33
|
+
/** Observe explicit navigation, including a turn clamped at the edge of a partial transcript. Layout is silent. */
|
|
34
|
+
setHistoryNavigation(listener) {
|
|
35
|
+
this.historyNavigation = listener;
|
|
36
|
+
}
|
|
28
37
|
constructor(component, options = {}) {
|
|
29
38
|
super();
|
|
30
39
|
if (options.axis !== undefined && options.axis !== "vertical") {
|
|
@@ -43,9 +52,23 @@ export class ScrollView extends Container {
|
|
|
43
52
|
this.scrollbarThumbStyle = options.scrollbarThumbStyle ?? ((text) => (plain ? text : `\x1b[37m${text}\x1b[39m`));
|
|
44
53
|
this.scrollbarHideDelayMs = Math.max(0, Math.floor(options.scrollbarHideDelayMs ?? 1000));
|
|
45
54
|
}
|
|
55
|
+
get hasHistoryNavigation() {
|
|
56
|
+
return this.historyNavigation !== undefined;
|
|
57
|
+
}
|
|
46
58
|
get scrollTop() {
|
|
47
59
|
return this.currentScrollTop;
|
|
48
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Rows the reader scrolled by since the last layout, relative to the rows it showed then; undefined after a move to
|
|
63
|
+
* an absolute row. Content added or removed above those rows meanwhile does not move what the scroll lands on.
|
|
64
|
+
*/
|
|
65
|
+
get scrolledSinceLayout() {
|
|
66
|
+
return this.movedSinceLayout;
|
|
67
|
+
}
|
|
68
|
+
/** Whether the next frame must show the row last jumped to with `exact`, whatever changed above it. */
|
|
69
|
+
get jumpedSinceLayout() {
|
|
70
|
+
return this.exactSinceLayout;
|
|
71
|
+
}
|
|
49
72
|
get isFollowingEnd() {
|
|
50
73
|
return this.followingEnd;
|
|
51
74
|
}
|
|
@@ -111,6 +134,10 @@ export class ScrollView extends Container {
|
|
|
111
134
|
const requested = Number.isFinite(scrollTop) ? Math.trunc(scrollTop) : this.currentScrollTop;
|
|
112
135
|
const maxScrollTop = Math.max(0, this.contentHeight - this.currentViewportHeight);
|
|
113
136
|
const next = Math.max(0, Math.min(maxScrollTop, requested));
|
|
137
|
+
if (options.exact) {
|
|
138
|
+
this.exactSinceLayout = true;
|
|
139
|
+
this.movedSinceLayout = undefined;
|
|
140
|
+
}
|
|
114
141
|
const nextFollowSuppressedAtEnd = options.disableFollow === true && next === maxScrollTop;
|
|
115
142
|
const nextFollowingEnd = !nextFollowSuppressedAtEnd && this.followEnd && next === maxScrollTop;
|
|
116
143
|
if (next === this.currentScrollTop &&
|
|
@@ -119,6 +146,8 @@ export class ScrollView extends Container {
|
|
|
119
146
|
return;
|
|
120
147
|
}
|
|
121
148
|
const moved = next !== this.currentScrollTop;
|
|
149
|
+
if (moved)
|
|
150
|
+
this.movedSinceLayout = undefined;
|
|
122
151
|
this.currentScrollTop = next;
|
|
123
152
|
this.followingEnd = nextFollowingEnd;
|
|
124
153
|
this.followSuppressedAtEnd = nextFollowSuppressedAtEnd;
|
|
@@ -135,6 +164,8 @@ export class ScrollView extends Container {
|
|
|
135
164
|
const next = Math.max(0, Math.min(maxScrollTop, start + requested));
|
|
136
165
|
const moved = next - start;
|
|
137
166
|
const wasFollowingEnd = this.followingEnd;
|
|
167
|
+
if (this.movedSinceLayout !== undefined)
|
|
168
|
+
this.movedSinceLayout += next - this.currentScrollTop;
|
|
138
169
|
this.currentScrollTop = next;
|
|
139
170
|
this.followingEnd = this.followEnd && next === maxScrollTop;
|
|
140
171
|
this.followSuppressedAtEnd = false;
|
|
@@ -142,11 +173,14 @@ export class ScrollView extends Container {
|
|
|
142
173
|
this.markScrollbarActivity();
|
|
143
174
|
if (moved !== 0 || this.followingEnd !== wasFollowingEnd)
|
|
144
175
|
this.requestRenderCallback?.();
|
|
176
|
+
this.historyNavigation?.(requested < 0 ? "older" : "newer");
|
|
145
177
|
return requested - moved;
|
|
146
178
|
}
|
|
147
179
|
scrollToStart() {
|
|
148
180
|
const changed = this.currentScrollTop !== 0 ||
|
|
149
181
|
this.followingEnd !== (this.followEnd && this.contentHeight <= this.currentViewportHeight);
|
|
182
|
+
if (this.currentScrollTop !== 0)
|
|
183
|
+
this.movedSinceLayout = undefined;
|
|
150
184
|
this.currentScrollTop = 0;
|
|
151
185
|
this.followingEnd = this.followEnd && this.contentHeight <= this.currentViewportHeight;
|
|
152
186
|
this.followSuppressedAtEnd = false;
|
|
@@ -154,10 +188,13 @@ export class ScrollView extends Container {
|
|
|
154
188
|
this.markScrollbarActivity();
|
|
155
189
|
this.requestRenderCallback?.();
|
|
156
190
|
}
|
|
191
|
+
this.historyNavigation?.("start");
|
|
157
192
|
}
|
|
158
193
|
scrollToEnd() {
|
|
159
194
|
const next = Math.max(0, this.contentHeight - this.currentViewportHeight);
|
|
160
195
|
const changed = this.currentScrollTop !== next || this.followingEnd !== this.followEnd;
|
|
196
|
+
if (this.currentScrollTop !== next)
|
|
197
|
+
this.movedSinceLayout = undefined;
|
|
161
198
|
this.currentScrollTop = next;
|
|
162
199
|
this.followingEnd = this.followEnd;
|
|
163
200
|
this.followSuppressedAtEnd = false;
|
|
@@ -165,11 +202,14 @@ export class ScrollView extends Container {
|
|
|
165
202
|
this.markScrollbarActivity();
|
|
166
203
|
this.requestRenderCallback?.();
|
|
167
204
|
}
|
|
205
|
+
this.historyNavigation?.("end");
|
|
168
206
|
}
|
|
169
207
|
updateLayout(contentHeight, viewportHeight, requestRender, anchoredScrollTop) {
|
|
170
208
|
this.contentHeight = Math.max(0, Math.floor(contentHeight));
|
|
171
209
|
this.currentViewportHeight = Math.max(0, Math.floor(viewportHeight));
|
|
172
210
|
this.requestRenderCallback = requestRender;
|
|
211
|
+
this.movedSinceLayout = 0;
|
|
212
|
+
this.exactSinceLayout = false;
|
|
173
213
|
const maxScrollTop = Math.max(0, this.contentHeight - this.currentViewportHeight);
|
|
174
214
|
if (this.followingEnd)
|
|
175
215
|
this.currentScrollTop = maxScrollTop;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-view.js","sourceRoot":"","sources":["../../src/components/scroll-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAkB,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtD,uEAAuE;AACvE,SAAS,cAAc,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IAC3D,IAAI,GAAG,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,WAAW,EAAE,IAA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AAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC9C,OAAO,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;IACzE,CAAC;IAED,CAAC,WAAW,CAAC;QACZ,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC/D,CAAC;CACD","sourcesContent":["import { LAYOUT_NODE, type ScrollLayoutNode } from \"../layout-node.ts\";\nimport { type Component, Container } from \"../tui.ts\";\n\n/** Whether NO_COLOR (any value) or FORCE_COLOR=0 asks for no color. */\nfunction colorTurnedOff(env: NodeJS.ProcessEnv = process.env): boolean {\n\tif (env.NO_COLOR !== undefined) return true;\n\tconst forced = env.FORCE_COLOR?.trim().toLowerCase();\n\treturn forced === \"0\" || forced === \"false\";\n}\n\nexport type ScrollViewScrollbar = \"hidden\" | \"auto\" | \"always\";\n\nexport interface ScrollViewOptions {\n\taxis?: \"vertical\";\n\tfollow?: \"none\" | \"end\";\n\tprimary?: boolean;\n\toverscroll?: \"chain\" | \"contain\";\n\tscrollbar?: ScrollViewScrollbar;\n\tscrollbarTrackStyle?: (text: string) => string;\n\tscrollbarThumbStyle?: (text: string) => string;\n\tscrollbarHideDelayMs?: number;\n}\n\nexport interface ScrollViewScrollToOptions {\n\t/** Keep follow-end disabled even when the target is the current content end. */\n\tdisableFollow?: boolean;\n}\n\nexport class ScrollView extends Container {\n\tprivate readonly child: Component;\n\treadonly followEnd: boolean;\n\treadonly primary: boolean;\n\treadonly overscroll: \"chain\" | \"contain\";\n\treadonly scrollbarTrackStyle: (text: string) => string;\n\treadonly scrollbarThumbStyle: (text: string) => string;\n\tprivate currentScrollbar: ScrollViewScrollbar;\n\tprivate readonly scrollbarHideDelayMs: number;\n\tprivate currentScrollTop = 0;\n\tprivate contentHeight = 0;\n\tprivate currentViewportHeight = 0;\n\tprivate followingEnd: boolean;\n\tprivate followSuppressedAtEnd = false;\n\tprivate requestRenderCallback: (() => void) | undefined;\n\tprivate transientScrollbarVisible = false;\n\tprivate scrollbarActive = false;\n\tprivate scrollbarHideTimer: NodeJS.Timeout | undefined;\n\n\tconstructor(component: Component, options: ScrollViewOptions = {}) {\n\t\tsuper();\n\t\tif (options.axis !== undefined && options.axis !== \"vertical\") {\n\t\t\tthrow new Error(`Unsupported ScrollView axis: ${options.axis}`);\n\t\t}\n\t\tthis.child = component;\n\t\tthis.children.push(component);\n\t\tthis.followEnd = (options.follow ?? \"none\") === \"end\";\n\t\tthis.followingEnd = this.followEnd;\n\t\tthis.primary = options.primary ?? false;\n\t\tthis.overscroll = options.overscroll ?? \"chain\";\n\t\tthis.currentScrollbar = options.scrollbar ?? \"hidden\";\n\t\t// The default styles honor NO_COLOR and FORCE_COLOR=0, read once here rather than on every painted cell.\n\t\tconst plain = colorTurnedOff();\n\t\tthis.scrollbarTrackStyle = options.scrollbarTrackStyle ?? ((text) => (plain ? text : `\\x1b[90m${text}\\x1b[39m`));\n\t\tthis.scrollbarThumbStyle = options.scrollbarThumbStyle ?? ((text) => (plain ? text : `\\x1b[37m${text}\\x1b[39m`));\n\t\tthis.scrollbarHideDelayMs = Math.max(0, Math.floor(options.scrollbarHideDelayMs ?? 1000));\n\t}\n\n\tget scrollTop(): number {\n\t\treturn this.currentScrollTop;\n\t}\n\n\tget isFollowingEnd(): boolean {\n\t\treturn this.followingEnd;\n\t}\n\n\tget viewportHeight(): number {\n\t\treturn this.currentViewportHeight;\n\t}\n\n\tget scrollbar(): ScrollViewScrollbar {\n\t\treturn this.currentScrollbar;\n\t}\n\n\tget isScrollbarVisible(): boolean {\n\t\tif (this.scrollbar === \"always\") return this.currentViewportHeight > 0;\n\t\treturn (\n\t\t\tthis.scrollbar === \"auto\" && this.contentHeight > this.currentViewportHeight && this.transientScrollbarVisible\n\t\t);\n\t}\n\n\tget isScrollbarActive(): boolean {\n\t\treturn this.scrollbarActive;\n\t}\n\n\tsetScrollbar(scrollbar: ScrollViewScrollbar): void {\n\t\tif (scrollbar === this.currentScrollbar) return;\n\t\tthis.currentScrollbar = scrollbar;\n\t\tif (scrollbar !== \"auto\") this.hideTransientScrollbar();\n\t\telse if (this.scrollbarActive) this.markScrollbarActivity();\n\t\tthis.requestRenderCallback?.();\n\t}\n\n\tgetContentWidth(width: number): number {\n\t\treturn this.scrollbar === \"always\" && width > 1 ? width - 1 : width;\n\t}\n\n\tprivate markScrollbarActivity(): void {\n\t\tif (this.scrollbar !== \"auto\" || this.contentHeight <= this.currentViewportHeight) return;\n\t\tthis.transientScrollbarVisible = true;\n\t\tif (this.scrollbarHideTimer) {\n\t\t\tclearTimeout(this.scrollbarHideTimer);\n\t\t\tthis.scrollbarHideTimer = undefined;\n\t\t}\n\t\tif (this.scrollbarActive) return;\n\t\tthis.scrollbarHideTimer = setTimeout(() => {\n\t\t\tthis.scrollbarHideTimer = undefined;\n\t\t\tthis.transientScrollbarVisible = false;\n\t\t\tthis.requestRenderCallback?.();\n\t\t}, this.scrollbarHideDelayMs);\n\t\tthis.scrollbarHideTimer.unref();\n\t}\n\n\tprivate hideTransientScrollbar(): void {\n\t\tthis.transientScrollbarVisible = false;\n\t\tif (!this.scrollbarHideTimer) return;\n\t\tclearTimeout(this.scrollbarHideTimer);\n\t\tthis.scrollbarHideTimer = undefined;\n\t}\n\n\tsetScrollbarActive(active: boolean): void {\n\t\tif (active === this.scrollbarActive) return;\n\t\tthis.scrollbarActive = active;\n\t\tthis.markScrollbarActivity();\n\t\tthis.requestRenderCallback?.();\n\t}\n\n\tscrollTo(scrollTop: number, options: ScrollViewScrollToOptions = {}): void {\n\t\tconst requested = Number.isFinite(scrollTop) ? Math.trunc(scrollTop) : this.currentScrollTop;\n\t\tconst maxScrollTop = Math.max(0, this.contentHeight - this.currentViewportHeight);\n\t\tconst next = Math.max(0, Math.min(maxScrollTop, requested));\n\t\tconst nextFollowSuppressedAtEnd = options.disableFollow === true && next === maxScrollTop;\n\t\tconst nextFollowingEnd = !nextFollowSuppressedAtEnd && this.followEnd && next === maxScrollTop;\n\t\tif (\n\t\t\tnext === this.currentScrollTop &&\n\t\t\tnextFollowingEnd === this.followingEnd &&\n\t\t\tnextFollowSuppressedAtEnd === this.followSuppressedAtEnd\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst moved = next !== this.currentScrollTop;\n\t\tthis.currentScrollTop = next;\n\t\tthis.followingEnd = nextFollowingEnd;\n\t\tthis.followSuppressedAtEnd = nextFollowSuppressedAtEnd;\n\t\tif (moved) this.markScrollbarActivity();\n\t\tthis.requestRenderCallback?.();\n\t}\n\n\tscrollBy(lines: number): number {\n\t\tconst requested = Number.isFinite(lines) ? Math.trunc(lines) : 0;\n\t\tif (requested === 0) return 0;\n\t\tconst maxScrollTop = Math.max(0, this.contentHeight - this.currentViewportHeight);\n\t\tconst start = this.followingEnd ? maxScrollTop : this.currentScrollTop;\n\t\tconst next = Math.max(0, Math.min(maxScrollTop, start + requested));\n\t\tconst moved = next - start;\n\t\tconst wasFollowingEnd = this.followingEnd;\n\t\tthis.currentScrollTop = next;\n\t\tthis.followingEnd = this.followEnd && next === maxScrollTop;\n\t\tthis.followSuppressedAtEnd = false;\n\t\tif (moved !== 0) this.markScrollbarActivity();\n\t\tif (moved !== 0 || this.followingEnd !== wasFollowingEnd) this.requestRenderCallback?.();\n\t\treturn requested - moved;\n\t}\n\n\tscrollToStart(): void {\n\t\tconst changed =\n\t\t\tthis.currentScrollTop !== 0 ||\n\t\t\tthis.followingEnd !== (this.followEnd && this.contentHeight <= this.currentViewportHeight);\n\t\tthis.currentScrollTop = 0;\n\t\tthis.followingEnd = this.followEnd && this.contentHeight <= this.currentViewportHeight;\n\t\tthis.followSuppressedAtEnd = false;\n\t\tif (changed) {\n\t\t\tthis.markScrollbarActivity();\n\t\t\tthis.requestRenderCallback?.();\n\t\t}\n\t}\n\n\tscrollToEnd(): void {\n\t\tconst next = Math.max(0, this.contentHeight - this.currentViewportHeight);\n\t\tconst changed = this.currentScrollTop !== next || this.followingEnd !== this.followEnd;\n\t\tthis.currentScrollTop = next;\n\t\tthis.followingEnd = this.followEnd;\n\t\tthis.followSuppressedAtEnd = false;\n\t\tif (changed) {\n\t\t\tthis.markScrollbarActivity();\n\t\t\tthis.requestRenderCallback?.();\n\t\t}\n\t}\n\n\tupdateLayout(\n\t\tcontentHeight: number,\n\t\tviewportHeight: number,\n\t\trequestRender: () => void,\n\t\tanchoredScrollTop?: number,\n\t): void {\n\t\tthis.contentHeight = Math.max(0, Math.floor(contentHeight));\n\t\tthis.currentViewportHeight = Math.max(0, Math.floor(viewportHeight));\n\t\tthis.requestRenderCallback = requestRender;\n\t\tconst maxScrollTop = Math.max(0, this.contentHeight - this.currentViewportHeight);\n\t\tif (this.followingEnd) this.currentScrollTop = maxScrollTop;\n\t\telse this.currentScrollTop = Math.max(0, Math.min(anchoredScrollTop ?? this.currentScrollTop, maxScrollTop));\n\t\tif (this.currentScrollTop < maxScrollTop) this.followSuppressedAtEnd = false;\n\t\tif (this.followEnd && this.currentScrollTop === maxScrollTop && !this.followSuppressedAtEnd) {\n\t\t\tthis.followingEnd = true;\n\t\t}\n\t\tif (this.contentHeight <= this.currentViewportHeight) this.hideTransientScrollbar();\n\t}\n\n\toverride addChild(_component: Component): void {\n\t\tthrow new Error(\"ScrollView has exactly one child\");\n\t}\n\n\toverride removeChild(_component: Component): void {\n\t\tthrow new Error(\"ScrollView child cannot be removed\");\n\t}\n\n\toverride clear(): void {\n\t\tthrow new Error(\"ScrollView child cannot be cleared\");\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst contentWidth = this.getContentWidth(width);\n\t\tconst lines = this.child.render(contentWidth);\n\t\treturn contentWidth === width ? lines : lines.map((line) => `${line} `);\n\t}\n\n\t[LAYOUT_NODE](): ScrollLayoutNode {\n\t\treturn { type: \"scroll\", component: this.child, state: this };\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"scroll-view.js","sourceRoot":"","sources":["../../src/components/scroll-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAyB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAkB,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtD,uEAAuE;AACvE,SAAS,cAAc,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IAC3D,IAAI,GAAG,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAC5C,MAAM,MAAM,GAAG,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrD,OAAO,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,OAAO,CAAC;AAC7C,CAAC;AAsBD,MAAM,OAAO,UAAW,SAAQ,SAAS;IACvB,KAAK,CAAY;IACzB,SAAS,CAAU;IACnB,OAAO,CAAU;IACjB,UAAU,CAAsB;IAChC,mBAAmB,CAA2B;IAC9C,mBAAmB,CAA2B;IAC/C,gBAAgB,CAAsB;IAC7B,oBAAoB,CAAS;IACtC,gBAAgB,GAAG,CAAC,CAAC;IAC7B,yGAAyG;IACjG,gBAAgB,GAAuB,CAAC,CAAC;IACjD,iEAAiE;IACzD,gBAAgB,GAAG,KAAK,CAAC;IACzB,aAAa,GAAG,CAAC,CAAC;IAClB,qBAAqB,GAAG,CAAC,CAAC;IAC1B,YAAY,CAAU;IACtB,qBAAqB,GAAG,KAAK,CAAC;IAC9B,qBAAqB,CAA2B;IAChD,yBAAyB,GAAG,KAAK,CAAC;IAClC,eAAe,GAAG,KAAK,CAAC;IACxB,kBAAkB,CAA6B;IAC/C,iBAAiB,CAAyD;IAElF,mHAAmH;IACnH,oBAAoB,CAAC,QAAgE;QACpF,IAAI,CAAC,iBAAiB,GAAG,QAA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C,gBAAgB,KAAK,YAAY,IAAI,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC7F,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAC1B,CAAC;QACD,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,qBAAqB;YAAE,IAAI,CAAC,sBAAsB,EAAE,CAAC;IACrF,CAAC;IAEQ,QAAQ,CAAC,UAAqB;QACtC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACrD,CAAC;IAEQ,WAAW,CAAC,UAAqB;QACzC,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACvD,CAAC;IAEQ,KAAK;QACb,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACvD,CAAC;IAEQ,MAAM,CAAC,KAAa;QAC5B,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACjD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC9C,OAAO,YAAY,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;IACzE,CAAC;IAED,CAAC,WAAW,CAAC;QACZ,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAC/D,CAAC;CACD","sourcesContent":["import { LAYOUT_NODE, type ScrollLayoutNode } from \"../layout-node.ts\";\nimport { type Component, Container } from \"../tui.ts\";\n\n/** Whether NO_COLOR (any value) or FORCE_COLOR=0 asks for no color. */\nfunction colorTurnedOff(env: NodeJS.ProcessEnv = process.env): boolean {\n\tif (env.NO_COLOR !== undefined) return true;\n\tconst forced = env.FORCE_COLOR?.trim().toLowerCase();\n\treturn forced === \"0\" || forced === \"false\";\n}\n\nexport type ScrollViewScrollbar = \"hidden\" | \"auto\" | \"always\";\n\nexport interface ScrollViewOptions {\n\taxis?: \"vertical\";\n\tfollow?: \"none\" | \"end\";\n\tprimary?: boolean;\n\toverscroll?: \"chain\" | \"contain\";\n\tscrollbar?: ScrollViewScrollbar;\n\tscrollbarTrackStyle?: (text: string) => string;\n\tscrollbarThumbStyle?: (text: string) => string;\n\tscrollbarHideDelayMs?: number;\n}\n\nexport interface ScrollViewScrollToOptions {\n\t/** Keep follow-end disabled even when the target is the current content end. */\n\tdisableFollow?: boolean;\n\t/** Show this row in the next frame even if rows above it change before then: a jump, not a held place. */\n\texact?: boolean;\n}\n\nexport class ScrollView extends Container {\n\tprivate readonly child: Component;\n\treadonly followEnd: boolean;\n\treadonly primary: boolean;\n\treadonly overscroll: \"chain\" | \"contain\";\n\treadonly scrollbarTrackStyle: (text: string) => string;\n\treadonly scrollbarThumbStyle: (text: string) => string;\n\tprivate currentScrollbar: ScrollViewScrollbar;\n\tprivate readonly scrollbarHideDelayMs: number;\n\tprivate currentScrollTop = 0;\n\t/** Rows `scrollBy` moved since the last layout; undefined once the view was moved to an absolute row. */\n\tprivate movedSinceLayout: number | undefined = 0;\n\t/** Whether an exact jump was asked for since the last layout. */\n\tprivate exactSinceLayout = false;\n\tprivate contentHeight = 0;\n\tprivate currentViewportHeight = 0;\n\tprivate followingEnd: boolean;\n\tprivate followSuppressedAtEnd = false;\n\tprivate requestRenderCallback: (() => void) | undefined;\n\tprivate transientScrollbarVisible = false;\n\tprivate scrollbarActive = false;\n\tprivate scrollbarHideTimer: NodeJS.Timeout | undefined;\n\tprivate historyNavigation?: (action: \"older\" | \"newer\" | \"start\" | \"end\") => void;\n\n\t/** Observe explicit navigation, including a turn clamped at the edge of a partial transcript. Layout is silent. */\n\tsetHistoryNavigation(listener?: (action: \"older\" | \"newer\" | \"start\" | \"end\") => void): void {\n\t\tthis.historyNavigation = listener;\n\t}\n\n\tconstructor(component: Component, options: ScrollViewOptions = {}) {\n\t\tsuper();\n\t\tif (options.axis !== undefined && options.axis !== \"vertical\") {\n\t\t\tthrow new Error(`Unsupported ScrollView axis: ${options.axis}`);\n\t\t}\n\t\tthis.child = component;\n\t\tthis.children.push(component);\n\t\tthis.followEnd = (options.follow ?? \"none\") === \"end\";\n\t\tthis.followingEnd = this.followEnd;\n\t\tthis.primary = options.primary ?? false;\n\t\tthis.overscroll = options.overscroll ?? \"chain\";\n\t\tthis.currentScrollbar = options.scrollbar ?? \"hidden\";\n\t\t// The default styles honor NO_COLOR and FORCE_COLOR=0, read once here rather than on every painted cell.\n\t\tconst plain = colorTurnedOff();\n\t\tthis.scrollbarTrackStyle = options.scrollbarTrackStyle ?? ((text) => (plain ? text : `\\x1b[90m${text}\\x1b[39m`));\n\t\tthis.scrollbarThumbStyle = options.scrollbarThumbStyle ?? ((text) => (plain ? text : `\\x1b[37m${text}\\x1b[39m`));\n\t\tthis.scrollbarHideDelayMs = Math.max(0, Math.floor(options.scrollbarHideDelayMs ?? 1000));\n\t}\n\n\tget hasHistoryNavigation(): boolean {\n\t\treturn this.historyNavigation !== undefined;\n\t}\n\n\tget scrollTop(): number {\n\t\treturn this.currentScrollTop;\n\t}\n\n\t/**\n\t * Rows the reader scrolled by since the last layout, relative to the rows it showed then; undefined after a move to\n\t * an absolute row. Content added or removed above those rows meanwhile does not move what the scroll lands on.\n\t */\n\tget scrolledSinceLayout(): number | undefined {\n\t\treturn this.movedSinceLayout;\n\t}\n\n\t/** Whether the next frame must show the row last jumped to with `exact`, whatever changed above it. */\n\tget jumpedSinceLayout(): boolean {\n\t\treturn this.exactSinceLayout;\n\t}\n\n\tget isFollowingEnd(): boolean {\n\t\treturn this.followingEnd;\n\t}\n\n\tget viewportHeight(): number {\n\t\treturn this.currentViewportHeight;\n\t}\n\n\tget scrollbar(): ScrollViewScrollbar {\n\t\treturn this.currentScrollbar;\n\t}\n\n\tget isScrollbarVisible(): boolean {\n\t\tif (this.scrollbar === \"always\") return this.currentViewportHeight > 0;\n\t\treturn (\n\t\t\tthis.scrollbar === \"auto\" && this.contentHeight > this.currentViewportHeight && this.transientScrollbarVisible\n\t\t);\n\t}\n\n\tget isScrollbarActive(): boolean {\n\t\treturn this.scrollbarActive;\n\t}\n\n\tsetScrollbar(scrollbar: ScrollViewScrollbar): void {\n\t\tif (scrollbar === this.currentScrollbar) return;\n\t\tthis.currentScrollbar = scrollbar;\n\t\tif (scrollbar !== \"auto\") this.hideTransientScrollbar();\n\t\telse if (this.scrollbarActive) this.markScrollbarActivity();\n\t\tthis.requestRenderCallback?.();\n\t}\n\n\tgetContentWidth(width: number): number {\n\t\treturn this.scrollbar === \"always\" && width > 1 ? width - 1 : width;\n\t}\n\n\tprivate markScrollbarActivity(): void {\n\t\tif (this.scrollbar !== \"auto\" || this.contentHeight <= this.currentViewportHeight) return;\n\t\tthis.transientScrollbarVisible = true;\n\t\tif (this.scrollbarHideTimer) {\n\t\t\tclearTimeout(this.scrollbarHideTimer);\n\t\t\tthis.scrollbarHideTimer = undefined;\n\t\t}\n\t\tif (this.scrollbarActive) return;\n\t\tthis.scrollbarHideTimer = setTimeout(() => {\n\t\t\tthis.scrollbarHideTimer = undefined;\n\t\t\tthis.transientScrollbarVisible = false;\n\t\t\tthis.requestRenderCallback?.();\n\t\t}, this.scrollbarHideDelayMs);\n\t\tthis.scrollbarHideTimer.unref();\n\t}\n\n\tprivate hideTransientScrollbar(): void {\n\t\tthis.transientScrollbarVisible = false;\n\t\tif (!this.scrollbarHideTimer) return;\n\t\tclearTimeout(this.scrollbarHideTimer);\n\t\tthis.scrollbarHideTimer = undefined;\n\t}\n\n\tsetScrollbarActive(active: boolean): void {\n\t\tif (active === this.scrollbarActive) return;\n\t\tthis.scrollbarActive = active;\n\t\tthis.markScrollbarActivity();\n\t\tthis.requestRenderCallback?.();\n\t}\n\n\tscrollTo(scrollTop: number, options: ScrollViewScrollToOptions = {}): void {\n\t\tconst requested = Number.isFinite(scrollTop) ? Math.trunc(scrollTop) : this.currentScrollTop;\n\t\tconst maxScrollTop = Math.max(0, this.contentHeight - this.currentViewportHeight);\n\t\tconst next = Math.max(0, Math.min(maxScrollTop, requested));\n\t\tif (options.exact) {\n\t\t\tthis.exactSinceLayout = true;\n\t\t\tthis.movedSinceLayout = undefined;\n\t\t}\n\t\tconst nextFollowSuppressedAtEnd = options.disableFollow === true && next === maxScrollTop;\n\t\tconst nextFollowingEnd = !nextFollowSuppressedAtEnd && this.followEnd && next === maxScrollTop;\n\t\tif (\n\t\t\tnext === this.currentScrollTop &&\n\t\t\tnextFollowingEnd === this.followingEnd &&\n\t\t\tnextFollowSuppressedAtEnd === this.followSuppressedAtEnd\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tconst moved = next !== this.currentScrollTop;\n\t\tif (moved) this.movedSinceLayout = undefined;\n\t\tthis.currentScrollTop = next;\n\t\tthis.followingEnd = nextFollowingEnd;\n\t\tthis.followSuppressedAtEnd = nextFollowSuppressedAtEnd;\n\t\tif (moved) this.markScrollbarActivity();\n\t\tthis.requestRenderCallback?.();\n\t}\n\n\tscrollBy(lines: number): number {\n\t\tconst requested = Number.isFinite(lines) ? Math.trunc(lines) : 0;\n\t\tif (requested === 0) return 0;\n\t\tconst maxScrollTop = Math.max(0, this.contentHeight - this.currentViewportHeight);\n\t\tconst start = this.followingEnd ? maxScrollTop : this.currentScrollTop;\n\t\tconst next = Math.max(0, Math.min(maxScrollTop, start + requested));\n\t\tconst moved = next - start;\n\t\tconst wasFollowingEnd = this.followingEnd;\n\t\tif (this.movedSinceLayout !== undefined) this.movedSinceLayout += next - this.currentScrollTop;\n\t\tthis.currentScrollTop = next;\n\t\tthis.followingEnd = this.followEnd && next === maxScrollTop;\n\t\tthis.followSuppressedAtEnd = false;\n\t\tif (moved !== 0) this.markScrollbarActivity();\n\t\tif (moved !== 0 || this.followingEnd !== wasFollowingEnd) this.requestRenderCallback?.();\n\t\tthis.historyNavigation?.(requested < 0 ? \"older\" : \"newer\");\n\t\treturn requested - moved;\n\t}\n\n\tscrollToStart(): void {\n\t\tconst changed =\n\t\t\tthis.currentScrollTop !== 0 ||\n\t\t\tthis.followingEnd !== (this.followEnd && this.contentHeight <= this.currentViewportHeight);\n\t\tif (this.currentScrollTop !== 0) this.movedSinceLayout = undefined;\n\t\tthis.currentScrollTop = 0;\n\t\tthis.followingEnd = this.followEnd && this.contentHeight <= this.currentViewportHeight;\n\t\tthis.followSuppressedAtEnd = false;\n\t\tif (changed) {\n\t\t\tthis.markScrollbarActivity();\n\t\t\tthis.requestRenderCallback?.();\n\t\t}\n\t\tthis.historyNavigation?.(\"start\");\n\t}\n\n\tscrollToEnd(): void {\n\t\tconst next = Math.max(0, this.contentHeight - this.currentViewportHeight);\n\t\tconst changed = this.currentScrollTop !== next || this.followingEnd !== this.followEnd;\n\t\tif (this.currentScrollTop !== next) this.movedSinceLayout = undefined;\n\t\tthis.currentScrollTop = next;\n\t\tthis.followingEnd = this.followEnd;\n\t\tthis.followSuppressedAtEnd = false;\n\t\tif (changed) {\n\t\t\tthis.markScrollbarActivity();\n\t\t\tthis.requestRenderCallback?.();\n\t\t}\n\t\tthis.historyNavigation?.(\"end\");\n\t}\n\n\tupdateLayout(\n\t\tcontentHeight: number,\n\t\tviewportHeight: number,\n\t\trequestRender: () => void,\n\t\tanchoredScrollTop?: number,\n\t): void {\n\t\tthis.contentHeight = Math.max(0, Math.floor(contentHeight));\n\t\tthis.currentViewportHeight = Math.max(0, Math.floor(viewportHeight));\n\t\tthis.requestRenderCallback = requestRender;\n\t\tthis.movedSinceLayout = 0;\n\t\tthis.exactSinceLayout = false;\n\t\tconst maxScrollTop = Math.max(0, this.contentHeight - this.currentViewportHeight);\n\t\tif (this.followingEnd) this.currentScrollTop = maxScrollTop;\n\t\telse this.currentScrollTop = Math.max(0, Math.min(anchoredScrollTop ?? this.currentScrollTop, maxScrollTop));\n\t\tif (this.currentScrollTop < maxScrollTop) this.followSuppressedAtEnd = false;\n\t\tif (this.followEnd && this.currentScrollTop === maxScrollTop && !this.followSuppressedAtEnd) {\n\t\t\tthis.followingEnd = true;\n\t\t}\n\t\tif (this.contentHeight <= this.currentViewportHeight) this.hideTransientScrollbar();\n\t}\n\n\toverride addChild(_component: Component): void {\n\t\tthrow new Error(\"ScrollView has exactly one child\");\n\t}\n\n\toverride removeChild(_component: Component): void {\n\t\tthrow new Error(\"ScrollView child cannot be removed\");\n\t}\n\n\toverride clear(): void {\n\t\tthrow new Error(\"ScrollView child cannot be cleared\");\n\t}\n\n\toverride render(width: number): string[] {\n\t\tconst contentWidth = this.getContentWidth(width);\n\t\tconst lines = this.child.render(contentWidth);\n\t\treturn contentWidth === width ? lines : lines.map((line) => `${line} `);\n\t}\n\n\t[LAYOUT_NODE](): ScrollLayoutNode {\n\t\treturn { type: \"scroll\", component: this.child, state: this };\n\t}\n}\n"]}
|
|
@@ -1,11 +1,71 @@
|
|
|
1
1
|
import { type Component, Container } from "../tui.ts";
|
|
2
|
+
export interface HistoryRowPosition {
|
|
3
|
+
readonly source: symbol;
|
|
4
|
+
readonly seq: number;
|
|
5
|
+
readonly block: number;
|
|
6
|
+
readonly part: number;
|
|
7
|
+
readonly line: number;
|
|
8
|
+
/** The row stands in for a card whose call and result are drawn on different pages: what it shows depends on which
|
|
9
|
+
* pages are mounted, so a selection never captures it and a copy draws its entry as the whole transcript does. */
|
|
10
|
+
readonly provisional?: true;
|
|
11
|
+
}
|
|
12
|
+
/** A saved leaf: a rendered part of a saved entry, without the row within it. */
|
|
13
|
+
export type HistoryLeaf = Omit<HistoryRowPosition, "line">;
|
|
14
|
+
/** The rows of one saved leaf that is not mounted, drawn on request. */
|
|
15
|
+
export interface HistoryRowsBlock {
|
|
16
|
+
readonly position: HistoryLeaf;
|
|
17
|
+
readonly lines: readonly string[];
|
|
18
|
+
}
|
|
19
|
+
/** Saved rows that are no longer, or never were, mounted below a history anchor. */
|
|
20
|
+
export interface HistorySource {
|
|
21
|
+
/** The last sequence number of the saved rows. */
|
|
22
|
+
readonly last: number;
|
|
23
|
+
/** Draw, without mounting, the saved leaves of entries `from` through `to` at `width`, in document order. */
|
|
24
|
+
read(from: number, to: number, width: number): Promise<readonly HistoryRowsBlock[]>;
|
|
25
|
+
}
|
|
26
|
+
/** The row that stands for a source's saved history: its mounted saved rows follow it, and everything else of the
|
|
27
|
+
* source can be drawn on request. */
|
|
28
|
+
export interface HistoryAnchorView {
|
|
29
|
+
readonly source: symbol;
|
|
30
|
+
readonly edges: HistoryRunEdges;
|
|
31
|
+
/** The first saved leaf mounted right below the anchor, if any. */
|
|
32
|
+
readonly first?: HistoryLeaf;
|
|
33
|
+
readonly last: number;
|
|
34
|
+
/** Draw saved rows at the width of this layout. */
|
|
35
|
+
read(from: number, to: number): Promise<readonly HistoryRowsBlock[]>;
|
|
36
|
+
}
|
|
37
|
+
/** The rows just outside a run of saved rows from one source, which stay in place when the run is released. */
|
|
38
|
+
export interface HistoryRunEdges {
|
|
39
|
+
readonly source: symbol;
|
|
40
|
+
/** The last row above the run, if any. */
|
|
41
|
+
readonly above?: () => number | undefined;
|
|
42
|
+
/** The first row below the run, if any. */
|
|
43
|
+
readonly below?: () => number | undefined;
|
|
44
|
+
}
|
|
2
45
|
export interface WindowRows {
|
|
3
46
|
readonly length: number;
|
|
4
47
|
at(index: number): string | undefined;
|
|
48
|
+
/** A weak position within a painted leaf; resolving it never draws or requests history. */
|
|
49
|
+
trackRow?(index: number): (() => number | undefined) | undefined;
|
|
50
|
+
historyRow?(index: number): HistoryRowPosition | undefined;
|
|
51
|
+
/** Weak positions of the rows around the saved run that holds `index`; no render, read or retained leaf. */
|
|
52
|
+
historyEdges?(index: number): HistoryRunEdges | undefined;
|
|
53
|
+
/** The mounted history anchor of this document, if any. */
|
|
54
|
+
historyAnchor?(): HistoryAnchorView | undefined;
|
|
55
|
+
/** Visit the rows of the mounted saved entries around `index` from `from` through `to`, in order, drawing an entry
|
|
56
|
+
* not yet drawn at this width as the background sweep would. A provisional leaf that draws no row is visited once,
|
|
57
|
+
* with an empty line. Never requests an unmounted page. */
|
|
58
|
+
visitHistoryRun?(index: number, from: HistoryLeaf | undefined, to: HistoryLeaf | undefined, visit: (line: string, position: HistoryRowPosition) => void): void;
|
|
59
|
+
/** Visit already rendered, non-replayable rows of an active selection, without requesting historical content. */
|
|
60
|
+
visitVolatileRows?(first: number, last: number, visit: (row: number, line: string, renderer: symbol, history?: HistoryRowPosition) => void): void;
|
|
5
61
|
}
|
|
6
62
|
export interface WindowRequest {
|
|
7
63
|
readonly width: number;
|
|
8
64
|
readonly top: number;
|
|
65
|
+
/** Rows the reader scrolled by since the last layout, when `top` is the last top moved by them. */
|
|
66
|
+
readonly moved?: number;
|
|
67
|
+
/** Show the row at `top` itself, whatever changed above it since the last layout. */
|
|
68
|
+
readonly exact?: boolean;
|
|
9
69
|
readonly height: number;
|
|
10
70
|
readonly followEnd: boolean;
|
|
11
71
|
readonly requestRender: () => void;
|
|
@@ -14,6 +74,14 @@ export interface WindowLayout extends WindowRows {
|
|
|
14
74
|
readonly top: number;
|
|
15
75
|
}
|
|
16
76
|
export declare class WindowedContainer extends Container {
|
|
77
|
+
/** Identify the leaf of a mutable saved transcript. A selection can then keep just its selected characters
|
|
78
|
+
* across eviction or an external rewrite, without keeping the component or its page. */
|
|
79
|
+
static markHistoryComponent(component: Component, source: symbol, seq: number, block: number, part: number, provisional?: boolean): void;
|
|
80
|
+
/** Mark the row that stands for a source's saved history. Its mounted saved rows follow it; a copy can draw the
|
|
81
|
+
* rest of a selection from `history`. Holding the anchor's source does not keep the anchor alive. */
|
|
82
|
+
static markHistoryAnchor(component: Component, source: symbol, history: HistorySource): void;
|
|
83
|
+
/** History anchors this window has laid out. */
|
|
84
|
+
private anchors;
|
|
17
85
|
/** The container that last laid this one out among its own rows, when this one is nested in it. */
|
|
18
86
|
private windowHost;
|
|
19
87
|
/** The windowed container this one is a child of, in that layout. */
|
|
@@ -21,6 +89,9 @@ export declare class WindowedContainer extends Container {
|
|
|
21
89
|
/** The host's laid-out entries this container's children occupied, `[first, end)`. */
|
|
22
90
|
private windowSpan;
|
|
23
91
|
private laidOut;
|
|
92
|
+
private observed;
|
|
93
|
+
/** Observe only children whose rows are actually returned to the viewport, never an offscreen measurement. */
|
|
94
|
+
onVisibleChild?: (child: Component) => void;
|
|
24
95
|
private offsets;
|
|
25
96
|
private staleOffsetsFrom;
|
|
26
97
|
private width;
|
|
@@ -39,6 +110,11 @@ export declare class WindowedContainer extends Container {
|
|
|
39
110
|
/** Content width of the window that laid out these children, including a containing window's layout. */
|
|
40
111
|
protected get windowLayoutWidth(): number | undefined;
|
|
41
112
|
protected windowChildren(): readonly Component[];
|
|
113
|
+
/** The last window layout's span for a leaf, measured in the root document's rows; no render or tree walk. */
|
|
114
|
+
windowRowSpan(component: Component): {
|
|
115
|
+
readonly top: number;
|
|
116
|
+
readonly bottom: number;
|
|
117
|
+
} | undefined;
|
|
42
118
|
invalidate(): void;
|
|
43
119
|
layoutWindow(request: WindowRequest): WindowLayout;
|
|
44
120
|
settleRows(): void;
|
|
@@ -55,9 +131,20 @@ export declare class WindowedContainer extends Container {
|
|
|
55
131
|
} | undefined;
|
|
56
132
|
private windowAt;
|
|
57
133
|
private rowCount;
|
|
134
|
+
private visibleRowAt;
|
|
58
135
|
private rowAt;
|
|
59
136
|
private indexAt;
|
|
137
|
+
/** The laid-out index of the first history anchor still in this window. */
|
|
138
|
+
private anchorIndex;
|
|
139
|
+
/** The laid-out entries of the saved run around `row`: one source, possibly with empty rows between. */
|
|
140
|
+
private historyRunAt;
|
|
60
141
|
private locateAnchor;
|
|
142
|
+
/**
|
|
143
|
+
* The row that keeps the reader's place when rows change before the next frame: the row at `top`, or, while a
|
|
144
|
+
* history anchor is on screen, the first row after it. Saved pages are mounted right after that anchor, so the rows
|
|
145
|
+
* the reader saw below it keep their place, not the rows above it.
|
|
146
|
+
*/
|
|
147
|
+
private scrollAnchor;
|
|
61
148
|
private topFor;
|
|
62
149
|
private syncEntries;
|
|
63
150
|
private entryFor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windowed-container.d.ts","sourceRoot":"","sources":["../../src/components/windowed-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"windowed-container.d.ts","sourceRoot":"","sources":["../../src/components/windowed-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,WAAW,kBAAkB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;sHACkH;IAClH,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC;CAC5B;AAGD,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAE3D,wEAAwE;AACxE,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,oFAAoF;AACpF,MAAM,WAAW,aAAa;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6GAA6G;IAC7G,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,gBAA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