@promptctl/rich-js 0.1.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 +418 -0
- package/dist/core/box.d.ts +91 -0
- package/dist/core/box.d.ts.map +1 -0
- package/dist/core/box.js +534 -0
- package/dist/core/box.js.map +1 -0
- package/dist/core/cells.d.ts +24 -0
- package/dist/core/cells.d.ts.map +1 -0
- package/dist/core/cells.js +114 -0
- package/dist/core/cells.js.map +1 -0
- package/dist/core/color.d.ts +158 -0
- package/dist/core/color.d.ts.map +1 -0
- package/dist/core/color.js +825 -0
- package/dist/core/color.js.map +1 -0
- package/dist/core/console.d.ts +100 -0
- package/dist/core/console.d.ts.map +1 -0
- package/dist/core/console.js +353 -0
- package/dist/core/console.js.map +1 -0
- package/dist/core/emoji.d.ts +25 -0
- package/dist/core/emoji.d.ts.map +1 -0
- package/dist/core/emoji.js +392 -0
- package/dist/core/emoji.js.map +1 -0
- package/dist/core/highlighter.d.ts +33 -0
- package/dist/core/highlighter.d.ts.map +1 -0
- package/dist/core/highlighter.js +103 -0
- package/dist/core/highlighter.js.map +1 -0
- package/dist/core/markup.d.ts +69 -0
- package/dist/core/markup.d.ts.map +1 -0
- package/dist/core/markup.js +401 -0
- package/dist/core/markup.js.map +1 -0
- package/dist/core/measure.d.ts +17 -0
- package/dist/core/measure.d.ts.map +1 -0
- package/dist/core/measure.js +50 -0
- package/dist/core/measure.js.map +1 -0
- package/dist/core/protocol.d.ts +32 -0
- package/dist/core/protocol.d.ts.map +1 -0
- package/dist/core/protocol.js +17 -0
- package/dist/core/protocol.js.map +1 -0
- package/dist/core/render.d.ts +51 -0
- package/dist/core/render.d.ts.map +1 -0
- package/dist/core/render.js +69 -0
- package/dist/core/render.js.map +1 -0
- package/dist/core/segment.d.ts +104 -0
- package/dist/core/segment.d.ts.map +1 -0
- package/dist/core/segment.js +364 -0
- package/dist/core/segment.js.map +1 -0
- package/dist/core/spinnerData.d.ts +11 -0
- package/dist/core/spinnerData.d.ts.map +1 -0
- package/dist/core/spinnerData.js +116 -0
- package/dist/core/spinnerData.js.map +1 -0
- package/dist/core/strip.d.ts +159 -0
- package/dist/core/strip.d.ts.map +1 -0
- package/dist/core/strip.js +237 -0
- package/dist/core/strip.js.map +1 -0
- package/dist/core/style.d.ts +115 -0
- package/dist/core/style.d.ts.map +1 -0
- package/dist/core/style.js +662 -0
- package/dist/core/style.js.map +1 -0
- package/dist/core/text.d.ts +91 -0
- package/dist/core/text.d.ts.map +1 -0
- package/dist/core/text.js +610 -0
- package/dist/core/text.js.map +1 -0
- package/dist/index.d.ts +99 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -0
- package/dist/renderables/align.d.ts +17 -0
- package/dist/renderables/align.d.ts.map +1 -0
- package/dist/renderables/align.js +47 -0
- package/dist/renderables/align.js.map +1 -0
- package/dist/renderables/columns.d.ts +28 -0
- package/dist/renderables/columns.d.ts.map +1 -0
- package/dist/renderables/columns.js +92 -0
- package/dist/renderables/columns.js.map +1 -0
- package/dist/renderables/constrain.d.ts +16 -0
- package/dist/renderables/constrain.d.ts.map +1 -0
- package/dist/renderables/constrain.js +38 -0
- package/dist/renderables/constrain.js.map +1 -0
- package/dist/renderables/flexStrip.d.ts +42 -0
- package/dist/renderables/flexStrip.d.ts.map +1 -0
- package/dist/renderables/flexStrip.js +201 -0
- package/dist/renderables/flexStrip.js.map +1 -0
- package/dist/renderables/group.d.ts +12 -0
- package/dist/renderables/group.d.ts.map +1 -0
- package/dist/renderables/group.js +16 -0
- package/dist/renderables/group.js.map +1 -0
- package/dist/renderables/json.d.ts +23 -0
- package/dist/renderables/json.d.ts.map +1 -0
- package/dist/renderables/json.js +49 -0
- package/dist/renderables/json.js.map +1 -0
- package/dist/renderables/layout.d.ts +37 -0
- package/dist/renderables/layout.d.ts.map +1 -0
- package/dist/renderables/layout.js +151 -0
- package/dist/renderables/layout.js.map +1 -0
- package/dist/renderables/live.d.ts +48 -0
- package/dist/renderables/live.d.ts.map +1 -0
- package/dist/renderables/live.js +131 -0
- package/dist/renderables/live.js.map +1 -0
- package/dist/renderables/markdown.d.ts +25 -0
- package/dist/renderables/markdown.d.ts.map +1 -0
- package/dist/renderables/markdown.js +190 -0
- package/dist/renderables/markdown.js.map +1 -0
- package/dist/renderables/padding.d.ts +26 -0
- package/dist/renderables/padding.d.ts.map +1 -0
- package/dist/renderables/padding.js +92 -0
- package/dist/renderables/padding.js.map +1 -0
- package/dist/renderables/panel.d.ts +42 -0
- package/dist/renderables/panel.d.ts.map +1 -0
- package/dist/renderables/panel.js +202 -0
- package/dist/renderables/panel.js.map +1 -0
- package/dist/renderables/pretty.d.ts +29 -0
- package/dist/renderables/pretty.d.ts.map +1 -0
- package/dist/renderables/pretty.js +141 -0
- package/dist/renderables/pretty.js.map +1 -0
- package/dist/renderables/progress.d.ts +91 -0
- package/dist/renderables/progress.d.ts.map +1 -0
- package/dist/renderables/progress.js +234 -0
- package/dist/renderables/progress.js.map +1 -0
- package/dist/renderables/progressBar.d.ts +32 -0
- package/dist/renderables/progressBar.d.ts.map +1 -0
- package/dist/renderables/progressBar.js +59 -0
- package/dist/renderables/progressBar.js.map +1 -0
- package/dist/renderables/prompt.d.ts +25 -0
- package/dist/renderables/prompt.d.ts.map +1 -0
- package/dist/renderables/prompt.js +109 -0
- package/dist/renderables/prompt.js.map +1 -0
- package/dist/renderables/rule.d.ts +25 -0
- package/dist/renderables/rule.d.ts.map +1 -0
- package/dist/renderables/rule.js +96 -0
- package/dist/renderables/rule.js.map +1 -0
- package/dist/renderables/spinner.d.ts +30 -0
- package/dist/renderables/spinner.d.ts.map +1 -0
- package/dist/renderables/spinner.js +70 -0
- package/dist/renderables/spinner.js.map +1 -0
- package/dist/renderables/status.d.ts +24 -0
- package/dist/renderables/status.d.ts.map +1 -0
- package/dist/renderables/status.js +67 -0
- package/dist/renderables/status.js.map +1 -0
- package/dist/renderables/syntax.d.ts +36 -0
- package/dist/renderables/syntax.d.ts.map +1 -0
- package/dist/renderables/syntax.js +115 -0
- package/dist/renderables/syntax.js.map +1 -0
- package/dist/renderables/table.d.ts +109 -0
- package/dist/renderables/table.d.ts.map +1 -0
- package/dist/renderables/table.js +434 -0
- package/dist/renderables/table.js.map +1 -0
- package/dist/renderables/traceback.d.ts +26 -0
- package/dist/renderables/traceback.d.ts.map +1 -0
- package/dist/renderables/traceback.js +108 -0
- package/dist/renderables/traceback.js.map +1 -0
- package/dist/renderables/tree.d.ts +30 -0
- package/dist/renderables/tree.d.ts.map +1 -0
- package/dist/renderables/tree.js +107 -0
- package/dist/renderables/tree.js.map +1 -0
- package/dist/template-bindings/index.d.ts +61 -0
- package/dist/template-bindings/index.d.ts.map +1 -0
- package/dist/template-bindings/index.js +70 -0
- package/dist/template-bindings/index.js.map +1 -0
- package/dist/template-bindings/style-funcs.d.ts +30 -0
- package/dist/template-bindings/style-funcs.d.ts.map +1 -0
- package/dist/template-bindings/style-funcs.js +172 -0
- package/dist/template-bindings/style-funcs.js.map +1 -0
- package/dist/themes/buildPalette.d.ts +31 -0
- package/dist/themes/buildPalette.d.ts.map +1 -0
- package/dist/themes/buildPalette.js +43 -0
- package/dist/themes/buildPalette.js.map +1 -0
- package/dist/themes/colorMath.d.ts +23 -0
- package/dist/themes/colorMath.d.ts.map +1 -0
- package/dist/themes/colorMath.js +99 -0
- package/dist/themes/colorMath.js.map +1 -0
- package/dist/themes/data/atom-one-dark.d.ts +4 -0
- package/dist/themes/data/atom-one-dark.d.ts.map +1 -0
- package/dist/themes/data/atom-one-dark.js +159 -0
- package/dist/themes/data/atom-one-dark.js.map +1 -0
- package/dist/themes/data/atom-one-light.d.ts +4 -0
- package/dist/themes/data/atom-one-light.d.ts.map +1 -0
- package/dist/themes/data/atom-one-light.js +159 -0
- package/dist/themes/data/atom-one-light.js.map +1 -0
- package/dist/themes/data/catppuccin-latte.d.ts +4 -0
- package/dist/themes/data/catppuccin-latte.d.ts.map +1 -0
- package/dist/themes/data/catppuccin-latte.js +159 -0
- package/dist/themes/data/catppuccin-latte.js.map +1 -0
- package/dist/themes/data/catppuccin-mocha.d.ts +4 -0
- package/dist/themes/data/catppuccin-mocha.d.ts.map +1 -0
- package/dist/themes/data/catppuccin-mocha.js +159 -0
- package/dist/themes/data/catppuccin-mocha.js.map +1 -0
- package/dist/themes/data/dracula.d.ts +4 -0
- package/dist/themes/data/dracula.d.ts.map +1 -0
- package/dist/themes/data/dracula.js +159 -0
- package/dist/themes/data/dracula.js.map +1 -0
- package/dist/themes/data/flexoki.d.ts +4 -0
- package/dist/themes/data/flexoki.d.ts.map +1 -0
- package/dist/themes/data/flexoki.js +159 -0
- package/dist/themes/data/flexoki.js.map +1 -0
- package/dist/themes/data/gruvbox.d.ts +4 -0
- package/dist/themes/data/gruvbox.d.ts.map +1 -0
- package/dist/themes/data/gruvbox.js +159 -0
- package/dist/themes/data/gruvbox.js.map +1 -0
- package/dist/themes/data/index.d.ts +29 -0
- package/dist/themes/data/index.d.ts.map +1 -0
- package/dist/themes/data/index.js +48 -0
- package/dist/themes/data/index.js.map +1 -0
- package/dist/themes/data/monokai.d.ts +4 -0
- package/dist/themes/data/monokai.d.ts.map +1 -0
- package/dist/themes/data/monokai.js +159 -0
- package/dist/themes/data/monokai.js.map +1 -0
- package/dist/themes/data/nord.d.ts +4 -0
- package/dist/themes/data/nord.d.ts.map +1 -0
- package/dist/themes/data/nord.js +159 -0
- package/dist/themes/data/nord.js.map +1 -0
- package/dist/themes/data/rose-pine-dawn.d.ts +4 -0
- package/dist/themes/data/rose-pine-dawn.d.ts.map +1 -0
- package/dist/themes/data/rose-pine-dawn.js +159 -0
- package/dist/themes/data/rose-pine-dawn.js.map +1 -0
- package/dist/themes/data/rose-pine-moon.d.ts +4 -0
- package/dist/themes/data/rose-pine-moon.d.ts.map +1 -0
- package/dist/themes/data/rose-pine-moon.js +159 -0
- package/dist/themes/data/rose-pine-moon.js.map +1 -0
- package/dist/themes/data/rose-pine.d.ts +4 -0
- package/dist/themes/data/rose-pine.d.ts.map +1 -0
- package/dist/themes/data/rose-pine.js +159 -0
- package/dist/themes/data/rose-pine.js.map +1 -0
- package/dist/themes/data/solarized-dark.d.ts +4 -0
- package/dist/themes/data/solarized-dark.d.ts.map +1 -0
- package/dist/themes/data/solarized-dark.js +159 -0
- package/dist/themes/data/solarized-dark.js.map +1 -0
- package/dist/themes/data/solarized-light.d.ts +4 -0
- package/dist/themes/data/solarized-light.d.ts.map +1 -0
- package/dist/themes/data/solarized-light.js +159 -0
- package/dist/themes/data/solarized-light.js.map +1 -0
- package/dist/themes/data/textual-ansi.d.ts +4 -0
- package/dist/themes/data/textual-ansi.d.ts.map +1 -0
- package/dist/themes/data/textual-ansi.js +159 -0
- package/dist/themes/data/textual-ansi.js.map +1 -0
- package/dist/themes/data/textual-dark.d.ts +4 -0
- package/dist/themes/data/textual-dark.d.ts.map +1 -0
- package/dist/themes/data/textual-dark.js +159 -0
- package/dist/themes/data/textual-dark.js.map +1 -0
- package/dist/themes/data/textual-light.d.ts +4 -0
- package/dist/themes/data/textual-light.d.ts.map +1 -0
- package/dist/themes/data/textual-light.js +159 -0
- package/dist/themes/data/textual-light.js.map +1 -0
- package/dist/themes/data/tokyo-night.d.ts +4 -0
- package/dist/themes/data/tokyo-night.d.ts.map +1 -0
- package/dist/themes/data/tokyo-night.js +159 -0
- package/dist/themes/data/tokyo-night.js.map +1 -0
- package/dist/themes/data/types.d.ts +15 -0
- package/dist/themes/data/types.d.ts.map +1 -0
- package/dist/themes/data/types.js +2 -0
- package/dist/themes/data/types.js.map +1 -0
- package/dist/themes/palette.d.ts +20 -0
- package/dist/themes/palette.d.ts.map +1 -0
- package/dist/themes/palette.js +27 -0
- package/dist/themes/palette.js.map +1 -0
- package/dist/themes/paletteResolver.d.ts +35 -0
- package/dist/themes/paletteResolver.d.ts.map +1 -0
- package/dist/themes/paletteResolver.js +88 -0
- package/dist/themes/paletteResolver.js.map +1 -0
- package/dist/themes/registry.d.ts +17 -0
- package/dist/themes/registry.d.ts.map +1 -0
- package/dist/themes/registry.js +33 -0
- package/dist/themes/registry.js.map +1 -0
- package/dist/themes/terminalThemes.d.ts +46 -0
- package/dist/themes/terminalThemes.d.ts.map +1 -0
- package/dist/themes/terminalThemes.js +268 -0
- package/dist/themes/terminalThemes.js.map +1 -0
- package/dist/widgets/button.d.ts +47 -0
- package/dist/widgets/button.d.ts.map +1 -0
- package/dist/widgets/button.js +183 -0
- package/dist/widgets/button.js.map +1 -0
- package/dist/widgets/checkbox.d.ts +43 -0
- package/dist/widgets/checkbox.d.ts.map +1 -0
- package/dist/widgets/checkbox.js +144 -0
- package/dist/widgets/checkbox.js.map +1 -0
- package/dist/widgets/dropdown.d.ts +67 -0
- package/dist/widgets/dropdown.d.ts.map +1 -0
- package/dist/widgets/dropdown.js +373 -0
- package/dist/widgets/dropdown.js.map +1 -0
- package/dist/widgets/event-router.d.ts +73 -0
- package/dist/widgets/event-router.d.ts.map +1 -0
- package/dist/widgets/event-router.js +479 -0
- package/dist/widgets/event-router.js.map +1 -0
- package/dist/widgets/focus-manager.d.ts +26 -0
- package/dist/widgets/focus-manager.d.ts.map +1 -0
- package/dist/widgets/focus-manager.js +179 -0
- package/dist/widgets/focus-manager.js.map +1 -0
- package/dist/widgets/index.d.ts +23 -0
- package/dist/widgets/index.d.ts.map +1 -0
- package/dist/widgets/index.js +13 -0
- package/dist/widgets/index.js.map +1 -0
- package/dist/widgets/screen.d.ts +90 -0
- package/dist/widgets/screen.d.ts.map +1 -0
- package/dist/widgets/screen.js +440 -0
- package/dist/widgets/screen.js.map +1 -0
- package/dist/widgets/slider.d.ts +55 -0
- package/dist/widgets/slider.d.ts.map +1 -0
- package/dist/widgets/slider.js +248 -0
- package/dist/widgets/slider.js.map +1 -0
- package/dist/widgets/static-item.d.ts +41 -0
- package/dist/widgets/static-item.d.ts.map +1 -0
- package/dist/widgets/static-item.js +62 -0
- package/dist/widgets/static-item.js.map +1 -0
- package/dist/widgets/text-input.d.ts +50 -0
- package/dist/widgets/text-input.d.ts.map +1 -0
- package/dist/widgets/text-input.js +242 -0
- package/dist/widgets/text-input.js.map +1 -0
- package/dist/widgets/toggle.d.ts +46 -0
- package/dist/widgets/toggle.d.ts.map +1 -0
- package/dist/widgets/toggle.js +169 -0
- package/dist/widgets/toggle.js.map +1 -0
- package/dist/widgets/types.d.ts +92 -0
- package/dist/widgets/types.d.ts.map +1 -0
- package/dist/widgets/types.js +13 -0
- package/dist/widgets/types.js.map +1 -0
- package/dist/widgets/widget-base.d.ts +41 -0
- package/dist/widgets/widget-base.d.ts.map +1 -0
- package/dist/widgets/widget-base.js +159 -0
- package/dist/widgets/widget-base.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Screen — owns the render loop and ANSI output for interactive widgets.
|
|
3
|
+
*
|
|
4
|
+
* [LAW:dataflow-not-control-flow] Same pipeline runs every frame: render
|
|
5
|
+
* widgets to Segment[], split into lines, encode to ANSI, write to stdout
|
|
6
|
+
* with cursor-up + overwrite. Variability lives in the values (which widgets
|
|
7
|
+
* are visible, what they render), never in whether the pipeline runs.
|
|
8
|
+
*
|
|
9
|
+
* [LAW:one-source-of-truth] Layout (widget bounds) is computed here and
|
|
10
|
+
* written to widget.bounds. Mouse hit-testing reads the same bounds — the
|
|
11
|
+
* Screen is the single authority on where each widget is drawn.
|
|
12
|
+
*
|
|
13
|
+
* [LAW:single-enforcer] Cursor management lives in one place: `draw()`
|
|
14
|
+
* tracks `lastLineCount` and emits a single `\x1b[<n>A` to reposition.
|
|
15
|
+
* Per-line `\x1b[K` (erase to end of line) overwrites old content without
|
|
16
|
+
* flicker — no clear-and-redraw cycle.
|
|
17
|
+
*
|
|
18
|
+
* Reactivity: `mobx.autorun` re-fires on any observable read during render
|
|
19
|
+
* (label, focused, hovered, active, disabled, visible, the widget list
|
|
20
|
+
* itself). Renders are debounced to a microtask so a burst of state changes
|
|
21
|
+
* within one tick produces one frame.
|
|
22
|
+
*
|
|
23
|
+
* Layout (per-widget Placement):
|
|
24
|
+
*
|
|
25
|
+
* flow — vertical stack at x=0; advances the layout cursor by the
|
|
26
|
+
* widget's measured height. Default placement; preserves the
|
|
27
|
+
* historical single-column behavior so existing consumers
|
|
28
|
+
* (and the screen tests) need no migration.
|
|
29
|
+
* inline — same row as the preceding flow/inline neighbor; x packs
|
|
30
|
+
* after that neighbor's right edge plus a one-cell gap. The
|
|
31
|
+
* row's height is the max of its members; the cursor advances
|
|
32
|
+
* past the tallest member when the next non-inline item is
|
|
33
|
+
* placed (or at end of frame).
|
|
34
|
+
* fixed — absolute (x, y); independent of the cursor. Used for
|
|
35
|
+
* anchored content like status/log rows that the host wants
|
|
36
|
+
* placed at a known coordinate regardless of flow growth.
|
|
37
|
+
*
|
|
38
|
+
* The overlay pass (single enforcer) runs after base layout: any widget
|
|
39
|
+
* implementing OverlayRenderable contributes overlay segments anchored
|
|
40
|
+
* directly below its inline footprint, and Screen unions the overlay
|
|
41
|
+
* area into the widget's bounds for hit-testing.
|
|
42
|
+
*
|
|
43
|
+
* Design alternatives considered:
|
|
44
|
+
* 1. Per-widget Placement (chosen) — smallest type that covers the legal
|
|
45
|
+
* variability; one total switch in computeFrame; back-compat default.
|
|
46
|
+
* 2. Named regions (header/body/status as flow containers) — adds a
|
|
47
|
+
* two-step API surface (declare regions, then mount into them) and
|
|
48
|
+
* another concept; rejected as larger than the problem requires.
|
|
49
|
+
* 3. Host-supplied layout function — pushes layout out of Screen,
|
|
50
|
+
* defeating single-enforcer; rejected.
|
|
51
|
+
*/
|
|
52
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
53
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
54
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
55
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
56
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
57
|
+
var _, done = false;
|
|
58
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
59
|
+
var context = {};
|
|
60
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
61
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
62
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
63
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
64
|
+
if (kind === "accessor") {
|
|
65
|
+
if (result === void 0) continue;
|
|
66
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
67
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
68
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
69
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
70
|
+
}
|
|
71
|
+
else if (_ = accept(result)) {
|
|
72
|
+
if (kind === "field") initializers.unshift(_);
|
|
73
|
+
else descriptor[key] = _;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
77
|
+
done = true;
|
|
78
|
+
};
|
|
79
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
80
|
+
var useValue = arguments.length > 2;
|
|
81
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
82
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
83
|
+
}
|
|
84
|
+
return useValue ? value : void 0;
|
|
85
|
+
};
|
|
86
|
+
import { autorun, makeObservable, observable, runInAction } from "mobx";
|
|
87
|
+
import { Segment } from "../core/segment.js";
|
|
88
|
+
import { segmentsToString } from "../core/render.js";
|
|
89
|
+
import { resolveColorSystem } from "../core/color.js";
|
|
90
|
+
import { DefaultFocusManager } from "./focus-manager.js";
|
|
91
|
+
import { FLOW, hasOverlay } from "./types.js";
|
|
92
|
+
const DEFAULT_WIDTH = 80;
|
|
93
|
+
let DefaultScreen = (() => {
|
|
94
|
+
var _a;
|
|
95
|
+
let _widgetList_decorators;
|
|
96
|
+
let _widgetList_initializers = [];
|
|
97
|
+
let _widgetList_extraInitializers = [];
|
|
98
|
+
return class DefaultScreen {
|
|
99
|
+
static {
|
|
100
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
101
|
+
_widgetList_decorators = [(_a = observable).shallow.bind(_a)];
|
|
102
|
+
__esDecorate(this, null, _widgetList_decorators, { kind: "accessor", name: "widgetList", static: false, private: false, access: { has: obj => "widgetList" in obj, get: obj => obj.widgetList, set: (obj, value) => { obj.widgetList = value; } }, metadata: _metadata }, _widgetList_initializers, _widgetList_extraInitializers);
|
|
103
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
104
|
+
}
|
|
105
|
+
focusManager;
|
|
106
|
+
#widgetList_accessor_storage = __runInitializers(this, _widgetList_initializers, []);
|
|
107
|
+
// [LAW:one-source-of-truth] The mounted widget list is observable so
|
|
108
|
+
// mount/unmount triggers the render autorun without an extra subscription.
|
|
109
|
+
get widgetList() { return this.#widgetList_accessor_storage; }
|
|
110
|
+
set widgetList(value) { this.#widgetList_accessor_storage = value; }
|
|
111
|
+
// [LAW:one-source-of-truth] Placements live in a parallel Map keyed by
|
|
112
|
+
// widget. Placements are immutable per mount — Screen sets them and never
|
|
113
|
+
// mutates them, so they don't need to be observable. The observable
|
|
114
|
+
// `widgetList` above already fires reactivity on mount/unmount.
|
|
115
|
+
placements = (__runInitializers(this, _widgetList_extraInitializers), new Map());
|
|
116
|
+
_running = false;
|
|
117
|
+
autorunDispose;
|
|
118
|
+
renderScheduled = false;
|
|
119
|
+
lastLineCount = 0;
|
|
120
|
+
out;
|
|
121
|
+
widthOverride;
|
|
122
|
+
colorSystem;
|
|
123
|
+
manageCursor;
|
|
124
|
+
constructor(options = {}) {
|
|
125
|
+
this.out = options.out ?? process.stdout;
|
|
126
|
+
this.widthOverride = options.width;
|
|
127
|
+
this.focusManager = options.focusManager ?? new DefaultFocusManager();
|
|
128
|
+
const isTTY = this.out.isTTY ?? false;
|
|
129
|
+
this.colorSystem = resolveSpec(options.colorSystem, isTTY);
|
|
130
|
+
this.manageCursor = options.manageCursor ?? isTTY;
|
|
131
|
+
makeObservable(this);
|
|
132
|
+
}
|
|
133
|
+
get running() {
|
|
134
|
+
return this._running;
|
|
135
|
+
}
|
|
136
|
+
get widgets() {
|
|
137
|
+
return this.widgetList;
|
|
138
|
+
}
|
|
139
|
+
// --- Lifecycle ---
|
|
140
|
+
mount(...entries) {
|
|
141
|
+
runInAction(() => {
|
|
142
|
+
const next = [...this.widgetList];
|
|
143
|
+
for (const entry of entries) {
|
|
144
|
+
const { widget, placement } = normalizeEntry(entry);
|
|
145
|
+
if (next.includes(widget))
|
|
146
|
+
continue;
|
|
147
|
+
next.push(widget);
|
|
148
|
+
this.placements.set(widget, placement);
|
|
149
|
+
this.focusManager.register(widget);
|
|
150
|
+
}
|
|
151
|
+
this.widgetList = next;
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
unmount(widget) {
|
|
155
|
+
runInAction(() => {
|
|
156
|
+
const idx = this.widgetList.indexOf(widget);
|
|
157
|
+
if (idx === -1)
|
|
158
|
+
return;
|
|
159
|
+
this.widgetList = this.widgetList.filter((w) => w !== widget);
|
|
160
|
+
this.placements.delete(widget);
|
|
161
|
+
this.focusManager.unregister(widget);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
start() {
|
|
165
|
+
if (this._running)
|
|
166
|
+
return;
|
|
167
|
+
this._running = true;
|
|
168
|
+
this.lastLineCount = 0;
|
|
169
|
+
if (this.manageCursor)
|
|
170
|
+
this.out.write("\x1b[?25l");
|
|
171
|
+
// [LAW:dataflow-not-control-flow] One reactive pipeline. The autorun
|
|
172
|
+
// reads observables during render; MobX subscribes to exactly what was
|
|
173
|
+
// read, so only relevant state changes trigger redraws.
|
|
174
|
+
this.autorunDispose = autorun(() => {
|
|
175
|
+
this.computeFrame(); // touch observables to subscribe
|
|
176
|
+
this.scheduleRender();
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
stop() {
|
|
180
|
+
if (!this._running)
|
|
181
|
+
return;
|
|
182
|
+
this._running = false;
|
|
183
|
+
if (this.autorunDispose) {
|
|
184
|
+
this.autorunDispose();
|
|
185
|
+
this.autorunDispose = undefined;
|
|
186
|
+
}
|
|
187
|
+
if (this.manageCursor)
|
|
188
|
+
this.out.write("\x1b[?25h");
|
|
189
|
+
if (this.lastLineCount > 0)
|
|
190
|
+
this.out.write("\n");
|
|
191
|
+
}
|
|
192
|
+
// --- Internal: layout + draw ---
|
|
193
|
+
get width() {
|
|
194
|
+
if (this.widthOverride !== undefined)
|
|
195
|
+
return this.widthOverride;
|
|
196
|
+
const cols = this.out.columns;
|
|
197
|
+
return cols ?? DEFAULT_WIDTH;
|
|
198
|
+
}
|
|
199
|
+
computeFrame() {
|
|
200
|
+
const renderOptions = {
|
|
201
|
+
maxWidth: this.width,
|
|
202
|
+
isTerminal: true,
|
|
203
|
+
encoding: "utf-8",
|
|
204
|
+
};
|
|
205
|
+
const lines = [];
|
|
206
|
+
const boundsList = [];
|
|
207
|
+
// Layout cursor for flow placement. `cursorY` is the next free row.
|
|
208
|
+
// `lastFlowRow` tracks the most recent flow/inline row so that a
|
|
209
|
+
// following inline placement can pack against its right edge.
|
|
210
|
+
let cursorY = 0;
|
|
211
|
+
let lastFlowRow = null;
|
|
212
|
+
// Pass 1 — base layout. Each widget contributes its inline footprint
|
|
213
|
+
// (Renderable.render). Position is determined by the widget's Placement.
|
|
214
|
+
for (const widget of this.widgetList) {
|
|
215
|
+
// [LAW:dataflow-not-control-flow] Hidden widgets still pass through the
|
|
216
|
+
// pipeline — their data just produces zero rows and zero-size bounds.
|
|
217
|
+
// The same operations execute every iteration.
|
|
218
|
+
const visible = widget.visible;
|
|
219
|
+
const segments = visible ? Array.from(widget.render(renderOptions)) : [];
|
|
220
|
+
const widgetLines = visible ? Segment.splitLines(segments) : [];
|
|
221
|
+
const [w, h] = Segment.getShape(widgetLines);
|
|
222
|
+
const placement = this.placements.get(widget) ?? FLOW;
|
|
223
|
+
// [LAW:types-are-the-program] Single total switch on the discriminated
|
|
224
|
+
// union: every legal placement gets exactly one branch, the compiler
|
|
225
|
+
// enforces exhaustiveness, and the rest of the pipeline (paint into
|
|
226
|
+
// `lines`, record bounds) is identical for every kind.
|
|
227
|
+
let x;
|
|
228
|
+
let y;
|
|
229
|
+
switch (placement.kind) {
|
|
230
|
+
case "flow": {
|
|
231
|
+
x = 0;
|
|
232
|
+
y = cursorY;
|
|
233
|
+
paintLines(lines, widgetLines, x, y);
|
|
234
|
+
if (h > 0) {
|
|
235
|
+
cursorY = y + h;
|
|
236
|
+
lastFlowRow = { startY: y, height: h, rightX: x + w };
|
|
237
|
+
}
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
case "inline": {
|
|
241
|
+
// Pack onto the most recent flow/inline row. If there is no prior
|
|
242
|
+
// row (inline used as the first item), fall back to flow at x=0.
|
|
243
|
+
const prev = lastFlowRow;
|
|
244
|
+
if (prev === null) {
|
|
245
|
+
x = 0;
|
|
246
|
+
y = cursorY;
|
|
247
|
+
}
|
|
248
|
+
else {
|
|
249
|
+
x = prev.rightX + (prev.rightX > 0 ? 1 : 0);
|
|
250
|
+
y = prev.startY;
|
|
251
|
+
}
|
|
252
|
+
paintLines(lines, widgetLines, x, y);
|
|
253
|
+
if (h > 0) {
|
|
254
|
+
const rowStart = prev?.startY ?? y;
|
|
255
|
+
const rowHeight = Math.max(prev?.height ?? 0, h);
|
|
256
|
+
cursorY = Math.max(cursorY, rowStart + rowHeight);
|
|
257
|
+
lastFlowRow = { startY: rowStart, height: rowHeight, rightX: x + w };
|
|
258
|
+
}
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
case "fixed": {
|
|
262
|
+
x = placement.x;
|
|
263
|
+
y = placement.y;
|
|
264
|
+
paintLines(lines, widgetLines, x, y);
|
|
265
|
+
// Fixed placements never advance the flow cursor — they are
|
|
266
|
+
// independent anchors. We still grow the canvas if needed
|
|
267
|
+
// (paintLines handles that).
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
boundsList.push({ widget, bounds: { x, y, width: w, height: h } });
|
|
272
|
+
}
|
|
273
|
+
// Pass 2 — overlays. Widgets that implement OverlayRenderable paint
|
|
274
|
+
// ON TOP of the frame, anchored directly below their inline footprint.
|
|
275
|
+
// Render order = z-order: the overlay pass runs last, so overlay rows
|
|
276
|
+
// overwrite anything that was placed below the widget by pass 1.
|
|
277
|
+
// [LAW:single-enforcer] Overlay placement and bounds-union both happen
|
|
278
|
+
// here; widgets never draw their own overlays.
|
|
279
|
+
for (const entry of boundsList) {
|
|
280
|
+
const widget = entry.widget;
|
|
281
|
+
if (!widget.visible)
|
|
282
|
+
continue;
|
|
283
|
+
if (!hasOverlay(widget))
|
|
284
|
+
continue;
|
|
285
|
+
const overlaySegs = widget.renderOverlay(renderOptions);
|
|
286
|
+
if (overlaySegs === null)
|
|
287
|
+
continue;
|
|
288
|
+
const overlayLines = Segment.splitLines(Array.from(overlaySegs));
|
|
289
|
+
if (overlayLines.length === 0)
|
|
290
|
+
continue;
|
|
291
|
+
const startY = entry.bounds.y + entry.bounds.height;
|
|
292
|
+
paintLines(lines, overlayLines, entry.bounds.x, startY);
|
|
293
|
+
const [overlayW] = Segment.getShape(overlayLines);
|
|
294
|
+
entry.bounds = {
|
|
295
|
+
x: entry.bounds.x,
|
|
296
|
+
y: entry.bounds.y,
|
|
297
|
+
width: Math.max(entry.bounds.width, overlayW),
|
|
298
|
+
height: entry.bounds.height + overlayLines.length,
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
return { lines, bounds: boundsList };
|
|
302
|
+
}
|
|
303
|
+
scheduleRender() {
|
|
304
|
+
if (this.renderScheduled)
|
|
305
|
+
return;
|
|
306
|
+
this.renderScheduled = true;
|
|
307
|
+
queueMicrotask(() => {
|
|
308
|
+
this.renderScheduled = false;
|
|
309
|
+
if (this._running)
|
|
310
|
+
this.draw();
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
draw() {
|
|
314
|
+
const { lines, bounds } = this.computeFrame();
|
|
315
|
+
// [LAW:single-enforcer] Bounds are written here, the only place that
|
|
316
|
+
// computes layout. `bounds` is a plain field (see widget-base.ts) — no
|
|
317
|
+
// MobX action required.
|
|
318
|
+
for (const { widget, bounds: b } of bounds)
|
|
319
|
+
widget.bounds = b;
|
|
320
|
+
const newCount = lines.length;
|
|
321
|
+
const drawCount = Math.max(newCount, this.lastLineCount);
|
|
322
|
+
let buf = "";
|
|
323
|
+
if (this.lastLineCount > 0) {
|
|
324
|
+
buf += `\x1b[${this.lastLineCount}A`;
|
|
325
|
+
}
|
|
326
|
+
buf += "\r";
|
|
327
|
+
for (let i = 0; i < drawCount; i++) {
|
|
328
|
+
const line = lines[i];
|
|
329
|
+
if (line) {
|
|
330
|
+
// [LAW:single-enforcer] Clip each line to terminal width so wide
|
|
331
|
+
// content can't soft-wrap and break the "1 frame row = 1 terminal
|
|
332
|
+
// row" invariant the redraw loop depends on. Without this, a wrapped
|
|
333
|
+
// line shifts every later row down by one terminal cell, which
|
|
334
|
+
// misaligns overlays and leaves wrap-continuation residue when later
|
|
335
|
+
// frames write narrower content over the same logical row.
|
|
336
|
+
const clipped = Segment.adjustLineLength(line, this.width, undefined, false);
|
|
337
|
+
buf += segmentsToString(clipped, this.colorSystem);
|
|
338
|
+
}
|
|
339
|
+
// [LAW:single-enforcer] Erase-to-end-of-line is the single mechanism
|
|
340
|
+
// for overwriting stale content. We do not pre-clear lines.
|
|
341
|
+
buf += "\x1b[K";
|
|
342
|
+
if (i < drawCount - 1)
|
|
343
|
+
buf += "\n";
|
|
344
|
+
}
|
|
345
|
+
this.out.write(buf);
|
|
346
|
+
this.lastLineCount = drawCount;
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
})();
|
|
350
|
+
export { DefaultScreen };
|
|
351
|
+
// [LAW:single-enforcer] One function resolves the color-system spec into a
|
|
352
|
+
// ColorDepth (or null). String specs route through resolveColorSystem; enum
|
|
353
|
+
// values pass through; null/`"none"` strip color.
|
|
354
|
+
function resolveSpec(spec, isTTY) {
|
|
355
|
+
if (spec === null)
|
|
356
|
+
return null;
|
|
357
|
+
if (spec === undefined)
|
|
358
|
+
return resolveColorSystem("auto", { isTTY });
|
|
359
|
+
if (typeof spec === "string")
|
|
360
|
+
return resolveColorSystem(spec, { isTTY });
|
|
361
|
+
return spec;
|
|
362
|
+
}
|
|
363
|
+
// Normalize a MountEntry into its internal { widget, placement } form.
|
|
364
|
+
// Bare widgets default to flow placement so existing call sites (and tests)
|
|
365
|
+
// that pass `mount(a, b, c)` keep working unchanged.
|
|
366
|
+
function normalizeEntry(entry) {
|
|
367
|
+
if ("widget" in entry && "placement" in entry) {
|
|
368
|
+
return { widget: entry.widget, placement: entry.placement };
|
|
369
|
+
}
|
|
370
|
+
return { widget: entry, placement: FLOW };
|
|
371
|
+
}
|
|
372
|
+
// Paint `widgetLines` into the frame `lines` at top-left (x, y). Grows the
|
|
373
|
+
// frame as needed and uses cell-accurate splice semantics so a fixed
|
|
374
|
+
// placement or overlay overwrites whatever was painted earlier underneath.
|
|
375
|
+
//
|
|
376
|
+
// [LAW:single-enforcer] All compositing into the frame buffer goes through
|
|
377
|
+
// this function. flow/inline/fixed placements and the overlay pass all call
|
|
378
|
+
// it, so the rules for "how characters land at (x, y)" live in one place.
|
|
379
|
+
function paintLines(lines, widgetLines, x, y) {
|
|
380
|
+
if (widgetLines.length === 0)
|
|
381
|
+
return;
|
|
382
|
+
while (lines.length < y + widgetLines.length)
|
|
383
|
+
lines.push([]);
|
|
384
|
+
for (let i = 0; i < widgetLines.length; i++) {
|
|
385
|
+
const target = lines[y + i];
|
|
386
|
+
const source = widgetLines[i];
|
|
387
|
+
const sourceWidth = lineCellLength(source);
|
|
388
|
+
if (sourceWidth === 0)
|
|
389
|
+
continue;
|
|
390
|
+
if (x === 0 && target.length === 0) {
|
|
391
|
+
lines[y + i] = source.slice();
|
|
392
|
+
continue;
|
|
393
|
+
}
|
|
394
|
+
lines[y + i] = spliceCells(target, x, sourceWidth, source);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
function lineCellLength(line) {
|
|
398
|
+
let total = 0;
|
|
399
|
+
for (const s of line)
|
|
400
|
+
total += s.cellLength;
|
|
401
|
+
return total;
|
|
402
|
+
}
|
|
403
|
+
// Return a new row with cells [start, start+length) replaced by
|
|
404
|
+
// `replacement`. Pads the prefix with spaces if `row` is shorter than
|
|
405
|
+
// `start`. Honors wide characters and styled segments by splitting at cell
|
|
406
|
+
// boundaries.
|
|
407
|
+
function spliceCells(row, start, length, replacement) {
|
|
408
|
+
const rowWidth = lineCellLength(row);
|
|
409
|
+
const padded = row.slice();
|
|
410
|
+
if (rowWidth < start) {
|
|
411
|
+
padded.push(new Segment(" ".repeat(start - rowWidth)));
|
|
412
|
+
}
|
|
413
|
+
const prefix = [];
|
|
414
|
+
const suffix = [];
|
|
415
|
+
let cursor = 0;
|
|
416
|
+
for (const seg of padded) {
|
|
417
|
+
const segEnd = cursor + seg.cellLength;
|
|
418
|
+
if (segEnd <= start) {
|
|
419
|
+
prefix.push(seg);
|
|
420
|
+
}
|
|
421
|
+
else if (cursor >= start + length) {
|
|
422
|
+
suffix.push(seg);
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
if (cursor < start) {
|
|
426
|
+
const [head] = seg.splitCells(start - cursor);
|
|
427
|
+
if (head.hasText)
|
|
428
|
+
prefix.push(head);
|
|
429
|
+
}
|
|
430
|
+
if (segEnd > start + length) {
|
|
431
|
+
const [, tail] = seg.splitCells(start + length - cursor);
|
|
432
|
+
if (tail.hasText)
|
|
433
|
+
suffix.push(tail);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
cursor = segEnd;
|
|
437
|
+
}
|
|
438
|
+
return [...prefix, ...replacement, ...suffix];
|
|
439
|
+
}
|
|
440
|
+
//# sourceMappingURL=screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screen.js","sourceRoot":"","sources":["../../src/widgets/screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAA0B,MAAM,MAAM,CAAC;AAChG,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAc,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAoC9C,MAAM,aAAa,GAAG,EAAE,CAAC;IAEZ,aAAa;;;;;iBAAb,aAAa;;;sCAKvB,CAAA,KAAA,UAAU,CAAA,CAAC,OAAO;YACnB,mLAAS,UAAU,6BAAV,UAAU,+FAA2B;;;QALrC,YAAY,CAAe;QAKpC,iFAA2C,EAAE,EAAC;QAH9C,qEAAqE;QACrE,2EAA2E;QAE3E,IAAS,UAAU,gDAA2B;QAA9C,IAAS,UAAU,sDAA2B;QAE9C,uEAAuE;QACvE,0EAA0E;QAC1E,oEAAoE;QACpE,gEAAgE;QAC/C,UAAU,4DAAG,IAAI,GAAG,EAAgC,EAAC;QAE9D,QAAQ,GAAG,KAAK,CAAC;QACjB,c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MAAM,GAAc,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAc,EAAE,CAAC;IAC7B,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC;QACvC,IAAI,MAAM,IAAI,KAAK,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;aAAM,IAAI,MAAM,IAAI,KAAK,GAAG,MAAM,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,IAAI,MAAM,GAAG,KAAK,EAAE,CAAC;gBACnB,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC;gBAC9C,IAAI,IAAI,CAAC,OAAO;oBAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC;YACD,IAAI,MAAM,GAAG,KAAK,GAAG,MAAM,EAAE,CAAC;gBAC5B,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;gBACzD,IAAI,IAAI,CAAC,OAAO;oBAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;QACD,MAAM,GAAG,MAAM,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,WAAW,EAAE,GAAG,MAAM,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slider widget — numeric value within [min, max] with step increments.
|
|
3
|
+
* [LAW:dataflow-not-control-flow] every render emits exactly `width`
|
|
4
|
+
* track cells; the marker cell index is data, not a branch.
|
|
5
|
+
* [LAW:one-type-per-behavior] shared infrastructure inherited from
|
|
6
|
+
* WidgetBase.
|
|
7
|
+
*
|
|
8
|
+
* Visual:
|
|
9
|
+
* track — `width` cells of "─" (ASCII fallback "-")
|
|
10
|
+
* marker — "●" (ASCII fallback "*") at round((value - min) / range * (width - 1))
|
|
11
|
+
* filled — cells left of and including the marker use primary fg
|
|
12
|
+
* unfilled — cells right of the marker use surface bg / foreground
|
|
13
|
+
* focused — underline on the segments
|
|
14
|
+
* disabled — dim
|
|
15
|
+
*/
|
|
16
|
+
import { Segment } from "../core/segment.js";
|
|
17
|
+
import type { RenderOptions } from "../core/protocol.js";
|
|
18
|
+
import type { TerminalTheme } from "../core/color.js";
|
|
19
|
+
import { WidgetBase } from "./widget-base.js";
|
|
20
|
+
import type { KeyEvent, WidgetMouseEvent } from "./types.js";
|
|
21
|
+
export interface SliderOptions {
|
|
22
|
+
value?: number;
|
|
23
|
+
min?: number;
|
|
24
|
+
max?: number;
|
|
25
|
+
step?: number;
|
|
26
|
+
width?: number;
|
|
27
|
+
id?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
theme?: TerminalTheme;
|
|
30
|
+
}
|
|
31
|
+
export declare class Slider extends WidgetBase {
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly focusable = true;
|
|
34
|
+
accessor value: number;
|
|
35
|
+
accessor min: number;
|
|
36
|
+
accessor max: number;
|
|
37
|
+
accessor step: number;
|
|
38
|
+
accessor width: number;
|
|
39
|
+
private _theme;
|
|
40
|
+
private _dragging;
|
|
41
|
+
constructor(options?: SliderOptions);
|
|
42
|
+
setTheme(theme: TerminalTheme): void;
|
|
43
|
+
handleKey(event: KeyEvent): void;
|
|
44
|
+
handleMouse(event: WidgetMouseEvent): void;
|
|
45
|
+
setHovered(value: boolean): void;
|
|
46
|
+
private setValue;
|
|
47
|
+
private setValueFromMouseX;
|
|
48
|
+
render(options: RenderOptions): Iterable<Segment>;
|
|
49
|
+
measure(_options: RenderOptions): {
|
|
50
|
+
minimum: number;
|
|
51
|
+
maximum: number;
|
|
52
|
+
};
|
|
53
|
+
private resolvePalette;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../src/widgets/slider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAI7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAID,qBAAa,MAAO,SAAQ,UAAU;IACpC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,SAAS,QAAQ;IAEd,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvC,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO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