@textui/core 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/README.md +17 -20
- package/dist/app/app.d.ts +36 -0
- package/dist/app/app.d.ts.map +1 -1
- package/dist/app/app.js +150 -1
- package/dist/core/focus.d.ts.map +1 -1
- package/dist/core/focus.js +12 -1
- package/dist/core/store.d.ts.map +1 -1
- package/dist/core/store.js +2 -10
- package/dist/jsx/intrinsics.d.ts +18 -0
- package/dist/jsx/intrinsics.d.ts.map +1 -1
- package/dist/render/layout.js +10 -2
- package/dist/themes/builtin.d.ts +2 -0
- package/dist/themes/builtin.d.ts.map +1 -1
- package/dist/themes/builtin.js +64 -1
- package/dist/themes/dividers.d.ts +14 -0
- package/dist/themes/dividers.d.ts.map +1 -0
- package/dist/themes/dividers.js +42 -0
- package/dist/themes/glyphs.d.ts.map +1 -1
- package/dist/themes/glyphs.js +4 -0
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/index.d.ts.map +1 -1
- package/dist/themes/index.js +1 -0
- package/dist/themes/registry.d.ts.map +1 -1
- package/dist/themes/registry.js +31 -1
- package/dist/types/command.d.ts +18 -1
- package/dist/types/command.d.ts.map +1 -1
- package/dist/types/input.d.ts +9 -0
- package/dist/types/input.d.ts.map +1 -1
- package/dist/types/markdown.d.ts +36 -1
- package/dist/types/markdown.d.ts.map +1 -1
- package/dist/types/style.d.ts +28 -1
- package/dist/types/style.d.ts.map +1 -1
- package/dist/types/terminal.d.ts +9 -0
- package/dist/types/terminal.d.ts.map +1 -1
- package/dist/types/theme.d.ts +26 -1
- package/dist/types/theme.d.ts.map +1 -1
- package/dist/util/markdown.d.ts.map +1 -1
- package/dist/util/markdown.js +172 -2
- package/dist/util/paths.d.ts +9 -3
- package/dist/util/paths.d.ts.map +1 -1
- package/dist/util/paths.js +11 -16
- package/package.json +5 -5
- package/src/app/app.ts +144 -1
- package/src/core/focus.ts +12 -1
- package/src/core/store.ts +2 -7
- package/src/jsx/intrinsics.ts +18 -0
- package/src/render/layout.ts +7 -2
- package/src/themes/builtin.ts +65 -1
- package/src/themes/dividers.ts +48 -0
- package/src/themes/glyphs.ts +4 -0
- package/src/themes/index.ts +1 -0
- package/src/themes/registry.ts +30 -2
- package/src/types/command.ts +18 -1
- package/src/types/input.ts +9 -0
- package/src/types/markdown.ts +38 -2
- package/src/types/style.ts +33 -1
- package/src/types/terminal.ts +9 -0
- package/src/types/theme.ts +29 -1
- package/src/util/markdown.ts +202 -3
- package/src/util/paths.ts +12 -15
package/dist/themes/builtin.js
CHANGED
|
@@ -21,6 +21,7 @@ export const DARK = {
|
|
|
21
21
|
border: '#30363d',
|
|
22
22
|
borderStrong: '#484f58',
|
|
23
23
|
borderSubtle: '#21262d',
|
|
24
|
+
divider: '#484f58',
|
|
24
25
|
text: '#e6edf3',
|
|
25
26
|
muted: '#8b949e',
|
|
26
27
|
subtle: '#6e7681',
|
|
@@ -66,6 +67,7 @@ export const LIGHT = {
|
|
|
66
67
|
border: '#d0d7de',
|
|
67
68
|
borderStrong: '#8c959f',
|
|
68
69
|
borderSubtle: '#eaeef2',
|
|
70
|
+
divider: '#8c959f',
|
|
69
71
|
text: '#1f2328',
|
|
70
72
|
muted: '#656d76',
|
|
71
73
|
subtle: '#8c959f',
|
|
@@ -110,6 +112,7 @@ export const CONSOLE = {
|
|
|
110
112
|
surface: '#0a0e14',
|
|
111
113
|
border: '#3b4252',
|
|
112
114
|
borderStrong: '#5e81ac',
|
|
115
|
+
divider: '#5e81ac',
|
|
113
116
|
accent: '#88c0d0',
|
|
114
117
|
text: '#d8dee9',
|
|
115
118
|
muted: '#616e88',
|
|
@@ -139,6 +142,58 @@ export const CONSOLE = {
|
|
|
139
142
|
export const PAPER = {
|
|
140
143
|
id: 'paper',
|
|
141
144
|
name: 'Paper',
|
|
145
|
+
appearance: 'dark',
|
|
146
|
+
extends: 'dark',
|
|
147
|
+
border: 'none',
|
|
148
|
+
density: 'airy',
|
|
149
|
+
colors: {
|
|
150
|
+
canvas: 'default',
|
|
151
|
+
surface: 'default',
|
|
152
|
+
surfaceAlt: 'default',
|
|
153
|
+
overlay: 'default',
|
|
154
|
+
border: 'default',
|
|
155
|
+
borderStrong: 'default',
|
|
156
|
+
borderSubtle: 'default',
|
|
157
|
+
divider: 'default',
|
|
158
|
+
text: 'default',
|
|
159
|
+
muted: '#9b949e',
|
|
160
|
+
subtle: '#a7a7a7',
|
|
161
|
+
inverted: '#0d1117',
|
|
162
|
+
accent: '#58a6ff',
|
|
163
|
+
primary: '#388bfd',
|
|
164
|
+
secondary: '#a371f7',
|
|
165
|
+
success: '#3fb950',
|
|
166
|
+
warning: '#d29922',
|
|
167
|
+
danger: '#f85149',
|
|
168
|
+
info: '#58a6ff',
|
|
169
|
+
onAccent: '#0d1117',
|
|
170
|
+
onDefault: '#0d1117',
|
|
171
|
+
onPrimary: '#0d1117',
|
|
172
|
+
onSecondary: '#0d1117',
|
|
173
|
+
onMuted: '#0d1117',
|
|
174
|
+
onSuccess: '#0d1117',
|
|
175
|
+
onInfo: '#0d1117',
|
|
176
|
+
onWarning: '#0d1117',
|
|
177
|
+
onDanger: '#0d1117',
|
|
178
|
+
hover: '#1f2937',
|
|
179
|
+
active: '#264466',
|
|
180
|
+
selected: '#1f6feb',
|
|
181
|
+
focus: '#58a6ff',
|
|
182
|
+
disabled: '#484f58',
|
|
183
|
+
scrim: '#010409',
|
|
184
|
+
cursor: 'default',
|
|
185
|
+
shadow: '#010409',
|
|
186
|
+
},
|
|
187
|
+
spacing: { none: 0, xs: 1, sm: 1, md: 2, lg: 3, xl: 4 },
|
|
188
|
+
components: {
|
|
189
|
+
Panel: { base: { border: 'none', padding: [1, 2] } },
|
|
190
|
+
Button: { base: { padding: [0, 2] } },
|
|
191
|
+
},
|
|
192
|
+
};
|
|
193
|
+
/** Borderless. Whitespace and alignment do the separating. */
|
|
194
|
+
export const PAPER_LIGHT = {
|
|
195
|
+
id: 'paper-light',
|
|
196
|
+
name: 'Paper Light',
|
|
142
197
|
appearance: 'light',
|
|
143
198
|
extends: 'light',
|
|
144
199
|
border: 'none',
|
|
@@ -149,6 +204,7 @@ export const PAPER = {
|
|
|
149
204
|
surfaceAlt: '#f5f2ec',
|
|
150
205
|
border: '#e5e0d8',
|
|
151
206
|
borderSubtle: '#f0ece5',
|
|
207
|
+
divider: 'default',
|
|
152
208
|
subtle: '#c56532',
|
|
153
209
|
text: '#2b2a27',
|
|
154
210
|
muted: '#7a756c',
|
|
@@ -185,6 +241,7 @@ export const WORKBENCH = {
|
|
|
185
241
|
overlay: '#181825',
|
|
186
242
|
border: '#45475a',
|
|
187
243
|
borderStrong: '#585b70',
|
|
244
|
+
divider: '#585b70',
|
|
188
245
|
text: '#cdd6f4',
|
|
189
246
|
muted: '#a6adc8',
|
|
190
247
|
subtle: '#6c7086',
|
|
@@ -211,6 +268,10 @@ export const MONO = {
|
|
|
211
268
|
name: 'Monochrome',
|
|
212
269
|
appearance: 'dark',
|
|
213
270
|
border: 'ascii',
|
|
271
|
+
cursor: 'underline',
|
|
272
|
+
// Chosen, not downgraded to: this theme is ascii on a terminal that could
|
|
273
|
+
// draw anything, so the rule has to say so too.
|
|
274
|
+
divider: 'ascii',
|
|
214
275
|
density: 'normal',
|
|
215
276
|
colors: {
|
|
216
277
|
canvas: 'default',
|
|
@@ -220,6 +281,7 @@ export const MONO = {
|
|
|
220
281
|
border: 'default',
|
|
221
282
|
borderStrong: 'default',
|
|
222
283
|
borderSubtle: 'default',
|
|
284
|
+
divider: 'default',
|
|
223
285
|
text: 'default',
|
|
224
286
|
muted: 'default',
|
|
225
287
|
subtle: 'default',
|
|
@@ -268,6 +330,7 @@ export const PAPER_DARK = {
|
|
|
268
330
|
surfaceAlt: '#26231f',
|
|
269
331
|
border: '#3a352e',
|
|
270
332
|
borderSubtle: '#2a2621',
|
|
333
|
+
divider: 'default',
|
|
271
334
|
subtle: '#db8c4c',
|
|
272
335
|
text: '#e8e3d9',
|
|
273
336
|
muted: '#9a9287',
|
|
@@ -287,5 +350,5 @@ export const PAPER_DARK = {
|
|
|
287
350
|
},
|
|
288
351
|
};
|
|
289
352
|
export const BUILTIN_THEMES = [
|
|
290
|
-
DARK, LIGHT, CONSOLE, PAPER, PAPER_DARK, WORKBENCH, MONO,
|
|
353
|
+
DARK, LIGHT, CONSOLE, PAPER, PAPER_LIGHT, PAPER_DARK, WORKBENCH, MONO,
|
|
291
354
|
];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DividerChars, DividerStyle } from '../types/style.js';
|
|
2
|
+
/**
|
|
3
|
+
* The divider sets.
|
|
4
|
+
*
|
|
5
|
+
* A parallel to `BORDER_SETS`, and deliberately not part of it. A border is
|
|
6
|
+
* thirteen characters that only mean anything together - they enclose a box.
|
|
7
|
+
* A divider encloses nothing: it is one rule, in one direction, whose whole
|
|
8
|
+
* job is to separate. Folding it into `BorderChars` made a theme choose a
|
|
9
|
+
* frame style in order to choose a rule, so a borderless theme could not have
|
|
10
|
+
* one without every bordered component reserving a ring it never draws.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DIVIDER_SETS: Record<DividerStyle, DividerChars>;
|
|
13
|
+
export declare function dividerCharsFor(style: DividerStyle, unicode: 'ascii' | 'bmp' | 'full'): DividerChars;
|
|
14
|
+
//# sourceMappingURL=dividers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dividers.d.ts","sourceRoot":"","sources":["../../src/themes/dividers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEpE;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,YAAY,CAO3D,CAAC;AAqBF,wBAAgB,eAAe,CAC7B,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,GAChC,YAAY,CAId"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The divider sets.
|
|
3
|
+
*
|
|
4
|
+
* A parallel to `BORDER_SETS`, and deliberately not part of it. A border is
|
|
5
|
+
* thirteen characters that only mean anything together - they enclose a box.
|
|
6
|
+
* A divider encloses nothing: it is one rule, in one direction, whose whole
|
|
7
|
+
* job is to separate. Folding it into `BorderChars` made a theme choose a
|
|
8
|
+
* frame style in order to choose a rule, so a borderless theme could not have
|
|
9
|
+
* one without every bordered component reserving a ring it never draws.
|
|
10
|
+
*/
|
|
11
|
+
export const DIVIDER_SETS = {
|
|
12
|
+
none: { horizontal: ' ', vertical: ' ' },
|
|
13
|
+
single: { horizontal: '┈', vertical: '│' },
|
|
14
|
+
double: { horizontal: '═', vertical: '║' },
|
|
15
|
+
dashed: { horizontal: '┄', vertical: '┆' },
|
|
16
|
+
thick: { horizontal: '━', vertical: '┃' },
|
|
17
|
+
ascii: { horizontal: '-', vertical: '|' },
|
|
18
|
+
};
|
|
19
|
+
/** What a terminal with no box drawing gets instead. */
|
|
20
|
+
const ASCII_FALLBACK = {
|
|
21
|
+
none: 'none',
|
|
22
|
+
single: 'ascii',
|
|
23
|
+
double: 'ascii',
|
|
24
|
+
dashed: 'ascii',
|
|
25
|
+
thick: 'ascii',
|
|
26
|
+
ascii: 'ascii',
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The BMP tier has box drawing but not every weight of it: `┄` and `━` are
|
|
30
|
+
* outside it, and a missing glyph is a question mark on somebody's terminal.
|
|
31
|
+
*/
|
|
32
|
+
const BMP_FALLBACK = {
|
|
33
|
+
dashed: 'single',
|
|
34
|
+
thick: 'single',
|
|
35
|
+
};
|
|
36
|
+
export function dividerCharsFor(style, unicode) {
|
|
37
|
+
if (unicode === 'ascii')
|
|
38
|
+
return DIVIDER_SETS[ASCII_FALLBACK[style]];
|
|
39
|
+
if (unicode === 'bmp')
|
|
40
|
+
return DIVIDER_SETS[BMP_FALLBACK[style] ?? style];
|
|
41
|
+
return DIVIDER_SETS[style];
|
|
42
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../../src/themes/glyphs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../../src/themes/glyphs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,WAqCzB,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,UAAU,EAAE,WASxB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,WAqC1B,CAAC;AAEF,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW,CAI5D"}
|
package/dist/themes/glyphs.js
CHANGED
|
@@ -19,6 +19,8 @@ export const FULL_GLYPHS = {
|
|
|
19
19
|
chevronUp: '▴',
|
|
20
20
|
arrowUp: '↑',
|
|
21
21
|
arrowDown: '↓',
|
|
22
|
+
arrowLeft: '←',
|
|
23
|
+
arrowRight: '→',
|
|
22
24
|
ellipsis: '…',
|
|
23
25
|
search: '⌕',
|
|
24
26
|
radioOn: '●',
|
|
@@ -66,6 +68,8 @@ export const ASCII_GLYPHS = {
|
|
|
66
68
|
chevronUp: '^',
|
|
67
69
|
arrowUp: '^',
|
|
68
70
|
arrowDown: 'v',
|
|
71
|
+
arrowLeft: '<',
|
|
72
|
+
arrowRight: '>',
|
|
69
73
|
ellipsis: '...',
|
|
70
74
|
search: '/',
|
|
71
75
|
radioOn: '(*)',
|
package/dist/themes/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/themes/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/themes/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
package/dist/themes/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/themes/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAAE,eAAe,EAAe,aAAa,EAC3D,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/themes/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EAAE,eAAe,EAAe,aAAa,EAC3D,MAAM,mBAAmB,CAAC;AAK3B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAqDzD,qBAAa,MAAO,YAAW,aAAa;IAC1C,OAAO,CAAC,IAAI,CAAsC;IAClD,OAAO,CAAC,KAAK,CAAoC;gBAErC,OAAO,GAAE,eAAe,EAAmB;IAIvD,QAAQ,CAAC,GAAG,EAAE,eAAe,GAAG,UAAU;IAS1C,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAK5B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAI5C,IAAI,IAAI,eAAe,EAAE;IAIzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,GAAG,aAAa;CAuJ/D;AAED,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,eAAe,EAAE,GAAG,MAAM,CAEhE"}
|
package/dist/themes/registry.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { toDisposable } from '../util/disposable.js';
|
|
2
2
|
import { borderCharsFor } from './borders.js';
|
|
3
|
+
import { dividerCharsFor } from './dividers.js';
|
|
3
4
|
import { glyphsFor } from './glyphs.js';
|
|
4
5
|
import { BUILTIN_THEMES } from './builtin.js';
|
|
5
6
|
const DEFAULT_SPACING = { none: 0, xs: 0, sm: 1, md: 1, lg: 2, xl: 3 };
|
|
6
7
|
const FALLBACK_COLORS = {
|
|
7
8
|
canvas: 'default', surface: 'default', surfaceAlt: 'default', overlay: 'default',
|
|
8
|
-
border: 'default', borderStrong: 'default', borderSubtle: 'default',
|
|
9
|
+
border: 'default', borderStrong: 'default', borderSubtle: 'default', divider: 'default',
|
|
9
10
|
text: 'default', muted: 'default', subtle: 'default', inverted: 'default',
|
|
10
11
|
accent: 'default', primary: 'default', secondary: 'default',
|
|
11
12
|
success: 'default', warning: 'default', danger: 'default', info: 'default',
|
|
@@ -95,6 +96,14 @@ export class Themes {
|
|
|
95
96
|
let spacing = { ...DEFAULT_SPACING };
|
|
96
97
|
let glyphOverrides = {};
|
|
97
98
|
let border = 'single';
|
|
99
|
+
let divider = 'single';
|
|
100
|
+
// Undefined means "leave the terminal's own setting alone", which is the
|
|
101
|
+
// right default: a theme that says nothing should not restyle the caret.
|
|
102
|
+
let cursorStyle;
|
|
103
|
+
// The quiet one. A rule between every pair of rows is right for a table of
|
|
104
|
+
// few, long rows and noise on a table of twenty short ones, so a theme
|
|
105
|
+
// opts in rather than out.
|
|
106
|
+
let tableRules = 'header';
|
|
98
107
|
let density = 'normal';
|
|
99
108
|
const components = {};
|
|
100
109
|
let syntaxOverrides = {};
|
|
@@ -126,6 +135,12 @@ export class Themes {
|
|
|
126
135
|
glyphOverrides = { ...glyphOverrides, ...def.glyphs };
|
|
127
136
|
if (def.border)
|
|
128
137
|
border = def.border;
|
|
138
|
+
if (def.divider)
|
|
139
|
+
divider = def.divider;
|
|
140
|
+
if (def.cursor)
|
|
141
|
+
cursorStyle = def.cursor;
|
|
142
|
+
if (def.tableRules)
|
|
143
|
+
tableRules = def.tableRules;
|
|
129
144
|
if (def.density)
|
|
130
145
|
density = def.density;
|
|
131
146
|
for (const [name, variants] of Object.entries(def.components ?? {})) {
|
|
@@ -155,6 +170,7 @@ export class Themes {
|
|
|
155
170
|
}
|
|
156
171
|
const glyphs = { ...glyphsFor(caps.unicode), ...glyphOverrides };
|
|
157
172
|
const charCache = new Map();
|
|
173
|
+
const ruleCache = new Map();
|
|
158
174
|
const resolved = {
|
|
159
175
|
id: leaf.id,
|
|
160
176
|
name: leaf.name,
|
|
@@ -163,6 +179,9 @@ export class Themes {
|
|
|
163
179
|
spacing,
|
|
164
180
|
glyphs,
|
|
165
181
|
border,
|
|
182
|
+
divider,
|
|
183
|
+
cursor: cursorStyle,
|
|
184
|
+
tableRules,
|
|
166
185
|
density,
|
|
167
186
|
components,
|
|
168
187
|
syntax,
|
|
@@ -183,6 +202,17 @@ export class Themes {
|
|
|
183
202
|
}
|
|
184
203
|
return chars;
|
|
185
204
|
},
|
|
205
|
+
dividerChars(style) {
|
|
206
|
+
const s = style ?? divider;
|
|
207
|
+
let chars = ruleCache.get(s);
|
|
208
|
+
if (!chars) {
|
|
209
|
+
const base = dividerCharsFor(s, caps.unicode);
|
|
210
|
+
const custom = leaf.dividerChars?.[s];
|
|
211
|
+
chars = custom ? { ...base, ...custom } : base;
|
|
212
|
+
ruleCache.set(s, chars);
|
|
213
|
+
}
|
|
214
|
+
return chars;
|
|
215
|
+
},
|
|
186
216
|
styleFor(component, variants = []) {
|
|
187
217
|
const entry = components[component];
|
|
188
218
|
if (!entry)
|
package/dist/types/command.d.ts
CHANGED
|
@@ -39,6 +39,16 @@ export interface ArgSpec {
|
|
|
39
39
|
/** Fixed choices, or a resolver for a picker. */
|
|
40
40
|
choices?: ArgChoices | (() => Promise<ArgChoices> | ArgChoices);
|
|
41
41
|
default?: unknown;
|
|
42
|
+
/**
|
|
43
|
+
* How the picker should lay out each choice's `description`.
|
|
44
|
+
*
|
|
45
|
+
* The argument is what knows: a list of branch names has nothing to say
|
|
46
|
+
* under each one, and a list of approval modes is *only* told apart by what
|
|
47
|
+
* is under each one. `below` gives every choice a second line, which is the
|
|
48
|
+
* only place a sentence fits - inline it shares the width with the label and
|
|
49
|
+
* every answer shows the same truncated half.
|
|
50
|
+
*/
|
|
51
|
+
descriptions?: 'inline' | 'below';
|
|
42
52
|
/**
|
|
43
53
|
* Show what a choice would do, before it is chosen.
|
|
44
54
|
*
|
|
@@ -63,6 +73,13 @@ export interface CommandDefinition {
|
|
|
63
73
|
id: string;
|
|
64
74
|
title: string;
|
|
65
75
|
description?: string;
|
|
76
|
+
/**
|
|
77
|
+
* The group this belongs to. The palette names it once, above the group.
|
|
78
|
+
*
|
|
79
|
+
* It is not a per-row label: repeating it beside every row spends the width
|
|
80
|
+
* the rows need for saying what they do, and still does not say where one
|
|
81
|
+
* group ends and the next begins.
|
|
82
|
+
*/
|
|
66
83
|
category?: string;
|
|
67
84
|
icon?: string;
|
|
68
85
|
/**
|
|
@@ -74,7 +91,7 @@ export interface CommandDefinition {
|
|
|
74
91
|
*/
|
|
75
92
|
keepOpen?: boolean;
|
|
76
93
|
/**
|
|
77
|
-
* A short state word shown beside the row, in place of
|
|
94
|
+
* A short state word shown beside the row, in place of its description.
|
|
78
95
|
*
|
|
79
96
|
* The icon is the row's identity and should not move under the reader as
|
|
80
97
|
* state changes; this is where the state goes instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/types/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,CAAC;AAErE;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAC;AAEhD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,OAAO,CAAC,EAAE,UAAU,GAAG,CAAC,MAAM,OAAO,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC,CAAC;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/types/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CA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,KAAK,CAAC,EAAE,YAAY,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,iBAAiB,EAAE,CAAC;IACpG,+DAA+D;IAC/D,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAAC;IACnD,OAAO,CACL,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAChC,OAAO,CAAC,OAAO,CAAC,CAAC;IACpB,iEAAiE;IACjE,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAC7B,uEAAuE;IACvE,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;CAC5C"}
|
package/dist/types/input.d.ts
CHANGED
|
@@ -41,6 +41,15 @@ export interface MouseEvent {
|
|
|
41
41
|
ctrl: boolean;
|
|
42
42
|
alt: boolean;
|
|
43
43
|
shift: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* When it happened, in milliseconds.
|
|
46
|
+
*
|
|
47
|
+
* A terminal reports presses and releases and never says "double click" -
|
|
48
|
+
* there is no such thing on the wire - so telling one gesture from two is
|
|
49
|
+
* arithmetic on when they arrived and where. Stamped by whatever produced
|
|
50
|
+
* the event, which is the only thing that knows.
|
|
51
|
+
*/
|
|
52
|
+
at?: number;
|
|
44
53
|
handled: boolean;
|
|
45
54
|
}
|
|
46
55
|
export interface PasteEvent {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/types/input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,GAAG,EAAE,OAAO,CA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O,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,UAAU,GAClB,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,kBAAkB,GAAG,WAAW,CAAC;AAE1E,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,UAAU,CAAC;CACjD"}
|
package/dist/types/markdown.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StyleColor } from './style.js';
|
|
1
|
+
import type { StyleColor, TableRules } from './style.js';
|
|
2
2
|
/**
|
|
3
3
|
* Markdown, as rows a terminal can scroll.
|
|
4
4
|
*
|
|
@@ -12,6 +12,8 @@ import type { StyleColor } from './style.js';
|
|
|
12
12
|
* several rows here, each tagged with the fence it belongs to so a painter can
|
|
13
13
|
* put the visible ones back into one box.
|
|
14
14
|
*/
|
|
15
|
+
/** Which edge a table column's text is pushed against. */
|
|
16
|
+
export type MarkdownAlign = 'left' | 'center' | 'right';
|
|
15
17
|
/** A run of text with one style. Inline emphasis is why rows are not strings. */
|
|
16
18
|
export interface MarkdownRun {
|
|
17
19
|
text: string;
|
|
@@ -39,6 +41,29 @@ export type MarkdownRow = {
|
|
|
39
41
|
part: 'open' | 'code' | 'close';
|
|
40
42
|
text?: string;
|
|
41
43
|
language?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* One line of a table, with its cells already fitted to their columns.
|
|
47
|
+
*
|
|
48
|
+
* The widths are decided once for the whole table and repeated on every row
|
|
49
|
+
* of it, because a column that is measured per row is not a column. Cells
|
|
50
|
+
* arrive padded and truncated to exactly `widths[i]`, so a painter only has
|
|
51
|
+
* to put the separators in - which is also what keeps the one-row-per-row
|
|
52
|
+
* invariant: a cell too long for its column is cut, never wrapped, or the
|
|
53
|
+
* table would be a different height than the document said it was.
|
|
54
|
+
*
|
|
55
|
+
* `top`, `rule` and `bottom` are edges and carry no cells; the painter draws
|
|
56
|
+
* them from the widths, in whatever the theme's border characters are. They
|
|
57
|
+
* are rows here for the same reason a fence's rules are: they take a line on
|
|
58
|
+
* the screen, so anything counting rows has to be able to count them.
|
|
59
|
+
*/
|
|
60
|
+
| {
|
|
61
|
+
kind: 'table';
|
|
62
|
+
table: number;
|
|
63
|
+
part: 'top' | 'head' | 'rule' | 'body' | 'bottom';
|
|
64
|
+
cells: MarkdownRun[][];
|
|
65
|
+
widths: number[];
|
|
66
|
+
align: MarkdownAlign[];
|
|
42
67
|
};
|
|
43
68
|
export interface MarkdownLayoutOptions {
|
|
44
69
|
/** Cells to wrap to. Zero means "not measured yet" - nothing is wrapped. */
|
|
@@ -54,5 +79,15 @@ export interface MarkdownLayoutOptions {
|
|
|
54
79
|
* rules nobody draws stops two rows short of the end of the document.
|
|
55
80
|
*/
|
|
56
81
|
ruled?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* How much of a table gets ruled. The theme's `tableRules`, passed through.
|
|
84
|
+
*
|
|
85
|
+
* It has to be decided here rather than by whatever paints the rows,
|
|
86
|
+
* because a rule between two rows *is* a row - it takes a line on the
|
|
87
|
+
* screen. A painter that added them would be drawing more lines than the
|
|
88
|
+
* layout counted, and every viewer that scrolls by row index would land in
|
|
89
|
+
* the wrong place by one per table row.
|
|
90
|
+
*/
|
|
91
|
+
tableRules?: TableRules;
|
|
57
92
|
}
|
|
58
93
|
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/types/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/types/markdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEzD;;;;;;;;;;;;GAYG;AAEH,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD,iFAAiF;AACjF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,WAAW,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;IAAC,EAAE,CAAC,EAAE,UAAU,CAAA;CAAE,GAC9F;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;AACrG;;;;;;;;;;;;;;GAcG;GACD;IACA,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IAClD,KAAK,EAAE,WAAW,EAAE,EAAE,CAAC;IACvB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB,CAAC;AAEJ,MAAM,WAAW,qBAAqB;IACpC,4EAA4E;IAC5E,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB"}
|
package/dist/types/style.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { EdgeSpec } from './geometry.js';
|
|
|
5
5
|
* what lets one catalog render the same under a light theme, a dark theme and
|
|
6
6
|
* a 16-colour ssh session.
|
|
7
7
|
*/
|
|
8
|
-
export type ColorToken = 'canvas' | 'surface' | 'surfaceAlt' | 'overlay' | 'border' | 'borderStrong' | 'borderSubtle' | 'text' | 'muted' | 'subtle' | 'inverted' | 'accent' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'onDefault' | 'onMuted' | 'onAccent' | 'onPrimary' | 'onSecondary' | 'onSuccess' | 'onWarning' | 'onDanger' | 'onInfo' | 'hover' | 'active' | 'selected' | 'focus' | 'disabled' | 'scrim' | 'cursor' | 'shadow';
|
|
8
|
+
export type ColorToken = 'canvas' | 'surface' | 'surfaceAlt' | 'overlay' | 'border' | 'borderStrong' | 'borderSubtle' | 'text' | 'muted' | 'subtle' | 'inverted' | 'accent' | 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | 'onDefault' | 'onMuted' | 'onAccent' | 'onPrimary' | 'onSecondary' | 'onSuccess' | 'onWarning' | 'onDanger' | 'onInfo' | 'hover' | 'active' | 'selected' | 'focus' | 'disabled' | 'scrim' | 'cursor' | 'shadow' | 'divider';
|
|
9
9
|
/** Anywhere a colour is accepted, a semantic token is accepted too. */
|
|
10
10
|
export type StyleColor = ColorToken | Color;
|
|
11
11
|
export type Dimension = number | `${number}%` | 'auto';
|
|
@@ -27,6 +27,33 @@ export interface BorderChars {
|
|
|
27
27
|
teeLeft: string;
|
|
28
28
|
teeRight: string;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* A rule that separates, rather than a frame that encloses.
|
|
32
|
+
*
|
|
33
|
+
* Kept apart from `BorderStyle` on purpose: a theme that draws no frames may
|
|
34
|
+
* still want a rule, and tying the two means choosing a divider glyph decides
|
|
35
|
+
* whether every bordered component reserves a ring.
|
|
36
|
+
*/
|
|
37
|
+
export type DividerStyle = 'none' | 'single' | 'double' | 'dashed' | 'thick' | 'ascii';
|
|
38
|
+
/** A divider runs either way, so it names both. */
|
|
39
|
+
export interface DividerChars {
|
|
40
|
+
horizontal: string;
|
|
41
|
+
vertical: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The shape of the caret.
|
|
45
|
+
*
|
|
46
|
+
* Named for DECSCUSR, which is what a terminal understands, so a theme value
|
|
47
|
+
* maps straight onto the escape sequence with nothing to translate.
|
|
48
|
+
*/
|
|
49
|
+
export type CursorStyle = 'block' | 'underline' | 'bar';
|
|
50
|
+
/**
|
|
51
|
+
* How much of a table gets ruled: the header only, or between every row.
|
|
52
|
+
*
|
|
53
|
+
* Not a border style - it is a question about how many lines, not which
|
|
54
|
+
* glyphs. The glyphs are the theme's border set either way.
|
|
55
|
+
*/
|
|
56
|
+
export type TableRules = 'header' | 'all';
|
|
30
57
|
export type BorderSides = {
|
|
31
58
|
top?: boolean;
|
|
32
59
|
right?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/types/style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAC/C,QAAQ,GAAG,cAAc,GAAG,cAAc,GAC1C,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GACxC,QAAQ,GAAG,SAAS,GAAG,WAAW,GAClC,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GACzC,WAAW,GAAG,SAAS,GACvB,UAAU,GAAG,WAAW,GAAG,aAAa,GACxC,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GACjD,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GACtD,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../src/types/style.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAC/C,QAAQ,GAAG,cAAc,GAAG,cAAc,GAC1C,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GACxC,QAAQ,GAAG,SAAS,GAAG,WAAW,GAClC,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,GACzC,WAAW,GAAG,SAAS,GACvB,UAAU,GAAG,WAAW,GAAG,aAAa,GACxC,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GACjD,OAAO,GAAG,QAAQ,G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,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC"}
|
package/dist/types/terminal.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CursorStyle } from './style.js';
|
|
1
2
|
import type { Disposable } from './disposable.js';
|
|
2
3
|
import type { Size } from './geometry.js';
|
|
3
4
|
import type { TerminalCapabilities, CapabilityOverrides } from './capabilities.js';
|
|
@@ -28,6 +29,8 @@ export interface AcquiredState {
|
|
|
28
29
|
focusEvents: boolean;
|
|
29
30
|
paste: boolean;
|
|
30
31
|
cursorHidden: boolean;
|
|
32
|
+
/** Whether this session changed the caret shape, and so owes a reset. */
|
|
33
|
+
cursorShaped?: boolean;
|
|
31
34
|
enhancedKeys: boolean;
|
|
32
35
|
rawMode: boolean;
|
|
33
36
|
titleSet: boolean;
|
|
@@ -48,5 +51,11 @@ export interface TerminalAdapter extends Disposable {
|
|
|
48
51
|
/** OSC 52, when the terminal allows it. */
|
|
49
52
|
writeClipboard?(text: string): void;
|
|
50
53
|
setTitle?(title: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* DECSCUSR. Session state rather than frame state - it survives until
|
|
56
|
+
* something changes it, so it is set when it changes and put back on
|
|
57
|
+
* teardown, the way the alt screen and raw mode are.
|
|
58
|
+
*/
|
|
59
|
+
setCursorShape?(shape: CursorStyle): void;
|
|
51
60
|
}
|
|
52
61
|
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../src/types/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CA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dist/types/theme.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Color } from './cells.js';
|
|
2
|
-
import type { BorderChars, BorderStyle, ColorToken, Density, Style, StyleColor } from './style.js';
|
|
2
|
+
import type { BorderChars, BorderStyle, ColorToken, CursorStyle, Density, DividerChars, DividerStyle, Style, StyleColor, TableRules } from './style.js';
|
|
3
3
|
import type { SyntaxScope } from './syntax.js';
|
|
4
4
|
import type { Disposable } from './disposable.js';
|
|
5
5
|
import type { TerminalCapabilities } from './capabilities.js';
|
|
@@ -31,6 +31,8 @@ export interface ThemeGlyphs {
|
|
|
31
31
|
chevronUp: string;
|
|
32
32
|
arrowUp: string;
|
|
33
33
|
arrowDown: string;
|
|
34
|
+
arrowLeft: string;
|
|
35
|
+
arrowRight: string;
|
|
34
36
|
ellipsis: string;
|
|
35
37
|
search: string;
|
|
36
38
|
radioOn: string;
|
|
@@ -77,6 +79,25 @@ export interface ThemeDefinition {
|
|
|
77
79
|
/** Default border style for chrome. `'none'` gives the borderless look. */
|
|
78
80
|
border?: BorderStyle;
|
|
79
81
|
borderChars?: Partial<Record<BorderStyle, BorderChars>>;
|
|
82
|
+
/**
|
|
83
|
+
* Default rule style. Independent of `border`, so a borderless theme can
|
|
84
|
+
* still separate with a line.
|
|
85
|
+
*/
|
|
86
|
+
divider?: DividerStyle;
|
|
87
|
+
dividerChars?: Partial<Record<DividerStyle, DividerChars>>;
|
|
88
|
+
/** The caret's shape. The terminal's own setting is the default. */
|
|
89
|
+
cursor?: CursorStyle;
|
|
90
|
+
/**
|
|
91
|
+
* How much of a table gets ruled.
|
|
92
|
+
*
|
|
93
|
+
* `header` is the default and the quiet one: a box, and a rule under the
|
|
94
|
+
* header. `all` puts a rule between every pair of rows as well, which is
|
|
95
|
+
* what a table of few, long rows wants - a wrapped-looking cell beside a
|
|
96
|
+
* short one is ambiguous about which row it belongs to until something
|
|
97
|
+
* separates them. On a table of twenty short rows the same lines are noise,
|
|
98
|
+
* which is why it is the theme's call rather than the default.
|
|
99
|
+
*/
|
|
100
|
+
tableRules?: TableRules;
|
|
80
101
|
density?: Density;
|
|
81
102
|
/** Per-component style overrides, keyed by component name then variant. */
|
|
82
103
|
components?: Record<string, Record<string, Style>>;
|
|
@@ -96,6 +117,9 @@ export interface ResolvedTheme {
|
|
|
96
117
|
spacing: ThemeSpacing;
|
|
97
118
|
glyphs: ThemeGlyphs;
|
|
98
119
|
border: BorderStyle;
|
|
120
|
+
divider: DividerStyle;
|
|
121
|
+
cursor: CursorStyle | undefined;
|
|
122
|
+
tableRules: TableRules;
|
|
99
123
|
density: Density;
|
|
100
124
|
components: Record<string, Record<string, Style>>;
|
|
101
125
|
/** Every syntax scope, resolved to a colour. */
|
|
@@ -103,6 +127,7 @@ export interface ResolvedTheme {
|
|
|
103
127
|
/** Resolve a token (or pass a literal colour through). */
|
|
104
128
|
color(token: string): Color;
|
|
105
129
|
borderChars(style?: BorderStyle): BorderChars;
|
|
130
|
+
dividerChars(style?: DividerStyle): DividerChars;
|
|
106
131
|
/** Component style for a name + variant list, merged in order. */
|
|
107
132
|
styleFor(component: string, variants?: string[]): Style;
|
|
108
133
|
}
|