stitchkit-tui 0.2.13 → 0.3.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/README.md +88 -4
- package/dist/App.d.ts +2 -2
- package/dist/App.d.ts.map +1 -1
- package/dist/app-mqzzrp1t.js +618 -0
- package/dist/cli.js +11 -2195
- package/dist/config.d.ts +8 -16
- package/dist/config.d.ts.map +1 -1
- package/dist/core/chart.d.ts +82 -0
- package/dist/core/chart.d.ts.map +1 -0
- package/dist/core/collection.d.ts.map +1 -1
- package/dist/core/command-palette.d.ts.map +1 -1
- package/dist/core/focus.d.ts +33 -0
- package/dist/core/focus.d.ts.map +1 -0
- package/dist/core/form.d.ts +88 -0
- package/dist/core/form.d.ts.map +1 -0
- package/dist/core/index.d.ts +17 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +226 -358
- package/dist/core/json.d.ts +24 -0
- package/dist/core/json.d.ts.map +1 -0
- package/dist/core/key-hints.d.ts +28 -0
- package/dist/core/key-hints.d.ts.map +1 -0
- package/dist/core/keys.d.ts +32 -0
- package/dist/core/keys.d.ts.map +1 -0
- package/dist/core/labels.d.ts +44 -0
- package/dist/core/labels.d.ts.map +1 -0
- package/dist/core/list.d.ts +112 -0
- package/dist/core/list.d.ts.map +1 -0
- package/dist/core/meter.d.ts +61 -0
- package/dist/core/meter.d.ts.map +1 -0
- package/dist/core/navigation.d.ts +33 -0
- package/dist/core/navigation.d.ts.map +1 -0
- package/dist/core/notices.d.ts +39 -0
- package/dist/core/notices.d.ts.map +1 -0
- package/dist/core/progress.d.ts +53 -0
- package/dist/core/progress.d.ts.map +1 -0
- package/dist/core/search.d.ts +36 -0
- package/dist/core/search.d.ts.map +1 -0
- package/dist/core/table.d.ts +126 -0
- package/dist/core/table.d.ts.map +1 -0
- package/dist/core/tabs.d.ts +37 -0
- package/dist/core/tabs.d.ts.map +1 -0
- package/dist/core/text.d.ts +36 -0
- package/dist/core/text.d.ts.map +1 -0
- package/dist/core/theme.d.ts +38 -0
- package/dist/core/theme.d.ts.map +1 -0
- package/dist/gallery/app.d.ts +12 -0
- package/dist/gallery/app.d.ts.map +1 -0
- package/dist/gallery/catalogue.d.ts +11 -0
- package/dist/gallery/catalogue.d.ts.map +1 -0
- package/dist/gallery/main.d.ts +3 -0
- package/dist/gallery/main.d.ts.map +1 -0
- package/dist/gallery/main.js +16 -0
- package/dist/gallery/monitor-page.d.ts +8 -0
- package/dist/gallery/monitor-page.d.ts.map +1 -0
- package/dist/gallery/widgets-page.d.ts +7 -0
- package/dist/gallery/widgets-page.d.ts.map +1 -0
- package/dist/index-251fexwh.js +106 -0
- package/dist/index-54sqbm3r.js +1354 -0
- package/dist/index-ecpc5qkb.js +245 -0
- package/dist/index-fxx9ktw7.js +1603 -0
- package/dist/index-kz62sdr9.js +336 -0
- package/dist/index-z4c2ehg4.js +1705 -0
- package/dist/index.js +77 -2219
- package/dist/run-e1kdpzna.js +15 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/status-line.d.ts +2 -2
- package/dist/status-line.d.ts.map +1 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/transcript.d.ts.map +1 -1
- package/dist/widgets/chart.d.ts +32 -0
- package/dist/widgets/chart.d.ts.map +1 -0
- package/dist/widgets/context.d.ts +29 -0
- package/dist/widgets/context.d.ts.map +1 -0
- package/dist/widgets/feedback.d.ts +65 -0
- package/dist/widgets/feedback.d.ts.map +1 -0
- package/dist/widgets/form.d.ts +23 -0
- package/dist/widgets/form.d.ts.map +1 -0
- package/dist/widgets/index.d.ts +13 -0
- package/dist/widgets/index.d.ts.map +1 -0
- package/dist/widgets/index.js +76 -0
- package/dist/widgets/keyboard.d.ts +28 -0
- package/dist/widgets/keyboard.d.ts.map +1 -0
- package/dist/widgets/layout.d.ts +51 -0
- package/dist/widgets/layout.d.ts.map +1 -0
- package/dist/widgets/list.d.ts +32 -0
- package/dist/widgets/list.d.ts.map +1 -0
- package/dist/widgets/meter.d.ts +26 -0
- package/dist/widgets/meter.d.ts.map +1 -0
- package/dist/widgets/table.d.ts +25 -0
- package/dist/widgets/table.d.ts.map +1 -0
- package/dist/widgets/tabs.d.ts +13 -0
- package/dist/widgets/tabs.d.ts.map +1 -0
- package/dist/widgets/text-view.d.ts +24 -0
- package/dist/widgets/text-view.d.ts.map +1 -0
- package/dist/widgets/theme.d.ts +17 -0
- package/dist/widgets/theme.d.ts.map +1 -0
- package/package.json +25 -12
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
defaultAgentTuiRecoveryDecision2,
|
|
4
|
+
resolveAgentTuiInitialConversationId2,
|
|
5
|
+
runAgentTui2
|
|
6
|
+
} from "./index-fxx9ktw7.js";
|
|
7
|
+
import"./index-ecpc5qkb.js";
|
|
8
|
+
import"./index-kz62sdr9.js";
|
|
9
|
+
import"./index-251fexwh.js";
|
|
10
|
+
import"./index-z4c2ehg4.js";
|
|
11
|
+
export {
|
|
12
|
+
defaultAgentTuiRecoveryDecision2 as defaultAgentTuiRecoveryDecision,
|
|
13
|
+
resolveAgentTuiInitialConversationId2 as resolveAgentTuiInitialConversationId,
|
|
14
|
+
runAgentTui2 as runAgentTui
|
|
15
|
+
};
|
package/dist/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAiB/C,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED,wBAAgB,+BAA+B,CAAC,EAC9C,GAAG,GACJ,EAAE,0BAA0B,GAAG,4BAA4B,CAE3D;AAED,wBAAgB,oCAAoC,CAAC,qBAAqB,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3F;AAED,+EAA+E;AAC/E,wBAAsB,WAAW,CAAC,OAAO,EACvC,MAAM,EAAE,cAAc,CAAC,OAAO,CAAC,GAC9B,OAAO,CAAC,eAAe,CAAC,CAyJ1B"}
|
package/dist/status-line.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AgentModelCatalogEntry, AgentSnapshot } from 'stitchkit/agent-runtime';
|
|
2
|
-
|
|
2
|
+
import type { TerminalTone } from './core/theme';
|
|
3
3
|
export interface AgentTuiStatusSegment {
|
|
4
4
|
text: string;
|
|
5
|
-
tone?:
|
|
5
|
+
tone?: TerminalTone;
|
|
6
6
|
}
|
|
7
7
|
export type AgentTuiStatusRows = readonly (readonly AgentTuiStatusSegment[])[];
|
|
8
8
|
export interface AgentTuiStatusLineContext {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status-line.d.ts","sourceRoot":"","sources":["../src/status-line.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EAEd,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"status-line.d.ts","sourceRoot":"","sources":["../src/status-line.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EAEd,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,SAAS,CAAC,SAAS,qBAAqB,EAAE,CAAC,EAAE,CAAC;AAE/E,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,sBAAsB,CAAC;IAC/B,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,MAAM,2BAA2B,GAAG,CACxC,OAAO,EAAE,yBAAyB,KAC/B,kBAAkB,CAAC;AAiCxB,sFAAsF;AACtF,eAAO,MAAM,yBAAyB,EAAE,2BAsCvC,CAAC"}
|
package/dist/transcript.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { AgentSnapshot } from 'stitchkit/agent-runtime';
|
|
2
|
+
import type { TerminalTone } from './core/theme';
|
|
2
3
|
export interface AgentTuiTranscriptEntry {
|
|
3
4
|
id: string;
|
|
4
5
|
role: 'you' | 'agent' | 'tool' | 'system';
|
|
5
6
|
text: string;
|
|
6
|
-
tone:
|
|
7
|
+
tone: TerminalTone;
|
|
7
8
|
}
|
|
8
9
|
export declare function projectAgentTuiTranscript(snapshot: AgentSnapshot): readonly AgentTuiTranscriptEntry[];
|
|
9
10
|
//# sourceMappingURL=transcript.d.ts.map
|
package/dist/transcript.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../src/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkC,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../src/transcript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAkC,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,CAAC;CACpB;AAkDD,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,aAAa,GACtB,SAAS,uBAAuB,EAAE,CAwBpC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type TerminalTimeSeries } from '../core/chart';
|
|
2
|
+
import type { TerminalTone } from '../core/theme';
|
|
3
|
+
export interface TerminalChartSeries {
|
|
4
|
+
data: TerminalTimeSeries;
|
|
5
|
+
tone: TerminalTone;
|
|
6
|
+
}
|
|
7
|
+
export interface TerminalChartProps {
|
|
8
|
+
series: readonly TerminalChartSeries[];
|
|
9
|
+
/** The right edge of the window; pass the clock of the tick being drawn. */
|
|
10
|
+
now: number;
|
|
11
|
+
width: number;
|
|
12
|
+
/** Lines of plot, not counting the axis. */
|
|
13
|
+
height: number;
|
|
14
|
+
min?: number;
|
|
15
|
+
max?: number;
|
|
16
|
+
fill?: boolean;
|
|
17
|
+
/** Draw the time axis line under the plot. */
|
|
18
|
+
axis?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** A btop-style braille line chart over the series' shared time window. */
|
|
21
|
+
export declare function TerminalChart({ series, now, width, height, min, max, fill, axis, }: TerminalChartProps): import("react").ReactNode;
|
|
22
|
+
export interface TerminalSparklineProps {
|
|
23
|
+
data: TerminalTimeSeries;
|
|
24
|
+
now: number;
|
|
25
|
+
width: number;
|
|
26
|
+
tone?: TerminalTone;
|
|
27
|
+
min?: number;
|
|
28
|
+
max?: number;
|
|
29
|
+
}
|
|
30
|
+
/** One line, one cell per point across the window. */
|
|
31
|
+
export declare function TerminalSparkline({ data, now, width, tone, min, max, }: TerminalSparklineProps): import("react").ReactNode;
|
|
32
|
+
//# sourceMappingURL=chart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../src/widgets/chart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,kBAAkB,EAIxB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,kBAAkB,CAAC;IACzB,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACvC,4EAA4E;IAC5E,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,8CAA8C;IAC9C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,GAAG,EACH,KAAK,EACL,MAAM,EACN,GAAG,EACH,GAAG,EACH,IAAY,EACZ,IAAW,GACZ,EAAE,kBAAkB,6BAiCpB;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,kBAAkB,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,sDAAsD;AACtD,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,GAAG,EACH,KAAK,EACL,IAAe,EACf,GAAG,EACH,GAAG,GACJ,EAAE,sBAAsB,6BAWxB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { TerminalFocusAction, TerminalFocusState } from '../core/focus';
|
|
3
|
+
import { type TerminalLabels } from '../core/labels';
|
|
4
|
+
/** The words every widget below draws; English without a provider. */
|
|
5
|
+
export declare function TerminalLabelsProvider({ labels, children, }: {
|
|
6
|
+
labels: TerminalLabels;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): ReactNode;
|
|
9
|
+
export declare function useTerminalLabels(): TerminalLabels;
|
|
10
|
+
interface FocusContextValue {
|
|
11
|
+
state: TerminalFocusState;
|
|
12
|
+
dispatch(action: TerminalFocusAction): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Shares one focus state (from `createTerminalFocus`, owned by the host) with
|
|
16
|
+
* the widgets below; a widget given `focusId` answers the keyboard only while
|
|
17
|
+
* that id is focused.
|
|
18
|
+
*/
|
|
19
|
+
export declare function TerminalFocusProvider({ state, dispatch, children, }: FocusContextValue & {
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}): ReactNode;
|
|
22
|
+
export declare function useTerminalFocusContext(): FocusContextValue | null;
|
|
23
|
+
/**
|
|
24
|
+
* Whether a widget answers the keyboard: an explicit `focused` prop wins, then
|
|
25
|
+
* the provider's focus for `focusId`, and a widget outside any provider is focused.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useTerminalFocused(focusId?: string, focused?: boolean): boolean;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/widgets/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,gBAAgB,CAAC;AAIvE,sEAAsE;AACtE,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;CACrB,aAEA;AAED,wBAAgB,iBAAiB,IAAI,cAAc,CAElD;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC7C;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,QAAQ,EACR,QAAQ,GACT,EAAE,iBAAiB,GAAG;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,aAG7C;AAED,wBAAgB,uBAAuB,IAAI,iBAAiB,GAAG,IAAI,CAElE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAK/E"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { TerminalKeyBinding } from '../core/key-hints';
|
|
3
|
+
import { type TerminalAsyncState, type TerminalSpinnerKind } from '../core/progress';
|
|
4
|
+
import type { TerminalTone } from '../core/theme';
|
|
5
|
+
/** Re-render every `intervalMs` while mounted; returns the clock of the last tick. */
|
|
6
|
+
export declare function useTerminalClock(intervalMs: number, clock?: () => number): number;
|
|
7
|
+
/** `⠹ Loading catalogue · 2.4s` — a frame, a label and the time since `startedAt`. */
|
|
8
|
+
export declare function TerminalSpinner({ label, startedAt, kind, tone, clock, }: {
|
|
9
|
+
label: string;
|
|
10
|
+
startedAt: number;
|
|
11
|
+
kind?: TerminalSpinnerKind;
|
|
12
|
+
tone?: TerminalTone;
|
|
13
|
+
clock?: () => number;
|
|
14
|
+
}): ReactNode;
|
|
15
|
+
/** A progress bar: determinate with percent, rate and time left, or a moving block while the total is unknown. */
|
|
16
|
+
export declare function TerminalProgressBar({ done, total, startedAt, now, width, label, unit, }: {
|
|
17
|
+
done: number | null;
|
|
18
|
+
total: number | null;
|
|
19
|
+
startedAt: number;
|
|
20
|
+
now: number;
|
|
21
|
+
width: number;
|
|
22
|
+
label?: string;
|
|
23
|
+
unit?: string;
|
|
24
|
+
}): ReactNode;
|
|
25
|
+
/** Loading, error, empty or the content: the four faces of anything fetched. */
|
|
26
|
+
export declare function TerminalAsyncView<DATA>({ state, width, children, clock, }: {
|
|
27
|
+
state: TerminalAsyncState<DATA>;
|
|
28
|
+
width: number;
|
|
29
|
+
children(data: DATA): ReactNode;
|
|
30
|
+
clock?: () => number;
|
|
31
|
+
}): ReactNode;
|
|
32
|
+
/** Aligned key/value pairs, k9s-describe style. */
|
|
33
|
+
export declare function TerminalDetails({ pairs, width, }: {
|
|
34
|
+
pairs: readonly {
|
|
35
|
+
key: string;
|
|
36
|
+
value: string;
|
|
37
|
+
tone?: TerminalTone;
|
|
38
|
+
}[];
|
|
39
|
+
width: number;
|
|
40
|
+
}): ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* A confirmation over the screen: Enter or `y` confirms, Esc or `n` cancels,
|
|
43
|
+
* ←→ move between the two buttons. It takes the keyboard while it is open.
|
|
44
|
+
*/
|
|
45
|
+
export declare function TerminalDialog({ title, message, tone, confirmLabel, cancelLabel, onConfirm, onCancel, width, focusId, focused, }: {
|
|
46
|
+
title: string;
|
|
47
|
+
message: string;
|
|
48
|
+
tone?: TerminalTone;
|
|
49
|
+
confirmLabel?: string;
|
|
50
|
+
cancelLabel?: string;
|
|
51
|
+
onConfirm(): void;
|
|
52
|
+
onCancel(): void;
|
|
53
|
+
width?: number;
|
|
54
|
+
focusId?: string;
|
|
55
|
+
focused?: boolean;
|
|
56
|
+
}): ReactNode;
|
|
57
|
+
/** Every binding of a screen, grouped, for a `?` help overlay. */
|
|
58
|
+
export declare function TerminalHelp({ groups, width, }: {
|
|
59
|
+
groups: readonly {
|
|
60
|
+
title: string;
|
|
61
|
+
bindings: readonly TerminalKeyBinding[];
|
|
62
|
+
}[];
|
|
63
|
+
width: number;
|
|
64
|
+
}): ReactNode;
|
|
65
|
+
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/widgets/feedback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EAKzB,MAAM,kBAAkB,CAAC;AAO1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAKlD,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,MAAiB,GAAG,MAAM,CAO3F;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,SAAS,EACT,IAAa,EACb,IAAe,EACf,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;CACtB,aAWA;AAED,kHAAkH;AAClH,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,KAAK,EACL,SAAS,EACT,GAAG,EACH,KAAK,EACL,KAAK,EACL,IAAS,GACV,EAAE;IACD,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,C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AAM,EAAE,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,CAAA;KAAE,EAAE,CAAC;IAC9E,KAAK,EAAE,MAAM,CAAC;CACf,aAsBA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TerminalFormAction, TerminalFormState } from '../core/form';
|
|
2
|
+
import { type TerminalKeyBinding } from '../core/key-hints';
|
|
3
|
+
import type { TerminalLabels } from '../core/labels';
|
|
4
|
+
export declare function terminalFormKeymap(labels: TerminalLabels, cancel?: boolean): TerminalKeyBinding[];
|
|
5
|
+
export interface TerminalFormProps {
|
|
6
|
+
state: TerminalFormState;
|
|
7
|
+
onAction(action: TerminalFormAction): void;
|
|
8
|
+
/** Called with the read values when Enter submits a form whose every field reads. */
|
|
9
|
+
onSubmit(values: Record<string, unknown>): void;
|
|
10
|
+
onCancel?(): void;
|
|
11
|
+
width: number;
|
|
12
|
+
focusId?: string;
|
|
13
|
+
focused?: boolean;
|
|
14
|
+
keymap?: readonly TerminalKeyBinding[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A form edited in place: one row per field with its label, the value (typed,
|
|
18
|
+
* or cycled with ←→ for booleans and choices, masked for secrets), the focused
|
|
19
|
+
* field's description, and each field's error once it was left or submitted.
|
|
20
|
+
* Enter on any field submits: a form with errors moves to the first of them.
|
|
21
|
+
*/
|
|
22
|
+
export declare function TerminalForm({ state, onAction, onSubmit, onCancel, width, focusId, focused, keymap, }: TerminalFormProps): import("react").ReactNode;
|
|
23
|
+
//# sourceMappingURL=form.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/widgets/form.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAYrD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,cAAc,EACtB,MAAM,UAAO,GACZ,kBAAkB,EAAE,CA4CtB;AAED,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC3C,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAChD,QAAQ,CAAC,IAAI,IAAI,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACxC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,GACP,EAAE,iBAAiB,6BAkHnB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './chart';
|
|
2
|
+
export * from './context';
|
|
3
|
+
export * from './feedback';
|
|
4
|
+
export * from './form';
|
|
5
|
+
export * from './keyboard';
|
|
6
|
+
export * from './layout';
|
|
7
|
+
export * from './list';
|
|
8
|
+
export * from './meter';
|
|
9
|
+
export * from './table';
|
|
10
|
+
export * from './tabs';
|
|
11
|
+
export * from './text-view';
|
|
12
|
+
export * from './theme';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"../index-z4c2ehg4.js";
|
|
3
|
+
import {
|
|
4
|
+
useTerminalPalette2,
|
|
5
|
+
useTerminalThemeMode2,
|
|
6
|
+
TerminalThemeProvider2,
|
|
7
|
+
TerminalChart2,
|
|
8
|
+
TerminalSparkline2,
|
|
9
|
+
TerminalLabelsProvider2,
|
|
10
|
+
useTerminalLabels2,
|
|
11
|
+
TerminalFocusProvider2,
|
|
12
|
+
useTerminalFocusContext2,
|
|
13
|
+
useTerminalFocused2,
|
|
14
|
+
TerminalKeyPriority2,
|
|
15
|
+
useTerminalKeyboard2,
|
|
16
|
+
useTerminalClock2,
|
|
17
|
+
TerminalSpinner2,
|
|
18
|
+
TerminalProgressBar2,
|
|
19
|
+
TerminalAsyncView2,
|
|
20
|
+
TerminalDetails2,
|
|
21
|
+
TerminalDialog2,
|
|
22
|
+
TerminalHelp2,
|
|
23
|
+
terminalFormKeymap2,
|
|
24
|
+
TerminalForm2,
|
|
25
|
+
TerminalPanel2,
|
|
26
|
+
TerminalStatusBar2,
|
|
27
|
+
TerminalKeyHints2,
|
|
28
|
+
TerminalNotices2,
|
|
29
|
+
TerminalAppShell2,
|
|
30
|
+
terminalListKeymap2,
|
|
31
|
+
TerminalList2,
|
|
32
|
+
TerminalMeter2,
|
|
33
|
+
TerminalMeterGrid2,
|
|
34
|
+
TerminalTable2,
|
|
35
|
+
TerminalTabs2,
|
|
36
|
+
terminalTextViewKeymap2,
|
|
37
|
+
TerminalTextView2,
|
|
38
|
+
TerminalJsonView2
|
|
39
|
+
} from "../index-54sqbm3r.js";
|
|
40
|
+
export {
|
|
41
|
+
TerminalAppShell2 as TerminalAppShell,
|
|
42
|
+
TerminalAsyncView2 as TerminalAsyncView,
|
|
43
|
+
TerminalChart2 as TerminalChart,
|
|
44
|
+
TerminalDetails2 as TerminalDetails,
|
|
45
|
+
TerminalDialog2 as TerminalDialog,
|
|
46
|
+
TerminalFocusProvider2 as TerminalFocusProvider,
|
|
47
|
+
TerminalForm2 as TerminalForm,
|
|
48
|
+
TerminalHelp2 as TerminalHelp,
|
|
49
|
+
TerminalJsonView2 as TerminalJsonView,
|
|
50
|
+
TerminalKeyHints2 as TerminalKeyHints,
|
|
51
|
+
TerminalKeyPriority2 as TerminalKeyPriority,
|
|
52
|
+
TerminalLabelsProvider2 as TerminalLabelsProvider,
|
|
53
|
+
TerminalList2 as TerminalList,
|
|
54
|
+
TerminalMeter2 as TerminalMeter,
|
|
55
|
+
TerminalMeterGrid2 as TerminalMeterGrid,
|
|
56
|
+
TerminalNotices2 as TerminalNotices,
|
|
57
|
+
TerminalPanel2 as TerminalPanel,
|
|
58
|
+
TerminalProgressBar2 as TerminalProgressBar,
|
|
59
|
+
TerminalSparkline2 as TerminalSparkline,
|
|
60
|
+
TerminalSpinner2 as TerminalSpinner,
|
|
61
|
+
TerminalStatusBar2 as TerminalStatusBar,
|
|
62
|
+
TerminalTable2 as TerminalTable,
|
|
63
|
+
TerminalTabs2 as TerminalTabs,
|
|
64
|
+
TerminalTextView2 as TerminalTextView,
|
|
65
|
+
TerminalThemeProvider2 as TerminalThemeProvider,
|
|
66
|
+
terminalFormKeymap2 as terminalFormKeymap,
|
|
67
|
+
terminalListKeymap2 as terminalListKeymap,
|
|
68
|
+
terminalTextViewKeymap2 as terminalTextViewKeymap,
|
|
69
|
+
useTerminalClock2 as useTerminalClock,
|
|
70
|
+
useTerminalFocusContext2 as useTerminalFocusContext,
|
|
71
|
+
useTerminalFocused2 as useTerminalFocused,
|
|
72
|
+
useTerminalKeyboard2 as useTerminalKeyboard,
|
|
73
|
+
useTerminalLabels2 as useTerminalLabels,
|
|
74
|
+
useTerminalPalette2 as useTerminalPalette,
|
|
75
|
+
useTerminalThemeMode2 as useTerminalThemeMode
|
|
76
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { KeyEvent } from '@opentui/core';
|
|
2
|
+
/**
|
|
3
|
+
* Who sees a key first. OpenTUI calls every `useKeyboard` subscriber in mount
|
|
4
|
+
* order and `preventDefault` does not stop the others, so two widgets on one
|
|
5
|
+
* screen would both act on one key. The kit routes keys itself: one listener
|
|
6
|
+
* per renderer, handlers by priority, and the first that takes a key ends it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TerminalKeyPriority: Readonly<{
|
|
9
|
+
/** A widget taking typed text (a filter, a query, a form field): it sees keys before anyone. */
|
|
10
|
+
input: 300;
|
|
11
|
+
/** A layer over the screen, such as a dialog. */
|
|
12
|
+
layer: 200;
|
|
13
|
+
/** A focused widget. */
|
|
14
|
+
widget: 100;
|
|
15
|
+
/** Application-wide keys: page switches, quit. They get what no widget took. */
|
|
16
|
+
global: 0;
|
|
17
|
+
}>;
|
|
18
|
+
/** Return `true` when the handler took the key; it then reaches nobody else. */
|
|
19
|
+
export type TerminalKeyHandler = (key: KeyEvent) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Subscribe to keys through the kit's router. The handler always reads the
|
|
22
|
+
* latest render's props; an inactive handler takes nothing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useTerminalKeyboard(handler: TerminalKeyHandler, options?: {
|
|
25
|
+
priority?: number;
|
|
26
|
+
active?: boolean;
|
|
27
|
+
}): void;
|
|
28
|
+
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../src/widgets/keyboard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,QAAQ,EAAE,MAAM,eAAe,CAAC;AAI3D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;IAC9B,gGAAgG;;IAEhG,iDAAiD;;IAEjD,wBAAwB;;IAExB,gFAAgF;;EAEhF,CAAC;AAEH,gFAAgF;AAChF,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC;AAqD5D;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACpD,IAAI,CAaN"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type TerminalKeyBinding } from '../core/key-hints';
|
|
3
|
+
import type { TerminalNoticesState } from '../core/notices';
|
|
4
|
+
import type { TerminalTone } from '../core/theme';
|
|
5
|
+
export interface TerminalSegment {
|
|
6
|
+
text: string;
|
|
7
|
+
tone?: TerminalTone;
|
|
8
|
+
}
|
|
9
|
+
/** A bordered box with a title, a badge on the right of it, and a brighter frame while focused. */
|
|
10
|
+
export declare function TerminalPanel({ title, badge, focused, width, height, grow, children, }: {
|
|
11
|
+
title?: string;
|
|
12
|
+
badge?: string | number;
|
|
13
|
+
focused?: boolean;
|
|
14
|
+
width?: number;
|
|
15
|
+
height?: number;
|
|
16
|
+
/** Take the space left in the parent's direction. */
|
|
17
|
+
grow?: boolean;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}): ReactNode;
|
|
20
|
+
/** One line of toned segments separated by ` · `, cut to the width. */
|
|
21
|
+
export declare function TerminalStatusBar({ segments, width, separator, }: {
|
|
22
|
+
segments: readonly TerminalSegment[];
|
|
23
|
+
width: number;
|
|
24
|
+
separator?: string;
|
|
25
|
+
}): ReactNode;
|
|
26
|
+
/** The footer of key hints, fitted to the width from the screen's own keymap. */
|
|
27
|
+
export declare function TerminalKeyHints({ bindings, width, }: {
|
|
28
|
+
bindings: readonly TerminalKeyBinding[];
|
|
29
|
+
width: number;
|
|
30
|
+
}): ReactNode;
|
|
31
|
+
/** Toasts, newest last, toned by kind. */
|
|
32
|
+
export declare function TerminalNotices({ state, width, }: {
|
|
33
|
+
state: TerminalNoticesState;
|
|
34
|
+
width: number;
|
|
35
|
+
}): ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* An application screen: breadcrumbs, status lines and a rule on top, the body
|
|
38
|
+
* in the space left, key hints at the bottom, and toasts over the top-right
|
|
39
|
+
* corner. Every line has a fixed place, so a screen never jumps while it updates.
|
|
40
|
+
*/
|
|
41
|
+
export declare function TerminalAppShell({ breadcrumbs, status, bindings, notices, width, height, children, }: {
|
|
42
|
+
breadcrumbs: readonly string[];
|
|
43
|
+
/** One or more status lines under the breadcrumbs. */
|
|
44
|
+
status?: readonly (readonly TerminalSegment[])[];
|
|
45
|
+
bindings?: readonly TerminalKeyBinding[];
|
|
46
|
+
notices?: TerminalNoticesState;
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
children: ReactNode;
|
|
50
|
+
}): ReactNode;
|
|
51
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/widgets/layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACjF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAO5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAGlD,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,OAAe,EACf,KAAK,EACL,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ACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;CACrB,aA8BA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type TerminalKeyBinding } from '../core/key-hints';
|
|
2
|
+
import type { TerminalLabels } from '../core/labels';
|
|
3
|
+
import { type TerminalListAction, type TerminalListItem, type TerminalListState } from '../core/list';
|
|
4
|
+
/** Bindings of a list; the same data draws its key hints. */
|
|
5
|
+
export declare function terminalListKeymap(labels: TerminalLabels, options?: {
|
|
6
|
+
searchable?: boolean;
|
|
7
|
+
multiple?: boolean;
|
|
8
|
+
back?: boolean;
|
|
9
|
+
}): TerminalKeyBinding[];
|
|
10
|
+
export interface TerminalListProps {
|
|
11
|
+
state: TerminalListState;
|
|
12
|
+
onAction(action: TerminalListAction): void;
|
|
13
|
+
onActivate?(item: TerminalListItem): void;
|
|
14
|
+
onBack?(): void;
|
|
15
|
+
width: number;
|
|
16
|
+
/** Lines for the whole widget: search line, list, and the selected item's description. */
|
|
17
|
+
height: number;
|
|
18
|
+
/** Typing filters the list (the query line shows at the top). */
|
|
19
|
+
searchable?: boolean;
|
|
20
|
+
/** Lines reserved under the list for the selected item's description. */
|
|
21
|
+
descriptionLines?: number;
|
|
22
|
+
focusId?: string;
|
|
23
|
+
focused?: boolean;
|
|
24
|
+
keymap?: readonly TerminalKeyBinding[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A picker: section headings, items with meta and badges, a `›` cursor on a
|
|
28
|
+
* raised row, matches highlighted while searching, "N more" at the edges, and
|
|
29
|
+
* the selected item's description underneath.
|
|
30
|
+
*/
|
|
31
|
+
export declare function TerminalList({ state, onAction, onActivate, onBack, width, height, searchable, descriptionLines, focusId, focused, keymap, }: TerminalListProps): import("react").ReactNode;
|
|
32
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/widgets/list.tsx"],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../core/meter';
|
|
2
|
+
export interface TerminalMeterProps {
|
|
3
|
+
label: string;
|
|
4
|
+
/** `null` is "not measured": an empty bar and `—`. */
|
|
5
|
+
value: number | null;
|
|
6
|
+
max: number;
|
|
7
|
+
/** Cells for the whole line: label, bracketed bar and reading. */
|
|
8
|
+
width: number;
|
|
9
|
+
labelWidth?: number;
|
|
10
|
+
/** The reading after the bar; a percentage of `max` when omitted. */
|
|
11
|
+
text?: string;
|
|
12
|
+
textWidth?: number;
|
|
13
|
+
thresholds?: readonly TerminalMeterThreshold[];
|
|
14
|
+
}
|
|
15
|
+
/** One htop-style meter line: `cpu3 [████▌ ] 41.2%`. */
|
|
16
|
+
export declare function TerminalMeter({ label, value, max, width, labelWidth, text, textWidth, thresholds, }: TerminalMeterProps): import("react").ReactNode;
|
|
17
|
+
export interface TerminalMeterGridProps {
|
|
18
|
+
meters: readonly Omit<TerminalMeterProps, 'width' | 'labelWidth'>[];
|
|
19
|
+
width: number;
|
|
20
|
+
/** The narrowest a meter may get before the grid adds a row. */
|
|
21
|
+
minMeterWidth?: number;
|
|
22
|
+
gap?: number;
|
|
23
|
+
}
|
|
24
|
+
/** A block of meters, one per core, column-major like htop's CPU header. */
|
|
25
|
+
export declare function TerminalMeterGrid({ meters, width, minMeterWidth, gap, }: TerminalMeterGridProps): import("react").ReactNode;
|
|
26
|
+
//# sourceMappingURL=meter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meter.d.ts","sourceRoot":"","sources":["../../src/widgets/meter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAE5B,MAAM,eAAe,CAAC;AAIvB,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,SAAS,sBAAsB,EAAE,CAAC;CAChD;AAED,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,KAAK,EACL,GAAG,EACH,KAAK,EACL,UAAsC,EACtC,IAAI,EACJ,SAAa,EACb,UAAU,GACX,EAAE,kBAAkB,6BAwBpB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,SAAS,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,YAAY,CAAC,EAAE,CAAC;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,KAAK,EACL,aAAkB,EAClB,GAAO,GACR,EAAE,sBAAsB,6BAoBxB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TerminalKeyBinding } from '../core/key-hints';
|
|
2
|
+
import { type TerminalTableAction, type TerminalTableRow, type TerminalTableState } from '../core/table';
|
|
3
|
+
export interface TerminalTableProps {
|
|
4
|
+
state: TerminalTableState;
|
|
5
|
+
/** Apply an action to the state the host owns (a `useReducer` dispatch). */
|
|
6
|
+
onAction(action: TerminalTableAction): void;
|
|
7
|
+
/** Enter on the selected row. */
|
|
8
|
+
onActivate?(row: TerminalTableRow): void;
|
|
9
|
+
width: number;
|
|
10
|
+
/** Lines including the header and the footer; rows get `height - 2`. */
|
|
11
|
+
height: number;
|
|
12
|
+
focusId?: string;
|
|
13
|
+
/** Whether this table answers the keyboard; overrides `focusId`. */
|
|
14
|
+
focused?: boolean;
|
|
15
|
+
keymap?: readonly TerminalKeyBinding[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A live table: one header line, a fixed window of rows and one footer line.
|
|
19
|
+
* Only the rows inside the window are drawn and each line is rewritten in
|
|
20
|
+
* place, so an update never changes the layout's height between ticks. While
|
|
21
|
+
* the filter line is open it takes every key, so typing a digit never also
|
|
22
|
+
* switches a tab.
|
|
23
|
+
*/
|
|
24
|
+
export declare function TerminalTable({ state, onAction, onActivate, width, height, focusId, focused, keymap, }: TerminalTableProps): import("react").ReactNode;
|
|
25
|
+
//# sourceMappingURL=table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/widgets/table.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAGL,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAGxB,MAAM,eAAe,CAAC;AAMvB,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC5C,iCAAiC;IACjC,UAAU,CAAC,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACxC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,UAAU,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,MAAM,GACP,EAAE,kBAAkB,6BAiIpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TerminalKeyBinding } from '../core/key-hints';
|
|
2
|
+
import type { TerminalTabsAction, TerminalTabsState } from '../core/tabs';
|
|
3
|
+
export interface TerminalTabsProps {
|
|
4
|
+
state: TerminalTabsState;
|
|
5
|
+
onAction(action: TerminalTabsAction): void;
|
|
6
|
+
focusId?: string;
|
|
7
|
+
/** Whether Tab, Shift-Tab and 1–9 switch these tabs; overrides `focusId`. */
|
|
8
|
+
focused?: boolean;
|
|
9
|
+
keymap?: readonly TerminalKeyBinding[];
|
|
10
|
+
}
|
|
11
|
+
/** One line of views: ` 1 Processes 412 │ 2 Network ` with the selected one raised. */
|
|
12
|
+
export declare function TerminalTabs({ state, onAction, focusId, focused, keymap, }: TerminalTabsProps): import("react").ReactNode;
|
|
13
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/widgets/tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAM1E,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,iBAAiB,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACxC;AAED,uFAAuF;AACvF,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,MAAM,GACP,EAAE,iBAAiB,6BAgCnB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type TerminalStyledLine } from '../core/json';
|
|
2
|
+
import { type TerminalKeyBinding } from '../core/key-hints';
|
|
3
|
+
import type { TerminalLabels } from '../core/labels';
|
|
4
|
+
export declare function terminalTextViewKeymap(labels: TerminalLabels, back?: boolean): TerminalKeyBinding[];
|
|
5
|
+
export interface TerminalTextViewProps {
|
|
6
|
+
/** Plain text (sanitized and word-wrapped) or pre-toned lines (cut, not wrapped). */
|
|
7
|
+
content: string | readonly TerminalStyledLine[];
|
|
8
|
+
width: number;
|
|
9
|
+
/** Lines for the view, the position line included. */
|
|
10
|
+
height: number;
|
|
11
|
+
onBack?(): void;
|
|
12
|
+
focusId?: string;
|
|
13
|
+
focused?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A pager for long output: scrolls by line and page, shows where the reader is,
|
|
17
|
+
* and never runs escape sequences from the text it shows.
|
|
18
|
+
*/
|
|
19
|
+
export declare function TerminalTextView({ content, width, height, onBack, focusId, focused, }: TerminalTextViewProps): import("react").ReactNode;
|
|
20
|
+
/** A JSON value in a pager, toned by kind. */
|
|
21
|
+
export declare function TerminalJsonView({ value, ...props }: Omit<TerminalTextViewProps, 'content'> & {
|
|
22
|
+
value: unknown;
|
|
23
|
+
}): import("react").ReactNode;
|
|
24
|
+
//# sourceMappingURL=text-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-view.d.ts","sourceRoot":"","sources":["../../src/widgets/text-view.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAqB,MAAM,cAAc,CAAC;AAC1E,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAMrD,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,cAAc,EACtB,IAAI,UAAO,GACV,kBAAkB,EAAE,CAsDtB;AAED,MAAM,WAAW,qBAAqB;IACpC,qFAAqF;IACrF,OAAO,EAAE,MAAM,GAAG,SAAS,kBAAkB,EAAE,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,IAAI,IAAI,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,KAAK,EACL,MAAM,EACN,MAAM,EACN,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,6BAyDvB;AAED,8CAA8C;AAC9C,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,6BAG7D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type TerminalPalette, type TerminalThemeMode } from '../core/theme';
|
|
3
|
+
/** The palette widgets draw with: the nearest provider's, or the dark one. */
|
|
4
|
+
export declare function useTerminalPalette(): TerminalPalette;
|
|
5
|
+
/**
|
|
6
|
+
* Follow the terminal's background: `auto` reads what the terminal reports
|
|
7
|
+
* (OSC colour query) and switches when it changes; until it answers, and on a
|
|
8
|
+
* terminal that never does, the palette is dark.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useTerminalThemeMode(mode: TerminalThemeMode | 'auto'): TerminalThemeMode;
|
|
11
|
+
export declare function TerminalThemeProvider({ mode, palette, children, }: {
|
|
12
|
+
mode?: TerminalThemeMode | 'auto';
|
|
13
|
+
/** Colours to change in the chosen palette. */
|
|
14
|
+
palette?: Partial<TerminalPalette>;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}): ReactNode;
|
|
17
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/widgets/theme.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AACf,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,iBAAiB,EAEvB,MAAM,eAAe,CAAC;AAIvB,8EAA8E;AAC9E,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,iBAAiB,CAaxF;AAED,wBAAgB,qBAAqB,CAAC,EACpC,IAAa,EACb,OAAO,EACP,QAAQ,GACT,EAAE;IACD,IAAI,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;IAClC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACnC,QAAQ,EAAE,SAAS,CAAC;CACrB,aAIA"}
|