feat: upgrade xterm the latest 5.3.0 release

There are some breaking api changes as documented here: https://github.com/xtermjs/xterm.js/releases/tag/5.0.0
This commit is contained in:
Jose Diaz-Gonzalez 2024-02-15 02:29:48 -05:00
parent 113b502abb
commit 721607826e
7 changed files with 53 additions and 34 deletions

View File

@ -149,6 +149,7 @@
right: 0; right: 0;
z-index: 10; z-index: 10;
color: transparent; color: transparent;
pointer-events: none;
} }
.xterm .live-region { .xterm .live-region {
@ -160,13 +161,27 @@
} }
.xterm-dim { .xterm-dim {
opacity: 0.5; /* Dim should not apply to background, so the opacity of the foreground color is applied
* explicitly in the generated class and reset to 1 here */
opacity: 1 !important;
} }
.xterm-underline { .xterm-underline-1 { text-decoration: underline; }
text-decoration: underline; .xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }
.xterm-overline {
text-decoration: overline;
} }
.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
.xterm-strikethrough { .xterm-strikethrough {
text-decoration: line-through; text-decoration: line-through;
} }
@ -176,8 +191,12 @@
position: absolute; position: absolute;
} }
.xterm-decoration-overview-ruler { .xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
z-index: 7; z-index: 7;
}
.xterm-decoration-overview-ruler {
z-index: 8;
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

38
js/package-lock.json generated
View File

@ -15,10 +15,10 @@
"preact": "^10.19.4", "preact": "^10.19.4",
"react-bootstrap": "^2.10.1", "react-bootstrap": "^2.10.1",
"style-loader": "^2.0.0", "style-loader": "^2.0.0",
"xterm": "^4.19.0", "xterm": "^5.3.0",
"xterm-addon-fit": "^0.5.0", "xterm-addon-fit": "^0.8.0",
"xterm-addon-web-links": "^0.4.0", "xterm-addon-web-links": "^0.9.0",
"xterm-addon-webgl": "^0.10.0", "xterm-addon-webgl": "^0.16.0",
"zmodem.js": "^0.1.10" "zmodem.js": "^0.1.10"
}, },
"devDependencies": { "devDependencies": {
@ -4479,32 +4479,32 @@
} }
}, },
"node_modules/xterm": { "node_modules/xterm": {
"version": "4.19.0", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/xterm/-/xterm-4.19.0.tgz", "resolved": "https://registry.npmjs.org/xterm/-/xterm-5.3.0.tgz",
"integrity": "sha512-c3Cp4eOVsYY5Q839dR5IejghRPpxciGmLWWaP9g+ppfMeBChMeLa1DCA+pmX/jyDZ+zxFOmlJL/82qVdayVoGQ==" "integrity": "sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg=="
}, },
"node_modules/xterm-addon-fit": { "node_modules/xterm-addon-fit": {
"version": "0.5.0", "version": "0.8.0",
"resolved": "https://registry.npmjs.org/xterm-addon-fit/-/xterm-addon-fit-0.5.0.tgz", "resolved": "https://registry.npmjs.org/xterm-addon-fit/-/xterm-addon-fit-0.8.0.tgz",
"integrity": "sha512-DsS9fqhXHacEmsPxBJZvfj2la30Iz9xk+UKjhQgnYNkrUIN5CYLbw7WEfz117c7+S86S/tpHPfvNxJsF5/G8wQ==", "integrity": "sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==",
"peerDependencies": { "peerDependencies": {
"xterm": "^4.0.0" "xterm": "^5.0.0"
} }
}, },
"node_modules/xterm-addon-web-links": { "node_modules/xterm-addon-web-links": {
"version": "0.4.0", "version": "0.9.0",
"resolved": "https://registry.npmjs.org/xterm-addon-web-links/-/xterm-addon-web-links-0.4.0.tgz", "resolved": "https://registry.npmjs.org/xterm-addon-web-links/-/xterm-addon-web-links-0.9.0.tgz",
"integrity": "sha512-xv8GeiINmx0zENO9hf5k+5bnkaE8mRzF+OBAr9WeFq2eLaQSudioQSiT34M1ofKbzcdjSsKiZm19Rw3i4eXamg==", "integrity": "sha512-LIzi4jBbPlrKMZF3ihoyqayWyTXAwGfu4yprz1aK2p71e9UKXN6RRzVONR0L+Zd+Ik5tPVI9bwp9e8fDTQh49Q==",
"peerDependencies": { "peerDependencies": {
"xterm": "^4.0.0" "xterm": "^5.0.0"
} }
}, },
"node_modules/xterm-addon-webgl": { "node_modules/xterm-addon-webgl": {
"version": "0.10.0", "version": "0.16.0",
"resolved": "https://registry.npmjs.org/xterm-addon-webgl/-/xterm-addon-webgl-0.10.0.tgz", "resolved": "https://registry.npmjs.org/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0.tgz",
"integrity": "sha512-MJzyWie5yw+PH6p//fXlXzmsULLtpBo992EWEKl2uv5M5Zj9etTwfuutCUK7o98mr6itDl+vS/CYIMP68jCf8w==", "integrity": "sha512-E8cq1AiqNOv0M/FghPT+zPAEnvIQRDbAbkb04rRYSxUym69elPWVJ4sv22FCLBqM/3LcrmBLl/pELnBebVFKgA==",
"peerDependencies": { "peerDependencies": {
"xterm": "^4.0.0" "xterm": "^5.0.0"
} }
}, },
"node_modules/yallist": { "node_modules/yallist": {

View File

@ -25,10 +25,10 @@
"preact": "^10.19.4", "preact": "^10.19.4",
"react-bootstrap": "^2.10.1", "react-bootstrap": "^2.10.1",
"style-loader": "^2.0.0", "style-loader": "^2.0.0",
"xterm": "^4.19.0", "xterm": "^5.3.0",
"xterm-addon-fit": "^0.5.0", "xterm-addon-fit": "^0.8.0",
"xterm-addon-web-links": "^0.4.0", "xterm-addon-web-links": "^0.9.0",
"xterm-addon-webgl": "^0.10.0", "xterm-addon-webgl": "^0.16.0",
"zmodem.js": "^0.1.10" "zmodem.js": "^0.1.10"
} }
} }

