@aitty/shell-ui
v0.6.7
Published
Shell UI decorations for aitty - controls, settings panel, theme toggle, and fullscreen management.
Maintainers
Readme
@aitty/shell-ui
Reference shell UI controls for aitty terminal pages.
This package contains the optional CLI shell decorations that sit around the browser terminal renderer: font-size controls, theme toggle, settings panel, fullscreen state, and shell window state helpers.
Install
npm i @aitty/shell-uiImport the shell stylesheet when you use the reference shell markup:
import "@aitty/shell-ui/style.css";Usage
import { installShellControls } from "@aitty/shell-ui";
import "@aitty/shell-ui/style.css";
const dispose = installShellControls({
captureScrollAnchor: () => ({ stickToBottom: true }),
doc: document,
focusTerminal() {
terminalRoot.focus();
},
getConfig: () => currentConfig,
onInterrupt() {
sendInput("\u0003");
},
resetConfig: initialConfig,
restoreScrollAnchor(anchor) {
if (anchor.stickToBottom) {
scrollViewport.scrollTop = scrollViewport.scrollHeight;
}
},
shell,
updateConfig(patch) {
currentConfig = mergeConfig(currentConfig, patch);
return currentConfig;
},
windowObject: window
});API
installShellControls(options)wires the reference shell buttons and returns a cleanup function.expandShellWindow(shell, id),collapseShellWindow(shell, id), andhideShellWindow(shell, id)manage shell window visibility.setShellWindowBrowserFullscreen(shell, id, enabled)andsetShellSystemFullscreen(shell, enabled)synchronize fullscreen state.syncShellWindowControl(shell, id, control)updates the fullscreen button state for a shell window.
The shell controls intentionally depend only on small callback contracts and
@aitty/protocol theme normalization. They do not depend on @aitty/browser;
@aitty/browser re-exports these APIs for compatibility.
License
Apache-2.0
