Skip to content

Commit 7928e11

Browse files
JeanMechethePunderWoman
authored andcommitted
docs(docs-infra): move back all xterm code to the fw repo (angular#55642)
Previously, the `@angular/docs` package had `xterm` as dependency but wasn't referencing it. It only had dedicated styles. This commit moves back the styles to the FW repo as it is only used here. PR Close angular#55642
1 parent d73127f commit 7928e11

File tree

8 files changed

+133
-18
lines changed

8 files changed

+133
-18
lines changed

adev/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ APPLICATION_DEPS = [
7979
"@npm//@lezer/javascript",
8080
"@npm//@lezer/common",
8181
"@npm//@xterm/xterm",
82+
"@npm//@xterm/addon-fit",
8283
"@npm//algoliasearch",
83-
"@npm//xterm",
84-
"@npm//xterm-addon-fit",
8584
"@npm//angular-split",
8685
"@npm//zone.js",
8786
]

adev/angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"tsConfig": "tsconfig.app.json",
2929
"inlineStyleLanguage": "scss",
3030
"assets": ["src/favicon.ico", "src/robots.txt", "src/assets"],
31-
"styles": ["@angular/docs/styles/global-styles.scss"],
31+
"styles": ["@angular/docs/styles/global-styles.scss", "./src/local-styles.scss"],
3232
"scripts": [],
3333
"webWorkerTsConfig": "tsconfig.worker.json",
3434
"optimization": {

adev/src/app/editor/terminal/terminal-handler.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import {Injectable} from '@angular/core';
1010
import {Terminal} from '@xterm/xterm';
11-
import {FitAddon} from 'xterm-addon-fit';
11+
import {FitAddon} from '@xterm/addon-fit';
1212
import {InteractiveTerminal} from './interactive-terminal';
1313

1414
export enum TerminalType {

adev/src/app/editor/terminal/terminal.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// SASS imports, here we're importing a CSS asset
33
//
44
// stylelint-disable-next-line @angular/no-import
5-
@import 'xterm/css/xterm.css';
5+
@import '@xterm/xterm/css/xterm.css';
66

77
.docs-tutorial-terminal {
88
display: block;

adev/src/local-styles.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import './styles/xterm';

adev/src/styles/_xterm.scss

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
.xterm-viewport,
2+
.xterm-screen {
3+
&::-webkit-scrollbar-track {
4+
background: rgba(0, 0, 0, 0);
5+
cursor: pointer;
6+
margin: 2px;
7+
}
8+
9+
&::-webkit-scrollbar {
10+
width: 6px;
11+
height: 6px;
12+
}
13+
14+
&::-webkit-scrollbar-thumb {
15+
background-color: var(--senary-contrast);
16+
border-radius: 10px;
17+
transition: background-color 0.3s ease;
18+
}
19+
20+
&::-webkit-scrollbar-thumb:hover {
21+
background-color: var(--quaternary-contrast);
22+
}
23+
}
24+
25+
// Override terminal styles
26+
.xterm {
27+
height: 100%;
28+
width: 100%;
29+
}
30+
31+
.xterm-viewport {
32+
overflow-y: auto !important;
33+
height: 100% !important;
34+
width: 100% !important;
35+
background-color: var(--octonary-contrast) !important;
36+
transition: background-color 0.3s ease;
37+
}
38+
39+
.xterm-screen {
40+
padding: 10px;
41+
box-sizing: border-box;
42+
overflow: visible !important;
43+
height: 100% !important;
44+
width: 100% !important;
45+
}
46+
47+
.xterm-rows {
48+
height: 100% !important;
49+
overflow: visible !important;
50+
color: var(--primary-contrast) !important;
51+
transition: color 0.3s ease;
52+
// It is important to not alter the font-size or the selection would lose in precision
53+
54+
.xterm-cursor {
55+
&.xterm-cursor-outline {
56+
outline-color: var(--primary-contrast) !important;
57+
}
58+
&.xterm-cursor-block {
59+
background: var(--primary-contrast) !important;
60+
}
61+
}
62+
}
63+
64+
.xterm-selection {
65+
top: 10px !important;
66+
left: 10px !important;
67+
div {
68+
background-color: transparent !important;
69+
}
70+
}
71+
72+
.xterm-decoration-top {
73+
background-color: var(--quinary-contrast) !important;
74+
}
75+
76+
.xterm-fg-11 {
77+
color: var(--electric-violet) !important;
78+
}
79+
80+
.xterm-fg-4 {
81+
color: var(--bright-blue) !important;
82+
}
83+
84+
// progress ###
85+
.xterm-fg-15 {
86+
color: var(--secondary-contrast) !important;
87+
}
88+
89+
.xterm-fg-14 {
90+
color: var(--vivid-pink) !important;
91+
}
92+
93+
// > in terminal
94+
.xterm-fg-5 {
95+
color: var(--electric-violet) !important;
96+
}
97+
98+
// error text, warning text
99+
.xterm-fg-9,
100+
.xterm-fg-3 {
101+
color: var(--vivid-pink) !important;
102+
}
103+
104+
.xterm-fg-10,
105+
.xterm-fg-2 {
106+
color: var(--symbolic-green) !important;
107+
}
108+
109+
// error bg
110+
.xterm-bg-1 {
111+
background-color: var(--orange-red) !important;
112+
}
113+
114+
// error text
115+
.xterm-fg-257 {
116+
color: var(--octonary-contrast) !important;
117+
}
118+
119+
.xterm-fg-8 {
120+
color: var(--tertiary-contrast) !important;
121+
}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
"@types/shelljs": "^0.8.6",
9393
"@types/systemjs": "6.13.5",
9494
"@types/yargs": "^17.0.3",
95+
"@xterm/xterm": "^5.5.0",
96+
"@xterm/addon-fit": "^0.10.0",
9597
"algoliasearch": "^4.23.3",
9698
"angular-1.5": "npm:angular@1.5",
9799
"angular-1.6": "npm:angular@1.6",
@@ -148,8 +150,6 @@
148150
"webtreemap": "^2.0.1",
149151
"ws": "^8.15.0",
150152
"xhr2": "0.2.1",
151-
"xterm": "^5.3.0",
152-
"xterm-addon-fit": "^0.8.0",
153153
"yargs": "^17.2.1"
154154
},
155155
"// 2": "devDependencies are not used under Bazel. Many can be removed after test.sh is deleted.",
@@ -188,7 +188,6 @@
188188
"@types/inquirer": "^9.0.3",
189189
"@types/jsdom": "^21.1.5",
190190
"@typescript/vfs": "^1.5.0",
191-
"@xterm/xterm": "^5.5.0",
192191
"@yarnpkg/lockfile": "^1.1.0",
193192
"adm-zip": "^0.5.10",
194193
"angular-split": "^17.1.1",

yarn.lock

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4807,6 +4807,11 @@
48074807
resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.10.tgz#a1337ca426aa61cef9fe15b5b28e340a72f6fa99"
48084808
integrity sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==
48094809

4810+
"@xterm/addon-fit@^0.10.0":
4811+
version "0.10.0"
4812+
resolved "https://registry.yarnpkg.com/@xterm/addon-fit/-/addon-fit-0.10.0.tgz#bebf87fadd74e3af30fdcdeef47030e2592c6f55"
4813+
integrity sha512-UFYkDm4HUahf2lnEyHvio51TNGiLK66mqP2JoATy7hRZeXaGMRDr00JiSF7m63vR5WKATF605yEggJKsw0JpMQ==
4814+
48104815
"@xterm/xterm@^5.5.0":
48114816
version "5.5.0"
48124817
resolved "https://registry.yarnpkg.com/@xterm/xterm/-/xterm-5.5.0.tgz#275fb8f6e14afa6e8a0c05d4ebc94523ff775396"
@@ -16625,16 +16630,6 @@ xtend@^4.0.0:
1662516630
resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
1662616631
integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==
1662716632

16628-
xterm-addon-fit@^0.8.0:
16629-
version "0.8.0"
16630-
resolved "https://registry.yarnpkg.com/xterm-addon-fit/-/xterm-addon-fit-0.8.0.tgz#48ca99015385141918f955ca7819e85f3691d35f"
16631-
integrity sha512-yj3Np7XlvxxhYF/EJ7p3KHaMt6OdwQ+HDu573Vx1lRXsVxOcnVJs51RgjZOouIZOczTsskaS+CpXspK81/DLqw==
16632-
16633-
xterm@^5.3.0:
16634-
version "5.3.0"
16635-
resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0.tgz#867daf9cc826f3d45b5377320aabd996cb0fce46"
16636-
integrity sha512-8QqjlekLUFTrU6x7xck1MsPzPA571K5zNqWm0M0oroYEWVOptZ0+ubQSkQ3uxIEhcIHRujJy6emDWX4A7qyFzg==
16637-
1663816633
y18n@^4.0.0:
1663916634
version "4.0.3"
1664016635
resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf"

0 commit comments

Comments
 (0)