@cplieger/web-terminal-engine 3.5.0 → 3.7.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 +2 -2
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/connection.ts +647 -9
- package/src/index.ts +2 -1
- package/src/intervals.ts +81 -0
- package/src/render.ts +899 -48
- package/src/scroll.ts +229 -25
- package/src/store.ts +1443 -68
- package/src/types.ts +28 -0
- package/src/wire-binary.ts +9 -1
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
const wrap = document.getElementById("term") as HTMLElement;
|
|
30
30
|
const out = document.getElementById("term-output") as HTMLElement;
|
|
31
31
|
|
|
32
|
-
render.init({ output: out, termWrap: wrap });
|
|
32
|
+
render.init({ output: out, termWrap: wrap }); // optional: maxLines (retained-line cap, default 5000)
|
|
33
33
|
scroll.init({ scrollEl: wrap });
|
|
34
34
|
mouse.init({
|
|
35
35
|
send: (data) => ws.send(data),
|
|
@@ -77,7 +77,7 @@ document.addEventListener("keydown", (ev) => {
|
|
|
77
77
|
|
|
78
78
|
## API
|
|
79
79
|
|
|
80
|
-
- **`render`** — DOM renderer driven by `ScreenMessage` / `ScrollMessage` frames. `init`, `handleScreen`, `handleScroll`, `updateFontMetrics`, `computeSize`, `getCursorPx`, `setPredictedCursor`, `resetScreen`, `resetScrollback`, `getHighestIndex`, `noteResumeBounds`, `updateReverseVideo`.
|
|
80
|
+
- **`render`** — DOM renderer driven by `ScreenMessage` / `ScrollMessage` frames. `init` (accepts `maxLines`, the retained-line cap — memory-constrained consumers pass a smaller budget; history above the cap is evicted from the top in batches, and the live screen is never evicted, so a cap at or below the terminal height keeps the full screen with no scrollback), `handleScreen`, `handleScroll`, `updateFontMetrics`, `computeSize`, `getCursorPx`, `setPredictedCursor`, `resetScreen`, `resetScrollback`, `getHighestIndex`, `noteResumeBounds`, `updateReverseVideo`.
|
|
81
81
|
- **`keyboard`** — Translates `KeyboardEvent` to terminal byte sequences. `mapKeyboardEvent`, `bracketTextForPaste`, `prepareTextForTerminal`, `ctrlByteFor`, plus the shared logical-key encodings (`plainCursorKeySeq`, `plainEscapeSeq`) the toolbar module reuses. Honors `applicationCursor`, `applicationKeypad`, `bracketedPaste`.
|
|
82
82
|
- **`toolbar`** — On-screen mobile toolbar widget (moved out of `keyboard` in v3). `bindMobileToolbar({toolbar, send, ids?})` wires `pointerdown` handlers for an on-screen Ctrl/arrows/Tab/Enter/Esc toolbar (with sticky-Ctrl semantics and kitty/DECCKM-aware arrows byte-identical to the physical-key path), returning a `MobileToolbarController` exposing `applyStickyCtrl`, `setCtrlArmed`, `isCtrlArmed`, and `dispose`.
|
|
83
83
|
- **`mouse`** — SGR 1006 mouse + focus reporting encoder. `init`, `encodeSGR`, `MouseInputHandler`. Auto-gates on `mouseMode > 0`.
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cplieger/web-terminal-engine",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"typecheck": "tsc -p tsconfig.json",
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"@typescript/native": "npm:typescript@7.0.2",
|
|
20
20
|
"@vitest/coverage-v8": "4.1.10",
|
|
21
21
|
"esbuild": "0.28.1",
|
|
22
|
-
"eslint": "10.8.
|
|
22
|
+
"eslint": "10.8.1",
|
|
23
23
|
"fast-check": "4.9.0",
|
|
24
|
-
"happy-dom": "20.11.
|
|
24
|
+
"happy-dom": "20.11.2",
|
|
25
25
|
"pngjs": "7.0.0",
|
|
26
26
|
"prettier": "3.9.6",
|
|
27
27
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|