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