@bigpixelrocket/uiok 0.4.0 → 0.6.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/CHANGELOG.md +63 -1
- package/dist/button/TextLink.d.ts +26 -3
- package/dist/button/TextLink.js +5 -3
- package/dist/button/button.css +7 -0
- package/dist/dialog/ModalDialog.js +8 -2
- package/dist/dialog/SectionedDialog.d.ts +37 -0
- package/dist/dialog/SectionedDialog.js +157 -0
- package/dist/dialog/dialog.css +102 -0
- package/dist/dialog/index.d.ts +4 -2
- package/dist/dialog/index.js +4 -2
- package/dist/frame/AppRoot.d.ts +1 -1
- package/dist/frame/AppRoot.js +2 -1
- package/dist/frame/Dock.d.ts +1 -1
- package/dist/frame/Dock.js +2 -1
- package/dist/frame/FilterChips.d.ts +5 -2
- package/dist/frame/FilterChips.js +35 -2
- package/dist/frame/FilterChips.logic.d.ts +24 -0
- package/dist/frame/FilterChips.logic.js +34 -0
- package/dist/frame/PageParts.d.ts +4 -3
- package/dist/frame/PageParts.js +10 -3
- package/dist/frame/SideBySide.d.ts +32 -0
- package/dist/frame/SideBySide.js +50 -0
- package/dist/frame/Tree.d.ts +9 -3
- package/dist/frame/Tree.js +8 -5
- package/dist/frame/WindowFrame.d.ts +1 -1
- package/dist/frame/WindowFrame.js +3 -1
- package/dist/frame/frame.css +74 -5
- package/dist/frame/index.d.ts +4 -2
- package/dist/frame/index.js +4 -2
- package/dist/grid/grid.css +1 -0
- package/dist/icon/ProductMark.d.ts +57 -0
- package/dist/icon/ProductMark.js +26 -0
- package/dist/icon/icon.css +53 -0
- package/dist/icon/index.d.ts +3 -1
- package/dist/icon/index.js +3 -1
- package/dist/keyboard/Keyboard.logic.js +20 -3
- package/dist/keychord/KeyChord.d.ts +17 -1
- package/dist/keychord/KeyChord.js +16 -1
- package/dist/keychord/ShortcutIndex.d.ts +49 -0
- package/dist/keychord/ShortcutIndex.js +28 -0
- package/dist/keychord/index.d.ts +8 -2
- package/dist/keychord/index.js +8 -2
- package/dist/keychord/keychord.css +101 -0
- package/dist/labels/dialog.d.ts +2 -0
- package/dist/labels/dialog.js +2 -1
- package/dist/labels/keys.d.ts +5 -0
- package/dist/labels/keys.js +2 -1
- package/dist/labels/settings.d.ts +6 -0
- package/dist/labels/settings.js +1 -0
- package/dist/listing/Listing.d.ts +95 -7
- package/dist/listing/Listing.js +57 -13
- package/dist/listing/ListingScope.d.ts +7 -0
- package/dist/listing/ListingScope.js +8 -0
- package/dist/listing/PaneMessage.d.ts +7 -4
- package/dist/listing/PaneMessage.js +11 -4
- package/dist/listing/Timeline.d.ts +51 -0
- package/dist/listing/Timeline.js +28 -0
- package/dist/listing/index.d.ts +4 -2
- package/dist/listing/index.js +3 -1
- package/dist/listing/listing.css +268 -25
- package/dist/log/Ansi.logic.d.ts +27 -0
- package/dist/log/Ansi.logic.js +203 -0
- package/dist/log/LogWell.d.ts +11 -2
- package/dist/log/LogWell.js +15 -3
- package/dist/log/index.d.ts +1 -0
- package/dist/log/index.js +1 -0
- package/dist/log/log.css +80 -0
- package/dist/menu/Menu.d.ts +133 -0
- package/dist/menu/Menu.js +351 -0
- package/dist/menu/Menu.logic.d.ts +83 -0
- package/dist/menu/Menu.logic.js +92 -0
- package/dist/menu/index.d.ts +6 -1
- package/dist/menu/index.js +6 -1
- package/dist/menu/menu.css +57 -0
- package/dist/palette/Palette.d.ts +3 -2
- package/dist/palette/Palette.js +8 -4
- package/dist/palette/PaletteRows.d.ts +138 -0
- package/dist/palette/PaletteRows.js +76 -0
- package/dist/palette/index.d.ts +5 -2
- package/dist/palette/index.js +5 -2
- package/dist/pane/Pane.d.ts +42 -6
- package/dist/pane/Pane.js +92 -5
- package/dist/pane/PaneFrame.d.ts +22 -1
- package/dist/pane/PaneFrame.js +42 -5
- package/dist/pane/PaneKeys.d.ts +5 -1
- package/dist/pane/PaneKeys.js +28 -3
- package/dist/pane/PaneKeys.logic.d.ts +25 -0
- package/dist/pane/PaneKeys.logic.js +30 -0
- package/dist/pane/index.d.ts +2 -2
- package/dist/pane/index.js +1 -1
- package/dist/pane/usePaneKeys.d.ts +8 -1
- package/dist/pane/usePaneKeys.js +32 -12
- package/dist/shell/SettingsDialog.d.ts +20 -2
- package/dist/shell/SettingsDialog.js +13 -3
- package/dist/shell/index.d.ts +1 -1
- package/dist/styles.css +18 -3
- package/dist/surface/FactList.d.ts +54 -0
- package/dist/surface/FactList.js +33 -0
- package/dist/surface/FactTable.d.ts +44 -0
- package/dist/surface/FactTable.js +33 -0
- package/dist/surface/index.d.ts +7 -2
- package/dist/surface/index.js +7 -2
- package/dist/surface/surface.css +139 -2
- package/dist/tabs/PageTabs.d.ts +6 -0
- package/dist/tabs/PageTabs.js +1 -1
- package/dist/tabs/tabs.css +14 -0
- package/dist/terminal/TerminalBox.d.ts +30 -0
- package/dist/terminal/TerminalBox.js +17 -0
- package/dist/terminal/ghostty/core.d.ts +12 -4
- package/dist/terminal/ghostty/core.js +12 -4
- package/dist/terminal/index.d.ts +6 -2
- package/dist/terminal/index.js +6 -2
- package/dist/terminal/terminal.css +29 -0
- package/dist/text/Code.d.ts +15 -0
- package/dist/text/Code.js +12 -0
- package/dist/text/index.d.ts +6 -1
- package/dist/text/index.js +6 -1
- package/dist/text/text.css +21 -0
- package/dist/themes/themes.generated.css +20 -0
- package/dist/themes/tokens.d.ts +1 -0
- package/dist/themes/tokens.js +16 -2
- package/package.json +1 -1
package/dist/surface/surface.css
CHANGED
|
@@ -126,12 +126,13 @@
|
|
|
126
126
|
problem (.field-problem), a listing's refusal (.pane-message.danger),
|
|
127
127
|
and a palette's failure note (.palette-failure) lead with the danger
|
|
128
128
|
tone's CircleAlert, drawn as a mask in --danger, so they read as the same status line a notice is, words in --text. A host
|
|
129
|
-
that draws its own glyph first (an svg
|
|
129
|
+
that draws its own glyph first (an svg, inside a PaneMessage's words
|
|
130
|
+
too) gets no second one. */
|
|
130
131
|
:is(
|
|
131
132
|
.field-problem,
|
|
132
133
|
:where(.listing-root) .pane-message.danger,
|
|
133
134
|
:where(.palette-notes) .palette-failure
|
|
134
|
-
):not(:has(> svg:first-child))::before {
|
|
135
|
+
):not(:has(> svg:first-child, > .pane-message-text > svg:first-child))::before {
|
|
135
136
|
content: '';
|
|
136
137
|
flex: none;
|
|
137
138
|
width: var(--icon-md);
|
|
@@ -267,3 +268,139 @@
|
|
|
267
268
|
letter-spacing: var(--tracking-caps);
|
|
268
269
|
text-transform: uppercase;
|
|
269
270
|
}
|
|
271
|
+
|
|
272
|
+
/* ---- Fact table (FactTable, FactRow) ----
|
|
273
|
+
|
|
274
|
+
A short table of facts on a page: a state glyph, a name, a detail, and a
|
|
275
|
+
value a row, the columns shared by every row (a subgrid) and ruled by
|
|
276
|
+
hairlines. The glyph wears its state's text tone, which keeps 4.5:1 on
|
|
277
|
+
every ground; the detail and the value are in the code face, the value
|
|
278
|
+
right-aligned in figures of one width. Its words are content, so they
|
|
279
|
+
can be swept and copied. */
|
|
280
|
+
.fact-table {
|
|
281
|
+
display: grid;
|
|
282
|
+
grid-template-columns: var(--icon-md) minmax(8ch, max-content) minmax(0, 1fr) auto;
|
|
283
|
+
column-gap: var(--space-8);
|
|
284
|
+
border-top: var(--line) solid var(--border);
|
|
285
|
+
font: var(--font-size-small) / var(--line-height-compact) var(--font-ui);
|
|
286
|
+
-webkit-user-select: text;
|
|
287
|
+
user-select: text;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.fact-row {
|
|
291
|
+
display: grid;
|
|
292
|
+
grid-column: 1 / -1;
|
|
293
|
+
grid-template-columns: subgrid;
|
|
294
|
+
align-items: center;
|
|
295
|
+
padding-block: var(--space-3);
|
|
296
|
+
border-bottom: var(--line) solid var(--border);
|
|
297
|
+
color: var(--text);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.fact-state {
|
|
301
|
+
display: inline-flex;
|
|
302
|
+
color: var(--text-dim);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.fact-row[data-tone='ready'] > .fact-state {
|
|
306
|
+
color: var(--success-text);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.fact-row[data-tone='warning'] > .fact-state {
|
|
310
|
+
color: var(--warning-text);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.fact-row[data-tone='danger'] > .fact-state {
|
|
314
|
+
color: var(--danger-text);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.fact-name,
|
|
318
|
+
.fact-detail {
|
|
319
|
+
min-width: 0;
|
|
320
|
+
overflow: hidden;
|
|
321
|
+
text-overflow: ellipsis;
|
|
322
|
+
white-space: nowrap;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
.fact-detail,
|
|
326
|
+
.fact-value {
|
|
327
|
+
font-family: var(--font-mono);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.fact-value {
|
|
331
|
+
justify-self: end;
|
|
332
|
+
font-variant-numeric: tabular-nums;
|
|
333
|
+
white-space: nowrap;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/* ---- Fact list (FactList, Fact, FactColumns) ----
|
|
337
|
+
|
|
338
|
+
A headed list of facts set straight on a page: the overline, then one
|
|
339
|
+
name and value a line, the names in a column of their own (as wide as
|
|
340
|
+
the longest, up to two fifths of the list) in the dim interface face,
|
|
341
|
+
the values beside them in the code face in --text. A long value wraps
|
|
342
|
+
whole as a block beside its name, so its next lines start under its
|
|
343
|
+
first and never under the name; a printed value (`.printed`) keeps its
|
|
344
|
+
line breaks and spaces. The words are content, so they can be swept and
|
|
345
|
+
copied. */
|
|
346
|
+
.fact-list {
|
|
347
|
+
min-width: 0;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.fact-list > .fact-list-title {
|
|
351
|
+
margin: 0 0 var(--space-4);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.fact-list-items {
|
|
355
|
+
display: grid;
|
|
356
|
+
grid-template-columns: fit-content(40%) minmax(0, 1fr);
|
|
357
|
+
column-gap: var(--space-8);
|
|
358
|
+
row-gap: var(--space-2);
|
|
359
|
+
margin: 0;
|
|
360
|
+
font: var(--font-size-small) / var(--line-height-compact) var(--font-ui);
|
|
361
|
+
-webkit-user-select: text;
|
|
362
|
+
user-select: text;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.fact-list-item {
|
|
366
|
+
display: grid;
|
|
367
|
+
grid-column: 1 / -1;
|
|
368
|
+
grid-template-columns: subgrid;
|
|
369
|
+
align-items: baseline;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
.fact-list-name {
|
|
373
|
+
min-width: 0;
|
|
374
|
+
color: var(--text-dim);
|
|
375
|
+
overflow-wrap: break-word;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.fact-list-value {
|
|
379
|
+
min-width: 0;
|
|
380
|
+
margin: 0;
|
|
381
|
+
color: var(--text);
|
|
382
|
+
font-family: var(--font-mono);
|
|
383
|
+
overflow-wrap: anywhere;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.fact-list-value.printed {
|
|
387
|
+
white-space: pre-wrap;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
.fact-list-item[data-tone='danger'] > .fact-list-value {
|
|
391
|
+
color: var(--danger-text);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.fact-list-item[data-tone='warning'] > .fact-list-value {
|
|
395
|
+
color: var(--warning-text);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
/* Lists side by side, as many columns of one width as fit (at least
|
|
399
|
+
26 characters of the interface face each), the lists of a row starting
|
|
400
|
+
on one line, a row's tallest setting where the next row starts. */
|
|
401
|
+
.fact-columns {
|
|
402
|
+
display: grid;
|
|
403
|
+
grid-template-columns: repeat(auto-fill, minmax(min(26em, 100%), 1fr));
|
|
404
|
+
gap: var(--space-8) var(--space-12);
|
|
405
|
+
align-items: start;
|
|
406
|
+
}
|
package/dist/tabs/PageTabs.d.ts
CHANGED
|
@@ -9,6 +9,12 @@ export interface PageTab<Id extends string> {
|
|
|
9
9
|
readonly label: string;
|
|
10
10
|
/** The tab's icon. */
|
|
11
11
|
readonly icon: LucideIcon;
|
|
12
|
+
/**
|
|
13
|
+
* How many things the page holds or asks about ("Updates 2", "Databases
|
|
14
|
+
* 3"), drawn after the name in the dim tone and read as part of the tab's
|
|
15
|
+
* name; none when absent or null. The app formats it for its language.
|
|
16
|
+
*/
|
|
17
|
+
readonly count?: string | number | null;
|
|
12
18
|
}
|
|
13
19
|
/** Props for {@link PageTabs}, over the type of its tab ids. */
|
|
14
20
|
export interface PageTabsProps<Id extends string> {
|
package/dist/tabs/PageTabs.js
CHANGED
|
@@ -212,5 +212,5 @@ export function PageTabs({ label, tabs, current, onSelect, pills = false, look =
|
|
|
212
212
|
pageStrip(strip.current, side);
|
|
213
213
|
}, tabIndex: -1, type: "button", children: _jsx(Icon, { "aria-hidden": true, size: ICON_MD }) }));
|
|
214
214
|
};
|
|
215
|
-
return (_jsxs("div", { className: pills ? 'page-tabs-frame pills' : 'page-tabs-frame', children: [_jsx("div", { "aria-label": label, className: pills ? 'page-tabs pills' : 'page-tabs', onKeyDown: onKeyDown, ref: strip, role: "tablist", children: tabs.map(({ id, label: name, icon: Icon }) => (_jsxs("button", { "aria-label": look === 'icons' ? name : undefined, "aria-selected": id === current, className: "page-tab", "data-page-tab": id, onClick: () => onSelect(id), role: "tab", tabIndex: id === focusable ? 0 : -1, type: "button", ...(look === 'icons' ? tooltip(name) : {}), children: [look !== 'text' && _jsx(Icon, { "aria-hidden": true, size: ICON_MD }), look !== 'icons' && _jsx("span", { "data-label": name, children: name })] }, id))) }), chevron('start'), chevron('end')] }));
|
|
215
|
+
return (_jsxs("div", { className: pills ? 'page-tabs-frame pills' : 'page-tabs-frame', children: [_jsx("div", { "aria-label": label, className: pills ? 'page-tabs pills' : 'page-tabs', onKeyDown: onKeyDown, ref: strip, role: "tablist", children: tabs.map(({ id, label: name, icon: Icon, count = null }) => (_jsxs("button", { "aria-label": look === 'icons' ? (count === null ? name : `${name} ${count}`) : undefined, "aria-selected": id === current, className: "page-tab", "data-page-tab": id, onClick: () => onSelect(id), role: "tab", tabIndex: id === focusable ? 0 : -1, type: "button", ...(look === 'icons' ? tooltip(count === null ? name : `${name} ${count}`) : {}), children: [look !== 'text' && _jsx(Icon, { "aria-hidden": true, size: ICON_MD }), look !== 'icons' && _jsx("span", { "data-label": name, children: name }), look !== 'icons' && count !== null && (_jsx("span", { className: "page-tab-count", "data-label": String(count), children: count }))] }, id))) }), chevron('start'), chevron('end')] }));
|
|
216
216
|
}
|
package/dist/tabs/tabs.css
CHANGED
|
@@ -140,6 +140,20 @@
|
|
|
140
140
|
content: attr(data-label) / '';
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/* A page's count after its name ("Updates 2"): the dim tone in figures of
|
|
144
|
+
one width, so a count that changes moves nothing after it. It keeps the
|
|
145
|
+
width of its bold self too, as the name does. */
|
|
146
|
+
.page-tab > .page-tab-count {
|
|
147
|
+
color: var(--text-dim);
|
|
148
|
+
font-variant-numeric: tabular-nums;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* On the current tab the count takes the current tab's words, which keep
|
|
152
|
+
their contrast on its fill where the dim tone is not held to. */
|
|
153
|
+
.page-tab[aria-selected='true'] > .page-tab-count {
|
|
154
|
+
color: inherit;
|
|
155
|
+
}
|
|
156
|
+
|
|
143
157
|
.page-tab[aria-selected='true'] {
|
|
144
158
|
background: var(--current-bg);
|
|
145
159
|
box-shadow: inset 0 0 0 var(--line) var(--current-ring);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
import { type TerminalProps } from './Terminal.js';
|
|
3
|
+
/** The height of a boxed terminal when none is given: a dialog body's console, in pixels. */
|
|
4
|
+
export declare const TERMINAL_BOX_HEIGHT = 200;
|
|
5
|
+
/** Props for {@link TerminalBox}: a `Terminal`'s, less its layout class, and the box's size. */
|
|
6
|
+
export interface TerminalBoxProps extends Omit<TerminalProps, 'className'> {
|
|
7
|
+
/**
|
|
8
|
+
* Fills the room its parent gives it (a dock, a pane's foot) instead of
|
|
9
|
+
* standing as a framed box of `height`: no frame, the parent's whole
|
|
10
|
+
* height. The parent lays it out as a flex column or row.
|
|
11
|
+
*/
|
|
12
|
+
readonly fill?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The framed box's height in pixels, the same from the first line to the
|
|
15
|
+
* last so the box never grows while output arrives; longer output scrolls
|
|
16
|
+
* inside. `TERMINAL_BOX_HEIGHT` (200) when absent. Ignored with `fill`.
|
|
17
|
+
*/
|
|
18
|
+
readonly height?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A terminal in a box of its own: a framed console of a fixed height in a
|
|
22
|
+
* dialog's body (an install's progress), or one that fills its parent (a
|
|
23
|
+
* dock). Every prop but the layout class is the `Terminal`'s, so a box
|
|
24
|
+
* without `onInput` is read-only: output written through the handle draws
|
|
25
|
+
* in place, a progress line redrawn by a carriage return included, and
|
|
26
|
+
* the user selects and copies it. The box pads the terminal to the
|
|
27
|
+
* library's 12px text inset and paints the terminal's ground behind it.
|
|
28
|
+
* Draws `.terminal-box` (`.fill`), with `--terminal-box-height`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function TerminalBox({ fill, height, ...terminal }: TerminalBoxProps): ReactElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Terminal } from './Terminal.js';
|
|
3
|
+
/** The height of a boxed terminal when none is given: a dialog body's console, in pixels. */
|
|
4
|
+
export const TERMINAL_BOX_HEIGHT = 200;
|
|
5
|
+
/**
|
|
6
|
+
* A terminal in a box of its own: a framed console of a fixed height in a
|
|
7
|
+
* dialog's body (an install's progress), or one that fills its parent (a
|
|
8
|
+
* dock). Every prop but the layout class is the `Terminal`'s, so a box
|
|
9
|
+
* without `onInput` is read-only: output written through the handle draws
|
|
10
|
+
* in place, a progress line redrawn by a carriage return included, and
|
|
11
|
+
* the user selects and copies it. The box pads the terminal to the
|
|
12
|
+
* library's 12px text inset and paints the terminal's ground behind it.
|
|
13
|
+
* Draws `.terminal-box` (`.fill`), with `--terminal-box-height`.
|
|
14
|
+
*/
|
|
15
|
+
export function TerminalBox({ fill = false, height = TERMINAL_BOX_HEIGHT, ...terminal }) {
|
|
16
|
+
return (_jsx("div", { className: fill ? 'terminal-box fill' : 'terminal-box', style: fill ? undefined : { '--terminal-box-height': `${height}px` }, children: _jsx(Terminal, { ...terminal, className: "terminal-box-screen" }) }));
|
|
17
|
+
}
|
|
@@ -4,10 +4,18 @@
|
|
|
4
4
|
* ABI into plain values. Every handle is freed by `dispose`.
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
* How many terminals one page
|
|
8
|
-
*
|
|
9
|
-
* shares one WebAssembly memory, which wasm32 caps
|
|
10
|
-
* terminal's history ceiling is
|
|
7
|
+
* How many terminals one page is budgeted for (17: sixteen interactive
|
|
8
|
+
* terminals and one read-only log), exported as `BUDGETED_TERMINALS_PER_PAGE`.
|
|
9
|
+
* Every terminal on a page shares one WebAssembly memory, which wasm32 caps
|
|
10
|
+
* at 4 GiB, so each terminal's history ceiling is this share of 3 GiB: up to
|
|
11
|
+
* this many terminals, every history may fill to its ceiling and the shared
|
|
12
|
+
* memory still holds. A page may show more, but past this count the
|
|
13
|
+
* guarantee is gone: should enough of them fill their histories to the
|
|
14
|
+
* ceiling (50,000 lines on a grid wider than about 445 columns), the shared
|
|
15
|
+
* memory runs out and the engine cannot allocate. At ordinary lengths a
|
|
16
|
+
* history stays far under its ceiling (about 7.4 MiB for 10,000 lines at 80
|
|
17
|
+
* columns), so an app that opens a terminal per tab can test its own limit
|
|
18
|
+
* against this count.
|
|
11
19
|
*/
|
|
12
20
|
export declare const GHOSTTY_BUDGETED_TERMINALS = 17;
|
|
13
21
|
/** Ghostty's cell width classes: a wide glyph's second column is its spacer tail. */
|
|
@@ -7,10 +7,18 @@ import { ghosttyConsumedMods, ghosttyKeyForCode, ghosttyUnshiftedCodepoint } fro
|
|
|
7
7
|
import { GhosttyRuntime, loadGhosttyRuntime } from './runtime.js';
|
|
8
8
|
import { ENGINE_DEFAULT_BACKGROUND, ENGINE_DEFAULT_FOREGROUND } from './fallbackColors.js';
|
|
9
9
|
/**
|
|
10
|
-
* How many terminals one page
|
|
11
|
-
*
|
|
12
|
-
* shares one WebAssembly memory, which wasm32 caps
|
|
13
|
-
* terminal's history ceiling is
|
|
10
|
+
* How many terminals one page is budgeted for (17: sixteen interactive
|
|
11
|
+
* terminals and one read-only log), exported as `BUDGETED_TERMINALS_PER_PAGE`.
|
|
12
|
+
* Every terminal on a page shares one WebAssembly memory, which wasm32 caps
|
|
13
|
+
* at 4 GiB, so each terminal's history ceiling is this share of 3 GiB: up to
|
|
14
|
+
* this many terminals, every history may fill to its ceiling and the shared
|
|
15
|
+
* memory still holds. A page may show more, but past this count the
|
|
16
|
+
* guarantee is gone: should enough of them fill their histories to the
|
|
17
|
+
* ceiling (50,000 lines on a grid wider than about 445 columns), the shared
|
|
18
|
+
* memory runs out and the engine cannot allocate. At ordinary lengths a
|
|
19
|
+
* history stays far under its ceiling (about 7.4 MiB for 10,000 lines at 80
|
|
20
|
+
* columns), so an app that opens a terminal per tab can test its own limit
|
|
21
|
+
* against this count.
|
|
14
22
|
*/
|
|
15
23
|
export const GHOSTTY_BUDGETED_TERMINALS = 17;
|
|
16
24
|
const GHOSTTY_SUCCESS = 0;
|
package/dist/terminal/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The terminal: `Terminal`, Ghostty's VT engine as WebAssembly drawn on a
|
|
3
|
-
* canvas, with its Copy and Paste menu
|
|
4
|
-
*
|
|
3
|
+
* canvas, with its Copy and Paste menu, `TerminalBox` (a framed console of
|
|
4
|
+
* a fixed height, or one that fills its parent), the scrollback length every
|
|
5
|
+
* terminal under `TerminalScrollbackContext` keeps, and how many terminals
|
|
6
|
+
* one page's shared engine memory is budgeted for. Imported on its own as
|
|
5
7
|
* `@bigpixelrocket/uiok/terminal`, never from the package root, so an app
|
|
6
8
|
* that shows no terminal never loads the engine; its look is terminal.css,
|
|
7
9
|
* which the base stylesheet imports.
|
|
8
10
|
*/
|
|
9
11
|
export { Terminal, type TerminalHandle, type TerminalProps, type TerminalSize } from './Terminal.js';
|
|
12
|
+
export { TERMINAL_BOX_HEIGHT, TerminalBox, type TerminalBoxProps } from './TerminalBox.js';
|
|
10
13
|
export { type TerminalAction, type TerminalKeyStroke } from './Terminal.logic.js';
|
|
11
14
|
export { DEFAULT_TERMINAL_MENU_CHORDS, type TerminalMenuChords } from './TerminalMenu.logic.js';
|
|
12
15
|
export { DEFAULT_TERMINAL_SCROLLBACK_LINES, TerminalScrollbackContext } from './TerminalScrollback.js';
|
|
16
|
+
export { GHOSTTY_BUDGETED_TERMINALS as BUDGETED_TERMINALS_PER_PAGE } from './ghostty/core.js';
|
package/dist/terminal/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The terminal: `Terminal`, Ghostty's VT engine as WebAssembly drawn on a
|
|
3
|
-
* canvas, with its Copy and Paste menu
|
|
4
|
-
*
|
|
3
|
+
* canvas, with its Copy and Paste menu, `TerminalBox` (a framed console of
|
|
4
|
+
* a fixed height, or one that fills its parent), the scrollback length every
|
|
5
|
+
* terminal under `TerminalScrollbackContext` keeps, and how many terminals
|
|
6
|
+
* one page's shared engine memory is budgeted for. Imported on its own as
|
|
5
7
|
* `@bigpixelrocket/uiok/terminal`, never from the package root, so an app
|
|
6
8
|
* that shows no terminal never loads the engine; its look is terminal.css,
|
|
7
9
|
* which the base stylesheet imports.
|
|
8
10
|
*/
|
|
9
11
|
export { Terminal } from './Terminal.js';
|
|
12
|
+
export { TERMINAL_BOX_HEIGHT, TerminalBox } from './TerminalBox.js';
|
|
10
13
|
export {} from './Terminal.logic.js';
|
|
11
14
|
export { DEFAULT_TERMINAL_MENU_CHORDS } from './TerminalMenu.logic.js';
|
|
12
15
|
export { DEFAULT_TERMINAL_SCROLLBACK_LINES, TerminalScrollbackContext } from './TerminalScrollback.js';
|
|
16
|
+
export { GHOSTTY_BUDGETED_TERMINALS as BUDGETED_TERMINALS_PER_PAGE } from './ghostty/core.js';
|
|
@@ -193,3 +193,32 @@
|
|
|
193
193
|
animation: none;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
+
|
|
197
|
+
/* A terminal in a box of its own (TerminalBox). Framed, it is a console of
|
|
198
|
+
a fixed height (--terminal-box-height, which the component sets) in the
|
|
199
|
+
strong hairline a well wears, on the terminal's ground; filling, it
|
|
200
|
+
takes its parent's room with no frame. Either way it pads the mount by
|
|
201
|
+
the 8px every host adds, so the text starts 12px in. */
|
|
202
|
+
.terminal-box {
|
|
203
|
+
display: flex;
|
|
204
|
+
flex: none;
|
|
205
|
+
min-width: 0;
|
|
206
|
+
height: var(--terminal-box-height);
|
|
207
|
+
padding: var(--space-4);
|
|
208
|
+
overflow: hidden;
|
|
209
|
+
border: var(--line) solid var(--border-strong);
|
|
210
|
+
border-radius: var(--radius-md);
|
|
211
|
+
background: var(--terminal-bg);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.terminal-box.fill {
|
|
215
|
+
flex: 1 1 auto;
|
|
216
|
+
min-height: 0;
|
|
217
|
+
height: auto;
|
|
218
|
+
border: none;
|
|
219
|
+
border-radius: 0;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.terminal-box > .terminal-box-screen {
|
|
223
|
+
flex: 1;
|
|
224
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
2
|
+
/** Props for {@link Code}. */
|
|
3
|
+
export interface CodeProps {
|
|
4
|
+
/** The command, path, name, or value, as the user would type or see it: `brew services list`. */
|
|
5
|
+
readonly children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A command, a path, or a name inside a sentence (a note, a field's help,
|
|
9
|
+
* a notice): the code face at the size of the words round it, on a faint
|
|
10
|
+
* track with rounded ends, in the text tone, so it reads as something to
|
|
11
|
+
* type or find, never as a link. A long one wraps anywhere, each line
|
|
12
|
+
* keeping its padding and ends. It can be swept and copied with the
|
|
13
|
+
* sentence. Draws `code.inline-code`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Code({ children }: CodeProps): ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* A command, a path, or a name inside a sentence (a note, a field's help,
|
|
4
|
+
* a notice): the code face at the size of the words round it, on a faint
|
|
5
|
+
* track with rounded ends, in the text tone, so it reads as something to
|
|
6
|
+
* type or find, never as a link. A long one wraps anywhere, each line
|
|
7
|
+
* keeping its padding and ends. It can be swept and copied with the
|
|
8
|
+
* sentence. Draws `code.inline-code`.
|
|
9
|
+
*/
|
|
10
|
+
export function Code({ children }) {
|
|
11
|
+
return _jsx("code", { className: "inline-code", children: children });
|
|
12
|
+
}
|
package/dist/text/index.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Text parts: `MarkedText` tints the characters a match hit, from the runs
|
|
3
|
+
* `highlightSegments` splits; `Code` sets a command or a path inside a
|
|
4
|
+
* sentence.
|
|
5
|
+
*/
|
|
6
|
+
export { Code, type CodeProps } from './Code.js';
|
|
2
7
|
export { highlightSegments, type HighlightSegment } from './highlightSegments.js';
|
|
3
8
|
export { MarkedText, type MarkedTextProps } from './MarkedText.js';
|
package/dist/text/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Text parts: `MarkedText` tints the characters a match hit, from the runs
|
|
3
|
+
* `highlightSegments` splits; `Code` sets a command or a path inside a
|
|
4
|
+
* sentence.
|
|
5
|
+
*/
|
|
6
|
+
export { Code } from './Code.js';
|
|
2
7
|
export { highlightSegments } from './highlightSegments.js';
|
|
3
8
|
export { MarkedText } from './MarkedText.js';
|
package/dist/text/text.css
CHANGED
|
@@ -18,3 +18,24 @@
|
|
|
18
18
|
background: var(--match-bg);
|
|
19
19
|
box-shadow: inset 0 calc(-1 * var(--line-strong)) 0 var(--match-mark);
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
/* ---- Inline code (Code) ----
|
|
23
|
+
|
|
24
|
+
A command, a path, or a name inside a sentence: the code face at the
|
|
25
|
+
size of the words round it, on the control track's faint wash, in the
|
|
26
|
+
text tone (never the accent, which reads as a link). It wraps anywhere,
|
|
27
|
+
and each line of a wrapped one keeps its padding and its rounded ends.
|
|
28
|
+
It is content, so a user can sweep and copy it. */
|
|
29
|
+
.inline-code {
|
|
30
|
+
padding: 0 var(--space-2);
|
|
31
|
+
border-radius: var(--radius-xs);
|
|
32
|
+
background: var(--control-track);
|
|
33
|
+
color: var(--text);
|
|
34
|
+
font-family: var(--font-mono);
|
|
35
|
+
font-size: inherit;
|
|
36
|
+
overflow-wrap: anywhere;
|
|
37
|
+
-webkit-box-decoration-break: clone;
|
|
38
|
+
box-decoration-break: clone;
|
|
39
|
+
-webkit-user-select: text;
|
|
40
|
+
user-select: text;
|
|
41
|
+
}
|
|
@@ -96,6 +96,7 @@
|
|
|
96
96
|
--cursor-row-bg: #dae3f4;
|
|
97
97
|
--row-meta-text: #5c5f77;
|
|
98
98
|
--glass-edge: rgb(255 255 255 / 60%);
|
|
99
|
+
--product-mark-mix: 100%;
|
|
99
100
|
--hover-wash: rgb(255 255 255 / 50%);
|
|
100
101
|
--pressed-wash: rgb(0 0 0 / 7%);
|
|
101
102
|
--well-shade: rgb(0 0 0 / 7%);
|
|
@@ -234,6 +235,7 @@
|
|
|
234
235
|
--cursor-row-bg: #2d334b;
|
|
235
236
|
--row-meta-text: #9399b2;
|
|
236
237
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
238
|
+
--product-mark-mix: 78%;
|
|
237
239
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
238
240
|
--pressed-wash: rgb(205 214 244 / 12%);
|
|
239
241
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -374,6 +376,7 @@
|
|
|
374
376
|
--cursor-row-bg: #dae3f4;
|
|
375
377
|
--row-meta-text: #5c5f77;
|
|
376
378
|
--glass-edge: rgb(255 255 255 / 60%);
|
|
379
|
+
--product-mark-mix: 100%;
|
|
377
380
|
--hover-wash: rgb(255 255 255 / 50%);
|
|
378
381
|
--pressed-wash: rgb(0 0 0 / 7%);
|
|
379
382
|
--well-shade: rgb(0 0 0 / 7%);
|
|
@@ -511,6 +514,7 @@
|
|
|
511
514
|
--cursor-row-bg: #e6f0fb;
|
|
512
515
|
--row-meta-text: #57606a;
|
|
513
516
|
--glass-edge: rgb(255 255 255 / 60%);
|
|
517
|
+
--product-mark-mix: 100%;
|
|
514
518
|
--hover-wash: rgb(31 35 40 / 3%);
|
|
515
519
|
--pressed-wash: rgb(0 0 0 / 8%);
|
|
516
520
|
--well-shade: rgb(0 0 0 / 7%);
|
|
@@ -648,6 +652,7 @@
|
|
|
648
652
|
--cursor-row-bg: #e9e5bc;
|
|
649
653
|
--row-meta-text: #665c54;
|
|
650
654
|
--glass-edge: rgb(255 255 255 / 60%);
|
|
655
|
+
--product-mark-mix: 100%;
|
|
651
656
|
--hover-wash: rgb(255 255 255 / 50%);
|
|
652
657
|
--pressed-wash: rgb(0 0 0 / 7%);
|
|
653
658
|
--well-shade: rgb(0 0 0 / 7%);
|
|
@@ -785,6 +790,7 @@
|
|
|
785
790
|
--cursor-row-bg: #e7ebf6;
|
|
786
791
|
--row-meta-text: #595b66;
|
|
787
792
|
--glass-edge: rgb(255 255 255 / 60%);
|
|
793
|
+
--product-mark-mix: 100%;
|
|
788
794
|
--hover-wash: rgb(56 58 66 / 3%);
|
|
789
795
|
--pressed-wash: rgb(0 0 0 / 8%);
|
|
790
796
|
--well-shade: rgb(0 0 0 / 7%);
|
|
@@ -922,6 +928,7 @@
|
|
|
922
928
|
--cursor-row-bg: #e5e6e2;
|
|
923
929
|
--row-meta-text: #656083;
|
|
924
930
|
--glass-edge: rgb(255 255 255 / 60%);
|
|
931
|
+
--product-mark-mix: 100%;
|
|
925
932
|
--hover-wash: rgb(255 255 255 / 58%);
|
|
926
933
|
--pressed-wash: rgb(0 0 0 / 7%);
|
|
927
934
|
--well-shade: rgb(0 0 0 / 7%);
|
|
@@ -1059,6 +1066,7 @@
|
|
|
1059
1066
|
--cursor-row-bg: #e7eadf;
|
|
1060
1067
|
--row-meta-text: #47626a;
|
|
1061
1068
|
--glass-edge: rgb(255 255 255 / 60%);
|
|
1069
|
+
--product-mark-mix: 100%;
|
|
1062
1070
|
--hover-wash: rgb(255 255 255 / 50%);
|
|
1063
1071
|
--pressed-wash: rgb(0 0 0 / 2%);
|
|
1064
1072
|
--well-shade: rgb(0 0 0 / 7%);
|
|
@@ -1196,6 +1204,7 @@
|
|
|
1196
1204
|
--cursor-row-bg: #cfd6e5;
|
|
1197
1205
|
--row-meta-text: #4d5a8b;
|
|
1198
1206
|
--glass-edge: rgb(255 255 255 / 60%);
|
|
1207
|
+
--product-mark-mix: 100%;
|
|
1199
1208
|
--hover-wash: rgb(255 255 255 / 50%);
|
|
1200
1209
|
--pressed-wash: rgb(0 0 0 / 5%);
|
|
1201
1210
|
--well-shade: rgb(0 0 0 / 7%);
|
|
@@ -1335,6 +1344,7 @@
|
|
|
1335
1344
|
--cursor-row-bg: #3d455e;
|
|
1336
1345
|
--row-meta-text: #a5adce;
|
|
1337
1346
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
1347
|
+
--product-mark-mix: 78%;
|
|
1338
1348
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
1339
1349
|
--pressed-wash: rgb(0 0 0 / 26%);
|
|
1340
1350
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -1473,6 +1483,7 @@
|
|
|
1473
1483
|
--cursor-row-bg: #323a54;
|
|
1474
1484
|
--row-meta-text: #a5adcb;
|
|
1475
1485
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
1486
|
+
--product-mark-mix: 78%;
|
|
1476
1487
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
1477
1488
|
--pressed-wash: rgb(202 211 245 / 13%);
|
|
1478
1489
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -1611,6 +1622,7 @@
|
|
|
1611
1622
|
--cursor-row-bg: #2d334b;
|
|
1612
1623
|
--row-meta-text: #9399b2;
|
|
1613
1624
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
1625
|
+
--product-mark-mix: 78%;
|
|
1614
1626
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
1615
1627
|
--pressed-wash: rgb(205 214 244 / 12%);
|
|
1616
1628
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -1749,6 +1761,7 @@
|
|
|
1749
1761
|
--cursor-row-bg: #3d3951;
|
|
1750
1762
|
--row-meta-text: #bcc2d3;
|
|
1751
1763
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
1764
|
+
--product-mark-mix: 78%;
|
|
1752
1765
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
1753
1766
|
--pressed-wash: rgb(248 248 242 / 11%);
|
|
1754
1767
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -1887,6 +1900,7 @@
|
|
|
1887
1900
|
--cursor-row-bg: #101e35;
|
|
1888
1901
|
--row-meta-text: #8b949e;
|
|
1889
1902
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
1903
|
+
--product-mark-mix: 78%;
|
|
1890
1904
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
1891
1905
|
--pressed-wash: rgb(230 237 243 / 12%);
|
|
1892
1906
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -2025,6 +2039,7 @@
|
|
|
2025
2039
|
--cursor-row-bg: #313831;
|
|
2026
2040
|
--row-meta-text: #bdae93;
|
|
2027
2041
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
2042
|
+
--product-mark-mix: 78%;
|
|
2028
2043
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
2029
2044
|
--pressed-wash: rgb(0 0 0 / 36%);
|
|
2030
2045
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -2163,6 +2178,7 @@
|
|
|
2163
2178
|
--cursor-row-bg: #3b4854;
|
|
2164
2179
|
--row-meta-text: #adb6c6;
|
|
2165
2180
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
2181
|
+
--product-mark-mix: 78%;
|
|
2166
2182
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
2167
2183
|
--pressed-wash: rgb(0 0 0 / 39%);
|
|
2168
2184
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -2301,6 +2317,7 @@
|
|
|
2301
2317
|
--cursor-row-bg: #303e4e;
|
|
2302
2318
|
--row-meta-text: #9da4b2;
|
|
2303
2319
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
2320
|
+
--product-mark-mix: 78%;
|
|
2304
2321
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
2305
2322
|
--pressed-wash: rgb(0 0 0 / 38%);
|
|
2306
2323
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -2439,6 +2456,7 @@
|
|
|
2439
2456
|
--cursor-row-bg: #312b3f;
|
|
2440
2457
|
--row-meta-text: #908caa;
|
|
2441
2458
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
2459
|
+
--product-mark-mix: 78%;
|
|
2442
2460
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
2443
2461
|
--pressed-wash: rgb(224 222 244 / 12%);
|
|
2444
2462
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -2577,6 +2595,7 @@
|
|
|
2577
2595
|
--cursor-row-bg: #05384c;
|
|
2578
2596
|
--row-meta-text: #93a1a1;
|
|
2579
2597
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
2598
|
+
--product-mark-mix: 78%;
|
|
2580
2599
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
2581
2600
|
--pressed-wash: rgb(147 161 161 / 13%);
|
|
2582
2601
|
--well-shade: rgb(0 0 0 / 24%);
|
|
@@ -2715,6 +2734,7 @@
|
|
|
2715
2734
|
--cursor-row-bg: #272e43;
|
|
2716
2735
|
--row-meta-text: #8e96bc;
|
|
2717
2736
|
--glass-edge: rgb(255 255 255 / 10%);
|
|
2737
|
+
--product-mark-mix: 78%;
|
|
2718
2738
|
--hover-wash: rgb(255 255 255 / 6%);
|
|
2719
2739
|
--pressed-wash: rgb(192 202 245 / 13%);
|
|
2720
2740
|
--well-shade: rgb(0 0 0 / 24%);
|
package/dist/themes/tokens.d.ts
CHANGED
|
@@ -109,6 +109,7 @@ declare function derivedTokens(palette: ThemePalette, terminal: TerminalPalette,
|
|
|
109
109
|
'--cursor-row-bg': `#${string}`;
|
|
110
110
|
'--row-meta-text': `#${string}`;
|
|
111
111
|
'--glass-edge': string;
|
|
112
|
+
'--product-mark-mix': `${number}%`;
|
|
112
113
|
'--hover-wash': string;
|
|
113
114
|
'--pressed-wash': string;
|
|
114
115
|
'--well-shade': string;
|