@fairyhunter13/opentui-core 0.1.114 → 0.1.116

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 (591) hide show
  1. package/3d/SpriteResourceManager.d.ts +74 -0
  2. package/3d/SpriteUtils.d.ts +13 -0
  3. package/3d/TextureUtils.d.ts +24 -0
  4. package/3d/ThreeRenderable.d.ts +40 -0
  5. package/3d/WGPURenderer.d.ts +61 -0
  6. package/3d/animation/ExplodingSpriteEffect.d.ts +71 -0
  7. package/3d/animation/PhysicsExplodingSpriteEffect.d.ts +76 -0
  8. package/3d/animation/SpriteAnimator.d.ts +124 -0
  9. package/3d/animation/SpriteParticleGenerator.d.ts +62 -0
  10. package/3d/canvas.d.ts +44 -0
  11. package/3d/index.d.ts +12 -0
  12. package/3d/physics/PlanckPhysicsAdapter.d.ts +19 -0
  13. package/3d/physics/RapierPhysicsAdapter.d.ts +19 -0
  14. package/3d/physics/physics-interface.d.ts +27 -0
  15. package/3d.d.ts +2 -0
  16. package/3d.js +34041 -0
  17. package/3d.js.map +155 -0
  18. package/LICENSE +21 -0
  19. package/NativeSpanFeed.d.ts +41 -0
  20. package/Renderable.d.ts +334 -0
  21. package/animation/Timeline.d.ts +126 -0
  22. package/ansi.d.ts +13 -0
  23. package/buffer.d.ts +111 -0
  24. package/console.d.ts +144 -0
  25. package/edit-buffer.d.ts +98 -0
  26. package/editor-view.d.ts +73 -0
  27. package/index-dcj62y8t.js +20614 -0
  28. package/index-dcj62y8t.js.map +67 -0
  29. package/index-jyrhjc34.js +411 -0
  30. package/index-jyrhjc34.js.map +10 -0
  31. package/index-wc7ae60z.js +12299 -0
  32. package/index-wc7ae60z.js.map +42 -0
  33. package/index.d.ts +23 -0
  34. package/index.js +478 -0
  35. package/index.js.map +9 -0
  36. package/lib/KeyHandler.d.ts +61 -0
  37. package/lib/RGBA.d.ts +25 -0
  38. package/lib/ascii.font.d.ts +508 -0
  39. package/lib/border.d.ts +51 -0
  40. package/lib/bunfs.d.ts +7 -0
  41. package/lib/clipboard.d.ts +17 -0
  42. package/lib/clock.d.ts +15 -0
  43. package/lib/data-paths.d.ts +26 -0
  44. package/lib/debounce.d.ts +42 -0
  45. package/lib/detect-links.d.ts +6 -0
  46. package/lib/env.d.ts +42 -0
  47. package/lib/extmarks-history.d.ts +17 -0
  48. package/lib/extmarks.d.ts +89 -0
  49. package/lib/hast-styled-text.d.ts +17 -0
  50. package/lib/index.d.ts +21 -0
  51. package/lib/keymapping.d.ts +25 -0
  52. package/lib/objects-in-viewport.d.ts +24 -0
  53. package/lib/output.capture.d.ts +24 -0
  54. package/lib/parse.keypress-kitty.d.ts +2 -0
  55. package/lib/parse.keypress.d.ts +26 -0
  56. package/lib/parse.mouse.d.ts +30 -0
  57. package/lib/paste.d.ts +7 -0
  58. package/lib/queue.d.ts +15 -0
  59. package/lib/renderable.validations.d.ts +12 -0
  60. package/lib/scroll-acceleration.d.ts +43 -0
  61. package/lib/selection.d.ts +63 -0
  62. package/lib/singleton.d.ts +7 -0
  63. package/lib/stdin-parser.d.ts +87 -0
  64. package/lib/styled-text.d.ts +63 -0
  65. package/lib/terminal-capability-detection.d.ts +30 -0
  66. package/lib/terminal-palette.d.ts +50 -0
  67. package/lib/tree-sitter/assets/update.d.ts +11 -0
  68. package/lib/tree-sitter/client.d.ts +47 -0
  69. package/lib/tree-sitter/default-parsers.d.ts +2 -0
  70. package/lib/tree-sitter/download-utils.d.ts +21 -0
  71. package/lib/tree-sitter/index.d.ts +8 -0
  72. package/lib/tree-sitter/parser.worker.d.ts +1 -0
  73. package/lib/tree-sitter/parsers-config.d.ts +53 -0
  74. package/lib/tree-sitter/resolve-ft.d.ts +5 -0
  75. package/lib/tree-sitter/types.d.ts +82 -0
  76. package/lib/tree-sitter-styled-text.d.ts +14 -0
  77. package/lib/validate-dir-name.d.ts +1 -0
  78. package/lib/yoga.options.d.ts +32 -0
  79. package/package.json +53 -62
  80. package/parser.worker.js +899 -0
  81. package/parser.worker.js.map +12 -0
  82. package/plugins/core-slot.d.ts +72 -0
  83. package/plugins/registry.d.ts +42 -0
  84. package/plugins/types.d.ts +34 -0
  85. package/post/effects.d.ts +147 -0
  86. package/post/filters.d.ts +65 -0
  87. package/post/matrices.d.ts +20 -0
  88. package/renderables/ASCIIFont.d.ts +52 -0
  89. package/renderables/Box.d.ts +81 -0
  90. package/renderables/Code.d.ts +78 -0
  91. package/renderables/Diff.d.ts +142 -0
  92. package/renderables/EditBufferRenderable.d.ts +237 -0
  93. package/renderables/FrameBuffer.d.ts +16 -0
  94. package/renderables/Input.d.ts +67 -0
  95. package/renderables/LineNumberRenderable.d.ts +78 -0
  96. package/renderables/Markdown.d.ts +185 -0
  97. package/renderables/ScrollBar.d.ts +77 -0
  98. package/renderables/ScrollBox.d.ts +124 -0
  99. package/renderables/Select.d.ts +115 -0
  100. package/renderables/Slider.d.ts +47 -0
  101. package/renderables/TabSelect.d.ts +96 -0
  102. package/renderables/Text.d.ts +36 -0
  103. package/renderables/TextBufferRenderable.d.ts +105 -0
  104. package/renderables/TextNode.d.ts +91 -0
  105. package/renderables/TextTable.d.ts +140 -0
  106. package/renderables/Textarea.d.ts +63 -0
  107. package/renderables/TimeToFirstDraw.d.ts +24 -0
  108. package/renderables/__tests__/renderable-test-utils.d.ts +12 -0
  109. package/renderables/composition/VRenderable.d.ts +16 -0
  110. package/renderables/composition/constructs.d.ts +35 -0
  111. package/renderables/composition/vnode.d.ts +46 -0
  112. package/renderables/index.d.ts +23 -0
  113. package/renderables/markdown-parser.d.ts +10 -0
  114. package/renderer.d.ts +419 -0
  115. package/runtime-plugin-support.d.ts +3 -0
  116. package/runtime-plugin-support.js +29 -0
  117. package/runtime-plugin-support.js.map +10 -0
  118. package/runtime-plugin.d.ts +16 -0
  119. package/runtime-plugin.js +16 -0
  120. package/runtime-plugin.js.map +9 -0
  121. package/syntax-style.d.ts +54 -0
  122. package/testing/manual-clock.d.ts +17 -0
  123. package/testing/mock-keys.d.ts +81 -0
  124. package/testing/mock-mouse.d.ts +38 -0
  125. package/testing/mock-tree-sitter-client.d.ts +23 -0
  126. package/testing/spy.d.ts +7 -0
  127. package/testing/test-recorder.d.ts +61 -0
  128. package/testing/test-renderer.d.ts +23 -0
  129. package/testing.d.ts +6 -0
  130. package/testing.js +697 -0
  131. package/testing.js.map +15 -0
  132. package/text-buffer-view.d.ts +42 -0
  133. package/text-buffer.d.ts +67 -0
  134. package/types.d.ts +139 -0
  135. package/utils.d.ts +14 -0
  136. package/zig-structs.d.ts +155 -0
  137. package/zig.d.ts +353 -0
  138. package/dev/keypress-debug-renderer.ts +0 -148
  139. package/dev/keypress-debug.ts +0 -43
  140. package/dev/print-env-vars.ts +0 -32
  141. package/dev/test-tmux-graphics-334.sh +0 -68
  142. package/dev/thai-debug-test.ts +0 -68
  143. package/docs/development.md +0 -144
  144. package/scripts/build.ts +0 -400
  145. package/scripts/publish.ts +0 -60
  146. package/src/3d/SpriteResourceManager.ts +0 -286
  147. package/src/3d/SpriteUtils.ts +0 -70
  148. package/src/3d/TextureUtils.ts +0 -196
  149. package/src/3d/ThreeRenderable.ts +0 -197
  150. package/src/3d/WGPURenderer.ts +0 -294
  151. package/src/3d/animation/ExplodingSpriteEffect.ts +0 -513
  152. package/src/3d/animation/PhysicsExplodingSpriteEffect.ts +0 -429
  153. package/src/3d/animation/SpriteAnimator.ts +0 -633
  154. package/src/3d/animation/SpriteParticleGenerator.ts +0 -435
  155. package/src/3d/canvas.ts +0 -464
  156. package/src/3d/index.ts +0 -12
  157. package/src/3d/physics/PlanckPhysicsAdapter.ts +0 -72
  158. package/src/3d/physics/RapierPhysicsAdapter.ts +0 -66
  159. package/src/3d/physics/physics-interface.ts +0 -31
  160. package/src/3d/shaders/supersampling.wgsl +0 -201
  161. package/src/3d.ts +0 -3
  162. package/src/NativeSpanFeed.ts +0 -300
  163. package/src/Renderable.ts +0 -1704
  164. package/src/__snapshots__/buffer.test.ts.snap +0 -28
  165. package/src/animation/Timeline.test.ts +0 -2709
  166. package/src/animation/Timeline.ts +0 -598
  167. package/src/ansi.ts +0 -18
  168. package/src/benchmark/attenuation-benchmark.ts +0 -81
  169. package/src/benchmark/colormatrix-benchmark.ts +0 -128
  170. package/src/benchmark/gain-benchmark.ts +0 -80
  171. package/src/benchmark/latest-all-bench-run.json +0 -707
  172. package/src/benchmark/latest-async-bench-run.json +0 -336
  173. package/src/benchmark/latest-default-bench-run.json +0 -657
  174. package/src/benchmark/latest-large-bench-run.json +0 -707
  175. package/src/benchmark/latest-quick-bench-run.json +0 -207
  176. package/src/benchmark/markdown-benchmark.ts +0 -1796
  177. package/src/benchmark/native-span-feed-async-benchmark.ts +0 -355
  178. package/src/benchmark/native-span-feed-benchmark.md +0 -56
  179. package/src/benchmark/native-span-feed-benchmark.ts +0 -596
  180. package/src/benchmark/native-span-feed-compare.ts +0 -280
  181. package/src/benchmark/renderer-benchmark.ts +0 -754
  182. package/src/benchmark/text-table-benchmark.ts +0 -948
  183. package/src/buffer.test.ts +0 -291
  184. package/src/buffer.ts +0 -554
  185. package/src/console.test.ts +0 -612
  186. package/src/console.ts +0 -1254
  187. package/src/edit-buffer.test.ts +0 -1769
  188. package/src/edit-buffer.ts +0 -411
  189. package/src/editor-view.test.ts +0 -1032
  190. package/src/editor-view.ts +0 -284
  191. package/src/examples/ascii-font-selection-demo.ts +0 -245
  192. package/src/examples/assets/Water_2_M_Normal.jpg +0 -0
  193. package/src/examples/assets/concrete.png +0 -0
  194. package/src/examples/assets/crate.png +0 -0
  195. package/src/examples/assets/crate_emissive.png +0 -0
  196. package/src/examples/assets/forrest_background.png +0 -0
  197. package/src/examples/assets/hast-example.json +0 -1018
  198. package/src/examples/assets/heart.png +0 -0
  199. package/src/examples/assets/main_char_heavy_attack.png +0 -0
  200. package/src/examples/assets/main_char_idle.png +0 -0
  201. package/src/examples/assets/main_char_jump_end.png +0 -0
  202. package/src/examples/assets/main_char_jump_landing.png +0 -0
  203. package/src/examples/assets/main_char_jump_start.png +0 -0
  204. package/src/examples/assets/main_char_run_loop.png +0 -0
  205. package/src/examples/assets/roughness_map.jpg +0 -0
  206. package/src/examples/build.ts +0 -115
  207. package/src/examples/code-demo.ts +0 -924
  208. package/src/examples/console-demo.ts +0 -358
  209. package/src/examples/core-plugin-slots-demo.ts +0 -759
  210. package/src/examples/diff-demo.ts +0 -701
  211. package/src/examples/draggable-three-demo.ts +0 -259
  212. package/src/examples/editor-demo.ts +0 -322
  213. package/src/examples/extmarks-demo.ts +0 -196
  214. package/src/examples/focus-restore-demo.ts +0 -310
  215. package/src/examples/fonts.ts +0 -245
  216. package/src/examples/fractal-shader-demo.ts +0 -268
  217. package/src/examples/framebuffer-demo.ts +0 -674
  218. package/src/examples/full-unicode-demo.ts +0 -241
  219. package/src/examples/golden-star-demo.ts +0 -933
  220. package/src/examples/grayscale-buffer-demo.ts +0 -249
  221. package/src/examples/hast-syntax-highlighting-demo.ts +0 -129
  222. package/src/examples/index.ts +0 -926
  223. package/src/examples/input-demo.ts +0 -377
  224. package/src/examples/input-select-layout-demo.ts +0 -425
  225. package/src/examples/install.sh +0 -143
  226. package/src/examples/keypress-debug-demo.ts +0 -452
  227. package/src/examples/lib/HexList.ts +0 -122
  228. package/src/examples/lib/PaletteGrid.ts +0 -125
  229. package/src/examples/lib/standalone-keys.ts +0 -25
  230. package/src/examples/lib/tab-controller.ts +0 -243
  231. package/src/examples/lights-phong-demo.ts +0 -290
  232. package/src/examples/link-demo.ts +0 -220
  233. package/src/examples/live-state-demo.ts +0 -480
  234. package/src/examples/markdown-demo.ts +0 -725
  235. package/src/examples/mouse-interaction-demo.ts +0 -428
  236. package/src/examples/nested-zindex-demo.ts +0 -357
  237. package/src/examples/opacity-example.ts +0 -235
  238. package/src/examples/opentui-demo.ts +0 -1057
  239. package/src/examples/physx-planck-2d-demo.ts +0 -623
  240. package/src/examples/physx-rapier-2d-demo.ts +0 -655
  241. package/src/examples/relative-positioning-demo.ts +0 -323
  242. package/src/examples/scroll-example.ts +0 -214
  243. package/src/examples/scrollbox-mouse-test.ts +0 -112
  244. package/src/examples/scrollbox-overlay-hit-test.ts +0 -206
  245. package/src/examples/select-demo.ts +0 -237
  246. package/src/examples/shader-cube-demo.ts +0 -1015
  247. package/src/examples/simple-layout-example.ts +0 -591
  248. package/src/examples/slider-demo.ts +0 -617
  249. package/src/examples/split-mode-demo.ts +0 -453
  250. package/src/examples/sprite-animation-demo.ts +0 -443
  251. package/src/examples/sprite-particle-generator-demo.ts +0 -486
  252. package/src/examples/static-sprite-demo.ts +0 -193
  253. package/src/examples/sticky-scroll-example.ts +0 -308
  254. package/src/examples/styled-text-demo.ts +0 -282
  255. package/src/examples/tab-select-demo.ts +0 -219
  256. package/src/examples/terminal-title.ts +0 -29
  257. package/src/examples/terminal.ts +0 -305
  258. package/src/examples/text-node-demo.ts +0 -416
  259. package/src/examples/text-selection-demo.ts +0 -377
  260. package/src/examples/text-table-demo.ts +0 -503
  261. package/src/examples/text-truncation-demo.ts +0 -481
  262. package/src/examples/text-wrap.ts +0 -757
  263. package/src/examples/texture-loading-demo.ts +0 -259
  264. package/src/examples/timeline-example.ts +0 -670
  265. package/src/examples/transparency-demo.ts +0 -400
  266. package/src/examples/vnode-composition-demo.ts +0 -404
  267. package/src/examples/wide-grapheme-overlay-demo.ts +0 -280
  268. package/src/index.ts +0 -24
  269. package/src/lib/KeyHandler.integration.test.ts +0 -292
  270. package/src/lib/KeyHandler.stopPropagation.test.ts +0 -289
  271. package/src/lib/KeyHandler.test.ts +0 -662
  272. package/src/lib/KeyHandler.ts +0 -222
  273. package/src/lib/RGBA.test.ts +0 -984
  274. package/src/lib/RGBA.ts +0 -204
  275. package/src/lib/ascii.font.ts +0 -330
  276. package/src/lib/border.test.ts +0 -83
  277. package/src/lib/border.ts +0 -170
  278. package/src/lib/bunfs.test.ts +0 -27
  279. package/src/lib/bunfs.ts +0 -18
  280. package/src/lib/clipboard.test.ts +0 -41
  281. package/src/lib/clipboard.ts +0 -47
  282. package/src/lib/clock.ts +0 -35
  283. package/src/lib/data-paths.test.ts +0 -133
  284. package/src/lib/data-paths.ts +0 -109
  285. package/src/lib/debounce.ts +0 -106
  286. package/src/lib/detect-links.test.ts +0 -98
  287. package/src/lib/detect-links.ts +0 -56
  288. package/src/lib/env.test.ts +0 -228
  289. package/src/lib/env.ts +0 -209
  290. package/src/lib/extmarks-history.ts +0 -51
  291. package/src/lib/extmarks-multiwidth.test.ts +0 -322
  292. package/src/lib/extmarks.test.ts +0 -3457
  293. package/src/lib/extmarks.ts +0 -843
  294. package/src/lib/fonts/block.json +0 -405
  295. package/src/lib/fonts/grid.json +0 -265
  296. package/src/lib/fonts/huge.json +0 -741
  297. package/src/lib/fonts/pallet.json +0 -314
  298. package/src/lib/fonts/shade.json +0 -591
  299. package/src/lib/fonts/slick.json +0 -321
  300. package/src/lib/fonts/tiny.json +0 -69
  301. package/src/lib/hast-styled-text.ts +0 -59
  302. package/src/lib/index.ts +0 -21
  303. package/src/lib/keymapping.test.ts +0 -317
  304. package/src/lib/keymapping.ts +0 -115
  305. package/src/lib/objects-in-viewport.test.ts +0 -787
  306. package/src/lib/objects-in-viewport.ts +0 -153
  307. package/src/lib/output.capture.ts +0 -58
  308. package/src/lib/parse.keypress-kitty.protocol.test.ts +0 -340
  309. package/src/lib/parse.keypress-kitty.test.ts +0 -663
  310. package/src/lib/parse.keypress-kitty.ts +0 -439
  311. package/src/lib/parse.keypress.test.ts +0 -1849
  312. package/src/lib/parse.keypress.ts +0 -397
  313. package/src/lib/parse.mouse.test.ts +0 -552
  314. package/src/lib/parse.mouse.ts +0 -232
  315. package/src/lib/paste.ts +0 -16
  316. package/src/lib/queue.ts +0 -65
  317. package/src/lib/renderable.validations.test.ts +0 -87
  318. package/src/lib/renderable.validations.ts +0 -83
  319. package/src/lib/scroll-acceleration.ts +0 -98
  320. package/src/lib/selection.ts +0 -240
  321. package/src/lib/singleton.ts +0 -28
  322. package/src/lib/stdin-parser.test.ts +0 -2290
  323. package/src/lib/stdin-parser.ts +0 -1810
  324. package/src/lib/styled-text.ts +0 -178
  325. package/src/lib/terminal-capability-detection.test.ts +0 -202
  326. package/src/lib/terminal-capability-detection.ts +0 -79
  327. package/src/lib/terminal-palette.test.ts +0 -878
  328. package/src/lib/terminal-palette.ts +0 -383
  329. package/src/lib/tree-sitter/assets/README.md +0 -118
  330. package/src/lib/tree-sitter/assets/update.ts +0 -334
  331. package/src/lib/tree-sitter/assets.d.ts +0 -9
  332. package/src/lib/tree-sitter/cache.test.ts +0 -273
  333. package/src/lib/tree-sitter/client.test.ts +0 -1165
  334. package/src/lib/tree-sitter/client.ts +0 -607
  335. package/src/lib/tree-sitter/default-parsers.ts +0 -86
  336. package/src/lib/tree-sitter/download-utils.ts +0 -148
  337. package/src/lib/tree-sitter/index.ts +0 -28
  338. package/src/lib/tree-sitter/parser.worker.ts +0 -1042
  339. package/src/lib/tree-sitter/parsers-config.ts +0 -81
  340. package/src/lib/tree-sitter/resolve-ft.test.ts +0 -55
  341. package/src/lib/tree-sitter/resolve-ft.ts +0 -189
  342. package/src/lib/tree-sitter/types.ts +0 -82
  343. package/src/lib/tree-sitter-styled-text.test.ts +0 -1253
  344. package/src/lib/tree-sitter-styled-text.ts +0 -306
  345. package/src/lib/validate-dir-name.ts +0 -55
  346. package/src/lib/yoga.options.test.ts +0 -628
  347. package/src/lib/yoga.options.ts +0 -346
  348. package/src/plugins/core-slot.ts +0 -579
  349. package/src/plugins/registry.ts +0 -402
  350. package/src/plugins/types.ts +0 -46
  351. package/src/post/effects.ts +0 -930
  352. package/src/post/filters.ts +0 -489
  353. package/src/post/matrices.ts +0 -288
  354. package/src/renderables/ASCIIFont.ts +0 -219
  355. package/src/renderables/Box.test.ts +0 -205
  356. package/src/renderables/Box.ts +0 -326
  357. package/src/renderables/Code.test.ts +0 -2062
  358. package/src/renderables/Code.ts +0 -357
  359. package/src/renderables/Diff.regression.test.ts +0 -226
  360. package/src/renderables/Diff.test.ts +0 -3101
  361. package/src/renderables/Diff.ts +0 -1211
  362. package/src/renderables/EditBufferRenderable.test.ts +0 -288
  363. package/src/renderables/EditBufferRenderable.ts +0 -1166
  364. package/src/renderables/FrameBuffer.ts +0 -47
  365. package/src/renderables/Input.test.ts +0 -1228
  366. package/src/renderables/Input.ts +0 -247
  367. package/src/renderables/LineNumberRenderable.ts +0 -724
  368. package/src/renderables/Markdown.ts +0 -1393
  369. package/src/renderables/ScrollBar.ts +0 -422
  370. package/src/renderables/ScrollBox.ts +0 -883
  371. package/src/renderables/Select.test.ts +0 -1033
  372. package/src/renderables/Select.ts +0 -524
  373. package/src/renderables/Slider.test.ts +0 -456
  374. package/src/renderables/Slider.ts +0 -342
  375. package/src/renderables/TabSelect.test.ts +0 -197
  376. package/src/renderables/TabSelect.ts +0 -455
  377. package/src/renderables/Text.selection-buffer.test.ts +0 -123
  378. package/src/renderables/Text.test.ts +0 -2660
  379. package/src/renderables/Text.ts +0 -147
  380. package/src/renderables/TextBufferRenderable.ts +0 -518
  381. package/src/renderables/TextNode.test.ts +0 -1058
  382. package/src/renderables/TextNode.ts +0 -325
  383. package/src/renderables/TextTable.test.ts +0 -1421
  384. package/src/renderables/TextTable.ts +0 -1344
  385. package/src/renderables/Textarea.ts +0 -430
  386. package/src/renderables/TimeToFirstDraw.ts +0 -89
  387. package/src/renderables/__snapshots__/Code.test.ts.snap +0 -13
  388. package/src/renderables/__snapshots__/Diff.test.ts.snap +0 -785
  389. package/src/renderables/__snapshots__/Text.test.ts.snap +0 -421
  390. package/src/renderables/__snapshots__/TextTable.test.ts.snap +0 -215
  391. package/src/renderables/__tests__/LineNumberRenderable.scrollbox-simple.test.ts +0 -144
  392. package/src/renderables/__tests__/LineNumberRenderable.scrollbox.test.ts +0 -816
  393. package/src/renderables/__tests__/LineNumberRenderable.test.ts +0 -1865
  394. package/src/renderables/__tests__/LineNumberRenderable.wrapping.test.ts +0 -85
  395. package/src/renderables/__tests__/Markdown.code-colors.test.ts +0 -242
  396. package/src/renderables/__tests__/Markdown.test.ts +0 -2518
  397. package/src/renderables/__tests__/MultiRenderable.selection.test.ts +0 -87
  398. package/src/renderables/__tests__/Textarea.buffer.test.ts +0 -682
  399. package/src/renderables/__tests__/Textarea.destroyed-events.test.ts +0 -675
  400. package/src/renderables/__tests__/Textarea.editing.test.ts +0 -2041
  401. package/src/renderables/__tests__/Textarea.error-handling.test.ts +0 -35
  402. package/src/renderables/__tests__/Textarea.events.test.ts +0 -738
  403. package/src/renderables/__tests__/Textarea.highlights.test.ts +0 -590
  404. package/src/renderables/__tests__/Textarea.keybinding.test.ts +0 -3149
  405. package/src/renderables/__tests__/Textarea.paste.test.ts +0 -357
  406. package/src/renderables/__tests__/Textarea.rendering.test.ts +0 -1866
  407. package/src/renderables/__tests__/Textarea.scroll.test.ts +0 -733
  408. package/src/renderables/__tests__/Textarea.selection.test.ts +0 -1590
  409. package/src/renderables/__tests__/Textarea.stress.test.ts +0 -670
  410. package/src/renderables/__tests__/Textarea.undo-redo.test.ts +0 -383
  411. package/src/renderables/__tests__/Textarea.visual-lines.test.ts +0 -310
  412. package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.code.test.ts.snap +0 -221
  413. package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.scrollbox-simple.test.ts.snap +0 -89
  414. package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.scrollbox.test.ts.snap +0 -457
  415. package/src/renderables/__tests__/__snapshots__/LineNumberRenderable.test.ts.snap +0 -158
  416. package/src/renderables/__tests__/__snapshots__/Textarea.rendering.test.ts.snap +0 -387
  417. package/src/renderables/__tests__/markdown-parser.test.ts +0 -217
  418. package/src/renderables/__tests__/renderable-test-utils.ts +0 -60
  419. package/src/renderables/composition/README.md +0 -8
  420. package/src/renderables/composition/VRenderable.ts +0 -32
  421. package/src/renderables/composition/constructs.ts +0 -127
  422. package/src/renderables/composition/vnode.ts +0 -289
  423. package/src/renderables/index.ts +0 -23
  424. package/src/renderables/markdown-parser.ts +0 -66
  425. package/src/renderer.ts +0 -2681
  426. package/src/runtime-plugin-support.ts +0 -39
  427. package/src/runtime-plugin.ts +0 -615
  428. package/src/syntax-style.test.ts +0 -841
  429. package/src/syntax-style.ts +0 -257
  430. package/src/testing/README.md +0 -210
  431. package/src/testing/capture-spans.test.ts +0 -194
  432. package/src/testing/integration.test.ts +0 -276
  433. package/src/testing/manual-clock.ts +0 -117
  434. package/src/testing/mock-keys.test.ts +0 -1378
  435. package/src/testing/mock-keys.ts +0 -457
  436. package/src/testing/mock-mouse.test.ts +0 -218
  437. package/src/testing/mock-mouse.ts +0 -247
  438. package/src/testing/mock-tree-sitter-client.ts +0 -73
  439. package/src/testing/spy.ts +0 -13
  440. package/src/testing/test-recorder.test.ts +0 -415
  441. package/src/testing/test-recorder.ts +0 -145
  442. package/src/testing/test-renderer.ts +0 -132
  443. package/src/testing.ts +0 -7
  444. package/src/tests/__snapshots__/absolute-positioning.snapshot.test.ts.snap +0 -481
  445. package/src/tests/__snapshots__/renderable.snapshot.test.ts.snap +0 -19
  446. package/src/tests/__snapshots__/scrollbox.test.ts.snap +0 -29
  447. package/src/tests/absolute-positioning.snapshot.test.ts +0 -638
  448. package/src/tests/allocator-stats.test.ts +0 -38
  449. package/src/tests/destroy-during-render.test.ts +0 -200
  450. package/src/tests/destroy-on-exit.fixture.ts +0 -36
  451. package/src/tests/destroy-on-exit.test.ts +0 -41
  452. package/src/tests/hover-cursor.test.ts +0 -98
  453. package/src/tests/native-span-feed-async.test.ts +0 -173
  454. package/src/tests/native-span-feed-close.test.ts +0 -120
  455. package/src/tests/native-span-feed-coverage.test.ts +0 -227
  456. package/src/tests/native-span-feed-edge-cases.test.ts +0 -352
  457. package/src/tests/native-span-feed-use-after-free.test.ts +0 -45
  458. package/src/tests/opacity.test.ts +0 -123
  459. package/src/tests/renderable.snapshot.test.ts +0 -524
  460. package/src/tests/renderable.test.ts +0 -1281
  461. package/src/tests/renderer.clock.test.ts +0 -158
  462. package/src/tests/renderer.console-startup.test.ts +0 -185
  463. package/src/tests/renderer.control.test.ts +0 -425
  464. package/src/tests/renderer.core-slot-binding.test.ts +0 -952
  465. package/src/tests/renderer.cursor.test.ts +0 -26
  466. package/src/tests/renderer.destroy-during-render.test.ts +0 -147
  467. package/src/tests/renderer.focus-restore.test.ts +0 -257
  468. package/src/tests/renderer.focus.test.ts +0 -294
  469. package/src/tests/renderer.idle.test.ts +0 -219
  470. package/src/tests/renderer.input.test.ts +0 -2237
  471. package/src/tests/renderer.kitty-flags.test.ts +0 -195
  472. package/src/tests/renderer.mouse.test.ts +0 -1274
  473. package/src/tests/renderer.palette.test.ts +0 -629
  474. package/src/tests/renderer.selection.test.ts +0 -49
  475. package/src/tests/renderer.slot-registry.test.ts +0 -684
  476. package/src/tests/renderer.useMouse.test.ts +0 -47
  477. package/src/tests/runtime-plugin-node-modules-cycle.fixture.ts +0 -76
  478. package/src/tests/runtime-plugin-node-modules-mjs.fixture.ts +0 -43
  479. package/src/tests/runtime-plugin-node-modules-no-bare-rewrite.fixture.ts +0 -67
  480. package/src/tests/runtime-plugin-node-modules-package-type-cache.fixture.ts +0 -72
  481. package/src/tests/runtime-plugin-node-modules-runtime-specifier.fixture.ts +0 -44
  482. package/src/tests/runtime-plugin-node-modules-scoped-package-bare-rewrite.fixture.ts +0 -85
  483. package/src/tests/runtime-plugin-path-alias.fixture.ts +0 -43
  484. package/src/tests/runtime-plugin-resolve-roots.fixture.ts +0 -65
  485. package/src/tests/runtime-plugin-support.fixture.ts +0 -11
  486. package/src/tests/runtime-plugin-support.test.ts +0 -19
  487. package/src/tests/runtime-plugin-windows-file-url.fixture.ts +0 -30
  488. package/src/tests/runtime-plugin.fixture.ts +0 -40
  489. package/src/tests/runtime-plugin.test.ts +0 -354
  490. package/src/tests/scrollbox-culling-bug.test.ts +0 -114
  491. package/src/tests/scrollbox-hitgrid-resize.test.ts +0 -136
  492. package/src/tests/scrollbox-hitgrid.test.ts +0 -909
  493. package/src/tests/scrollbox.test.ts +0 -1530
  494. package/src/tests/wrap-resize-perf.test.ts +0 -276
  495. package/src/tests/yoga-setters.test.ts +0 -921
  496. package/src/text-buffer-view.test.ts +0 -705
  497. package/src/text-buffer-view.ts +0 -189
  498. package/src/text-buffer.test.ts +0 -347
  499. package/src/text-buffer.ts +0 -250
  500. package/src/types.ts +0 -161
  501. package/src/utils.ts +0 -88
  502. package/src/zig/ansi.zig +0 -268
  503. package/src/zig/bench/README.md +0 -50
  504. package/src/zig/bench/buffer-draw-text-buffer_bench.zig +0 -887
  505. package/src/zig/bench/edit-buffer_bench.zig +0 -476
  506. package/src/zig/bench/native-span-feed_bench.zig +0 -100
  507. package/src/zig/bench/rope-markers_bench.zig +0 -713
  508. package/src/zig/bench/rope_bench.zig +0 -514
  509. package/src/zig/bench/styled-text_bench.zig +0 -470
  510. package/src/zig/bench/text-buffer-coords_bench.zig +0 -362
  511. package/src/zig/bench/text-buffer-view_bench.zig +0 -459
  512. package/src/zig/bench/text-chunk-graphemes_bench.zig +0 -273
  513. package/src/zig/bench/utf8_bench.zig +0 -799
  514. package/src/zig/bench-utils.zig +0 -431
  515. package/src/zig/bench.zig +0 -217
  516. package/src/zig/buffer-methods.zig +0 -211
  517. package/src/zig/buffer.zig +0 -2281
  518. package/src/zig/build.zig +0 -289
  519. package/src/zig/build.zig.zon +0 -16
  520. package/src/zig/edit-buffer.zig +0 -825
  521. package/src/zig/editor-view.zig +0 -802
  522. package/src/zig/event-bus.zig +0 -13
  523. package/src/zig/event-emitter.zig +0 -65
  524. package/src/zig/file-logger.zig +0 -92
  525. package/src/zig/grapheme.zig +0 -599
  526. package/src/zig/lib.zig +0 -1854
  527. package/src/zig/link.zig +0 -333
  528. package/src/zig/logger.zig +0 -43
  529. package/src/zig/mem-registry.zig +0 -125
  530. package/src/zig/native-span-feed-bench-lib.zig +0 -7
  531. package/src/zig/native-span-feed.zig +0 -708
  532. package/src/zig/renderer.zig +0 -1393
  533. package/src/zig/rope.zig +0 -1220
  534. package/src/zig/syntax-style.zig +0 -161
  535. package/src/zig/terminal.zig +0 -987
  536. package/src/zig/test.zig +0 -72
  537. package/src/zig/tests/README.md +0 -18
  538. package/src/zig/tests/buffer-methods_test.zig +0 -1109
  539. package/src/zig/tests/buffer_test.zig +0 -2557
  540. package/src/zig/tests/edit-buffer-history_test.zig +0 -271
  541. package/src/zig/tests/edit-buffer_test.zig +0 -1689
  542. package/src/zig/tests/editor-view_test.zig +0 -3299
  543. package/src/zig/tests/event-emitter_test.zig +0 -249
  544. package/src/zig/tests/grapheme_test.zig +0 -1304
  545. package/src/zig/tests/link_test.zig +0 -190
  546. package/src/zig/tests/mem-registry_test.zig +0 -473
  547. package/src/zig/tests/memory_leak_regression_test.zig +0 -159
  548. package/src/zig/tests/native-span-feed_test.zig +0 -1264
  549. package/src/zig/tests/renderer_test.zig +0 -1017
  550. package/src/zig/tests/rope-nested_test.zig +0 -712
  551. package/src/zig/tests/rope_fuzz_test.zig +0 -238
  552. package/src/zig/tests/rope_test.zig +0 -2362
  553. package/src/zig/tests/segment-merge.test.zig +0 -148
  554. package/src/zig/tests/syntax-style_test.zig +0 -557
  555. package/src/zig/tests/terminal_test.zig +0 -754
  556. package/src/zig/tests/text-buffer-drawing_test.zig +0 -3237
  557. package/src/zig/tests/text-buffer-highlights_test.zig +0 -666
  558. package/src/zig/tests/text-buffer-iterators_test.zig +0 -776
  559. package/src/zig/tests/text-buffer-segment_test.zig +0 -320
  560. package/src/zig/tests/text-buffer-selection_test.zig +0 -1035
  561. package/src/zig/tests/text-buffer-selection_viewport_test.zig +0 -358
  562. package/src/zig/tests/text-buffer-view_test.zig +0 -3649
  563. package/src/zig/tests/text-buffer_test.zig +0 -2191
  564. package/src/zig/tests/unicode-width-map.zon +0 -3909
  565. package/src/zig/tests/utf8_no_zwj_test.zig +0 -260
  566. package/src/zig/tests/utf8_test.zig +0 -4057
  567. package/src/zig/tests/utf8_wcwidth_cursor_test.zig +0 -267
  568. package/src/zig/tests/utf8_wcwidth_test.zig +0 -357
  569. package/src/zig/tests/word-wrap-editing_test.zig +0 -498
  570. package/src/zig/tests/wrap-cache-perf_test.zig +0 -113
  571. package/src/zig/text-buffer-iterators.zig +0 -499
  572. package/src/zig/text-buffer-segment.zig +0 -404
  573. package/src/zig/text-buffer-view.zig +0 -1371
  574. package/src/zig/text-buffer.zig +0 -1180
  575. package/src/zig/utf8.zig +0 -1948
  576. package/src/zig/utils.zig +0 -9
  577. package/src/zig-structs.ts +0 -261
  578. package/src/zig.ts +0 -3884
  579. package/tsconfig.build.json +0 -24
  580. package/tsconfig.json +0 -27
  581. /package/{src/lib/tree-sitter/assets → assets}/javascript/highlights.scm +0 -0
  582. /package/{src/lib/tree-sitter/assets → assets}/javascript/tree-sitter-javascript.wasm +0 -0
  583. /package/{src/lib/tree-sitter/assets → assets}/markdown/highlights.scm +0 -0
  584. /package/{src/lib/tree-sitter/assets → assets}/markdown/injections.scm +0 -0
  585. /package/{src/lib/tree-sitter/assets → assets}/markdown/tree-sitter-markdown.wasm +0 -0
  586. /package/{src/lib/tree-sitter/assets → assets}/markdown_inline/highlights.scm +0 -0
  587. /package/{src/lib/tree-sitter/assets → assets}/markdown_inline/tree-sitter-markdown_inline.wasm +0 -0
  588. /package/{src/lib/tree-sitter/assets → assets}/typescript/highlights.scm +0 -0
  589. /package/{src/lib/tree-sitter/assets → assets}/typescript/tree-sitter-typescript.wasm +0 -0
  590. /package/{src/lib/tree-sitter/assets → assets}/zig/highlights.scm +0 -0
  591. /package/{src/lib/tree-sitter/assets → assets}/zig/tree-sitter-zig.wasm +0 -0
