@cssints/tui 0.6.0 → 0.7.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/dist/bomb.d.mts +1 -5
- package/dist/bomb.mjs +2 -4
- package/dist/index.d.mts +0 -2
- package/dist/index.mjs +1 -2
- package/dist/opentui.d.mts +1 -5
- package/dist/opentui.mjs +2 -4
- package/dist/{system-CFyJGOUM.d.mts → system-M74t-l7g.d.mts} +0 -2
- package/dist/system.d.mts +1 -1
- package/dist/system.mjs +1 -2
- package/package.json +2 -2
package/dist/bomb.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { TuiState, onTheme, resolve, setTheme, theme } from "./index.mjs";
|
|
2
|
-
import { g as SystemTheme } from "./system-
|
|
2
|
+
import { g as SystemTheme } from "./system-M74t-l7g.mjs";
|
|
3
3
|
import { Op, OpenElement, RenderOptions, RenderResult, Term, Text } from "@bomb.sh/tty";
|
|
4
4
|
import { TuiProps, TuiShape } from "cssints/tui";
|
|
5
|
-
//#region src/bomb-system.d.ts
|
|
6
5
|
/** A system theme fed by the bytes of stdin. */
|
|
7
6
|
interface SystemFollower {
|
|
8
7
|
/** Takes the terminal's replies out of a chunk of stdin and gives back the rest, for `input.scan()`. */
|
|
@@ -25,8 +24,6 @@ export declare const followSystemTheme: (theme: SystemTheme, options: {
|
|
|
25
24
|
wait?: number;
|
|
26
25
|
colorfgbg?: string;
|
|
27
26
|
}) => SystemFollower;
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/bomb.d.ts
|
|
30
27
|
/** The options of `open(id, options)`. */
|
|
31
28
|
export type OpenProps = Omit<OpenElement, "directive" | "id">;
|
|
32
29
|
/** The options of `text(content, options)`. */
|
|
@@ -82,5 +79,4 @@ export interface Tracker {
|
|
|
82
79
|
* @returns {Tracker} the tracker
|
|
83
80
|
*/
|
|
84
81
|
export declare const createTracker: () => Tracker;
|
|
85
|
-
//#endregion
|
|
86
82
|
export { type SystemFollower, type TuiState, onTheme, resolve, setTheme, theme };
|
package/dist/bomb.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { onTheme, resolve, setTheme, theme } from "./index.mjs";
|
|
2
2
|
import { COLOURS, NOTIFY, QUERY, UNNOTIFY, scan } from "./system.mjs";
|
|
3
3
|
import { fit, fixed, grow, open, percent, rgba, text } from "@bomb.sh/tty";
|
|
4
|
-
|
|
4
|
+
// src/bomb-system.ts
|
|
5
5
|
const binary = (bytes) => {
|
|
6
6
|
let s = "";
|
|
7
7
|
for (const b of bytes) s += String.fromCharCode(b);
|
|
@@ -56,8 +56,7 @@ const followSystemTheme = (theme, options) => {
|
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
//#region src/bomb.ts
|
|
59
|
+
// src/bomb.ts
|
|
61
60
|
const ATTRS = {
|
|
62
61
|
bold: 1,
|
|
63
62
|
dim: 2,
|
|
@@ -319,5 +318,4 @@ const createTracker = () => {
|
|
|
319
318
|
])
|
|
320
319
|
};
|
|
321
320
|
};
|
|
322
|
-
//#endregion
|
|
323
321
|
export { createTracker, followSystemTheme, onTheme, openProps, resolve, rgbaOf, setTheme, textProps, theme };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { TuiProps, TuiProps as TuiProps$1, TuiShape, TuiShape as TuiShape$1 } from "cssints/tui";
|
|
2
|
-
//#region src/index.d.ts
|
|
3
2
|
/** The states a renderable is in. */
|
|
4
3
|
export interface TuiState {
|
|
5
4
|
hover?: boolean;
|
|
@@ -45,5 +44,4 @@ export declare const onTheme: (fn: (name: string) => void) => (() => void);
|
|
|
45
44
|
* @returns {TuiProps} the props, renderer-neutral
|
|
46
45
|
*/
|
|
47
46
|
export declare const resolve: (style: TuiShape$1, state?: TuiState, name?: string) => TuiProps$1;
|
|
48
|
-
//#endregion
|
|
49
47
|
export type { TuiProps, TuiShape };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/index.ts
|
|
2
2
|
const WARNED = Symbol.for("cssints.tui.deprecated");
|
|
3
3
|
const flags = globalThis;
|
|
4
4
|
if (!flags[WARNED]) {
|
|
@@ -90,5 +90,4 @@ const resolve = (style, state = {}, name = current) => {
|
|
|
90
90
|
}
|
|
91
91
|
return out;
|
|
92
92
|
};
|
|
93
|
-
//#endregion
|
|
94
93
|
export { defineTheme, onTheme, resolve, setTheme, theme };
|
package/dist/opentui.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { TuiState, resolve, setTheme, theme } from "./index.mjs";
|
|
2
|
-
import { c as Report, g as SystemTheme } from "./system-
|
|
2
|
+
import { c as Report, g as SystemTheme } from "./system-M74t-l7g.mjs";
|
|
3
3
|
import { CliRenderer, Renderable, TerminalColors, TextNodeRenderable, ThemeMode } from "@opentui/core";
|
|
4
4
|
import { TuiProps, TuiShape } from "cssints/tui";
|
|
5
|
-
//#region src/opentui-system.d.ts
|
|
6
5
|
/**
|
|
7
6
|
* The report of OpenTUI's palette and theme mode.
|
|
8
7
|
*
|
|
@@ -23,8 +22,6 @@ export declare const reportOf: (colors: TerminalColors | undefined, mode: ThemeM
|
|
|
23
22
|
export declare const followSystemTheme: (renderer: CliRenderer, theme: SystemTheme, options?: {
|
|
24
23
|
wait?: number;
|
|
25
24
|
}) => Promise<() => void>;
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/opentui.d.ts
|
|
28
25
|
/**
|
|
29
26
|
* The OpenTUI props of a style (`has` tells which props the renderable has: a box takes `backgroundColor`, a text `bg`):
|
|
30
27
|
* `color` is `fg` (`textColor` on an editable or a select), the text attributes are the bits of `attributes`, the
|
|
@@ -62,5 +59,4 @@ export declare const attach: <R extends Node>(r: R, style: TuiShape) => R;
|
|
|
62
59
|
export declare const use: (style: TuiShape | (() => TuiShape)) => {
|
|
63
60
|
ref: (r: Node | null) => void;
|
|
64
61
|
};
|
|
65
|
-
//#endregion
|
|
66
62
|
export { type TuiState, resolve, setTheme, theme };
|
package/dist/opentui.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { onTheme, resolve, setTheme, theme } from "./index.mjs";
|
|
2
2
|
import { RGBA } from "@opentui/core";
|
|
3
|
-
|
|
3
|
+
// src/opentui-system.ts
|
|
4
4
|
/**
|
|
5
5
|
* The report of OpenTUI's palette and theme mode.
|
|
6
6
|
*
|
|
@@ -50,8 +50,7 @@ const followSystemTheme = async (renderer, theme, options = {}) => {
|
|
|
50
50
|
clearTimeout(timer);
|
|
51
51
|
return stop;
|
|
52
52
|
};
|
|
53
|
-
|
|
54
|
-
//#region src/opentui.ts
|
|
53
|
+
// src/opentui.ts
|
|
55
54
|
const BITS = {
|
|
56
55
|
bold: 1,
|
|
57
56
|
dim: 2,
|
|
@@ -205,5 +204,4 @@ const attach = (r, style) => {
|
|
|
205
204
|
const use = (style) => ({ ref: (r) => {
|
|
206
205
|
if (r) attach(r, typeof style === "function" ? style() : style);
|
|
207
206
|
} });
|
|
208
|
-
//#endregion
|
|
209
207
|
export { attach, followSystemTheme, props, reportOf, resolve, setTheme, theme, use };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/system.d.ts
|
|
2
1
|
/** The 16 ANSI colours, by their index. */
|
|
3
2
|
declare const SLOTS: readonly ["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "brightBlack", "brightRed", "brightGreen", "brightYellow", "brightBlue", "brightMagenta", "brightCyan", "brightWhite"];
|
|
4
3
|
type Slot = (typeof SLOTS)[number];
|
|
@@ -114,5 +113,4 @@ declare const scan: (text: string) => {
|
|
|
114
113
|
rest: string;
|
|
115
114
|
tail: string;
|
|
116
115
|
};
|
|
117
|
-
//#endregion
|
|
118
116
|
export { UNNOTIFY as _, NOTIFY as a, luminance as b, Report as c, SLOTS as d, Slot as f, SystemTheme as g, SystemOptions as h, Hue as i, Role as l, Solved as m, COLOURS as n, QUERY as o, SolveOptions as p, ColourToken as r, Replies as s, Appearance as t, Roles as u, contrast as v, scan as x, createSystemTheme as y };
|
package/dist/system.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as UNNOTIFY, a as NOTIFY, b as luminance, c as Report, d as SLOTS, f as Slot, g as SystemTheme, h as SystemOptions, i as Hue, l as Role, m as Solved, n as COLOURS, o as QUERY, p as SolveOptions, r as ColourToken, s as Replies, t as Appearance, u as Roles, v as contrast, x as scan, y as createSystemTheme } from "./system-
|
|
1
|
+
import { _ as UNNOTIFY, a as NOTIFY, b as luminance, c as Report, d as SLOTS, f as Slot, g as SystemTheme, h as SystemOptions, i as Hue, l as Role, m as Solved, n as COLOURS, o as QUERY, p as SolveOptions, r as ColourToken, s as Replies, t as Appearance, u as Roles, v as contrast, x as scan, y as createSystemTheme } from "./system-M74t-l7g.mjs";
|
|
2
2
|
export { Appearance, COLOURS, ColourToken, Hue, NOTIFY, QUERY, Replies, Report, Role, Roles, SLOTS, Slot, SolveOptions, Solved, SystemOptions, SystemTheme, UNNOTIFY, contrast, createSystemTheme, luminance, scan };
|
package/dist/system.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineTheme } from "./index.mjs";
|
|
2
2
|
import { clampRgb, converter, formatHex, modeLrgb, modeOkhsl, modeOklab, modeOklch, modeRgb, parse, useMode, wcagLuminance } from "culori/fn";
|
|
3
|
-
|
|
3
|
+
// src/system.ts
|
|
4
4
|
for (const mode of [
|
|
5
5
|
modeRgb,
|
|
6
6
|
modeLrgb,
|
|
@@ -287,5 +287,4 @@ const scan = (text) => {
|
|
|
287
287
|
tail
|
|
288
288
|
};
|
|
289
289
|
};
|
|
290
|
-
//#endregion
|
|
291
290
|
export { COLOURS, NOTIFY, QUERY, SLOTS, UNNOTIFY, contrast, createSystemTheme, luminance, scan };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cssints/tui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Deprecated: the terminal target in the cssints repository's native/ replaces this. Kept for existing apps: the runtime of cssints/tui styles (states, cursors, themes) and its OpenTUI and @bomb.sh/tty adapters",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@bomb.sh/tty": ">=0.9.0",
|
|
40
40
|
"@opentui/core": ">=0.5.17",
|
|
41
|
-
"cssints": "^0.
|
|
41
|
+
"cssints": "^0.7.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"@bomb.sh/tty": {
|