@bigpixelrocket/uiok 0.0.0-stage → 0.1.1

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.
Files changed (280) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +21 -0
  3. package/NOTICE +569 -0
  4. package/README.md +44 -2
  5. package/dist/VisuallyHidden.d.ts +13 -0
  6. package/dist/VisuallyHidden.js +13 -0
  7. package/dist/activity/ActivityBar.d.ts +29 -0
  8. package/dist/activity/ActivityBar.js +21 -0
  9. package/dist/activity/activity.css +43 -0
  10. package/dist/activity/index.d.ts +2 -0
  11. package/dist/activity/index.js +2 -0
  12. package/dist/button/Button.d.ts +26 -0
  13. package/dist/button/Button.js +14 -0
  14. package/dist/button/IconButton.d.ts +18 -0
  15. package/dist/button/IconButton.js +14 -0
  16. package/dist/button/button.css +95 -0
  17. package/dist/button/index.d.ts +3 -0
  18. package/dist/button/index.js +3 -0
  19. package/dist/charts/Drawing.d.ts +27 -0
  20. package/dist/charts/Drawing.js +117 -0
  21. package/dist/charts/Drawing.logic.d.ts +2 -0
  22. package/dist/charts/Drawing.logic.js +22 -0
  23. package/dist/charts/Line.logic.d.ts +33 -0
  24. package/dist/charts/Line.logic.js +72 -0
  25. package/dist/charts/LineChart.d.ts +34 -0
  26. package/dist/charts/LineChart.js +100 -0
  27. package/dist/charts/Pie.logic.d.ts +16 -0
  28. package/dist/charts/Pie.logic.js +28 -0
  29. package/dist/charts/PieChart.d.ts +20 -0
  30. package/dist/charts/PieChart.js +16 -0
  31. package/dist/charts/ResultChart.d.ts +47 -0
  32. package/dist/charts/ResultChart.js +175 -0
  33. package/dist/charts/ResultChart.logic.d.ts +42 -0
  34. package/dist/charts/ResultChart.logic.js +165 -0
  35. package/dist/charts/Scatter.logic.d.ts +55 -0
  36. package/dist/charts/Scatter.logic.js +134 -0
  37. package/dist/charts/ScatterChart.d.ts +36 -0
  38. package/dist/charts/ScatterChart.js +99 -0
  39. package/dist/charts/charts.css +310 -0
  40. package/dist/charts/index.d.ts +14 -0
  41. package/dist/charts/index.js +11 -0
  42. package/dist/charts/seriesColour.d.ts +2 -0
  43. package/dist/charts/seriesColour.js +8 -0
  44. package/dist/clock/index.d.ts +2 -0
  45. package/dist/clock/index.js +2 -0
  46. package/dist/clock/useClock.d.ts +14 -0
  47. package/dist/clock/useClock.js +57 -0
  48. package/dist/datetime/DateTimePicker.d.ts +50 -0
  49. package/dist/datetime/DateTimePicker.js +98 -0
  50. package/dist/datetime/DateTimePicker.logic.d.ts +59 -0
  51. package/dist/datetime/DateTimePicker.logic.js +103 -0
  52. package/dist/datetime/datetime.css +115 -0
  53. package/dist/datetime/index.d.ts +7 -0
  54. package/dist/datetime/index.js +7 -0
  55. package/dist/dialog/ConfirmDialog.d.ts +73 -0
  56. package/dist/dialog/ConfirmDialog.js +30 -0
  57. package/dist/dialog/DialogLegend.d.ts +21 -0
  58. package/dist/dialog/DialogLegend.js +28 -0
  59. package/dist/dialog/DialogLegend.logic.d.ts +145 -0
  60. package/dist/dialog/DialogLegend.logic.js +71 -0
  61. package/dist/dialog/ModalDialog.d.ts +101 -0
  62. package/dist/dialog/ModalDialog.js +184 -0
  63. package/dist/dialog/dialog.css +283 -0
  64. package/dist/dialog/index.d.ts +8 -0
  65. package/dist/dialog/index.js +8 -0
  66. package/dist/filter/FilterEscape.d.ts +16 -0
  67. package/dist/filter/FilterEscape.js +15 -0
  68. package/dist/filter/FilterIcon.d.ts +8 -0
  69. package/dist/filter/FilterIcon.js +11 -0
  70. package/dist/filter/filter.css +42 -0
  71. package/dist/filter/index.d.ts +3 -0
  72. package/dist/filter/index.js +3 -0
  73. package/dist/grid/DataGrid.d.ts +149 -0
  74. package/dist/grid/DataGrid.js +373 -0
  75. package/dist/grid/DataGrid.logic.d.ts +57 -0
  76. package/dist/grid/DataGrid.logic.js +121 -0
  77. package/dist/grid/grid.css +206 -0
  78. package/dist/grid/index.d.ts +7 -0
  79. package/dist/grid/index.js +7 -0
  80. package/dist/index.d.ts +32 -0
  81. package/dist/index.js +32 -0
  82. package/dist/keyboard/BrowserKeys.d.ts +15 -0
  83. package/dist/keyboard/BrowserKeys.js +28 -0
  84. package/dist/keyboard/KeyChord.logic.d.ts +25 -0
  85. package/dist/keyboard/KeyChord.logic.js +50 -0
  86. package/dist/keyboard/Keyboard.logic.d.ts +84 -0
  87. package/dist/keyboard/Keyboard.logic.js +137 -0
  88. package/dist/keyboard/OverlayWatch.d.ts +28 -0
  89. package/dist/keyboard/OverlayWatch.js +119 -0
  90. package/dist/keyboard/PageSelectAll.d.ts +14 -0
  91. package/dist/keyboard/PageSelectAll.js +22 -0
  92. package/dist/keyboard/index.d.ts +9 -0
  93. package/dist/keyboard/index.js +9 -0
  94. package/dist/keychord/KeyChord.d.ts +16 -0
  95. package/dist/keychord/KeyChord.js +55 -0
  96. package/dist/keychord/index.d.ts +2 -0
  97. package/dist/keychord/index.js +2 -0
  98. package/dist/keychord/keychord.css +41 -0
  99. package/dist/labels/UiokLabels.d.ts +41 -0
  100. package/dist/labels/UiokLabels.js +31 -0
  101. package/dist/labels/UiokProvider.d.ts +44 -0
  102. package/dist/labels/UiokProvider.js +54 -0
  103. package/dist/labels/charts.d.ts +34 -0
  104. package/dist/labels/charts.js +15 -0
  105. package/dist/labels/dateTime.d.ts +32 -0
  106. package/dist/labels/dateTime.js +14 -0
  107. package/dist/labels/dialog.d.ts +18 -0
  108. package/dist/labels/dialog.js +6 -0
  109. package/dist/labels/index.d.ts +13 -0
  110. package/dist/labels/index.js +13 -0
  111. package/dist/labels/keys.d.ts +28 -0
  112. package/dist/labels/keys.js +53 -0
  113. package/dist/labels/legend.d.ts +21 -0
  114. package/dist/labels/legend.js +7 -0
  115. package/dist/labels/listing.d.ts +16 -0
  116. package/dist/labels/listing.js +8 -0
  117. package/dist/labels/pager.d.ts +32 -0
  118. package/dist/labels/pager.js +20 -0
  119. package/dist/labels/palette.d.ts +17 -0
  120. package/dist/labels/palette.js +6 -0
  121. package/dist/labels/selectAll.d.ts +15 -0
  122. package/dist/labels/selectAll.js +6 -0
  123. package/dist/labels/terminal.d.ts +25 -0
  124. package/dist/labels/terminal.js +9 -0
  125. package/dist/legend/KeyLegend.logic.d.ts +84 -0
  126. package/dist/legend/KeyLegend.logic.js +109 -0
  127. package/dist/legend/KeyLegendStrip.d.ts +36 -0
  128. package/dist/legend/KeyLegendStrip.js +82 -0
  129. package/dist/legend/index.d.ts +3 -0
  130. package/dist/legend/index.js +3 -0
  131. package/dist/legend/legend.css +148 -0
  132. package/dist/listing/CurrentDot.d.ts +15 -0
  133. package/dist/listing/CurrentDot.js +13 -0
  134. package/dist/listing/Listing.d.ts +230 -0
  135. package/dist/listing/Listing.js +265 -0
  136. package/dist/listing/PathParts.logic.d.ts +17 -0
  137. package/dist/listing/PathParts.logic.js +18 -0
  138. package/dist/listing/index.d.ts +10 -0
  139. package/dist/listing/index.js +10 -0
  140. package/dist/listing/listing.css +867 -0
  141. package/dist/menu/MenuQuery.logic.d.ts +69 -0
  142. package/dist/menu/MenuQuery.logic.js +75 -0
  143. package/dist/menu/fuzzyMatch.d.ts +31 -0
  144. package/dist/menu/fuzzyMatch.js +296 -0
  145. package/dist/menu/index.d.ts +9 -0
  146. package/dist/menu/index.js +9 -0
  147. package/dist/menu/menu.css +203 -0
  148. package/dist/menu/useBellBeat.d.ts +8 -0
  149. package/dist/menu/useBellBeat.js +26 -0
  150. package/dist/namecut/NameCut.d.ts +22 -0
  151. package/dist/namecut/NameCut.js +28 -0
  152. package/dist/namecut/NameCut.logic.d.ts +51 -0
  153. package/dist/namecut/NameCut.logic.js +120 -0
  154. package/dist/namecut/index.d.ts +3 -0
  155. package/dist/namecut/index.js +3 -0
  156. package/dist/namecut/namecut.css +67 -0
  157. package/dist/pager/Pager.d.ts +37 -0
  158. package/dist/pager/Pager.js +38 -0
  159. package/dist/pager/Pager.logic.d.ts +13 -0
  160. package/dist/pager/Pager.logic.js +63 -0
  161. package/dist/pager/index.d.ts +7 -0
  162. package/dist/pager/index.js +7 -0
  163. package/dist/pager/pager.css +62 -0
  164. package/dist/palette/Palette.d.ts +79 -0
  165. package/dist/palette/Palette.js +60 -0
  166. package/dist/palette/index.d.ts +6 -0
  167. package/dist/palette/index.js +6 -0
  168. package/dist/palette/palette.css +159 -0
  169. package/dist/pane/PaneActions.d.ts +104 -0
  170. package/dist/pane/PaneActions.js +62 -0
  171. package/dist/pane/PaneFrame.d.ts +51 -0
  172. package/dist/pane/PaneFrame.js +28 -0
  173. package/dist/pane/PaneKeys.d.ts +41 -0
  174. package/dist/pane/PaneKeys.js +104 -0
  175. package/dist/pane/PaneKeys.logic.d.ts +95 -0
  176. package/dist/pane/PaneKeys.logic.js +109 -0
  177. package/dist/pane/index.d.ts +11 -0
  178. package/dist/pane/index.js +11 -0
  179. package/dist/pane/usePaneKeys.d.ts +141 -0
  180. package/dist/pane/usePaneKeys.js +313 -0
  181. package/dist/run/RunHeader.d.ts +50 -0
  182. package/dist/run/RunHeader.js +31 -0
  183. package/dist/run/RunProgress.logic.d.ts +29 -0
  184. package/dist/run/RunProgress.logic.js +34 -0
  185. package/dist/run/index.d.ts +3 -0
  186. package/dist/run/index.js +3 -0
  187. package/dist/run/run.css +190 -0
  188. package/dist/segmented/SegmentedChoice.d.ts +22 -0
  189. package/dist/segmented/SegmentedChoice.js +31 -0
  190. package/dist/segmented/index.d.ts +2 -0
  191. package/dist/segmented/index.js +2 -0
  192. package/dist/segmented/segmented.css +49 -0
  193. package/dist/selectall/CheckRange.logic.d.ts +8 -0
  194. package/dist/selectall/CheckRange.logic.js +23 -0
  195. package/dist/selectall/SelectAllBar.d.ts +25 -0
  196. package/dist/selectall/SelectAllBar.js +24 -0
  197. package/dist/selectall/index.d.ts +7 -0
  198. package/dist/selectall/index.js +7 -0
  199. package/dist/selectall/selectall.css +31 -0
  200. package/dist/store/KeepUnchanged.logic.d.ts +19 -0
  201. package/dist/store/KeepUnchanged.logic.js +33 -0
  202. package/dist/store/SameProps.d.ts +15 -0
  203. package/dist/store/SameProps.js +46 -0
  204. package/dist/store/ValueStore.d.ts +17 -0
  205. package/dist/store/ValueStore.js +23 -0
  206. package/dist/store/index.d.ts +8 -0
  207. package/dist/store/index.js +8 -0
  208. package/dist/store/useStableHandlers.d.ts +13 -0
  209. package/dist/store/useStableHandlers.js +22 -0
  210. package/dist/styles.css +85 -0
  211. package/dist/tabs/PageTabs.d.ts +38 -0
  212. package/dist/tabs/PageTabs.js +33 -0
  213. package/dist/tabs/index.d.ts +2 -0
  214. package/dist/tabs/index.js +2 -0
  215. package/dist/tabs/tabs.css +64 -0
  216. package/dist/terminal/Terminal.d.ts +104 -0
  217. package/dist/terminal/Terminal.js +309 -0
  218. package/dist/terminal/Terminal.logic.d.ts +66 -0
  219. package/dist/terminal/Terminal.logic.js +156 -0
  220. package/dist/terminal/TerminalMenu.d.ts +36 -0
  221. package/dist/terminal/TerminalMenu.js +87 -0
  222. package/dist/terminal/TerminalMenu.logic.d.ts +78 -0
  223. package/dist/terminal/TerminalMenu.logic.js +68 -0
  224. package/dist/terminal/TerminalScrollback.d.ts +10 -0
  225. package/dist/terminal/TerminalScrollback.js +11 -0
  226. package/dist/terminal/ghostty/LICENSE +21 -0
  227. package/dist/terminal/ghostty/core.d.ts +315 -0
  228. package/dist/terminal/ghostty/core.js +1189 -0
  229. package/dist/terminal/ghostty/fallbackColors.d.ts +12 -0
  230. package/dist/terminal/ghostty/fallbackColors.js +23 -0
  231. package/dist/terminal/ghostty/fonts/LICENSE +21 -0
  232. package/dist/terminal/ghostty/fonts/SymbolsNerdFontMono-Regular.woff2 +0 -0
  233. package/dist/terminal/ghostty/keyCodes.logic.d.ts +20 -0
  234. package/dist/terminal/ghostty/keyCodes.logic.js +249 -0
  235. package/dist/terminal/ghostty/links.logic.d.ts +39 -0
  236. package/dist/terminal/ghostty/links.logic.js +84 -0
  237. package/dist/terminal/ghostty/renderer.d.ts +98 -0
  238. package/dist/terminal/ghostty/renderer.js +481 -0
  239. package/dist/terminal/ghostty/runtime.d.ts +126 -0
  240. package/dist/terminal/ghostty/runtime.js +346 -0
  241. package/dist/terminal/ghostty/spriteGlyphs.logic.d.ts +64 -0
  242. package/dist/terminal/ghostty/spriteGlyphs.logic.js +546 -0
  243. package/dist/terminal/ghostty/surface.d.ts +285 -0
  244. package/dist/terminal/ghostty/surface.js +1565 -0
  245. package/dist/terminal/ghostty/surface.logic.d.ts +181 -0
  246. package/dist/terminal/ghostty/surface.logic.js +392 -0
  247. package/dist/terminal/ghostty/vendor/LICENSE +21 -0
  248. package/dist/terminal/ghostty/vendor/ghostty-effects.wasm +0 -0
  249. package/dist/terminal/ghostty/vendor/ghostty-vt.wasm +0 -0
  250. package/dist/terminal/index.d.ts +12 -0
  251. package/dist/terminal/index.js +12 -0
  252. package/dist/terminal/terminal.css +169 -0
  253. package/dist/text/MarkedText.d.ts +14 -0
  254. package/dist/text/MarkedText.js +11 -0
  255. package/dist/text/highlightSegments.d.ts +13 -0
  256. package/dist/text/highlightSegments.js +29 -0
  257. package/dist/text/index.d.ts +3 -0
  258. package/dist/text/index.js +3 -0
  259. package/dist/text/text.css +11 -0
  260. package/dist/themes/attributes.d.ts +21 -0
  261. package/dist/themes/attributes.js +41 -0
  262. package/dist/themes/catalog.d.ts +125 -0
  263. package/dist/themes/catalog.js +940 -0
  264. package/dist/themes/color.d.ts +29 -0
  265. package/dist/themes/color.js +52 -0
  266. package/dist/themes/ids.d.ts +139 -0
  267. package/dist/themes/ids.js +59 -0
  268. package/dist/themes/index.d.ts +12 -0
  269. package/dist/themes/index.js +12 -0
  270. package/dist/themes/themes.generated.css +1830 -0
  271. package/dist/themes/tokens.d.ts +189 -0
  272. package/dist/themes/tokens.js +462 -0
  273. package/dist/tooltip/Tooltip.d.ts +21 -0
  274. package/dist/tooltip/Tooltip.js +105 -0
  275. package/dist/tooltip/Tooltip.logic.d.ts +49 -0
  276. package/dist/tooltip/Tooltip.logic.js +50 -0
  277. package/dist/tooltip/index.d.ts +3 -0
  278. package/dist/tooltip/index.js +3 -0
  279. package/dist/tooltip/tooltip.css +45 -0
  280. package/package.json +91 -4
