@zakmandhro/bunti 0.2.0 → 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 +16 -10
- package/dist/cli.d.ts +2 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +33 -9
- package/dist/cli.js.map +1 -1
- package/dist/colors.d.ts +2 -2
- package/dist/colors.js +2 -2
- package/dist/components/Box.d.ts +1 -1
- package/dist/components/Button.d.ts +6 -3
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +12 -3
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.d.ts +1 -1
- package/dist/components/Card.js +3 -3
- package/dist/components/Header.d.ts +1 -1
- package/dist/components/Header.js +2 -2
- package/dist/components/Input.d.ts +2 -2
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +5 -1
- package/dist/components/Input.js.map +1 -1
- package/dist/components/Link.d.ts +2 -2
- package/dist/components/Link.d.ts.map +1 -1
- package/dist/components/Link.js +12 -3
- package/dist/components/Link.js.map +1 -1
- package/dist/components/Modal.d.ts +1 -1
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Modal.js +11 -6
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/Progress.d.ts +2 -2
- package/dist/components/Progress.js +2 -2
- package/dist/components/Spinner.d.ts +2 -2
- package/dist/components/index.d.ts +9 -9
- package/dist/components/index.js +9 -9
- package/dist/data/nf-glyphs.d.ts +2 -2
- package/dist/demo-registry.d.ts.map +1 -1
- package/dist/demo-registry.js +6 -1
- package/dist/demo-registry.js.map +1 -1
- package/dist/demos/2048.js +559 -0
- package/dist/demos/2048.ts +1 -1
- package/dist/demos/animation.js +177 -0
- package/dist/demos/animation.ts +1 -1
- package/dist/demos/demo-layout.js +85 -0
- package/dist/demos/demo-layout.ts +6 -1
- package/dist/demos/engine.js +244 -0
- package/dist/demos/interaction.js +74 -0
- package/dist/demos/interaction.ts +1 -1
- package/dist/demos/login.js +175 -0
- package/dist/demos/login.ts +1 -1
- package/dist/demos/mission-control.js +427 -0
- package/dist/demos/platformer-physics.js +122 -0
- package/dist/demos/platformer-physics.ts +284 -0
- package/dist/demos/platformer.js +519 -0
- package/dist/demos/platformer.ts +761 -0
- package/dist/demos/showcase.js +181 -0
- package/dist/demos/showcase.ts +1 -1
- package/dist/diagnostics.d.ts +2 -2
- package/dist/dsl/context.d.ts +2 -2
- package/dist/dsl/context.d.ts.map +1 -1
- package/dist/dsl/context.js +122 -27
- package/dist/dsl/context.js.map +1 -1
- package/dist/dsl/hooks.d.ts +2 -2
- package/dist/dsl/hooks.js +1 -1
- package/dist/dsl/interaction.d.ts +19 -4
- package/dist/dsl/interaction.d.ts.map +1 -1
- package/dist/dsl/interaction.js +54 -5
- package/dist/dsl/interaction.js.map +1 -1
- package/dist/dsl/layers.d.ts +2 -2
- package/dist/dsl/motion.d.ts +2 -2
- package/dist/dsl/motion.js +2 -2
- package/dist/dsl/render.d.ts +2 -2
- package/dist/dsl/render.d.ts.map +1 -1
- package/dist/dsl/render.js +4 -8
- package/dist/dsl/render.js.map +1 -1
- package/dist/dsl/types.d.ts +58 -12
- package/dist/dsl/types.d.ts.map +1 -1
- package/dist/dsl/types.js.map +1 -1
- package/dist/dsl.d.ts +4 -4
- package/dist/dsl.js +3 -3
- package/dist/easing.d.ts +1 -1
- package/dist/geometry.d.ts +1 -1
- package/dist/geometry.js +1 -1
- package/dist/icons-full.d.ts +2 -2
- package/dist/icons-full.js +3 -3
- package/dist/icons.d.ts +4 -4
- package/dist/icons.js +3 -3
- package/dist/index.d.ts +44 -34
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -24
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts +61 -8
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +77 -21
- package/dist/layout.js.map +1 -1
- package/dist/pixels.d.ts +51 -0
- package/dist/pixels.d.ts.map +1 -0
- package/dist/pixels.js +82 -0
- package/dist/pixels.js.map +1 -0
- package/dist/render.d.ts +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +44 -10
- package/dist/render.js.map +1 -1
- package/dist/state.d.ts +22 -3
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +1 -1
- package/dist/state.js.map +1 -1
- package/dist/theme.d.ts +2 -2
- package/dist/theme.js +1 -1
- package/dist/themes/catppuccin-mocha.d.ts +1 -1
- package/dist/themes/catppuccin-mocha.js +1 -1
- package/dist/themes/dracula.d.ts +1 -1
- package/dist/themes/dracula.js +1 -1
- package/dist/themes/github-light.d.ts +1 -1
- package/dist/themes/github-light.js +1 -1
- package/dist/themes/index.d.ts +7 -7
- package/dist/themes/index.js +6 -6
- package/dist/themes/nord.d.ts +1 -1
- package/dist/themes/nord.js +1 -1
- package/dist/themes/one-dark-pro.d.ts +1 -1
- package/dist/themes/one-dark-pro.js +1 -1
- package/dist/themes/tokyo-night.d.ts +1 -1
- package/dist/themes/tokyo-night.js +1 -1
- package/dist/utils.d.ts +6 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +68 -3
- package/dist/utils.js.map +1 -1
- package/llms.txt +4 -2
- package/package.json +8 -4
package/dist/dsl/interaction.js
CHANGED
|
@@ -6,10 +6,46 @@
|
|
|
6
6
|
* carrying the press-origin coordinates (state.clickX/clickY). isClicked is
|
|
7
7
|
* therefore true exactly one frame per click — components fire actions once
|
|
8
8
|
* per click instead of every frame the button is held.
|
|
9
|
+
*
|
|
10
|
+
* Hit-testing semantics:
|
|
11
|
+
* - Topmost wins: when several hitboxes contain the point, only the
|
|
12
|
+
* last-registered one (declaration order; layers render later, so later
|
|
13
|
+
* registration = visually on top) reports hovered/pressed/clicked.
|
|
14
|
+
* - hitbox() evaluates against the PREVIOUS frame's settled rect for its id
|
|
15
|
+
* when one exists: registration rects can still be re-placed by the direct
|
|
16
|
+
* box renderer at paint time (auto-height measure, content alignment), and
|
|
17
|
+
* a click physically happened on the frame the user was looking at. New
|
|
18
|
+
* ids fall back to their freshly resolved rect.
|
|
19
|
+
* - The isHovered/isPressed/isClicked query forms evaluate against the
|
|
20
|
+
* current frame's registrations (they are called after registration).
|
|
9
21
|
*/
|
|
10
22
|
function contains(box, x, y) {
|
|
11
23
|
return (x >= box.x && x < box.x + box.width && y >= box.y && y < box.y + box.height);
|
|
12
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Last-registered (= topmost) hitbox id containing the point, if any.
|
|
27
|
+
* Map iteration follows insertion order, so the last containing entry is
|
|
28
|
+
* the one declared latest — layers render later, hence visually on top.
|
|
29
|
+
*/
|
|
30
|
+
function topmostAt(map, x, y) {
|
|
31
|
+
if (!map)
|
|
32
|
+
return undefined;
|
|
33
|
+
let top;
|
|
34
|
+
for (const box of map.values()) {
|
|
35
|
+
if (contains(box, x, y))
|
|
36
|
+
top = box.id;
|
|
37
|
+
}
|
|
38
|
+
return top;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* True when `id` is the topmost hitbox at the point, or when the map has
|
|
42
|
+
* no containing entry at all (first-frame fallback: nothing is known to
|
|
43
|
+
* cover the point, so the caller's own containment test decides).
|
|
44
|
+
*/
|
|
45
|
+
function isTopmost(map, id, x, y) {
|
|
46
|
+
const top = topmostAt(map, x, y);
|
|
47
|
+
return top === undefined || top === id;
|
|
48
|
+
}
|
|
13
49
|
/**
|
|
14
50
|
* True when this frame carries a click. `state.keys` covers events drained
|
|
15
51
|
* by the render loop; the `state.lastKey === 'click'` check keeps manually
|
|
@@ -27,7 +63,7 @@ function clickX(state) {
|
|
|
27
63
|
function clickY(state) {
|
|
28
64
|
return state.clickY ?? state.mouseY;
|
|
29
65
|
}
|
|
30
|
-
export function createInteraction(state, resolveRect) {
|
|
66
|
+
export function createInteraction(state, resolveRect, capture) {
|
|
31
67
|
const interaction = {
|
|
32
68
|
focusable(id) {
|
|
33
69
|
if (!state.focusableIds.includes(id)) {
|
|
@@ -54,7 +90,15 @@ export function createInteraction(state, resolveRect) {
|
|
|
54
90
|
const rect = resolveRect(bounds);
|
|
55
91
|
const box = { id, ...rect };
|
|
56
92
|
state.hitboxes.set(id, box);
|
|
57
|
-
|
|
93
|
+
// Direct boxes re-place captured hitboxes once their painted rect is
|
|
94
|
+
// known; flow-anchored entries carry their content-local (line, col).
|
|
95
|
+
capture?.(box, bounds.flow ? { line: bounds.y ?? 0, col: bounds.x ?? 0 } : undefined);
|
|
96
|
+
// Evaluate against last frame's settled rect when this id existed
|
|
97
|
+
// (the rect the user actually saw); fall back to the fresh rect.
|
|
98
|
+
const prev = state.prevHitboxes;
|
|
99
|
+
const eff = prev?.get(id) ?? box;
|
|
100
|
+
const hovered = contains(eff, state.mouseX, state.mouseY) &&
|
|
101
|
+
isTopmost(prev, id, state.mouseX, state.mouseY);
|
|
58
102
|
// Hover-change tracking against the last evaluation of this id.
|
|
59
103
|
const prevHovered = state.hoverStates.get(id) ?? false;
|
|
60
104
|
if (hovered !== prevHovered) {
|
|
@@ -69,14 +113,17 @@ export function createInteraction(state, resolveRect) {
|
|
|
69
113
|
state.hoverStates.set(id, hovered);
|
|
70
114
|
}
|
|
71
115
|
const pressed = hovered && state.isMouseDown && state.mouseButton === 0;
|
|
72
|
-
const clicked = frameHasClick(state) &&
|
|
116
|
+
const clicked = frameHasClick(state) &&
|
|
117
|
+
contains(eff, clickX(state), clickY(state)) &&
|
|
118
|
+
isTopmost(prev, id, clickX(state), clickY(state));
|
|
73
119
|
return { box, hovered, pressed, clicked };
|
|
74
120
|
},
|
|
75
121
|
isHovered(id) {
|
|
76
122
|
const box = state.hitboxes.get(id);
|
|
77
123
|
if (!box)
|
|
78
124
|
return false;
|
|
79
|
-
return contains(box, state.mouseX, state.mouseY)
|
|
125
|
+
return (contains(box, state.mouseX, state.mouseY) &&
|
|
126
|
+
isTopmost(state.hitboxes, id, state.mouseX, state.mouseY));
|
|
80
127
|
},
|
|
81
128
|
isPressed(id) {
|
|
82
129
|
return (interaction.isHovered(id) &&
|
|
@@ -87,7 +134,9 @@ export function createInteraction(state, resolveRect) {
|
|
|
87
134
|
const box = state.hitboxes.get(id);
|
|
88
135
|
if (!box)
|
|
89
136
|
return false;
|
|
90
|
-
return (frameHasClick(state) &&
|
|
137
|
+
return (frameHasClick(state) &&
|
|
138
|
+
contains(box, clickX(state), clickY(state)) &&
|
|
139
|
+
isTopmost(state.hitboxes, id, clickX(state), clickY(state)));
|
|
91
140
|
},
|
|
92
141
|
isHoverEnter(id) {
|
|
93
142
|
return state.hoverEntered.has(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/dsl/interaction.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"interaction.js","sourceRoot":"","sources":["../../src/dsl/interaction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAoBH,SAAS,QAAQ,CAAC,GAAW,EAAE,CAAS,EAAE,CAAS;IACjD,OAAO,CACL,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAC5E,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAChB,GAAoC,EACpC,CAAS,EACT,CAAS;IAET,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,IAAI,GAAuB,CAAC;IAC5B,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC;QAC/B,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YAAE,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC;IACxC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;GAIG;AACH,SAAS,SAAS,CAChB,GAAoC,EACpC,EAAU,EAC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QAAQ,EAAE,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAC1D,CAAC;QACJ,CAAC;QAED,SAAS,CAAC,EAAU;YAClB,OAAO,CACL,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;gBACzB,KAAK,CAAC,WAAW;gBACjB,KAAK,CAAC,WAAW,KAAK,CAAC,CACxB,CAAC;QACJ,CAAC;QAED,SAAS,CAAC,EAAU;YAClB,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YACnC,IAAI,CAAC,GAAG;gBAAE,OAAO,KAAK,CAAC;YACvB,OAAO,CACL,aAAa,CAAC,KAAK,CAAC;gBACpB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC3C,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAC5D,CAAC;QACJ,CAAC;QAED,YAAY,CAAC,EAAU;YACrB,OAAO,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACpC,CAAC;QAED,YAAY,CAAC,EAAU;YACrB,OAAO,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACjC,CAAC;KACF,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/dist/dsl/layers.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Bunti DSL layer machinery: transparent buffers, layer screen states,
|
|
3
3
|
* painted-bounds tracking, and back-buffer compositing.
|
|
4
4
|
*/
|
|
5
|
-
import type { Rect } from '../geometry';
|
|
6
|
-
import type { Cell, ScreenState } from '../state';
|
|
5
|
+
import type { Rect } from '../geometry.js';
|
|
6
|
+
import type { Cell, ScreenState } from '../state.js';
|
|
7
7
|
export declare function createLayerScreenState(state: ScreenState): ScreenState;
|
|
8
8
|
/**
|
|
9
9
|
* Tight min/max bounds of a layer buffer's painted cells, or null when the
|
package/dist/dsl/motion.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Bunti DSL motion helpers: animate, fade, typewriter, flicker, transition,
|
|
3
3
|
* stagger, restartAnimation, and per-frame timing (dt / frame).
|
|
4
4
|
*/
|
|
5
|
-
import type { ScreenState } from '../state';
|
|
6
|
-
import type { BuntiContext } from './types';
|
|
5
|
+
import type { ScreenState } from '../state.js';
|
|
6
|
+
import type { BuntiContext } from './types.js';
|
|
7
7
|
type Motion = Pick<BuntiContext, 'animate' | 'fade' | 'typewriter' | 'flicker' | 'transition' | 'stagger' | 'restartAnimation' | 'dt' | 'frame'>;
|
|
8
8
|
export declare function createMotion(state: ScreenState, useState: BuntiContext['useState']): Motion;
|
|
9
9
|
export {};
|
package/dist/dsl/motion.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Bunti DSL motion helpers: animate, fade, typewriter, flicker, transition,
|
|
3
3
|
* stagger, restartAnimation, and per-frame timing (dt / frame).
|
|
4
4
|
*/
|
|
5
|
-
import { fade } from '../colors';
|
|
6
|
-
import { clamp01 } from '../easing';
|
|
5
|
+
import { fade } from '../colors.js';
|
|
6
|
+
import { clamp01 } from '../easing.js';
|
|
7
7
|
function graphemes(text) {
|
|
8
8
|
const segmenter = new Intl.Segmenter('en', { granularity: 'grapheme' });
|
|
9
9
|
return Array.from(segmenter.segment(text), ({ segment }) => segment);
|
package/dist/dsl/render.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bunti DSL primary entry point: render.
|
|
3
3
|
*/
|
|
4
|
-
import { type ScreenOptions } from '../state';
|
|
5
|
-
import type { BuntiContext } from './types';
|
|
4
|
+
import { type ScreenOptions } from '../state.js';
|
|
5
|
+
import type { BuntiContext } from './types.js';
|
|
6
6
|
/**
|
|
7
7
|
* Starts a Bunti app: runs `callback` every frame (immediate mode —
|
|
8
8
|
* redraw the whole screen from state each call) and flushes only the
|
package/dist/dsl/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/dsl/render.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,MAAM,EAC9C,OAAO,GAAE,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/dsl/render.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;;;;;;GAYG;AACH,wBAAsB,MAAM,CAC1B,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,MAAM,EAC9C,OAAO,GAAE,aAAa,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,iBA2CjD"}
|
package/dist/dsl/render.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bunti DSL primary entry point: render.
|
|
3
3
|
*/
|
|
4
|
-
import { init } from '../icons';
|
|
5
|
-
import { flush, loop } from '../render';
|
|
6
|
-
import { ANSI, clearBackBuffer, createScreenState, } from '../state';
|
|
7
|
-
import { createScreenContext } from './context';
|
|
4
|
+
import { init } from '../icons.js';
|
|
5
|
+
import { flush, loop } from '../render.js';
|
|
6
|
+
import { ANSI, clearBackBuffer, createScreenState, } from '../state.js';
|
|
7
|
+
import { createScreenContext } from './context.js';
|
|
8
8
|
/**
|
|
9
9
|
* Starts a Bunti app: runs `callback` every frame (immediate mode —
|
|
10
10
|
* redraw the whole screen from state each call) and flushes only the
|
|
@@ -19,10 +19,6 @@ import { createScreenContext } from './context';
|
|
|
19
19
|
* }, { keyboard: true, mouse: true, alternateBuffer: true, hideCursor: true });
|
|
20
20
|
*/
|
|
21
21
|
export async function render(callback, options = {}) {
|
|
22
|
-
if (typeof Bun === 'undefined') {
|
|
23
|
-
throw new Error('Bunti is Bun-native and uses Bun runtime APIs. ' +
|
|
24
|
-
'Run with Bun >=1.0: https://bun.sh — Node.js is not supported.');
|
|
25
|
-
}
|
|
26
22
|
// createScreenState runs env detection once per render() (state.terminal).
|
|
27
23
|
const state = createScreenState(options);
|
|
28
24
|
// Icon tier: an explicit ScreenOptions.nerdFont always wins; otherwise the
|
package/dist/dsl/render.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/dsl/render.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EACL,IAAI,EACJ,eAAe,EACf,iBAAiB,GAElB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,QAA8C,EAC9C,UAA8C,EAAE;IAEhD,
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/dsl/render.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO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pE,8BAA8B;QAC9B,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;YAClC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,sEAAsE;QACtE,yCAAyC;QACzC,IAAI,OAAO,CAAC,UAAU;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC9D,OAAO;IACT,CAAC;IAED,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/dsl/types.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bunti DSL shared types and constants.
|
|
3
3
|
*/
|
|
4
|
-
import type { bg, darken, fg, Gradient, lighten, rgb } from '../colors';
|
|
5
|
-
import type { TerminalProfile } from '../detect';
|
|
6
|
-
import type { PlacedRectInput, PlacedRectOptions, Rect, RectInput, SplitOptions } from '../geometry';
|
|
7
|
-
import type { KeyEvent } from '../input';
|
|
8
|
-
import type { ListOptions, SideColors, StyleOptions, TableOptions } from '../layout';
|
|
9
|
-
import type { Cell, Hitbox, RGB, ScreenState } from '../state';
|
|
10
|
-
import type { Theme, ThemeColor, ThemeInput } from '../theme';
|
|
11
|
-
import type { BuntiColor } from '../vendor/colors';
|
|
4
|
+
import type { bg, darken, fg, Gradient, lighten, rgb } from '../colors.js';
|
|
5
|
+
import type { TerminalProfile } from '../detect.js';
|
|
6
|
+
import type { PlacedRectInput, PlacedRectOptions, Rect, RectInput, SplitOptions } from '../geometry.js';
|
|
7
|
+
import type { KeyEvent } from '../input.js';
|
|
8
|
+
import type { BlitStyle, ListOptions, SideColors, StyleOptions, TableOptions } from '../layout.js';
|
|
9
|
+
import type { Cell, Hitbox, RGB, ScreenState } from '../state.js';
|
|
10
|
+
import type { Theme, ThemeColor, ThemeInput } from '../theme.js';
|
|
11
|
+
import type { BuntiColor } from '../vendor/colors.js';
|
|
12
12
|
/**
|
|
13
13
|
* Normalized key-name constants for `ctx.lastKey` / `ctx.keyPressed()`.
|
|
14
14
|
* Printable keys are their literal character ('a', 'A', ' '); mouse events
|
|
@@ -76,6 +76,14 @@ export interface DSLBoxOptions extends StyleOptions {
|
|
|
76
76
|
borderColor?: string | number | RGB | ThemeColor | ((s: string) => string) | SideColors;
|
|
77
77
|
/** If true, the string is returned but NOT appended to the flow. */
|
|
78
78
|
detach?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Visual-only vertical paint offset in rows (direct-rendered boxes).
|
|
81
|
+
* The box PAINTS shifted by this amount while its resolved rect —
|
|
82
|
+
* sub-context offsets, hitboxes, focus geometry — stays at the settled
|
|
83
|
+
* position. Entrance animations (Modal's slide-in) use this so hitboxes
|
|
84
|
+
* sit at their final coordinates from the first frame.
|
|
85
|
+
*/
|
|
86
|
+
paintOffsetY?: number;
|
|
79
87
|
}
|
|
80
88
|
/** Options for `ctx.typewriter()`. */
|
|
81
89
|
export interface TypewriterOptions {
|
|
@@ -251,10 +259,11 @@ export interface BuntiContext {
|
|
|
251
259
|
/**
|
|
252
260
|
* Paints a (possibly multi-line, ANSI-styled) string directly into the
|
|
253
261
|
* screen buffer at absolute cell coordinates — exact-position text,
|
|
254
|
-
* sprites, labels, and ASCII art.
|
|
262
|
+
* sprites, labels, and ASCII art. Pass `transparent: ' '` to skip
|
|
263
|
+
* space cells so irregular sprites composite over the background.
|
|
255
264
|
* @example ctx.blit(2, 1, 'FPS 60', { fg: 'gold' });
|
|
256
265
|
*/
|
|
257
|
-
blit(x: number, y: number, content: string, style?:
|
|
266
|
+
blit(x: number, y: number, content: string, style?: BlitStyle): BuntiContext;
|
|
258
267
|
/**
|
|
259
268
|
* Fills a w×h cell rectangle at absolute coordinates with a style —
|
|
260
269
|
* bars, panels, charts, and backgrounds. Pure-background fills keep the
|
|
@@ -338,10 +347,12 @@ export interface BuntiContext {
|
|
|
338
347
|
focusNext(): void;
|
|
339
348
|
/**
|
|
340
349
|
* Registers a clickable region and returns its interaction snapshot for
|
|
341
|
-
* this frame. Requires `mouse: true`.
|
|
350
|
+
* this frame. Requires `mouse: true`. When several hitboxes contain the
|
|
351
|
+
* pointer, only the topmost (last-registered — layers render later, so
|
|
352
|
+
* later registration is visually on top) reports hovered/pressed/clicked.
|
|
342
353
|
* @example const { hovered, clicked } = ctx.hitbox('save', { x: 2, y: 5, width: 10, height: 1 });
|
|
343
354
|
*/
|
|
344
|
-
hitbox(id: string, bounds:
|
|
355
|
+
hitbox(id: string, bounds: HitboxBounds): {
|
|
345
356
|
box: Hitbox;
|
|
346
357
|
hovered: boolean;
|
|
347
358
|
pressed: boolean;
|
|
@@ -475,6 +486,39 @@ export interface BuntiContext {
|
|
|
475
486
|
/** Resets an animate()/typewriter()/stagger() id clock to "now". */
|
|
476
487
|
restartAnimation(id: string): void;
|
|
477
488
|
}
|
|
489
|
+
/**
|
|
490
|
+
* Bounds for ctx.hitbox(): a RectInput plus flow anchoring.
|
|
491
|
+
*/
|
|
492
|
+
export interface HitboxBounds extends RectInput {
|
|
493
|
+
/**
|
|
494
|
+
* Anchors the hitbox to the text flow: x/y are the flow (column, line)
|
|
495
|
+
* where the owning content begins, and the enclosing direct-rendered box
|
|
496
|
+
* re-places the rect at paint time so content alignment (align/valign,
|
|
497
|
+
* auto-height centering) can never separate the hitbox from the painted
|
|
498
|
+
* cells. Components (Button/Input/Link) pass this for their flow
|
|
499
|
+
* placement; app code with explicit coordinates rarely needs it.
|
|
500
|
+
*/
|
|
501
|
+
flow?: boolean;
|
|
502
|
+
}
|
|
503
|
+
/** One hitbox registered inside a pending direct-box paint (see HitboxFrame). */
|
|
504
|
+
export interface HitboxEntry {
|
|
505
|
+
/** The live Hitbox object in state.hitboxes (mutated by the fixup). */
|
|
506
|
+
box: Hitbox;
|
|
507
|
+
/** Flow anchor (content-local line/column) for flow-placed hitboxes. */
|
|
508
|
+
flow?: {
|
|
509
|
+
line: number;
|
|
510
|
+
col: number;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Hitboxes registered while a direct box renders its callback. Once the
|
|
515
|
+
* box's painted rect is known (content measured, alignment applied), the
|
|
516
|
+
* renderer re-places every captured entry so registered hitboxes exactly
|
|
517
|
+
* match the painted cells.
|
|
518
|
+
*/
|
|
519
|
+
export interface HitboxFrame {
|
|
520
|
+
entries: HitboxEntry[];
|
|
521
|
+
}
|
|
478
522
|
/**
|
|
479
523
|
* The DSL state container allowing stable references with dynamic capture targets.
|
|
480
524
|
*/
|
|
@@ -491,6 +535,8 @@ export interface DSLState {
|
|
|
491
535
|
themeStack: Theme[];
|
|
492
536
|
/** Direct-rendered box areas this frame (root only; dev diagnostics). */
|
|
493
537
|
boxRects?: Rect[];
|
|
538
|
+
/** Pending direct-box hitbox fixups (innermost frame last). */
|
|
539
|
+
hitboxFrames?: HitboxFrame[];
|
|
494
540
|
}
|
|
495
541
|
/** One queued overlay buffer awaiting composite (see ctx.layer()). */
|
|
496
542
|
export interface RenderLayer {
|
package/dist/dsl/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dsl/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,IAAI,EACJ,SAAS,EACT,YAAY,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EACV,YAAY,EACZ,YAAY,EACb,MAAM,WAAW,CAAC;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AE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;CACrB"}
|
package/dist/dsl/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dsl/types.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/dsl/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuBH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,QAAQ;IACjB,SAAS,EAAE,UAAU;IACrB,MAAM,EAAE,QAAQ;IAChB,4EAA4E;IAC5E,KAAK,EAAE,OAAO;IACd,wDAAwD;IACxD,QAAQ,EAAE,UAAU;IACpB,0DAA0D;IAC1D,UAAU,EAAE,YAAY;CACzB,CAAC"}
|
package/dist/dsl.d.ts
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* - motion: animate / typewriter / flicker / fade
|
|
12
12
|
* - types: shared interfaces + KEYS
|
|
13
13
|
*/
|
|
14
|
-
export { createScreenContext } from './dsl/context';
|
|
15
|
-
export { render } from './dsl/render';
|
|
16
|
-
export type { BuntiContext, DSLBoxOptions, LayerOptions, TypewriterOptions, TypewriterState, } from './dsl/types';
|
|
17
|
-
export { KEYS } from './dsl/types';
|
|
14
|
+
export { createScreenContext } from './dsl/context.js';
|
|
15
|
+
export { render } from './dsl/render.js';
|
|
16
|
+
export type { BuntiContext, DSLBoxOptions, LayerOptions, TypewriterOptions, TypewriterState, } from './dsl/types.js';
|
|
17
|
+
export { KEYS } from './dsl/types.js';
|
|
18
18
|
//# sourceMappingURL=dsl.d.ts.map
|
package/dist/dsl.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - motion: animate / typewriter / flicker / fade
|
|
12
12
|
* - types: shared interfaces + KEYS
|
|
13
13
|
*/
|
|
14
|
-
export { createScreenContext } from './dsl/context';
|
|
15
|
-
export { render } from './dsl/render';
|
|
16
|
-
export { KEYS } from './dsl/types';
|
|
14
|
+
export { createScreenContext } from './dsl/context.js';
|
|
15
|
+
export { render } from './dsl/render.js';
|
|
16
|
+
export { KEYS } from './dsl/types.js';
|
|
17
17
|
//# sourceMappingURL=dsl.js.map
|
package/dist/easing.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* The standard easing set, every curve clamps its input to [0, 1] so raw
|
|
5
5
|
* animation progress can be fed in directly. Pure functions only.
|
|
6
6
|
*/
|
|
7
|
-
import type { Rect } from './geometry';
|
|
7
|
+
import type { Rect } from './geometry.js';
|
|
8
8
|
/** Clamps a number to the [0, 1] range. */
|
|
9
9
|
export declare function clamp01(value: number): number;
|
|
10
10
|
/** Identity easing (clamped to [0, 1]). */
|
package/dist/geometry.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Rect is the layout primitive: components resolve a rect first, then
|
|
5
5
|
* render and hit-test against the same resolved cells.
|
|
6
6
|
*/
|
|
7
|
-
import { type SizeUnit } from './layout';
|
|
7
|
+
import { type SizeUnit } from './layout.js';
|
|
8
8
|
/** An absolute cell rectangle: x/y origin plus width/height in cells. */
|
|
9
9
|
export interface Rect {
|
|
10
10
|
x: number;
|
package/dist/geometry.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Rect is the layout primitive: components resolve a rect first, then
|
|
5
5
|
* render and hit-test against the same resolved cells.
|
|
6
6
|
*/
|
|
7
|
-
import { resolveSize } from './layout';
|
|
7
|
+
import { resolveSize } from './layout.js';
|
|
8
8
|
/**
|
|
9
9
|
* Resolves a RectInput against a parent rect into absolute cells
|
|
10
10
|
* (top-left placement; use resolvePlacedRect for alignment defaults).
|
package/dist/icons-full.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { NF_GLYPHS, NF_VERSION } from './data/nf-glyphs';
|
|
2
|
-
export type { IconName } from './data/nf-names';
|
|
1
|
+
export { NF_GLYPHS, NF_VERSION } from './data/nf-glyphs.js';
|
|
2
|
+
export type { IconName } from './data/nf-names.js';
|
|
3
3
|
/** Installs the full Nerd Fonts map into the runtime registry (idempotent). */
|
|
4
4
|
export declare function installFullIcons(): void;
|
|
5
5
|
//# sourceMappingURL=icons-full.d.ts.map
|
package/dist/icons-full.js
CHANGED
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
* This is a separate subpath export on purpose: the core
|
|
17
17
|
* '@zakmandhro/bunti' entry never loads the ~280KB glyph map.
|
|
18
18
|
*/
|
|
19
|
-
import { NF_GLYPHS } from './data/nf-glyphs';
|
|
20
|
-
import { registerAll } from './icons';
|
|
21
|
-
export { NF_GLYPHS, NF_VERSION } from './data/nf-glyphs';
|
|
19
|
+
import { NF_GLYPHS } from './data/nf-glyphs.js';
|
|
20
|
+
import { registerAll } from './icons.js';
|
|
21
|
+
export { NF_GLYPHS, NF_VERSION } from './data/nf-glyphs.js';
|
|
22
22
|
let installed = false;
|
|
23
23
|
/** Installs the full Nerd Fonts map into the runtime registry (idempotent). */
|
|
24
24
|
export function installFullIcons() {
|
package/dist/icons.d.ts
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Purely tactical: Nerd Fonts or ASCII fallbacks.
|
|
4
4
|
*
|
|
5
5
|
* Two tiers of names resolve through icon()/getIcon():
|
|
6
|
-
* 1. The curated ICON_MAP below (
|
|
6
|
+
* 1. The curated ICON_MAP below (88 short names with ASCII fallbacks).
|
|
7
7
|
* 2. A runtime registry filled via register()/registerAll() — most notably
|
|
8
8
|
* by `import '@zakmandhro/bunti/icons-full'`, which installs the full
|
|
9
9
|
* Nerd Fonts v3.4.0 glyph set (~10.7k names like 'fa-rocket').
|
|
10
10
|
*/
|
|
11
|
-
import type { IconName } from './data/nf-names';
|
|
12
|
-
import { type TerminalCapabilities, type TerminalProfile } from './detect';
|
|
11
|
+
import type { IconName } from './data/nf-names.js';
|
|
12
|
+
import { type TerminalCapabilities, type TerminalProfile } from './detect.js';
|
|
13
13
|
/** An icon's Nerd Font glyph plus its plain-terminal ASCII stand-in. */
|
|
14
14
|
export interface IconDefinition {
|
|
15
15
|
/** Nerd Font glyph (private-use-area codepoint). */
|
|
@@ -379,7 +379,7 @@ export type CuratedIconName = keyof typeof CURATED_ICONS;
|
|
|
379
379
|
* custom names added via register(). Arbitrary strings stay assignable.
|
|
380
380
|
*/
|
|
381
381
|
export type BuntiIconName = CuratedIconName | IconName | (string & Record<never, never>);
|
|
382
|
-
/** The curated icon table:
|
|
382
|
+
/** The curated icon table: 88 width-audited names with ASCII fallbacks. */
|
|
383
383
|
export declare const ICON_MAP: Record<string, IconDefinition>;
|
|
384
384
|
/**
|
|
385
385
|
* Emoji-to-icon-name swaps applied automatically to drawn text (emoji
|
package/dist/icons.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { identifyTerminal, } from './detect';
|
|
2
|
-
import { hintsSuppressed, nearestMatch, registerHintFlusher, } from './diagnostics';
|
|
1
|
+
import { identifyTerminal, } from './detect.js';
|
|
2
|
+
import { hintsSuppressed, nearestMatch, registerHintFlusher, } from './diagnostics.js';
|
|
3
3
|
const CURATED_ICONS = {
|
|
4
4
|
add: { nf: '\uf067', ascii: '+' },
|
|
5
5
|
'arrow-left': { nf: '\uf060', ascii: '<' },
|
|
@@ -90,7 +90,7 @@ const CURATED_ICONS = {
|
|
|
90
90
|
yaml: { nf: '\ue6a8', ascii: 'Y' },
|
|
91
91
|
zap: { nf: '\uf0e7', ascii: 'z' },
|
|
92
92
|
};
|
|
93
|
-
/** The curated icon table:
|
|
93
|
+
/** The curated icon table: 88 width-audited names with ASCII fallbacks. */
|
|
94
94
|
export const ICON_MAP = CURATED_ICONS;
|
|
95
95
|
/**
|
|
96
96
|
* Emoji-to-icon-name swaps applied automatically to drawn text (emoji
|
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
import * as colors from './colors';
|
|
2
|
-
import * as detect from './detect';
|
|
3
|
-
import * as dsl from './dsl';
|
|
4
|
-
import * as geometry from './geometry';
|
|
5
|
-
import * as icons from './icons';
|
|
6
|
-
import * as input from './input';
|
|
7
|
-
import * as layout from './layout';
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
|
|
11
|
-
export {
|
|
12
|
-
export
|
|
13
|
-
export type {
|
|
14
|
-
export {
|
|
15
|
-
export
|
|
16
|
-
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export {
|
|
20
|
-
export
|
|
21
|
-
export {
|
|
22
|
-
export
|
|
23
|
-
export {
|
|
24
|
-
export
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export type {
|
|
28
|
-
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
export
|
|
1
|
+
import * as colors from './colors.js';
|
|
2
|
+
import * as detect from './detect.js';
|
|
3
|
+
import * as dsl from './dsl.js';
|
|
4
|
+
import * as geometry from './geometry.js';
|
|
5
|
+
import * as icons from './icons.js';
|
|
6
|
+
import * as input from './input.js';
|
|
7
|
+
import * as layout from './layout.js';
|
|
8
|
+
import * as pixels from './pixels.js';
|
|
9
|
+
import * as state from './state.js';
|
|
10
|
+
import * as theme from './theme.js';
|
|
11
|
+
export type { ColorValue, Gradient } from './colors.js';
|
|
12
|
+
export { ansi256ToRGB, bg, contrastText, createGradient, fade, fg, hexToRGB, isThemeColor, PALETTE, relativeLuminance, resolveColor, resolveColorToRGB, rgb, rgbTo16, rgbTo256, rgbToHex, } from './colors.js';
|
|
13
|
+
export type { IconName } from './data/nf-names.js';
|
|
14
|
+
export type { ColorTier, NerdFontPolicy, TerminalApp, TerminalCapabilities, TerminalProfile, } from './detect.js';
|
|
15
|
+
export { colorTier, detectCapabilities, detectColorTier, identifyTerminal, setColorTier, } from './detect.js';
|
|
16
|
+
export type { BuntiContext, DSLBoxOptions, LayerOptions, TypewriterOptions, TypewriterState, } from './dsl.js';
|
|
17
|
+
/** createScreenContext is the headless-testing entry point: pair it with
|
|
18
|
+
* createScreenState + renderFrame to assert on frames without a TTY. */
|
|
19
|
+
export { createScreenContext, KEYS, render } from './dsl.js';
|
|
20
|
+
export { clamp01, easeInCubic, easeInOutCubic, easeInOutQuad, easeInOutQuart, easeInQuad, easeInQuart, easeOutBack, easeOutBounce, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, lerp, lerpRect, linear, } from './easing.js';
|
|
21
|
+
export type { PlacedRectInput, PlacedRectOptions, Rect, RectInput, SplitOptions, } from './geometry.js';
|
|
22
|
+
export { innerRect, resolvePlacedRect, resolveRect, splitRect, } from './geometry.js';
|
|
23
|
+
export type { BuntiIconName, CuratedIconName, IconDefinition, } from './icons.js';
|
|
24
|
+
export { EMOJI_MAP, ICON_MAP, icon, init, nerd, nerdIcon, register, registerAll, replaceEmojis, } from './icons.js';
|
|
25
|
+
export type { HeldKeyOptions, InputToken, InputTokenizerOptions, KeyEvent, TerminalResponse, TerminalResponseKind, } from './input.js';
|
|
26
|
+
export { createKeyEvent, HeldKeyTracker, InputTokenizer } from './input.js';
|
|
27
|
+
export type { BlitStyle, BorderStyle, ListOptions, StyleOptions, TableOptions, } from './layout.js';
|
|
28
|
+
export { badge, blit, box, createStyle, dimRect, getWindow, gradient, joinHorizontal, joinVertical, list, rect, setCell, table, viewport, wallpaper, } from './layout.js';
|
|
29
|
+
/** Halfblock pixel canvas: 2x vertical resolution via '▀'/'▄' cells.
|
|
30
|
+
* @example createPixelCanvas(16, 16).blitTo(ctx.state, 2, 1); */
|
|
31
|
+
export type { PixelCanvas } from './pixels.js';
|
|
32
|
+
export { createPixelCanvas } from './pixels.js';
|
|
33
|
+
export { applyInputToState, drainFrameInput, flush, loop, renderFrame, restoreTerminal, updatePointerShape, } from './render.js';
|
|
34
|
+
export type { Cell, RGB, ScreenOptions, ScreenState } from './state.js';
|
|
35
|
+
export { ANSI, clearBackBuffer, createScreenState, resizeScreen, } from './state.js';
|
|
36
|
+
export type { Theme, ThemeColor, ThemeColorInput, ThemeInput, ThemeMode, ThemeToken, } from './theme.js';
|
|
37
|
+
export { createTheme, darkTheme, isTheme, lightTheme, resolveTheme, THEME_TOKENS, themeColor, } from './theme.js';
|
|
38
|
+
export { charWidth, indentBlock, stringWidthFallback, stripAnsi, truncate, visibleWidth, } from './utils.js';
|
|
39
|
+
export type { BuntiColor, ColorFormatter } from './vendor/colors.js';
|
|
33
40
|
/**
|
|
34
41
|
* Namespaced API surface for `bunti.render(...)` style usage — every
|
|
35
42
|
* named export gathered onto one object.
|
|
@@ -155,6 +162,7 @@ export declare const bunti: {
|
|
|
155
162
|
readonly mint: "121";
|
|
156
163
|
};
|
|
157
164
|
stripAnsi(str: string): string;
|
|
165
|
+
stringWidthFallback(str: string): number;
|
|
158
166
|
visibleWidth(str: string): number;
|
|
159
167
|
charWidth(char: string): number;
|
|
160
168
|
truncate(str: string, width: number, tail?: string): string;
|
|
@@ -170,12 +178,14 @@ export declare const bunti: {
|
|
|
170
178
|
loop(state: state.ScreenState, renderCallback: (s: state.ScreenState) => void): Promise<void>;
|
|
171
179
|
applyInputToState(state: state.ScreenState, data: unknown, stop?: () => void): void;
|
|
172
180
|
drainFrameInput(state: state.ScreenState): void;
|
|
181
|
+
createPixelCanvas(width: number, height: number): pixels.PixelCanvas;
|
|
173
182
|
setCell(state: state.ScreenState, x: number, y: number, cell: Partial<state.Cell>): void;
|
|
174
183
|
dimRect(state: state.ScreenState, area: geometry.Rect, amount: number): void;
|
|
175
184
|
rect(state: state.ScreenState, x: number, y: number, w: number, h: number, style: layout.RectOptions): void;
|
|
176
|
-
blit(state: state.ScreenState, startX: number, startY: number, content: string, style?:
|
|
185
|
+
blit(state: state.ScreenState, startX: number, startY: number, content: string, style?: layout.BlitStyle): void;
|
|
177
186
|
resolveSize(unit: layout.SizeUnit | undefined, parentDim: number, contentDim: number): number;
|
|
178
|
-
|
|
187
|
+
measureBox(content: string, options?: layout.StyleOptions, parentW?: number, parentH?: number): layout.BoxMeasure;
|
|
188
|
+
box(content: string, options?: layout.StyleOptions, parentW?: number, parentH?: number, measure?: layout.BoxMeasure): string;
|
|
179
189
|
joinHorizontal(...blocks: string[]): string;
|
|
180
190
|
joinVertical(...blocks: string[]): string;
|
|
181
191
|
createStyle(defaults: layout.StyleOptions): (content: string, overrides?: layout.StyleOptions) => string;
|