@cssints/tui 0.1.0 → 0.2.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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TuiState, onTheme, resolve, setTheme, theme } from "./index.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { g as SystemTheme } from "./system-CFyJGOUM.mjs";
|
|
3
3
|
import { Op, OpenElement, RenderOptions, RenderResult, Term, Text } from "@bomb.sh/tty";
|
|
4
4
|
import { TuiProps, TuiShape } from "cssints/tui";
|
|
5
5
|
//#region src/bomb-system.d.ts
|
package/dist/bomb.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { onTheme, resolve, setTheme, theme } from "./index.mjs";
|
|
2
|
-
import { NOTIFY, QUERY, UNNOTIFY, scan } from "./system.mjs";
|
|
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
|
//#region src/bomb-system.ts
|
|
5
5
|
const binary = (bytes) => {
|
|
@@ -43,7 +43,7 @@ const followSystemTheme = (theme, options) => {
|
|
|
43
43
|
for (const [i, hex] of replies.ansi) report.ansi[i] = hex;
|
|
44
44
|
if (replies.scheme) {
|
|
45
45
|
report.scheme = replies.scheme;
|
|
46
|
-
if (done) options.write(
|
|
46
|
+
if (done) options.write(COLOURS);
|
|
47
47
|
}
|
|
48
48
|
const complete = report.fg && report.bg && report.ansi.filter(Boolean).length === 16;
|
|
49
49
|
if (found && done) apply();
|
package/dist/opentui.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TuiState, resolve, setTheme, theme } from "./index.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { c as Report, g as SystemTheme } from "./system-CFyJGOUM.mjs";
|
|
3
3
|
import { CliRenderer, Renderable, TerminalColors, TextNodeRenderable, ThemeMode } from "@opentui/core";
|
|
4
4
|
import { TuiProps, TuiShape } from "cssints/tui";
|
|
5
5
|
//#region src/opentui-system.d.ts
|
|
@@ -86,7 +86,9 @@ declare const contrast: (a: string, b: string) => number;
|
|
|
86
86
|
* @returns {SystemTheme} the theme, for `followSystemTheme` of an adapter, or `solve` and `apply`
|
|
87
87
|
*/
|
|
88
88
|
declare const createSystemTheme: <T extends object>(tokens: T, roles: Roles<T>, options?: SystemOptions) => SystemTheme;
|
|
89
|
-
/** OSC 10 and 11 (the default colours)
|
|
89
|
+
/** OSC 10 and 11 (the default colours) and OSC 4 for the 16 ANSI colours. */
|
|
90
|
+
declare const COLOURS: string;
|
|
91
|
+
/** The colours and the colour-scheme report (`CSI ? 996 n`). */
|
|
90
92
|
declare const QUERY: string;
|
|
91
93
|
/** Mode 2031 on: the terminal sends `CSI ? 997 ; 1|2 n` when its palette changes. */
|
|
92
94
|
declare const NOTIFY = "[?2031h";
|
|
@@ -113,4 +115,4 @@ declare const scan: (text: string) => {
|
|
|
113
115
|
tail: string;
|
|
114
116
|
};
|
|
115
117
|
//#endregion
|
|
116
|
-
export {
|
|
118
|
+
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
|
|
2
|
-
export { Appearance, ColourToken, Hue, NOTIFY, QUERY, Replies, Report, Role, Roles, SLOTS, Slot, SolveOptions, Solved, SystemOptions, SystemTheme, UNNOTIFY, contrast, createSystemTheme, luminance, scan };
|
|
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-CFyJGOUM.mjs";
|
|
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
|
@@ -236,13 +236,14 @@ const createSystemTheme = (tokens, roles, options = {}) => {
|
|
|
236
236
|
}
|
|
237
237
|
};
|
|
238
238
|
};
|
|
239
|
-
/** OSC 10 and 11 (the default colours)
|
|
240
|
-
const
|
|
239
|
+
/** OSC 10 and 11 (the default colours) and OSC 4 for the 16 ANSI colours. */
|
|
240
|
+
const COLOURS = [
|
|
241
241
|
"\x1B]10;?\x1B\\",
|
|
242
242
|
"\x1B]11;?\x1B\\",
|
|
243
|
-
...SLOTS.map((_, i) => `\x1b]4;${i};?\x1b\\`)
|
|
244
|
-
"\x1B[?996n"
|
|
243
|
+
...SLOTS.map((_, i) => `\x1b]4;${i};?\x1b\\`)
|
|
245
244
|
].join("");
|
|
245
|
+
/** The colours and the colour-scheme report (`CSI ? 996 n`). */
|
|
246
|
+
const QUERY = `${COLOURS}\x1b[?996n`;
|
|
246
247
|
/** Mode 2031 on: the terminal sends `CSI ? 997 ; 1|2 n` when its palette changes. */
|
|
247
248
|
const NOTIFY = "\x1B[?2031h";
|
|
248
249
|
/** Mode 2031 off. */
|
|
@@ -287,4 +288,4 @@ const scan = (text) => {
|
|
|
287
288
|
};
|
|
288
289
|
};
|
|
289
290
|
//#endregion
|
|
290
|
-
export { NOTIFY, QUERY, SLOTS, UNNOTIFY, contrast, createSystemTheme, luminance, scan };
|
|
291
|
+
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.2.0",
|
|
4
4
|
"description": "cssints in a terminal: 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.2.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"@bomb.sh/tty": {
|