@@ -0,0 +1,181 @@
1
+ /**
2
+ * The terminal surface's pure decisions: font stacks, sizes, and line
3
+ * pitch, cursor blink, the canvas backing store, grid geometry, scrollbar
4
+ * math, link hit testing over snapshot rows, clipboard and IME key
5
+ * classification, mouse reporting, wheel translation, and multi-click
6
+ * counting.
7
+ */
8
+ import type { GhosttyRow, GhosttyScrollbar } from './core.js';
9
+ import type { GhosttyCellMetrics, GhosttyCellRange } from './renderer.js';
10
+ /**
11
+ * The platform's own monospace faces; concrete names only, because an
12
+ * unknown keyword (like ui-monospace) makes canvas font shorthand parsing
13
+ * reject the whole string.
14
+ */
15
+ export declare const DEFAULT_TERMINAL_FONT_FAMILY: string;
16
+ /**
17
+ * A requested family list, quoted for canvas font shorthand and followed by
18
+ * the glyph fallbacks; the default stack when nothing usable is requested.
19
+ * Quoting matters: an unquoted non-ident name ("3270 Nerd Font", "M+ 1m")
20
+ * makes the whole canvas font string invalid and the assignment silently
21
+ * no-ops.
22
+ */
23
+ export declare function terminalFontStack(family?: string): string;
24
+ /** Whether the given family list names no face at all. */
25
+ export declare function isEmptyTerminalFontFamily(family?: string): boolean;
26
+ /** Clamps a requested text size to whole pixels in the supported range. */
27
+ export declare function terminalFontSize(size?: number): number;
28
+ /**
29
+ * The line pitch a cell asks for, in whole pixels: the requested one, or
30
+ * 1.35 times the text size when none is. The cell measurement still grows it
31
+ * to fit a face whose glyphs are taller (`measureGhosttyCell`).
32
+ */
33
+ export declare function terminalLineHeight(fontSize: number, lineHeight?: number): number;
34
+ /**
35
+ * Whether a face's measured glyph advances are all equal. Unmeasurable
36
+ * advances answer true, so a missing measurement never blocks a face.
37
+ */
38
+ export declare function areFontAdvancesMonospace(advances: readonly number[]): boolean;
39
+ /**
40
+ * Whether the cursor should keep toggling. An unfocused surface draws a steady
41
+ * hollow cursor instead of blinking, and a reduced-motion reader gets a steady
42
+ * cursor too rather than a permanently animating element.
43
+ */
44
+ export declare function shouldBlinkTerminalCursor(state: {
45
+ readonly focused: boolean;
46
+ readonly cursorBlinking: boolean;
47
+ readonly cursorVisible: boolean;
48
+ readonly reducedMotion: boolean;
49
+ }): boolean;
50
+ /** A canvas backing store: its size in device pixels and the ratio its transform scales by. */
51
+ export interface TerminalCanvasBacking {
52
+ readonly width: number;
53
+ readonly height: number;
54
+ readonly ratio: number;
55
+ }
56
+ /**
57
+ * The backing store a mount of `cssWidth` by `cssHeight` needs at `ratio`, or
58
+ * null when the installed one already matches. A ratio change alone still needs
59
+ * a new transform, and a fresh canvas (`installed` null) always needs one, even
60
+ * when its default size happens to match.
61
+ */
62
+ export declare function terminalCanvasBackingChange(installed: TerminalCanvasBacking | null, cssWidth: number, cssHeight: number, ratio: number): TerminalCanvasBacking | null;
63
+ /** The scrollbar thumb's size and position in pixels. */
64
+ export interface TerminalScrollbarGeometry {
65
+ readonly thumbHeight: number;
66
+ readonly thumbTop: number;
67
+ readonly maxOffset: number;
68
+ }
69
+ /** The thumb for a scrollback position in a track; null when nothing can scroll. */
70
+ export declare function terminalScrollbarGeometry(state: GhosttyScrollbar, trackHeight: number): TerminalScrollbarGeometry | null;
71
+ /** The scrollback row offset for a thumb dragged to `pointerY`, holding the grab point. */
72
+ export declare function terminalScrollbarOffsetAtPointer(state: GhosttyScrollbar, trackHeight: number, pointerY: number, pointerOffset: number): number;
73
+ /** The viewport cell under a point, or null outside the drawn grid (padding included). */
74
+ export declare function terminalGridCellAt(options: {
75
+ bounds: {
76
+ left: number;
77
+ top: number;
78
+ };
79
+ clientX: number;
80
+ clientY: number;
81
+ cols: number;
82
+ rows: number;
83
+ metrics: Pick<GhosttyCellMetrics, 'width' | 'height'>;
84
+ padding: number;
85
+ }): {
86
+ x: number;
87
+ y: number;
88
+ } | null;
89
+ /** A link and the viewport cells it covers. */
90
+ export interface TerminalLinkWithRange {
91
+ readonly text: string;
92
+ readonly range: GhosttyCellRange;
93
+ }
94
+ /** Whether two hit-tested links are the same link over the same cells. */
95
+ export declare function isSameTerminalLink(left: TerminalLinkWithRange, right: TerminalLinkWithRange | null): boolean;
96
+ /** The URL printed under a viewport cell, rebuilt across soft wraps; null when absent or cut off. */
97
+ export declare function terminalLinkAtPositionWithRange(rows: readonly GhosttyRow[], rowIndex: number, column: number): TerminalLinkWithRange | null;
98
+ /**
99
+ * Command-C copies. Control-C stays the shell's interrupt, and the produced
100
+ * character decides, so a layout that moves C keeps the chord on C.
101
+ */
102
+ export declare function isTerminalCopyShortcut(event: Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'key' | 'metaKey'>): boolean;
103
+ /** Command-V pastes; Control-V stays the shell's literal-next. */
104
+ export declare function isTerminalPasteShortcut(event: Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'key' | 'metaKey'>): boolean;
105
+ /**
106
+ * Canvas terminals have no DOM selection. A copy command run from the Edit
107
+ * menu reads the focused textarea, so an empty IME field would write
108
+ * blankness to the clipboard. Park the Ghostty selection there first.
109
+ */
110
+ export declare function primeTerminalCopyInput(input: Pick<HTMLTextAreaElement, 'value' | 'select'>, selection: string): void;
111
+ /**
112
+ * Only blank the copy we parked. The same textarea holds the IME candidate;
113
+ * wiping whatever is there would cancel CJK composition.
114
+ */
115
+ export declare function clearPrimedTerminalCopyInput(input: Pick<HTMLTextAreaElement, 'value'>, primedSelection: string): void;
116
+ /**
117
+ * A copy event may only be claimed (default prevented) when it actually
118
+ * received the selection; a copy event without clipboardData keeps its
119
+ * native default so the primed textarea is what gets copied.
120
+ */
121
+ export declare function applyTerminalCopyEvent(selection: string, clipboardData: {
122
+ setData: (type: string, data: string) => void;
123
+ } | null | undefined): {
124
+ preventDefault: boolean;
125
+ };
126
+ /** Whether an input event is the browser's follow-up to a finished IME composition. */
127
+ export declare function isTerminalCompositionCommitInput(event: Pick<InputEvent, 'inputType'>): boolean;
128
+ /** IME keydowns must not touch the hidden textarea; it holds the candidate. */
129
+ export declare function isTerminalCompositionKey(event: Pick<KeyboardEvent, 'isComposing' | 'key' | 'keyCode'>, composing: boolean): boolean;
130
+ /** AltGr text arrives through the textarea's input event, not the key encoder. */
131
+ export declare function isTerminalAltGraphText(event: Pick<KeyboardEvent, 'getModifierState' | 'key'>): boolean;
132
+ /**
133
+ * Whether a pointer event goes to the program's mouse reporting. Shift, and
134
+ * the link and copy modifiers, keep the pointer for selection and links.
135
+ */
136
+ export declare function shouldReportTerminalMouse(tracking: boolean, event: Pick<MouseEvent, 'ctrlKey' | 'metaKey' | 'shiftKey'>): boolean;
137
+ /**
138
+ * Whether a press is a secondary click: the right button, or Control with
139
+ * the primary one, which macOS turns into the same `contextmenu`. It asks for
140
+ * the terminal's menu, so it is never a mouse report and never starts or ends
141
+ * a selection, which the menu's Copy then still has.
142
+ */
143
+ export declare function isTerminalSecondaryPress(event: Pick<MouseEvent, 'button' | 'ctrlKey'>): boolean;
144
+ /** A mouse report's kind. */
145
+ export type TerminalMouseAction = 'press' | 'release' | 'motion';
146
+ /** Drops a motion report identical to the last one, so hovering within a cell sends nothing. */
147
+ export declare function resolveTerminalMouseData(action: TerminalMouseAction, data: string, previousMotionData: string): {
148
+ readonly send: boolean;
149
+ readonly nextMotionData: string;
150
+ };
151
+ /** Restarts motion deduplication whenever the program toggles motion tracking. */
152
+ export declare function resolveTerminalMouseTrackingState(previousTracking: boolean, tracking: boolean, motionData: string): {
153
+ readonly tracking: boolean;
154
+ readonly motionData: string;
155
+ };
156
+ /** Converts a wheel delta into whole rows, carrying the fractional remainder forward. */
157
+ export declare function terminalWheelDeltaRows(event: Pick<WheelEvent, 'deltaY' | 'deltaMode'>, cellHeight: number, viewportRows: number, remainder: number): {
158
+ readonly rows: number;
159
+ readonly remainder: number;
160
+ };
161
+ /** Arrow keys standing in for wheel rows on the alternate screen, which has no scrollback. */
162
+ export declare function terminalWheelArrowData(rows: number, applicationCursorKeys: boolean): string;
163
+ /** Ghostty's mouse button for a DOM `button`; null for buttons it does not know. */
164
+ export declare function ghosttyMouseButton(button: number): number | null;
165
+ /** The running click count and where and when the last press landed. */
166
+ export interface TerminalSelectionClickSequence {
167
+ readonly count: number;
168
+ readonly time: number;
169
+ readonly x: number;
170
+ readonly y: number;
171
+ }
172
+ /** Whether a pointer moved far enough from its press to become a drag. */
173
+ export declare function isTerminalPointerDrag(origin: {
174
+ readonly x: number;
175
+ readonly y: number;
176
+ }, event: Pick<PointerEvent, 'clientX' | 'clientY'>): boolean;
177
+ /**
178
+ * Counts stationary presses within the double-click interval (single, word,
179
+ * line, then back to single), since PointerEvent.detail is not reliable.
180
+ */
181
+ export declare function advanceTerminalSelectionClickSequence(previous: TerminalSelectionClickSequence | null, event: Pick<PointerEvent, 'clientX' | 'clientY' | 'timeStamp'>): TerminalSelectionClickSequence;
@@ -0,0 +1,392 @@
1
+ /**
2
+ * The terminal surface's pure decisions: font stacks, sizes, and line
3
+ * pitch, cursor blink, the canvas backing store, grid geometry, scrollbar
4
+ * math, link hit testing over snapshot rows, clipboard and IME key
5
+ * classification, mouse reporting, wheel translation, and multi-click
6
+ * counting.
7
+ */
8
+ import { collectWrappedTerminalLinkLine, extractTerminalLinks } from './links.logic.js';
9
+ /** The terminal's text size in CSS pixels when none is requested. */
10
+ const DEFAULT_TERMINAL_FONT_SIZE = 12;
11
+ const MIN_TERMINAL_FONT_SIZE = 6;
12
+ const MAX_TERMINAL_FONT_SIZE = 32;
13
+ /** A line's height as a multiple of the text size when no line height is requested. */
14
+ const DEFAULT_TERMINAL_LINE_HEIGHT_RATIO = 1.35;
15
+ // The glyph fallbacks only supply symbols the text faces are missing (powerline
16
+ // separators, devicons, and other private-use prompt symbols), so shells
17
+ // configured for a locally installed Nerd Font keep their prompt glyphs no
18
+ // matter which text face is active.
19
+ const TERMINAL_GLYPH_FALLBACKS = '"Symbols Nerd Font Mono", "Symbols Nerd Font", "JetBrainsMono Nerd Font", ' +
20
+ '"JetBrainsMono NF", "FiraCode Nerd Font", "Hack Nerd Font", "MesloLGS NF", ' +
21
+ '"CaskaydiaCove Nerd Font", "PowerlineSymbols", monospace';
22
+ /**
23
+ * The platform's own monospace faces; concrete names only, because an
24
+ * unknown keyword (like ui-monospace) makes canvas font shorthand parsing
25
+ * reject the whole string.
26
+ */
27
+ export const DEFAULT_TERMINAL_FONT_FAMILY = '"SF Mono", "SFMono-Regular", Menlo, ' + TERMINAL_GLYPH_FALLBACKS;
28
+ const MIN_SCROLLBAR_THUMB_HEIGHT = 18;
29
+ /** Two presses within this many milliseconds count as a double click. */
30
+ const SELECTION_MULTI_CLICK_INTERVAL_MS = 500;
31
+ const TERMINAL_LINK_DRAG_THRESHOLD_PX = 4;
32
+ const MONOSPACE_ADVANCE_TOLERANCE = 0.01;
33
+ function quoteTerminalFontFamilies(list) {
34
+ return list
35
+ .split(',')
36
+ .map((name) => {
37
+ const bare = name.trim();
38
+ if (bare.length === 0)
39
+ return '';
40
+ if (/^(['"]).*\1$/.test(bare))
41
+ return bare;
42
+ if (/^[a-zA-Z][a-zA-Z0-9-]*$/.test(bare))
43
+ return bare;
44
+ return `"${bare.replaceAll('"', '')}"`;
45
+ })
46
+ .filter((name) => name.length > 0)
47
+ .join(', ');
48
+ }
49
+ /**
50
+ * A requested family list, quoted for canvas font shorthand and followed by
51
+ * the glyph fallbacks; the default stack when nothing usable is requested.
52
+ * Quoting matters: an unquoted non-ident name ("3270 Nerd Font", "M+ 1m")
53
+ * makes the whole canvas font string invalid and the assignment silently
54
+ * no-ops.
55
+ */
56
+ export function terminalFontStack(family) {
57
+ const custom = family === undefined ? '' : quoteTerminalFontFamilies(family);
58
+ return custom.length === 0
59
+ ? DEFAULT_TERMINAL_FONT_FAMILY
60
+ : `${custom}, ${TERMINAL_GLYPH_FALLBACKS}`;
61
+ }
62
+ /** Whether the given family list names no face at all. */
63
+ export function isEmptyTerminalFontFamily(family) {
64
+ return family === undefined || quoteTerminalFontFamilies(family).length === 0;
65
+ }
66
+ /** Clamps a requested text size to whole pixels in the supported range. */
67
+ export function terminalFontSize(size) {
68
+ if (size === undefined || !Number.isFinite(size))
69
+ return DEFAULT_TERMINAL_FONT_SIZE;
70
+ return Math.max(MIN_TERMINAL_FONT_SIZE, Math.min(MAX_TERMINAL_FONT_SIZE, Math.round(size)));
71
+ }
72
+ /**
73
+ * The line pitch a cell asks for, in whole pixels: the requested one, or
74
+ * 1.35 times the text size when none is. The cell measurement still grows it
75
+ * to fit a face whose glyphs are taller (`measureGhosttyCell`).
76
+ */
77
+ export function terminalLineHeight(fontSize, lineHeight) {
78
+ if (lineHeight === undefined || !Number.isFinite(lineHeight)) {
79
+ return Math.round(fontSize * DEFAULT_TERMINAL_LINE_HEIGHT_RATIO);
80
+ }
81
+ return Math.max(1, Math.round(lineHeight));
82
+ }
83
+ /**
84
+ * Whether a face's measured glyph advances are all equal. Unmeasurable
85
+ * advances answer true, so a missing measurement never blocks a face.
86
+ */
87
+ export function areFontAdvancesMonospace(advances) {
88
+ const reference = advances[0];
89
+ if (reference === undefined ||
90
+ reference <= 0 ||
91
+ advances.some((advance) => !Number.isFinite(advance) || advance <= 0)) {
92
+ return true;
93
+ }
94
+ return advances.every((advance) => Math.abs(advance - reference) < MONOSPACE_ADVANCE_TOLERANCE);
95
+ }
96
+ /**
97
+ * Whether the cursor should keep toggling. An unfocused surface draws a steady
98
+ * hollow cursor instead of blinking, and a reduced-motion reader gets a steady
99
+ * cursor too rather than a permanently animating element.
100
+ */
101
+ export function shouldBlinkTerminalCursor(state) {
102
+ return state.focused && state.cursorBlinking && state.cursorVisible && !state.reducedMotion;
103
+ }
104
+ /**
105
+ * The backing store a mount of `cssWidth` by `cssHeight` needs at `ratio`, or
106
+ * null when the installed one already matches. A ratio change alone still needs
107
+ * a new transform, and a fresh canvas (`installed` null) always needs one, even
108
+ * when its default size happens to match.
109
+ */
110
+ export function terminalCanvasBackingChange(installed, cssWidth, cssHeight, ratio) {
111
+ const width = Math.max(1, Math.round(cssWidth * ratio));
112
+ const height = Math.max(1, Math.round(cssHeight * ratio));
113
+ if (installed !== null &&
114
+ installed.width === width &&
115
+ installed.height === height &&
116
+ installed.ratio === ratio) {
117
+ return null;
118
+ }
119
+ return { width, height, ratio };
120
+ }
121
+ /** The thumb for a scrollback position in a track; null when nothing can scroll. */
122
+ export function terminalScrollbarGeometry(state, trackHeight) {
123
+ const total = Math.max(0, state.total);
124
+ const len = Math.max(0, Math.min(state.len, total));
125
+ const maxOffset = Math.max(0, total - len);
126
+ if (trackHeight <= 0 || len <= 0 || maxOffset === 0)
127
+ return null;
128
+ const thumbHeight = Math.min(trackHeight, Math.max(MIN_SCROLLBAR_THUMB_HEIGHT, (trackHeight * len) / total));
129
+ const travel = Math.max(0, trackHeight - thumbHeight);
130
+ const offset = Math.max(0, Math.min(state.offset, maxOffset));
131
+ return {
132
+ thumbHeight,
133
+ thumbTop: travel * (offset / maxOffset),
134
+ maxOffset
135
+ };
136
+ }
137
+ /** The scrollback row offset for a thumb dragged to `pointerY`, holding the grab point. */
138
+ export function terminalScrollbarOffsetAtPointer(state, trackHeight, pointerY, pointerOffset) {
139
+ const geometry = terminalScrollbarGeometry(state, trackHeight);
140
+ if (geometry === null)
141
+ return 0;
142
+ const travel = Math.max(0, trackHeight - geometry.thumbHeight);
143
+ if (travel === 0)
144
+ return 0;
145
+ const thumbTop = Math.max(0, Math.min(pointerY - pointerOffset, travel));
146
+ return Math.round((thumbTop / travel) * geometry.maxOffset);
147
+ }
148
+ /** The viewport cell under a point, or null outside the drawn grid (padding included). */
149
+ export function terminalGridCellAt(options) {
150
+ const { bounds, clientX, clientY, cols, rows, metrics, padding } = options;
151
+ const gridX = clientX - bounds.left - padding;
152
+ const gridY = clientY - bounds.top - padding;
153
+ if (gridX < 0 || gridY < 0 || gridX >= cols * metrics.width || gridY >= rows * metrics.height) {
154
+ return null;
155
+ }
156
+ return {
157
+ x: Math.floor(gridX / metrics.width),
158
+ y: Math.floor(gridY / metrics.height)
159
+ };
160
+ }
161
+ function terminalRowText(row, trimRight) {
162
+ const text = row.cells.map((cell) => cell.text || ' ').join('');
163
+ return trimRight ? text.trimEnd() : text;
164
+ }
165
+ function terminalColumnOffset(row, column) {
166
+ let offset = 0;
167
+ for (let cellIndex = 0; cellIndex < column; cellIndex += 1) {
168
+ offset += row.cells[cellIndex]?.text.length || 1;
169
+ }
170
+ return offset;
171
+ }
172
+ /** Whether two hit-tested links are the same link over the same cells. */
173
+ export function isSameTerminalLink(left, right) {
174
+ return (right?.text === left.text &&
175
+ right.range.start.x === left.range.start.x &&
176
+ right.range.start.y === left.range.start.y &&
177
+ right.range.end.x === left.range.end.x &&
178
+ right.range.end.y === left.range.end.y);
179
+ }
180
+ function terminalColumnAtOffset(row, offset) {
181
+ for (let column = 0; column < row.cells.length; column += 1) {
182
+ const nextOffset = terminalColumnOffset(row, column + 1);
183
+ if (offset < nextOffset)
184
+ return column;
185
+ }
186
+ return Math.max(0, row.cells.length - 1);
187
+ }
188
+ /** The URL printed under a viewport cell, rebuilt across soft wraps; null when absent or cut off. */
189
+ export function terminalLinkAtPositionWithRange(rows, rowIndex, column) {
190
+ const wrappedLine = collectWrappedTerminalLinkLine(rowIndex + 1, (index) => {
191
+ const row = rows[index];
192
+ if (!row)
193
+ return null;
194
+ return {
195
+ isWrapped: row.isWrapContinuation,
196
+ translateToString: (trimRight = false) => terminalRowText(row, trimRight)
197
+ };
198
+ });
199
+ if (!wrappedLine)
200
+ return null;
201
+ // Only viewport rows are available: a wrapped line whose head scrolled above
202
+ // the viewport would resolve a truncated match into a wrong link.
203
+ const firstSegment = wrappedLine.segments[0];
204
+ if (firstSegment && rows[firstSegment.bufferLineNumber - 1]?.isWrapContinuation) {
205
+ return null;
206
+ }
207
+ const segment = wrappedLine.segments.find((value) => value.bufferLineNumber === rowIndex + 1);
208
+ const row = rows[rowIndex];
209
+ if (!segment || !row)
210
+ return null;
211
+ const lastSegment = wrappedLine.segments.at(-1);
212
+ const lastRow = lastSegment ? rows[lastSegment.bufferLineNumber - 1] : undefined;
213
+ // Ghostty's soft-wrap flag is authoritative: when the last collected row
214
+ // still wraps onward, its continuation is outside the viewport.
215
+ const continuesBelowViewport = lastRow !== undefined && lastRow.wrapsToNext;
216
+ const offset = segment.startIndex + terminalColumnOffset(row, column);
217
+ for (const match of extractTerminalLinks(wrappedLine.text)) {
218
+ if (offset >= match.start && offset < match.end) {
219
+ // A truncated tail must not activate as a complete link.
220
+ if (match.end === wrappedLine.text.length && continuesBelowViewport)
221
+ return null;
222
+ const startSegment = wrappedLine.segments.find((value) => match.start >= value.startIndex && match.start < value.endIndex);
223
+ const endSegment = wrappedLine.segments.find((value) => match.end - 1 >= value.startIndex && match.end - 1 < value.endIndex);
224
+ const startRow = startSegment ? rows[startSegment.bufferLineNumber - 1] : undefined;
225
+ const endRow = endSegment ? rows[endSegment.bufferLineNumber - 1] : undefined;
226
+ if (!startSegment || !endSegment || !startRow || !endRow)
227
+ return null;
228
+ return {
229
+ text: match.text,
230
+ range: {
231
+ start: {
232
+ x: terminalColumnAtOffset(startRow, match.start - startSegment.startIndex),
233
+ y: startSegment.bufferLineNumber - 1
234
+ },
235
+ end: {
236
+ x: terminalColumnAtOffset(endRow, match.end - 1 - endSegment.startIndex),
237
+ y: endSegment.bufferLineNumber - 1
238
+ }
239
+ }
240
+ };
241
+ }
242
+ }
243
+ return null;
244
+ }
245
+ /**
246
+ * Command-C copies. Control-C stays the shell's interrupt, and the produced
247
+ * character decides, so a layout that moves C keeps the chord on C.
248
+ */
249
+ export function isTerminalCopyShortcut(event) {
250
+ return event.metaKey && !event.ctrlKey && !event.altKey && event.key.toLowerCase() === 'c';
251
+ }
252
+ /** Command-V pastes; Control-V stays the shell's literal-next. */
253
+ export function isTerminalPasteShortcut(event) {
254
+ return event.metaKey && !event.ctrlKey && !event.altKey && event.key.toLowerCase() === 'v';
255
+ }
256
+ /**
257
+ * Canvas terminals have no DOM selection. A copy command run from the Edit
258
+ * menu reads the focused textarea, so an empty IME field would write
259
+ * blankness to the clipboard. Park the Ghostty selection there first.
260
+ */
261
+ export function primeTerminalCopyInput(input, selection) {
262
+ input.value = selection;
263
+ if (selection.length === 0)
264
+ return;
265
+ input.select();
266
+ }
267
+ /**
268
+ * Only blank the copy we parked. The same textarea holds the IME candidate;
269
+ * wiping whatever is there would cancel CJK composition.
270
+ */
271
+ export function clearPrimedTerminalCopyInput(input, primedSelection) {
272
+ if (primedSelection.length === 0 || input.value !== primedSelection)
273
+ return;
274
+ input.value = '';
275
+ }
276
+ /**
277
+ * A copy event may only be claimed (default prevented) when it actually
278
+ * received the selection; a copy event without clipboardData keeps its
279
+ * native default so the primed textarea is what gets copied.
280
+ */
281
+ export function applyTerminalCopyEvent(selection, clipboardData) {
282
+ if (selection.length === 0 || !clipboardData)
283
+ return { preventDefault: false };
284
+ clipboardData.setData('text/plain', selection);
285
+ return { preventDefault: true };
286
+ }
287
+ /** Whether an input event is the browser's follow-up to a finished IME composition. */
288
+ export function isTerminalCompositionCommitInput(event) {
289
+ return (event.inputType === '' ||
290
+ event.inputType === 'insertCompositionText' ||
291
+ event.inputType === 'insertFromComposition');
292
+ }
293
+ /** IME keydowns must not touch the hidden textarea; it holds the candidate. */
294
+ export function isTerminalCompositionKey(event, composing) {
295
+ return event.isComposing || composing || event.key === 'Process' || event.keyCode === 229;
296
+ }
297
+ /** AltGr text arrives through the textarea's input event, not the key encoder. */
298
+ export function isTerminalAltGraphText(event) {
299
+ return event.getModifierState('AltGraph') && [...event.key].length === 1;
300
+ }
301
+ /**
302
+ * Whether a pointer event goes to the program's mouse reporting. Shift, and
303
+ * the link and copy modifiers, keep the pointer for selection and links.
304
+ */
305
+ export function shouldReportTerminalMouse(tracking, event) {
306
+ return tracking && !event.shiftKey && !event.ctrlKey && !event.metaKey;
307
+ }
308
+ /**
309
+ * Whether a press is a secondary click: the right button, or Control with
310
+ * the primary one, which macOS turns into the same `contextmenu`. It asks for
311
+ * the terminal's menu, so it is never a mouse report and never starts or ends
312
+ * a selection, which the menu's Copy then still has.
313
+ */
314
+ export function isTerminalSecondaryPress(event) {
315
+ return event.button === 2 || (event.button === 0 && event.ctrlKey);
316
+ }
317
+ /** Drops a motion report identical to the last one, so hovering within a cell sends nothing. */
318
+ export function resolveTerminalMouseData(action, data, previousMotionData) {
319
+ const nextMotionData = action === 'motion' ? data : '';
320
+ return {
321
+ send: data.length > 0 && (action !== 'motion' || data !== previousMotionData),
322
+ nextMotionData
323
+ };
324
+ }
325
+ /** Restarts motion deduplication whenever the program toggles motion tracking. */
326
+ export function resolveTerminalMouseTrackingState(previousTracking, tracking, motionData) {
327
+ return {
328
+ tracking,
329
+ motionData: previousTracking === tracking ? motionData : ''
330
+ };
331
+ }
332
+ /** Converts a wheel delta into whole rows, carrying the fractional remainder forward. */
333
+ export function terminalWheelDeltaRows(event, cellHeight, viewportRows, remainder) {
334
+ // deltaMode: 0 pixels, 1 lines, 2 pages.
335
+ const pixels = event.deltaMode === 1
336
+ ? event.deltaY * cellHeight
337
+ : event.deltaMode === 2
338
+ ? event.deltaY * viewportRows * cellHeight
339
+ : event.deltaY;
340
+ const total = remainder + pixels / cellHeight;
341
+ const rows = Math.trunc(total);
342
+ return { rows, remainder: total - rows };
343
+ }
344
+ /** Arrow keys standing in for wheel rows on the alternate screen, which has no scrollback. */
345
+ export function terminalWheelArrowData(rows, applicationCursorKeys) {
346
+ if (rows === 0)
347
+ return '';
348
+ const sequence = rows < 0
349
+ ? applicationCursorKeys
350
+ ? '\u001bOA'
351
+ : '\u001b[A'
352
+ : applicationCursorKeys
353
+ ? '\u001bOB'
354
+ : '\u001b[B';
355
+ return sequence.repeat(Math.abs(rows));
356
+ }
357
+ /** Ghostty's mouse button for a DOM `button`; null for buttons it does not know. */
358
+ export function ghosttyMouseButton(button) {
359
+ switch (button) {
360
+ case 0:
361
+ return 1;
362
+ case 1:
363
+ return 3;
364
+ case 2:
365
+ return 2;
366
+ case 3:
367
+ return 4;
368
+ case 4:
369
+ return 5;
370
+ default:
371
+ return null;
372
+ }
373
+ }
374
+ /** Whether a pointer moved far enough from its press to become a drag. */
375
+ export function isTerminalPointerDrag(origin, event) {
376
+ return (Math.hypot(event.clientX - origin.x, event.clientY - origin.y) > TERMINAL_LINK_DRAG_THRESHOLD_PX);
377
+ }
378
+ /**
379
+ * Counts stationary presses within the double-click interval (single, word,
380
+ * line, then back to single), since PointerEvent.detail is not reliable.
381
+ */
382
+ export function advanceTerminalSelectionClickSequence(previous, event) {
383
+ const repeats = previous !== null &&
384
+ event.timeStamp - previous.time <= SELECTION_MULTI_CLICK_INTERVAL_MS &&
385
+ !isTerminalPointerDrag(previous, event);
386
+ return {
387
+ count: repeats ? (previous.count >= 3 ? 1 : previous.count + 1) : 1,
388
+ time: event.timeStamp,
389
+ x: event.clientX,
390
+ y: event.clientY
391
+ };
392
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Mitchell Hashimoto, Ghostty contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The terminal: `Terminal`, Ghostty's VT engine as WebAssembly drawn on a
3
+ * canvas, with its Copy and Paste menu and the scrollback length every
4
+ * terminal under `TerminalScrollbackContext` keeps. Imported on its own as
5
+ * `@bigpixelrocket/uiok/terminal`, never from the package root, so an app
6
+ * that shows no terminal never loads the engine; its look is terminal.css,
7
+ * which the base stylesheet imports.
8
+ */
9
+ export { Terminal, type TerminalHandle, type TerminalProps, type TerminalSize } from './Terminal.js';
10
+ export { type TerminalAction, type TerminalKeyStroke } from './Terminal.logic.js';
11
+ export { DEFAULT_TERMINAL_MENU_CHORDS, type TerminalMenuChords } from './TerminalMenu.logic.js';
12
+ export { DEFAULT_TERMINAL_SCROLLBACK_LINES, TerminalScrollbackContext } from './TerminalScrollback.js';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The terminal: `Terminal`, Ghostty's VT engine as WebAssembly drawn on a
3
+ * canvas, with its Copy and Paste menu and the scrollback length every
4
+ * terminal under `TerminalScrollbackContext` keeps. Imported on its own as
5
+ * `@bigpixelrocket/uiok/terminal`, never from the package root, so an app
6
+ * that shows no terminal never loads the engine; its look is terminal.css,
7
+ * which the base stylesheet imports.
8
+ */
9
+ export { Terminal } from './Terminal.js';
10
+ export {} from './Terminal.logic.js';
11
+ export { DEFAULT_TERMINAL_MENU_CHORDS } from './TerminalMenu.logic.js';
12
+ export { DEFAULT_TERMINAL_SCROLLBACK_LINES, TerminalScrollbackContext } from './TerminalScrollback.js';