@visulima/tui 1.0.8 → 2.0.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 (336) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/LICENSE.md +54 -2444
  3. package/MIGRATION-GUIDE.md +164 -0
  4. package/README.md +15 -12
  5. package/dist/components/box.d.ts +26 -27
  6. package/dist/components/canvas.d.ts +26 -31
  7. package/dist/components/canvas.js +1 -1
  8. package/dist/components/cursor.d.ts +40 -46
  9. package/dist/components/error-boundary.d.ts +16 -0
  10. package/dist/components/error-boundary.js +1 -0
  11. package/dist/components/error-overview.d.ts +6 -0
  12. package/dist/components/error-overview.js +1 -0
  13. package/dist/components/newline.d.ts +6 -8
  14. package/dist/components/spacer.d.ts +4 -4
  15. package/dist/components/static-render.d.ts +10 -42
  16. package/dist/components/static.d.ts +13 -14
  17. package/dist/components/text.d.ts +34 -48
  18. package/dist/components/transform.d.ts +7 -11
  19. package/dist/core/index.d.ts +11 -12
  20. package/dist/core/index.js +1 -1
  21. package/dist/ink/canvas/index.d.ts +24 -0
  22. package/dist/ink/canvas/index.js +1 -0
  23. package/dist/ink/hooks/use-animation.d.ts +22 -22
  24. package/dist/ink/hooks/use-app.d.ts +3 -34
  25. package/dist/ink/hooks/use-app.js +1 -1
  26. package/dist/ink/hooks/use-box-metrics.d.ts +17 -18
  27. package/dist/ink/hooks/use-clipboard.d.ts +16 -16
  28. package/dist/ink/hooks/use-color-blindness.d.ts +16 -16
  29. package/dist/ink/hooks/use-console-capture.d.ts +19 -19
  30. package/dist/ink/hooks/use-cursor.d.ts +7 -7
  31. package/dist/ink/hooks/use-focus-manager.d.ts +25 -25
  32. package/dist/ink/hooks/use-focus.d.ts +14 -18
  33. package/dist/ink/hooks/use-form.d.ts +32 -32
  34. package/dist/ink/hooks/use-hotkey.d.ts +17 -17
  35. package/dist/ink/hooks/use-input.d.ts +92 -92
  36. package/dist/ink/hooks/use-input.js +2 -2
  37. package/dist/ink/hooks/use-interval.d.ts +14 -14
  38. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +3 -3
  39. package/dist/ink/hooks/use-key-bindings.d.ts +32 -32
  40. package/dist/ink/hooks/use-key-chord.d.ts +15 -15
  41. package/dist/ink/hooks/use-paste.d.ts +38 -38
  42. package/dist/ink/hooks/use-paste.js +1 -1
  43. package/dist/ink/hooks/use-persistent-state.d.ts +46 -46
  44. package/dist/ink/hooks/use-persistent-state.js +2 -2
  45. package/dist/ink/hooks/use-scroll-acceleration.d.ts +24 -24
  46. package/dist/ink/hooks/use-scroll-input.d.ts +15 -15
  47. package/dist/ink/hooks/use-stderr.d.ts +6 -6
  48. package/dist/ink/hooks/use-stderr.js +1 -1
  49. package/dist/ink/hooks/use-stdin.d.ts +10 -10
  50. package/dist/ink/hooks/use-stdin.js +1 -1
  51. package/dist/ink/hooks/use-stdout.d.ts +6 -6
  52. package/dist/ink/hooks/use-stdout.js +1 -1
  53. package/dist/ink/hooks/use-stopwatch.d.ts +12 -12
  54. package/dist/ink/hooks/use-terminal-palette.d.ts +11 -11
  55. package/dist/ink/hooks/use-text-buffer.d.ts +2 -2
  56. package/dist/ink/hooks/use-text-selection.d.ts +19 -20
  57. package/dist/ink/hooks/use-timeout.d.ts +11 -11
  58. package/dist/ink/hooks/use-timer.d.ts +19 -19
  59. package/dist/ink/hooks/use-window-size.d.ts +8 -8
  60. package/dist/ink/hooks/use-window-size.js +1 -1
  61. package/dist/ink/index.d.ts +110 -123
  62. package/dist/ink/index.js +1 -1
  63. package/dist/ink/mouse/use-element-position.d.ts +7 -8
  64. package/dist/ink/mouse/use-mouse-action.d.ts +1 -1
  65. package/dist/ink/mouse/use-mouse-position.d.ts +1 -1
  66. package/dist/ink/mouse/use-mouse.d.ts +1 -1
  67. package/dist/ink/mouse/use-on-mouse-click.d.ts +4 -5
  68. package/dist/ink/mouse/use-on-mouse-hover.d.ts +3 -4
  69. package/dist/ink/mouse/use-on-mouse-state.d.ts +3 -4
  70. package/dist/ink/public/cursor.d.ts +47 -0
  71. package/dist/ink/public/cursor.js +1 -0
  72. package/dist/ink/public/dom.d.ts +6 -0
  73. package/dist/ink/public/dom.js +0 -0
  74. package/dist/ink/public/highlighter.d.ts +44 -0
  75. package/dist/ink/public/highlighter.js +1 -0
  76. package/dist/ink/public/input.d.ts +14 -0
  77. package/dist/ink/public/input.js +1 -0
  78. package/dist/ink/public/styles.d.ts +4 -0
  79. package/dist/ink/public/styles.js +0 -0
  80. package/dist/ink/public/utils.d.ts +5 -0
  81. package/dist/ink/public/utils.js +1 -0
  82. package/dist/packem_chunks/devtools.js +1 -1
  83. package/dist/packem_shared/{DevTools-k6uiVzqv.js → DevTools-BxD3PYAN.js} +1 -1
  84. package/dist/packem_shared/InputParser-CiBitCva.js +2 -0
  85. package/dist/packem_shared/MouseProvider-DOcWCRVq.js +1 -0
  86. package/dist/packem_shared/{Renderer-DsskdkUd.js → Renderer-BeS49FNq.js} +1 -1
  87. package/dist/packem_shared/TuiApp-CCVaiKbf.js +1 -0
  88. package/dist/packem_shared/app-context-DTm1_XBA.js +1 -0
  89. package/dist/packem_shared/app-context.d-DMLw5Nxy.d.ts +56 -0
  90. package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
  91. package/dist/packem_shared/buffer.d-CttIC480.d.ts +67 -0
  92. package/dist/packem_shared/buildCursorOnlySequence-CerkmjWt.js +1 -0
  93. package/dist/packem_shared/clipboard.d-nDPQkZ2H.d.ts +23 -0
  94. package/dist/packem_shared/color-matrix.d-sTqnJ23h.d.ts +50 -0
  95. package/dist/packem_shared/{braille-ch3O5D7I.js → createBrailleGrid-BTOQrujS.js} +1 -1
  96. package/dist/packem_shared/createCanvasBuffer-CL6sAM-A.js +1 -0
  97. package/dist/packem_shared/{createInlineLoop-BT40Wpmx.js → createInlineLoop-DnEvE2eM.js} +1 -1
  98. package/dist/packem_shared/disposeHighlighter-D9OkrhwX.js +1 -0
  99. package/dist/packem_shared/{dom.d-B4kXbaVY.d.ts → dom.d-CLGlidfI.d.ts} +140 -154
  100. package/dist/packem_shared/formatDuration-Bdx4ZgRh.js +1 -0
  101. package/dist/packem_shared/index-Dl9I2_QH.js +75 -0
  102. package/dist/packem_shared/input.d-Bb8pWHvp.d.ts +172 -0
  103. package/dist/packem_shared/{input-utils-BSWCb4F_.js → isControlCharacter-uDgBe_32.js} +1 -1
  104. package/dist/packem_shared/load-native-root-binding-CxJnHcac.js +1 -0
  105. package/dist/packem_shared/{mouse-context.d-BfL9xGk_.d.ts → mouse-context.d-W-nszUps.d.ts} +8 -8
  106. package/dist/packem_shared/reconciler-DkwOtC5B.js +1 -0
  107. package/dist/packem_shared/render-CuCo-R-l.js +24 -0
  108. package/dist/packem_shared/{render-DFZ8NHlG.js → render-DtQd8qQq.js} +1 -1
  109. package/dist/packem_shared/render.d-DjQhFsiN.d.ts +435 -0
  110. package/dist/packem_shared/{renderToString-DwXFY8Qh.js → renderToString-B1LgWcJe.js} +1 -1
  111. package/dist/packem_shared/{renderToString-L_bpw4OQ.js → renderToString-DkTmJPaS.js} +1 -1
  112. package/dist/packem_shared/renderToken-DjiQ6dfv.js +1 -0
  113. package/dist/packem_shared/renderTreeToBuffer-BpSD0sBJ.js +2 -0
  114. package/dist/packem_shared/{renderer-k-xShm1P.js → renderer-Cs0KEr1o.js} +4 -4
  115. package/dist/packem_shared/{selection.d-CI3_p8wg.d.ts → selection.d-BSAWa4ey.d.ts} +16 -16
  116. package/dist/packem_shared/stderr-context-CR2LLec6.js +1 -0
  117. package/dist/packem_shared/stdin-context-BjMA9Sbi.js +1 -0
  118. package/dist/packem_shared/stdout-context-DAAlQct2.js +1 -0
  119. package/dist/packem_shared/styles.d-CKGQFfm4.d.ts +485 -0
  120. package/dist/packem_shared/{terminal-palette.d-D2SQjfn-.d.ts → terminal-palette.d-JbWHISW-.d.ts} +7 -7
  121. package/dist/packem_shared/utils-CVgM8kTn.js +1 -0
  122. package/dist/react/index.d.ts +160 -179
  123. package/dist/react/index.js +1 -1
  124. package/dist/testing/index.d.ts +152 -152
  125. package/dist/testing/index.js +1 -1
  126. package/index.js +52 -52
  127. package/package.json +49 -384
  128. package/dist/components/accordion.d.ts +0 -59
  129. package/dist/components/accordion.js +0 -1
  130. package/dist/components/alert.d.ts +0 -26
  131. package/dist/components/alert.js +0 -1
  132. package/dist/components/animate-presence.d.ts +0 -18
  133. package/dist/components/animate-presence.js +0 -1
  134. package/dist/components/approval-prompt.d.ts +0 -65
  135. package/dist/components/approval-prompt.js +0 -1
  136. package/dist/components/area-chart.d.ts +0 -66
  137. package/dist/components/area-chart.js +0 -1
  138. package/dist/components/badge.d.ts +0 -22
  139. package/dist/components/badge.js +0 -1
  140. package/dist/components/bar-chart.d.ts +0 -67
  141. package/dist/components/bar-chart.js +0 -1
  142. package/dist/components/big-text.d.ts +0 -81
  143. package/dist/components/big-text.js +0 -1
  144. package/dist/components/blink-dot.d.ts +0 -36
  145. package/dist/components/blink-dot.js +0 -1
  146. package/dist/components/breadcrumb.d.ts +0 -33
  147. package/dist/components/breadcrumb.js +0 -1
  148. package/dist/components/button.d.ts +0 -45
  149. package/dist/components/button.js +0 -1
  150. package/dist/components/calendar.d.ts +0 -72
  151. package/dist/components/calendar.js +0 -1
  152. package/dist/components/card.d.ts +0 -57
  153. package/dist/components/card.js +0 -1
  154. package/dist/components/checkbox.d.ts +0 -48
  155. package/dist/components/checkbox.js +0 -1
  156. package/dist/components/code.d.ts +0 -48
  157. package/dist/components/code.js +0 -2
  158. package/dist/components/collapsible.d.ts +0 -53
  159. package/dist/components/collapsible.js +0 -1
  160. package/dist/components/command-block.d.ts +0 -47
  161. package/dist/components/command-block.js +0 -4
  162. package/dist/components/command-palette.d.ts +0 -82
  163. package/dist/components/command-palette.js +0 -1
  164. package/dist/components/confirm-dialog.d.ts +0 -75
  165. package/dist/components/confirm-dialog.js +0 -1
  166. package/dist/components/confirm-input.d.ts +0 -38
  167. package/dist/components/confirm-input.js +0 -1
  168. package/dist/components/console-overlay.d.ts +0 -54
  169. package/dist/components/console-overlay.js +0 -1
  170. package/dist/components/content-switcher.d.ts +0 -57
  171. package/dist/components/content-switcher.js +0 -1
  172. package/dist/components/controlled-scroll-view.d.ts +0 -61
  173. package/dist/components/controlled-scroll-view.js +0 -1
  174. package/dist/components/date-picker.d.ts +0 -65
  175. package/dist/components/date-picker.js +0 -1
  176. package/dist/components/definition-list.d.ts +0 -44
  177. package/dist/components/definition-list.js +0 -1
  178. package/dist/components/dialog.d.ts +0 -117
  179. package/dist/components/dialog.js +0 -1
  180. package/dist/components/diff-view.d.ts +0 -85
  181. package/dist/components/diff-view.js +0 -1
  182. package/dist/components/divider.d.ts +0 -49
  183. package/dist/components/divider.js +0 -1
  184. package/dist/components/file-picker-entry.d.ts +0 -104
  185. package/dist/components/file-picker-entry.js +0 -1
  186. package/dist/components/form.d.ts +0 -81
  187. package/dist/components/form.js +0 -1
  188. package/dist/components/gauge.d.ts +0 -87
  189. package/dist/components/gauge.js +0 -1
  190. package/dist/components/gradient.d.ts +0 -42
  191. package/dist/components/gradient.js +0 -1
  192. package/dist/components/heading.d.ts +0 -33
  193. package/dist/components/heading.js +0 -1
  194. package/dist/components/heatmap.d.ts +0 -62
  195. package/dist/components/heatmap.js +0 -1
  196. package/dist/components/help.d.ts +0 -52
  197. package/dist/components/help.js +0 -1
  198. package/dist/components/histogram.d.ts +0 -62
  199. package/dist/components/histogram.js +0 -1
  200. package/dist/components/kbd.d.ts +0 -31
  201. package/dist/components/kbd.js +0 -1
  202. package/dist/components/line-chart.d.ts +0 -109
  203. package/dist/components/line-chart.js +0 -1
  204. package/dist/components/link.d.ts +0 -38
  205. package/dist/components/link.js +0 -1
  206. package/dist/components/loading-indicator.d.ts +0 -29
  207. package/dist/components/loading-indicator.js +0 -1
  208. package/dist/components/markdown.d.ts +0 -40
  209. package/dist/components/markdown.js +0 -1
  210. package/dist/components/masked-input.d.ts +0 -50
  211. package/dist/components/masked-input.js +0 -1
  212. package/dist/components/menu.d.ts +0 -78
  213. package/dist/components/menu.js +0 -1
  214. package/dist/components/message-bubble.d.ts +0 -43
  215. package/dist/components/message-bubble.js +0 -1
  216. package/dist/components/model-badge.d.ts +0 -39
  217. package/dist/components/model-badge.js +0 -1
  218. package/dist/components/multi-select.d.ts +0 -65
  219. package/dist/components/multi-select.js +0 -1
  220. package/dist/components/operation-tree.d.ts +0 -49
  221. package/dist/components/operation-tree.js +0 -1
  222. package/dist/components/option-list.d.ts +0 -47
  223. package/dist/components/option-list.js +0 -1
  224. package/dist/components/ordered-list.d.ts +0 -24
  225. package/dist/components/ordered-list.js +0 -1
  226. package/dist/components/paginator.d.ts +0 -69
  227. package/dist/components/paginator.js +0 -1
  228. package/dist/components/paragraph.d.ts +0 -38
  229. package/dist/components/paragraph.js +0 -1
  230. package/dist/components/placeholder.d.ts +0 -55
  231. package/dist/components/placeholder.js +0 -1
  232. package/dist/components/progress-bar.d.ts +0 -56
  233. package/dist/components/progress-bar.js +0 -1
  234. package/dist/components/radio-group.d.ts +0 -74
  235. package/dist/components/radio-group.js +0 -1
  236. package/dist/components/scatter-plot.d.ts +0 -35
  237. package/dist/components/scatter-plot.js +0 -1
  238. package/dist/components/scroll-bar-box.d.ts +0 -37
  239. package/dist/components/scroll-bar-box.js +0 -1
  240. package/dist/components/scroll-bar.d.ts +0 -25
  241. package/dist/components/scroll-bar.js +0 -1
  242. package/dist/components/scroll-list.d.ts +0 -20
  243. package/dist/components/scroll-list.js +0 -1
  244. package/dist/components/scroll-view.d.ts +0 -10
  245. package/dist/components/scroll-view.js +0 -1
  246. package/dist/components/search-input.d.ts +0 -55
  247. package/dist/components/search-input.js +0 -1
  248. package/dist/components/select-input-indicator.d.ts +0 -32
  249. package/dist/components/select-input-indicator.js +0 -1
  250. package/dist/components/select-input-item.d.ts +0 -41
  251. package/dist/components/select-input-item.js +0 -1
  252. package/dist/components/select-input.d.ts +0 -110
  253. package/dist/components/select-input.js +0 -1
  254. package/dist/components/shimmer-text.d.ts +0 -47
  255. package/dist/components/shimmer-text.js +0 -1
  256. package/dist/components/slider.d.ts +0 -103
  257. package/dist/components/slider.js +0 -1
  258. package/dist/components/sparkline.d.ts +0 -35
  259. package/dist/components/sparkline.js +0 -1
  260. package/dist/components/spinner.d.ts +0 -17
  261. package/dist/components/spinner.js +0 -1
  262. package/dist/components/status-line.d.ts +0 -37
  263. package/dist/components/status-line.js +0 -1
  264. package/dist/components/status-message.d.ts +0 -21
  265. package/dist/components/status-message.js +0 -1
  266. package/dist/components/stepper.d.ts +0 -48
  267. package/dist/components/stepper.js +0 -1
  268. package/dist/components/stopwatch.d.ts +0 -49
  269. package/dist/components/stopwatch.js +0 -1
  270. package/dist/components/streaming-text.d.ts +0 -46
  271. package/dist/components/streaming-text.js +0 -1
  272. package/dist/components/switch.d.ts +0 -55
  273. package/dist/components/switch.js +0 -1
  274. package/dist/components/tab.d.ts +0 -19
  275. package/dist/components/tab.js +0 -1
  276. package/dist/components/table.d.ts +0 -119
  277. package/dist/components/table.js +0 -1
  278. package/dist/components/tabs.d.ts +0 -107
  279. package/dist/components/tabs.js +0 -1
  280. package/dist/components/tag.d.ts +0 -35
  281. package/dist/components/tag.js +0 -1
  282. package/dist/components/text-input.d.ts +0 -48
  283. package/dist/components/text-input.js +0 -1
  284. package/dist/components/textarea.d.ts +0 -68
  285. package/dist/components/textarea.js +0 -2
  286. package/dist/components/timer.d.ts +0 -59
  287. package/dist/components/timer.js +0 -1
  288. package/dist/components/toast.d.ts +0 -49
  289. package/dist/components/toast.js +0 -1
  290. package/dist/components/tooltip.d.ts +0 -43
  291. package/dist/components/tooltip.js +0 -1
  292. package/dist/components/transition.d.ts +0 -74
  293. package/dist/components/transition.js +0 -1
  294. package/dist/components/tree-view-entry.d.ts +0 -357
  295. package/dist/components/tree-view-entry.js +0 -1
  296. package/dist/components/unordered-list.d.ts +0 -30
  297. package/dist/components/unordered-list.js +0 -1
  298. package/dist/ink/hooks/use-linked-scroll.d.ts +0 -49
  299. package/dist/ink/hooks/use-linked-scroll.js +0 -1
  300. package/dist/packem_shared/ControlledScrollView-Cn4byU2n.js +0 -1
  301. package/dist/packem_shared/FilePicker-BLS9nOPz.js +0 -1
  302. package/dist/packem_shared/InputParser-CtwkCbrQ.js +0 -2
  303. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +0 -1
  304. package/dist/packem_shared/ScrollBar-qa1IzDDv.js +0 -1
  305. package/dist/packem_shared/ScrollBarBox-DchESZWv.js +0 -1
  306. package/dist/packem_shared/ScrollList-BBAnRsrC.js +0 -1
  307. package/dist/packem_shared/ScrollView-CHAo7Epj.js +0 -1
  308. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +0 -1
  309. package/dist/packem_shared/TreeView-BsvLCsf0.js +0 -1
  310. package/dist/packem_shared/TuiApp-BPL8v1i1.js +0 -1
  311. package/dist/packem_shared/app-context-BVpKlG1z.js +0 -1
  312. package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +0 -39
  313. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +0 -23
  314. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +0 -50
  315. package/dist/packem_shared/controlled-scroll-view-BVg7ywNW.js +0 -1
  316. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +0 -12
  317. package/dist/packem_shared/format-time-fjoQHMxD.js +0 -1
  318. package/dist/packem_shared/input.d-CgxV2e8U.d.ts +0 -90
  319. package/dist/packem_shared/line-chart-C7CUrvVs.js +0 -1
  320. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +0 -1
  321. package/dist/packem_shared/reconciler-CFyBVf7l.js +0 -1
  322. package/dist/packem_shared/render-CuQecTAs.js +0 -24
  323. package/dist/packem_shared/render.d-CBnYBDk2.d.ts +0 -417
  324. package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +0 -2
  325. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +0 -119
  326. package/dist/packem_shared/stderr-context-Bvnik0hL.js +0 -1
  327. package/dist/packem_shared/stdin-context-88AhuztD.js +0 -1
  328. package/dist/packem_shared/stdout-context-BnblEPez.js +0 -1
  329. package/dist/packem_shared/styles.d-cMo36xQz.d.ts +0 -396
  330. package/dist/packem_shared/token-to-elements-D6J6-P2A.js +0 -1
  331. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +0 -1
  332. package/dist/packem_shared/useTreeView-D5ifGwG3.js +0 -1
  333. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +0 -1
  334. package/dist/packem_shared/utils-Bup8lyK8.js +0 -1
  335. package/dist/packem_shared/variant-config-BJqpNo7H.js +0 -1
  336. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +0 -2
