restty 0.1.14 → 0.1.16
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 +22 -0
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.js +387 -94
- package/dist/app/types.d.ts +18 -0
- package/dist/index.js +387 -94
- package/dist/internal.js +387 -94
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ Powerful, lightweight browser terminal. Batteries included.
|
|
|
5
5
|
Live demo: `https://restty.pages.dev/`
|
|
6
6
|
|
|
7
7
|
Powered by:
|
|
8
|
+
|
|
8
9
|
- `libghostty-vt` (WASM terminal core)
|
|
9
10
|
- `WebGPU` (with WebGL2 fallback)
|
|
10
11
|
- `text-shaper` (shaping + raster)
|
|
@@ -124,17 +125,37 @@ await restty.setFontSources([
|
|
|
124
125
|
]);
|
|
125
126
|
```
|
|
126
127
|
|
|
128
|
+
### Touch behavior (pan-first by default)
|
|
129
|
+
|
|
130
|
+
On touch devices, restty defaults to pan-first scrolling with long-press selection.
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
const restty = new Restty({
|
|
134
|
+
root: document.getElementById("terminal") as HTMLElement,
|
|
135
|
+
appOptions: {
|
|
136
|
+
// "long-press" (default) | "drag" | "off"
|
|
137
|
+
touchSelectionMode: "long-press",
|
|
138
|
+
// Optional tuning knobs:
|
|
139
|
+
touchSelectionLongPressMs: 450,
|
|
140
|
+
touchSelectionMoveThresholdPx: 10,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
```
|
|
144
|
+
|
|
127
145
|
## API Snapshot
|
|
128
146
|
|
|
129
147
|
Primary class:
|
|
148
|
+
|
|
130
149
|
- `new Restty({ root, ...options })`
|
|
131
150
|
- `createRestty(options)`
|
|
132
151
|
|
|
133
152
|
Pane access:
|
|
153
|
+
|
|
134
154
|
- `panes()` / `pane(id)` / `activePane()` / `focusedPane()` / `forEachPane(visitor)`
|
|
135
155
|
- `splitActivePane("vertical" | "horizontal")` / `splitPane(id, direction)` / `closePane(id)`
|
|
136
156
|
|
|
137
157
|
Active-pane convenience:
|
|
158
|
+
|
|
138
159
|
- `connectPty(url)` / `disconnectPty()` / `isPtyConnected()`
|
|
139
160
|
- `setRenderer("auto" | "webgpu" | "webgl2")`
|
|
140
161
|
- `setFontSize(number)` / `setFontSources([...])`
|
|
@@ -148,6 +169,7 @@ Active-pane convenience:
|
|
|
148
169
|
## Advanced / Internal Modules
|
|
149
170
|
|
|
150
171
|
Use these only when you need lower-level control:
|
|
172
|
+
|
|
151
173
|
- `restty/wasm`: low-level WASM ABI wrapper (`loadResttyWasm`, `ResttyWasm`)
|
|
152
174
|
- `restty/input`: key/mouse/input encoding utilities
|
|
153
175
|
- `restty/pty`: PTY transport helpers
|
package/dist/app/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ResttyApp, ResttyAppOptions } from "./types";
|
|
|
2
2
|
export { createResttyAppSession, getDefaultResttyAppSession } from "./session";
|
|
3
3
|
export { createResttyPaneManager, createDefaultResttyPaneContextMenuItems, getResttyShortcutModifierLabel, } from "./panes";
|
|
4
4
|
export { Restty } from "./restty";
|
|
5
|
-
export type { ResttyAppElements, ResttyAppCallbacks, FontSource, ResttyFontSource, ResttyUrlFontSource, ResttyBufferFontSource, ResttyLocalFontSource, ResttyWasmLogListener, ResttyAppSession, ResttyAppOptions, ResttyApp, } from "./types";
|
|
5
|
+
export type { ResttyAppElements, ResttyAppCallbacks, FontSource, ResttyFontSource, ResttyTouchSelectionMode, ResttyUrlFontSource, ResttyBufferFontSource, ResttyLocalFontSource, ResttyWasmLogListener, ResttyAppSession, ResttyAppOptions, ResttyApp, } from "./types";
|
|
6
6
|
export type { ResttyPaneSplitDirection, ResttyPaneContextMenuItem, ResttyPaneDefinition, ResttyPaneStyleOptions, ResttyPaneStylesOptions, ResttyPaneShortcutsOptions, ResttyPaneContextMenuOptions, CreateResttyPaneManagerOptions, ResttyPaneManager, ResttyPaneWithApp, CreateDefaultResttyPaneContextMenuItemsOptions, } from "./panes";
|
|
7
7
|
export type { ResttyOptions } from "./restty";
|
|
8
8
|
export declare function createResttyApp(options: ResttyAppOptions): ResttyApp;
|