@flyingrobots/bijou 3.0.0 → 4.0.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/LICENSE +159 -21
- package/README.md +100 -13
- package/dist/adapters/test/clock.d.ts +36 -0
- package/dist/adapters/test/clock.d.ts.map +1 -0
- package/dist/adapters/test/clock.js +132 -0
- package/dist/adapters/test/clock.js.map +1 -0
- package/dist/adapters/test/index.d.ts +8 -1
- package/dist/adapters/test/index.d.ts.map +1 -1
- package/dist/adapters/test/index.js +20 -2
- package/dist/adapters/test/index.js.map +1 -1
- package/dist/adapters/test/io.d.ts +3 -0
- package/dist/adapters/test/io.d.ts.map +1 -1
- package/dist/adapters/test/io.js +5 -4
- package/dist/adapters/test/io.js.map +1 -1
- package/dist/core/ansi.d.ts +2 -0
- package/dist/core/ansi.d.ts.map +1 -1
- package/dist/core/ansi.js +2 -0
- package/dist/core/ansi.js.map +1 -1
- package/dist/core/clock.d.ts +12 -0
- package/dist/core/clock.d.ts.map +1 -0
- package/dist/core/clock.js +59 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/components/alert-v3.d.ts +7 -0
- package/dist/core/components/alert-v3.d.ts.map +1 -0
- package/dist/core/components/alert-v3.js +37 -0
- package/dist/core/components/alert-v3.js.map +1 -0
- package/dist/core/components/alert.d.ts +2 -0
- package/dist/core/components/alert.d.ts.map +1 -1
- package/dist/core/components/alert.js +1 -1
- package/dist/core/components/alert.js.map +1 -1
- package/dist/core/components/box-v3.d.ts +9 -2
- package/dist/core/components/box-v3.d.ts.map +1 -1
- package/dist/core/components/box-v3.js +78 -21
- package/dist/core/components/box-v3.js.map +1 -1
- package/dist/core/components/box.d.ts +7 -0
- package/dist/core/components/box.d.ts.map +1 -1
- package/dist/core/components/box.js +13 -7
- package/dist/core/components/box.js.map +1 -1
- package/dist/core/components/index.d.ts +6 -0
- package/dist/core/components/index.d.ts.map +1 -1
- package/dist/core/components/index.js +4 -0
- package/dist/core/components/index.js.map +1 -1
- package/dist/core/components/log.d.ts.map +1 -1
- package/dist/core/components/log.js +4 -3
- package/dist/core/components/log.js.map +1 -1
- package/dist/core/components/overflow.d.ts +3 -0
- package/dist/core/components/overflow.d.ts.map +1 -0
- package/dist/core/components/overflow.js +33 -0
- package/dist/core/components/overflow.js.map +1 -0
- package/dist/core/components/progress.d.ts.map +1 -1
- package/dist/core/components/progress.js +3 -1
- package/dist/core/components/progress.js.map +1 -1
- package/dist/core/components/separator-v3.d.ts +7 -0
- package/dist/core/components/separator-v3.d.ts.map +1 -0
- package/dist/core/components/separator-v3.js +46 -0
- package/dist/core/components/separator-v3.js.map +1 -0
- package/dist/core/components/spinner.d.ts.map +1 -1
- package/dist/core/components/spinner.js +3 -1
- package/dist/core/components/spinner.js.map +1 -1
- package/dist/core/components/surface-text.d.ts +14 -0
- package/dist/core/components/surface-text.d.ts.map +1 -0
- package/dist/core/components/surface-text.js +95 -0
- package/dist/core/components/surface-text.js.map +1 -0
- package/dist/core/components/table-v3.d.ts +11 -0
- package/dist/core/components/table-v3.d.ts.map +1 -0
- package/dist/core/components/table-v3.js +148 -0
- package/dist/core/components/table-v3.js.map +1 -0
- package/dist/core/components/table.d.ts +2 -1
- package/dist/core/components/table.d.ts.map +1 -1
- package/dist/core/components/table.js +40 -11
- package/dist/core/components/table.js.map +1 -1
- package/dist/core/components/timer.d.ts.map +1 -1
- package/dist/core/components/timer.js +11 -9
- package/dist/core/components/timer.js.map +1 -1
- package/dist/core/components/types.d.ts +4 -0
- package/dist/core/components/types.d.ts.map +1 -1
- package/dist/core/render/differ.d.ts +3 -3
- package/dist/core/render/differ.d.ts.map +1 -1
- package/dist/core/render/differ.js +33 -14
- package/dist/core/render/differ.js.map +1 -1
- package/dist/core/runtime-viewport.d.ts +34 -0
- package/dist/core/runtime-viewport.d.ts.map +1 -0
- package/dist/core/runtime-viewport.js +74 -0
- package/dist/core/runtime-viewport.js.map +1 -0
- package/dist/core/text/index.d.ts +1 -0
- package/dist/core/text/index.d.ts.map +1 -1
- package/dist/core/text/index.js +1 -0
- package/dist/core/text/index.js.map +1 -1
- package/dist/core/text/wrap.d.ts +11 -0
- package/dist/core/text/wrap.d.ts.map +1 -0
- package/dist/core/text/wrap.js +90 -0
- package/dist/core/text/wrap.js.map +1 -0
- package/dist/factory.d.ts +3 -0
- package/dist/factory.d.ts.map +1 -1
- package/dist/factory.js +3 -0
- package/dist/factory.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/ports/clock.d.ts +29 -0
- package/dist/ports/clock.d.ts.map +1 -0
- package/dist/ports/clock.js +2 -0
- package/dist/ports/clock.js.map +1 -0
- package/dist/ports/context.d.ts +3 -0
- package/dist/ports/context.d.ts.map +1 -1
- package/dist/ports/index.d.ts +1 -0
- package/dist/ports/index.d.ts.map +1 -1
- package/dist/ports/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RuntimePort } from '../ports/runtime.js';
|
|
2
|
+
/** Sanitized terminal viewport dimensions. */
|
|
3
|
+
export interface RuntimeViewport {
|
|
4
|
+
readonly columns: number;
|
|
5
|
+
readonly rows: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Clamp a terminal dimension to a non-negative integer.
|
|
9
|
+
*
|
|
10
|
+
* Runtime adapters may surface fractional, negative, or non-finite values
|
|
11
|
+
* transiently during resize flows. The TUI runtime only operates on whole,
|
|
12
|
+
* non-negative cell counts.
|
|
13
|
+
*/
|
|
14
|
+
export declare function sanitizeRuntimeDimension(value: number): number;
|
|
15
|
+
/** Read the current runtime viewport using Bijou's shared dimension rules. */
|
|
16
|
+
export declare function readRuntimeViewport(runtime: RuntimePort): RuntimeViewport;
|
|
17
|
+
/**
|
|
18
|
+
* Install a mutable viewport overlay on top of an existing runtime port.
|
|
19
|
+
*
|
|
20
|
+
* This gives runtimes backed by immutable globals (for example Node's
|
|
21
|
+
* `process.stdout.columns`) a stable, writable source of truth for scripted
|
|
22
|
+
* resizes and worker-proxy synchronization.
|
|
23
|
+
*/
|
|
24
|
+
export declare function installRuntimeViewportOverlay<T extends {
|
|
25
|
+
runtime: RuntimePort;
|
|
26
|
+
}>(host: T): RuntimePort;
|
|
27
|
+
/**
|
|
28
|
+
* Update a mutable runtime overlay with sanitized viewport dimensions.
|
|
29
|
+
*
|
|
30
|
+
* Use this after {@link installRuntimeViewportOverlay} when resize events or
|
|
31
|
+
* worker messages need to advance the current runtime viewport source of truth.
|
|
32
|
+
*/
|
|
33
|
+
export declare function updateRuntimeViewport(runtime: RuntimePort, columns: number, rows: number): RuntimeViewport;
|
|
34
|
+
//# sourceMappingURL=runtime-viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-viewport.d.ts","sourceRoot":"","sources":["../../src/core/runtime-viewport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,8CAA8C;AAC9C,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,eAAe,CAKzE;AAED;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS;IAAE,OAAO,EAAE,WAAW,CAAA;CAAE,EAAE,IAAI,EAAE,CAAC,GAAG,WAAW,CAoCtG;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX,eAAe,CAIjB"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clamp a terminal dimension to a non-negative integer.
|
|
3
|
+
*
|
|
4
|
+
* Runtime adapters may surface fractional, negative, or non-finite values
|
|
5
|
+
* transiently during resize flows. The TUI runtime only operates on whole,
|
|
6
|
+
* non-negative cell counts.
|
|
7
|
+
*/
|
|
8
|
+
export function sanitizeRuntimeDimension(value) {
|
|
9
|
+
if (!Number.isFinite(value))
|
|
10
|
+
return 0;
|
|
11
|
+
return Math.max(0, Math.floor(value));
|
|
12
|
+
}
|
|
13
|
+
/** Read the current runtime viewport using Bijou's shared dimension rules. */
|
|
14
|
+
export function readRuntimeViewport(runtime) {
|
|
15
|
+
return {
|
|
16
|
+
columns: sanitizeRuntimeDimension(runtime.columns),
|
|
17
|
+
rows: sanitizeRuntimeDimension(runtime.rows),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Install a mutable viewport overlay on top of an existing runtime port.
|
|
22
|
+
*
|
|
23
|
+
* This gives runtimes backed by immutable globals (for example Node's
|
|
24
|
+
* `process.stdout.columns`) a stable, writable source of truth for scripted
|
|
25
|
+
* resizes and worker-proxy synchronization.
|
|
26
|
+
*/
|
|
27
|
+
export function installRuntimeViewportOverlay(host) {
|
|
28
|
+
const baseRuntime = host.runtime;
|
|
29
|
+
const viewport = readRuntimeViewport(baseRuntime);
|
|
30
|
+
const state = {
|
|
31
|
+
columns: viewport.columns,
|
|
32
|
+
rows: viewport.rows,
|
|
33
|
+
};
|
|
34
|
+
const runtime = {
|
|
35
|
+
env(key) {
|
|
36
|
+
return baseRuntime.env(key);
|
|
37
|
+
},
|
|
38
|
+
get stdoutIsTTY() {
|
|
39
|
+
return baseRuntime.stdoutIsTTY;
|
|
40
|
+
},
|
|
41
|
+
get stdinIsTTY() {
|
|
42
|
+
return baseRuntime.stdinIsTTY;
|
|
43
|
+
},
|
|
44
|
+
get columns() {
|
|
45
|
+
return state.columns;
|
|
46
|
+
},
|
|
47
|
+
set columns(value) {
|
|
48
|
+
state.columns = sanitizeRuntimeDimension(value);
|
|
49
|
+
},
|
|
50
|
+
get rows() {
|
|
51
|
+
return state.rows;
|
|
52
|
+
},
|
|
53
|
+
set rows(value) {
|
|
54
|
+
state.rows = sanitizeRuntimeDimension(value);
|
|
55
|
+
},
|
|
56
|
+
get refreshRate() {
|
|
57
|
+
return baseRuntime.refreshRate;
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
host.runtime = runtime;
|
|
61
|
+
return runtime;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Update a mutable runtime overlay with sanitized viewport dimensions.
|
|
65
|
+
*
|
|
66
|
+
* Use this after {@link installRuntimeViewportOverlay} when resize events or
|
|
67
|
+
* worker messages need to advance the current runtime viewport source of truth.
|
|
68
|
+
*/
|
|
69
|
+
export function updateRuntimeViewport(runtime, columns, rows) {
|
|
70
|
+
runtime.columns = columns;
|
|
71
|
+
runtime.rows = rows;
|
|
72
|
+
return readRuntimeViewport(runtime);
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=runtime-viewport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-viewport.js","sourceRoot":"","sources":["../../src/core/runtime-viewport.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAa;IACpD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IACtC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,mBAAmB,CAAC,OAAoB;IACtD,OAAO;QACL,OAAO,EAAE,wBAAwB,CAAC,OAAO,CAAC,OAAO,CAAC;QAClD,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,IAAI,CAAC;KAC7C,CA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C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/text/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/text/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/core/text/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/text/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/text/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,SAAS,GACV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap a string to the requested display width while preserving ANSI styling.
|
|
3
|
+
*
|
|
4
|
+
* Wrapping is grapheme-aware and hard-wraps long lines without adding ellipses.
|
|
5
|
+
*
|
|
6
|
+
* @param str - Input string, possibly containing ANSI SGR escapes.
|
|
7
|
+
* @param maxWidth - Maximum display width in columns.
|
|
8
|
+
* @returns Wrapped lines.
|
|
9
|
+
*/
|
|
10
|
+
export declare function wrapToWidth(str: string, maxWidth: number): string[];
|
|
11
|
+
//# sourceMappingURL=wrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../../src/core/text/wrap.ts"],"names":[],"mappings":"AA2FA;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAInE"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { RESET_SGR } from '../ansi.js';
|
|
2
|
+
import { ANSI_SGR_RE, graphemeClusterWidth, segmentGraphemes } from './grapheme.js';
|
|
3
|
+
function tokenizeAnsiText(str) {
|
|
4
|
+
const regex = new RegExp(ANSI_SGR_RE.source, 'g');
|
|
5
|
+
const tokens = [];
|
|
6
|
+
let lastIndex = 0;
|
|
7
|
+
for (const match of str.matchAll(regex)) {
|
|
8
|
+
const index = match.index ?? 0;
|
|
9
|
+
if (index > lastIndex) {
|
|
10
|
+
const raw = str.slice(lastIndex, index);
|
|
11
|
+
for (const grapheme of segmentGraphemes(raw)) {
|
|
12
|
+
tokens.push({
|
|
13
|
+
kind: 'grapheme',
|
|
14
|
+
raw: grapheme,
|
|
15
|
+
width: graphemeClusterWidth(grapheme),
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
tokens.push({ kind: 'ansi', raw: match[0] });
|
|
20
|
+
lastIndex = index + match[0].length;
|
|
21
|
+
}
|
|
22
|
+
if (lastIndex < str.length) {
|
|
23
|
+
const raw = str.slice(lastIndex);
|
|
24
|
+
for (const grapheme of segmentGraphemes(raw)) {
|
|
25
|
+
tokens.push({
|
|
26
|
+
kind: 'grapheme',
|
|
27
|
+
raw: grapheme,
|
|
28
|
+
width: graphemeClusterWidth(grapheme),
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return tokens;
|
|
33
|
+
}
|
|
34
|
+
function isResetEscape(raw) {
|
|
35
|
+
return raw === RESET_SGR;
|
|
36
|
+
}
|
|
37
|
+
function finalizeWrappedLine(raw, activeStyle) {
|
|
38
|
+
if (activeStyle.length === 0 || raw.endsWith(RESET_SGR))
|
|
39
|
+
return raw;
|
|
40
|
+
return raw + RESET_SGR;
|
|
41
|
+
}
|
|
42
|
+
function wrapSingleLine(str, maxWidth) {
|
|
43
|
+
if (str.length === 0)
|
|
44
|
+
return [''];
|
|
45
|
+
if (maxWidth <= 0)
|
|
46
|
+
return [''];
|
|
47
|
+
const tokens = tokenizeAnsiText(str);
|
|
48
|
+
const lines = [];
|
|
49
|
+
let currentRaw = '';
|
|
50
|
+
let currentWidth = 0;
|
|
51
|
+
let activeStyle = '';
|
|
52
|
+
const pushLine = () => {
|
|
53
|
+
if (currentWidth <= 0)
|
|
54
|
+
return;
|
|
55
|
+
lines.push(finalizeWrappedLine(currentRaw, activeStyle));
|
|
56
|
+
currentRaw = activeStyle;
|
|
57
|
+
currentWidth = 0;
|
|
58
|
+
};
|
|
59
|
+
for (const token of tokens) {
|
|
60
|
+
if (token.kind === 'ansi') {
|
|
61
|
+
currentRaw += token.raw;
|
|
62
|
+
activeStyle = isResetEscape(token.raw) ? '' : activeStyle + token.raw;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (currentWidth > 0 && currentWidth + token.width > maxWidth) {
|
|
66
|
+
pushLine();
|
|
67
|
+
}
|
|
68
|
+
currentRaw += token.raw;
|
|
69
|
+
currentWidth += token.width;
|
|
70
|
+
}
|
|
71
|
+
if (currentWidth > 0) {
|
|
72
|
+
lines.push(finalizeWrappedLine(currentRaw, activeStyle));
|
|
73
|
+
}
|
|
74
|
+
return lines.length > 0 ? lines : [''];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Wrap a string to the requested display width while preserving ANSI styling.
|
|
78
|
+
*
|
|
79
|
+
* Wrapping is grapheme-aware and hard-wraps long lines without adding ellipses.
|
|
80
|
+
*
|
|
81
|
+
* @param str - Input string, possibly containing ANSI SGR escapes.
|
|
82
|
+
* @param maxWidth - Maximum display width in columns.
|
|
83
|
+
* @returns Wrapped lines.
|
|
84
|
+
*/
|
|
85
|
+
export function wrapToWidth(str, maxWidth) {
|
|
86
|
+
const source = str ?? '';
|
|
87
|
+
const rawLines = source.split('\n');
|
|
88
|
+
return rawLines.flatMap((line) => wrapSingleLine(line, maxWidth));
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=wrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wrap.js","sourceRoot":"","sources":["../../../src/core/text/wrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAMpF,SAAS,gBAAgB,CAAC,GAAW;IACnC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClD,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;QAC/B,IAAI,KAAK,GAAG,SAAS,EAAE,CAAC;YACtB,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS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CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,QAAgB;IACvD,MAAM,MAAM,GAAG,GAAG,IAAI,EAAE,CAAC;IACzB,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpE,CAAC"}
|
package/dist/factory.d.ts
CHANGED
|
@@ -3,12 +3,15 @@ import type { RuntimePort } from './ports/runtime.js';
|
|
|
3
3
|
import type { IOPort } from './ports/io.js';
|
|
4
4
|
import type { StylePort } from './ports/style.js';
|
|
5
5
|
import type { Theme } from './core/theme/tokens.js';
|
|
6
|
+
import type { ClockPort } from './ports/clock.js';
|
|
6
7
|
/** Options for {@link createBijou}. */
|
|
7
8
|
export interface CreateBijouOptions {
|
|
8
9
|
/** Runtime environment adapter. */
|
|
9
10
|
runtime: RuntimePort;
|
|
10
11
|
/** I/O adapter (stdin/stdout, filesystem). */
|
|
11
12
|
io: IOPort;
|
|
13
|
+
/** Clock/scheduler adapter. Defaults to the system clock. */
|
|
14
|
+
clock?: ClockPort;
|
|
12
15
|
/** Style adapter (chalk, plain-text, etc.). */
|
|
13
16
|
style: StylePort;
|
|
14
17
|
/** Explicit theme object. Defaults to {@link CYAN_MAGENTA}. */
|
package/dist/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAAE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;IACjB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAChC,4FAA4F;IAC5F,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,YAAY,CA2CrE"}
|
package/dist/factory.js
CHANGED
|
@@ -5,6 +5,7 @@ import { CYAN_MAGENTA } from './core/theme/presets.js';
|
|
|
5
5
|
import { PRESETS } from './core/theme/presets.js';
|
|
6
6
|
import { fromDTCG } from './core/theme/dtcg.js';
|
|
7
7
|
import { detectOutputMode } from './core/detect/tty.js';
|
|
8
|
+
import { systemClock } from './core/clock.js';
|
|
8
9
|
/**
|
|
9
10
|
* Create a fully-wired {@link BijouContext} from adapter ports.
|
|
10
11
|
*
|
|
@@ -18,6 +19,7 @@ import { detectOutputMode } from './core/detect/tty.js';
|
|
|
18
19
|
*/
|
|
19
20
|
export function createBijou(options) {
|
|
20
21
|
const { runtime, io, style } = options;
|
|
22
|
+
const clock = options.clock ?? systemClock();
|
|
21
23
|
const envVar = options.envVar ?? 'BIJOU_THEME';
|
|
22
24
|
const presets = options.presets ?? PRESETS;
|
|
23
25
|
const fallback = options.theme ?? CYAN_MAGENTA;
|
|
@@ -48,6 +50,7 @@ export function createBijou(options) {
|
|
|
48
50
|
mode,
|
|
49
51
|
runtime,
|
|
50
52
|
io,
|
|
53
|
+
clock,
|
|
51
54
|
style,
|
|
52
55
|
tokenGraph,
|
|
53
56
|
resolveBCSS: () => ({}),
|
package/dist/factory.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAsB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,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AC;IACtD,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAEvC,IAAI,QAAQ,GAAU,QAAQ,CAAC;IAE/B,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,MAAM,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;gBACxC,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAiB,CAAC;gBAChD,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,oCAAoC;YACtC,CAAC;QACH,CAAC;aAAM,CAAC;YACN,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAkB,cAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAe,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAEnD,kCAAkC;IAClC,MAAM,UAAU,GAAG,gBAAgB,CAAC,QAAuC,CAAC,CAAC;IAE7E,OAAO;QACL,KAAK;QACL,IAAI;QACJ,OAAO;QACP,EAAE;QACF,KAAK;QACL,KAAK;QACL,UAAU;QACV,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;QACvB,GAAG,oBAAoB,CAAC,KAAK,CAAC;KAC/B,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,21 +4,22 @@
|
|
|
4
4
|
* Themed terminal components for CLIs, loggers, and scripts —
|
|
5
5
|
* with graceful degradation across output modes.
|
|
6
6
|
*/
|
|
7
|
-
export type { RuntimePort, WritePort, QueryPort, InteractivePort, FilePort, IOPort, RawInputHandle, TimerHandle, StylePort, BijouContext, } from './ports/index.js';
|
|
7
|
+
export type { RuntimePort, WritePort, QueryPort, InteractivePort, FilePort, IOPort, ClockPort, RawInputHandle, TimerHandle, StylePort, BijouContext, } from './ports/index.js';
|
|
8
8
|
export { type Cell, type Surface, type CellMask, type Matrix3x3, type TransformOptions, createSurface, FULL_MASK, ROTATION_CHAR_MAP, } from './ports/surface.js';
|
|
9
9
|
export { getDefaultContext, setDefaultContext, } from './context.js';
|
|
10
10
|
export { resolveCtx, resolveSafeCtx } from './core/resolve-ctx.js';
|
|
11
|
+
export { systemClock, resolveClock, sleep, defer } from './core/clock.js';
|
|
12
|
+
export { type RuntimeViewport, sanitizeRuntimeDimension, readRuntimeViewport, installRuntimeViewportOverlay, updateRuntimeViewport, } from './core/runtime-viewport.js';
|
|
11
13
|
export { renderByMode, type ModeHandler, type ModeMap, } from './core/mode-render.js';
|
|
12
14
|
export { shouldApplyBg, makeBgFill } from './core/bg-fill.js';
|
|
13
15
|
export { createBijou, type CreateBijouOptions } from './factory.js';
|
|
14
16
|
export { type RGB, type GradientStop, type TextModifier, type TokenValue, type InkColor, type BaseStatusKey, type BaseUiKey, type BaseGradientKey, type Theme, CYAN_MAGENTA, TEAL_ORANGE_PINK, PRESETS, tv, styled, styledStatus, extendTheme, lerp3, gradientText, type GradientTextOptions, isNoColor, createThemeResolver, createResolved, type ResolvedTheme, type ThemeResolver, type ThemeResolverOptions, fromDTCG, toDTCG, type DTCGDocument, type DTCGToken, type DTCGGroup, rgbToAnsi256, nearestAnsi256, rgbToAnsi16, ansi256ToAnsi16, type ColorLevel, createThemeAccessors, type ThemeAccessors, hexToRgb, rgbToHex, lighten, darken, mix, complementary, saturate, desaturate, createTokenGraph, type TokenGraph, type ThemeMode, type ColorDefinition, type TokenDefinition, type TokenDefinitions, type ColorTransform, } from './core/theme/index.js';
|
|
15
|
-
export { isWideChar, segmentGraphemes, graphemeClusterWidth, graphemeWidth, clipToWidth, ANSI_SGR_RE, stripAnsi, } from './core/text/index.js';
|
|
17
|
+
export { isWideChar, segmentGraphemes, graphemeClusterWidth, graphemeWidth, clipToWidth, wrapToWidth, ANSI_SGR_RE, stripAnsi, } from './core/text/index.js';
|
|
16
18
|
export { detectOutputMode, detectColorScheme, type OutputMode, type ColorScheme, } from './core/detect/index.js';
|
|
17
|
-
export { spinnerFrame, createSpinner, type SpinnerOptions, type SpinnerController, progressBar, createProgressBar, createAnimatedProgressBar, type ProgressBarOptions, type LiveProgressBarOptions, type AnimatedProgressBarOptions, type ProgressBarController, table, type TableColumn, type TableOptions, box, headerBox, type BoxOptions, type HeaderBoxOptions, selectLogoSize, loadRandomLogo, type LogoSize, type LogoResult, type LogoConstraints, type LogoOptions, separator, type SeparatorOptions, badge, type BadgeVariant, type BadgeOptions, alert, type AlertVariant, type AlertOptions, skeleton, type SkeletonOptions, kbd, type KbdOptions, tree, type TreeNode, type TreeOptions, accordion, type AccordionSection, type AccordionOptions, timeline, type TimelineEvent, type TimelineOptions, tabs, type TabItem, type TabsOptions, breadcrumb, type BreadcrumbOptions, paginator, type PaginatorOptions, stepper, type StepperStep, type StepperOptions, dag, dagSlice, dagLayout, type DagNode, type DagOptions, type DagNodePosition, type DagLayout, arraySource, isDagSource, isSlicedDagSource, type DagSource, type SlicedDagSource, type DagSliceOptions, dagStats, type DagStats, enumeratedList, type BulletStyle, type EnumeratedListOptions, hyperlink, type HyperlinkOptions, log, type LogLevel, type LogOptions, markdown, type MarkdownOptions, constrain, type ConstrainOptions, timer, createTimer, createStopwatch, type TimerOptions, type TimerController, type CreateTimerOptions, type CreateStopwatchOptions, cursorGuard, withHiddenCursor, type CursorGuard, type CursorHideHandle, } from './core/components/index.js';
|
|
19
|
+
export { spinnerFrame, createSpinner, type SpinnerOptions, type SpinnerController, type OverflowBehavior, progressBar, createProgressBar, createAnimatedProgressBar, type ProgressBarOptions, type LiveProgressBarOptions, type AnimatedProgressBarOptions, type ProgressBarController, table, type TableColumn, type TableOptions, tableSurface, type TableSurfaceCell, type TableSurfaceOptions, box, headerBox, type BoxOptions, type HeaderBoxOptions, boxSurface, headerBoxSurface, selectLogoSize, loadRandomLogo, type LogoSize, type LogoResult, type LogoConstraints, type LogoOptions, separator, type SeparatorOptions, separatorSurface, badge, type BadgeVariant, type BadgeOptions, alert, type AlertVariant, type AlertOptions, alertSurface, skeleton, type SkeletonOptions, kbd, type KbdOptions, tree, type TreeNode, type TreeOptions, accordion, type AccordionSection, type AccordionOptions, timeline, type TimelineEvent, type TimelineOptions, tabs, type TabItem, type TabsOptions, breadcrumb, type BreadcrumbOptions, paginator, type PaginatorOptions, stepper, type StepperStep, type StepperOptions, dag, dagSlice, dagLayout, type DagNode, type DagOptions, type DagNodePosition, type DagLayout, arraySource, isDagSource, isSlicedDagSource, type DagSource, type SlicedDagSource, type DagSliceOptions, dagStats, type DagStats, enumeratedList, type BulletStyle, type EnumeratedListOptions, hyperlink, type HyperlinkOptions, log, type LogLevel, type LogOptions, markdown, type MarkdownOptions, constrain, type ConstrainOptions, timer, createTimer, createStopwatch, type TimerOptions, type TimerController, type CreateTimerOptions, type CreateStopwatchOptions, cursorGuard, withHiddenCursor, type CursorGuard, type CursorHideHandle, } from './core/components/index.js';
|
|
18
20
|
export { HIDE_CURSOR, SHOW_CURSOR, CLEAR_LINE_RETURN } from './core/ansi.js';
|
|
19
21
|
export { renderDiff, isSameCell, stringToSurface, parseAnsiToSurface, surfaceToString, paintLayoutNode } from './core/render/differ.js';
|
|
20
22
|
export type { LayoutRect, LayoutNode, LayoutEngine } from './ports/surface.js';
|
|
21
23
|
export { calculateFlex, type FlexOptions, type FlexChildProps } from './core/layout/flex.js';
|
|
22
24
|
export { type ValidationResult, type Validator, type FieldOptions, type SelectOption, type SelectFieldOptions, type ConfirmFieldOptions, type GroupFieldResult, type InputOptions, input, select, multiselect, confirm, group, textarea, type TextareaOptions, filter, type FilterOption, type FilterOptions, wizard, type WizardStep, type WizardOptions, note, type NoteOptions, } from './core/forms/index.js';
|
|
23
|
-
export { boxV3 } from './core/components/box-v3.js';
|
|
24
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,eAAe,EACf,QAAQ,EACR,MAAM,EACN,cAAc,EACd,WAAW,EACX,SAAS,EACT,YAAY,GACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,aAAa,EACb,SAAS,EACT,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,eAAe,EACf,QAAQ,EACR,MAAM,EACN,SAAS,EACT,cAAc,EACd,WAAW,EACX,SAAS,EACT,YAAY,GACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,IAAI,EACT,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,aAAa,EACb,SAAS,EACT,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OA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AAI,EACJ,KAAK,WAAW,GACjB,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,8 @@ export { createSurface, FULL_MASK, ROTATION_CHAR_MAP, } from './ports/surface.js
|
|
|
9
9
|
export { getDefaultContext, setDefaultContext, } from './context.js';
|
|
10
10
|
// Context resolution helpers
|
|
11
11
|
export { resolveCtx, resolveSafeCtx } from './core/resolve-ctx.js';
|
|
12
|
+
export { systemClock, resolveClock, sleep, defer } from './core/clock.js';
|
|
13
|
+
export { sanitizeRuntimeDimension, readRuntimeViewport, installRuntimeViewportOverlay, updateRuntimeViewport, } from './core/runtime-viewport.js';
|
|
12
14
|
// Mode rendering strategy
|
|
13
15
|
export { renderByMode, } from './core/mode-render.js';
|
|
14
16
|
// Background fill utilities
|
|
@@ -38,11 +40,11 @@ hexToRgb, rgbToHex, lighten, darken, mix, complementary, saturate, desaturate,
|
|
|
38
40
|
// Reactive Token Graph
|
|
39
41
|
createTokenGraph, } from './core/theme/index.js';
|
|
40
42
|
// Text / grapheme utilities
|
|
41
|
-
export { isWideChar, segmentGraphemes, graphemeClusterWidth, graphemeWidth, clipToWidth, ANSI_SGR_RE, stripAnsi, } from './core/text/index.js';
|
|
43
|
+
export { isWideChar, segmentGraphemes, graphemeClusterWidth, graphemeWidth, clipToWidth, wrapToWidth, ANSI_SGR_RE, stripAnsi, } from './core/text/index.js';
|
|
42
44
|
// Detection
|
|
43
45
|
export { detectOutputMode, detectColorScheme, } from './core/detect/index.js';
|
|
44
46
|
// Components
|
|
45
|
-
export { spinnerFrame, createSpinner, progressBar, createProgressBar, createAnimatedProgressBar, table, box, headerBox, selectLogoSize, loadRandomLogo, separator, badge, alert, skeleton, kbd, tree, accordion, timeline, tabs, breadcrumb, paginator, stepper, dag, dagSlice, dagLayout, arraySource, isDagSource, isSlicedDagSource, dagStats, enumeratedList, hyperlink, log, markdown, constrain, timer, createTimer, createStopwatch, cursorGuard, withHiddenCursor, } from './core/components/index.js';
|
|
47
|
+
export { spinnerFrame, createSpinner, progressBar, createProgressBar, createAnimatedProgressBar, table, tableSurface, box, headerBox, boxSurface, headerBoxSurface, selectLogoSize, loadRandomLogo, separator, separatorSurface, badge, alert, alertSurface, skeleton, kbd, tree, accordion, timeline, tabs, breadcrumb, paginator, stepper, dag, dagSlice, dagLayout, arraySource, isDagSource, isSlicedDagSource, dagStats, enumeratedList, hyperlink, log, markdown, constrain, timer, createTimer, createStopwatch, cursorGuard, withHiddenCursor, } from './core/components/index.js';
|
|
46
48
|
// Shared ANSI escape constants
|
|
47
49
|
export { HIDE_CURSOR, SHOW_CURSOR, CLEAR_LINE_RETURN } from './core/ansi.js';
|
|
48
50
|
// Rendering
|
|
@@ -50,5 +52,4 @@ export { renderDiff, isSameCell, stringToSurface, parseAnsiToSurface, surfaceToS
|
|
|
50
52
|
export { calculateFlex } from './core/layout/flex.js';
|
|
51
53
|
// Forms
|
|
52
54
|
export { input, select, multiselect, confirm, group, textarea, filter, wizard, note, } from './core/forms/index.js';
|
|
53
|
-
export { boxV3 } from './core/components/box-v3.js';
|
|
54
55
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAiBH,OAAO,EAML,aAAa,EACb,SAAS,EACT,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,UAAU;AACV,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,cAAc,CAAC;AAEtB,6BAA6B;AAC7B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC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Kd,SAAS,EAET,gBAAgB,EAChB,KAAK,EAGL,KAAK,EAGL,YAAY,EACZ,QAAQ,EAER,GAAG,EAEH,IAAI,EAGJ,SAAS,EAGT,QAAQ,EAGR,IAAI,EAGJ,UAAU,EAEV,SAAS,EAET,OAAO,EAGP,GAAG,EACH,QAAQ,EACR,SAAS,EAKT,WAAW,EACX,WAAW,EACX,iBAAiB,EAIjB,QAAQ,EAER,cAAc,EAGd,SAAS,EAET,GAAG,EAGH,QAAQ,EAER,SAAS,EAET,KAAK,EACL,WAAW,EACX,eAAe,EAKf,WAAW,EACX,gBAAgB,GAGjB,MAAM,4BAA4B,CAAC;AAEpC,+BAA+B;AAC/B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,YAAY;AACZ,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAIxI,OAAO,EAAE,aAAa,EAAyC,MAAM,uBAAuB,CAAC;AAE7F,QAAQ;AACR,OAAO,EASL,KAAK,EACL,MAAM,EACN,WAAW,EACX,OAAO,EACP,KAAK,EACL,QAAQ,EAER,MAAM,EAGN,MAAM,EAGN,IAAI,GAEL,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { TimerHandle } from './io.js';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract time/scheduling port.
|
|
4
|
+
*
|
|
5
|
+
* Provides wall-clock reads plus timer and microtask scheduling without
|
|
6
|
+
* coupling components to Node.js globals.
|
|
7
|
+
*/
|
|
8
|
+
export interface ClockPort {
|
|
9
|
+
/** Current wall-clock time in milliseconds since the Unix epoch. */
|
|
10
|
+
now(): number;
|
|
11
|
+
/**
|
|
12
|
+
* Create a Date object for a specific timestamp or for the current time when
|
|
13
|
+
* omitted.
|
|
14
|
+
*/
|
|
15
|
+
date(ms?: number): Date;
|
|
16
|
+
/**
|
|
17
|
+
* Schedule a one-shot callback.
|
|
18
|
+
* @returns A handle whose `dispose()` cancels the timeout.
|
|
19
|
+
*/
|
|
20
|
+
setTimeout(callback: () => void, ms: number): TimerHandle;
|
|
21
|
+
/**
|
|
22
|
+
* Schedule a repeating callback.
|
|
23
|
+
* @returns A handle whose `dispose()` cancels the interval.
|
|
24
|
+
*/
|
|
25
|
+
setInterval(callback: () => void, ms: number): TimerHandle;
|
|
26
|
+
/** Schedule a microtask callback. */
|
|
27
|
+
queueMicrotask(callback: () => void): void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=clock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/ports/clock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,oEAAoE;IACpE,GAAG,IAAI,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,CAAC;IAE1D;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,WAAW,CAAC;IAE3D,qCAAqC;IACrC,cAAc,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/ports/clock.ts"],"names":[],"mappings":""}
|
package/dist/ports/context.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Theme, TokenValue, GradientStop } from '../core/theme/tokens.js';
|
|
|
3
3
|
import type { OutputMode } from '../core/detect/tty.js';
|
|
4
4
|
import type { RuntimePort } from './runtime.js';
|
|
5
5
|
import type { IOPort } from './io.js';
|
|
6
|
+
import type { ClockPort } from './clock.js';
|
|
6
7
|
import type { StylePort } from './style.js';
|
|
7
8
|
import type { TokenGraph } from '../core/theme/graph.js';
|
|
8
9
|
/**
|
|
@@ -20,6 +21,8 @@ export interface BijouContext {
|
|
|
20
21
|
readonly runtime: RuntimePort;
|
|
21
22
|
/** I/O adapter (stdin/stdout, filesystem). */
|
|
22
23
|
readonly io: IOPort;
|
|
24
|
+
/** Clock/scheduler adapter for deterministic time and timers. */
|
|
25
|
+
readonly clock?: ClockPort;
|
|
23
26
|
/** Color / text-decoration adapter. */
|
|
24
27
|
readonly style: StylePort;
|
|
25
28
|
/** Reactive and Semantic Token Graph for advanced theming. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/ports/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEzD;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,yFAAyF;IACzF,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC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;IAChC,wCAAwC;IACxC,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,4DAA4D;IAC5D,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,EAAE,CAAC;CACvC"}
|
package/dist/ports/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export type { RuntimePort } from './runtime.js';
|
|
7
7
|
export type { WritePort, QueryPort, InteractivePort, FilePort, IOPort, RawInputHandle, TimerHandle } from './io.js';
|
|
8
|
+
export type { ClockPort } from './clock.js';
|
|
8
9
|
export type { StylePort } from './style.js';
|
|
9
10
|
export type { BijouContext } from './context.js';
|
|
10
11
|
export { createEnvAccessor, createTTYAccessor } from './env.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpH,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpH,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/ports/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ports/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flyingrobots/bijou",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Themed terminal components for CLIs, loggers, and scripts
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Themed terminal components for CLIs, loggers, and scripts — graceful degradation included.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"forms"
|
|
52
52
|
],
|
|
53
53
|
"author": "James Ross <james@flyingrobots.dev>",
|
|
54
|
-
"license": "
|
|
54
|
+
"license": "Apache-2.0",
|
|
55
55
|
"repository": {
|
|
56
56
|
"type": "git",
|
|
57
57
|
"url": "git+https://github.com/flyingrobots/bijou.git",
|