@visulima/tui 1.0.0-alpha.9 → 1.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 (549) hide show
  1. package/CHANGELOG.md +650 -0
  2. package/LICENSE.md +2414 -187
  3. package/README.md +49 -4
  4. package/dist/components/accordion.d.ts +59 -0
  5. package/dist/components/accordion.js +1 -0
  6. package/dist/components/alert.d.ts +26 -0
  7. package/dist/components/alert.js +1 -0
  8. package/dist/components/animate-presence.d.ts +18 -0
  9. package/dist/components/animate-presence.js +1 -0
  10. package/dist/components/approval-prompt.d.ts +65 -0
  11. package/dist/components/approval-prompt.js +1 -0
  12. package/dist/components/area-chart.d.ts +66 -0
  13. package/dist/components/area-chart.js +1 -0
  14. package/dist/components/badge.d.ts +22 -0
  15. package/dist/components/badge.js +1 -0
  16. package/dist/components/bar-chart.d.ts +67 -0
  17. package/dist/components/bar-chart.js +1 -0
  18. package/dist/components/big-text.d.ts +81 -0
  19. package/dist/components/big-text.js +1 -0
  20. package/dist/components/blink-dot.d.ts +36 -0
  21. package/dist/components/blink-dot.js +1 -0
  22. package/dist/components/box.d.ts +62 -0
  23. package/dist/components/box.js +1 -0
  24. package/dist/components/breadcrumb.d.ts +33 -0
  25. package/dist/components/breadcrumb.js +1 -0
  26. package/dist/components/button.d.ts +45 -0
  27. package/dist/components/button.js +1 -0
  28. package/dist/components/calendar.d.ts +72 -0
  29. package/dist/components/calendar.js +1 -0
  30. package/dist/components/canvas.d.ts +44 -0
  31. package/dist/components/canvas.js +1 -0
  32. package/dist/components/card.d.ts +57 -0
  33. package/dist/components/card.js +1 -0
  34. package/dist/components/checkbox.d.ts +48 -0
  35. package/dist/components/checkbox.js +1 -0
  36. package/dist/components/code.d.ts +48 -0
  37. package/dist/components/code.js +2 -0
  38. package/dist/components/collapsible.d.ts +53 -0
  39. package/dist/components/collapsible.js +1 -0
  40. package/dist/components/command-block.d.ts +47 -0
  41. package/dist/components/command-block.js +4 -0
  42. package/dist/components/command-palette.d.ts +82 -0
  43. package/dist/components/command-palette.js +1 -0
  44. package/dist/components/confirm-dialog.d.ts +75 -0
  45. package/dist/components/confirm-dialog.js +1 -0
  46. package/dist/components/confirm-input.d.ts +38 -0
  47. package/dist/components/confirm-input.js +1 -0
  48. package/dist/components/console-overlay.d.ts +54 -0
  49. package/dist/components/console-overlay.js +1 -0
  50. package/dist/components/content-switcher.d.ts +57 -0
  51. package/dist/components/content-switcher.js +1 -0
  52. package/dist/components/controlled-scroll-view.d.ts +61 -0
  53. package/dist/components/controlled-scroll-view.js +1 -0
  54. package/dist/components/cursor.d.ts +62 -0
  55. package/dist/components/cursor.js +1 -0
  56. package/dist/components/date-picker.d.ts +65 -0
  57. package/dist/components/date-picker.js +1 -0
  58. package/dist/components/definition-list.d.ts +44 -0
  59. package/dist/components/definition-list.js +1 -0
  60. package/dist/components/dialog.d.ts +117 -0
  61. package/dist/components/dialog.js +1 -0
  62. package/dist/components/diff-view.d.ts +85 -0
  63. package/dist/components/diff-view.js +1 -0
  64. package/dist/components/divider.d.ts +49 -0
  65. package/dist/components/divider.js +1 -0
  66. package/dist/components/file-picker-entry.d.ts +104 -0
  67. package/dist/components/file-picker-entry.js +1 -0
  68. package/dist/components/form.d.ts +81 -0
  69. package/dist/components/form.js +1 -0
  70. package/dist/components/gauge.d.ts +87 -0
  71. package/dist/components/gauge.js +1 -0
  72. package/dist/components/gradient.d.ts +42 -0
  73. package/dist/components/gradient.js +1 -0
  74. package/dist/components/heading.d.ts +33 -0
  75. package/dist/components/heading.js +1 -0
  76. package/dist/components/heatmap.d.ts +62 -0
  77. package/dist/components/heatmap.js +1 -0
  78. package/dist/components/help.d.ts +52 -0
  79. package/dist/components/help.js +1 -0
  80. package/dist/components/histogram.d.ts +62 -0
  81. package/dist/components/histogram.js +1 -0
  82. package/dist/components/kbd.d.ts +31 -0
  83. package/dist/components/kbd.js +1 -0
  84. package/dist/components/line-chart.d.ts +109 -0
  85. package/dist/components/line-chart.js +1 -0
  86. package/dist/components/link.d.ts +38 -0
  87. package/dist/components/link.js +1 -0
  88. package/dist/components/loading-indicator.d.ts +29 -0
  89. package/dist/components/loading-indicator.js +1 -0
  90. package/dist/components/markdown.d.ts +40 -0
  91. package/dist/components/markdown.js +1 -0
  92. package/dist/components/masked-input.d.ts +50 -0
  93. package/dist/components/masked-input.js +1 -0
  94. package/dist/components/menu.d.ts +78 -0
  95. package/dist/components/menu.js +1 -0
  96. package/dist/components/message-bubble.d.ts +43 -0
  97. package/dist/components/message-bubble.js +1 -0
  98. package/dist/components/model-badge.d.ts +39 -0
  99. package/dist/components/model-badge.js +1 -0
  100. package/dist/components/multi-select.d.ts +65 -0
  101. package/dist/components/multi-select.js +1 -0
  102. package/dist/components/newline.d.ts +15 -0
  103. package/dist/components/newline.js +2 -0
  104. package/dist/components/operation-tree.d.ts +49 -0
  105. package/dist/components/operation-tree.js +1 -0
  106. package/dist/components/option-list.d.ts +47 -0
  107. package/dist/components/option-list.js +1 -0
  108. package/dist/components/ordered-list.d.ts +24 -0
  109. package/dist/components/ordered-list.js +1 -0
  110. package/dist/components/paginator.d.ts +69 -0
  111. package/dist/components/paginator.js +1 -0
  112. package/dist/components/paragraph.d.ts +38 -0
  113. package/dist/components/paragraph.js +1 -0
  114. package/dist/components/placeholder.d.ts +55 -0
  115. package/dist/components/placeholder.js +1 -0
  116. package/dist/components/progress-bar.d.ts +56 -0
  117. package/dist/components/progress-bar.js +1 -0
  118. package/dist/components/radio-group.d.ts +74 -0
  119. package/dist/components/radio-group.js +1 -0
  120. package/dist/components/scatter-plot.d.ts +35 -0
  121. package/dist/components/scatter-plot.js +1 -0
  122. package/dist/components/scroll-bar-box.d.ts +37 -0
  123. package/dist/components/scroll-bar-box.js +1 -0
  124. package/dist/components/scroll-bar.d.ts +25 -0
  125. package/dist/components/scroll-bar.js +1 -0
  126. package/dist/components/scroll-list.d.ts +20 -0
  127. package/dist/components/scroll-list.js +1 -0
  128. package/dist/components/scroll-view.d.ts +10 -0
  129. package/dist/components/scroll-view.js +1 -0
  130. package/dist/components/search-input.d.ts +55 -0
  131. package/dist/components/search-input.js +1 -0
  132. package/dist/components/select-input-indicator.d.ts +32 -0
  133. package/dist/components/select-input-indicator.js +1 -0
  134. package/dist/components/select-input-item.d.ts +41 -0
  135. package/dist/components/select-input-item.js +1 -0
  136. package/dist/components/select-input.d.ts +110 -0
  137. package/dist/components/select-input.js +1 -0
  138. package/dist/components/shimmer-text.d.ts +47 -0
  139. package/dist/components/shimmer-text.js +1 -0
  140. package/dist/components/slider.d.ts +103 -0
  141. package/dist/components/slider.js +1 -0
  142. package/dist/components/spacer.d.ts +8 -0
  143. package/dist/components/spacer.js +1 -0
  144. package/dist/components/sparkline.d.ts +35 -0
  145. package/dist/components/sparkline.js +1 -0
  146. package/dist/components/spinner.d.ts +17 -0
  147. package/dist/components/spinner.js +1 -0
  148. package/dist/components/static-render.d.ts +55 -0
  149. package/dist/components/static-render.js +1 -0
  150. package/dist/components/static.d.ts +29 -0
  151. package/dist/components/static.js +1 -0
  152. package/dist/components/status-line.d.ts +37 -0
  153. package/dist/components/status-line.js +1 -0
  154. package/dist/components/status-message.d.ts +21 -0
  155. package/dist/components/status-message.js +1 -0
  156. package/dist/components/stepper.d.ts +48 -0
  157. package/dist/components/stepper.js +1 -0
  158. package/dist/components/stopwatch.d.ts +49 -0
  159. package/dist/components/stopwatch.js +1 -0
  160. package/dist/components/streaming-text.d.ts +46 -0
  161. package/dist/components/streaming-text.js +1 -0
  162. package/dist/components/switch.d.ts +55 -0
  163. package/dist/components/switch.js +1 -0
  164. package/dist/components/tab.d.ts +19 -0
  165. package/dist/components/tab.js +1 -0
  166. package/dist/components/table.d.ts +119 -0
  167. package/dist/components/table.js +1 -0
  168. package/dist/components/tabs.d.ts +107 -0
  169. package/dist/components/tabs.js +1 -0
  170. package/dist/components/tag.d.ts +35 -0
  171. package/dist/components/tag.js +1 -0
  172. package/dist/components/text-input.d.ts +48 -0
  173. package/dist/components/text-input.js +1 -0
  174. package/dist/components/text.d.ts +79 -0
  175. package/dist/components/text.js +1 -0
  176. package/dist/components/textarea.d.ts +68 -0
  177. package/dist/components/textarea.js +2 -0
  178. package/dist/components/timer.d.ts +59 -0
  179. package/dist/components/timer.js +1 -0
  180. package/dist/components/toast.d.ts +49 -0
  181. package/dist/components/toast.js +1 -0
  182. package/dist/components/tooltip.d.ts +43 -0
  183. package/dist/components/tooltip.js +1 -0
  184. package/dist/components/transform.d.ts +21 -0
  185. package/dist/components/transform.js +1 -0
  186. package/dist/components/transition.d.ts +74 -0
  187. package/dist/components/transition.js +1 -0
  188. package/dist/components/tree-view-entry.d.ts +357 -0
  189. package/dist/components/tree-view-entry.js +1 -0
  190. package/dist/components/unordered-list.d.ts +30 -0
  191. package/dist/components/unordered-list.js +1 -0
  192. package/dist/core/index.d.ts +2 -2
  193. package/dist/core/index.js +1 -1
  194. package/dist/ink/hooks/use-animation.d.ts +41 -0
  195. package/dist/ink/hooks/use-animation.js +1 -0
  196. package/dist/ink/hooks/use-app.d.ts +38 -0
  197. package/dist/ink/hooks/use-app.js +1 -0
  198. package/dist/ink/hooks/use-box-metrics.d.ts +66 -0
  199. package/dist/ink/hooks/use-box-metrics.js +1 -0
  200. package/dist/ink/hooks/use-clipboard.d.ts +30 -0
  201. package/dist/ink/hooks/use-clipboard.js +1 -0
  202. package/dist/ink/hooks/use-color-blindness.d.ts +33 -0
  203. package/dist/ink/hooks/use-color-blindness.js +1 -0
  204. package/dist/ink/hooks/use-console-capture.d.ts +43 -0
  205. package/dist/ink/hooks/use-console-capture.js +1 -0
  206. package/dist/ink/hooks/use-cursor.d.ts +13 -0
  207. package/dist/ink/hooks/use-cursor.js +1 -0
  208. package/dist/ink/hooks/use-focus-manager.d.ts +57 -0
  209. package/dist/ink/hooks/use-focus-manager.js +1 -0
  210. package/dist/ink/hooks/use-focus.d.ts +34 -0
  211. package/dist/ink/hooks/use-focus.js +1 -0
  212. package/dist/ink/hooks/use-form.d.ts +68 -0
  213. package/dist/ink/hooks/use-form.js +1 -0
  214. package/dist/ink/hooks/use-hotkey.d.ts +37 -0
  215. package/dist/ink/hooks/use-hotkey.js +1 -0
  216. package/dist/ink/hooks/use-input.d.ts +149 -0
  217. package/dist/ink/hooks/use-input.js +2 -0
  218. package/dist/ink/hooks/use-interval.d.ts +25 -0
  219. package/dist/ink/hooks/use-interval.js +1 -0
  220. package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +6 -0
  221. package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -0
  222. package/dist/ink/hooks/use-key-bindings.d.ts +59 -0
  223. package/dist/ink/hooks/use-key-bindings.js +1 -0
  224. package/dist/ink/hooks/use-key-chord.d.ts +25 -0
  225. package/dist/ink/hooks/use-key-chord.js +1 -0
  226. package/dist/ink/hooks/use-linked-scroll.d.ts +49 -0
  227. package/dist/ink/hooks/use-linked-scroll.js +1 -0
  228. package/dist/ink/hooks/use-paste.d.ts +45 -0
  229. package/dist/ink/hooks/use-paste.js +1 -0
  230. package/dist/ink/hooks/use-persistent-state.d.ts +65 -0
  231. package/dist/ink/hooks/use-persistent-state.js +2 -0
  232. package/dist/ink/hooks/use-scroll-acceleration.d.ts +47 -0
  233. package/dist/ink/hooks/use-scroll-acceleration.js +1 -0
  234. package/dist/ink/hooks/use-scroll-input.d.ts +34 -0
  235. package/dist/ink/hooks/use-scroll-input.js +1 -0
  236. package/dist/ink/hooks/use-stderr.d.ts +16 -0
  237. package/dist/ink/hooks/use-stderr.js +1 -0
  238. package/dist/ink/hooks/use-stdin.d.ts +30 -0
  239. package/dist/ink/hooks/use-stdin.js +1 -0
  240. package/dist/ink/hooks/use-stdout.d.ts +16 -0
  241. package/dist/ink/hooks/use-stdout.js +1 -0
  242. package/dist/ink/hooks/use-stopwatch.d.ts +39 -0
  243. package/dist/ink/hooks/use-stopwatch.js +1 -0
  244. package/dist/ink/hooks/use-terminal-palette.d.ts +20 -0
  245. package/dist/ink/hooks/use-terminal-palette.js +1 -0
  246. package/dist/ink/hooks/use-text-buffer.d.ts +42 -0
  247. package/dist/ink/hooks/use-text-buffer.js +4 -0
  248. package/dist/ink/hooks/use-text-selection.d.ts +45 -0
  249. package/dist/ink/hooks/use-text-selection.js +1 -0
  250. package/dist/ink/hooks/use-timeout.d.ts +24 -0
  251. package/dist/ink/hooks/use-timeout.js +1 -0
  252. package/dist/ink/hooks/use-timer.d.ts +48 -0
  253. package/dist/ink/hooks/use-timer.js +1 -0
  254. package/dist/ink/hooks/use-window-size.d.ts +18 -0
  255. package/dist/ink/hooks/use-window-size.js +1 -0
  256. package/dist/ink/index.d.ts +30 -6251
  257. package/dist/ink/index.js +1 -1
  258. package/dist/ink/mouse/use-element-position.d.ts +31 -0
  259. package/dist/ink/mouse/use-element-position.js +1 -0
  260. package/dist/ink/mouse/use-mouse-action.d.ts +5 -0
  261. package/dist/ink/mouse/use-mouse-action.js +1 -0
  262. package/dist/ink/mouse/use-mouse-position.d.ts +5 -0
  263. package/dist/ink/mouse/use-mouse-position.js +1 -0
  264. package/dist/ink/mouse/use-mouse.d.ts +5 -0
  265. package/dist/ink/mouse/use-mouse.js +1 -0
  266. package/dist/ink/mouse/use-on-mouse-click.d.ts +16 -0
  267. package/dist/ink/mouse/use-on-mouse-click.js +1 -0
  268. package/dist/ink/mouse/use-on-mouse-hover.d.ts +10 -0
  269. package/dist/ink/mouse/use-on-mouse-hover.js +1 -0
  270. package/dist/ink/mouse/use-on-mouse-state.d.ts +13 -0
  271. package/dist/ink/mouse/use-on-mouse-state.js +1 -0
  272. package/dist/packem_chunks/devtools.js +1 -1
  273. package/dist/packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js +1 -0
  274. package/dist/packem_shared/ControlledScrollView-Cn4byU2n.js +1 -0
  275. package/dist/packem_shared/DevTools-k6uiVzqv.js +1 -0
  276. package/dist/packem_shared/FilePicker-BLS9nOPz.js +1 -0
  277. package/dist/packem_shared/FocusContext-C2Sosxa4.js +1 -0
  278. package/dist/packem_shared/Fullscreen-BRhuBLBh.js +1 -0
  279. package/dist/packem_shared/IMECompositionBuffer-VhC9HRCv.js +1 -0
  280. package/dist/packem_shared/InputParser-CtwkCbrQ.js +2 -0
  281. package/dist/packem_shared/KEY-C--kOw41.js +1 -0
  282. package/dist/packem_shared/LayoutNode-LPYsuzBg.js +1 -0
  283. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +1 -0
  284. package/dist/packem_shared/NAMED_COLORS-82DpREQV.js +1 -0
  285. package/dist/packem_shared/Range-BsVYNWtg.js +1 -0
  286. package/dist/packem_shared/Renderer-DsskdkUd.js +1 -0
  287. package/dist/packem_shared/ResizeObserver-BI9bDy-j.js +1 -0
  288. package/dist/packem_shared/ScrollBar-qa1IzDDv.js +1 -0
  289. package/dist/packem_shared/ScrollBarBox-DchESZWv.js +1 -0
  290. package/dist/packem_shared/ScrollList-BBAnRsrC.js +1 -0
  291. package/dist/packem_shared/ScrollView-CHAo7Epj.js +1 -0
  292. package/dist/packem_shared/Static-DSzsElz4.js +1 -0
  293. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +1 -0
  294. package/dist/packem_shared/TreeView-BsvLCsf0.js +1 -0
  295. package/dist/packem_shared/TuiApp-BPL8v1i1.js +1 -0
  296. package/dist/packem_shared/TuiContext-BNmP0lMY.js +3 -0
  297. package/dist/packem_shared/ansi-parser-DlgLtOYO.js +1 -0
  298. package/dist/packem_shared/ansi-tokenizer-BU67A126.js +1 -0
  299. package/dist/packem_shared/braille-ch3O5D7I.js +1 -0
  300. package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +39 -0
  301. package/dist/packem_shared/calculateScroll-D4Y_JR4H.js +1 -0
  302. package/dist/packem_shared/{measureElement-DA8WqFP_.js → calculateScrollbarLayout-Lf6i24c9.js} +1 -1
  303. package/dist/packem_shared/clearOsc52-BUpnQOav.js +1 -0
  304. package/dist/packem_shared/clearStringWidthCache-DKFjfJuB.js +1 -0
  305. package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +23 -0
  306. package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +50 -0
  307. package/dist/packem_shared/colorize-DU4YZkp3.js +1 -0
  308. package/dist/packem_shared/controlled-scroll-view-BVg7ywNW.js +1 -0
  309. package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +2 -0
  310. package/dist/packem_shared/createScreen-DoYpyL0V.js +3 -0
  311. package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +12 -0
  312. package/dist/packem_shared/dom-rphpG0kf.js +1 -0
  313. package/dist/packem_shared/dom.d-B4kXbaVY.d.ts +449 -0
  314. package/dist/packem_shared/format-time-fjoQHMxD.js +1 -0
  315. package/dist/packem_shared/{getPathToRoot-B2tKmx3i.js → getPathToRoot-PDJeqiEH.js} +1 -1
  316. package/dist/packem_shared/input-utils-BSWCb4F_.js +1 -0
  317. package/dist/packem_shared/{input.d-Bfq7oc06.d.ts → input.d-CgxV2e8U.d.ts} +1 -1
  318. package/dist/packem_shared/isIntersecting-Bo2npvMR.js +1 -0
  319. package/dist/packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js +1 -0
  320. package/dist/packem_shared/kittyFlags-g8ALyoCU.js +1 -0
  321. package/dist/packem_shared/line-chart-C7CUrvVs.js +1 -0
  322. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +1 -0
  323. package/dist/packem_shared/measure-element-D4M9iSYp.js +1 -0
  324. package/dist/packem_shared/measure-text-B7juNq4Y.js +3 -0
  325. package/dist/packem_shared/mouse-context.d-BfL9xGk_.d.ts +30 -0
  326. package/dist/packem_shared/parseSgrMouse-bUrqPrh-.js +1 -0
  327. package/dist/packem_shared/processLayout-I83k6vXE.js +2 -0
  328. package/dist/packem_shared/reconciler-CFyBVf7l.js +1 -0
  329. package/dist/packem_shared/reconciler-ClpU7Y-V.js +1 -0
  330. package/dist/packem_shared/render-CuQecTAs.js +24 -0
  331. package/dist/packem_shared/render-DFZ8NHlG.js +1 -0
  332. package/dist/packem_shared/render.d-CBnYBDk2.d.ts +417 -0
  333. package/dist/packem_shared/renderToString-DwXFY8Qh.js +4 -0
  334. package/dist/packem_shared/renderToString-L_bpw4OQ.js +2 -0
  335. package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +2 -0
  336. package/dist/packem_shared/renderer-k-xShm1P.js +17 -0
  337. package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +119 -0
  338. package/dist/packem_shared/selection.d-CI3_p8wg.d.ts +62 -0
  339. package/dist/packem_shared/squashTextNodesWithMap-BmUSBPfc.js +1 -0
  340. package/dist/packem_shared/stderr-context-Bvnik0hL.js +1 -0
  341. package/dist/packem_shared/stdin-context-88AhuztD.js +1 -0
  342. package/dist/packem_shared/styles.d-cMo36xQz.d.ts +396 -0
  343. package/dist/packem_shared/terminal-palette.d-D2SQjfn-.d.ts +19 -0
  344. package/dist/packem_shared/text-width-e49vlbQH.js +2 -0
  345. package/dist/packem_shared/token-to-elements-D6J6-P2A.js +1 -0
  346. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +1 -0
  347. package/dist/packem_shared/useTreeView-D5ifGwG3.js +1 -0
  348. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +1 -0
  349. package/dist/packem_shared/utils-Bup8lyK8.js +1 -0
  350. package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +2 -0
  351. package/dist/packem_shared/waitFor-CTAki32d.js +4 -0
  352. package/dist/packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js +3 -0
  353. package/dist/react/index.d.ts +2 -2
  354. package/dist/react/index.js +1 -1
  355. package/dist/testing/index.d.ts +5 -1
  356. package/dist/testing/index.js +1 -1
  357. package/index.js +65 -156
  358. package/package.json +601 -47
  359. package/dist/packem_shared/Accordion-BXsqchV-.js +0 -1
  360. package/dist/packem_shared/Alert-BhYVMHtR.js +0 -1
  361. package/dist/packem_shared/AnimatePresence-Eu7Z8KHc.js +0 -1
  362. package/dist/packem_shared/ApprovalPrompt-BSn0FT1g.js +0 -1
  363. package/dist/packem_shared/AreaChart-Chy-frI7.js +0 -1
  364. package/dist/packem_shared/Badge-B8WPyRsK.js +0 -1
  365. package/dist/packem_shared/BarChart-rpZtlMcF.js +0 -1
  366. package/dist/packem_shared/BigText-CRpwUzrt.js +0 -1
  367. package/dist/packem_shared/BlinkDot-BvnRuWP8.js +0 -1
  368. package/dist/packem_shared/Box-BwqSvWuq.js +0 -1
  369. package/dist/packem_shared/Breadcrumb-D0hClbRV.js +0 -1
  370. package/dist/packem_shared/Button-B89Yvbc6.js +0 -1
  371. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +0 -1
  372. package/dist/packem_shared/Calendar-Dmflvm2S.js +0 -1
  373. package/dist/packem_shared/Canvas-CKg6WV47.js +0 -1
  374. package/dist/packem_shared/Card-B_9fXdtU.js +0 -1
  375. package/dist/packem_shared/Checkbox-BN71eCWU.js +0 -1
  376. package/dist/packem_shared/Code-HhevcyiH.js +0 -2
  377. package/dist/packem_shared/Collapsible-u6uf_FdV.js +0 -1
  378. package/dist/packem_shared/CommandBlock-B-nslpCv.js +0 -4
  379. package/dist/packem_shared/CommandPalette-CEFdaURo.js +0 -1
  380. package/dist/packem_shared/ConfirmDialog-5Jje_Xpu.js +0 -1
  381. package/dist/packem_shared/ConfirmInput-D44Mb9oo.js +0 -1
  382. package/dist/packem_shared/ConsoleOverlay-CM3APfgP.js +0 -1
  383. package/dist/packem_shared/ContentSwitcher-Dm5BkrCt.js +0 -1
  384. package/dist/packem_shared/ControlledScrollView-DI8KZOQB.js +0 -1
  385. package/dist/packem_shared/Cursor-BoLFIMol.js +0 -1
  386. package/dist/packem_shared/DatePicker-CnSrFFAE.js +0 -1
  387. package/dist/packem_shared/DefinitionList-v8RDuF_R.js +0 -1
  388. package/dist/packem_shared/DevTools-O8EbCfHa.js +0 -1
  389. package/dist/packem_shared/Dialog-CTaL8pn0.js +0 -1
  390. package/dist/packem_shared/DiffView-BUIFqUB0.js +0 -1
  391. package/dist/packem_shared/Divider-C47bKmqu.js +0 -1
  392. package/dist/packem_shared/FilePicker-CUo7R5Qb.js +0 -1
  393. package/dist/packem_shared/FocusContext-Xy0cwJpO.js +0 -1
  394. package/dist/packem_shared/FormField-af3aUpRL.js +0 -1
  395. package/dist/packem_shared/Fullscreen-CuJ8y0s0.js +0 -1
  396. package/dist/packem_shared/Gauge-Dz-usH__.js +0 -1
  397. package/dist/packem_shared/Gradient-DYNc0GZA.js +0 -1
  398. package/dist/packem_shared/Heading-mwEYza3Y.js +0 -1
  399. package/dist/packem_shared/Heatmap-ChL97U1-.js +0 -1
  400. package/dist/packem_shared/Help-Zcelyw_U.js +0 -1
  401. package/dist/packem_shared/Histogram-FIf2F83d.js +0 -1
  402. package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +0 -1
  403. package/dist/packem_shared/InputParser-rZKjY_7Y.js +0 -2
  404. package/dist/packem_shared/KEY-Bk8B-3h_.js +0 -1
  405. package/dist/packem_shared/Kbd-DpkPp4jB.js +0 -1
  406. package/dist/packem_shared/LayoutNode-rxblE317.js +0 -1
  407. package/dist/packem_shared/LineChart-BXE_girm.js +0 -1
  408. package/dist/packem_shared/Link-i2o2EG4-.js +0 -1
  409. package/dist/packem_shared/LoadingIndicator-TC1Fjwyt.js +0 -1
  410. package/dist/packem_shared/Markdown-R1XqK63D.js +0 -1
  411. package/dist/packem_shared/MaskedInput-J01phOZs.js +0 -1
  412. package/dist/packem_shared/Menu-CfrH4ymk.js +0 -1
  413. package/dist/packem_shared/MessageBubble-BmBBU2Rm.js +0 -1
  414. package/dist/packem_shared/ModelBadge-D3wrXncu.js +0 -1
  415. package/dist/packem_shared/MouseProvider-pjza-lpc.js +0 -1
  416. package/dist/packem_shared/MultiSelect-Dqmn-bVo.js +0 -1
  417. package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +0 -1
  418. package/dist/packem_shared/Newline-BSG4iUqp.js +0 -2
  419. package/dist/packem_shared/OperationTree-DksxjMIV.js +0 -1
  420. package/dist/packem_shared/OptionList-CNx7r9yN.js +0 -1
  421. package/dist/packem_shared/OrderedList-BeDy035w.js +0 -1
  422. package/dist/packem_shared/Paginator-B56s6bhS.js +0 -1
  423. package/dist/packem_shared/Paragraph-BqJlH0R-.js +0 -1
  424. package/dist/packem_shared/Placeholder-GMpHRGC8.js +0 -1
  425. package/dist/packem_shared/ProgressBar-Bj3fmORR.js +0 -1
  426. package/dist/packem_shared/RadioGroup-Br8BeEwS.js +0 -1
  427. package/dist/packem_shared/Renderer-DJXooAsp.js +0 -1
  428. package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +0 -1
  429. package/dist/packem_shared/ScatterPlot-OhfYco5l.js +0 -1
  430. package/dist/packem_shared/ScrollBar-Da5Y3z7N.js +0 -1
  431. package/dist/packem_shared/ScrollBarBox-Dz6F-Eat.js +0 -1
  432. package/dist/packem_shared/ScrollList-DiVGyEjv.js +0 -1
  433. package/dist/packem_shared/ScrollView-BojONotI.js +0 -1
  434. package/dist/packem_shared/SearchInput-BoPTRbhV.js +0 -1
  435. package/dist/packem_shared/SelectInput-CAJ7SCBq.js +0 -1
  436. package/dist/packem_shared/SelectInputIndicator-N1n8ULHs.js +0 -1
  437. package/dist/packem_shared/SelectInputItem-BEkbmobs.js +0 -1
  438. package/dist/packem_shared/ShimmerText-CuGQ2NDC.js +0 -1
  439. package/dist/packem_shared/Slider-Cg_tJpKa.js +0 -1
  440. package/dist/packem_shared/Spacer-eT3HOrXk.js +0 -1
  441. package/dist/packem_shared/Sparkline-T6_FPVET.js +0 -1
  442. package/dist/packem_shared/Spinner-B0-A50pu.js +0 -1
  443. package/dist/packem_shared/Static-DLynr5pn.js +0 -1
  444. package/dist/packem_shared/Static-jzLPaHJF.js +0 -1
  445. package/dist/packem_shared/StaticRender-BgD61E7x.js +0 -1
  446. package/dist/packem_shared/StatusLine-Ch4jjef1.js +0 -1
  447. package/dist/packem_shared/StatusMessage-B1qfKeMM.js +0 -1
  448. package/dist/packem_shared/Stepper-CNPAqxiU.js +0 -1
  449. package/dist/packem_shared/Stopwatch-CAx2EWwq.js +0 -1
  450. package/dist/packem_shared/StreamingText-BYOKSB2T.js +0 -1
  451. package/dist/packem_shared/Switch-DzSpKYu7.js +0 -1
  452. package/dist/packem_shared/Tab-BcXzSUdj.js +0 -1
  453. package/dist/packem_shared/Table-DJp1TLrR.js +0 -1
  454. package/dist/packem_shared/Tabs-D68z0SOt.js +0 -1
  455. package/dist/packem_shared/Tag-BvLHnYRn.js +0 -1
  456. package/dist/packem_shared/Text-mTAve9R2.js +0 -1
  457. package/dist/packem_shared/TextInput-C_gYQlnF.js +0 -1
  458. package/dist/packem_shared/Textarea-C2ET_oMb.js +0 -2
  459. package/dist/packem_shared/Timer-CI3aQX65.js +0 -1
  460. package/dist/packem_shared/Toast-Drvc8XfG.js +0 -1
  461. package/dist/packem_shared/Tooltip-C5UnQlLd.js +0 -1
  462. package/dist/packem_shared/Transform-fYmcdqRT.js +0 -1
  463. package/dist/packem_shared/Transition-CJDBKYUB.js +0 -1
  464. package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +0 -1
  465. package/dist/packem_shared/TreeView-DjhacGJ5.js +0 -1
  466. package/dist/packem_shared/TuiApp-DrjI_i-R.js +0 -1
  467. package/dist/packem_shared/TuiContext-BoJvG3NN.js +0 -3
  468. package/dist/packem_shared/UnorderedList-BnfqexZs.js +0 -1
  469. package/dist/packem_shared/ansi-parser-B6uXaq65.js +0 -1
  470. package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +0 -1
  471. package/dist/packem_shared/boxes-DyY_LXCi.js +0 -1
  472. package/dist/packem_shared/braille-BBjIoaN0.js +0 -1
  473. package/dist/packem_shared/colorize-DbTZMrJO.js +0 -1
  474. package/dist/packem_shared/comparePoints-C85EsmNz.js +0 -1
  475. package/dist/packem_shared/controlled-scroll-view-CmrAEvJk.js +0 -1
  476. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +0 -2
  477. package/dist/packem_shared/createLinkedScrollGroup-BMTJ7rAj.js +0 -1
  478. package/dist/packem_shared/createMemoryStorage-QVZNXbWz.js +0 -2
  479. package/dist/packem_shared/createScreen-CrLrxA6t.js +0 -3
  480. package/dist/packem_shared/dom-4y__5fWB.js +0 -1
  481. package/dist/packem_shared/format-time-C7Q-hQZq.js +0 -1
  482. package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +0 -1
  483. package/dist/packem_shared/input-utils-fAxzSlNh.js +0 -1
  484. package/dist/packem_shared/isIntersecting-B3KbKTmu.js +0 -1
  485. package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +0 -1
  486. package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +0 -1
  487. package/dist/packem_shared/kittyFlags-C3rZLbcK.js +0 -1
  488. package/dist/packem_shared/line-chart-DrM8PwnI.js +0 -1
  489. package/dist/packem_shared/measure-element-DSp7YDus.js +0 -2
  490. package/dist/packem_shared/measure-text-DDjHT1jD.js +0 -3
  491. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +0 -1
  492. package/dist/packem_shared/processLayout-DXDfFb_d.js +0 -1
  493. package/dist/packem_shared/reconciler-BuOP-TZ6.js +0 -1
  494. package/dist/packem_shared/reconciler-DSYCrIZs.js +0 -1
  495. package/dist/packem_shared/render-DDqtMAFN.js +0 -1
  496. package/dist/packem_shared/render-_r0K9K11.js +0 -28
  497. package/dist/packem_shared/render.d-CNIzVQTh.d.ts +0 -1257
  498. package/dist/packem_shared/renderToString-DeqOWRP8.js +0 -4
  499. package/dist/packem_shared/renderToString-IYYPyASm.js +0 -2
  500. package/dist/packem_shared/renderTreeToBuffer-DPkoCgP2.js +0 -2
  501. package/dist/packem_shared/renderer-D2p6av2X.js +0 -17
  502. package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +0 -1
  503. package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.js +0 -1
  504. package/dist/packem_shared/stderr-context-BzEaUICS.js +0 -1
  505. package/dist/packem_shared/stdin-context-BTaaFagk.js +0 -1
  506. package/dist/packem_shared/text-width-CZ9vPvM0.js +0 -2
  507. package/dist/packem_shared/token-to-elements-BYxT6J_Q.js +0 -1
  508. package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +0 -1
  509. package/dist/packem_shared/useAnimation-B9we6ZzL.js +0 -1
  510. package/dist/packem_shared/useApp-B6fvM42d.js +0 -1
  511. package/dist/packem_shared/useBoxMetrics-D5pkIr6P.js +0 -1
  512. package/dist/packem_shared/useClipboard-CBxy0hT8.js +0 -1
  513. package/dist/packem_shared/useColorBlindness-BvWcu2Bb.js +0 -1
  514. package/dist/packem_shared/useConsoleCapture-BxiG8iLJ.js +0 -1
  515. package/dist/packem_shared/useCursor-CPu8T5Db.js +0 -1
  516. package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +0 -1
  517. package/dist/packem_shared/useFocus-DSmziO_x.js +0 -1
  518. package/dist/packem_shared/useFocusManager-Uapn3LQo.js +0 -1
  519. package/dist/packem_shared/useForm-CzV-Oext.js +0 -1
  520. package/dist/packem_shared/useHotkey-D0dGey14.js +0 -1
  521. package/dist/packem_shared/useInput-D1_jG26Z.js +0 -2
  522. package/dist/packem_shared/useInterval-AobjZT3u.js +0 -1
  523. package/dist/packem_shared/useIsScreenReaderEnabled-DjWHh-II.js +0 -1
  524. package/dist/packem_shared/useKeyBindings-zabkEJQs.js +0 -1
  525. package/dist/packem_shared/useKeyChord-CICQIxXj.js +0 -1
  526. package/dist/packem_shared/useMouseAction-2dRfU1vE.js +0 -1
  527. package/dist/packem_shared/useMouseContext-C746G7kY.js +0 -1
  528. package/dist/packem_shared/useMousePosition-BTWfV4JK.js +0 -1
  529. package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +0 -1
  530. package/dist/packem_shared/useOnMouseHover-D3DczIol.js +0 -1
  531. package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +0 -1
  532. package/dist/packem_shared/usePaste-CKKB9H-Z.js +0 -1
  533. package/dist/packem_shared/useScrollAcceleration-NrY1oVMs.js +0 -1
  534. package/dist/packem_shared/useScrollInput-Caghtn-Q.js +0 -1
  535. package/dist/packem_shared/useStderr-BDZb6InG.js +0 -1
  536. package/dist/packem_shared/useStdin-DKa4h35k.js +0 -1
  537. package/dist/packem_shared/useStdout-B-2lX4C5.js +0 -1
  538. package/dist/packem_shared/useStopwatch-DffK7iMh.js +0 -1
  539. package/dist/packem_shared/useTerminalPalette-Cv7tSduR.js +0 -1
  540. package/dist/packem_shared/useTextBuffer-DekkGLxI.js +0 -4
  541. package/dist/packem_shared/useTextSelection-CGT0GLDR.js +0 -1
  542. package/dist/packem_shared/useTimeout-7LEFYTnG.js +0 -1
  543. package/dist/packem_shared/useTimer-DyoqSyGi.js +0 -1
  544. package/dist/packem_shared/useTreeView-8UlTK6sW.js +0 -1
  545. package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +0 -1
  546. package/dist/packem_shared/useWindowSize-yDZsXF8z.js +0 -1
  547. package/dist/packem_shared/utils-THUhYKG2.js +0 -1
  548. package/dist/packem_shared/waitFor-Dj5zfL5s.js +0 -4
  549. package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +0 -3
