@battlefieldduck/xterm-svelte 0.0.5 → 1.0.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 CHANGED
@@ -1,17 +1,28 @@
1
1
  # xterm-svelte
2
2
 
3
- [![Node.js Build](https://github.com/BattlefieldDuck/xterm-svelte/actions/workflows/node-build.yml/badge.svg)](https://github.com/BattlefieldDuck/xterm-svelte/actions/workflows/node-build.yml)
3
+ <img align="right" width="100" height="100" src="https://github.com/BattlefieldDuck/xterm-svelte/assets/29337428/e1055940-ae66-48b5-9a1f-1965949b5757">
4
4
 
5
+ [![Node.js Build](https://github.com/BattlefieldDuck/xterm-svelte/actions/workflows/node-build.yml/badge.svg)](https://github.com/BattlefieldDuck/xterm-svelte/actions/workflows/node-build.yml)
6
+ [![NPM Version](https://img.shields.io/npm/v/%40battlefieldduck%2Fxterm-svelte)](https://www.npmjs.com/package/@battlefieldduck/xterm-svelte)
7
+ ![NPM Downloads](https://img.shields.io/npm/dw/%40battlefieldduck%2Fxterm-svelte)
5
8
 
6
9
  xterm-svelte is a wrapper for the [xterm.js](https://github.com/xtermjs/xterm.js) library, designed to work seamlessly with SvelteKit. This library allows you to embed a fully functional terminal in your SvelteKit application.
7
10
 
8
- Live Demo: https://xterm-svelte.pages.dev
11
+ Check it out: https://xterm-svelte.pages.dev
9
12
 
10
13
  ## Features
11
14
 
12
- - Full integration with SvelteKit.
13
- - Xterm addons is managed in xterm-svelte
14
- - Continuous package updates: xterm-svelte is regularly updated to ensure compatibility with the latest versions of SvelteKit and Xterm.js.
15
+ - **Full integration with SvelteKit**
16
+
17
+ Xterm-Svelte is designed to work seamlessly with SvelteKit, allowing you to easily incorporate terminal functionality into your SvelteKit projects.
18
+
19
+ - **Xterm addons management**
20
+
21
+ Xterm addons are managed within Xterm-Svelte, providing a unified and consistent interface for working with Xterm and its addons.
22
+
23
+ - **Continuous package updates**
24
+
25
+ Xterm-Svelte is regularly updated to ensure compatibility with the latest versions of SvelteKit and Xterm.js. This means you can always use the latest features and improvements from these libraries in your projects.
15
26
 
16
27
  ## Installation
17
28
 
@@ -27,33 +38,38 @@ Here's a basic example of how to use xterm-svelte in your SvelteKit application:
27
38
 
28
39
  ```svelte
29
40
  <script lang="ts">
30
- import { Xterm } from '@battlefieldduck/xterm-svelte';
31
- import type { ITerminalOptions, ITerminalInitOnlyOptions, Terminal } from '@battlefieldduck/xterm-svelte';
32
-
33
- let options: ITerminalOptions & ITerminalInitOnlyOptions = {};
34
-
35
- async function onLoad(event: CustomEvent<{ terminal: Terminal }>) {
36
- console.log('Child component has loaded');
37
- const terminal = event.detail.terminal;
38
-
39
- // FitAddon Usage
40
- const { FitAddon } = await XtermAddon.FitAddon();
41
- const fitAddon = new FitAddon();
42
- terminal.loadAddon(fitAddon);
43
- fitAddon.fit();
44
-
45
- terminal.write('Hello World');
46
- }
47
-
48
- function onData(event: CustomEvent<string>) {
49
- const data = event.detail;
50
- console.log('onData()', data);
51
- }
52
-
53
- function onKey(event: CustomEvent<{ key: string; domEvent: KeyboardEvent }>) {
54
- const data = event.detail;
55
- console.log('onKey()', data);
56
- }
41
+ import { Xterm, XtermAddon } from '@battlefieldduck/xterm-svelte';
42
+ import type {
43
+ ITerminalOptions,
44
+ ITerminalInitOnlyOptions,
45
+ Terminal
46
+ } from '@battlefieldduck/xterm-svelte';
47
+
48
+ let options: ITerminalOptions & ITerminalInitOnlyOptions = {
49
+ fontFamily: 'Consolas'
50
+ };
51
+
52
+ async function onLoad(event: CustomEvent<{ terminal: Terminal }>) {
53
+ console.log('Child component has loaded');
54
+ const terminal = event.detail.terminal;
55
+
56
+ // FitAddon Usage
57
+ const fitAddon = new (await XtermAddon.FitAddon()).FitAddon();
58
+ terminal.loadAddon(fitAddon);
59
+ fitAddon.fit();
60
+
61
+ terminal.write('Hello World');
62
+ }
63
+
64
+ function onData(event: CustomEvent<string>) {
65
+ const data = event.detail;
66
+ console.log('onData()', data);
67
+ }
68
+
69
+ function onKey(event: CustomEvent<{ key: string; domEvent: KeyboardEvent }>) {
70
+ const data = event.detail;
71
+ console.log('onKey()', data);
72
+ }
57
73
  </script>
58
74
 
59
75
  <Xterm {options} on:load={onLoad} on:data={onData} on:key={onKey} />
@@ -0,0 +1,11 @@
1
+ export type * from '@xterm/addon-attach';
2
+ export type * from '@xterm/addon-canvas';
3
+ export type * from '@xterm/addon-clipboard';
4
+ export type * from '@xterm/addon-fit';
5
+ export type * from '@xterm/addon-image';
6
+ export type * from '@xterm/addon-ligatures';
7
+ export type * from '@xterm/addon-search';
8
+ export type * from '@xterm/addon-serialize';
9
+ export type * from '@xterm/addon-unicode11';
10
+ export type * from '@xterm/addon-web-links';
11
+ export type * from '@xterm/addon-webgl';
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -4,4 +4,5 @@ import { XtermAddon } from './XtermAddon.js';
4
4
  import type { XtermEvent } from './XtermEvent.js';
5
5
  export { Xterm, XtermAddon };
6
6
  export type * from '@xterm/xterm';
7
+ export type * from './XtermAddonType.js';
7
8
  export type { XtermEvent };
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ // Imports
1
2
  import Xterm from './Xterm.svelte';
2
3
  import { XtermAddon } from './XtermAddon.js';
4
+ // Exports
3
5
  export { Xterm, XtermAddon };
package/package.json CHANGED
@@ -1,6 +1,23 @@
1
1
  {
2
2
  "name": "@battlefieldduck/xterm-svelte",
3
- "version": "0.0.5",
3
+ "version": "1.0.0",
4
+ "description": "A SvelteKit wrapper for Xterm.js, enabling terminal embedding in SvelteKit apps, managing Xterm addons, and providing seamless updates with the latest SvelteKit and Xterm.js versions.",
5
+ "keywords": [
6
+ "svelte",
7
+ "xterm",
8
+ "xterm-js",
9
+ "sveltekit",
10
+ "xterm-svelte"
11
+ ],
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/BattlefieldDuck/xterm-svelte.git"
15
+ },
16
+ "homepage": "https://xterm-svelte.pages.dev",
17
+ "bugs": {
18
+ "url": "https://github.com/BattlefieldDuck/xterm-svelte/issues"
19
+ },
20
+ "license": "MIT",
4
21
  "scripts": {
5
22
  "dev": "vite dev",
6
23
  "build": "vite build && npm run package",
@@ -68,4 +85,4 @@
68
85
  "@xterm/addon-webgl": "^0.18.0",
69
86
  "@xterm/xterm": "^5.5.0"
70
87
  }
71
- }
88
+ }