@cplieger/web-terminal-ui 8.3.5-dev.1 → 8.4.0-dev.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/package.json +1 -1
- package/src/composition.ts +1 -1
- package/src/features/tabs/model.ts +5 -5
- package/src/features/tabs/switch-anim.ts +1 -1
- package/src/kernel/a11y.ts +1 -0
- package/src/kernel/bus.ts +1 -1
- package/src/kernel/conn-state.ts +1 -1
- package/src/kernel/fatal.ts +1 -1
- package/src/kernel/feature-host.ts +1 -1
- package/src/kernel/keyboard-presence.ts +1 -1
- package/src/kernel/notify.ts +1 -0
- package/src/kernel/pane.ts +0 -2
- package/src/kernel/scrollback.ts +1 -1
- package/src/kernel/status-share.ts +1 -1
- package/src/viewport.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cplieger/web-terminal-ui",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.0-dev.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Reference touch-first browser UI for @cplieger/web-terminal-engine: a composable kernel + feature modules (tabs, activity monitor, mobile toolbar, context menu, IME, predictive echo, viewport handling) and CSS. One createTerminal() call.",
|
|
6
6
|
"license": "MPL-2.0",
|
package/src/composition.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { windowOf } from "./kernel/realm.js";
|
|
|
18
18
|
* after a pause, against losing all input until an unrelated event fires. */
|
|
19
19
|
const COMPOSITION_IDLE_MS = 5000;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
interface CompositionOptions {
|
|
22
22
|
textarea: HTMLTextAreaElement;
|
|
23
23
|
compositionView: HTMLElement;
|
|
24
24
|
getCursorPx: () => { left: number; top: number; cellH: number };
|
|
@@ -246,7 +246,7 @@ export function isUnseenCue(
|
|
|
246
246
|
|
|
247
247
|
/** What the cue fold reads per tab; structural, so a caller passes its own tab
|
|
248
248
|
* objects. */
|
|
249
|
-
|
|
249
|
+
interface CueCandidate {
|
|
250
250
|
readonly id: string;
|
|
251
251
|
readonly status: string;
|
|
252
252
|
}
|
|
@@ -255,7 +255,7 @@ export interface CueCandidate {
|
|
|
255
255
|
* WORST for the icon. A count is set-valued and needs no rule for choosing among
|
|
256
256
|
* sessions; severity is a total order, so the icon's choice is not arbitrary.
|
|
257
257
|
* Neither names a session, the standing constraint on a page-wide surface. */
|
|
258
|
-
|
|
258
|
+
interface CueSummary {
|
|
259
259
|
readonly count: number;
|
|
260
260
|
readonly worst: CueStatus | "";
|
|
261
261
|
}
|
|
@@ -480,7 +480,7 @@ export function hasPinnedName(tab: Tab): boolean {
|
|
|
480
480
|
|
|
481
481
|
/** The realm a session API runs in: the mounted window's `fetch`, its abort
|
|
482
482
|
* signals and its clock, never the importing page's. */
|
|
483
|
-
|
|
483
|
+
interface SessionAPIRealm {
|
|
484
484
|
readonly fetch: typeof fetch;
|
|
485
485
|
readonly AbortSignal: typeof AbortSignal;
|
|
486
486
|
readonly Date: typeof Date;
|
|
@@ -489,7 +489,7 @@ export interface SessionAPIRealm {
|
|
|
489
489
|
/** The session REST client, bound to an apiBase. Every call is timeout-bounded:
|
|
490
490
|
* fetch has no default timeout, and a stalled-but-open server would leave a
|
|
491
491
|
* bootstrap await pending forever. */
|
|
492
|
-
|
|
492
|
+
interface SessionAPI {
|
|
493
493
|
list(): Promise<SessionInfo[]>;
|
|
494
494
|
create(): Promise<SessionInfo>;
|
|
495
495
|
close(id: string): Promise<void>;
|
|
@@ -753,7 +753,7 @@ export function createSessionAPI(apiBase: string, realm: SessionAPIRealm): Sessi
|
|
|
753
753
|
* listing (the SSE re-open snapshot, or the poll's GET /api/sessions) that
|
|
754
754
|
* predates the server reaping the session does not re-adopt (flash back) the
|
|
755
755
|
* closed tab. */
|
|
756
|
-
|
|
756
|
+
interface Tombstones {
|
|
757
757
|
add(id: string): void;
|
|
758
758
|
/** True while `id` is tombstoned (within the TTL). A hit past the TTL clears
|
|
759
759
|
* the entry and reports false (the adopt may proceed). */
|
|
@@ -23,7 +23,7 @@ export const SWITCH_ANIMATIONS = {
|
|
|
23
23
|
} as const;
|
|
24
24
|
|
|
25
25
|
/** A class the tabs feature puts on the terminal surface to play a switch animation. */
|
|
26
|
-
|
|
26
|
+
type SwitchClass = keyof typeof SWITCH_ANIMATIONS;
|
|
27
27
|
|
|
28
28
|
/** The three classes, for a caller that has to clear whichever one is present. */
|
|
29
29
|
export const SWITCH_CLASSES = Object.keys(SWITCH_ANIMATIONS) as SwitchClass[];
|
package/src/kernel/a11y.ts
CHANGED
|
@@ -33,6 +33,7 @@ let REANNOUNCE_DELAY_MS = 100;
|
|
|
33
33
|
|
|
34
34
|
/** @internal Test seam: re-set every later announcement after `ms`; returns the
|
|
35
35
|
* previous value so the caller can restore it. */
|
|
36
|
+
// deadset:ignore DS1004 -- the browser tests shorten the re-announce delay so they need not wait out the real one
|
|
36
37
|
export function setReannounceDelayMs(ms: number): number {
|
|
37
38
|
const previous = REANNOUNCE_DELAY_MS;
|
|
38
39
|
REANNOUNCE_DELAY_MS = ms;
|
package/src/kernel/bus.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type { TerminalEvents, Unsubscribe } from "./types.js";
|
|
10
10
|
|
|
11
11
|
/** A typed event bus over TerminalEvents. */
|
|
12
|
-
|
|
12
|
+
interface TypedBus {
|
|
13
13
|
on<K extends keyof TerminalEvents>(e: K, fn: (p: TerminalEvents[K]) => void): Unsubscribe;
|
|
14
14
|
emit<K extends keyof TerminalEvents>(e: K, p: TerminalEvents[K]): void;
|
|
15
15
|
/** Drop every listener (used on kernel destroy). */
|
package/src/kernel/conn-state.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface ConnStateMachine {
|
|
|
41
41
|
|
|
42
42
|
/** The timers the machine schedules on: the mounted window's, so a grace delay
|
|
43
43
|
* runs on the terminal's own clock. */
|
|
44
|
-
|
|
44
|
+
interface ConnStateTimers {
|
|
45
45
|
setTimeout(handler: () => void, ms: number): number;
|
|
46
46
|
clearTimeout(id: number): void;
|
|
47
47
|
}
|
package/src/kernel/fatal.ts
CHANGED
|
@@ -15,7 +15,7 @@ export function fadeOutOverlay(ld: HTMLElement | undefined): void {
|
|
|
15
15
|
windowOf(ld.ownerDocument).setTimeout(removeOverlay, 1500);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
interface FatalPanelOptions {
|
|
19
19
|
message?: string;
|
|
20
20
|
/** `showModal()` (the terminal IS the page) or the bare `open` attribute (an
|
|
21
21
|
* embedded panel, or a pane beside a live one). */
|
|
@@ -50,7 +50,7 @@ interface Entry {
|
|
|
50
50
|
readonly scope: CleanupScope;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
interface FeatureHost {
|
|
54
54
|
/** Set one feature up. The scope exists before `setup` runs, so a throw drains
|
|
55
55
|
* what the feature acquired; a `destroyed()` true after the await tears the
|
|
56
56
|
* instance down instead of registering it. */
|
|
@@ -27,7 +27,7 @@ export interface KeyboardPresenceTracker extends KeyboardPresence {
|
|
|
27
27
|
noteSoftKeyboard(heightPx: number, editableFocused: boolean): void;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
interface KeyboardPresenceOptions {
|
|
31
31
|
readonly win: Window & typeof globalThis;
|
|
32
32
|
/** Never the suppressed inset: the suppression itself reads this tracker. */
|
|
33
33
|
readonly softKeyboardHeight: () => number;
|
package/src/kernel/notify.ts
CHANGED
package/src/kernel/pane.ts
CHANGED
|
@@ -200,7 +200,6 @@ export interface PaneKernel extends PaneHandle {
|
|
|
200
200
|
): Unsubscribe;
|
|
201
201
|
connectionInitiated(): boolean;
|
|
202
202
|
isDestroyed(): boolean;
|
|
203
|
-
layout(): { narrow: boolean; coarse: boolean };
|
|
204
203
|
toast(message: string, ms?: number): void;
|
|
205
204
|
announce(message: string, politeness?: "polite" | "assertive"): void;
|
|
206
205
|
paste(text: string): void;
|
|
@@ -1468,7 +1467,6 @@ function buildPaneInto(
|
|
|
1468
1467
|
),
|
|
1469
1468
|
connectionInitiated: () => connectionInitiated,
|
|
1470
1469
|
isDestroyed: () => destroyed,
|
|
1471
|
-
layout,
|
|
1472
1470
|
toast,
|
|
1473
1471
|
announce: (message, politeness) => {
|
|
1474
1472
|
announcer.announce(message, politeness);
|
package/src/kernel/scrollback.ts
CHANGED
|
@@ -44,7 +44,7 @@ const DEFAULT_SAVE_INTERVAL_MS = 10_000;
|
|
|
44
44
|
|
|
45
45
|
/** What the kernel drives. Every method is safe to call at any point in the
|
|
46
46
|
* terminal's life, including after stop(). */
|
|
47
|
-
|
|
47
|
+
interface ScrollbackKeeper {
|
|
48
48
|
/** The store for a session: hydrated from storage when a usable entry exists,
|
|
49
49
|
* otherwise a fresh one. Either way the store is tracked for saving. Seeds
|
|
50
50
|
* the persisted server epoch, so this MUST be called before that session
|
|
@@ -7,7 +7,7 @@ import type { Unsubscribe } from "./types.js";
|
|
|
7
7
|
|
|
8
8
|
/** Opens the server's status stream at a path; the engine's `connectStatusStream`
|
|
9
9
|
* in production. */
|
|
10
|
-
|
|
10
|
+
type StatusConnector = (path: string, callbacks: StatusStreamCallbacks) => StatusStream;
|
|
11
11
|
|
|
12
12
|
/** The shell's shared status streams. */
|
|
13
13
|
export interface StatusShare {
|
package/src/viewport.ts
CHANGED
|
@@ -13,6 +13,7 @@ let SETTLE_MS = 350;
|
|
|
13
13
|
|
|
14
14
|
/** @internal Test seam: arm every settle started from now on at `ms`; returns the
|
|
15
15
|
* previous value so the caller can restore it. */
|
|
16
|
+
// deadset:ignore DS1004 -- the browser tests shorten the settle delay so they need not wait out the real one
|
|
16
17
|
export function setSettleMs(ms: number): number {
|
|
17
18
|
const previous = SETTLE_MS;
|
|
18
19
|
SETTLE_MS = ms;
|
|
@@ -27,7 +28,7 @@ interface KeyboardGeometry {
|
|
|
27
28
|
readonly bottom: number;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
interface KeyboardInsetsOptions {
|
|
31
32
|
/** The outermost terminal root: receives --kb-inset and --vv-top, which every
|
|
32
33
|
* pane and chrome element beneath it inherits, so they scope to the terminal
|
|
33
34
|
* subtree instead of leaking onto the host document. */
|
|
@@ -56,7 +57,7 @@ export interface KeyboardInsets {
|
|
|
56
57
|
teardown(): void;
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
interface ViewportOptions {
|
|
60
61
|
termWrap: HTMLElement;
|
|
61
62
|
/** The box termWrap is pinned within, observed in its place: termWrap's
|
|
62
63
|
* insets follow chrome measured in ResizeObserver callbacks on boxes deeper
|