View File

@ -1,4 +1,4 @@
import { Terminal, IDisposable } from "xterm"; import { IDisposable, Terminal } from "xterm";
import { FitAddon } from 'xterm-addon-fit'; import { FitAddon } from 'xterm-addon-fit';
import { WebLinksAddon } from 'xterm-addon-web-links'; import { WebLinksAddon } from 'xterm-addon-web-links';
import { WebglAddon } from 'xterm-addon-webgl'; import { WebglAddon } from 'xterm-addon-webgl';
@ -104,9 +104,9 @@ export class OurXterm {
if (key == "EnableWebGL" && key) { if (key == "EnableWebGL" && key) {
this.term.loadAddon(new WebglAddon()); this.term.loadAddon(new WebglAddon());
} else if (key == "font-size") { } else if (key == "font-size") {
this.term.setOption("fontSize", value[key]) this.term.options.fontSize = value[key]
} else if (key == "font-family") { } else if (key == "font-family") {
this.term.setOption("fontFamily", value[key]) this.term.options.fontFamily = value[key]
} }
}); });
}; };

View File

@ -1,7 +1,7 @@
import { Component, ComponentChildren, createRef, render } from "preact";
import { ITerminalAddon, Terminal } from "xterm"; import { ITerminalAddon, Terminal } from "xterm";
import { Browser, Detection, Offer, Sentry, Session } from 'zmodem.js/src/zmodem_browser'; import { Browser, Detection, Offer, Sentry, Session } from 'zmodem.js/src/zmodem_browser';
import { MyModal, Button } from "./MyModal"; import { Button, MyModal } from "./MyModal";
import { Component, ComponentChildren, createRef, render } from "preact";
export class ZModemAddon implements ITerminalAddon { export class ZModemAddon implements ITerminalAddon {
term: Terminal; term: Terminal;