Skip to content

Commit 7659364

Browse files
committedSep 12, 2023
Update dependencies, including xterm.js
1 parent 403d9da commit 7659364

File tree

4 files changed

+370
-396
lines changed

4 files changed

+370
-396
lines changed
 

‎package-lock.json

+341-370
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
1313
},
1414
"dependencies": {
15-
"@fontsource-variable/inter": "^5.0.3",
15+
"@fontsource-variable/inter": "^5.0.8",
1616
"@rgossiaux/svelte-headlessui": "^2.0.0",
1717
"@tldraw/vec": "^1.9.2",
1818
"@use-gesture/vanilla": "^10.2.27",
1919
"buffer": "^6.0.3",
20-
"cbor-x": "^1.5.3",
20+
"cbor-x": "^1.5.4",
2121
"firacode": "^6.2.0",
2222
"fontfaceobserver": "^2.3.0",
2323
"lodash-es": "^4.17.21",
@@ -26,29 +26,29 @@
2626
"svelte": "^3.59.2",
2727
"svelte-feather-icons": "^4.0.1",
2828
"xterm-addon-image": "^0.5.0",
29-
"xterm-addon-web-links": "^0.8.0",
30-
"xterm-addon-webgl": "^0.15.0"
29+
"xterm-addon-web-links": "^0.9.0",
30+
"xterm-addon-webgl": "^0.16.0"
3131
},
3232
"devDependencies": {
33-
"@sveltejs/adapter-static": "2.0.2",
34-
"@sveltejs/kit": "1.21.0",
35-
"@types/lodash-es": "^4.17.7",
36-
"@typescript-eslint/eslint-plugin": "^5.60.1",
37-
"@typescript-eslint/parser": "^5.60.1",
38-
"autoprefixer": "^10.4.14",
33+
"@sveltejs/adapter-static": "^2.0.3",
34+
"@sveltejs/kit": "^1.24.1",
35+
"@types/lodash-es": "^4.17.9",
36+
"@typescript-eslint/eslint-plugin": "^6.7.0",
37+
"@typescript-eslint/parser": "^6.7.0",
38+
"autoprefixer": "^10.4.15",
3939
"cssnano": "^6.0.1",
40-
"eslint": "^8.44.0",
41-
"eslint-config-prettier": "^8.8.0",
40+
"eslint": "^8.49.0",
41+
"eslint-config-prettier": "^9.0.0",
4242
"eslint-plugin-svelte3": "^4.0.0",
43-
"postcss": "^8.4.24",
43+
"postcss": "^8.4.29",
4444
"postcss-load-config": "^4.0.1",
4545
"prettier": "2.8.8",
4646
"prettier-plugin-svelte": "2.10.1",
47-
"svelte-check": "^3.4.4",
47+
"svelte-check": "^3.5.1",
4848
"svelte-preprocess": "^5.0.4",
49-
"tailwindcss": "^3.3.2",
50-
"tslib": "^2.6.0",
51-
"typescript": "~5.1.6",
52-
"vite": "^4.3.9"
49+
"tailwindcss": "^3.3.3",
50+
"tslib": "^2.6.2",
51+
"typescript": "~5.2.2",
52+
"vite": "^4.4.9"
5353
}
5454
}

‎src/lib/Session.svelte

+1-3
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,7 @@
404404
<div
405405
class="absolute w-5 h-5 -bottom-1 -right-1 cursor-nwse-resize"
406406
on:mousedown={(event) => {
407-
const canvasEl = termElements[id].querySelector(
408-
"canvas.xterm-cursor-layer",
409-
);
407+
const canvasEl = termElements[id].querySelector(".xterm-screen");
410408
if (canvasEl) {
411409
resizing = id;
412410
const r = canvasEl.getBoundingClientRect();

‎src/lib/ui/XTerm.svelte

+10-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,13 @@
7474
7575
function handleWheelSkipXTerm(event: WheelEvent) {
7676
event.preventDefault(); // Stop native macOS Chrome zooming on pinch.
77+
78+
// We stop the event from propagating to the main `.xterm` terminal element,
79+
// so the xterm.js's event handlers do not fire and scroll the buffer.
7780
event.stopPropagation();
81+
82+
// However, we still want it to propagate upward to our pan/zoom handlers,
83+
// so we re-dispatch the event higher up, skipping xterm.
7884
termEl?.dispatchEvent(new WheelEvent(event.type, event));
7985
}
8086
@@ -162,10 +168,9 @@
162168
});
163169
164170
// Hack: We artificially disable scrolling when the terminal is not focused.
165-
const cursorLayer = termEl.querySelector(
166-
".xterm-cursor-layer",
167-
)! as HTMLDivElement;
168-
cursorLayer.addEventListener("wheel", handleWheelSkipXTerm);
171+
// ("termEl" > div.terminal.xterm > div.xterm-screen)
172+
const screenEl = termEl.querySelector(".xterm-screen")! as HTMLDivElement;
173+
screenEl.addEventListener("wheel", handleWheelSkipXTerm);
169174
170175
const focusObserver = new MutationObserver((mutations) => {
171176
for (const mutation of mutations) {
@@ -176,7 +181,7 @@
176181
// The "focus" class is set directly by xterm.js, but there isn't any way to listen for it.
177182
const target = mutation.target as HTMLElement;
178183
const isFocused = target.classList.contains("focus");
179-
setFocused(isFocused, cursorLayer);
184+
setFocused(isFocused, screenEl);
180185
}
181186
}
182187
});

0 commit comments

Comments
 (0)
Please sign in to comment.