@@ -0,0 +1,2 @@
1
+ import{createRequire as $}from"node:module";import{useRef as L,useEffectEvent as _,useEffect as g}from"react";import{IMECompositionBuffer as S,isIMEInput as q}from"../../packem_shared/IMECompositionBuffer-VhC9HRCv.js";import{kittyModifiers as p}from"../../packem_shared/kittyFlags-g8ALyoCU.js";import{j as w}from"../../packem_shared/reconciler-CFyBVf7l.js";import{useStdinContext as I}from"./use-stdin.js";const C=$(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,P=e=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[a,n]=m.versions.node.split(".").map(Number);if(a>22||a===22&&n>=3||a===20&&n>=16)return m.getBuiltinModule(e)}return C(e)},{Buffer:E}=P("node:buffer"),j=/^\u001B([a-z0-9])$/i,N=/^\u001B+([ON[]|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,y={"[1~":"home","[2$":"insert","[2^":"insert","[2~":"insert","[3$":"delete","[3^":"delete","[3~":"delete","[4~":"end","[5$":"pageup","[5^":"pageup","[5~":"pageup","[6$":"pagedown","[6^":"pagedown","[6~":"pagedown","[7$":"home","[7^":"home","[7~":"home","[8$":"end","[8^":"end","[8~":"end","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[[5~":"pageup","[[6~":"pagedown","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[A":"up","[a":"up","[B":"down","[b":"down","[C":"right","[c":"right","[D":"left","[d":"left","[E":"clear","[e":"clear","[F":"end","[H":"home","[P":"f1","[Q":"f2","[R":"f3","[S":"f4","[Z":"tab",OA:"up",Oa:"up",OB:"down",Ob:"down",OC:"right",Oc:"right",OD:"left",Od:"left",OE:"clear",Oe:"clear",OF:"end",OH:"home",OP:"f1",OQ:"f2",OR:"f3",OS:"f4"},M=[...Object.values(y),"backspace"],T=e=>["[2$","[3$","[5$","[6$","[7$","[8$","[a","[b","[c","[d","[e","[Z"].includes(e),K=e=>["[2^","[3^","[5^","[6^","[7^","[8^","Oa","Ob","Oc","Od","Oe"].includes(e),B=/^\u001B\[(\d+)(?:;(\d+)(?::(\d+))?(?:;([\d:]+))?)?u$/,R=/^\u001B\[(\d+);(\d+):(\d+)([A-Z~])$/i,Z={A:"up",B:"down",C:"right",D:"left",E:"clear",F:"end",H:"home",P:"f1",Q:"f2",R:"f3",S:"f4"},D={2:"insert",3:"delete",5:"pageup",6:"pagedown",7:"home",8:"end",11:"f1",12:"f2",13:"f3",14:"f4",15:"f5",17:"f6",18:"f7",19:"f8",20:"f9",21:"f10",23:"f11",24:"f12"},v={8:"backspace",9:"tab",27:"escape",127:"backspace",57358:"capslock",57359:"scrolllock",57360:"numlock",57361:"printscreen",57362:"pause",57363:"menu",57376:"f13",57377:"f14",57378:"f15",57379:"f16",57380:"f17",57381:"f18",57382:"f19",57383:"f20",57384:"f21",57385:"f22",57386:"f23",57387:"f24",57388:"f25",57389:"f26",57390:"f27",57391:"f28",57392:"f29",57393:"f30",57394:"f31",57395:"f32",57396:"f33",57397:"f34",57398:"f35",57399:"kp0",57400:"kp1",57401:"kp2",57402:"kp3",57403:"kp4",57404:"kp5",57405:"kp6",57406:"kp7",57407:"kp8",57408:"kp9",57409:"kpdecimal",57410:"kpdivide",57411:"kpmultiply",57412:"kpsubtract",57413:"kpadd",57414:"kpenter",57415:"kpequal",57416:"kpseparator",57417:"kpleft",57418:"kpright",57419:"kpup",57420:"kpdown",57421:"kppageup",57422:"kppagedown",57423:"kphome",57424:"kpend",57425:"kpinsert",57426:"kpdelete",57427:"kpbegin",57428:"mediaplay",57429:"mediapause",57430:"mediaplaypause",57431:"mediareverse",57432:"mediastop",57433:"mediafastforward",57434:"mediarewind",57435:"mediatracknext",57436:"mediatrackprevious",57437:"mediarecord",57438:"lowervolume",57439:"raisevolume",57440:"mutevolume",57441:"leftshift",57442:"leftcontrol",57443:"leftalt",57444:"leftsuper",57445:"lefthyper",57446:"leftmeta",57447:"rightshift",57448:"rightcontrol",57449:"rightalt",57450:"rightsuper",57451:"righthyper",57452:"rightmeta",57453:"isoLevel3Shift",57454:"isoLevel5Shift"},x=e=>e>=0&&e<=1114111&&!(e>=55296&&e<=57343),b=e=>x(e)?String.fromCodePoint(e):"?";function A(e){return e===3?"release":e===2?"repeat":"press"}function O(e){return{capsLock:!!(e&p.capsLock),ctrl:!!(e&p.ctrl),hyper:!!(e&p.hyper),meta:!!(e&p.meta),numLock:!!(e&p.numLock),option:!!(e&p.alt),shift:!!(e&p.shift),super:!!(e&p.super)}}const F=e=>{const a=B.exec(e);if(!a)return null;const n=Number.parseInt(a[1],10),c=a[2]?Math.max(0,Number.parseInt(a[2],10)-1):0,t=a[3]?Number.parseInt(a[3],10):1,l=a[4];if(!x(n))return null;let s;l&&(s=l.split(":").map(d=>b(Number.parseInt(d,10))).join(""));let o,i;return n===32?(o="space",i=!0):n===13?(o="return",i=!0):v[n]?(o=v[n],i=!1):n>=1&&n<=26?(o=String.fromCodePoint(n+96),i=!1):(o=b(n).toLowerCase(),i=!0),i&&!s&&(s=b(n)),{name:o,...O(c),eventType:A(t),isKittyProtocol:!0,isPrintable:i,raw:e,sequence:e,text:s}},U=e=>{const a=R.exec(e);if(!a)return null;const n=Number.parseInt(a[1],10),c=Math.max(0,Number.parseInt(a[2],10)-1),t=Number.parseInt(a[3],10),l=a[4],s=l==="~"?D[n]:Z[l];return s?{name:s,...O(c),eventType:A(t),isKittyProtocol:!0,isPrintable:!1,raw:e,sequence:e}:null},z=(e="")=>{let a;E.isBuffer(e)?e[0]>127&&e[1]===void 0?(e[0]-=128,e=`\x1B${String(e)}`):e=String(e):e!==void 0&&typeof e!="string"?e=String(e):e||(e="");const n=F(e);if(n)return n;const c=U(e);if(c)return c;if(B.test(e))return{ctrl:!1,isKittyProtocol:!0,isPrintable:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};const t={ctrl:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};switch(t.sequence=t.sequence||e||t.name,e){case"\r":case"\x1B\r":{t.raw=void 0,t.name="return",t.option=e.length===2;break}case`
2
+ `:{t.name="enter";break}case" ":{t.name="tab";break}case" ":case"\x1B ":{t.name="space",t.meta=e.length===2;break}case"\b":case"\x1B\b":{t.name="backspace",t.meta=e.charAt(0)==="\x1B";break}case"\x1B":case"\x1B\x1B":{t.name="escape",t.meta=e.length===2;break}case"\x1B":case"":{t.name="backspace",t.meta=e.charAt(0)==="\x1B";break}default:if(e.length===1&&e<="")t.name=String.fromCharCode(e.charCodeAt(0)+97-1),t.ctrl=!0;else if(e.length===1&&e>="0"&&e<="9")t.name="number";else if(e.length===1&&e>="a"&&e<="z")t.name=e;else if(e.length===1&&e>="A"&&e<="Z")t.name=e.toLowerCase(),t.shift=!0;else if(a=j.exec(e))t.meta=!0,t.shift=/^[A-Z]$/.test(a[1]);else if(a=N.exec(e)){const l=[...e];l[0]==="\x1B"&&l[1]==="\x1B"&&(t.option=!0);const s=[a[1],a[2],a[4],a[6]].filter(Boolean).join(""),o=(a[3]||a[5]||1)-1;t.ctrl=!!(o&4),t.meta=!!(o&10),t.shift=!!(o&1),t.code=s,t.name=y[s]??"",t.shift=T(s)||t.shift,t.ctrl=K(s)||t.ctrl}}return t},X=(e,a={})=>{const{internal_eventEmitter:n,internal_exitOnCtrlC:c,setRawMode:t,stdin:l}=I(),s=a.imeEnabled??!0,o=a.imeTimeout??50,i=L(void 0),d=_(e);g(()=>{if(s)return i.current=new S({onFlush:h=>{const u={backspace:!1,capsLock:!1,ctrl:!1,delete:!1,downArrow:!1,end:!1,escape:!1,home:!1,hyper:!1,leftArrow:!1,meta:!1,numLock:!1,pageDown:!1,pageUp:!1,return:!1,rightArrow:!1,shift:!1,super:!1,tab:!1,upArrow:!1};w.discreteUpdates(()=>{d(h,u)})},timeout:o}),()=>{i.current?.destroy(),i.current=void 0}},[s,o]),g(()=>{if(a.isActive!==!1)return t(!0),()=>{t(!1)}},[a.isActive,t]),g(()=>{if(a.isActive===!1)return;const h=u=>{if(s&&q(u)){i.current?.add(u);return}i.current?.flush();const r=z(u),k={backspace:r.name==="backspace",capsLock:r.capsLock??!1,ctrl:r.ctrl,delete:r.name==="delete",downArrow:r.name==="down",end:r.name==="end",escape:r.name==="escape",eventType:r.eventType,home:r.name==="home",hyper:r.hyper??!1,leftArrow:r.name==="left",meta:r.meta||r.option,numLock:r.numLock??!1,pageDown:r.name==="pagedown",pageUp:r.name==="pageup",return:r.name==="return",rightArrow:r.name==="right",shift:r.shift,super:r.super??!1,tab:r.name==="tab",upArrow:r.name==="up"};let f;r.isKittyProtocol?r.isPrintable?f=r.text??r.name:r.ctrl&&r.name.length===1?f=r.name:f="":r.ctrl?f=r.name:f=r.sequence,!r.isKittyProtocol&&M.includes(r.name)&&(f=""),f.startsWith("\x1B")&&(f=f.slice(1)),f.length===1&&typeof f[0]=="string"&&/[A-Z]/.test(f[0])&&(k.shift=!0),!(f==="c"&&k.ctrl&&c)&&(!r.name&&f===""||w.discreteUpdates(()=>{d(f,k)}))};return n.on("input",h),()=>{n.removeListener("input",h)}},[a.isActive,l,c,s])};export{X as default,X as useInput};
@@ -0,0 +1,25 @@
1
+ type UseIntervalOptions = {
2
+ /**
3
+ * When false, the timer is paused. Flipping back to true restarts it.
4
+ * @default true
5
+ */
6
+ readonly isActive?: boolean;
7
+ };
8
+ type UseIntervalResult = {
9
+ /**
10
+ * Cancel the currently-running timer. The hook effect will reschedule on
11
+ * the next re-render if `isActive` remains true.
12
+ */
13
+ readonly clear: () => void;
14
+ };
15
+ /**
16
+ * A React hook that invokes `callback` every `interval` ms. The callback
17
+ * reference is captured in a ref so it always sees the latest closure; only
18
+ * `interval` and `isActive` cause the timer to be rebuilt.
19
+ * @param callback Invoked on every tick. Latest closure is captured in a ref.
20
+ * @param interval Tick period in milliseconds. Invalid values pause the timer.
21
+ * @param options Optional `isActive` flag to pause without unmounting.
22
+ * @returns A stable object with a `clear()` method to cancel on demand.
23
+ */
24
+ declare const useInterval: (callback: () => void, interval: number, options?: UseIntervalOptions) => UseIntervalResult;
25
+ export { UseIntervalOptions, UseIntervalResult, useInterval as default, useInterval };
@@ -0,0 +1 @@
1
+ import{useRef as s,useLayoutEffect as i,useEffect as o,useCallback as l}from"react";const f=(t,r,a)=>{const{isActive:u=!0}=a??{},n=s(t),e=s(void 0);return i(()=>{n.current=t},[t]),o(()=>{if(!u||r<=0||!Number.isFinite(r))return;const c=setInterval(()=>{n.current()},r);return e.current=c,()=>{clearInterval(c),e.current=void 0}},[r,u]),{clear:l(()=>{e.current!==void 0&&(clearInterval(e.current),e.current=void 0)},[])}};export{f as default,f as useInterval};
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A React hook that returns whether a screen reader is enabled.
3
+ * This is useful when you want to render different output for screen readers.
4
+ */
5
+ declare const useIsScreenReaderEnabled: () => boolean;
6
+ export { useIsScreenReaderEnabled as default, useIsScreenReaderEnabled };
@@ -0,0 +1 @@
1
+ import{useContext as t}from"react";import{a as r}from"../../packem_shared/accessibility-context-DDyHTwmA.js";const n=()=>{const{isScreenReaderEnabled:e}=t(r);return e};export{n as default,n as useIsScreenReaderEnabled};
@@ -0,0 +1,59 @@
1
+ /**
2
+ * A single key binding definition.
3
+ */
4
+ type KeyBinding = {
5
+ /** Human-readable description shown in Help. */
6
+ readonly description: string;
7
+ /**
8
+ * Whether this binding is active.
9
+ * @default true
10
+ */
11
+ readonly enabled?: boolean;
12
+ /** Optional group name for organizing in the Help component's full mode. */
13
+ readonly group?: string;
14
+ /**
15
+ * Key(s) that trigger this binding.
16
+ *
17
+ * A string can be:
18
+ * - A single character: `"q"`, `"a"`, `" "` (space)
19
+ * - A `Key` boolean field name: `"return"`, `"escape"`, `"upArrow"`, `"leftArrow"`, etc.
20
+ * - A modifier combo: `"ctrl+c"`, `"meta+s"` (modifier + character)
21
+ *
22
+ * Provide an array to match multiple keys for the same action.
23
+ */
24
+ readonly key: string | ReadonlyArray<string>;
25
+ };
26
+ /**
27
+ * A binding paired with its handler function.
28
+ */
29
+ type KeyBindingHandler = {
30
+ readonly binding: KeyBinding;
31
+ readonly handler: () => void;
32
+ };
33
+ type UseKeyBindingsOptions = {
34
+ /**
35
+ * Whether keyboard input is captured.
36
+ * @default true
37
+ */
38
+ readonly isActive?: boolean;
39
+ };
40
+ type UseKeyBindingsResult = {
41
+ /** The enabled bindings, suitable for passing to the Help component. */
42
+ readonly bindings: ReadonlyArray<KeyBinding>;
43
+ };
44
+ /**
45
+ * Declarative keybinding hook. Registers multiple key bindings with handlers
46
+ * and returns the enabled bindings for display in a Help component.
47
+ *
48
+ * ```tsx
49
+ * const { bindings } = useKeyBindings([
50
+ * { binding: { key: "q", description: "Quit" }, handler: () => exit() },
51
+ * { binding: { key: ["upArrow", "k"], description: "Move up" }, handler: () => moveUp() },
52
+ * { binding: { key: "ctrl+s", description: "Save" }, handler: () => save() },
53
+ * ]);
54
+ *
55
+ * &lt;Help bindings={bindings} />
56
+ * ```
57
+ */
58
+ declare function useKeyBindings(handlers: ReadonlyArray<KeyBindingHandler>, options?: UseKeyBindingsOptions): UseKeyBindingsResult;
59
+ export { KeyBinding, KeyBindingHandler, useKeyBindings as default, useKeyBindings };
@@ -0,0 +1 @@
1
+ import{useRef as l,useCallback as d,useMemo as p}from"react";import b from"./use-input.js";const a=new Set(["backspace","delete","downArrow","end","escape","home","leftArrow","pageDown","pageUp","return","rightArrow","tab","upArrow"]),g=new Set(["ctrl","hyper","meta","shift","super"]);function m(e,o,t){const r=e.indexOf("+");if(r!==-1){const n=e.slice(0,r),s=e.slice(r+1);return!g.has(n)||!t[n]?!1:a.has(s)?t[s]===!0:o===s}return a.has(e)?t[e]===!0:o===e}function y(e,o){const{isActive:t=!0}=o??{},r=l(e);return r.current=e,b(d((n,s)=>{for(const{binding:i,handler:c}of r.current){if(i.enabled===!1)continue;const f=typeof i.key=="string"?[i.key]:i.key;for(const u of f)if(m(u,n,s)){c();return}}},[]),{isActive:t}),{bindings:p(()=>e.filter(n=>n.binding.enabled!==!1).map(n=>n.binding),[e])}}export{y as default,y as useKeyBindings};
@@ -0,0 +1,25 @@
1
+ type KeyChordStep = string;
2
+ type UseKeyChordOptions = {
3
+ /**
4
+ * Disable the chord while keeping the component rendered.
5
+ * @default true
6
+ */
7
+ readonly isActive?: boolean;
8
+ /**
9
+ * Milliseconds of silence after which the partial chord resets.
10
+ * @default 1000
11
+ */
12
+ readonly resetAfter?: number;
13
+ };
14
+ /**
15
+ * Invoke `callback` when the user types the given sequence of keys in order
16
+ * (like Vim's `g d` or Emacs's `C-x C-s`). The chord resets automatically
17
+ * after `resetAfter` ms of silence.
18
+ * @param sequence Ordered list of chord steps. Each step is compared against
19
+ * a canonical key token (e.g. `"g"`, `"space"`, `"ctrl+s"`).
20
+ * @param callback Invoked exactly once per successful chord match. Latest
21
+ * reference is captured in a ref.
22
+ * @param options Optional `isActive` flag and `resetAfter` silence timeout.
23
+ */
24
+ declare const useKeyChord: (sequence: ReadonlyArray<KeyChordStep>, callback: () => void, options?: UseKeyChordOptions) => void;
25
+ export { KeyChordStep, UseKeyChordOptions, useKeyChord as default, useKeyChord };
@@ -0,0 +1 @@
1
+ import{useRef as a,useCallback as w}from"react";import g from"./use-input.js";const m=(e,r)=>{if(r.escape)return"escape";if(r.return)return"return";if(r.tab)return"tab";if(r.backspace)return"backspace";if(r.delete)return"delete";if(r.home)return"home";if(r.end)return"end";if(r.pageUp)return"pageup";if(r.pageDown)return"pagedown";if(r.upArrow)return"up";if(r.downArrow)return"down";if(r.leftArrow)return"left";if(r.rightArrow)return"right";if(e===" ")return"space";if(!(!e||e.length===0))return e},A=(e,r)=>{const u=m(e,r);if(u===void 0)return;const n=[];return r.ctrl&&n.push("ctrl"),r.meta&&n.push("meta"),r.shift&&n.push("shift"),n.push(u),n.join("+")},i=e=>e.trim().toLowerCase(),k=(e,r,u)=>{const{isActive:n=!0,resetAfter:c=1e3}=u??{},t=a(0),o=a(0),p=a(r);p.current=r,g(w((d,l)=>{const f=Date.now();c>0&&t.current>0&&f-o.current>c&&(t.current=0);const s=A(d,l);if(s===void 0||e.length===0)return;const h=e[t.current];if(h===void 0){t.current=0;return}if(i(s)===i(h)){t.current+=1,o.current=f,t.current>=e.length&&(t.current=0,p.current());return}t.current=0,i(s)===i(e[0]??"")&&(t.current=1,o.current=f)},[e,c]),{isActive:n})};export{k as default,k as useKeyChord};
@@ -0,0 +1,49 @@
1
+ import { RefObject } from 'react';
2
+ import { b as ScrollViewRef } from "../../packem_shared/scroll-view.d-DtpsgHLg.js";
3
+ import "../../components/box.js";
4
+ import 'type-fest';
5
+ import "../../packem_shared/dom.d-B4kXbaVY.js";
6
+ import 'yoga-layout';
7
+ import "../../packem_shared/cursor-helpers.d-BONB9tky.js";
8
+ import '@visulima/colorize';
9
+ import 'cli-boxes';
10
+ import "../../packem_shared/styles.d-cMo36xQz.js";
11
+ type UseLinkedScrollReturn = {
12
+ /**
13
+ * Callback to pass to ScrollView's `onScroll` prop.
14
+ * Broadcasts the scroll position to all linked instances.
15
+ */
16
+ onScroll: (scrollOffset: number) => void;
17
+ /**
18
+ * Ref to attach to the ScrollView component.
19
+ * Used internally to call `scrollTo()` when other instances scroll.
20
+ */
21
+ ref: RefObject<ScrollViewRef | null>;
22
+ };
23
+ type LinkedScrollGroup = {
24
+ /**
25
+ * Hook that returns a ref and onScroll callback for linking a ScrollView
26
+ * to this group. Call once per ScrollView instance.
27
+ */
28
+ useLinkedScroll: () => UseLinkedScrollReturn;
29
+ };
30
+ /**
31
+ * Creates a linked scroll group that synchronizes scroll position
32
+ * across multiple ScrollView instances.
33
+ * @example
34
+ * ```tsx
35
+ * const group = createLinkedScrollGroup();
36
+ *
37
+ * const PanelA = () => {
38
+ * const { ref, onScroll } = group.useLinkedScroll();
39
+ * return <ScrollView ref={ref} onScroll={onScroll}>...</ScrollView>;
40
+ * };
41
+ *
42
+ * const PanelB = () => {
43
+ * const { ref, onScroll } = group.useLinkedScroll();
44
+ * return <ScrollView ref={ref} onScroll={onScroll}>...</ScrollView>;
45
+ * };
46
+ * ```
47
+ */
48
+ declare const createLinkedScrollGroup: () => LinkedScrollGroup;
49
+ export { LinkedScrollGroup, UseLinkedScrollReturn, createLinkedScrollGroup, createLinkedScrollGroup as default };
@@ -0,0 +1 @@
1
+ import{useRef as s,useState as u,useEffect as a,useCallback as d}from"react";const S=()=>{const r=new Set;let t=!1;return{useLinkedScroll:()=>{const l=s(null),[,c]=u(0),f={ref:l,setOffset:()=>{c(e=>e+1)}},n=s(f);return n.current=f,a(()=>{const{current:e}=n;return r.add(e),()=>{r.delete(e)}},[]),{onScroll:d(e=>{if(!t){t=!0;try{for(const o of r)o.ref!==l&&o.ref.current?.scrollTo(e)}finally{t=!1}}},[]),ref:l}}}};export{S as createLinkedScrollGroup,S as default};
@@ -0,0 +1,45 @@
1
+ type Options = {
2
+ /**
3
+ * Enable or disable the paste handler. Useful when multiple components use `usePaste` and only one should be active at a time.
4
+ * @default true
5
+ */
6
+ isActive?: boolean;
7
+ };
8
+ /**
9
+ * A React hook that calls `handler` whenever the user pastes text in the
10
+ * terminal. Bracketed paste mode (`\x1b[?2004h`) is automatically enabled while
11
+ * the hook is active, so pasted text arrives as a single string rather than being
12
+ * misinterpreted as individual key presses.
13
+ *
14
+ * `usePaste` is the dedicated API for paste blobs. `usePaste` and `useInput` can
15
+ * be used together in the same component; they operate on separate event
16
+ * channels, so paste content is never forwarded to `useInput` handlers while a
17
+ * `usePaste` handler is active.
18
+ *
19
+ * If no `usePaste` handler is active, Ink still forwards bracketed paste text to
20
+ * `useInput` for backward compatibility. That fallback is deprecated and will be
21
+ * removed in the next major version.
22
+ *
23
+ * ```
24
+ * import {useInput} from '@visulima/tui/hooks/use-input';
25
+ * import {usePaste} from '@visulima/tui/hooks/use-paste';
26
+ *
27
+ * const MyInput = () => {
28
+ * useInput((input, key) => {
29
+ * // Only receives typed characters and key events, not pasted text.
30
+ * if (key.return) {
31
+ * // Submit
32
+ * }
33
+ * });
34
+ *
35
+ * usePaste((text) => {
36
+ * // Receives the full pasted string, including newlines.
37
+ * console.log('Pasted:', text);
38
+ * });
39
+ *
40
+ * return …
41
+ * };
42
+ * ```
43
+ */
44
+ declare const usePaste: (handler: (text: string) => void, options?: Options) => void;
45
+ export { usePaste as default, usePaste };
@@ -0,0 +1 @@
1
+ import{useEffectEvent as c,useEffect as a}from"react";import{j as u}from"../../packem_shared/reconciler-CFyBVf7l.js";import{useStdinContext as m}from"./use-stdin.js";const l=(o,e={})=>{const{internal_eventEmitter:t,setBracketedPasteMode:s,setRawMode:r}=m(),f=c(o);a(()=>{if(e.isActive!==!1)return r(!0),s(!0),()=>{r(!1),s(!1)}},[e.isActive,r,s]),a(()=>{if(e.isActive===!1)return;const i=n=>{u.discreteUpdates(()=>{f(n)})};return t.on("paste",i),()=>{t.removeListener("paste",i)}},[e.isActive,t])};export{l as default,l as usePaste};
@@ -0,0 +1,65 @@
1
+ type PersistentStorage = {
2
+ /**
3
+ * Return the persisted JSON-encoded string for `key`, or `undefined` if
4
+ * nothing has been stored yet.
5
+ */
6
+ readonly read: (key: string) => string | undefined;
7
+ /**
8
+ * Persist `value` (a JSON-encoded string) for `key`. Errors are swallowed
9
+ * by the hook so the UI keeps working in read-only environments.
10
+ */
11
+ readonly write: (key: string, value: string) => void;
12
+ };
13
+ type UsePersistentStateOptions = {
14
+ /**
15
+ * Namespace used by the default file storage. Separates keys across
16
+ * independent applications sharing the user's home directory.
17
+ * @default "tui"
18
+ */
19
+ readonly namespace?: string;
20
+ /**
21
+ * Custom storage backend. When omitted, the default is a file on disk at
22
+ * `~/.cache/visulima-tui/&lt;namespace>.json`.
23
+ */
24
+ readonly storage?: PersistentStorage;
25
+ };
26
+ /**
27
+ * In-memory storage shared across all hook instances that use it. Useful in
28
+ * tests and in environments without file access.
29
+ */
30
+ declare const createMemoryStorage: () => PersistentStorage;
31
+ /**
32
+ * Default file-backed storage. Reads/writes a single JSON object per
33
+ * namespace, keyed by `key`. The directory is created on first write and
34
+ * updates use a temp-file + rename to avoid partial writes if the process
35
+ * crashes mid-write. Errors are forwarded to `process.stderr.write` so they
36
+ * are visible without crashing the UI.
37
+ *
38
+ * The namespace object is parsed from disk once (lazily) and kept in memory;
39
+ * subsequent reads/writes operate on the cached object instead of re-reading
40
+ * and re-parsing the whole file on every call.
41
+ */
42
+ declare const createFileStorage: (namespace: string) => PersistentStorage;
43
+ /**
44
+ * `useState` that persists its value through the configured `storage`
45
+ * backend (file on disk by default). Behaves identically to `useState` at
46
+ * the call-site.
47
+ *
48
+ * Persistence happens in a commit-phase effect, **not** inside the state
49
+ * updater — updaters must be pure (React may double-invoke them under
50
+ * StrictMode or discard them under concurrent rendering), so writing from
51
+ * inside one risked double or phantom disk writes. Writing after commit means
52
+ * only values that actually render are persisted.
53
+ *
54
+ * **Lifecycle note:** the storage backend (resolved from `options.storage`
55
+ * or a fresh `createFileStorage(namespace)`) is captured once on mount and
56
+ * never replaced. Mutating `options.storage` on subsequent renders has no
57
+ * effect — remount the hook (e.g. via a `key` prop) if you need to swap
58
+ * backends at runtime.
59
+ * @param key Unique identifier within the backend namespace.
60
+ * @param initialValue Value used when the backend has no entry for `key`.
61
+ * @param options Optional storage backend + namespace overrides.
62
+ * @returns A `[value, setValue]` tuple. Writes flush in a post-commit effect.
63
+ */
64
+ declare const usePersistentState: <T>(key: string, initialValue: T, options?: UsePersistentStateOptions) => readonly [T, (value: T | ((previous: T) => T)) => void];
65
+ export { PersistentStorage, UsePersistentStateOptions, createFileStorage, createMemoryStorage, usePersistentState as default, usePersistentState };
@@ -0,0 +1,2 @@
1
+ import{createRequire as g}from"node:module";import{useRef as m,useState as N,useEffect as b,useCallback as E}from"react";const S=g(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=e=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[r,s]=a.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return a.getBuiltinModule(e)}return S(e)},{mkdirSync:v,writeFileSync:h,renameSync:_,readFileSync:w}=l("node:fs"),{homedir:j}=l("node:os"),f=l("node:path"),p=a,q=()=>{const e=new Map;return{read:r=>e.get(r),write:(r,s)=>{e.set(r,s)}}},O=/[/\\]/,k=e=>{if(e===""||e==="."||e===".."||O.test(e)||e.includes("\0"))throw new Error(`[visulima/tui] usePersistentState: invalid namespace ${JSON.stringify(e)} — must not be empty or contain path separators.`)},J=e=>{k(e);const r=f.join(j(),".cache","visulima-tui",`${e}.json`);let s;const i=(t,n)=>{const o=n instanceof Error?n.message:String(n);p.stderr.write(`[visulima/tui] persistent-state ${t} failed: ${o}
2
+ `)},c=()=>{if(s!==void 0)return s;try{const t=w(r,"utf8"),n=JSON.parse(t);s=n&&typeof n=="object"?n:{}}catch(t){const n=t?.code;n!=="ENOENT"&&n!=="EACCES"&&i("read",t),s={}}return s};return{read:t=>c()[t],write:(t,n)=>{const o=f.dirname(r),u=`${r}.tmp.${p.pid}`,d=c();d[t]=n;try{v(o,{recursive:!0}),h(u,JSON.stringify(d,null,2),{encoding:"utf8",flag:"w"}),_(u,r)}catch(y){i("write",y)}}}},M=(e,r,s)=>{const i=e.read(r);if(i===void 0)return s;try{return JSON.parse(i)}catch{return s}},C=(e,r,s)=>{const i=m(void 0);i.current??=s?.storage??J(s?.namespace??"tui");const c=i.current,[t,n]=N(()=>M(c,e,r)),o=m(void 0);o.current??={key:e,value:t},b(()=>{if(!(o.current?.key===e&&Object.is(o.current.value,t)))try{c.write(e,JSON.stringify(t)),o.current={key:e,value:t}}catch{}},[e,t,c]);const u=E(d=>{n(d)},[]);return[t,u]};export{J as createFileStorage,q as createMemoryStorage,C as default,C as usePersistentState};
@@ -0,0 +1,47 @@
1
+ type UseScrollAccelerationOptions = {
2
+ /**
3
+ * Velocity multiplier per rapid scroll event.
4
+ * @default 1.5
5
+ */
6
+ readonly acceleration?: number;
7
+ /**
8
+ * Velocity decay factor per tick (0-1). Lower = faster stop.
9
+ * @default 0.92
10
+ */
11
+ readonly decayRate?: number;
12
+ /**
13
+ * Enable or disable acceleration.
14
+ * @default true
15
+ */
16
+ readonly isActive?: boolean;
17
+ /**
18
+ * Maximum velocity in lines per tick.
19
+ * @default 20
20
+ */
21
+ readonly maxVelocity?: number;
22
+ /**
23
+ * Callback invoked with the scroll delta (signed integer lines) on each tick.
24
+ */
25
+ readonly onScroll?: (delta: number) => void;
26
+ };
27
+ type UseScrollAccelerationResult = {
28
+ /** Handle a discrete scroll event (from mouse wheel or keyboard). */
29
+ readonly handleScroll: (direction: "down" | "up") => void;
30
+ /** Whether momentum is still active (coasting after last input). */
31
+ readonly isCoasting: boolean;
32
+ /** Current velocity (positive = down, negative = up). */
33
+ readonly velocity: number;
34
+ };
35
+ /**
36
+ * Hook providing scroll acceleration with momentum physics.
37
+ *
38
+ * ```tsx
39
+ * const { handleScroll } = useScrollAcceleration({
40
+ * onScroll: (delta) => scrollViewRef.current?.scrollBy(delta),
41
+ * });
42
+ *
43
+ * useMouseAction(); // call handleScroll("up") or handleScroll("down") on scroll events
44
+ * ```
45
+ */
46
+ declare const useScrollAcceleration: (options?: UseScrollAccelerationOptions) => UseScrollAccelerationResult;
47
+ export { UseScrollAccelerationOptions, UseScrollAccelerationResult, useScrollAcceleration as default, useScrollAcceleration };
@@ -0,0 +1 @@
1
+ import{useState as y,useRef as e,useEffect as p,useCallback as C,useMemo as I}from"react";const R=100,x=16,A=.5,D=(g={})=>{const{acceleration:d=1.5,decayRate:h=.92,isActive:t=!0,maxVelocity:m=20,onScroll:v}=g,[M,l]=y(0),[n,S]=y(!1),r=e(0),b=e(0),i=e(!1),f=e(void 0),c=e(v);c.current=v,p(()=>{if(!t||!n)return;const u=()=>{if(i.current){i.current=!1;return}const a=r.current;if(Math.abs(a)<A){r.current=0,l(0),S(!1);return}r.current*=h;const s=Math.round(r.current);s!==0&&c.current?.(s),l(r.current)};return f.current=setInterval(u,x),()=>{f.current&&clearInterval(f.current)}},[t,n,h]);const w=C(u=>{if(!t){c.current?.(u==="down"?1:-1);return}const a=Date.now(),s=a-b.current,o=u==="down"?1:-1;b.current=a,s<R&&Math.sign(r.current)===o?r.current=Math.min(Math.abs(r.current*d),m)*o:r.current=o,l(r.current),S(!0),i.current=!0,c.current?.(o)},[t,d,m]);return I(()=>({handleScroll:w,isCoasting:n,velocity:M}),[w,n,M])};export{D as default,D as useScrollAcceleration};
@@ -0,0 +1,34 @@
1
+ type UseScrollInputOptions = {
2
+ /**
3
+ * Returns the current viewport height in lines. Called on each key event
4
+ * so the value is always fresh (avoids stale-closure issues with refs).
5
+ */
6
+ getViewportHeight: () => number;
7
+ /**
8
+ * Enable or disable scroll input handling.
9
+ * @default true
10
+ */
11
+ isActive?: boolean;
12
+ /**
13
+ * Scroll by a relative delta (in lines).
14
+ */
15
+ scrollBy: (delta: number) => void;
16
+ /**
17
+ * Jump to the bottom of the content.
18
+ */
19
+ scrollToBottom: () => void;
20
+ /**
21
+ * Jump to the top of the content.
22
+ */
23
+ scrollToTop: () => void;
24
+ /**
25
+ * Enable vim-style keybindings (j/k/g/G/u/d).
26
+ * @default false
27
+ */
28
+ vimBindings?: boolean;
29
+ };
30
+ type UseScrollInputReturn = {
31
+ isFocused: boolean;
32
+ };
33
+ declare const useScrollInput: (options: UseScrollInputOptions) => UseScrollInputReturn;
34
+ export { UseScrollInputOptions, UseScrollInputReturn, useScrollInput as default, useScrollInput };
@@ -0,0 +1 @@
1
+ import c from"./use-focus.js";import a from"./use-input.js";const h=u=>{const{getViewportHeight:e,isActive:i=!0,scrollBy:o,scrollToBottom:f,scrollToTop:n,vimBindings:s=!1}=u,{isFocused:l}=c({isActive:i});return a((t,r)=>{if(r.upArrow){o(-1);return}if(r.downArrow){o(1);return}if(r.pageUp){o(-e());return}if(r.pageDown){o(e());return}if(r.home){n();return}if(r.end){f();return}if(r.ctrl&&t==="u"){o(-Math.floor(e()/2));return}if(r.ctrl&&t==="d"){o(Math.floor(e()/2));return}if(s){if(t==="k"){o(-1);return}if(t==="j"){o(1);return}if(t==="G"&&r.shift){f();return}if(t==="g"&&!r.shift){n();return}if(t==="u"&&!r.ctrl){o(-Math.floor(e()/2));return}t==="d"&&!r.ctrl&&o(Math.floor(e()/2))}},{isActive:i}),{isFocused:l}};export{h as default,h as useScrollInput};
@@ -0,0 +1,16 @@
1
+ import 'react';
2
+ type Props = {
3
+ /**
4
+ * Stderr stream passed to `render()` in `options.stderr` or `process.stderr` by default.
5
+ */
6
+ readonly stderr: NodeJS.WriteStream;
7
+ /**
8
+ * Write any string to stderr while preserving Ink's output. It's useful when you want to display external information outside of Ink's rendering and ensure there's no conflict between the two. It's similar to `&lt;Static>`, except it can't accept components; it only works with strings.
9
+ */
10
+ readonly write: (data: string) => void;
11
+ };
12
+ /**
13
+ * A React hook that returns the stderr stream.
14
+ */
15
+ declare const useStderr: () => Props;
16
+ export { type Props as StderrProps, useStderr as default, useStderr };
@@ -0,0 +1 @@
1
+ import{useContext as t}from"react";import{t as o}from"../../packem_shared/stderr-context-Bvnik0hL.js";const s=()=>t(o);export{s as default,s as useStderr};
@@ -0,0 +1,30 @@
1
+ import { EventEmitter } from 'node:events';
2
+ import 'react';
3
+ type PublicProps = {
4
+ /**
5
+ * A boolean flag determining if the current `stdin` supports `setRawMode`. A component using `setRawMode` might want to use `isRawModeSupported` to nicely fall back in environments where raw mode is not supported.
6
+ */
7
+ readonly isRawModeSupported: boolean;
8
+ /**
9
+ * Ink exposes this function via own `&lt;StdinContext>` to be able to handle Ctrl+C, that's why you should use Ink's `setRawMode` instead of `process.stdin.setRawMode`. If the `stdin` stream passed to Ink does not support setRawMode, this function does nothing.
10
+ */
11
+ readonly setRawMode: (value: boolean) => void;
12
+ /**
13
+ * The stdin stream passed to `render()` in `options.stdin`, or `process.stdin` by default. Useful if your app needs to handle user input.
14
+ */
15
+ readonly stdin: NodeJS.ReadStream;
16
+ };
17
+ type Props = PublicProps & {
18
+ readonly internal_eventEmitter: EventEmitter;
19
+ readonly internal_exitOnCtrlC: boolean;
20
+ /**
21
+ * Enable or disable bracketed paste mode on the terminal. When enabled, pasted text is wrapped in escape sequences that allow it to be distinguished from typed input.
22
+ */
23
+ readonly setBracketedPasteMode: (value: boolean) => void;
24
+ };
25
+ /**
26
+ * A React hook that returns the stdin stream and stdin-related utilities.
27
+ */
28
+ declare const useStdin: () => PublicProps;
29
+ declare const useStdinContext: () => Props;
30
+ export { type PublicProps as StdinProps, useStdin as default, useStdin, useStdinContext };
@@ -0,0 +1 @@
1
+ import{useContext as t}from"react";import{e}from"../../packem_shared/stdin-context-88AhuztD.js";const n=()=>t(e),r=()=>t(e);export{n as default,n as useStdin,r as useStdinContext};
@@ -0,0 +1,16 @@
1
+ import 'react';
2
+ type Props = {
3
+ /**
4
+ * Stdout stream passed to `render()` in `options.stdout` or `process.stdout` by default.
5
+ */
6
+ readonly stdout: NodeJS.WriteStream;
7
+ /**
8
+ * Write any string to stdout while preserving Ink's output. It's useful when you want to display external information outside of Ink's rendering and ensure there's no conflict between the two. It's similar to `&lt;Static>`, except it can't accept components; it only works with strings.
9
+ */
10
+ readonly write: (data: string) => void;
11
+ };
12
+ /**
13
+ * A React hook that returns the stdout stream where Ink renders your app.
14
+ */
15
+ declare const useStdout: () => Props;
16
+ export { type Props as StdoutProps, useStdout as default, useStdout };
@@ -0,0 +1 @@
1
+ import{useContext as t}from"react";import{t as o}from"../../packem_shared/stdout-context-BnblEPez.js";const r=()=>t(o);export{r as default,r as useStdout};
@@ -0,0 +1,39 @@
1
+ type UseStopwatchOptions = {
2
+ /**
3
+ * Whether to start counting immediately.
4
+ * @default false
5
+ */
6
+ readonly autoStart?: boolean;
7
+ /**
8
+ * Tick interval in milliseconds.
9
+ * @default 1000
10
+ */
11
+ readonly interval?: number;
12
+ };
13
+ type UseStopwatchResult = {
14
+ /** Milliseconds elapsed since start (or last reset). */
15
+ readonly elapsed: number;
16
+ /** Whether the stopwatch is currently running. */
17
+ readonly isRunning: boolean;
18
+ /** Capture the current elapsed time as a lap. Returns the elapsed value. */
19
+ readonly lap: () => number;
20
+ /** Accumulated lap times. */
21
+ readonly laps: ReadonlyArray<number>;
22
+ /** Reset elapsed to 0, clear laps, and stop the stopwatch. */
23
+ readonly reset: () => void;
24
+ /** Start counting. */
25
+ readonly start: () => void;
26
+ /** Pause counting. */
27
+ readonly stop: () => void;
28
+ /** Toggle between running and stopped. */
29
+ readonly toggle: () => void;
30
+ };
31
+ /**
32
+ * A count-up stopwatch hook built on `useAnimation`.
33
+ *
34
+ * ```tsx
35
+ * const { elapsed, isRunning, start, stop, reset, lap, laps } = useStopwatch();
36
+ * ```
37
+ */
38
+ declare function useStopwatch(options?: UseStopwatchOptions): UseStopwatchResult;
39
+ export { UseStopwatchOptions, UseStopwatchResult, useStopwatch as default, useStopwatch };
@@ -0,0 +1 @@
1
+ import{useState as u,useCallback as t,useRef as b}from"react";import h from"./use-animation.js";function x(c){const{autoStart:i=!1,interval:f=1e3}=c??{},[a,e]=u(i),[p,n]=u([]),{reset:o,time:s}=h({interval:f,isActive:a}),m=t(()=>{e(!0)},[]),g=t(()=>{e(!1)},[]),d=t(()=>{e(r=>!r)},[]),v=t(()=>{e(!1),n([]),o()},[o]),l=b(s);l.current=s;const R=t(()=>{const{current:r}=l;return n(S=>[...S,r]),r},[]);return{elapsed:s,isRunning:a,lap:R,laps:p,reset:v,start:m,stop:g,toggle:d}}export{x as default,x as useStopwatch};
@@ -0,0 +1,20 @@
1
+ import { T as TerminalPalette } from "../../packem_shared/terminal-palette.d-D2SQjfn-.js";
2
+ import 'node:stream';
3
+ type UseTerminalPaletteResult = {
4
+ readonly isLoading: boolean;
5
+ readonly isSupported: boolean;
6
+ readonly palette: Partial<TerminalPalette> | null;
7
+ };
8
+ /**
9
+ * Hook that queries the terminal for its current color palette.
10
+ * Returns the detected palette colors or null if not yet loaded.
11
+ *
12
+ * ```tsx
13
+ * const { palette, isLoading } = useTerminalPalette();
14
+ * if (palette?.background) {
15
+ * console.log("Terminal background:", palette.background);
16
+ * }
17
+ * ```
18
+ */
19
+ declare const useTerminalPalette: () => UseTerminalPaletteResult;
20
+ export { UseTerminalPaletteResult, useTerminalPalette as default, useTerminalPalette };
@@ -0,0 +1 @@
1
+ import{useState as o,useMemo as m,useEffect as f}from"react";import{isTerminalPaletteQuerySupported as p,queryTerminalPalette as c}from"../../packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js";import{useStdinContext as d}from"./use-stdin.js";import y from"./use-stdout.js";const g=()=>{const{stdin:t}=d(),{stdout:e}=y(),[u,i]=o(null),[l,s]=o(!0),r=m(()=>p(),[]);return f(()=>{if(!r||!t||!e){s(!1);return}let a=!1;return(async()=>{try{const n=await c(t,e,200);a||i(n)}catch{}finally{a||s(!1)}})(),()=>{a=!0}},[r,t,e]),{isLoading:l,isSupported:r,palette:u}};export{g as default,g as useTerminalPalette};
@@ -0,0 +1,42 @@
1
+ type CursorPosition = {
2
+ readonly col: number;
3
+ readonly line: number;
4
+ };
5
+ type TextBufferState = {
6
+ readonly anchor: CursorPosition | null;
7
+ readonly cursor: CursorPosition;
8
+ readonly lines: ReadonlyArray<string>;
9
+ };
10
+ type UseTextBufferResult = {
11
+ readonly anchor: CursorPosition | null;
12
+ readonly clearSelection: () => void;
13
+ readonly cursor: CursorPosition;
14
+ readonly deleteBack: () => void;
15
+ readonly deleteForward: () => void;
16
+ readonly deleteLine: () => void;
17
+ readonly deleteSelection: () => void;
18
+ readonly deleteToLineEnd: () => void;
19
+ readonly deleteToLineStart: () => void;
20
+ readonly deleteWord: () => void;
21
+ readonly getSelectedText: () => string;
22
+ readonly hasSelection: () => boolean;
23
+ readonly insert: (text: string) => void;
24
+ readonly lines: ReadonlyArray<string>;
25
+ readonly moveCursor: (direction: "down" | "left" | "right" | "up", selecting?: boolean) => void;
26
+ readonly moveToEnd: (selecting?: boolean) => void;
27
+ readonly moveToLineEnd: (selecting?: boolean) => void;
28
+ readonly moveToLineStart: (selecting?: boolean) => void;
29
+ readonly moveToStart: (selecting?: boolean) => void;
30
+ readonly newline: () => void;
31
+ readonly redo: () => void;
32
+ readonly replaceSelection: (text: string) => void;
33
+ readonly selectAll: () => void;
34
+ readonly setValue: (value: string) => void;
35
+ readonly undo: () => void;
36
+ readonly value: string;
37
+ };
38
+ /**
39
+ * Hook managing a multi-line text buffer with cursor, selection, and undo/redo.
40
+ */
41
+ declare const useTextBuffer: (initialValue?: string) => UseTextBufferResult;
42
+ export { CursorPosition, TextBufferState, UseTextBufferResult, useTextBuffer as default, useTextBuffer };
@@ -0,0 +1,4 @@
1
+ import{useState as Y,useRef as T,useCallback as u,useMemo as Q}from"react";const Z=300,_=100,q=/\S+\s*$/,x=i=>{const t=i.split(`
2
+ `);return t.length===0?[""]:t},J=i=>i.join(`
3
+ `),h=i=>({anchor:i.anchor,cursor:{...i.cursor},lines:[...i.lines]}),b=(i,t,s)=>s?{...i,anchor:i.anchor??i.cursor,cursor:t}:{...i,anchor:null,cursor:t},U=(i,t)=>t.line<i.line||t.line===i.line&&t.col<i.col?{end:i,start:t}:{end:t,start:i},S=i=>{if(!i.anchor)return null;const{end:t,start:s}=U(i.cursor,i.anchor),a=[...i.lines],d=a[s.line].slice(0,s.col),f=a[t.line].slice(t.col);return a.splice(s.line,t.line-s.line+1,d+f),{anchor:null,cursor:s,lines:a}},M=(i,t)=>{const s=S(i)??i,a=[...s.lines],{col:d,line:f}=s.cursor,v=a[f].slice(0,d),m=a[f].slice(d),c=x(t);if(c.length===1)return a[f]=v+c[0]+m,{anchor:null,cursor:{col:d+c[0].length,line:f},lines:a};const k=v+c[0],L=c.at(-1)+m,w=c.slice(1,-1);return a.splice(f,1,k,...w,L),{anchor:null,cursor:{col:c.at(-1).length,line:f+c.length-1},lines:a}},ln=(i="")=>{const[t,s]=Y(()=>{const n=x(i);return{anchor:null,cursor:{col:n.at(-1).length,line:n.length-1},lines:n}}),a=T([]),d=T([]),f=T(0),v=T(t.cursor.col);v.current=t.cursor.col;const m=T(t);m.current=t;const c=u(n=>{const l=Date.now();l-f.current<Z&&a.current.length>0||(a.current.push(n),a.current.length>_&&a.current.shift()),d.current=[],f.current=l},[]),k=u(()=>m.current.anchor!==null,[]),L=u(()=>{const n=m.current;if(!n.anchor)return"";const{end:l,start:e}=U(n.cursor,n.anchor);if(e.line===l.line)return n.lines[e.line].slice(e.col,l.col);const r=[];r.push(n.lines[e.line].slice(e.col));for(let o=e.line+1;o<l.line;o++)r.push(n.lines[o]);return r.push(n.lines[l.line].slice(0,l.col)),r.join(`
4
+ `)},[]),w=u(n=>{s(l=>(c(h(l)),M(l,n)))},[c]),E=u(()=>{s(n=>{c(h(n));const l=S(n)??n,e=[...l.lines],{col:r,line:o}=l.cursor,g=e[o].slice(0,r),p=e[o].slice(r);return e.splice(o,1,g,p),{anchor:null,cursor:{col:0,line:o+1},lines:e}})},[c]),j=u(()=>{s(n=>{if(n.anchor)return c(h(n)),S(n)??n;const{col:l,line:e}=n.cursor;if(l===0&&e===0)return n;c(h(n));const r=[...n.lines];if(l===0){const o=r[e-1],g=o.length;return r[e-1]=o+r[e],r.splice(e,1),{anchor:null,cursor:{col:g,line:e-1},lines:r}}return r[e]=r[e].slice(0,l-1)+r[e].slice(l),{anchor:null,cursor:{col:l-1,line:e},lines:r}})},[c]),B=u(()=>{s(n=>{if(n.anchor)return c(h(n)),S(n)??n;const{col:l,line:e}=n.cursor,r=n.lines[e];if(l===r.length&&e===n.lines.length-1)return n;c(h(n));const o=[...n.lines];return l===r.length?(o[e]=r+o[e+1],o.splice(e+1,1),{anchor:null,cursor:n.cursor,lines:o}):(o[e]=r.slice(0,l)+r.slice(l+1),{anchor:null,cursor:n.cursor,lines:o})})},[c]),C=u(()=>{s(n=>{c(h(n));const l=[...n.lines],{line:e}=n.cursor;if(l.length===1)return{anchor:null,cursor:{col:0,line:0},lines:[""]};l.splice(e,1);const r=Math.min(e,l.length-1);return{anchor:null,cursor:{col:Math.min(n.cursor.col,l[r].length),line:r},lines:l}})},[c]),y=u(()=>{s(n=>{c(h(n));const l=[...n.lines],{col:e,line:r}=n.cursor;return l[r]=l[r].slice(0,e),{...n,anchor:null,lines:l}})},[c]),A=u(()=>{s(n=>{c(h(n));const l=[...n.lines],{col:e,line:r}=n.cursor;return l[r]=l[r].slice(e),{anchor:null,cursor:{col:0,line:r},lines:l}})},[c]),D=u(()=>{s(n=>{if(c(h(n)),n.anchor)return S(n)??n;const{col:l,line:e}=n.cursor,r=n.lines[e].slice(0,l).replace(q,""),o=[...n.lines];return o[e]=r+n.lines[e].slice(l),{anchor:null,cursor:{col:r.length,line:e},lines:o}})},[c]),F=u((n,l=!1)=>{s(e=>{const{col:r,line:o}=e.cursor;let g=o,p=r;switch(n){case"down":{o<e.lines.length-1&&(g=o+1,p=Math.min(v.current,e.lines[g].length));break}case"left":{r>0?p=r-1:o>0&&(g=o-1,p=e.lines[g].length);break}case"right":{const X=e.lines[o].length;r<X?p=r+1:o<e.lines.length-1&&(g=o+1,p=0);break}case"up":{o>0&&(g=o-1,p=Math.min(v.current,e.lines[g].length));break}}return b(e,{col:p,line:g},l)})},[]),R=u((n=!1)=>{s(l=>b(l,{col:0,line:l.cursor.line},n))},[]),V=u((n=!1)=>{s(l=>b(l,{col:l.lines[l.cursor.line].length,line:l.cursor.line},n))},[]),W=u((n=!1)=>{s(l=>b(l,{col:0,line:0},n))},[]),$=u((n=!1)=>{s(l=>{const e=l.lines.length-1;return b(l,{col:l.lines[e].length,line:e},n)})},[]),z=u(()=>{s(n=>{const l=n.lines.length-1;return{...n,anchor:{col:0,line:0},cursor:{col:n.lines[l].length,line:l}}})},[]),G=u(()=>{s(n=>n.anchor?{...n,anchor:null}:n)},[]),H=u(()=>{s(n=>n.anchor?(c(h(n)),S(n)??n):n)},[c]),I=u(n=>{s(l=>{if(!l.anchor)return c(h(l)),M(l,n);c(h(l));const e=S(l)??l;return M(e,n)})},[c]),K=u(n=>{const l=x(n);s({anchor:null,cursor:{col:l.at(-1).length,line:l.length-1},lines:l}),a.current=[],d.current=[]},[]),N=u(()=>{const n=a.current.pop();n&&(d.current.push(h(m.current)),s(n))},[]),O=u(()=>{const n=d.current.pop();n&&(a.current.push(h(m.current)),s(n))},[]),P=Q(()=>J(t.lines),[t.lines]);return Q(()=>({anchor:t.anchor,clearSelection:G,cursor:t.cursor,deleteBack:j,deleteForward:B,deleteLine:C,deleteSelection:H,deleteToLineEnd:y,deleteToLineStart:A,deleteWord:D,getSelectedText:L,hasSelection:k,insert:w,lines:t.lines,moveCursor:F,moveToEnd:$,moveToLineEnd:V,moveToLineStart:R,moveToStart:W,newline:E,redo:O,replaceSelection:I,selectAll:z,setValue:K,undo:N,value:P}),[t.anchor,t.cursor,t.lines,P,G,j,B,C,H,y,A,D,L,k,w,F,$,V,R,W,E,O,I,z,K,N])};export{ln as default,ln as useTextBuffer};