@@ -1,11 +1,10 @@
1
1
  import { RefObject } from 'react';
2
- import { D as DOMElement } from "../../packem_shared/dom.d-B4kXbaVY.js";
3
- import { e as MouseButton } from "../../packem_shared/mouse-context.d-BfL9xGk_.js";
2
+ import { D as DOMElement } from "../../packem_shared/dom.d-CLGlidfI.js";
3
+ import { e as MouseButton } from "../../packem_shared/mouse-context.d-W-nszUps.js";
4
4
  import 'yoga-layout';
5
- import "../../packem_shared/cursor-helpers.d-BONB9tky.js";
5
+ import "../public/cursor.js";
6
6
  import '@visulima/colorize';
7
- import 'cli-boxes';
8
- import "../../packem_shared/styles.d-cMo36xQz.js";
7
+ import "../../packem_shared/styles.d-CKGQFfm4.js";
9
8
  import 'type-fest';
10
9
  import 'node:events';
11
10
  type UseOnMouseClickOptions = {
@@ -1,10 +1,9 @@
1
1
  import { RefObject } from 'react';
2
- import { D as DOMElement } from "../../packem_shared/dom.d-B4kXbaVY.js";
2
+ import { D as DOMElement } from "../../packem_shared/dom.d-CLGlidfI.js";
3
3
  import 'yoga-layout';
4
- import "../../packem_shared/cursor-helpers.d-BONB9tky.js";
4
+ import "../public/cursor.js";
5
5
  import '@visulima/colorize';
6
- import 'cli-boxes';
7
- import "../../packem_shared/styles.d-cMo36xQz.js";
6
+ import "../../packem_shared/styles.d-CKGQFfm4.js";
8
7
  import 'type-fest';
9
8
  declare const useOnMouseHover: (ref: RefObject<DOMElement | null>, onChange: (event: boolean) => void) => void;
10
9
  export { useOnMouseHover as default };
@@ -1,10 +1,9 @@
1
1
  import { RefObject } from 'react';
2
- import { D as DOMElement } from "../../packem_shared/dom.d-B4kXbaVY.js";
2
+ import { D as DOMElement } from "../../packem_shared/dom.d-CLGlidfI.js";
3
3
  import 'yoga-layout';
4
- import "../../packem_shared/cursor-helpers.d-BONB9tky.js";
4
+ import "../public/cursor.js";
5
5
  import '@visulima/colorize';
6
- import 'cli-boxes';
7
- import "../../packem_shared/styles.d-cMo36xQz.js";
6
+ import "../../packem_shared/styles.d-CKGQFfm4.js";
8
7
  import 'type-fest';
9
8
  declare const useOnMouseState: (ref: RefObject<DOMElement | null>) => {
10
9
  clicking: boolean;
@@ -0,0 +1,47 @@
1
+ type CursorPosition = {
2
+ x: number;
3
+ y: number;
4
+ };
5
+ /**
6
+ * Declarative cursor shape, mapped to DECSCUSR (`CSI Ps SP q`).
7
+ *
8
+ * `"default"` restores the terminal's user-configured shape (`Ps=0`).
9
+ * Steady variants are non-blinking; `blinking-*` variants opt into blink.
10
+ */
11
+ type CursorShape = "bar" | "blinking-bar" | "blinking-block" | "blinking-underline" | "block" | "default" | "underline";
12
+ /**
13
+ * Build the DECSCUSR escape sequence for a cursor shape.
14
+ */
15
+ declare const buildCursorShapeSequence: (shape: CursorShape) => string;
16
+ /**
17
+ * Compare two cursor positions. Returns true if they differ.
18
+ */
19
+ declare const cursorPositionChanged: (a: CursorPosition | undefined, b: CursorPosition | undefined) => boolean;
20
+ /**
21
+ * Build escape sequence to move cursor from bottom of output to the target position and show it.
22
+ * Assumes cursor is at (col 0, line visibleLineCount) — i.e. just after the last output line.
23
+ */
24
+ declare const buildCursorSuffix: (visibleLineCount: number, cursorPosition: CursorPosition | undefined) => string;
25
+ /**
26
+ * Build escape sequence to move cursor from previousCursorPosition back to the bottom of output.
27
+ * This must be done before eraseLines or any operation that assumes cursor is at the bottom.
28
+ */
29
+ declare const buildReturnToBottom: (previousLineCount: number, previousCursorPosition: CursorPosition | undefined) => string;
30
+ type CursorOnlyInput = {
31
+ cursorPosition: CursorPosition | undefined;
32
+ cursorWasShown: boolean;
33
+ previousCursorPosition: CursorPosition | undefined;
34
+ previousLineCount: number;
35
+ visibleLineCount: number;
36
+ };
37
+ /**
38
+ * Build the escape sequence for cursor-only updates (output unchanged, cursor moved).
39
+ * Hides cursor if it was previously shown, returns to bottom, then repositions.
40
+ */
41
+ declare const buildCursorOnlySequence: (input: CursorOnlyInput) => string;
42
+ /**
43
+ * Build the prefix that hides cursor and returns to bottom before erasing or rewriting.
44
+ * Returns empty string if cursor was not shown.
45
+ */
46
+ declare const buildReturnToBottomPrefix: (cursorWasShown: boolean, previousLineCount: number, previousCursorPosition: CursorPosition | undefined) => string;
47
+ export { type CursorOnlyInput, type CursorPosition, type CursorShape, buildCursorOnlySequence, buildCursorShapeSequence, buildCursorSuffix, buildReturnToBottom, buildReturnToBottomPrefix, cursorPositionChanged };
@@ -0,0 +1 @@
1
+ import{buildCursorOnlySequence as r,buildCursorShapeSequence as e,buildCursorSuffix as i,buildReturnToBottom as t,buildReturnToBottomPrefix as n,cursorPositionChanged as d}from"../../packem_shared/buildCursorOnlySequence-CerkmjWt.js";export{r as buildCursorOnlySequence,e as buildCursorShapeSequence,i as buildCursorSuffix,t as buildReturnToBottom,n as buildReturnToBottomPrefix,d as cursorPositionChanged};
@@ -0,0 +1,6 @@
1
+ export type { C as CursorAnchorRef, a as CursorMarker, D as DOMElement, b as DOMNode, c as DOMNodeAttribute, E as ElementNames, N as NodeNames, S as StickyHeader, T as TextName, d as TextNode } from "../../packem_shared/dom.d-CLGlidfI.js";
2
+ import 'yoga-layout';
3
+ import "./cursor.js";
4
+ import '@visulima/colorize';
5
+ import "../../packem_shared/styles.d-CKGQFfm4.js";
6
+ import 'type-fest';
File without changes
@@ -0,0 +1,44 @@
1
+ import { TokensResult, ThemedToken } from '@shikijs/core';
2
+ import { HighlighterGeneric } from '@shikijs/types';
3
+ import { ReactElement } from 'react';
4
+ type BundledLanguage = '1c' | '1c-query' | 'abap' | 'actionscript-3' | 'ada' | 'adoc' | 'angular-html' | 'angular-ts' | 'apache' | 'apex' | 'apl' | 'applescript' | 'ara' | 'asciidoc' | 'asm' | 'astro' | 'awk' | 'ballerina' | 'bash' | 'bat' | 'batch' | 'be' | 'beancount' | 'berry' | 'bibtex' | 'bicep' | 'bird' | 'bird2' | 'blade' | 'bsl' | 'c' | 'c#' | 'c++' | 'c3' | 'cadence' | 'cairo' | 'cdc' | 'cjs' | 'clarity' | 'clj' | 'clojure' | 'closure-templates' | 'cmake' | 'cmd' | 'cobol' | 'codeowners' | 'codeql' | 'coffee' | 'coffeescript' | 'common-lisp' | 'console' | 'coq' | 'cpp' | 'cql' | 'crystal' | 'cs' | 'csharp' | 'css' | 'csv' | 'cts' | 'cue' | 'cypher' | 'd' | 'dart' | 'dax' | 'desktop' | 'diff' | 'docker' | 'dockerfile' | 'dotenv' | 'dream-maker' | 'edge' | 'elisp' | 'elixir' | 'elm' | 'emacs-lisp' | 'erb' | 'erl' | 'erlang' | 'f' | 'f#' | 'f03' | 'f08' | 'f18' | 'f77' | 'f90' | 'f95' | 'fennel' | 'fish' | 'fluent' | 'for' | 'fortran-fixed-form' | 'fortran-free-form' | 'fs' | 'fsharp' | 'fsl' | 'ftl' | 'gd' | 'gdresource' | 'gdscript' | 'gdshader' | 'genie' | 'gherkin' | 'git-commit' | 'git-rebase' | 'gjs' | 'gleam' | 'glimmer-js' | 'glimmer-ts' | 'glsl' | 'gn' | 'gnuplot' | 'go' | 'gql' | 'graphql' | 'groovy' | 'gts' | 'hack' | 'haml' | 'handlebars' | 'haskell' | 'haxe' | 'hbs' | 'hcl' | 'hjson' | 'hlsl' | 'hs' | 'html' | 'html-derivative' | 'http' | 'hurl' | 'hxml' | 'hy' | 'imba' | 'ini' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'jl' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsonnet' | 'jssm' | 'jsx' | 'julia' | 'just' | 'kdl' | 'kotlin' | 'kql' | 'kt' | 'kts' | 'kusto' | 'latex' | 'lean' | 'lean4' | 'less' | 'liquid' | 'lisp' | 'lit' | 'llvm' | 'log' | 'logo' | 'lua' | 'luau' | 'make' | 'makefile' | 'markdown' | 'marko' | 'matlab' | 'mbt' | 'mbti' | 'md' | 'mdc' | 'mdx' | 'mediawiki' | 'mermaid' | 'mips' | 'mipsasm' | 'mjs' | 'mmd' | 'mojo' | 'moonbit' | 'move' | 'mts' | 'nar' | 'narrat' | 'nextflow' | 'nextflow-groovy' | 'nf' | 'nginx' | 'nim' | 'nix' | 'nu' | 'nushell' | 'objc' | 'objective-c' | 'objective-cpp' | 'ocaml' | 'odin' | 'openscad' | 'pascal' | 'perl' | 'perl6' | 'php' | 'pkl' | 'plsql' | 'po' | 'polar' | 'postcss' | 'pot' | 'potx' | 'powerquery' | 'powershell' | 'prisma' | 'prolog' | 'properties' | 'proto' | 'protobuf' | 'ps' | 'ps1' | 'pug' | 'puppet' | 'purescript' | 'py' | 'python' | 'ql' | 'qml' | 'qmldir' | 'qss' | 'r' | 'racket' | 'raku' | 'razor' | 'rb' | 'reg' | 'regex' | 'regexp' | 'rel' | 'riscv' | 'ron' | 'rosmsg' | 'rs' | 'rst' | 'ruby' | 'rust' | 'sas' | 'sass' | 'scad' | 'scala' | 'scheme' | 'scss' | 'sdbl' | 'sh' | 'shader' | 'shaderlab' | 'shell' | 'shellscript' | 'shellsession' | 'smalltalk' | 'solidity' | 'soy' | 'sparql' | 'spl' | 'splunk' | 'sql' | 'ssh-config' | 'stata' | 'styl' | 'stylus' | 'surql' | 'surrealql' | 'svelte' | 'swift' | 'system-verilog' | 'systemd' | 'talon' | 'talonscript' | 'tasl' | 'tcl' | 'templ' | 'terraform' | 'tex' | 'tf' | 'tfvars' | 'toml' | 'tres' | 'ts' | 'ts-tags' | 'tscn' | 'tsp' | 'tsv' | 'tsx' | 'turtle' | 'twig' | 'typ' | 'typescript' | 'typespec' | 'typst' | 'v' | 'vala' | 'vb' | 'verilog' | 'vhdl' | 'vim' | 'viml' | 'vimscript' | 'vue' | 'vue-html' | 'vue-vine' | 'vy' | 'vyper' | 'wasm' | 'wenyan' | 'wgsl' | 'wiki' | 'wikitext' | 'wit' | 'wl' | 'wolfram' | 'xml' | 'xsl' | 'yaml' | 'yml' | 'zenscript' | 'zig' | 'zsh' | '文言';
5
+ type BundledTheme = 'andromeeda' | 'aurora-x' | 'ayu-dark' | 'ayu-light' | 'ayu-mirage' | 'catppuccin-frappe' | 'catppuccin-latte' | 'catppuccin-macchiato' | 'catppuccin-mocha' | 'dark-plus' | 'dracula' | 'dracula-soft' | 'everforest-dark' | 'everforest-light' | 'github-dark' | 'github-dark-default' | 'github-dark-dimmed' | 'github-dark-high-contrast' | 'github-light' | 'github-light-default' | 'github-light-high-contrast' | 'gruvbox-dark-hard' | 'gruvbox-dark-medium' | 'gruvbox-dark-soft' | 'gruvbox-light-hard' | 'gruvbox-light-medium' | 'gruvbox-light-soft' | 'horizon' | 'horizon-bright' | 'houston' | 'kanagawa-dragon' | 'kanagawa-lotus' | 'kanagawa-wave' | 'laserwave' | 'light-plus' | 'material-theme' | 'material-theme-darker' | 'material-theme-lighter' | 'material-theme-ocean' | 'material-theme-palenight' | 'min-dark' | 'min-light' | 'monokai' | 'night-owl' | 'night-owl-light' | 'nord' | 'one-dark-pro' | 'one-light' | 'plastic' | 'poimandres' | 'red' | 'rose-pine' | 'rose-pine-dawn' | 'rose-pine-moon' | 'slack-dark' | 'slack-ochin' | 'snazzy-light' | 'solarized-dark' | 'solarized-light' | 'synthwave-84' | 'tokyo-night' | 'vesper' | 'vitesse-black' | 'vitesse-dark' | 'vitesse-light';
6
+ type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>;
7
+ /**
8
+ * Get cached tokens or compute and cache them.
9
+ */
10
+ declare const getCachedTokens: (highlighter: Highlighter, code: string, lang: string, theme: string) => TokensResult;
11
+ /**
12
+ * Resolve a language name to a canonical name, handling aliases.
13
+ */
14
+ declare const resolveLanguage: (lang: string) => string;
15
+ /**
16
+ * Check if a language is supported.
17
+ */
18
+ declare const isLanguageSupported: (lang: string) => boolean;
19
+ /**
20
+ * Get or create the singleton Shiki highlighter, optionally loading languages and themes.
21
+ */
22
+ declare const getHighlighter: (languages?: string[], theme?: string) => Promise<Highlighter>;
23
+ /**
24
+ * Dispose the singleton highlighter, freeing resources.
25
+ */
26
+ declare const disposeHighlighter: () => void;
27
+ type TokenRenderOptions = {
28
+ readonly highlightLines?: ReadonlySet<number>;
29
+ readonly showLineNumbers?: boolean;
30
+ readonly startLine?: number;
31
+ };
32
+ /**
33
+ * Render a single ThemedToken as a styled &lt;Text> element.
34
+ */
35
+ declare const renderToken: (token: ThemedToken, key: number) => ReactElement;
36
+ /**
37
+ * Render a single line of tokens as inline React elements (no Box wrapper).
38
+ */
39
+ declare const renderTokenLine: (tokens: ThemedToken[]) => ReactElement;
40
+ /**
41
+ * Convert Shiki token lines to Ink React elements with optional line numbers.
42
+ */
43
+ declare const tokenLinesToElements: (lines: ThemedToken[][], options?: TokenRenderOptions) => ReactElement;
44
+ export { type TokenRenderOptions, disposeHighlighter, getCachedTokens, getHighlighter, isLanguageSupported, renderToken, renderTokenLine, resolveLanguage, tokenLinesToElements };
@@ -0,0 +1 @@
1
+ import{disposeHighlighter as r,getCachedTokens as n,default as g,isLanguageSupported as t,resolveLanguage as i}from"../../packem_shared/disposeHighlighter-D9OkrhwX.js";import{renderToken as a,renderTokenLine as d,tokenLinesToElements as h}from"../../packem_shared/renderToken-DjiQ6dfv.js";export{r as disposeHighlighter,n as getCachedTokens,g as getHighlighter,t as isLanguageSupported,a as renderToken,d as renderTokenLine,i as resolveLanguage,h as tokenLinesToElements};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Check if a character is a C0 control character or DEL.
3
+ */
4
+ declare const isControlCharacter: (input: string) => boolean;
5
+ /**
6
+ * Determine whether the input should be inserted as text.
7
+ * Filters out modifier chords (Ctrl+S, Meta+S, etc.) while allowing
8
+ * AltGr-produced symbols (Ctrl+Meta+@, Ctrl+Meta+€) on international keyboards.
9
+ */
10
+ declare const isInsertableInput: (input: string, key: {
11
+ ctrl: boolean;
12
+ meta: boolean;
13
+ }) => boolean;
14
+ export { isControlCharacter, isInsertableInput };
@@ -0,0 +1 @@
1
+ import{isControlCharacter as e,isInsertableInput as o}from"../../packem_shared/isControlCharacter-uDgBe_32.js";export{e as isControlCharacter,o as isInsertableInput};
@@ -0,0 +1,4 @@
1
+ export type { S as Styles } from "../../packem_shared/styles.d-CKGQFfm4.js";
2
+ import '@visulima/colorize';
3
+ import 'type-fest';
4
+ import 'yoga-layout';
File without changes
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Format a duration in milliseconds to `MM:SS` or `HH:MM:SS` (when hours > 0).
3
+ */
4
+ declare function formatDuration(ms: number): string;
5
+ export { formatDuration };
@@ -0,0 +1 @@
1
+ import{formatDuration as t}from"../../packem_shared/formatDuration-Bdx4ZgRh.js";export{t as formatDuration};
@@ -1,4 +1,4 @@
1
- import n from"react-devtools-core";import r from"ws";const i=async()=>new Promise(t=>{const e=new r("ws://localhost:8097"),o=setTimeout(()=>{e.terminate(),t(!1)},2e3);o.unref(),e.on("open",()=>{clearTimeout(o),e.terminate(),t(!0)}),e.on("error",()=>{clearTimeout(o),e.terminate(),t(!1)})});await i()?(n.initialize(),n.connectToDevTools()):console.warn(`DEV is set to true, but the React DevTools server is not running. Start it with:
1
+ import n from"react-devtools-core";const s=async()=>new Promise(t=>{const e=new WebSocket("ws://localhost:8097"),o=setTimeout(()=>{e.close(),t(!1)},2e3);o.unref(),e.addEventListener("open",()=>{clearTimeout(o),e.close(),t(!0)}),e.addEventListener("error",()=>{clearTimeout(o),t(!1)})});await s()?(n.initialize(),n.connectToDevTools()):console.warn(`DEV is set to true, but the React DevTools server is not running. Start it with:
2
2
 
3
3
  $ npx react-devtools
4
4
  `);
@@ -1 +1 @@
1
- import{jsxs as l,jsx as u}from"react/jsx-runtime";import{useState as p,useRef as s,useEffect as h}from"react";import{useWindowSize as x,useTuiContext as w}from"./TuiContext-BNmP0lMY.js";import{_Box as i,_Spacer as S,_Text as D}from"./render-DFZ8NHlG.js";function T(){const{app:r}=w(),[t,c]=p(0),e=s(0),n=s(Date.now()),o=s(null);return h(()=>{const m=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{c(0),e.current=0,n.current=Date.now()},2e3),e.current++;const d=Date.now(),f=d-n.current;f>=500&&(c(Math.round(e.current/f*1e3)),e.current=0,n.current=d)},a=r.onBeforeFlush(()=>{m()});return()=>{a(),o.current&&clearTimeout(o.current)}},[r]),t}const b=({fps:r})=>{const t=r===0?"--":String(r);return u(i,{borderColor:"gray",borderStyle:"round",paddingX:1,children:l(D,{dim:!0,children:[t," ","updates/sec"]})})},B=({children:r,enabled:t=!0})=>{const c=T(),{columns:e,rows:n}=x();return l(i,{flexDirection:"column",height:n,width:e,children:[u(i,{flexGrow:1,children:r}),t&&l(i,{flexDirection:"row",flexShrink:0,children:[u(S,{}),u(b,{fps:c})]})]})};export{B as DevTools};
1
+ import{jsxs as l,jsx as u}from"react/jsx-runtime";import{useState as p,useRef as s,useEffect as h}from"react";import{useWindowSize as x,useTuiContext as w}from"./TuiContext-BNmP0lMY.js";import{_Box as i,_Spacer as S,_Text as D}from"./render-DtQd8qQq.js";function T(){const{app:r}=w(),[t,c]=p(0),e=s(0),n=s(Date.now()),o=s(null);return h(()=>{const m=()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{c(0),e.current=0,n.current=Date.now()},2e3),e.current++;const d=Date.now(),f=d-n.current;f>=500&&(c(Math.round(e.current/f*1e3)),e.current=0,n.current=d)},a=r.onBeforeFlush(()=>{m()});return()=>{a(),o.current&&clearTimeout(o.current)}},[r]),t}const b=({fps:r})=>{const t=r===0?"--":String(r);return u(i,{borderColor:"gray",borderStyle:"round",paddingX:1,children:l(D,{dim:!0,children:[t," ","updates/sec"]})})},B=({children:r,enabled:t=!0})=>{const c=T(),{columns:e,rows:n}=x();return l(i,{flexDirection:"column",height:n,width:e,children:[u(i,{flexGrow:1,children:r}),t&&l(i,{flexDirection:"row",flexShrink:0,children:[u(S,{}),u(b,{fps:c})]})]})};export{B as DevTools};
@@ -0,0 +1,2 @@
1
+ import{l}from"./index-Dl9I2_QH.js";class B extends l.EventEmitter{constructor(t){super(),this.stdin=t}stdin;_boundHandleData=null;_pasteBuffer=null;start(){typeof this.stdin.setRawMode=="function"&&this.stdin.setRawMode(!0),this.stdin.resume(),this.stdin.setEncoding("utf8"),this._boundHandleData=this.handleData.bind(this),this.stdin.on("data",this._boundHandleData)}stop(){typeof this.stdin.setRawMode=="function"&&this.stdin.setRawMode(!1),this.stdin.pause(),this._boundHandleData&&(this.stdin.removeListener("data",this._boundHandleData),this._boundHandleData=null)}handleData(t){if(t===""){this.emit("exit");return}if(t.includes("\x1B[200~")||this._pasteBuffer!==null){if(this._pasteBuffer===null?this._pasteBuffer=t.replace("\x1B[200~",""):this._pasteBuffer+=t,this._pasteBuffer.includes("\x1B[201~")){const e=this._pasteBuffer.replace("\x1B[201~","");this._pasteBuffer=null,this.emit("paste",e),this.listenerCount("paste")===0&&this.emit("data",e)}return}if(t.length===1){const e=t.charCodeAt(0);if(e>=1&&e<=26&&e!==3&&e!==9&&e!==10&&e!==13){const s=String.fromCharCode(e+96);this.emit("ctrl",s),this.emit("data",t,{ctrl:!0});return}}if(t==="\x1B[A"){this.emit("keydown","up");return}if(t==="\x1B[B"){this.emit("keydown","down");return}if(t==="\x1B[C"){this.emit("keydown","right");return}if(t==="\x1B[D"){this.emit("keydown","left");return}if(t===" "){this.emit("keydown","tab");return}if(t==="\x1B[Z"){this.emit("keydown","shift-tab");return}if(t==="\x1B"){this.emit("keydown","escape");return}if(t==="\r"||t===`
2
+ `){this.emit("keydown","enter");return}if(t===""){this.emit("keydown","backspace");return}if(t==="\x1B[3~"){this.emit("keydown","delete");return}if(t==="\x1B[5~"){this.emit("keydown","pageUp");return}if(t==="\x1B[6~"){this.emit("keydown","pageDown");return}if(t==="\x1B[H"||t==="\x1B[1~"){this.emit("keydown","home");return}if(t==="\x1B[F"||t==="\x1B[4~"){this.emit("keydown","end");return}if(t.length===2&&t[0]==="\x1B"){this.emit("meta",t[1]),this.emit("data",t,{meta:!0});return}if(t.startsWith("\x1B[<")){const e=t.match(/\u001B\[<(\d+);(\d+);(\d+)(M)/i);if(e){const s=Number.parseInt(e[1]),a=Number.parseInt(e[2])-1,d=Number.parseInt(e[3])-1,r=e[4]==="m",h=(s&4)!==0,u=(s&8)!==0,o=(s&16)!==0,n=s&-29;let i=null;if(n===0&&!r?i="left":n===1&&!r?i="middle":n===2&&!r?i="right":n===64?i="scrollUp":n===65&&(i="scrollDown"),i){const f={button:i,ctrl:o,meta:u,shift:h,x:a,y:d};this.emit("mouse",f),i==="left"&&this.emit("click",{x:a,y:d})}}return}this.emit("data",t)}}export{B as InputParser};
@@ -0,0 +1 @@
1
+ import{createRequire as _}from"node:module";import{jsx as h}from"react/jsx-runtime";import{useRef as d,useReducer as j,useEffect as b,useMemo as x}from"react";import{useStdinContext as w}from"../ink/hooks/use-stdin.js";import q from"../ink/hooks/use-stdout.js";import{M as n,d as B}from"./ansi-parser-DlgLtOYO.js";import{o as E}from"./mouse-context-DaARgUu1.js";let y;const v=e=>(y??=_(import.meta.url))(e),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[t,i]=u.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return u.getBuiltinModule(e)}return v(e)},{EventEmitter:M}=T("node:events"),R=u,S={button:null,click:null,drag:null,position:{x:0,y:0},scroll:null},C=(e,t)=>{switch(t.type){case"click":return{...e,button:t.button,click:t.click,position:t.position};case"click-reset":return{...e,button:null,click:null};case"drag":return{...e,button:t.button,drag:t.drag,position:t.position};case"move":return{...e,position:t.position};case"scroll":return{...e,position:t.position,scroll:t.scroll};case"scroll-reset":return{...e,scroll:null};default:return e}},A=({children:e})=>{const{internal_eventEmitter:t}=w(),{stdout:i}=q(),l=d(new M),[s,c]=j(C,S),p=d(void 0),m=d(void 0);b(()=>{const a=i.isTTY?i:R.stdout;return a.write(n.mouseButton.on+n.mouseMotion.on+n.mouseMotionOthers.on+n.mouseSGR.on),()=>{a.write(n.mouseSGR.off+n.mouseMotionOthers.off+n.mouseMotion.off+n.mouseButton.off)}},[i]),b(()=>{const a=k=>{const o=B(k);if(!o)return;const r={x:o.x,y:o.y};switch(l.current.emit("position",r),o.type){case"click":{c({button:o.button,click:o.action,position:r,type:"click"}),l.current.emit("click",r,o.action,o.button),clearTimeout(p.current),p.current=setTimeout(()=>{c({type:"click-reset"})},100);break}case"drag":{const f=o.action==="press"?"dragging":null;c({button:o.button,drag:f,position:r,type:"drag"}),l.current.emit("drag",r,f,o.button);break}case"move":{c({position:r,type:"move"});break}case"scroll":{c({position:r,scroll:o.direction,type:"scroll"}),l.current.emit("scroll",r,o.direction),clearTimeout(m.current),m.current=setTimeout(()=>{c({type:"scroll-reset"})},100);break}}};return t.on("input",a),()=>{t.off("input",a),clearTimeout(p.current),clearTimeout(m.current)}},[t]);const g=x(()=>({button:s.button,click:s.click,drag:s.drag,events:l.current,position:s.position,scroll:s.scroll}),[s]);return h(E,{value:g,children:e})};export{A as default};
@@ -1 +1 @@
1
- import{p as r}from"./load-native-root-binding-DDikxNox.js";const n=r(import.meta.url),e=n,m=e.Renderer,t=e.TerminalGuard,a=e.terminalSize;export{m as Renderer,t as TerminalGuard,a as terminalSize};
1
+ import{p as r}from"./load-native-root-binding-CxJnHcac.js";const n=r(import.meta.url),e=n,m=e.Renderer,t=e.TerminalGuard,a=e.terminalSize;export{m as Renderer,t as TerminalGuard,a as terminalSize};
@@ -0,0 +1 @@
1
+ import{createDecMode as h,setMode as n,resetMode as u}from"@visulima/ansi";import{l as f}from"./index-Dl9I2_QH.js";import{Renderer as s,TerminalGuard as o}from"./Renderer-BeS49FNq.js";const i=h(2026),d=n(i),a=u(i);class p extends f.EventEmitter{renderer;terminal=null;backBuffer;width;height;isRunning=!1;stdoutBuffer=[];stderrBuffer=[];constructor(){super(),this.width=process.stdout.columns||80,this.height=process.stdout.rows||24,this.renderer=new s(this.width,this.height),this.backBuffer=new Uint32Array(this.width*this.height*2)}start(){this.isRunning||(this.terminal=new o(!0),this.isRunning=!0)}quit(){this.emit("quit")}stop(){this.isRunning=!1,this.terminal?.leave(),this.terminal=null,this.stdoutBuffer.length>0&&(process.stdout.write(this.stdoutBuffer.join("")),this.stdoutBuffer=[]),this.stderrBuffer.length>0&&(process.stderr.write(this.stderrBuffer.join("")),this.stderrBuffer=[])}writeStdout(t){this.isRunning?this.stdoutBuffer.push(t):process.stdout.write(t)}writeStderr(t){this.isRunning?this.stderrBuffer.push(t):process.stderr.write(t)}getBuffer(){return this.backBuffer}getSize(){return{height:this.height,width:this.width}}resize(t,e){this.width=t,this.height=e,this.renderer=new s(t,e),this.backBuffer=new Uint32Array(t*e*2)}beforeFlushListeners=[];onBeforeFlush(t){return this.beforeFlushListeners.push(t),()=>{this.beforeFlushListeners=this.beforeFlushListeners.filter(e=>e!==t)}}paintNow(t,e){if(this.isRunning){t(this.width,this.height),e(this.backBuffer,this.width,this.height);for(const r of this.beforeFlushListeners)r(this.backBuffer,this.width,this.height);this.renderer.writeRaw(d);try{this.renderer.render(this.backBuffer)}finally{this.renderer.writeRaw(a)}}}}export{p as TuiApp};
@@ -0,0 +1 @@
1
+ import{createContext as e}from"react";const t=e({exit(){},suspendTerminal:(()=>Promise.resolve(void 0)),async waitUntilRenderFlush(){}});t.displayName="InternalAppContext";export{t as e};
@@ -0,0 +1,56 @@
1
+ import 'react';
2
+ /**
3
+ * A handle returned by `suspendTerminal()` when called without a callback.
4
+ * Call `resume()` (or use `await using`, which disposes it) to restore Ink's
5
+ * rendering and input handling.
6
+ */
7
+ type TerminalSuspension = {
8
+ readonly [Symbol.asyncDispose]: () => Promise<void>;
9
+ readonly resume: () => Promise<void>;
10
+ };
11
+ type Props = {
12
+ /**
13
+ * Exit (unmount) the whole Ink app.
14
+ *
15
+ * - `exit()` — resolves `waitUntilExit()` with `undefined`.
16
+ * - `exit(new Error('…'))` — rejects `waitUntilExit()` with the error.
17
+ * - `exit(value)` — resolves `waitUntilExit()` with `value`.
18
+ */
19
+ readonly exit: (errorOrResult?: Error | unknown) => void;
20
+ /**
21
+ * Temporarily hand terminal control to a child process (e.g. an editor,
22
+ * pager, or interactive subprocess), then restore Ink's rendering.
23
+ *
24
+ * - `suspendTerminal(async () => { … })` — runs the callback with the
25
+ * terminal released and auto-resumes when it settles.
26
+ * - `suspendTerminal()` — returns a {@link TerminalSuspension} handle; call
27
+ * `resume()` (or `await using`) to restore.
28
+ */
29
+ readonly suspendTerminal: {
30
+ (callback: () => Promise<void> | void): Promise<undefined>;
31
+ (): Promise<TerminalSuspension>;
32
+ };
33
+ /**
34
+ * Returns a promise that settles after pending render output is flushed to stdout.
35
+ * @example
36
+ * ```jsx
37
+ * import {useEffect} from 'react';
38
+ * import {useApp} from '@visulima/tui/hooks/use-app';
39
+
40
+ const Example = () => {
41
+ const {waitUntilRenderFlush} = useApp();
42
+
43
+ useEffect(() => {
44
+ void (async () => {
45
+ await waitUntilRenderFlush();
46
+ runNextCommand();
47
+ })();
48
+ }, [waitUntilRenderFlush]);
49
+
50
+ return …;
51
+ };
52
+ ```
53
+ */
54
+ readonly waitUntilRenderFlush: () => Promise<void>;
55
+ };
56
+ export { Props as P, TerminalSuspension as T };
@@ -0,0 +1 @@
1
+ var t={topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},o={topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},e={topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},b={topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},i={topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},g={topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},p={topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},f={topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"};const h={single:t,double:o,round:e,bold:b,singleDouble:i,doubleSingle:g,classic:p,arrow:f};export{h as o};
@@ -0,0 +1,67 @@
1
+ type CanvasColor = number | string | undefined;
2
+ type CellStyle = {
3
+ readonly background?: CanvasColor;
4
+ readonly bold?: boolean;
5
+ readonly color?: CanvasColor;
6
+ readonly dim?: boolean;
7
+ };
8
+ /**
9
+ * Reverse of the encoder. 0 → undefined; any other id returns the original
10
+ * CanvasColor (preserving number vs string distinction).
11
+ */
12
+ type ColorDecoder = (id: number) => CanvasColor;
13
+ type CanvasContext = {
14
+ /**
15
+ * Clear every cell back to space + default style.
16
+ */
17
+ readonly clear: () => void;
18
+ /**
19
+ * Draw a horizontal bar using fractional block glyphs (▏▎▍▌▋▊▉█).
20
+ * `fillRatio` in [0, 1] determines the filled portion.
21
+ */
22
+ readonly drawHBar: (x: number, y: number, w: number, fillRatio: number, style?: CellStyle) => void;
23
+ /**
24
+ * Draw a filled rectangle using a single character.
25
+ */
26
+ readonly drawRect: (x: number, y: number, w: number, h: number, char: number | string, style?: CellStyle) => void;
27
+ /**
28
+ * Render a string left-to-right starting at (x, y). Non-printable or
29
+ * multi-byte codepoints are preserved but advance the cursor by 1 cell.
30
+ */
31
+ readonly drawText: (x: number, y: number, text: string, style?: CellStyle) => void;
32
+ /**
33
+ * Draw a vertical bar using fractional block glyphs (▁▂▃▄▅▆▇█).
34
+ * `fillRatio` in [0, 1] determines the filled portion.
35
+ */
36
+ readonly drawVBar: (x: number, y: number, h: number, fillRatio: number, style?: CellStyle) => void;
37
+ readonly height: number;
38
+ /**
39
+ * Set a single cell at (x, y). Out-of-bounds writes are silently ignored.
40
+ */
41
+ readonly setCell: (x: number, y: number, char: number | string, style?: CellStyle) => void;
42
+ readonly width: number;
43
+ };
44
+ type CanvasBuffer = {
45
+ readonly bg: Int32Array;
46
+ readonly chars: Uint32Array;
47
+ readonly colorDecoder: ColorDecoder;
48
+ readonly context: CanvasContext;
49
+ readonly dirty: Uint8Array;
50
+ readonly fg: Int32Array;
51
+ readonly height: number;
52
+ readonly styles: Uint32Array;
53
+ readonly width: number;
54
+ };
55
+ /**
56
+ * Allocate a canvas buffer and return a context that mutates it in place.
57
+ * The buffer is typed-array backed; all mutations O(1) per cell with no
58
+ * object allocation.
59
+ */
60
+ declare const createCanvasBuffer: (width: number, height: number) => CanvasBuffer;
61
+ /**
62
+ * Serialize a buffer row into an ANSI string, coalescing adjacent cells that
63
+ * share the same style. Call directly when you need to re-emit rows; row
64
+ * caching lives one level up in Canvas.tsx.
65
+ */
66
+ declare const serializeRow: (buffer: CanvasBuffer, row: number) => string;
67
+ export { CanvasContext as C, CanvasColor as a, CellStyle as b, CanvasBuffer as c, createCanvasBuffer as d, serializeRow as s };
@@ -0,0 +1 @@
1
+ import{setCursorStyle as t,cursorUp as c,cursorTo as u,cursorShow as l,cursorDown as b,cursorHide as i}from"@visulima/ansi";const d={bar:6,"blinking-bar":5,"blinking-block":1,"blinking-underline":3,block:2,default:0,underline:4},S=r=>t(d[r]),a=(r,o)=>r?.x!==o?.x||r?.y!==o?.y,C=(r,o)=>{if(!o)return"";const n=r-o.y;return(n>0?c(n):"")+u(o.x)+l},e=(r,o)=>{if(!o)return"";const n=r-1-o.y;return(n>0?b(n):"")+u(0)},p=r=>{const o=r.cursorWasShown?i:"",n=e(r.previousLineCount,r.previousCursorPosition),s=C(r.visibleLineCount,r.cursorPosition);return o+n+s},x=(r,o,n)=>r?i+e(o,n):"";export{p as buildCursorOnlySequence,S as buildCursorShapeSequence,C as buildCursorSuffix,e as buildReturnToBottom,x as buildReturnToBottomPrefix,a as cursorPositionChanged};
@@ -0,0 +1,23 @@
1
+ import { Writable } from 'node:stream';
2
+ /**
3
+ * Clipboard targets as defined by the OSC 52 spec.
4
+ * - `c` — system clipboard
5
+ * - `p` — primary selection (X11 only)
6
+ * - `s` — secondary selection (X11 only)
7
+ */
8
+ type ClipboardTarget = "c" | "p" | "s";
9
+ /**
10
+ * Check whether the current terminal likely supports OSC 52.
11
+ *
12
+ * Detection is best-effort based on `TERM_PROGRAM` and other env vars.
13
+ * Returns `true` for known-supported terminals, `false` otherwise.
14
+ */
15
+ declare const isOsc52Supported: () => boolean;
16
+ declare const writeOsc52: (stream: Writable, text: string, target?: ClipboardTarget) => void;
17
+ /**
18
+ * Clear the clipboard via OSC 52.
19
+ * @param stream The writable stream to write the escape sequence to.
20
+ * @param target The clipboard target. Defaults to `"c"`.
21
+ */
22
+ declare const clearOsc52: (stream: Writable, target?: ClipboardTarget) => void;
23
+ export { ClipboardTarget as C, clearOsc52 as c, isOsc52Supported as i, writeOsc52 as w };
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Color matrix transforms for color blindness simulation and compensation.
3
+ *
4
+ * Matrices sourced from research by Brettel, Viénot, and Mollon (1997)
5
+ * and Machado, Oliveira, and Fernandes (2009).
6
+ * @see https://www.inf.ufrgs.br/~oliveira/pubs_files/CVD_Simulation/CVD_Simulation.html
7
+ */
8
+ /**
9
+ * 3x3 color transformation matrix operating on linear RGB values (0-255).
10
+ */
11
+ type ColorMatrix = readonly [readonly [number, number, number], readonly [number, number, number], readonly [number, number, number]];
12
+ type ColorBlindnessType = "achromatopsia" | "deuteranopia" | "protanopia" | "tritanopia";
13
+ /**
14
+ * Simulation matrices — show how colors appear to users with color vision deficiency.
15
+ */
16
+ declare const COLOR_BLINDNESS_SIMULATION: Record<ColorBlindnessType, ColorMatrix>;
17
+ /**
18
+ * Compensation matrices — shift colors into a distinguishable range for affected users.
19
+ * These remap problematic colors to alternatives the user can perceive.
20
+ */
21
+ /**
22
+ * Compensation matrices — enhance distinguishability for affected users
23
+ * by redistributing the lost channel's energy into perceivable channels.
24
+ * Based on Daltonization approach (Fidaner et al., 2005).
25
+ */
26
+ declare const COLOR_BLINDNESS_COMPENSATION: Record<Exclude<ColorBlindnessType, "achromatopsia">, ColorMatrix>;
27
+ /**
28
+ * Identity matrix (no transformation).
29
+ */
30
+ declare const IDENTITY_MATRIX: ColorMatrix;
31
+ /**
32
+ * Apply a 3x3 color matrix to an RGB triplet.
33
+ * @param r Red channel (0-255)
34
+ * @param g Green channel (0-255)
35
+ * @param b Blue channel (0-255)
36
+ * @param matrix The 3x3 transformation matrix
37
+ * @returns Transformed [r, g, b] triplet, clamped to 0-255
38
+ */
39
+ declare const applyColorMatrix: (r: number, g: number, b: number, matrix: ColorMatrix) => [number, number, number];
40
+ declare const hexToRgb: (hex: string) => [number, number, number] | null;
41
+ /**
42
+ * Convert RGB components to a hex color string.
43
+ */
44
+ declare const rgbToHex: (r: number, g: number, b: number) => string;
45
+ /**
46
+ * Transform a hex color through a color blindness simulation or compensation matrix.
47
+ * Returns the original color if parsing fails.
48
+ */
49
+ declare const transformHexColor: (hex: string, matrix: ColorMatrix) => string;
50
+ export { ColorBlindnessType as C, IDENTITY_MATRIX as I, ColorMatrix as a, COLOR_BLINDNESS_COMPENSATION as b, COLOR_BLINDNESS_SIMULATION as c, applyColorMatrix as d, hexToRgb as h, rgbToHex as r, transformHexColor as t };
@@ -1 +1 @@
1
- const w=[1,8,2,16,4,32,64,128],A=(l,c)=>{const p=Math.max(0,l*2),x=Math.max(0,c*4),f=new Uint8Array(l*c),s=new Uint8Array(l*c),m=(a,r)=>{if(a<0||r<0||a>=p||r>=x)return;const h=Math.floor(a/2),i=Math.floor(r/4),t=a%2,o=r%4,e=w[o*2+t],n=i*l+h;(f[n]&e)===0&&(f[n]=(f[n]??0)|e,s[n]=1)};return{cellHeight:c,cellWidth:l,clear:()=>{f.fill(0),s.fill(0)},flush:(a,r)=>{for(const[h,i]of f.entries()){if(s[h]===0)continue;const t=h%l,o=Math.floor(h/l),e=10240+i;a.setCell(t,o,e,r)}},pixelHeight:x,pixelWidth:p,plotLine:(a,r,h,i)=>{let t=Math.round(a),o=Math.round(r);const e=Math.round(h),n=Math.round(i),M=Math.abs(e-t),g=t<e?1:-1,u=-Math.abs(n-o),k=o<n?1:-1;let d=M+u;for(;m(t,o),!(t===e&&o===n);){const y=2*d;if(y>=u){if(t===e)break;d+=u,t+=g}if(y<=M){if(o===n)break;d+=M,o+=k}}},plotPoint:m}};export{A as c};
1
+ const w=[1,8,2,16,4,32,64,128],A=(l,c)=>{const p=Math.max(0,l*2),x=Math.max(0,c*4),f=new Uint8Array(l*c),s=new Uint8Array(l*c),m=(a,r)=>{if(a<0||r<0||a>=p||r>=x)return;const h=Math.floor(a/2),i=Math.floor(r/4),t=a%2,o=r%4,e=w[o*2+t],n=i*l+h;(f[n]&e)===0&&(f[n]=(f[n]??0)|e,s[n]=1)};return{cellHeight:c,cellWidth:l,clear:()=>{f.fill(0),s.fill(0)},flush:(a,r)=>{for(const[h,i]of f.entries()){if(s[h]===0)continue;const t=h%l,o=Math.floor(h/l),e=10240+i;a.setCell(t,o,e,r)}},pixelHeight:x,pixelWidth:p,plotLine:(a,r,h,i)=>{let t=Math.round(a),o=Math.round(r);const e=Math.round(h),n=Math.round(i),M=Math.abs(e-t),g=t<e?1:-1,u=-Math.abs(n-o),k=o<n?1:-1;let d=M+u;for(;m(t,o),!(t===e&&o===n);){const y=2*d;if(y>=u){if(t===e)break;d+=u,t+=g}if(y<=M){if(o===n)break;d+=M,o+=k}}},plotPoint:m}};export{A as createBrailleGrid};
@@ -0,0 +1 @@
1
+ import{a as U}from"./colorize-DU4YZkp3.js";const R=Math.trunc(1),k=2,A=32,I=0,T=()=>{const c=new Map,f=[void 0];return{decode:a=>f[a],encode:a=>{if(a===void 0)return I;const g=typeof a=="number"?`n:${a}`:`s:${a}`,u=c.get(g);if(u!==void 0)return u;const m=f.length;return f.push(a),c.set(g,m),m}}},S=[9601,9602,9603,9604,9605,9606,9607,9608],$=[9615,9614,9613,9612,9611,9610,9609,9608],D=9608,_=c=>{if(!c)return 0;let f=0;return c.bold&&(f|=R),c.dim&&(f|=k),f},P=c=>typeof c=="number"?c:c.codePointAt(0)??A,E=(c,f)=>{const a=Math.max(0,c*f),g=new Uint32Array(a),u=new Uint32Array(a),m=new Int32Array(a),x=new Int32Array(a),b=new Uint8Array(f),{decode:y,encode:B}=T();g.fill(A);const M=r=>{r>=0&&r<f&&(b[r]=1)},h=(r,e,i,o)=>{if(r<0||r>=c||e<0||e>=f)return;const t=e*c+r,l=P(i),s=B(o?.color),n=B(o?.background),d=_(o);g[t]===l&&u[t]===d&&m[t]===s&&x[t]===n||(g[t]=l,u[t]=d,m[t]=s,x[t]=n,b[e]=1)};return{bg:x,chars:g,colorDecoder:y,context:{clear:()=>{g.fill(A),u.fill(0),m.fill(0),x.fill(0),b.fill(1)},drawHBar:(r,e,i,o,t)=>{if(i<=0||e<0||e>=f)return;const l=Math.max(0,Math.min(1,o)),s=i*$.length,n=Math.round(l*s),d=Math.floor(n/$.length),v=n%$.length;for(let w=0;w<i;w+=1){const p=r+w;w<d?h(p,e,D,t):w===d&&v>0?h(p,e,$[v-1],t):h(p,e,A,t)}M(e)},drawRect:(r,e,i,o,t,l)=>{if(i<=0||o<=0)return;const s=P(t);for(let n=0;n<o;n+=1){for(let d=0;d<i;d+=1)h(r+d,e+n,s,l);M(e+n)}},drawText:(r,e,i,o)=>{if(e<0||e>=f||i.length===0)return;let t=0;for(const l of i)h(r+t,e,l,o),t+=1;M(e)},drawVBar:(r,e,i,o,t)=>{if(i<=0||r<0||r>=c)return;const l=Math.max(0,Math.min(1,o)),s=i*S.length,n=Math.round(l*s),d=Math.floor(n/S.length),v=n%S.length;for(let w=0;w<i;w+=1){const p=i-w-1,C=e+w;p<d?h(r,C,D,t):p===d&&v>0?h(r,C,S[v-1],t):h(r,C,A,t),M(C)}},height:f,setCell:h,width:c},dirty:b,fg:m,height:f,styles:u,width:c}},H=(c,f)=>{const{bg:a,chars:g,colorDecoder:u,fg:m,styles:x,width:b}=c,y=f*b;let B="",M=0,h=x[y],r=m[y],e=a[y];const i=o=>{let t="";for(let d=M;d<o;d+=1)t+=String.fromCodePoint(g[y+d]);const l=u(r),s=u(e);let n=t;l!==void 0&&(n=U(n,typeof l=="number"?String(l):l,"foreground")),s!==void 0&&(n=U(n,typeof s=="number"?String(s):s,"background")),(h&R)!==0&&(n=`\x1B[1m${n}\x1B[22m`),(h&k)!==0&&(n=`\x1B[2m${n}\x1B[22m`),B+=n};for(let o=1;o<b;o+=1){const t=x[y+o],l=m[y+o],s=a[y+o];(t!==h||l!==r||s!==e)&&(i(o),M=o,h=t,r=l,e=s)}return i(b),B};export{E as createCanvasBuffer,H as serializeRow};
@@ -1,2 +1,2 @@
1
- import{createDecMode as P,setMode as w,resetMode as M,BracketedPasteMode as R,cursorUp as U,cursorToColumn1 as L,cursorHide as b,REQUEST_CURSOR_POSITION as z,cursorPosition as u,eraseLine as A,cursorShow as B}from"@visulima/ansi";import{terminalSize as C,Renderer as Y}from"./Renderer-DsskdkUd.js";const T=P(2026),_=w(T),g=M(T),k=w(R),D=M(R);function Q(I,d={}){const S=d.rows??10,E=d.fps??60,O=d.onExit??"preserve";let n=null,o=null,c=null,i=80,t=10,h=0,r=1;function e(s){o.writeRaw(s)}function a(){c.fill(0),I(c,i,t,h++),e(_);try{o.render(c)}finally{e(g)}}function v(s){r=s-t,e(U(t)+L),o.setRowOffset(r),a(),n=setInterval(()=>{a()},Math.round(1e3/E))}function x(){const s=C();i=s.cols;const y=s.rows;t=Math.min(S,y),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding("utf8"),o=new Y(i,t),c=new Uint32Array(i*t*2),e(b),e(k),e(`
1
+ import{createDecMode as P,setMode as w,resetMode as M,BracketedPasteMode as R,cursorUp as U,cursorToColumn1 as L,cursorHide as b,REQUEST_CURSOR_POSITION as z,cursorPosition as u,eraseLine as A,cursorShow as B}from"@visulima/ansi";import{terminalSize as C,Renderer as Y}from"./Renderer-BeS49FNq.js";const T=P(2026),_=w(T),g=M(T),k=w(R),D=M(R);function Q(I,d={}){const S=d.rows??10,E=d.fps??60,O=d.onExit??"preserve";let n=null,o=null,c=null,i=80,t=10,h=0,r=1;function e(s){o.writeRaw(s)}function a(){c.fill(0),I(c,i,t,h++),e(_);try{o.render(c)}finally{e(g)}}function v(s){r=s-t,e(U(t)+L),o.setRowOffset(r),a(),n=setInterval(()=>{a()},Math.round(1e3/E))}function x(){const s=C();i=s.cols;const y=s.rows;t=Math.min(S,y),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.resume(),process.stdin.setEncoding("utf8"),o=new Y(i,t),c=new Uint32Array(i*t*2),e(b),e(k),e(`
2
2
  `.repeat(t)),e(z),process.on("SIGINT",l);let p="";const f=N=>{p+=N;const m=p.match(/\u001B\[(\d+);(\d+)R/);m&&(process.stdin.off("data",f),v(Number.parseInt(m[1],10)))};process.stdin.on("data",f)}function l(){if(n&&(clearInterval(n),n=null),o){if(O==="destroy"){for(let s=0;s<t;s++)e(u(r+1+s,1)+A);e(u(r+1,1))}else e(u(r+t+1,1));e(D),e(B)}process.stdin.isTTY&&process.stdin.setRawMode(!1),process.stdin.pause(),process.exit(0)}return{start:x,stop:l}}export{Q as createInlineLoop};
@@ -0,0 +1 @@
1
+ const l={bash:()=>import("@shikijs/langs/bash"),c:()=>import("@shikijs/langs/c"),clojure:()=>import("@shikijs/langs/clojure"),cpp:()=>import("@shikijs/langs/cpp"),csharp:()=>import("@shikijs/langs/csharp"),css:()=>import("@shikijs/langs/css"),dart:()=>import("@shikijs/langs/dart"),diff:()=>import("@shikijs/langs/diff"),dockerfile:()=>import("@shikijs/langs/dockerfile"),elixir:()=>import("@shikijs/langs/elixir"),erlang:()=>import("@shikijs/langs/erlang"),go:()=>import("@shikijs/langs/go"),graphql:()=>import("@shikijs/langs/graphql"),groovy:()=>import("@shikijs/langs/groovy"),haskell:()=>import("@shikijs/langs/haskell"),html:()=>import("@shikijs/langs/html"),java:()=>import("@shikijs/langs/java"),javascript:()=>import("@shikijs/langs/javascript"),json:()=>import("@shikijs/langs/json"),jsonc:()=>import("@shikijs/langs/jsonc"),jsx:()=>import("@shikijs/langs/jsx"),kotlin:()=>import("@shikijs/langs/kotlin"),less:()=>import("@shikijs/langs/less"),lua:()=>import("@shikijs/langs/lua"),makefile:()=>import("@shikijs/langs/makefile"),markdown:()=>import("@shikijs/langs/markdown"),mdx:()=>import("@shikijs/langs/mdx"),nginx:()=>import("@shikijs/langs/nginx"),objc:()=>import("@shikijs/langs/objc"),perl:()=>import("@shikijs/langs/perl"),php:()=>import("@shikijs/langs/php"),powershell:()=>import("@shikijs/langs/powershell"),prisma:()=>import("@shikijs/langs/prisma"),python:()=>import("@shikijs/langs/python"),r:()=>import("@shikijs/langs/r"),ruby:()=>import("@shikijs/langs/ruby"),rust:()=>import("@shikijs/langs/rust"),scala:()=>import("@shikijs/langs/scala"),scss:()=>import("@shikijs/langs/scss"),shell:()=>import("@shikijs/langs/shell"),sql:()=>import("@shikijs/langs/sql"),svelte:()=>import("@shikijs/langs/svelte"),swift:()=>import("@shikijs/langs/swift"),text:()=>Promise.resolve({name:"text",patterns:[],repository:{},scopeName:"source.text"}),toml:()=>import("@shikijs/langs/toml"),tsx:()=>import("@shikijs/langs/tsx"),typescript:()=>import("@shikijs/langs/typescript"),vue:()=>import("@shikijs/langs/vue"),xml:()=>import("@shikijs/langs/xml"),yaml:()=>import("@shikijs/langs/yaml"),zig:()=>import("@shikijs/langs/zig")},d={"c#":"csharp","c++":"cpp",docker:"dockerfile",gql:"graphql",hs:"haskell",js:"javascript",kt:"kotlin",md:"markdown","objective-c":"objc",ps1:"powershell",py:"python",rb:"ruby",rs:"rust",sh:"bash",ts:"typescript",yml:"yaml",zsh:"bash"},g={"catppuccin-frappe":()=>import("@shikijs/themes/catppuccin-frappe"),"catppuccin-latte":()=>import("@shikijs/themes/catppuccin-latte"),"catppuccin-macchiato":()=>import("@shikijs/themes/catppuccin-macchiato"),"catppuccin-mocha":()=>import("@shikijs/themes/catppuccin-mocha"),"dark-plus":()=>import("@shikijs/themes/dark-plus"),dracula:()=>import("@shikijs/themes/dracula"),"github-dark":()=>import("@shikijs/themes/github-dark"),"github-dark-default":()=>import("@shikijs/themes/github-dark-default"),"github-dark-dimmed":()=>import("@shikijs/themes/github-dark-dimmed"),"github-light":()=>import("@shikijs/themes/github-light"),"github-light-default":()=>import("@shikijs/themes/github-light-default"),"light-plus":()=>import("@shikijs/themes/light-plus"),"min-dark":()=>import("@shikijs/themes/min-dark"),"min-light":()=>import("@shikijs/themes/min-light"),monokai:()=>import("@shikijs/themes/monokai"),nord:()=>import("@shikijs/themes/nord"),"one-dark-pro":()=>import("@shikijs/themes/one-dark-pro"),"one-light":()=>import("@shikijs/themes/one-light"),poimandres:()=>import("@shikijs/themes/poimandres"),"rose-pine":()=>import("@shikijs/themes/rose-pine"),"rose-pine-dawn":()=>import("@shikijs/themes/rose-pine-dawn"),"rose-pine-moon":()=>import("@shikijs/themes/rose-pine-moon"),"slack-dark":()=>import("@shikijs/themes/slack-dark"),"slack-ochin":()=>import("@shikijs/themes/slack-ochin"),"solarized-dark":()=>import("@shikijs/themes/solarized-dark"),"solarized-light":()=>import("@shikijs/themes/solarized-light"),"tokyo-night":()=>import("@shikijs/themes/tokyo-night"),"vitesse-dark":()=>import("@shikijs/themes/vitesse-dark"),"vitesse-light":()=>import("@shikijs/themes/vitesse-light")};let a;const m=new Map,c=new Map,u=50,p=new Map,k=(i,t,o)=>`${i.length}:${i}\0${t}\0${o}`,b=(i,t,o,e)=>{const r=k(t,o,e);if(p.has(r)){const s=p.get(r);return p.delete(r),p.set(r,s),s}const n=i.codeToTokens(t,{lang:o,theme:e});if(p.set(r,n),p.size>u){const s=p.keys().next().value;s!==void 0&&p.delete(s)}return n},y=async()=>{const[i,t]=await Promise.all([import("shiki/core"),import("shiki/engine/javascript")]),{createHighlighterCore:o}=i,{createJavaScriptRegexEngine:e}=t;return await o({engine:e(),langs:[],themes:[import("@shikijs/themes/github-dark-default")]})},h=i=>{const t=i.toLowerCase();return d[t]??t},v=i=>h(i)in l,w=async(i,t)=>{const o=h(t);if(!(o==="text"||(i.getLoadedLanguages?.()??[]).includes(o))){if(!m.has(o)){const e=(async()=>{try{const r=l[o];r&&await i.loadLanguage(await r())}catch(r){throw m.delete(o),r}})();m.set(o,e)}await m.get(o)}},f=async(i,t)=>{if((i.getLoadedThemes?.()??[]).includes(t))return;const o=g[t];if(o){if(!c.has(t)){const e=(async()=>{try{await i.loadTheme(await o())}catch(r){throw c.delete(t),r}})();c.set(t,e)}await c.get(t)}},x=async(i=[],t)=>{a||(a=y());const o=await a,e=i.map(r=>w(o,r));return t&&t!=="github-dark-default"&&e.push(f(o,t)),await Promise.all(e),o},j=()=>{m.clear(),c.clear(),p.clear(),a&&(a.then(i=>{try{i.dispose?.()}catch{}}).catch(()=>{}),a=void 0)};export{x as default,j as disposeHighlighter,b as getCachedTokens,v as isLanguageSupported,h as resolveLanguage};