silvery 0.3.0 → 0.4.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.
Files changed (88) hide show
  1. package/README.md +41 -145
  2. package/package.json +64 -12
  3. package/src/index.ts +67 -1
  4. package/src/runtime.ts +4 -0
  5. package/src/theme.ts +4 -0
  6. package/src/ui/animation.ts +2 -0
  7. package/src/ui/ansi.ts +2 -0
  8. package/src/ui/cli.ts +2 -0
  9. package/src/ui/display.ts +2 -0
  10. package/src/ui/image.ts +2 -0
  11. package/src/ui/input.ts +2 -0
  12. package/src/ui/progress.ts +2 -0
  13. package/src/ui/react.ts +2 -0
  14. package/src/ui/utils.ts +2 -0
  15. package/src/ui/wrappers.ts +2 -0
  16. package/src/ui.ts +4 -0
  17. package/examples/CLAUDE.md +0 -75
  18. package/examples/_banner.tsx +0 -60
  19. package/examples/cli.ts +0 -228
  20. package/examples/index.md +0 -101
  21. package/examples/inline/inline-nontty.tsx +0 -98
  22. package/examples/inline/inline-progress.tsx +0 -79
  23. package/examples/inline/inline-simple.tsx +0 -63
  24. package/examples/inline/scrollback.tsx +0 -185
  25. package/examples/interactive/_input-debug.tsx +0 -110
  26. package/examples/interactive/_stdin-test.ts +0 -71
  27. package/examples/interactive/_textarea-bare.tsx +0 -45
  28. package/examples/interactive/aichat/components.tsx +0 -468
  29. package/examples/interactive/aichat/index.tsx +0 -207
  30. package/examples/interactive/aichat/script.ts +0 -460
  31. package/examples/interactive/aichat/state.ts +0 -326
  32. package/examples/interactive/aichat/types.ts +0 -19
  33. package/examples/interactive/app-todo.tsx +0 -198
  34. package/examples/interactive/async-data.tsx +0 -208
  35. package/examples/interactive/cli-wizard.tsx +0 -332
  36. package/examples/interactive/clipboard.tsx +0 -183
  37. package/examples/interactive/components.tsx +0 -463
  38. package/examples/interactive/data-explorer.tsx +0 -506
  39. package/examples/interactive/dev-tools.tsx +0 -379
  40. package/examples/interactive/explorer.tsx +0 -747
  41. package/examples/interactive/gallery.tsx +0 -652
  42. package/examples/interactive/inline-bench.tsx +0 -136
  43. package/examples/interactive/kanban.tsx +0 -267
  44. package/examples/interactive/layout-ref.tsx +0 -185
  45. package/examples/interactive/outline.tsx +0 -171
  46. package/examples/interactive/paste-demo.tsx +0 -198
  47. package/examples/interactive/scroll.tsx +0 -77
  48. package/examples/interactive/search-filter.tsx +0 -240
  49. package/examples/interactive/task-list.tsx +0 -279
  50. package/examples/interactive/terminal.tsx +0 -798
  51. package/examples/interactive/textarea.tsx +0 -103
  52. package/examples/interactive/theme.tsx +0 -336
  53. package/examples/interactive/transform.tsx +0 -256
  54. package/examples/interactive/virtual-10k.tsx +0 -413
  55. package/examples/kitty/canvas.tsx +0 -519
  56. package/examples/kitty/generate-samples.ts +0 -236
  57. package/examples/kitty/image-component.tsx +0 -273
  58. package/examples/kitty/images.tsx +0 -604
  59. package/examples/kitty/input.tsx +0 -371
  60. package/examples/kitty/keys.tsx +0 -378
  61. package/examples/kitty/paint.tsx +0 -1017
  62. package/examples/layout/dashboard.tsx +0 -551
  63. package/examples/layout/live-resize.tsx +0 -290
  64. package/examples/layout/overflow.tsx +0 -51
  65. package/examples/playground/README.md +0 -69
  66. package/examples/playground/build.ts +0 -61
  67. package/examples/playground/index.html +0 -420
  68. package/examples/playground/playground-app.tsx +0 -416
  69. package/examples/runtime/elm-counter.tsx +0 -206
  70. package/examples/runtime/hello-runtime.tsx +0 -73
  71. package/examples/runtime/pipe-composition.tsx +0 -184
  72. package/examples/runtime/run-counter.tsx +0 -78
  73. package/examples/runtime/runtime-counter.tsx +0 -197
  74. package/examples/screenshots/generate.tsx +0 -563
  75. package/examples/scrollback-perf.tsx +0 -230
  76. package/examples/viewer.tsx +0 -654
  77. package/examples/web/build.ts +0 -365
  78. package/examples/web/canvas-app.tsx +0 -80
  79. package/examples/web/canvas.html +0 -89
  80. package/examples/web/dom-app.tsx +0 -81
  81. package/examples/web/dom.html +0 -113
  82. package/examples/web/showcase-app.tsx +0 -107
  83. package/examples/web/showcase.html +0 -34
  84. package/examples/web/showcases/index.tsx +0 -56
  85. package/examples/web/viewer-app.tsx +0 -555
  86. package/examples/web/viewer.html +0 -30
  87. package/examples/web/xterm-app.tsx +0 -105
  88. package/examples/web/xterm.html +0 -118
@@ -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
- &lt;Box borderStyle="single"&gt;
106
- &lt;Text&gt;Size: {width} cols x {height} rows&lt;/Text&gt;
107
- &lt;/Box&gt;
108
- );
109
- }
110
-
111
- const term = new Terminal({ cols: 80, rows: 24 });
112
- term.open(container);
113
- renderToXterm(&lt;App /&gt;, term);</code></pre>
114
- </div>
115
-
116
- <script type="module" src="./dist/xterm-app.js"></script>
117
- </body>
118
- </html>