@trismegisto/terminal 0.0.0-stage → 3.3.9
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/LICENSE +56 -0
- package/NOTICE +39 -0
- package/README.md +44 -3
- package/fesm2022/trismegisto-terminal.mjs +9717 -0
- package/fesm2022/trismegisto-terminal.mjs.map +1 -0
- package/package.json +27 -3
- package/types/trismegisto-terminal.d.ts +1952 -0
- package/types/trismegisto-terminal.d.ts.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Hermes License 1.0
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lucas Ribeiro. All rights reserved except as granted below.
|
|
4
|
+
|
|
5
|
+
1. Use. You may, free of charge, install and use this software (the "Library"),
|
|
6
|
+
unmodified, for any purpose, including commercial purposes.
|
|
7
|
+
|
|
8
|
+
2. Applications. You may include the unmodified Library in an application or
|
|
9
|
+
service you build and distribute or make that application available to others
|
|
10
|
+
(for example, a compiled web application bundle, a container image or an
|
|
11
|
+
installed program), provided the Library is not offered as a separate,
|
|
12
|
+
standalone component and this license notice is kept with it.
|
|
13
|
+
|
|
14
|
+
3. No modification. You may not modify, adapt, translate or create derivative
|
|
15
|
+
works of the Library.
|
|
16
|
+
|
|
17
|
+
4. No redistribution. Except as allowed in section 2, you may not publish,
|
|
18
|
+
redistribute, sublicense, sell or otherwise make available the Library —
|
|
19
|
+
including as a package in a public or private registry, a fork or a copy of
|
|
20
|
+
its source code.
|
|
21
|
+
|
|
22
|
+
5. Notice. You must keep this license and the copyright notice with every copy
|
|
23
|
+
of the Library.
|
|
24
|
+
|
|
25
|
+
6. No warranty. The Library is provided "as is", without warranty of any kind,
|
|
26
|
+
express or implied. In no event shall the author be liable for any claim,
|
|
27
|
+
damages or other liability arising from the use of the Library.
|
|
28
|
+
|
|
29
|
+
7. Third-party components. Some files in the Library are, or are derived from,
|
|
30
|
+
third-party software and fonts. They are identified in the NOTICE files, in
|
|
31
|
+
the LICENSES folders and in the font license files shipped with the package,
|
|
32
|
+
and remain under their own licenses. Nothing in this license limits the
|
|
33
|
+
rights those licenses grant for those parts.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
Licença Hermes 1.0 (tradução de referência; em caso de divergência vale o texto em inglês)
|
|
38
|
+
|
|
39
|
+
1. Uso. Você pode, gratuitamente, instalar e usar esta biblioteca, sem modificações,
|
|
40
|
+
para qualquer finalidade, inclusive comercial.
|
|
41
|
+
2. Aplicações. Você pode incluir a biblioteca, sem modificações, numa aplicação ou
|
|
42
|
+
serviço seu e distribuir ou disponibilizar essa aplicação (por exemplo, o bundle de
|
|
43
|
+
um app web, uma imagem de container ou um programa instalado), desde que a biblioteca
|
|
44
|
+
não seja oferecida como componente avulso e este aviso de licença a acompanhe.
|
|
45
|
+
3. Sem modificação. Você não pode modificar, adaptar, traduzir nem criar obras
|
|
46
|
+
derivadas da biblioteca.
|
|
47
|
+
4. Sem redistribuição. Fora o permitido no item 2, você não pode publicar, redistribuir,
|
|
48
|
+
sublicenciar, vender ou disponibilizar a biblioteca — inclusive como pacote num
|
|
49
|
+
registry público ou privado, fork ou cópia do código-fonte.
|
|
50
|
+
5. Aviso. Mantenha esta licença e o aviso de copyright em todas as cópias.
|
|
51
|
+
6. Sem garantia. A biblioteca é fornecida "como está", sem garantia de qualquer tipo.
|
|
52
|
+
7. Componentes de terceiros. Alguns arquivos da biblioteca são, ou derivam de, software
|
|
53
|
+
e fontes de terceiros. Eles estão identificados nos arquivos NOTICE, nas pastas
|
|
54
|
+
LICENSES e nos arquivos de licença das fontes que acompanham o pacote, e continuam
|
|
55
|
+
sob as licenças originais. Nada nesta licença limita os direitos que elas concedem
|
|
56
|
+
sobre essas partes.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@trismegisto/terminal
|
|
2
|
+
=====================
|
|
3
|
+
|
|
4
|
+
Este pacote foi escrito do zero ("clean room"). As referências de comportamento foram as especificações
|
|
5
|
+
públicas dos protocolos de terminal: XTerm Control Sequences (Thomas E. Dickey), ECMA-48, a descrição do
|
|
6
|
+
analisador DEC em vt100.net, os manuais dos terminais DEC VT e o Unicode Standard Annex #11 (East Asian Width).
|
|
7
|
+
|
|
8
|
+
A forma da API pública (nomes de classes, métodos, opções e eventos) segue a definição de tipos pública do
|
|
9
|
+
xterm.js (typings/xterm.d.ts), para que quem já usa aquela biblioteca possa trocar o import. Nenhum código de
|
|
10
|
+
implementação do xterm.js foi lido, copiado ou redistribuído; o crédito e a licença abaixo acompanham o pacote
|
|
11
|
+
por cortesia e por cautela, por causa da definição de tipos usada como referência.
|
|
12
|
+
|
|
13
|
+
xterm.js (https://github.com/xtermjs/xterm.js) é distribuído sob a licença a seguir:
|
|
14
|
+
|
|
15
|
+
-------------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
The MIT License (MIT)
|
|
18
|
+
|
|
19
|
+
Copyright (c) 2017-2019, The xterm.js authors (https://github.com/xtermjs/xterm.js)
|
|
20
|
+
Copyright (c) 2014-2016, SourceLair Private Company (https://www.sourcelair.com)
|
|
21
|
+
Copyright (c) 2012-2013, Christopher Jeffrey (https://github.com/chjj/)
|
|
22
|
+
|
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
24
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
25
|
+
in the Software without restriction, including without limitation the rights
|
|
26
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
27
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
28
|
+
furnished to do so, subject to the following conditions:
|
|
29
|
+
|
|
30
|
+
The above copyright notice and this permission notice shall be included in
|
|
31
|
+
all copies or substantial portions of the Software.
|
|
32
|
+
|
|
33
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
34
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
35
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
36
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
37
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
38
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
39
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,44 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @trismegisto/terminal
|
|
2
|
+
|
|
3
|
+
Emulador de terminal do Hermes Design System, escrito do zero, sem dependências de terceiros em tempo de
|
|
4
|
+
execução. A API segue a forma da do xterm.js: `Terminal`, `FitAddon`, `SearchAddon` e `WebLinksAddon`, com os
|
|
5
|
+
mesmos nomes de métodos, opções e eventos. Quem já usa o xterm.js troca o import.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { FitAddon, Terminal } from '@trismegisto/terminal';
|
|
9
|
+
|
|
10
|
+
const term = new Terminal({ fontFamily: 'monospace', fontSize: 13, scrollback: 5000 });
|
|
11
|
+
const fit = new FitAddon();
|
|
12
|
+
term.loadAddon(fit);
|
|
13
|
+
term.open(document.getElementById('terminal')!);
|
|
14
|
+
fit.fit();
|
|
15
|
+
|
|
16
|
+
term.onData((data) => socket.send(data));
|
|
17
|
+
socket.onmessage = (e) => term.write(e.data);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## O que cobre
|
|
21
|
+
|
|
22
|
+
- **Sequências**: C0, ESC, CSI, OSC, DCS e APC pelo analisador DEC (vt100.net), com os parâmetros e
|
|
23
|
+
subparâmetros (`:`). Inclui cursor, apagar, inserir e excluir, região de rolagem, tabulação, REP, SGR completo
|
|
24
|
+
(16, 256 e RGB, sublinhados com estilo e cor, sobrelinha), modos ANSI e DEC (1, 6, 7, 12, 25, 45, 47, 1047,
|
|
25
|
+
1049, 1000–1006, 1004, 2004, 2026), DECRQM, DSR, DA1, DA2, DECSCUSR, DECSTR, RIS, título (OSC 0/1/2), cores
|
|
26
|
+
(OSC 4/10/11/12 e os resets 104/110/111/112) e hiperlinks (OSC 8).
|
|
27
|
+
- **Buffer**: tela normal com histórico e tela alternativa. Ao mudar a largura, as linhas lógicas são
|
|
28
|
+
re-quebradas. Caracteres largos e combinantes seguem o UAX #11, e é possível registrar outra versão de Unicode.
|
|
29
|
+
- **Entrada**: teclado (setas e DECCKM, teclas de função, modificadores, Alt como Meta), IME, colagem entre
|
|
30
|
+
colchetes, mouse (X10, normal, arrasto e qualquer movimento, nos formatos SGR e clássico) e foco.
|
|
31
|
+
- **Tela**: renderização em DOM, com linhas sujas redesenhadas uma vez por quadro, cursor em bloco, sublinhado ou
|
|
32
|
+
barra (piscando ou não), seleção por arrasto, duplo e triplo clique, links (OSC 8 e provedores), marcadores,
|
|
33
|
+
decorações e modo de leitor de tela (árvore de linhas e região viva).
|
|
34
|
+
- **Parser público**: `terminal.parser.registerCsiHandler` / `Esc` / `Osc` / `Dcs` / `Apc`, com manipuladores
|
|
35
|
+
síncronos ou assíncronos (a análise pausa e retoma na ordem).
|
|
36
|
+
|
|
37
|
+
O núcleo sem framework (`TerminalCore`, `Parser`, `Buffer`) também é exportado e roda sem DOM, por exemplo em
|
|
38
|
+
testes ou num servidor.
|
|
39
|
+
|
|
40
|
+
## Origem
|
|
41
|
+
|
|
42
|
+
Implementação "clean room": as referências foram as especificações públicas dos protocolos (XTerm Control
|
|
43
|
+
Sequences, ECMA-48, vt100.net, manuais DEC VT, Unicode UAX #11) e a definição de tipos pública do xterm.js.
|
|
44
|
+
Nenhum código de implementação do xterm.js foi lido nem copiado. Veja `NOTICE` e `SPEC.md`.
|