@@ -1,926 +0,0 @@
1
- #!/usr/bin/env bun
2
-
3
- import {
4
- ASCIIFontRenderable,
5
- BoxRenderable,
6
- CliRenderer,
7
- createCliRenderer,
8
- FrameBufferRenderable,
9
- RGBA,
10
- SelectRenderable,
11
- SelectRenderableEvents,
12
- TextareaRenderable,
13
- TextRenderable,
14
- TimeToFirstDrawRenderable,
15
- type KeyEvent,
16
- type SelectOption,
17
- type ThemeMode,
18
- } from "../index.js"
19
- import { measureText } from "../lib/ascii.font.js"
20
- import * as goldenStarDemo from "./golden-star-demo.js"
21
- import * as boxExample from "./fonts.js"
22
- import * as fractalShaderExample from "./fractal-shader-demo.js"
23
- import * as framebufferExample from "./framebuffer-demo.js"
24
- import * as lightsPhongExample from "./lights-phong-demo.js"
25
- import * as physxPlanckExample from "./physx-planck-2d-demo.js"
26
- import * as physxRapierExample from "./physx-rapier-2d-demo.js"
27
- import * as opentuiDemo from "./opentui-demo.js"
28
- import * as nestedZIndexDemo from "./nested-zindex-demo.js"
29
- import * as relativePositioningDemo from "./relative-positioning-demo.js"
30
- import * as transparencyDemo from "./transparency-demo.js"
31
- import * as draggableThreeDemo from "./draggable-three-demo.js"
32
- import * as scrollExample from "./scroll-example.js"
33
- import * as stickyScrollExample from "./sticky-scroll-example.js"
34
- import * as shaderCubeExample from "./shader-cube-demo.js"
35
- import * as spriteAnimationExample from "./sprite-animation-demo.js"
36
- import * as spriteParticleExample from "./sprite-particle-generator-demo.js"
37
- import * as staticSpriteExample from "./static-sprite-demo.js"
38
- import * as textureLoadingExample from "./texture-loading-demo.js"
39
- import * as timelineExample from "./timeline-example.js"
40
- import * as tabSelectExample from "./tab-select-demo.js"
41
- import * as selectExample from "./select-demo.js"
42
- import * as inputExample from "./input-demo.js"
43
- import * as layoutExample from "./simple-layout-example.js"
44
- import * as inputSelectLayoutExample from "./input-select-layout-demo.js"
45
- import * as styledTextExample from "./styled-text-demo.js"
46
- import * as textTableExample from "./text-table-demo.js"
47
- import * as mouseInteractionExample from "./mouse-interaction-demo.js"
48
- import * as textSelectionExample from "./text-selection-demo.js"
49
- import * as asciiFontSelectionExample from "./ascii-font-selection-demo.js"
50
- import * as splitModeExample from "./split-mode-demo.js"
51
- import * as consoleExample from "./console-demo.js"
52
- import * as vnodeCompositionDemo from "./vnode-composition-demo.js"
53
- import * as hastSyntaxHighlightingExample from "./hast-syntax-highlighting-demo.js"
54
- import * as codeDemo from "./code-demo.js"
55
- import * as liveStateExample from "./live-state-demo.js"
56
- import * as fullUnicodeExample from "./full-unicode-demo.js"
57
- import * as textNodeDemo from "./text-node-demo.js"
58
- import * as textWrapExample from "./text-wrap.js"
59
- import * as editorDemo from "./editor-demo.js"
60
- import * as sliderDemo from "./slider-demo.js"
61
- import * as terminalDemo from "./terminal.js"
62
- import * as diffDemo from "./diff-demo.js"
63
- import * as keypressDebugDemo from "./keypress-debug-demo.js"
64
- import * as extmarksDemo from "./extmarks-demo.js"
65
- import * as markdownDemo from "./markdown-demo.js"
66
- import * as linkDemo from "./link-demo.js"
67
- import * as opacityExample from "./opacity-example.js"
68
- import * as scrollboxOverlayHitTest from "./scrollbox-overlay-hit-test.js"
69
- import * as scrollboxMouseTest from "./scrollbox-mouse-test.js"
70
- import * as textTruncationDemo from "./text-truncation-demo.js"
71
- import * as grayscaleBufferDemo from "./grayscale-buffer-demo.js"
72
- import * as focusRestoreDemo from "./focus-restore-demo.js"
73
- import { setupCommonDemoKeys } from "./lib/standalone-keys.js"
74
- import * as corePluginSlotsDemo from "./core-plugin-slots-demo.js"
75
- import * as wideGraphemeOverlayDemo from "./wide-grapheme-overlay-demo.js"
76
-
77
- interface Example {
78
- name: string
79
- description: string
80
- run?: (renderer: CliRenderer) => void
81
- destroy?: (renderer: CliRenderer) => void
82
- }
83
-
84
- interface ExampleTheme {
85
- titleColor: RGBA
86
- borderColor: string
87
- focusedBorderColor: string
88
- inputTextColor: string
89
- inputFocusedTextColor: string
90
- inputPlaceholderColor: string
91
- inputCursorColor: string
92
- selectSelectedBackgroundColor: string
93
- selectTextColor: string
94
- selectSelectedTextColor: string
95
- selectDescriptionColor: string
96
- selectSelectedDescriptionColor: string
97
- instructionsColor: string
98
- notImplementedColor: string
99
- }
100
-
101
- const DEFAULT_THEME_MODE: ThemeMode = "dark"
102
-
103
- const MENU_THEMES: Record<ThemeMode, ExampleTheme> = {
104
- dark: {
105
- titleColor: RGBA.fromInts(240, 248, 255, 255),
106
- borderColor: "#475569",
107
- focusedBorderColor: "#60A5FA",
108
- inputTextColor: "#E2E8F0",
109
- inputFocusedTextColor: "#F8FAFC",
110
- inputPlaceholderColor: "#94A3B8",
111
- inputCursorColor: "#60A5FA",
112
- selectSelectedBackgroundColor: "#1E3A5F",
113
- selectTextColor: "#E2E8F0",
114
- selectSelectedTextColor: "#38BDF8",
115
- selectDescriptionColor: "#64748B",
116
- selectSelectedDescriptionColor: "#94A3B8",
117
- instructionsColor: "#94A3B8",
118
- notImplementedColor: "#FACC15",
119
- },
120
- light: {
121
- titleColor: RGBA.fromInts(15, 23, 42, 255),
122
- borderColor: "#CBD5E1",
123
- focusedBorderColor: "#2563EB",
124
- inputTextColor: "#0F172A",
125
- inputFocusedTextColor: "#0B1221",
126
- inputPlaceholderColor: "#64748B",
127
- inputCursorColor: "#2563EB",
128
- selectSelectedBackgroundColor: "#DBEAFE",
129
- selectTextColor: "#0F172A",
130
- selectSelectedTextColor: "#1D4ED8",
131
- selectDescriptionColor: "#475569",
132
- selectSelectedDescriptionColor: "#1E40AF",
133
- instructionsColor: "#475569",
134
- notImplementedColor: "#B45309",
135
- },
136
- }
137
-
138
- const examples: Example[] = [
139
- {
140
- name: "Golden Star Demo",
141
- description: "3D golden star with particle effects and animated text celebrating 5000 stars",
142
- run: goldenStarDemo.run,
143
- destroy: goldenStarDemo.destroy,
144
- },
145
- {
146
- name: "Mouse Interaction Demo",
147
- description: "Interactive mouse trails and clickable cells demonstration",
148
- run: mouseInteractionExample.run,
149
- destroy: mouseInteractionExample.destroy,
150
- },
151
- {
152
- name: "Text Selection Demo",
153
- description: "Text selection across multiple renderables with mouse drag",
154
- run: textSelectionExample.run,
155
- destroy: textSelectionExample.destroy,
156
- },
157
- {
158
- name: "Text Truncation Demo",
159
- description: "Middle truncation with ellipsis - toggle with 'T' key and resize to test responsive behavior",
160
- run: textTruncationDemo.run,
161
- destroy: textTruncationDemo.destroy,
162
- },
163
- {
164
- name: "ASCII Font Selection Demo",
165
- description: "Text selection with ASCII fonts - precise character-level selection across different font types",
166
- run: asciiFontSelectionExample.run,
167
- destroy: asciiFontSelectionExample.destroy,
168
- },
169
- {
170
- name: "Text Wrap Demo",
171
- description: "Text wrapping example",
172
- run: textWrapExample.run,
173
- destroy: textWrapExample.destroy,
174
- },
175
- {
176
- name: "Console Demo",
177
- description: "Interactive console logging with clickable buttons for different log levels",
178
- run: consoleExample.run,
179
- destroy: consoleExample.destroy,
180
- },
181
- {
182
- name: "Styled Text Demo",
183
- description: "Template literals with styled text, colors, and formatting",
184
- run: styledTextExample.run,
185
- destroy: styledTextExample.destroy,
186
- },
187
- {
188
- name: "TextTable Demo",
189
- description: "TextTable renderable with styled chunks, Unicode content, and wrap/border toggles",
190
- run: textTableExample.run,
191
- destroy: textTableExample.destroy,
192
- },
193
- {
194
- name: "Link Demo",
195
- description: "Hyperlink support with OSC 8 - clickable links and link inheritance in styled text",
196
- run: linkDemo.run,
197
- destroy: linkDemo.destroy,
198
- },
199
- {
200
- name: "Opacity Demo",
201
- description: "Box opacity and transparency effects with animated opacity transitions",
202
- run: opacityExample.run,
203
- destroy: opacityExample.destroy,
204
- },
205
- {
206
- name: "TextNode Demo",
207
- description: "TextNode API for building complex styled text structures",
208
- run: textNodeDemo.run,
209
- destroy: textNodeDemo.destroy,
210
- },
211
- {
212
- name: "HAST Syntax Highlighting Demo",
213
- description: "Convert HAST trees to syntax-highlighted text with efficient chunk generation",
214
- run: hastSyntaxHighlightingExample.run,
215
- destroy: hastSyntaxHighlightingExample.destroy,
216
- },
217
- {
218
- name: "Code Demo",
219
- description:
220
- "Code viewer with line numbers, diff highlights, and diagnostics using CodeRenderable + LineNumberRenderable",
221
- run: codeDemo.run,
222
- destroy: codeDemo.destroy,
223
- },
224
- {
225
- name: "Diff Demo",
226
- description: "Unified and split diff views with syntax highlighting and multiple themes",
227
- run: diffDemo.run,
228
- destroy: diffDemo.destroy,
229
- },
230
- {
231
- name: "Markdown Demo",
232
- description: "Markdown rendering with table alignment, syntax highlighting, and theme switching",
233
- run: markdownDemo.run,
234
- destroy: markdownDemo.destroy,
235
- },
236
- {
237
- name: "Live State Management Demo",
238
- description: "Test automatic renderer lifecycle management with live renderables",
239
- run: liveStateExample.run,
240
- destroy: liveStateExample.destroy,
241
- },
242
- {
243
- name: "Core Plugin Slots Demo",
244
- description: "Framework-free plugin slots with cached renderables and deterministic ordering",
245
- run: corePluginSlotsDemo.run,
246
- destroy: corePluginSlotsDemo.destroy,
247
- },
248
- {
249
- name: "Layout System Demo",
250
- description: "Flex layout system with multiple configurations",
251
- run: layoutExample.run,
252
- destroy: layoutExample.destroy,
253
- },
254
- {
255
- name: "Input & Select Layout Demo",
256
- description: "Interactive layout with input and select elements",
257
- run: inputSelectLayoutExample.run,
258
- destroy: inputSelectLayoutExample.destroy,
259
- },
260
- {
261
- name: "ASCII Font Demo",
262
- description: "ASCII font rendering with various colors and text",
263
- run: boxExample.run,
264
- destroy: boxExample.destroy,
265
- },
266
- {
267
- name: "OpenTUI Demo",
268
- description: "Multi-tab demo with various features",
269
- run: opentuiDemo.run,
270
- destroy: opentuiDemo.destroy,
271
- },
272
- {
273
- name: "Nested Z-Index Demo",
274
- description: "Demonstrates z-index behavior with nested render objects",
275
- run: nestedZIndexDemo.run,
276
- destroy: nestedZIndexDemo.destroy,
277
- },
278
- {
279
- name: "Relative Positioning Demo",
280
- description: "Shows how child positions are relative to their parent containers",
281
- run: relativePositioningDemo.run,
282
- destroy: relativePositioningDemo.destroy,
283
- },
284
- {
285
- name: "Transparency Demo",
286
- description: "Alpha blending and transparency effects demonstration",
287
- run: transparencyDemo.run,
288
- destroy: transparencyDemo.destroy,
289
- },
290
- {
291
- name: "Draggable ThreeRenderable",
292
- description: "Draggable WebGPU cube with live animation",
293
- run: draggableThreeDemo.run,
294
- destroy: draggableThreeDemo.destroy,
295
- },
296
- {
297
- name: "Static Sprite",
298
- description: "Static sprite rendering demo",
299
- run: staticSpriteExample.run,
300
- destroy: staticSpriteExample.destroy,
301
- },
302
- {
303
- name: "Sprite Animation",
304
- description: "Animated sprite sequences",
305
- run: spriteAnimationExample.run,
306
- destroy: spriteAnimationExample.destroy,
307
- },
308
- {
309
- name: "Sprite Particles",
310
- description: "Particle system with sprites",
311
- run: spriteParticleExample.run,
312
- destroy: spriteParticleExample.destroy,
313
- },
314
- {
315
- name: "Framebuffer Demo",
316
- description: "Framebuffer rendering techniques",
317
- run: framebufferExample.run,
318
- destroy: framebufferExample.destroy,
319
- },
320
- {
321
- name: "Texture Loading",
322
- description: "Loading and displaying textures",
323
- run: textureLoadingExample.run,
324
- destroy: textureLoadingExample.destroy,
325
- },
326
- {
327
- name: "ScrollBox Demo",
328
- description: "Scrollable container with customization",
329
- run: scrollExample.run,
330
- destroy: scrollExample.destroy,
331
- },
332
- {
333
- name: "Sticky Scroll Demo",
334
- description: "ScrollBox with sticky scroll behavior - maintains position at borders when content changes",
335
- run: stickyScrollExample.run,
336
- destroy: stickyScrollExample.destroy,
337
- },
338
- {
339
- name: "Scrollbox Mouse Test",
340
- description: "Test scrollbox mouse hit detection with hover and click events",
341
- run: scrollboxMouseTest.run,
342
- destroy: scrollboxMouseTest.destroy,
343
- },
344
- {
345
- name: "Scrollbox Overlay Hit Test",
346
- description: "Test scrollbox hit detection with overlays and dialogs",
347
- run: scrollboxOverlayHitTest.run,
348
- destroy: scrollboxOverlayHitTest.destroy,
349
- },
350
- {
351
- name: "Shader Cube",
352
- description: "3D cube with custom shaders",
353
- run: shaderCubeExample.run,
354
- destroy: shaderCubeExample.destroy,
355
- },
356
- {
357
- name: "Fractal Shader",
358
- description: "Fractal rendering with shaders",
359
- run: fractalShaderExample.run,
360
- destroy: fractalShaderExample.destroy,
361
- },
362
- {
363
- name: "Phong Lighting",
364
- description: "Phong lighting model demo",
365
- run: lightsPhongExample.run,
366
- destroy: lightsPhongExample.destroy,
367
- },
368
- {
369
- name: "Physics Planck",
370
- description: "2D physics with Planck.js",
371
- run: physxPlanckExample.run,
372
- destroy: physxPlanckExample.destroy,
373
- },
374
- {
375
- name: "Physics Rapier",
376
- description: "2D physics with Rapier",
377
- run: physxRapierExample.run,
378
- destroy: physxRapierExample.destroy,
379
- },
380
- {
381
- name: "Timeline Example",
382
- description: "Animation timeline system",
383
- run: timelineExample.run,
384
- destroy: timelineExample.destroy,
385
- },
386
- {
387
- name: "Tab Select",
388
- description: "Tab selection demo",
389
- run: tabSelectExample.run,
390
- destroy: tabSelectExample.destroy,
391
- },
392
- {
393
- name: "Select Demo",
394
- description: "Interactive SelectElement demo with customizable options",
395
- run: selectExample.run,
396
- destroy: selectExample.destroy,
397
- },
398
- {
399
- name: "Input Demo",
400
- description: "Interactive InputElement demo with validation and multiple fields",
401
- run: inputExample.run,
402
- destroy: inputExample.destroy,
403
- },
404
- {
405
- name: "Terminal Palette Demo",
406
- description: "Terminal color palette detection and visualization - fetch and display all 256 terminal colors",
407
- run: terminalDemo.run,
408
- destroy: terminalDemo.destroy,
409
- },
410
- {
411
- name: "Editor Demo",
412
- description: "Interactive text editor with TextareaRenderable - supports full editing capabilities",
413
- run: editorDemo.run,
414
- destroy: editorDemo.destroy,
415
- },
416
- {
417
- name: "Extmarks Demo",
418
- description: "Virtual extmarks - text ranges that the cursor jumps over, with deletion handling",
419
- run: extmarksDemo.run,
420
- destroy: extmarksDemo.destroy,
421
- },
422
- {
423
- name: "Slider Demo",
424
- description: "Interactive slider components with various orientations and configurations",
425
- run: sliderDemo.run,
426
- destroy: sliderDemo.destroy,
427
- },
428
- {
429
- name: "VNode Composition Demo",
430
- description: "Declarative Box(Box(Box(children))) composition",
431
- run: vnodeCompositionDemo.run,
432
- destroy: vnodeCompositionDemo.destroy,
433
- },
434
- {
435
- name: "Full Unicode Demo",
436
- description: "Draggable boxes and background filled with complex graphemes",
437
- run: fullUnicodeExample.run,
438
- destroy: fullUnicodeExample.destroy,
439
- },
440
- {
441
- name: "Wide Grapheme Overlay Demo",
442
- description: "Drag transparent boxes over CJK/emoji, toggle dimming scrim with D key",
443
- run: wideGraphemeOverlayDemo.run,
444
- destroy: wideGraphemeOverlayDemo.destroy,
445
- },
446
- {
447
- name: "Split Mode Demo (Experimental)",
448
- description: "Renderer confined to bottom area with normal terminal output above",
449
- run: splitModeExample.run,
450
- destroy: splitModeExample.destroy,
451
- },
452
- {
453
- name: "Keypress Debug Tool",
454
- description: "Debug tool to inspect keypress events, raw input, and terminal capabilities",
455
- run: keypressDebugDemo.run,
456
- destroy: keypressDebugDemo.destroy,
457
- },
458
- {
459
- name: "Grayscale Buffer",
460
- description: "Grayscale buffer rendering with 1x vs 2x supersampled intensity",
461
- run: grayscaleBufferDemo.run,
462
- destroy: grayscaleBufferDemo.destroy,
463
- },
464
- {
465
- name: "Focus Restore Demo",
466
- description: "Test focus restore - alt-tab away and back to verify mouse tracking resumes",
467
- run: focusRestoreDemo.run,
468
- destroy: focusRestoreDemo.destroy,
469
- },
470
- ]
471
-
472
- class ExampleSelector {
473
- private renderer: CliRenderer
474
- private currentExample: Example | null = null
475
- private inMenu = true
476
- private themeMode: ThemeMode = DEFAULT_THEME_MODE
477
-
478
- private menuContainer: BoxRenderable | null = null
479
- private title: FrameBufferRenderable | null = null
480
- private filterBox: BoxRenderable | null = null
481
- private filterInput: TextareaRenderable | null = null
482
- private instructions: TextRenderable | null = null
483
- private timeToFirstDrawText: TimeToFirstDrawRenderable | null = null
484
- private selectElement: SelectRenderable | null = null
485
- private selectBox: BoxRenderable | null = null
486
- private notImplementedText: TextRenderable | null = null
487
- private allExamples: Example[] = examples
488
-
489
- constructor(renderer: CliRenderer) {
490
- this.renderer = renderer
491
- this.themeMode = this.renderer.themeMode ?? DEFAULT_THEME_MODE
492
- this.createLayout()
493
- this.setupKeyboardHandling()
494
-
495
- this.renderer.on("theme_mode", (mode: ThemeMode) => {
496
- this.applyTheme(mode)
497
- console.log(`Theme mode changed to ${mode}, applied new theme to menu`)
498
- })
499
-
500
- this.applyTheme(this.renderer.themeMode)
501
-
502
- this.renderer.on("resize", (width: number, height: number) => {
503
- this.handleResize(width, height)
504
- })
505
- }
506
-
507
- private createLayout(): void {
508
- const width = this.renderer.terminalWidth
509
- const theme = MENU_THEMES[this.themeMode]
510
-
511
- // Menu container with column layout
512
- this.menuContainer = new BoxRenderable(renderer, {
513
- id: "example-menu-container",
514
- flexDirection: "column",
515
- width: "100%",
516
- height: "100%",
517
- })
518
- this.renderer.root.add(this.menuContainer)
519
-
520
- // Title
521
- const titleText = "OPENTUI EXAMPLES"
522
- const titleFont = "tiny"
523
- const { width: titleWidth } = measureText({ text: titleText, font: titleFont })
524
- const centerX = Math.floor(width / 2) - Math.floor(titleWidth / 2)
525
-
526
- this.title = new ASCIIFontRenderable(renderer, {
527
- id: "example-index-title",
528
- left: centerX,
529
- margin: 1,
530
- text: titleText,
531
- font: titleFont,
532
- color: theme.titleColor,
533
- backgroundColor: "transparent",
534
- })
535
- this.menuContainer.add(this.title)
536
-
537
- // Filter box with border (grows with content)
538
- this.filterBox = new BoxRenderable(renderer, {
539
- id: "example-index-filter-box",
540
- marginLeft: 1,
541
- marginRight: 1,
542
- flexShrink: 0,
543
- backgroundColor: "transparent",
544
- border: true,
545
- borderStyle: "single",
546
- borderColor: theme.borderColor,
547
- })
548
- this.menuContainer.add(this.filterBox)
549
-
550
- // Filter input inside the box (transparent bg so box bg shows through)
551
- this.filterInput = new TextareaRenderable(renderer, {
552
- id: "example-index-filter-input",
553
- width: "100%",
554
- height: 1,
555
- placeholder: "Filter examples by title...",
556
- placeholderColor: theme.inputPlaceholderColor,
557
- backgroundColor: "transparent",
558
- focusedBackgroundColor: "transparent",
559
- textColor: theme.inputTextColor,
560
- focusedTextColor: theme.inputFocusedTextColor,
561
- wrapMode: "none",
562
- showCursor: true,
563
- cursorColor: theme.inputCursorColor,
564
- onContentChange: () => {
565
- this.filterExamples()
566
- },
567
- })
568
- this.filterBox.add(this.filterInput)
569
- this.filterInput.focus()
570
-
571
- // Select box (grows to fill remaining space)
572
- this.selectBox = new BoxRenderable(renderer, {
573
- id: "example-selector-box",
574
- marginLeft: 1,
575
- marginRight: 1,
576
- marginBottom: 1,
577
- flexGrow: 1,
578
- borderStyle: "single",
579
- borderColor: theme.borderColor,
580
- focusedBorderColor: theme.focusedBorderColor,
581
- title: "Examples",
582
- titleAlignment: "center",
583
- backgroundColor: "transparent",
584
- shouldFill: true,
585
- border: true,
586
- })
587
- this.menuContainer.add(this.selectBox)
588
-
589
- // Select element
590
- const selectOptions: SelectOption[] = examples.map((example) => ({
591
- name: example.name,
592
- description: example.description,
593
- value: example,
594
- }))
595
-
596
- this.selectElement = new SelectRenderable(renderer, {
597
- id: "example-selector",
598
- height: "100%",
599
- options: selectOptions,
600
- backgroundColor: "transparent",
601
- focusedBackgroundColor: "transparent",
602
- selectedBackgroundColor: theme.selectSelectedBackgroundColor,
603
- textColor: theme.selectTextColor,
604
- selectedTextColor: theme.selectSelectedTextColor,
605
- descriptionColor: theme.selectDescriptionColor,
606
- selectedDescriptionColor: theme.selectSelectedDescriptionColor,
607
- showScrollIndicator: true,
608
- wrapSelection: true,
609
- showDescription: true,
610
- fastScrollStep: 5,
611
- })
612
- this.selectBox.add(this.selectElement)
613
-
614
- this.selectElement.on(SelectRenderableEvents.ITEM_SELECTED, (index: number, option: SelectOption) => {
615
- this.runSelected(option.value as Example)
616
- })
617
-
618
- this.timeToFirstDrawText = new TimeToFirstDrawRenderable(renderer, {
619
- id: "example-index-time-to-first-draw",
620
- fg: theme.instructionsColor,
621
- })
622
- this.menuContainer.add(this.timeToFirstDrawText)
623
-
624
- // Instructions at the bottom
625
- this.instructions = new TextRenderable(renderer, {
626
- id: "example-index-instructions",
627
- height: 1,
628
- flexShrink: 0,
629
- alignSelf: "center",
630
- content: "Type to filter | ↑↓/j/k navigate | Enter run | Esc clear/return | ctrl+c quit",
631
- fg: theme.instructionsColor,
632
- })
633
- this.menuContainer.add(this.instructions)
634
- }
635
-
636
- private applyTheme(mode: ThemeMode | null): void {
637
- this.themeMode = mode ?? DEFAULT_THEME_MODE
638
- const theme = MENU_THEMES[this.themeMode]
639
-
640
- if (this.title) {
641
- this.title.color = theme.titleColor
642
- }
643
-
644
- if (this.filterBox) {
645
- this.filterBox.borderColor = theme.borderColor
646
- }
647
-
648
- if (this.filterInput) {
649
- this.filterInput.textColor = theme.inputTextColor
650
- this.filterInput.focusedTextColor = theme.inputFocusedTextColor
651
- this.filterInput.placeholderColor = theme.inputPlaceholderColor
652
- this.filterInput.cursorColor = theme.inputCursorColor
653
- }
654
-
655
- if (this.selectBox) {
656
- this.selectBox.borderColor = theme.borderColor
657
- this.selectBox.focusedBorderColor = theme.focusedBorderColor
658
- }
659
-
660
- if (this.selectElement) {
661
- this.selectElement.selectedBackgroundColor = theme.selectSelectedBackgroundColor
662
- this.selectElement.textColor = theme.selectTextColor
663
- this.selectElement.selectedTextColor = theme.selectSelectedTextColor
664
- this.selectElement.descriptionColor = theme.selectDescriptionColor
665
- this.selectElement.selectedDescriptionColor = theme.selectSelectedDescriptionColor
666
- }
667
-
668
- if (this.instructions) {
669
- this.instructions.fg = theme.instructionsColor
670
- }
671
-
672
- if (this.timeToFirstDrawText) {
673
- this.timeToFirstDrawText.color = theme.instructionsColor
674
- }
675
-
676
- if (this.notImplementedText) {
677
- this.notImplementedText.fg = theme.notImplementedColor
678
- }
679
-
680
- this.renderer.requestRender()
681
- }
682
-
683
- private filterExamples(): void {
684
- if (!this.filterInput || !this.selectElement) return
685
-
686
- const filterText = this.filterInput.editBuffer.getText().toLowerCase().trim()
687
-
688
- if (filterText === "") {
689
- // Show all examples
690
- const selectOptions: SelectOption[] = this.allExamples.map((example) => ({
691
- name: example.name,
692
- description: example.description,
693
- value: example,
694
- }))
695
- this.selectElement.options = selectOptions
696
- } else {
697
- // Filter by title only
698
- const filtered = this.allExamples.filter((example) => example.name.toLowerCase().includes(filterText))
699
- const selectOptions: SelectOption[] = filtered.map((example) => ({
700
- name: example.name,
701
- description: example.description,
702
- value: example,
703
- }))
704
- this.selectElement.options = selectOptions
705
- }
706
- }
707
-
708
- private handleResize(width: number, height: number): void {
709
- if (this.title) {
710
- const titleWidth = this.title.frameBuffer.width
711
- const centerX = Math.floor(width / 2) - Math.floor(titleWidth / 2)
712
- this.title.x = centerX
713
- }
714
-
715
- this.renderer.requestRender()
716
- }
717
-
718
- private setupKeyboardHandling(): void {
719
- this.renderer.keyInput.on("keypress", (key: KeyEvent) => {
720
- if (key.name === "c" && key.ctrl) {
721
- this.cleanup()
722
- return
723
- }
724
-
725
- if (!this.inMenu) {
726
- switch (key.name) {
727
- case "escape":
728
- this.returnToMenu()
729
- break
730
- }
731
- return
732
- }
733
-
734
- // Forward navigation keys to select even when filter is focused
735
- if (this.filterInput?.focused && this.selectElement) {
736
- // Navigation keys: arrow up/down, j/k, shift variants
737
- if (key.name === "up" || key.name === "k") {
738
- key.preventDefault()
739
- if (key.shift) {
740
- this.selectElement.moveUp(5)
741
- } else {
742
- this.selectElement.moveUp(1)
743
- }
744
- return
745
- }
746
- if (key.name === "down" || key.name === "j") {
747
- key.preventDefault()
748
- if (key.shift) {
749
- this.selectElement.moveDown(5)
750
- } else {
751
- this.selectElement.moveDown(1)
752
- }
753
- return
754
- }
755
- // Enter to select
756
- if (key.name === "return" || key.name === "linefeed") {
757
- key.preventDefault()
758
- this.selectElement.selectCurrent()
759
- return
760
- }
761
- }
762
-
763
- // Handle Escape: clear filter if has content
764
- if (key.name === "escape") {
765
- if (this.filterInput) {
766
- const filterText = this.filterInput.editBuffer.getText()
767
- if (filterText.length > 0) {
768
- key.preventDefault()
769
- this.filterInput.editBuffer.setText("")
770
- this.filterExamples()
771
- return
772
- }
773
- }
774
- }
775
-
776
- if (key.name === "c" && key.ctrl) {
777
- this.cleanup()
778
- return
779
- }
780
- switch (key.name) {
781
- case "c":
782
- console.log("Capabilities:", this.renderer.capabilities)
783
- break
784
- case "z":
785
- if (key.ctrl) {
786
- console.log("Suspending renderer... (will auto-resume in 5 seconds)")
787
- this.renderer.suspend()
788
- setTimeout(() => {
789
- console.log("Resuming renderer...")
790
- this.renderer.resume()
791
- }, 5000)
792
- }
793
- break
794
- }
795
- })
796
- setupCommonDemoKeys(this.renderer)
797
- }
798
-
799
- private runSelected(selected: Example): void {
800
- this.inMenu = false
801
- this.hideMenuElements()
802
-
803
- if (selected.run) {
804
- this.currentExample = selected
805
- selected.run(this.renderer)
806
- } else {
807
- if (!this.notImplementedText) {
808
- const theme = MENU_THEMES[this.themeMode]
809
- this.notImplementedText = new TextRenderable(renderer, {
810
- id: "not-implemented",
811
- position: "absolute",
812
- left: 10,
813
- top: 10,
814
- content: `${selected.name} not yet implemented. Press Escape to return.`,
815
- fg: theme.notImplementedColor,
816
- zIndex: 10,
817
- })
818
- this.renderer.root.add(this.notImplementedText)
819
- }
820
- this.renderer.requestRender()
821
- }
822
- }
823
-
824
- private hideMenuElements(): void {
825
- if (this.menuContainer) {
826
- this.menuContainer.visible = false
827
- }
828
- if (this.title) {
829
- this.title.visible = false
830
- }
831
- if (this.filterBox) {
832
- this.filterBox.visible = false
833
- }
834
- if (this.selectBox) {
835
- this.selectBox.visible = false
836
- }
837
- if (this.instructions) {
838
- this.instructions.visible = false
839
- }
840
- if (this.timeToFirstDrawText) {
841
- this.timeToFirstDrawText.visible = false
842
- }
843
- if (this.filterInput) {
844
- this.filterInput.blur()
845
- }
846
- if (this.selectElement) {
847
- this.selectElement.blur()
848
- }
849
- }
850
-
851
- private showMenuElements(): void {
852
- if (this.menuContainer) {
853
- this.menuContainer.visible = true
854
- }
855
- if (this.title) {
856
- this.title.visible = true
857
- }
858
- if (this.filterBox) {
859
- this.filterBox.visible = true
860
- }
861
- if (this.selectBox) {
862
- this.selectBox.visible = true
863
- }
864
- if (this.instructions) {
865
- this.instructions.visible = true
866
- }
867
- if (this.timeToFirstDrawText) {
868
- this.timeToFirstDrawText.visible = true
869
- }
870
- if (this.filterInput) {
871
- // Clear filter when returning to menu
872
- this.filterInput.editBuffer.setText("")
873
- this.filterInput.focus()
874
- }
875
- // Reset filter to show all examples
876
- this.filterExamples()
877
- }
878
-
879
- private returnToMenu(): void {
880
- if (this.currentExample) {
881
- this.currentExample.destroy?.(this.renderer)
882
- this.currentExample = null
883
- }
884
-
885
- if (this.notImplementedText) {
886
- this.renderer.root.remove(this.notImplementedText.id)
887
- this.notImplementedText = null
888
- }
889
-
890
- this.inMenu = true
891
- this.restart()
892
- }
893
-
894
- private restart(): void {
895
- this.renderer.pause()
896
- this.renderer.auto()
897
- this.showMenuElements()
898
- this.renderer.setBackgroundColor("transparent")
899
- this.renderer.requestRender()
900
- }
901
-
902
- private cleanup(): void {
903
- if (this.currentExample) {
904
- this.currentExample.destroy?.(this.renderer)
905
- }
906
- if (this.filterInput) {
907
- this.filterInput.blur()
908
- }
909
- if (this.selectElement) {
910
- this.selectElement.blur()
911
- }
912
- if (this.menuContainer) {
913
- this.menuContainer.destroy()
914
- }
915
- this.renderer.destroy()
916
- }
917
- }
918
-
919
- const renderer = await createCliRenderer({
920
- exitOnCtrlC: false,
921
- targetFps: 60,
922
- // useAlternateScreen: false,
923
- })
924
-
925
- renderer.setBackgroundColor("transparent")
926
- new ExampleSelector(renderer)