silvery 0.3.0 → 0.4.1
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 +41 -145
- package/dist/chalk.js +3 -0
- package/dist/chalk.js.map +11 -0
- package/dist/index.js +340 -0
- package/dist/index.js.map +282 -0
- package/dist/ink.js +129 -0
- package/dist/ink.js.map +140 -0
- package/dist/runtime.js +394 -0
- package/dist/runtime.js.map +286 -0
- package/dist/theme.js +343 -0
- package/dist/theme.js.map +286 -0
- package/dist/ui/animation.js +3 -0
- package/dist/ui/animation.js.map +15 -0
- package/dist/ui/ansi.js +3 -0
- package/dist/ui/ansi.js.map +10 -0
- package/dist/ui/cli.js +8 -0
- package/dist/ui/cli.js.map +14 -0
- package/dist/ui/display.js +4 -0
- package/dist/ui/display.js.map +10 -0
- package/dist/ui/image.js +4 -0
- package/dist/ui/image.js.map +15 -0
- package/dist/ui/input.js +3 -0
- package/dist/ui/input.js.map +11 -0
- package/dist/ui/progress.js +8 -0
- package/dist/ui/progress.js.map +20 -0
- package/dist/ui/react.js +3 -0
- package/dist/ui/react.js.map +15 -0
- package/dist/ui/utils.js +3 -0
- package/dist/ui/utils.js.map +10 -0
- package/dist/ui/wrappers.js +14 -0
- package/dist/ui/wrappers.js.map +19 -0
- package/dist/ui.js +17 -0
- package/dist/ui.js.map +20 -0
- package/package.json +67 -15
- package/src/index.ts +67 -1
- package/src/runtime.ts +4 -0
- package/src/theme.ts +4 -0
- package/src/ui/animation.ts +2 -0
- package/src/ui/ansi.ts +2 -0
- package/src/ui/cli.ts +2 -0
- package/src/ui/display.ts +2 -0
- package/src/ui/image.ts +2 -0
- package/src/ui/input.ts +2 -0
- package/src/ui/progress.ts +2 -0
- package/src/ui/react.ts +2 -0
- package/src/ui/utils.ts +2 -0
- package/src/ui/wrappers.ts +2 -0
- package/src/ui.ts +4 -0
- package/examples/CLAUDE.md +0 -75
- package/examples/_banner.tsx +0 -60
- package/examples/cli.ts +0 -228
- package/examples/index.md +0 -101
- package/examples/inline/inline-nontty.tsx +0 -98
- package/examples/inline/inline-progress.tsx +0 -79
- package/examples/inline/inline-simple.tsx +0 -63
- package/examples/inline/scrollback.tsx +0 -185
- package/examples/interactive/_input-debug.tsx +0 -110
- package/examples/interactive/_stdin-test.ts +0 -71
- package/examples/interactive/_textarea-bare.tsx +0 -45
- package/examples/interactive/aichat/components.tsx +0 -468
- package/examples/interactive/aichat/index.tsx +0 -207
- package/examples/interactive/aichat/script.ts +0 -460
- package/examples/interactive/aichat/state.ts +0 -326
- package/examples/interactive/aichat/types.ts +0 -19
- package/examples/interactive/app-todo.tsx +0 -198
- package/examples/interactive/async-data.tsx +0 -208
- package/examples/interactive/cli-wizard.tsx +0 -332
- package/examples/interactive/clipboard.tsx +0 -183
- package/examples/interactive/components.tsx +0 -463
- package/examples/interactive/data-explorer.tsx +0 -506
- package/examples/interactive/dev-tools.tsx +0 -379
- package/examples/interactive/explorer.tsx +0 -747
- package/examples/interactive/gallery.tsx +0 -652
- package/examples/interactive/inline-bench.tsx +0 -136
- package/examples/interactive/kanban.tsx +0 -267
- package/examples/interactive/layout-ref.tsx +0 -185
- package/examples/interactive/outline.tsx +0 -171
- package/examples/interactive/paste-demo.tsx +0 -198
- package/examples/interactive/scroll.tsx +0 -77
- package/examples/interactive/search-filter.tsx +0 -240
- package/examples/interactive/task-list.tsx +0 -279
- package/examples/interactive/terminal.tsx +0 -798
- package/examples/interactive/textarea.tsx +0 -103
- package/examples/interactive/theme.tsx +0 -336
- package/examples/interactive/transform.tsx +0 -256
- package/examples/interactive/virtual-10k.tsx +0 -413
- package/examples/kitty/canvas.tsx +0 -519
- package/examples/kitty/generate-samples.ts +0 -236
- package/examples/kitty/image-component.tsx +0 -273
- package/examples/kitty/images.tsx +0 -604
- package/examples/kitty/input.tsx +0 -371
- package/examples/kitty/keys.tsx +0 -378
- package/examples/kitty/paint.tsx +0 -1017
- package/examples/layout/dashboard.tsx +0 -551
- package/examples/layout/live-resize.tsx +0 -290
- package/examples/layout/overflow.tsx +0 -51
- package/examples/playground/README.md +0 -69
- package/examples/playground/build.ts +0 -61
- package/examples/playground/index.html +0 -420
- package/examples/playground/playground-app.tsx +0 -416
- package/examples/runtime/elm-counter.tsx +0 -206
- package/examples/runtime/hello-runtime.tsx +0 -73
- package/examples/runtime/pipe-composition.tsx +0 -184
- package/examples/runtime/run-counter.tsx +0 -78
- package/examples/runtime/runtime-counter.tsx +0 -197
- package/examples/screenshots/generate.tsx +0 -563
- package/examples/scrollback-perf.tsx +0 -230
- package/examples/viewer.tsx +0 -654
- package/examples/web/build.ts +0 -365
- package/examples/web/canvas-app.tsx +0 -80
- package/examples/web/canvas.html +0 -89
- package/examples/web/dom-app.tsx +0 -81
- package/examples/web/dom.html +0 -113
- package/examples/web/showcase-app.tsx +0 -107
- package/examples/web/showcase.html +0 -34
- package/examples/web/showcases/index.tsx +0 -56
- package/examples/web/viewer-app.tsx +0 -555
- package/examples/web/viewer.html +0 -30
- package/examples/web/xterm-app.tsx +0 -105
- package/examples/web/xterm.html +0 -118
package/examples/web/xterm.html
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>silvery xterm.js Demo</title>
|
|
7
|
-
<link rel="stylesheet" href="../../node_modules/@xterm/xterm/css/xterm.css" />
|
|
8
|
-
<style>
|
|
9
|
-
* {
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
}
|
|
12
|
-
body {
|
|
13
|
-
margin: 0;
|
|
14
|
-
padding: 20px;
|
|
15
|
-
background: #1a1a2e;
|
|
16
|
-
color: #eee;
|
|
17
|
-
font-family: system-ui, sans-serif;
|
|
18
|
-
}
|
|
19
|
-
h1 {
|
|
20
|
-
color: #4ec9b0;
|
|
21
|
-
margin-bottom: 10px;
|
|
22
|
-
}
|
|
23
|
-
p {
|
|
24
|
-
color: #808080;
|
|
25
|
-
margin-top: 0;
|
|
26
|
-
}
|
|
27
|
-
#terminal {
|
|
28
|
-
border: 1px solid #333;
|
|
29
|
-
border-radius: 4px;
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
}
|
|
32
|
-
.info {
|
|
33
|
-
margin-top: 20px;
|
|
34
|
-
padding: 15px;
|
|
35
|
-
background: #16213e;
|
|
36
|
-
border-radius: 4px;
|
|
37
|
-
}
|
|
38
|
-
.info h3 {
|
|
39
|
-
color: #9cdcfe;
|
|
40
|
-
margin-top: 0;
|
|
41
|
-
}
|
|
42
|
-
.info ul {
|
|
43
|
-
margin: 0;
|
|
44
|
-
padding-left: 20px;
|
|
45
|
-
}
|
|
46
|
-
.info li {
|
|
47
|
-
margin: 5px 0;
|
|
48
|
-
}
|
|
49
|
-
.comparison {
|
|
50
|
-
display: flex;
|
|
51
|
-
gap: 20px;
|
|
52
|
-
margin-top: 20px;
|
|
53
|
-
}
|
|
54
|
-
.comparison > div {
|
|
55
|
-
flex: 1;
|
|
56
|
-
}
|
|
57
|
-
.comparison h3 {
|
|
58
|
-
margin-top: 0;
|
|
59
|
-
}
|
|
60
|
-
code {
|
|
61
|
-
background: #0f0f1a;
|
|
62
|
-
padding: 2px 6px;
|
|
63
|
-
border-radius: 3px;
|
|
64
|
-
font-family: monospace;
|
|
65
|
-
}
|
|
66
|
-
</style>
|
|
67
|
-
</head>
|
|
68
|
-
<body>
|
|
69
|
-
<h1>silvery xterm.js Adapter</h1>
|
|
70
|
-
<p>React components rendered to xterm.js via ANSI escape sequences</p>
|
|
71
|
-
|
|
72
|
-
<div id="terminal"></div>
|
|
73
|
-
|
|
74
|
-
<div class="comparison">
|
|
75
|
-
<div class="info">
|
|
76
|
-
<h3>xterm.js Advantages</h3>
|
|
77
|
-
<ul>
|
|
78
|
-
<li>Full ANSI/VT100 escape sequence support</li>
|
|
79
|
-
<li>True terminal rendering in the browser</li>
|
|
80
|
-
<li>Reuses silvery terminal adapter (same as native TUI)</li>
|
|
81
|
-
<li>Copy/paste, selection, accessibility built-in</li>
|
|
82
|
-
<li>WebGL renderer available for performance</li>
|
|
83
|
-
</ul>
|
|
84
|
-
</div>
|
|
85
|
-
<div class="info">
|
|
86
|
-
<h3>How It Works</h3>
|
|
87
|
-
<ul>
|
|
88
|
-
<li>silvery terminal adapter produces ANSI diff strings</li>
|
|
89
|
-
<li>xterm.js parses and renders the ANSI sequences</li>
|
|
90
|
-
<li>Same output as a real terminal (Kitty, iTerm, etc.)</li>
|
|
91
|
-
<li>Layout computed by Flexture (pure JS flexbox)</li>
|
|
92
|
-
<li>Incremental updates via buffer diffing</li>
|
|
93
|
-
</ul>
|
|
94
|
-
</div>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<div class="info">
|
|
98
|
-
<h3>Code</h3>
|
|
99
|
-
<pre><code>import { Terminal } from "@xterm/xterm";
|
|
100
|
-
import { renderToXterm, Box, Text, useContentRect } from '@silvery/term/xterm';
|
|
101
|
-
|
|
102
|
-
function App() {
|
|
103
|
-
const { width, height } = useContentRect();
|
|
104
|
-
return (
|
|
105
|
-
<Box borderStyle="single">
|
|
106
|
-
<Text>Size: {width} cols x {height} rows</Text>
|
|
107
|
-
</Box>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const term = new Terminal({ cols: 80, rows: 24 });
|
|
112
|
-
term.open(container);
|
|
113
|
-
renderToXterm(<App />, term);</code></pre>
|
|
114
|
-
</div>
|
|
115
|
-
|
|
116
|
-
<script type="module" src="./dist/xterm-app.js"></script>
|
|
117
|
-
</body>
|
|
118
|
-
</html>
|