@visulima/tui 1.0.0-alpha.23 → 1.0.0-alpha.24

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 (307) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +17 -0
  3. package/dist/components/accordion.js +1 -1
  4. package/dist/components/alert.js +1 -1
  5. package/dist/components/animate-presence.js +1 -1
  6. package/dist/components/approval-prompt.js +1 -1
  7. package/dist/components/area-chart.js +1 -1
  8. package/dist/components/badge.js +1 -1
  9. package/dist/components/bar-chart.js +1 -1
  10. package/dist/components/big-text.js +1 -1
  11. package/dist/components/blink-dot.js +1 -1
  12. package/dist/components/box.d.ts +1 -1
  13. package/dist/components/breadcrumb.js +1 -1
  14. package/dist/components/button.js +1 -1
  15. package/dist/components/calendar.js +1 -1
  16. package/dist/components/canvas.d.ts +1 -1
  17. package/dist/components/canvas.js +1 -1
  18. package/dist/components/card.js +1 -1
  19. package/dist/components/checkbox.js +1 -1
  20. package/dist/components/code.js +2 -2
  21. package/dist/components/collapsible.js +1 -1
  22. package/dist/components/command-block.js +4 -4
  23. package/dist/components/command-palette.js +1 -1
  24. package/dist/components/confirm-dialog.js +1 -1
  25. package/dist/components/confirm-input.js +1 -1
  26. package/dist/components/console-overlay.js +1 -1
  27. package/dist/components/content-switcher.js +1 -1
  28. package/dist/components/controlled-scroll-view.d.ts +1 -1
  29. package/dist/components/controlled-scroll-view.js +1 -1
  30. package/dist/components/cursor.d.ts +1 -1
  31. package/dist/components/cursor.js +1 -1
  32. package/dist/components/date-picker.js +1 -1
  33. package/dist/components/definition-list.js +1 -1
  34. package/dist/components/dialog.d.ts +1 -1
  35. package/dist/components/dialog.js +1 -1
  36. package/dist/components/diff-view.js +1 -1
  37. package/dist/components/divider.js +1 -1
  38. package/dist/components/file-picker-entry.js +1 -1
  39. package/dist/components/form.js +1 -1
  40. package/dist/components/gauge.js +1 -1
  41. package/dist/components/gradient.js +1 -1
  42. package/dist/components/heading.js +1 -1
  43. package/dist/components/heatmap.js +1 -1
  44. package/dist/components/help.js +1 -1
  45. package/dist/components/histogram.js +1 -1
  46. package/dist/components/kbd.js +1 -1
  47. package/dist/components/line-chart.js +1 -1
  48. package/dist/components/link.js +1 -1
  49. package/dist/components/loading-indicator.js +1 -1
  50. package/dist/components/markdown.js +1 -1
  51. package/dist/components/masked-input.js +1 -1
  52. package/dist/components/menu.js +1 -1
  53. package/dist/components/message-bubble.js +1 -1
  54. package/dist/components/model-badge.js +1 -1
  55. package/dist/components/multi-select.js +1 -1
  56. package/dist/components/newline.js +2 -2
  57. package/dist/components/operation-tree.js +1 -1
  58. package/dist/components/option-list.js +1 -1
  59. package/dist/components/ordered-list.js +1 -1
  60. package/dist/components/paginator.js +1 -1
  61. package/dist/components/paragraph.js +1 -1
  62. package/dist/components/placeholder.js +1 -1
  63. package/dist/components/progress-bar.js +1 -1
  64. package/dist/components/radio-group.js +1 -1
  65. package/dist/components/scatter-plot.js +1 -1
  66. package/dist/components/scroll-bar-box.d.ts +1 -1
  67. package/dist/components/scroll-bar-box.js +1 -1
  68. package/dist/components/scroll-bar.d.ts +1 -1
  69. package/dist/components/scroll-bar.js +1 -1
  70. package/dist/components/scroll-list.d.ts +1 -1
  71. package/dist/components/scroll-list.js +1 -1
  72. package/dist/components/scroll-view.d.ts +1 -1
  73. package/dist/components/scroll-view.js +1 -1
  74. package/dist/components/search-input.js +1 -1
  75. package/dist/components/select-input-indicator.js +1 -1
  76. package/dist/components/select-input-item.js +1 -1
  77. package/dist/components/select-input.js +1 -1
  78. package/dist/components/shimmer-text.js +1 -1
  79. package/dist/components/slider.js +1 -1
  80. package/dist/components/spacer.js +1 -1
  81. package/dist/components/sparkline.js +1 -1
  82. package/dist/components/spinner.js +1 -1
  83. package/dist/components/static-render.d.ts +1 -1
  84. package/dist/components/static-render.js +1 -1
  85. package/dist/components/static.js +1 -1
  86. package/dist/components/status-line.js +1 -1
  87. package/dist/components/status-message.js +1 -1
  88. package/dist/components/stepper.js +1 -1
  89. package/dist/components/stopwatch.js +1 -1
  90. package/dist/components/streaming-text.js +1 -1
  91. package/dist/components/switch.js +1 -1
  92. package/dist/components/tab.js +1 -1
  93. package/dist/components/table.js +1 -1
  94. package/dist/components/tabs.js +1 -1
  95. package/dist/components/tag.js +1 -1
  96. package/dist/components/text-input.js +1 -1
  97. package/dist/components/text.js +1 -1
  98. package/dist/components/textarea.js +2 -2
  99. package/dist/components/timer.js +1 -1
  100. package/dist/components/toast.js +1 -1
  101. package/dist/components/tooltip.js +1 -1
  102. package/dist/components/transform.js +1 -1
  103. package/dist/components/transition.js +1 -1
  104. package/dist/components/tree-view-entry.d.ts +1 -1
  105. package/dist/components/tree-view-entry.js +1 -1
  106. package/dist/components/unordered-list.js +1 -1
  107. package/dist/core/index.js +1 -1
  108. package/dist/ink/hooks/use-animation.js +1 -1
  109. package/dist/ink/hooks/use-app.js +1 -1
  110. package/dist/ink/hooks/use-box-metrics.d.ts +1 -1
  111. package/dist/ink/hooks/use-box-metrics.js +1 -1
  112. package/dist/ink/hooks/use-clipboard.js +1 -1
  113. package/dist/ink/hooks/use-color-blindness.js +1 -1
  114. package/dist/ink/hooks/use-console-capture.js +1 -1
  115. package/dist/ink/hooks/use-cursor.js +1 -1
  116. package/dist/ink/hooks/use-focus-manager.js +1 -1
  117. package/dist/ink/hooks/use-focus.js +1 -1
  118. package/dist/ink/hooks/use-form.js +1 -1
  119. package/dist/ink/hooks/use-hotkey.js +1 -1
  120. package/dist/ink/hooks/use-input.js +2 -2
  121. package/dist/ink/hooks/use-interval.js +1 -1
  122. package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -1
  123. package/dist/ink/hooks/use-key-bindings.js +1 -1
  124. package/dist/ink/hooks/use-key-chord.js +1 -1
  125. package/dist/ink/hooks/use-linked-scroll.d.ts +1 -1
  126. package/dist/ink/hooks/use-linked-scroll.js +1 -1
  127. package/dist/ink/hooks/use-paste.js +1 -1
  128. package/dist/ink/hooks/use-persistent-state.d.ts +12 -3
  129. package/dist/ink/hooks/use-persistent-state.js +2 -2
  130. package/dist/ink/hooks/use-scroll-acceleration.js +1 -1
  131. package/dist/ink/hooks/use-scroll-input.js +1 -1
  132. package/dist/ink/hooks/use-stderr.js +1 -1
  133. package/dist/ink/hooks/use-stdin.js +1 -1
  134. package/dist/ink/hooks/use-stdout.js +1 -1
  135. package/dist/ink/hooks/use-stopwatch.js +1 -1
  136. package/dist/ink/hooks/use-terminal-palette.js +1 -1
  137. package/dist/ink/hooks/use-text-buffer.js +4 -4
  138. package/dist/ink/hooks/use-text-selection.d.ts +2 -2
  139. package/dist/ink/hooks/use-text-selection.js +1 -1
  140. package/dist/ink/hooks/use-timeout.js +1 -1
  141. package/dist/ink/hooks/use-timer.js +1 -1
  142. package/dist/ink/hooks/use-window-size.js +1 -1
  143. package/dist/ink/index.d.ts +17 -62
  144. package/dist/ink/index.js +1 -1
  145. package/dist/ink/mouse/use-element-position.d.ts +31 -0
  146. package/dist/ink/mouse/use-element-position.js +1 -0
  147. package/dist/ink/mouse/use-mouse-action.d.ts +5 -0
  148. package/dist/ink/mouse/use-mouse-action.js +1 -0
  149. package/dist/ink/mouse/use-mouse-position.d.ts +5 -0
  150. package/dist/ink/mouse/use-mouse-position.js +1 -0
  151. package/dist/ink/mouse/use-mouse.d.ts +5 -0
  152. package/dist/ink/mouse/use-mouse.js +1 -0
  153. package/dist/ink/mouse/use-on-mouse-click.d.ts +16 -0
  154. package/dist/ink/mouse/use-on-mouse-click.js +1 -0
  155. package/dist/ink/mouse/use-on-mouse-hover.d.ts +10 -0
  156. package/dist/ink/mouse/use-on-mouse-hover.js +1 -0
  157. package/dist/ink/mouse/use-on-mouse-state.d.ts +13 -0
  158. package/dist/ink/mouse/use-on-mouse-state.js +1 -0
  159. package/dist/packem_chunks/devtools.js +1 -1
  160. package/dist/packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js +1 -0
  161. package/dist/packem_shared/ControlledScrollView-BoN5Oi-p.js +1 -0
  162. package/dist/packem_shared/DevTools-k6uiVzqv.js +1 -0
  163. package/dist/packem_shared/FilePicker-BLS9nOPz.js +1 -0
  164. package/dist/packem_shared/FocusContext-C2Sosxa4.js +1 -0
  165. package/dist/packem_shared/Fullscreen-BRhuBLBh.js +1 -0
  166. package/dist/packem_shared/IMECompositionBuffer-VhC9HRCv.js +1 -0
  167. package/dist/packem_shared/InputParser-CtwkCbrQ.js +2 -0
  168. package/dist/packem_shared/KEY-C--kOw41.js +1 -0
  169. package/dist/packem_shared/LayoutNode-LPYsuzBg.js +1 -0
  170. package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +1 -0
  171. package/dist/packem_shared/NAMED_COLORS-82DpREQV.js +1 -0
  172. package/dist/packem_shared/Range-BsVYNWtg.js +1 -0
  173. package/dist/packem_shared/Renderer-DsskdkUd.js +1 -0
  174. package/dist/packem_shared/ResizeObserver-aX8XOr2u.js +1 -0
  175. package/dist/packem_shared/ScrollBar-BKCK8jsb.js +1 -0
  176. package/dist/packem_shared/ScrollBarBox-CBhLo6eZ.js +1 -0
  177. package/dist/packem_shared/ScrollList-DyFyVs6I.js +1 -0
  178. package/dist/packem_shared/ScrollView-BEgrtSnt.js +1 -0
  179. package/dist/packem_shared/Static-DSzsElz4.js +1 -0
  180. package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +1 -0
  181. package/dist/packem_shared/TreeView-BsvLCsf0.js +1 -0
  182. package/dist/packem_shared/TuiApp-BPL8v1i1.js +1 -0
  183. package/dist/packem_shared/TuiContext-BNmP0lMY.js +3 -0
  184. package/dist/packem_shared/ansi-parser-DlgLtOYO.js +1 -0
  185. package/dist/packem_shared/ansi-tokenizer-BU67A126.js +1 -0
  186. package/dist/packem_shared/braille-ch3O5D7I.js +1 -0
  187. package/dist/packem_shared/calculateScroll-D4Y_JR4H.js +1 -0
  188. package/dist/packem_shared/calculateScrollbarLayout--eUVRLw7.js +1 -0
  189. package/dist/packem_shared/clearOsc52-BUpnQOav.js +1 -0
  190. package/dist/packem_shared/clearStringWidthCache-DKFjfJuB.js +1 -0
  191. package/dist/packem_shared/colorize-DU4YZkp3.js +1 -0
  192. package/dist/packem_shared/controlled-scroll-view-t55HU9L8.js +1 -0
  193. package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +2 -0
  194. package/dist/packem_shared/createScreen-DoYpyL0V.js +3 -0
  195. package/dist/packem_shared/dom-rphpG0kf.js +1 -0
  196. package/dist/packem_shared/{dom.d-C1IxuLJ9.d.ts → dom.d-B4kXbaVY.d.ts} +35 -0
  197. package/dist/packem_shared/format-time-fjoQHMxD.js +1 -0
  198. package/dist/packem_shared/{getPathToRoot-BuAM_kmj.js → getPathToRoot-PDJeqiEH.js} +1 -1
  199. package/dist/packem_shared/input-utils-BSWCb4F_.js +1 -0
  200. package/dist/packem_shared/isIntersecting-Bo2npvMR.js +1 -0
  201. package/dist/packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js +1 -0
  202. package/dist/packem_shared/kittyFlags-g8ALyoCU.js +1 -0
  203. package/dist/packem_shared/line-chart-C7CUrvVs.js +1 -0
  204. package/dist/packem_shared/load-native-root-binding-DDikxNox.js +1 -0
  205. package/dist/packem_shared/measure-element-Cs7_proT.js +2 -0
  206. package/dist/packem_shared/measure-text-B7juNq4Y.js +3 -0
  207. package/dist/packem_shared/mouse-context.d-BfL9xGk_.d.ts +30 -0
  208. package/dist/packem_shared/parseSgrMouse-bUrqPrh-.js +1 -0
  209. package/dist/packem_shared/processLayout-tAee0ytT.js +1 -0
  210. package/dist/packem_shared/reconciler-ClpU7Y-V.js +1 -0
  211. package/dist/packem_shared/reconciler-DhUGYWCr.js +1 -0
  212. package/dist/packem_shared/render-DFZ8NHlG.js +1 -0
  213. package/dist/packem_shared/render-v2x7ZRzT.js +24 -0
  214. package/dist/packem_shared/{render.d-DuyG0zip.d.ts → render.d-CBnYBDk2.d.ts} +1 -1
  215. package/dist/packem_shared/renderToString-C2YmVNLG.js +4 -0
  216. package/dist/packem_shared/renderToString-L_bpw4OQ.js +2 -0
  217. package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +2 -0
  218. package/dist/packem_shared/renderer-COXHo5Xk.js +17 -0
  219. package/dist/packem_shared/{selection.d-Dbha5bMS.d.ts → selection.d-CI3_p8wg.d.ts} +1 -1
  220. package/dist/packem_shared/squashTextNodesWithMap-BmUSBPfc.js +1 -0
  221. package/dist/packem_shared/stderr-context-Bvnik0hL.js +1 -0
  222. package/dist/packem_shared/stdin-context-88AhuztD.js +1 -0
  223. package/dist/packem_shared/text-width-e49vlbQH.js +2 -0
  224. package/dist/packem_shared/token-to-elements-D6J6-P2A.js +1 -0
  225. package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +1 -0
  226. package/dist/packem_shared/useTreeView-D5ifGwG3.js +1 -0
  227. package/dist/packem_shared/useTreeViewState-BiTJakkh.js +1 -0
  228. package/dist/packem_shared/utils-Bup8lyK8.js +1 -0
  229. package/dist/packem_shared/waitFor-CTAki32d.js +4 -0
  230. package/dist/packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js +3 -0
  231. package/dist/react/index.js +1 -1
  232. package/dist/testing/index.d.ts +2 -2
  233. package/dist/testing/index.js +1 -1
  234. package/index.js +691 -539
  235. package/package.json +48 -23
  236. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +0 -1
  237. package/dist/packem_shared/ControlledScrollView-CIc-x1Cx.js +0 -1
  238. package/dist/packem_shared/DevTools-ClAYpMVI.js +0 -1
  239. package/dist/packem_shared/FilePicker-tYj_CIau.js +0 -1
  240. package/dist/packem_shared/FocusContext-Xy0cwJpO.js +0 -1
  241. package/dist/packem_shared/Fullscreen-CxLd1-Zu.js +0 -1
  242. package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +0 -1
  243. package/dist/packem_shared/InputParser-B_qZcN3r.js +0 -2
  244. package/dist/packem_shared/KEY-Bk8B-3h_.js +0 -1
  245. package/dist/packem_shared/LayoutNode-B8zej4dm.js +0 -1
  246. package/dist/packem_shared/MouseProvider-PnIUKURs.js +0 -1
  247. package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +0 -1
  248. package/dist/packem_shared/Renderer-DJXooAsp.js +0 -1
  249. package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +0 -1
  250. package/dist/packem_shared/ScrollBar-U_37hlIT.js +0 -1
  251. package/dist/packem_shared/ScrollBarBox-DwiCxilX.js +0 -1
  252. package/dist/packem_shared/ScrollList-C7nZ9ufK.js +0 -1
  253. package/dist/packem_shared/ScrollView-DKZ8OM-m.js +0 -1
  254. package/dist/packem_shared/Static-DLynr5pn.js +0 -1
  255. package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +0 -1
  256. package/dist/packem_shared/TreeView-C0Iv3et8.js +0 -1
  257. package/dist/packem_shared/TuiApp-BVDXP0Cv.js +0 -1
  258. package/dist/packem_shared/TuiContext-BoJvG3NN.js +0 -3
  259. package/dist/packem_shared/ansi-parser-B6uXaq65.js +0 -1
  260. package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +0 -1
  261. package/dist/packem_shared/braille-BBjIoaN0.js +0 -1
  262. package/dist/packem_shared/colorize-DbTZMrJO.js +0 -1
  263. package/dist/packem_shared/comparePoints-C3NJirbh.js +0 -1
  264. package/dist/packem_shared/controlled-scroll-view-CcUS50jx.js +0 -1
  265. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +0 -2
  266. package/dist/packem_shared/createScreen-CrLrxA6t.js +0 -3
  267. package/dist/packem_shared/dom-CXB-19sK.js +0 -1
  268. package/dist/packem_shared/format-time-C7Q-hQZq.js +0 -1
  269. package/dist/packem_shared/getScrollHeight-ClEOyLHH.js +0 -1
  270. package/dist/packem_shared/input-utils-fAxzSlNh.js +0 -1
  271. package/dist/packem_shared/isIntersecting-B3KbKTmu.js +0 -1
  272. package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +0 -1
  273. package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +0 -1
  274. package/dist/packem_shared/kittyFlags-C3rZLbcK.js +0 -1
  275. package/dist/packem_shared/layout-BMo200nF.js +0 -2
  276. package/dist/packem_shared/line-chart-kf7uhR0K.js +0 -1
  277. package/dist/packem_shared/measure-text-Ce2widM1.js +0 -3
  278. package/dist/packem_shared/measureElement-BTtTFZg4.js +0 -1
  279. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +0 -1
  280. package/dist/packem_shared/processLayout-FEKj_mWu.js +0 -1
  281. package/dist/packem_shared/reconciler-DIfG72R9.js +0 -1
  282. package/dist/packem_shared/reconciler-DYE5h4K4.js +0 -1
  283. package/dist/packem_shared/render-BRR1ESvR.js +0 -26
  284. package/dist/packem_shared/render-Dh7HMhK1.js +0 -1
  285. package/dist/packem_shared/renderToString-BbQiRHrd.js +0 -2
  286. package/dist/packem_shared/renderToString-vEQyGmv6.js +0 -4
  287. package/dist/packem_shared/renderTreeToBuffer-CZilzyhN.js +0 -2
  288. package/dist/packem_shared/renderer-maLLQcut.js +0 -17
  289. package/dist/packem_shared/setEnableStyledLineCache-DSbMbENc.js +0 -1
  290. package/dist/packem_shared/squashTextNodesWithMap-DCdi3SZ2.js +0 -1
  291. package/dist/packem_shared/stderr-context-BzEaUICS.js +0 -1
  292. package/dist/packem_shared/stdin-context-BTaaFagk.js +0 -1
  293. package/dist/packem_shared/text-width-BU2eeTWn.js +0 -2
  294. package/dist/packem_shared/token-to-elements-BAZpNZsu.js +0 -1
  295. package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +0 -1
  296. package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +0 -1
  297. package/dist/packem_shared/useMouseAction-2dRfU1vE.js +0 -1
  298. package/dist/packem_shared/useMouseContext-C746G7kY.js +0 -1
  299. package/dist/packem_shared/useMousePosition-BTWfV4JK.js +0 -1
  300. package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +0 -1
  301. package/dist/packem_shared/useOnMouseHover-D3DczIol.js +0 -1
  302. package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +0 -1
  303. package/dist/packem_shared/useTreeView-BoMMeRPq.js +0 -1
  304. package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +0 -1
  305. package/dist/packem_shared/utils-CoviI5Vm.js +0 -1
  306. package/dist/packem_shared/waitFor-Dj5zfL5s.js +0 -4
  307. package/dist/packem_shared/wrapOrTruncateStyledLine-C5rcIrNb.js +0 -3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,48 @@
1
+ ## @visulima/tui [1.0.0-alpha.24](https://github.com/visulima/visulima/compare/@visulima/tui@1.0.0-alpha.23...@visulima/tui@1.0.0-alpha.24) (2026-06-13)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **tui:** guard Spinner against unknown spinner name ([94ea8fd](https://github.com/visulima/visulima/commit/94ea8fd639a6ae66799f42996f731720aa363c31))
6
+ * **tui:** harden persistent-state and fix export/sideeffects drift ([40a0dbe](https://github.com/visulima/visulima/commit/40a0dbedc317af0e02d2e87314295c66c276991f))
7
+
8
+ ### Performance Improvements
9
+
10
+ * **tui:** avoid per-keystroke Key allocation and double key-enumeration in prepareUpdate ([f87f6c7](https://github.com/visulima/visulima/commit/f87f6c789324b21ca49c8415b71ba95bdfc94ac2))
11
+
12
+ ### Documentation
13
+
14
+ * **tui:** correct sideEffects guidance ([e41d2bb](https://github.com/visulima/visulima/commit/e41d2bb33807d227b94eba973dcf6fa21e01566c))
15
+
16
+ ### Code Refactoring
17
+
18
+ * **tui:** reformat NAPI loader and src to prettier style ([38f99e5](https://github.com/visulima/visulima/commit/38f99e521be081fefb134e0ad25172fbb4de2965))
19
+ * **tui:** unify napi root-binding loader ([84172fc](https://github.com/visulima/visulima/commit/84172fcb8675881313066fd5dc96d2d452e1d3f2))
20
+
21
+ ### Tests
22
+
23
+ * **tui:** de-flake toggle focus management ([ceb4007](https://github.com/visulima/visulima/commit/ceb4007728f7e97894ec2a0734acc2f1f5edca78))
24
+ * **tui:** skip flaky suspense-animation test on macos ([68e3933](https://github.com/visulima/visulima/commit/68e3933f7756a0a40427d93e09c060858a62e5e4))
25
+
26
+ ### Build System
27
+
28
+ * **deps:** update tui dependencies ([7bd603d](https://github.com/visulima/visulima/commit/7bd603db3d0efa7f5e8d5427df34d9bdc4b747dd))
29
+ * regenerate bundled-license manifests and types ordering ([af26588](https://github.com/visulima/visulima/commit/af26588d75aaa937fd4862800560bd4070a4878c))
30
+
31
+ ### Continuous Integration
32
+
33
+ * stabilize flaky tests and drop markdown lint ([91e110a](https://github.com/visulima/visulima/commit/91e110a30b1ef8ca16f0632253a9e4d13856d8f9))
34
+
35
+
36
+ ### Dependencies
37
+
38
+ * **@visulima/ansi:** upgraded to 4.0.0-alpha.17
39
+ * **@visulima/colorize:** upgraded to 2.0.0-alpha.14
40
+ * **@visulima/error:** upgraded to 6.0.0-alpha.33
41
+ * **@visulima/spinner:** upgraded to 1.0.0-alpha.4
42
+ * **@visulima/string:** upgraded to 3.0.0-alpha.17
43
+ * **@visulima/boxen:** upgraded to 3.0.0-alpha.14
44
+ * **@visulima/tabular:** upgraded to 4.0.0-alpha.14
45
+
1
46
  ## @visulima/tui [1.0.0-alpha.23](https://github.com/visulima/visulima/compare/@visulima/tui@1.0.0-alpha.22...@visulima/tui@1.0.0-alpha.23) (2026-06-04)
2
47
 
3
48
 
package/README.md CHANGED
@@ -132,6 +132,23 @@ const Spinner = () => {
132
132
 
133
133
  Returns `{ frame, time, delta, reset }`. See the [full hooks reference](https://visulima.com/packages/tui/hooks#useanimation) for detailed return values, more examples (sine waves, physics, pausable, reset), and `maxFps` interaction.
134
134
 
135
+ The full list of hooks (each at `@visulima/tui/hooks/<name>`): `use-animation`, `use-app`, `use-box-metrics`, `use-clipboard`, `use-color-blindness`, `use-console-capture`, `use-cursor`, `use-element-position`, `use-focus`, `use-focus-manager`, `use-form`, `use-hotkey`, `use-input`, `use-interval`, `use-is-screen-reader-enabled`, `use-key-bindings`, `use-key-chord`, `use-linked-scroll`, `use-mouse`, `use-mouse-action`, `use-mouse-position`, `use-on-mouse-click`, `use-on-mouse-hover`, `use-on-mouse-state`, `use-paste`, `use-persistent-state`, `use-scroll-acceleration`, `use-scroll-input`, `use-stderr`, `use-stdin`, `use-stdout`, `use-stopwatch`, `use-terminal-palette`, `use-text-buffer`, `use-text-selection`, `use-timeout`, `use-timer`, `use-window-size`. See the [hooks reference](https://visulima.com/packages/tui/hooks) for details.
136
+
137
+ ## Component Catalog
138
+
139
+ `@visulima/tui` ships 90+ components, each at its own subpath `@visulima/tui/components/<name>`:
140
+
141
+ - **Layout & text**: `box`, `text`, `paragraph`, `heading`, `divider`, `spacer`, `newline`, `transform`, `gradient`, `big-text`, `shimmer-text`, `streaming-text`, `placeholder`, `link`, `kbd`, `code`, `markdown`, `diff-view`.
142
+ - **Lists & data**: `ordered-list`, `unordered-list`, `definition-list`, `option-list`, `table`, `tree-view`, `operation-tree`, `breadcrumb`, `paginator`, `tag`, `badge`, `model-badge`.
143
+ - **Inputs & forms**: `text-input`, `textarea`, `masked-input`, `search-input`, `confirm-input`, `select-input` (`select-input-item`, `select-input-indicator`), `multi-select`, `checkbox`, `radio-group`, `switch`, `slider`, `date-picker`, `calendar`, `form`, `button`, `file-picker`.
144
+ - **Feedback & status**: `alert`, `toast`, `status-line`, `status-message`, `progress-bar`, `gauge`, `spinner`, `loading-indicator`, `blink-dot`, `stepper`, `timer`, `stopwatch`, `cursor`.
145
+ - **Overlays & navigation**: `dialog`, `confirm-dialog`, `approval-prompt`, `command-palette`, `command-block`, `menu`, `tooltip`, `tab`, `tabs`, `content-switcher`, `accordion`, `collapsible`, `help`, `console-overlay`, `message-bubble`.
146
+ - **Charts & viz**: `area-chart`, `bar-chart`, `line-chart`, `scatter-plot`, `histogram`, `heatmap`, `sparkline`, `canvas`, `card`.
147
+ - **Scrolling**: `scroll-view`, `controlled-scroll-view`, `scroll-list`, `scroll-bar`, `scroll-bar-box`.
148
+ - **Animation & rendering**: `animate-presence`, `transition`, `static`, `static-render`.
149
+
150
+ Browse the live gallery and per-component APIs in the [component docs](https://visulima.com/packages/tui/components).
151
+
135
152
  ## Documentation
136
153
 
137
154
  Full documentation, API reference, component gallery, and guides are available at:
@@ -1 +1 @@
1
- var y=Object.defineProperty;var m=(c,o)=>y(c,"name",{value:o,configurable:!0});import{jsx as p,jsxs as x}from"react/jsx-runtime";import{useState as A,useRef as F,useCallback as g}from"react";import k from"../ink/hooks/use-focus.js";import B from"../ink/hooks/use-input.js";import{Box as a}from"./box.js";import{Text as C}from"./text.js";var L=Object.defineProperty,P=m((c,o)=>L(c,"name",{value:o,configurable:!0}),"g");function E({accentColor:c="blue",allowMultiple:o=!1,autoFocus:j=!1,defaultExpanded:l,isDisabled:u=!1,items:s}){const{isFocused:d}=k({autoFocus:j,isActive:!u}),[w,D]=A(()=>l===void 0||l.length===0?[]:o?l:l.slice(0,1)),[f,h]=A(0),i=F(f);i.current=f;const v=g(r=>{D(e=>{const n=e.includes(r);return o?n?e.filter(t=>t!==r):[...e,r]:n?[]:[r]})},[o]);return B(g((r,e)=>{if(!d)return;const n=s.length;if((e.downArrow||r==="j")&&i.current<n-1)h(i.current+1);else if((e.upArrow||r==="k")&&i.current>0)h(i.current-1);else if(e.return||r===" "){const t=s[i.current];t&&v(t.id)}},[d,s,v]),{isActive:!u&&d}),p(a,{flexDirection:"column",children:s.map((r,e)=>{const n=w.includes(r.id),t=d&&e===f,b=t?c:void 0;return x(a,{flexDirection:"column",children:[x(a,{children:[x(C,{color:b,dimColor:u,children:[t?"▸ ":" ",n?"▼ ":"▶ "]}),p(C,{bold:t,color:b,dimColor:u,children:r.title})]}),n?p(a,{flexDirection:"column",marginBottom:1,marginLeft:4,children:r.content}):void 0]},r.id)})})}m(E,"C");P(E,"Accordion");export{E as Accordion,E as default};
1
+ import{jsx as m,jsxs as a}from"react/jsx-runtime";import{useState as b,useRef as F,useCallback as v}from"react";import j from"../ink/hooks/use-focus.js";import k from"../ink/hooks/use-input.js";import{Box as u}from"./box.js";import{Text as A}from"./text.js";function M({accentColor:g="blue",allowMultiple:d=!1,autoFocus:w=!1,defaultExpanded:i,isDisabled:c=!1,items:l}){const{isFocused:s}=j({autoFocus:w,isActive:!c}),[C,D]=b(()=>i===void 0||i.length===0?[]:d?i:i.slice(0,1)),[f,p]=b(0),n=F(f);n.current=f;const x=v(r=>{D(e=>{const o=e.includes(r);return d?o?e.filter(t=>t!==r):[...e,r]:o?[]:[r]})},[d]);return k(v((r,e)=>{if(!s)return;const o=l.length;if((e.downArrow||r==="j")&&n.current<o-1)p(n.current+1);else if((e.upArrow||r==="k")&&n.current>0)p(n.current-1);else if(e.return||r===" "){const t=l[n.current];t&&x(t.id)}},[s,l,x]),{isActive:!c&&s}),m(u,{flexDirection:"column",children:l.map((r,e)=>{const o=C.includes(r.id),t=s&&e===f,h=t?g:void 0;return a(u,{flexDirection:"column",children:[a(u,{children:[a(A,{color:h,dimColor:c,children:[t?"▸ ":" ",o?"▼ ":"▶ "]}),m(A,{bold:t,color:h,dimColor:c,children:r.title})]}),o?m(u,{flexDirection:"column",marginBottom:1,marginLeft:4,children:r.content}):void 0]},r.id)})})}export{M as Accordion,M as default};
@@ -1 +1 @@
1
- var f=Object.defineProperty;var i=(e,r)=>f(e,"name",{value:r,configurable:!0});import{jsxs as d,jsx as o}from"react/jsx-runtime";import{Box as l}from"./box.js";import{Text as n}from"./text.js";import{o as m}from"../packem_shared/variant-config-BJqpNo7H.js";var h=Object.defineProperty,p=i((e,r)=>h(e,"name",{value:r,configurable:!0}),"i");function x({children:e,title:r,variant:c}){const{color:t,icon:a}=m[c];return d(l,{borderColor:t,borderStyle:"round",flexGrow:1,gap:1,paddingX:1,children:[o(l,{flexShrink:0,children:o(n,{color:t,children:a})}),d(l,{flexDirection:"column",flexGrow:1,flexShrink:1,gap:1,minWidth:0,children:[r?o(n,{bold:!0,children:r}):void 0,o(n,{children:e})]})]})}i(x,"p");p(x,"Alert");export{x as Alert,x as default};
1
+ import{jsxs as l,jsx as r}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Text as i}from"./text.js";import{o as f}from"../packem_shared/variant-config-BJqpNo7H.js";function p({children:t,title:e,variant:d}){const{color:n,icon:c}=f[d];return l(o,{borderColor:n,borderStyle:"round",flexGrow:1,gap:1,paddingX:1,children:[r(o,{flexShrink:0,children:r(i,{color:n,children:c})}),l(o,{flexDirection:"column",flexGrow:1,flexShrink:1,gap:1,minWidth:0,children:[e?r(i,{bold:!0,children:e}):void 0,r(i,{children:t})]})]})}export{p as Alert,p as default};
@@ -1 +1 @@
1
- var w=Object.defineProperty;var a=(o,s)=>w(o,"name",{value:s,configurable:!0});import{jsx as E}from"react/jsx-runtime";import{useState as b,Children as p,isValidElement as h,useEffect as x,useCallback as v,cloneElement as y}from"react";import{Box as A}from"./box.js";var g=Object.defineProperty,u=a((o,s)=>g(o,"name",{value:s,configurable:!0}),"a");const k=u(o=>{const{key:s}=o;if(s!==null)return s},"getKey"),c=u(o=>o.type?.isAnimatable===!0?!0:typeof o.props=="object"&&o.props!==null&&"show"in o.props,"isAnimatable");function j({children:o}){const[s,f]=b(()=>{const e=[];return p.forEach(o,t=>{if(!h(t))return;const r=k(t);r!==void 0&&e.push({element:(c(t),t),key:r,show:!0})}),e});x(()=>{const e=new Map;p.forEach(o,t=>{if(!h(t))return;const r=k(t);r!==void 0&&e.set(r,(c(t),t))}),f(t=>{const r=[],m=new Set;let l=!1;for(const n of t)if(e.has(n.key)){const i=e.get(n.key);(!n.show||n.element!==i)&&(l=!0),r.push({element:i,key:n.key,show:!0}),m.add(n.key)}else n.show&&(l=!0),r.push({...n,show:!1});for(const[n,i]of e)m.has(n)||(l=!0,r.push({element:i,key:n,show:!0}));return l?r:t})},[o]);const d=v(e=>{f(t=>t.filter(r=>r.key!==e))},[]);return E(A,{flexDirection:"column",children:s.map(e=>{if(!c(e.element))return y(e.element,{key:e.key});const t=e.element.props.onExit;return y(e.element,{key:e.key,onExit:u(()=>{t?.(),d(e.key)},"onExit"),show:e.show})})})}a(j,"d");u(j,"AnimatePresence");export{j as AnimatePresence,j as default};
1
+ import{jsx as y}from"react/jsx-runtime";import{useState as k,Children as f,isValidElement as a,useEffect as w,useCallback as d,cloneElement as m}from"react";import{Box as E}from"./box.js";const p=s=>{const{key:r}=s;if(r!==null)return r},x=s=>s.type?.isAnimatable===!0?!0:typeof s.props=="object"&&s.props!==null&&"show"in s.props;function A({children:s}){const[r,c]=k(()=>{const e=[];return f.forEach(s,t=>{if(!a(t))return;const n=p(t);n!==void 0&&e.push({element:t,key:n,show:!0})}),e});w(()=>{const e=new Map;f.forEach(s,t=>{if(!a(t))return;const n=p(t);n!==void 0&&e.set(n,t)}),c(t=>{const n=[],i=new Set;let l=!1;for(const o of t)if(e.has(o.key)){const u=e.get(o.key);(!o.show||o.element!==u)&&(l=!0),n.push({element:u,key:o.key,show:!0}),i.add(o.key)}else o.show&&(l=!0),n.push({...o,show:!1});for(const[o,u]of e)i.has(o)||(l=!0,n.push({element:u,key:o,show:!0}));return l?n:t})},[s]);const h=d(e=>{c(t=>t.filter(n=>n.key!==e))},[]);return y(E,{flexDirection:"column",children:r.map(e=>{if(!x(e.element))return m(e.element,{key:e.key});const t=e.element.props.onExit;return m(e.element,{key:e.key,onExit:()=>{t?.(),h(e.key)},show:e.show})})})}export{A as AnimatePresence,A as default};
@@ -1 +1 @@
1
- var x=Object.defineProperty;var m=(r,l)=>x(r,"name",{value:l,configurable:!0});import{jsxs as n,jsx as e}from"react/jsx-runtime";import{useCallback as I}from"react";import T from"../ink/hooks/use-focus.js";import A from"../ink/hooks/use-input.js";import{Box as i}from"./box.js";import{Text as o}from"./text.js";var C=Object.defineProperty,v=m((r,l)=>C(r,"name",{value:l,configurable:!0}),"m");const D={high:"red",low:"green",medium:"yellow"},j={high:"HIGH RISK",low:"LOW RISK",medium:"MEDIUM RISK"},k=v(r=>{if(r===null)return"null";if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="boolean")return String(r);try{return JSON.stringify(r)}catch{return String(r)}},"formatParameterValue");function O({accentColor:r,autoFocus:l=!0,children:p,description:h,isDisabled:f=!1,onDecision:t,params:b,risk:g="medium",tool:w}){const d=D[g],u=r??d,{isFocused:S}=T({autoFocus:l,isActive:!f});A(I((c,a)=>{const s=c.toLowerCase();if(s==="y"||a.return){t("allow-once");return}if(s==="a"){t("allow-always");return}(s==="n"||a.escape)&&t("deny")},[t]),{isActive:!f&&S});const y=b===void 0?[]:Object.entries(b);return n(i,{borderColor:d,borderStyle:"round",flexDirection:"column",paddingX:1,children:[n(i,{children:[n(o,{backgroundColor:d,color:"black",children:[" ",j[g]," "]}),n(o,{children:[" ",e(o,{bold:!0,children:w})]})]}),h===void 0?void 0:e(i,{marginTop:1,children:e(o,{children:h})}),y.length===0?void 0:e(i,{flexDirection:"column",marginTop:1,children:y.map(([c,a])=>n(i,{children:[n(o,{color:"cyan",children:[c,"="]}),e(o,{wrap:"truncate-end",children:k(a)})]},c))}),p===void 0?void 0:e(i,{marginTop:1,children:p}),e(i,{marginTop:1,children:n(o,{children:["Allow? [",e(o,{bold:!0,color:u,children:"y"}),"es /"," ",e(o,{bold:!0,color:u,children:"a"}),"lways /"," ",e(o,{bold:!0,color:u,children:"n"}),"o ]"]})})]})}m(O,"w");v(O,"ApprovalPrompt");export{O as ApprovalPrompt,O as default};
1
+ import{jsxs as n,jsx as o}from"react/jsx-runtime";import{useCallback as v}from"react";import x from"../ink/hooks/use-focus.js";import S from"../ink/hooks/use-input.js";import{Box as i}from"./box.js";import{Text as e}from"./text.js";const C={high:"red",low:"green",medium:"yellow"},k={high:"HIGH RISK",low:"LOW RISK",medium:"MEDIUM RISK"},A=r=>{if(r===null)return"null";if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="boolean")return String(r);try{return JSON.stringify(r)}catch{return String(r)}};function O({accentColor:r,autoFocus:b=!0,children:u,description:m,isDisabled:h=!1,onDecision:l,params:p,risk:f="medium",tool:y}){const d=C[f],a=r??d,{isFocused:w}=x({autoFocus:b,isActive:!h});S(v((t,c)=>{const s=t.toLowerCase();if(s==="y"||c.return){l("allow-once");return}if(s==="a"){l("allow-always");return}(s==="n"||c.escape)&&l("deny")},[l]),{isActive:!h&&w});const g=p===void 0?[]:Object.entries(p);return n(i,{borderColor:d,borderStyle:"round",flexDirection:"column",paddingX:1,children:[n(i,{children:[n(e,{backgroundColor:d,color:"black",children:[" ",k[f]," "]}),n(e,{children:[" ",o(e,{bold:!0,children:y})]})]}),m===void 0?void 0:o(i,{marginTop:1,children:o(e,{children:m})}),g.length===0?void 0:o(i,{flexDirection:"column",marginTop:1,children:g.map(([t,c])=>n(i,{children:[n(e,{color:"cyan",children:[t,"="]}),o(e,{wrap:"truncate-end",children:A(c)})]},t))}),u===void 0?void 0:o(i,{marginTop:1,children:u}),o(i,{marginTop:1,children:n(e,{children:["Allow? [",o(e,{bold:!0,color:a,children:"y"}),"es /"," ",o(e,{bold:!0,color:a,children:"a"}),"lways /"," ",o(e,{bold:!0,color:a,children:"n"}),"o ]"]})})]})}export{O as ApprovalPrompt,O as default};
@@ -1 +1 @@
1
- var A=Object.defineProperty;var x=(c,p)=>A(c,"name",{value:p,configurable:!0});import{jsxs as v,jsx as f}from"react/jsx-runtime";import{useMemo as Y}from"react";import{c as _}from"../packem_shared/braille-BBjIoaN0.js";import{Box as I}from"./box.js";import{Canvas as D}from"./canvas.js";import{t as F,p as j,D as L,c as S,a as g}from"../packem_shared/line-chart-kf7uhR0K.js";import{Text as w}from"./text.js";var V=Object.defineProperty,G=x((c,p)=>V(c,"name",{value:p,configurable:!0}),"E");const O=L,k={heavy:"▓",light:"░",medium:"▒"};function B({axisColor:c="gray",fillDensity:p="medium",height:N=10,maxY:d,minY:M,palette:u=O,series:y,showLegend:C=!0,width:T=40}){const l=Y(()=>{const o=y.map((r,h)=>({color:j(r,h,u),points:F(r.data),series:r})),t=S(o);return{list:o,xMax:t.xMax===Number.NEGATIVE_INFINITY?1:t.xMax,xMin:t.xMin===Number.POSITIVE_INFINITY?0:t.xMin,yMax:d??(t.yMax===Number.NEGATIVE_INFINITY?1:t.yMax),yMin:M??(t.yMin===Number.POSITIVE_INFINITY?0:t.yMin)}},[y,u,M,d]),E=k[p];return v(I,{flexDirection:"column",children:[f(D,{draw:x(o=>{o.clear();const t=o.width*2,r=o.height*4,h={xMax:l.xMax,xMin:l.xMin,yMax:l.yMax,yMin:l.yMin};for(const{color:n,points:s}of l.list)if(s.length!==0)for(let a=0;a<o.width;a+=1){let i;for(const e of s){const{px:m,py:P}=g(e,h,t,r);if(Math.floor(m/2)===a){const b=Math.floor(P/4);(i===void 0||b<i)&&(i=b)}}if(i!==void 0)for(let e=i+1;e<o.height;e+=1)o.setCell(a,e,E,{color:n,dim:!0})}for(let n=0;n<o.width;n+=2)o.setCell(n,o.height-1,"·",{color:c,dim:!0});for(const{color:n,points:s}of l.list){if(s.length===0)continue;const a=_(o.width,o.height);let i=g(s[0],h,t,r);a.plotPoint(i.px,i.py);for(let e=1;e<s.length;e+=1){const m=g(s[e],h,t,r);a.plotLine(i.px,i.py,m.px,m.py),i=m}a.flush(o,{bold:!0,color:n})}},"draw"),height:N,version:[y,T,N,M,d,p,c,u],width:T}),C?f(I,{gap:2,marginTop:1,children:l.list.map(({color:o,series:t},r)=>v(I,{gap:1,children:[f(w,{color:o,children:E}),f(w,{children:t.label??`Series ${r+1}`})]},`${r}:${t.label??""}`))}):void 0]})}x(B,"N");G(B,"AreaChart");export{B as AreaChart,B as default};
1
+ import{jsxs as b,jsx as m}from"react/jsx-runtime";import{useMemo as A}from"react";import{c as P}from"../packem_shared/braille-ch3O5D7I.js";import{Box as M}from"./box.js";import{Canvas as Y}from"./canvas.js";import{t as _,p as F,c as L,D,a as u}from"../packem_shared/line-chart-C7CUrvVs.js";import{Text as w}from"./text.js";const S=D,V={heavy:"▓",light:"░",medium:"▒"};function H({axisColor:I="gray",fillDensity:y="medium",height:g=10,maxY:p,minY:h,palette:d=S,series:f,showLegend:C=!0,width:N=40}){const s=A(()=>{const o=f.map((r,c)=>({color:F(r,c,d),points:_(r.data),series:r})),t=L(o);return{list:o,xMax:t.xMax===Number.NEGATIVE_INFINITY?1:t.xMax,xMin:t.xMin===Number.POSITIVE_INFINITY?0:t.xMin,yMax:p??(t.yMax===Number.NEGATIVE_INFINITY?1:t.yMax),yMin:h??(t.yMin===Number.POSITIVE_INFINITY?0:t.yMin)}},[f,d,h,p]),T=V[y];return b(M,{flexDirection:"column",children:[m(Y,{draw:o=>{o.clear();const t=o.width*2,r=o.height*4,c={xMax:s.xMax,xMin:s.xMin,yMax:s.yMax,yMin:s.yMin};for(const{color:a,points:n}of s.list)if(n.length!==0)for(let l=0;l<o.width;l+=1){let i;for(const e of n){const{px:x,py:v}=u(e,c,t,r);if(Math.floor(x/2)===l){const E=Math.floor(v/4);(i===void 0||E<i)&&(i=E)}}if(i!==void 0)for(let e=i+1;e<o.height;e+=1)o.setCell(l,e,T,{color:a,dim:!0})}for(let a=0;a<o.width;a+=2)o.setCell(a,o.height-1,"·",{color:I,dim:!0});for(const{color:a,points:n}of s.list){if(n.length===0)continue;const l=P(o.width,o.height);let i=u(n[0],c,t,r);l.plotPoint(i.px,i.py);for(let e=1;e<n.length;e+=1){const x=u(n[e],c,t,r);l.plotLine(i.px,i.py,x.px,x.py),i=x}l.flush(o,{bold:!0,color:a})}},height:g,version:[f,N,g,h,p,y,I,d],width:N}),C?m(M,{gap:2,marginTop:1,children:s.list.map(({color:o,series:t},r)=>b(M,{gap:1,children:[m(w,{color:o,children:T}),m(w,{children:t.label??`Series ${r+1}`})]},`${r}:${t.label??""}`))}):void 0]})}export{H as AreaChart,H as default};
@@ -1 +1 @@
1
- var n=Object.defineProperty;var a=(r,e)=>n(r,"name",{value:e,configurable:!0});import{jsxs as c,jsx as l}from"react/jsx-runtime";import{Text as o}from"./text.js";var i=Object.defineProperty,s=a((r,e)=>i(r,"name",{value:e,configurable:!0}),"t");function d({children:r,color:e="magenta"}){const t=typeof r=="string"?r.toUpperCase():r;return c(o,{backgroundColor:e,children:[" ",l(o,{color:"black",children:t})," "]})}a(d,"p");s(d,"Badge");export{d as Badge,d as default};
1
+ import{jsxs as a,jsx as n}from"react/jsx-runtime";import{Text as o}from"./text.js";function l({children:r,color:t="magenta"}){const e=typeof r=="string"?r.toUpperCase():r;return a(o,{backgroundColor:t,children:[" ",n(o,{color:"black",children:e})," "]})}export{l as Badge,l as default};
@@ -1 +1 @@
1
- var D=Object.defineProperty;var s=(r,l)=>D(r,"name",{value:l,configurable:!0});import{jsx as e,jsxs as S}from"react/jsx-runtime";import{useMemo as M}from"react";import{Box as i}from"./box.js";import{Canvas as k}from"./canvas.js";import{Text as p}from"./text.js";var y=Object.defineProperty,g=s((r,l)=>y(r,"name",{value:l,configurable:!0}),"u");const L=["cyan","magenta","yellow","green","blue","red"],V=g((r,l)=>{if(l!==void 0)return l;if(r.length===0)return 0;let n=r[0].value;for(let u=1;u<r.length;u+=1){const{value:c}=r[u];c>n&&(n=c)}return n},"findMax"),E=g((r,l,n)=>n.color??l[r%l.length]??"cyan","colorFor");function z({data:r,height:l=10,max:n,orientation:u="vertical",palette:c=L,showLabels:C=!0,showValues:b=!1,width:B}){const h=M(()=>V(r,n),[r,n]);if(u==="horizontal"){const a=B??24;return e(i,{flexDirection:"column",children:r.map((t,f)=>{const w=h===0?0:t.value/h,m=E(f,c,t);return S(i,{gap:1,children:[C&&t.label!==void 0?e(i,{flexShrink:0,minWidth:8,children:e(p,{dimColor:!0,wrap:"truncate-end",children:t.label})}):void 0,e(i,{flexGrow:1,flexShrink:1,children:e(k,{draw:s(v=>{v.clear(),v.drawHBar(0,0,a,w,{color:m})},"draw"),height:1,version:[t.value,h,m,a],width:a})}),b?e(i,{flexShrink:0,children:e(p,{children:String(t.value)})}):void 0]},f)})})}const o=2,d=1,j=B??Math.max(r.length*(o+d),1);return S(i,{flexDirection:"column",children:[e(k,{draw:s(a=>{a.clear(),r.forEach((t,f)=>{const w=h===0?0:t.value/h,m=E(f,c,t),v=f*(o+d);for(let x=0;x<o;x+=1)a.drawVBar(v+x,0,l,w,{color:m})})},"draw"),height:l,version:[r,h,c,o,d,l],width:j}),b?e(i,{children:r.map((a,t)=>e(i,{width:o+d,children:e(p,{dimColor:!0,children:String(a.value).padEnd(o+d," ")})},t))}):void 0,C?e(i,{children:r.map((a,t)=>e(i,{width:o+d,children:e(p,{dimColor:!0,wrap:"truncate-end",children:(a.label??"").padEnd(o+d," ")})},t))}):void 0]})}s(z,"k");g(z,"BarChart");export{z as BarChart,z as default};
1
+ import{jsx as e,jsxs as B}from"react/jsx-runtime";import{useMemo as E}from"react";import{Box as o}from"./box.js";import{Canvas as C}from"./canvas.js";import{Text as p}from"./text.js";const j=["cyan","magenta","yellow","green","blue","red"],D=(r,t)=>{if(t!==void 0)return t;if(r.length===0)return 0;let a=r[0].value;for(let u=1;u<r.length;u+=1){const{value:h}=r[u];h>a&&(a=h)}return a},S=(r,t,a)=>a.color??t[r%t.length]??"cyan";function z({data:r,height:t=10,max:a,orientation:u="vertical",palette:h=j,showLabels:w=!0,showValues:g=!1,width:k}){const c=E(()=>D(r,a),[r,a]);if(u==="horizontal"){const i=k??24;return e(o,{flexDirection:"column",children:r.map((l,s)=>{const v=c===0?0:l.value/c,m=S(s,h,l);return B(o,{gap:1,children:[w&&l.label!==void 0?e(o,{flexShrink:0,minWidth:8,children:e(p,{dimColor:!0,wrap:"truncate-end",children:l.label})}):void 0,e(o,{flexGrow:1,flexShrink:1,children:e(C,{draw:f=>{f.clear(),f.drawHBar(0,0,i,v,{color:m})},height:1,version:[l.value,c,m,i],width:i})}),g?e(o,{flexShrink:0,children:e(p,{children:String(l.value)})}):void 0]},s)})})}const n=2,d=1,b=k??Math.max(r.length*(n+d),1);return B(o,{flexDirection:"column",children:[e(C,{draw:i=>{i.clear(),r.forEach((l,s)=>{const v=c===0?0:l.value/c,m=S(s,h,l),f=s*(n+d);for(let x=0;x<n;x+=1)i.drawVBar(f+x,0,t,v,{color:m})})},height:t,version:[r,c,h,n,d,t],width:b}),g?e(o,{children:r.map((i,l)=>e(o,{width:n+d,children:e(p,{dimColor:!0,children:String(i.value).padEnd(n+d," ")})},l))}):void 0,w?e(o,{children:r.map((i,l)=>e(o,{width:n+d,children:e(p,{dimColor:!0,wrap:"truncate-end",children:(i.label??"").padEnd(n+d," ")})},l))}):void 0]})}export{z as BarChart,z as default};
@@ -1 +1 @@
1
- var m=Object.defineProperty;var r=(e,t)=>m(e,"name",{value:t,configurable:!0});import{jsx as p}from"react/jsx-runtime";import f from"cfonts";import{useMemo as u}from"react";import{Text as x}from"./text.js";var d=Object.defineProperty,h=r((e,t)=>d(e,"name",{value:t,configurable:!0}),"p");const b={align:"left",backgroundColor:"transparent",colors:["system"],font:"block",letterSpacing:1,lineHeight:1,maxLength:0,space:!0};function k({align:e,backgroundColor:t,colors:o,font:n,letterSpacing:a,lineHeight:i,maxLength:c,space:g,text:l}){const s=u(()=>f.render(l,{...b,align:e,backgroundColor:t,colors:o,font:n,letterSpacing:a,lineHeight:i,maxLength:c,space:g}),[l,e,t,o,n,a,i,c,g]);return p(x,{children:s&&s.string})}r(k,"c");h(k,"BigText");export{k as BigText,k as default};
1
+ import{jsx as s}from"react/jsx-runtime";import m from"cfonts";import{useMemo as p}from"react";import{Text as f}from"./text.js";const u={align:"left",backgroundColor:"transparent",colors:["system"],font:"block",letterSpacing:1,lineHeight:1,maxLength:0,space:!0};function b({align:t,backgroundColor:e,colors:o,font:r,letterSpacing:n,lineHeight:a,maxLength:i,space:c,text:g}){const l=p(()=>m.render(g,{...u,align:t,backgroundColor:e,colors:o,font:r,letterSpacing:n,lineHeight:a,maxLength:i,space:c}),[g,t,e,o,r,n,a,i,c]);return s(f,{children:l&&l.string})}export{b as BigText,b as default};
@@ -1 +1 @@
1
- var c=Object.defineProperty;var t=(r,e)=>c(r,"name",{value:e,configurable:!0});import{jsx as l}from"react/jsx-runtime";import f from"../ink/hooks/use-animation.js";import{Text as m}from"./text.js";var s=Object.defineProperty,u=t((r,e)=>s(r,"name",{value:e,configurable:!0}),"e");function v({character:r="●",color:e="red",interval:a=800,isActive:o=!0}){const{frame:i}=f({interval:Math.max(1,Math.floor(a/2)),isActive:o}),n=!o||i%2===0;return l(m,{color:e,children:n?r:" "})}t(v,"n");u(v,"BlinkDot");export{v as BlinkDot,v as default};
1
+ import{jsx as c}from"react/jsx-runtime";import l from"../ink/hooks/use-animation.js";import{Text as m}from"./text.js";function h({character:t="●",color:o="red",interval:e=800,isActive:r=!0}){const{frame:i}=l({interval:Math.max(1,Math.floor(e/2)),isActive:r}),a=!r||i%2===0;return c(m,{color:o,children:a?t:" "})}export{h as BlinkDot,h as default};
@@ -1,6 +1,6 @@
1
1
  import { ReactNode, PropsWithChildren, RefAttributes, ForwardRefExoticComponent } from 'react';
2
2
  import { Except } from 'type-fest';
3
- import { D as DOMElement } from "../packem_shared/dom.d-C1IxuLJ9.js";
3
+ import { D as DOMElement } from "../packem_shared/dom.d-B4kXbaVY.js";
4
4
  import { S as Styles } from "../packem_shared/styles.d-cMo36xQz.js";
5
5
  import 'yoga-layout';
6
6
  import "../packem_shared/cursor-helpers.d-BONB9tky.js";
@@ -1 +1 @@
1
- var d=Object.defineProperty;var l=(e,r)=>d(e,"name",{value:r,configurable:!0});import{jsx as c,jsxs as a,Fragment as u}from"react/jsx-runtime";import{Fragment as s}from"react";import{Box as b}from"./box.js";import{Text as m}from"./text.js";var f=Object.defineProperty,p=l((e,r)=>f(e,"name",{value:r,configurable:!0}),"l");function v({currentColor:e="blue",items:r,separator:n="›"}){return c(b,{children:r.map((o,t)=>{const i=t===r.length-1;return a(s,{children:[t>0?a(m,{dimColor:!0,children:[" ",n," "]}):void 0,a(m,{bold:i,color:i?e:void 0,dimColor:!i,children:[o.icon===void 0?void 0:a(u,{children:[o.icon," "]}),o.label]})]},o.key??`${t}:${o.label}`)})})}l(v,"d");p(v,"Breadcrumb");export{v as Breadcrumb,v as default};
1
+ import{jsx as a,jsxs as o,Fragment as d}from"react/jsx-runtime";import{Fragment as c}from"react";import{Box as s}from"./box.js";import{Text as l}from"./text.js";function b({currentColor:n="blue",items:i,separator:m="›"}){return a(s,{children:i.map((r,e)=>{const t=e===i.length-1;return o(c,{children:[e>0?o(l,{dimColor:!0,children:[" ",m," "]}):void 0,o(l,{bold:t,color:t?n:void 0,dimColor:!t,children:[r.icon===void 0?void 0:o(d,{children:[r.icon," "]}),r.label]})]},r.key??`${e}:${r.label}`)})})}export{b as Breadcrumb,b as default};
@@ -1 +1 @@
1
- var b=Object.defineProperty;var l=(o,e)=>b(o,"name",{value:e,configurable:!0});import{jsx as c,jsxs as v}from"react/jsx-runtime";import{useCallback as y}from"react";import C from"../ink/hooks/use-focus.js";import g from"../ink/hooks/use-input.js";import{Box as d}from"./box.js";import{Text as u}from"./text.js";var h=Object.defineProperty,m=l((o,e)=>h(o,"name",{value:e,configurable:!0}),"l");const x="round",B=m((o,e,a,i)=>{if(!a){if(o==="primary"&&e)return"black";if(e)return i}},"resolveTextColor");function j({accentColor:o="blue",autoFocus:e=!1,children:a,isDisabled:i=!1,onPress:s,variant:t="primary"}){const{isFocused:r}=C({autoFocus:e,isActive:!i});g(y((f,p)=>{r&&(p.return||f===" ")&&s?.()},[r,s]),{isActive:!i&&r});const n=B(t,r,i,o);return t==="ghost"?c(d,{paddingX:1,children:v(u,{bold:r,color:n,dimColor:i,children:[r?"▸ ":" ",a]})}):c(d,{backgroundColor:t==="primary"&&r?o:void 0,borderColor:t==="outline"?r?o:"gray":t==="secondary"||r?o:void 0,borderStyle:x,paddingX:1,children:c(u,{bold:r,color:n,dimColor:i,children:a})})}l(j,"f");m(j,"Button");export{j as Button,j as default};
1
+ import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useCallback as p}from"react";import b from"../ink/hooks/use-focus.js";import g from"../ink/hooks/use-input.js";import{Box as e}from"./box.js";import{Text as c}from"./text.js";const h="round",y=(i,s,a,r)=>{if(!a){if(i==="primary"&&s)return"black";if(s)return r}};function A({accentColor:i="blue",autoFocus:s=!1,children:a,isDisabled:r=!1,onPress:l,variant:n="primary"}){const{isFocused:o}=b({autoFocus:s,isActive:!r});g(p((m,u)=>{o&&(u.return||m===" ")&&l?.()},[o,l]),{isActive:!r&&o});const t=y(n,o,r,i);return n==="ghost"?d(e,{paddingX:1,children:f(c,{bold:o,color:t,dimColor:r,children:[o?"▸ ":" ",a]})}):d(e,{backgroundColor:n==="primary"&&o?i:void 0,borderColor:n==="outline"?o?i:"gray":n==="secondary"||o?i:void 0,borderStyle:h,paddingX:1,children:d(c,{bold:o,color:t,dimColor:r,children:a})})}export{A as Button,A as default};
@@ -1 +1 @@
1
- var $=Object.defineProperty;var v=(e,r)=>$(e,"name",{value:r,configurable:!0});import{jsxs as x,jsx as u}from"react/jsx-runtime";import{useMemo as F,useState as I,useRef as L,useCallback as k}from"react";import V from"../ink/hooks/use-focus.js";import _ from"../ink/hooks/use-input.js";import{Box as h}from"./box.js";import{Text as b}from"./text.js";var q=Object.defineProperty,p=v((e,r)=>q(e,"name",{value:r,configurable:!0}),"g");const z=["January","February","March","April","May","June","July","August","September","October","November","December"],O=["Su","Mo","Tu","We","Th","Fr","Sa"],f=p(e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),"startOfDay"),j=p((e,r)=>{const i=e.getFullYear(),l=e.getMonth()+r,g=new Date(i,l+1,0).getDate(),n=Math.min(e.getDate(),g);return new Date(i,l,n)},"shiftMonth"),J=p((e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),"isSameDay"),T=p((e,r,i)=>r!==void 0&&e<f(r)||i!==void 0&&e>f(i),"isOutOfRange"),G=p((e,r,i)=>{const l=(new Date(e,r,1).getDay()-i+7)%7,g=new Date(e,r+1,0).getDate(),n=[];for(let a=0;a<l;a+=1)n.push(void 0);for(let a=1;a<=g;a+=1)n.push(new Date(e,r,a));for(;n.length%7!==0;)n.push(void 0);const D=[];for(let a=0;a<n.length;a+=7)D.push(n.slice(a,a+7));return D},"buildWeeks");function H({accentColor:e="blue",autoFocus:r=!1,defaultValue:i,firstDayOfWeek:l=1,isDisabled:g=!1,maxDate:n,minDate:D,onChange:a,onSubmit:M,selectedColor:R="green",value:w}){const{isFocused:m}=V({autoFocus:r,isActive:!g}),y=F(()=>f(new Date),[]),W=f(w??i??y),[B,E]=I(W),c=w?f(w):B,C=L(c);C.current=c;const N=F(()=>[...O.slice(l),...O.slice(0,l)],[l]),P=F(()=>G(c.getFullYear(),c.getMonth(),l),[c,l]),d=k(s=>{const o=f(s);T(o,D,n)||(w===void 0&&E(o),a?.(o))},[w,a,D,n]);_(k((s,o)=>{if(!m)return;const{current:t}=C;o.leftArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-1)):o.rightArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+1)):o.upArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-7)):o.downArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+7)):o.pageUp?d(j(t,-1)):o.pageDown?d(j(t,1)):o.return&&M?.(t)},[m,d,M]),{isActive:!g&&m});const U=`${z[c.getMonth()]} ${c.getFullYear()}`;return x(h,{borderColor:m?e:void 0,borderStyle:"round",flexDirection:"column",paddingX:1,children:[u(h,{justifyContent:"center",children:u(b,{bold:!0,color:e,children:U})}),u(h,{marginTop:1,children:N.map(s=>u(h,{width:3,children:u(b,{dimColor:!0,children:s.padEnd(2," ")})},s))}),P.map((s,o)=>u(h,{children:s.map((t,Y)=>{if(t===void 0)return u(h,{width:3,children:u(b,{children:" "})},Y);const S=J(t,y),A=J(t,c),X=T(t,D,n);return u(h,{width:3,children:x(b,{backgroundColor:A&&m?e:void 0,bold:S,color:A&&m?"black":S?R:void 0,dimColor:X||g,children:[String(t.getDate()).padStart(2," ")," "]})},Y)})},o))]})}v(H,"v");p(H,"Calendar");export{H as Calendar,H as default};
1
+ import{jsxs as y,jsx as u}from"react/jsx-runtime";import{useMemo as w,useState as V,useRef as W,useCallback as S}from"react";import I from"../ink/hooks/use-focus.js";import K from"../ink/hooks/use-input.js";import{Box as h}from"./box.js";import{Text as b}from"./text.js";const P=["January","February","March","April","May","June","July","August","September","October","November","December"],k=["Su","Mo","Tu","We","Th","Fr","Sa"],p=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),x=(e,r)=>{const i=e.getFullYear(),l=e.getMonth()+r,g=new Date(i,l+1,0).getDate(),a=Math.min(e.getDate(),g);return new Date(i,l,a)},T=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),J=(e,r,i)=>r!==void 0&&e<p(r)||i!==void 0&&e>p(i),X=(e,r,i)=>{const l=(new Date(e,r,1).getDay()-i+7)%7,g=new Date(e,r+1,0).getDate(),a=[];for(let o=0;o<l;o+=1)a.push(void 0);for(let o=1;o<=g;o+=1)a.push(new Date(e,r,o));for(;a.length%7!==0;)a.push(void 0);const D=[];for(let o=0;o<a.length;o+=7)D.push(a.slice(o,o+7));return D};function Z({accentColor:e="blue",autoFocus:r=!1,defaultValue:i,firstDayOfWeek:l=1,isDisabled:g=!1,maxDate:a,minDate:D,onChange:o,onSubmit:F,selectedColor:$="green",value:f}){const{isFocused:m}=I({autoFocus:r,isActive:!g}),M=w(()=>p(new Date),[]),j=p(f??i??M),[O,B]=V(j),c=f?p(f):O,v=W(c);v.current=c;const E=w(()=>[...k.slice(l),...k.slice(0,l)],[l]),N=w(()=>X(c.getFullYear(),c.getMonth(),l),[c,l]),d=S(s=>{const n=p(s);J(n,D,a)||(f===void 0&&B(n),o?.(n))},[f,o,D,a]);K(S((s,n)=>{if(!m)return;const{current:t}=v;n.leftArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-1)):n.rightArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+1)):n.upArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-7)):n.downArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+7)):n.pageUp?d(x(t,-1)):n.pageDown?d(x(t,1)):n.return&&F?.(t)},[m,d,F]),{isActive:!g&&m});const R=`${P[c.getMonth()]} ${c.getFullYear()}`;return y(h,{borderColor:m?e:void 0,borderStyle:"round",flexDirection:"column",paddingX:1,children:[u(h,{justifyContent:"center",children:u(b,{bold:!0,color:e,children:R})}),u(h,{marginTop:1,children:E.map(s=>u(h,{width:3,children:u(b,{dimColor:!0,children:s.padEnd(2," ")})},s))}),N.map((s,n)=>u(h,{children:s.map((t,C)=>{if(t===void 0)return u(h,{width:3,children:u(b,{children:" "})},C);const Y=T(t,M),A=T(t,c),U=J(t,D,a);return u(h,{width:3,children:y(b,{backgroundColor:A&&m?e:void 0,bold:Y,color:A&&m?"black":Y?$:void 0,dimColor:U||g,children:[String(t.getDate()).padStart(2," ")," "]})},C)})},n))]})}export{Z as Calendar,Z as default};
@@ -1,6 +1,6 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { C as CanvasContext } from "../packem_shared/buffer.d-EJkZr8uH.js";
3
- export { type a as CanvasColor, type b as CellStyle } from "../packem_shared/buffer.d-EJkZr8uH.js";
3
+ export type { a as CanvasColor, b as CellStyle } from "../packem_shared/buffer.d-EJkZr8uH.js";
4
4
  type Props = {
5
5
  /**
6
6
  * Imperative draw callback. Mutates the underlying typed-array buffer via
@@ -1 +1 @@
1
- var O=Object.defineProperty;var S=(r,e)=>O(r,"name",{value:e,configurable:!0});import{jsx as D}from"react/jsx-runtime";import{useRef as P,useMemo as z,Fragment as H}from"react";import{d as I}from"../packem_shared/colorize-DbTZMrJO.js";import{Box as V}from"./box.js";import{Text as _}from"./text.js";var E=Object.defineProperty,m=S((r,e)=>E(r,"name",{value:e,configurable:!0}),"u$1");const j=Math.trunc(1),F=2,R=32,q=0,G=m(()=>{const r=new Map,e=[void 0];return{decode:m(l=>e[l],"decode"),encode:m(l=>{if(l===void 0)return q;const u=typeof l=="number"?`n:${l}`:`s:${l}`,h=r.get(u);if(h!==void 0)return h;const y=e.length;return e.push(l),r.set(u,y),y},"encode")}},"createColorCoders"),$=[9601,9602,9603,9604,9605,9606,9607,9608],k=[9615,9614,9613,9612,9611,9610,9609,9608],T=9608,J=m(r=>{if(!r)return 0;let e=0;return r.bold&&(e|=j),r.dim&&(e|=F),e},"flagsFromStyle"),U=m(r=>typeof r=="number"?r:r.codePointAt(0)??R,"toCodepoint"),K=m((r,e)=>{const l=Math.max(0,r*e),u=new Uint32Array(l),h=new Uint32Array(l),y=new Int32Array(l),p=new Int32Array(l),v=new Uint8Array(e),{decode:x,encode:g}=G();u.fill(R);const C=m(o=>{o>=0&&o<e&&(v[o]=1)},"markDirty"),w=m((o,n,c,i)=>{if(o<0||o>=r||n<0||n>=e)return;const t=n*r+o,d=U(c),s=g(i?.color),a=g(i?.background),f=J(i);u[t]===d&&h[t]===f&&y[t]===s&&p[t]===a||(u[t]=d,h[t]=f,y[t]=s,p[t]=a,v[n]=1)},"setCellImpl");return{bg:p,chars:u,colorDecoder:x,context:{clear:m(()=>{u.fill(R),h.fill(0),y.fill(0),p.fill(0),v.fill(1)},"clear"),drawHBar:m((o,n,c,i,t)=>{if(c<=0||n<0||n>=e)return;const d=Math.max(0,Math.min(1,i)),s=c*k.length,a=Math.round(d*s),f=Math.floor(a/k.length),M=a%k.length;for(let b=0;b<c;b+=1){const B=o+b;b<f?w(B,n,T,t):b===f&&M>0?w(B,n,k[M-1],t):w(B,n,R,t)}C(n)},"drawHBar"),drawRect:m((o,n,c,i,t,d)=>{if(c<=0||i<=0)return;const s=U(t);for(let a=0;a<i;a+=1){for(let f=0;f<c;f+=1)w(o+f,n+a,s,d);C(n+a)}},"drawRect"),drawText:m((o,n,c,i)=>{if(n<0||n>=e||c.length===0)return;let t=0;for(const d of c)w(o+t,n,d,i),t+=1;C(n)},"drawText"),drawVBar:m((o,n,c,i,t)=>{if(c<=0||o<0||o>=r)return;const d=Math.max(0,Math.min(1,i)),s=c*$.length,a=Math.round(d*s),f=Math.floor(a/$.length),M=a%$.length;for(let b=0;b<c;b+=1){const B=c-b-1,A=n+b;B<f?w(o,A,T,t):B===f&&M>0?w(o,A,$[M-1],t):w(o,A,R,t),C(A)}},"drawVBar"),height:e,setCell:w,width:r},dirty:v,fg:y,height:e,styles:h,width:r}},"createCanvasBuffer"),L=m((r,e)=>{const{bg:l,chars:u,colorDecoder:h,fg:y,styles:p,width:v}=r,x=e*v;let g="",C=0,w=p[x],o=y[x],n=l[x];const c=m(i=>{let t="";for(let f=C;f<i;f+=1)t+=String.fromCodePoint(u[x+f]);const d=h(o),s=h(n);let a=t;d!==void 0&&(a=I(a,typeof d=="number"?String(d):d,"foreground")),s!==void 0&&(a=I(a,typeof s=="number"?String(s):s,"background")),(w&j)!==0&&(a=`\x1B[1m${a}\x1B[22m`),(w&F)!==0&&(a=`\x1B[2m${a}\x1B[22m`),g+=a},"flush");for(let i=1;i<v;i+=1){const t=p[x+i],d=y[x+i],s=l[x+i];(t!==w||d!==o||s!==n)&&(c(i),C=i,w=t,o=d,n=s)}return c(v),g},"serializeRow");var N=Object.defineProperty,Q=S((r,e)=>N(r,"name",{value:e,configurable:!0}),"u");function W({draw:r,height:e,version:l,width:u}){const h=P(void 0),y=P(void 0);(h.current?.width!==u||h.current.height!==e)&&(h.current=K(u,e),y.current={hasRendered:!1,lines:Array.from({length:e}).fill("")});const p=h.current,v=y.current,x=z(()=>{r(p.context);for(let g=0;g<p.height;g+=1)v.hasRendered&&p.dirty[g]===0||(v.lines[g]=L(p,g),p.dirty[g]=0);return v.hasRendered=!0,[...v.lines]},[l,u,e]);return D(V,{flexDirection:"column",flexShrink:0,height:e,width:u,children:x.map((g,C)=>D(H,{children:D(_,{wrap:"truncate-end",children:g})},C))})}S(W,"d");Q(W,"Canvas");export{W as Canvas,W as default};
1
+ import{jsx as $}from"react/jsx-runtime";import{useRef as k,useMemo as _,Fragment as j}from"react";import{a as D}from"../packem_shared/colorize-DU4YZkp3.js";import{Box as z}from"./box.js";import{Text as E}from"./text.js";const T=Math.trunc(1),I=2,A=32,F=0,H=()=>{const c=new Map,r=[void 0];return{decode:l=>r[l],encode:l=>{if(l===void 0)return F;const h=typeof l=="number"?`n:${l}`:`s:${l}`,u=c.get(h);if(u!==void 0)return u;const w=r.length;return r.push(l),c.set(h,w),w}}},C=[9601,9602,9603,9604,9605,9606,9607,9608],S=[9615,9614,9613,9612,9611,9610,9609,9608],U=9608,L=c=>{if(!c)return 0;let r=0;return c.bold&&(r|=T),c.dim&&(r|=I),r},P=c=>typeof c=="number"?c:c.codePointAt(0)??A,O=(c,r)=>{const l=Math.max(0,c*r),h=new Uint32Array(l),u=new Uint32Array(l),w=new Int32Array(l),x=new Int32Array(l),y=new Uint8Array(r),{decode:p,encode:m}=H();h.fill(A);const b=n=>{n>=0&&n<r&&(y[n]=1)},g=(n,t,s,i)=>{if(n<0||n>=c||t<0||t>=r)return;const e=t*c+n,d=P(s),a=m(i?.color),o=m(i?.background),f=L(i);h[e]===d&&u[e]===f&&w[e]===a&&x[e]===o||(h[e]=d,u[e]=f,w[e]=a,x[e]=o,y[t]=1)};return{bg:x,chars:h,colorDecoder:p,context:{clear:()=>{h.fill(A),u.fill(0),w.fill(0),x.fill(0),y.fill(1)},drawHBar:(n,t,s,i,e)=>{if(s<=0||t<0||t>=r)return;const d=Math.max(0,Math.min(1,i)),a=s*S.length,o=Math.round(d*a),f=Math.floor(o/S.length),B=o%S.length;for(let M=0;M<s;M+=1){const v=n+M;M<f?g(v,t,U,e):M===f&&B>0?g(v,t,S[B-1],e):g(v,t,A,e)}b(t)},drawRect:(n,t,s,i,e,d)=>{if(s<=0||i<=0)return;const a=P(e);for(let o=0;o<i;o+=1){for(let f=0;f<s;f+=1)g(n+f,t+o,a,d);b(t+o)}},drawText:(n,t,s,i)=>{if(t<0||t>=r||s.length===0)return;let e=0;for(const d of s)g(n+e,t,d,i),e+=1;b(t)},drawVBar:(n,t,s,i,e)=>{if(s<=0||n<0||n>=c)return;const d=Math.max(0,Math.min(1,i)),a=s*C.length,o=Math.round(d*a),f=Math.floor(o/C.length),B=o%C.length;for(let M=0;M<s;M+=1){const v=s-M-1,R=t+M;v<f?g(n,R,U,e):v===f&&B>0?g(n,R,C[B-1],e):g(n,R,A,e),b(R)}},height:r,setCell:g,width:c},dirty:y,fg:w,height:r,styles:u,width:c}},V=(c,r)=>{const{bg:l,chars:h,colorDecoder:u,fg:w,styles:x,width:y}=c,p=r*y;let m="",b=0,g=x[p],n=w[p],t=l[p];const s=i=>{let e="";for(let f=b;f<i;f+=1)e+=String.fromCodePoint(h[p+f]);const d=u(n),a=u(t);let o=e;d!==void 0&&(o=D(o,typeof d=="number"?String(d):d,"foreground")),a!==void 0&&(o=D(o,typeof a=="number"?String(a):a,"background")),(g&T)!==0&&(o=`\x1B[1m${o}\x1B[22m`),(g&I)!==0&&(o=`\x1B[2m${o}\x1B[22m`),m+=o};for(let i=1;i<y;i+=1){const e=x[p+i],d=w[p+i],a=l[p+i];(e!==g||d!==n||a!==t)&&(s(i),b=i,g=e,n=d,t=a)}return s(y),m};function Q({draw:c,height:r,version:l,width:h}){const u=k(void 0),w=k(void 0);(u.current?.width!==h||u.current.height!==r)&&(u.current=O(h,r),w.current={hasRendered:!1,lines:Array.from({length:r}).fill("")});const x=u.current,y=w.current,p=_(()=>{c(x.context);for(let m=0;m<x.height;m+=1)y.hasRendered&&x.dirty[m]===0||(y.lines[m]=V(x,m),x.dirty[m]=0);return y.hasRendered=!0,[...y.lines]},[l,h,r]);return $(z,{flexDirection:"column",flexShrink:0,height:r,width:h,children:p.map((m,b)=>$(j,{children:$(E,{wrap:"truncate-end",children:m})},b))})}export{Q as Canvas,Q as default};
@@ -1 +1 @@
1
- var f=Object.defineProperty;var m=(e,i)=>f(e,"name",{value:i,configurable:!0});import{jsxs as d,jsx as r}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Divider as p}from"./divider.js";import{Text as u}from"./text.js";var s=Object.defineProperty,x=m((e,i)=>s(e,"name",{value:i,configurable:!0}),"m");function b({borderColor:e,borderStyle:i="round",children:h,footer:a,headerRight:t,subtitle:n,title:l,titleColor:v,width:c}){return d(o,{borderColor:e,borderStyle:i,flexDirection:"column",paddingX:1,width:c,children:[l!==void 0||n!==void 0||t!==void 0?d(o,{flexDirection:"column",marginBottom:1,children:[d(o,{justifyContent:"space-between",children:[r(o,{children:l===void 0?void 0:r(u,{bold:!0,color:v,children:l})}),t===void 0?void 0:r(o,{children:t})]}),n===void 0?void 0:r(u,{dimColor:!0,children:n})]}):void 0,r(o,{flexDirection:"column",children:h}),a===void 0?void 0:d(o,{flexDirection:"column",marginTop:1,children:[r(p,{dimColor:!0,length:typeof c=="number"?Math.max(1,c-4):void 0}),r(o,{marginTop:1,children:a})]})]})}m(b,"p");x(b,"Card");export{b as Card,b as default};
1
+ import{jsxs as r,jsx as i}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Divider as u}from"./divider.js";import{Text as c}from"./text.js";function b({borderColor:m,borderStyle:h="round",children:a,footer:l,headerRight:e,subtitle:d,title:t,titleColor:f,width:n}){return r(o,{borderColor:m,borderStyle:h,flexDirection:"column",paddingX:1,width:n,children:[t!==void 0||d!==void 0||e!==void 0?r(o,{flexDirection:"column",marginBottom:1,children:[r(o,{justifyContent:"space-between",children:[i(o,{children:t===void 0?void 0:i(c,{bold:!0,color:f,children:t})}),e===void 0?void 0:i(o,{children:e})]}),d===void 0?void 0:i(c,{dimColor:!0,children:d})]}):void 0,i(o,{flexDirection:"column",children:a}),l===void 0?void 0:r(o,{flexDirection:"column",marginTop:1,children:[i(u,{dimColor:!0,length:typeof n=="number"?Math.max(1,n-4):void 0}),i(o,{marginTop:1,children:l})]})]})}export{b as Card,b as default};
@@ -1 +1 @@
1
- var p=Object.defineProperty;var a=(o,r)=>p(o,"name",{value:r,configurable:!0});import{jsxs as f,jsx as b}from"react/jsx-runtime";import{useState as x,useCallback as k}from"react";import g from"../ink/hooks/use-focus.js";import j from"../ink/hooks/use-input.js";import{Box as A}from"./box.js";import{Text as m}from"./text.js";var F=Object.defineProperty,y=a((o,r)=>F(o,"name",{value:r,configurable:!0}),"d");const B="☒",D="☐";function I({accentColor:o="blue",autoFocus:r=!1,children:t,defaultChecked:n=!1,isChecked:c,isDisabled:i=!1,onChange:l}){const{isFocused:e}=g({autoFocus:r,isActive:!i}),[u,v]=x(n),s=c??u;return j(k((C,h)=>{if(e&&(h.return||C===" ")){const d=!s;c===void 0&&v(d),l?.(d)}},[e,s,c,l]),{isActive:!i&&e}),f(A,{gap:1,children:[f(m,{color:e?o:void 0,dimColor:i,children:[e?"▸ ":" ",s?B:D]}),t===void 0?void 0:b(m,{color:e?o:void 0,dimColor:i,children:t})]})}a(I,"f");y(I,"Checkbox");export{I as Checkbox,I as default};
1
+ import{jsxs as d,jsx as v}from"react/jsx-runtime";import{useState as C,useCallback as x}from"react";import b from"../ink/hooks/use-focus.js";import k from"../ink/hooks/use-input.js";import{Box as F}from"./box.js";import{Text as l}from"./text.js";const g="☒",j="☐";function q({accentColor:s="blue",autoFocus:m=!1,children:c,defaultChecked:n=!1,isChecked:i,isDisabled:e=!1,onChange:t}){const{isFocused:o}=b({autoFocus:m,isActive:!e}),[u,f]=C(n),r=i??u;return k(x((h,p)=>{if(o&&(p.return||h===" ")){const a=!r;i===void 0&&f(a),t?.(a)}},[o,r,i,t]),{isActive:!e&&o}),d(F,{gap:1,children:[d(l,{color:o?s:void 0,dimColor:e,children:[o?"▸ ":" ",r?g:j]}),c===void 0?void 0:v(l,{color:o?s:void 0,dimColor:e,children:c})]})}export{q as Checkbox,q as default};
@@ -1,2 +1,2 @@
1
- var b=Object.defineProperty;var f=(e,r)=>b(e,"name",{value:r,configurable:!0});import{jsx as g,jsxs as p}from"react/jsx-runtime";import{useState as k,useRef as w,useEffect as y}from"react";import{r as C,i as T,P as j,g as E,t as N}from"../packem_shared/token-to-elements-BAZpNZsu.js";import{Box as x}from"./box.js";import{Text as L}from"./text.js";var P=Object.defineProperty,R=f((e,r)=>P(e,"name",{value:r,configurable:!0}),"m");function B({code:e,highlightLines:r,language:a,showLineNumbers:i=!1,startLine:l=1,theme:u="github-dark-default"}){const[h,c]=k(null),n=w(!1);y(()=>{n.current=!1;const t=a?C(a):"text";if(t!=="text"&&!T(t)){c(null);return}return(async()=>{try{const o=await j(t==="text"?[]:[t],u),s=E(o,e,t,u);n.current||c(s.tokens)}catch{n.current||c(null)}})(),()=>{n.current=!0}},[e,a,u]);const v={highlightLines:r,showLineNumbers:i,startLine:l};if(h)return N(h,v);const m=e.split(`
2
- `),S=i?String(l+m.length-1).length:0;return g(x,{flexDirection:"column",children:m.map((t,o)=>{const s=l+o,d=r?.has(s)??!1;return p(x,{children:[i?p(L,{color:d?"yellow":void 0,dimColor:!d,children:[String(s).padStart(S)," "]}):void 0,g(L,{children:t})]},o)})})}f(B,"x");R(B,"Code");export{B as Code,B as default};
1
+ import{jsx as m,jsxs as d}from"react/jsx-runtime";import{useState as w,useRef as S,useEffect as T}from"react";import{r as b,i as v,w as y,g as C,t as j}from"../packem_shared/token-to-elements-D6J6-P2A.js";import{Box as p}from"./box.js";import{Text as x}from"./text.js";function q({code:o,highlightLines:c,language:s,showLineNumbers:i=!1,startLine:a=1,theme:l="github-dark-default"}){const[f,u]=w(null),t=S(!1);T(()=>{t.current=!1;const e=s?b(s):"text";if(e!=="text"&&!v(e)){u(null);return}return(async()=>{try{const r=await y(e==="text"?[]:[e],l),n=C(r,o,e,l);t.current||u(n.tokens)}catch{t.current||u(null)}})(),()=>{t.current=!0}},[o,s,l]);const L={highlightLines:c,showLineNumbers:i,startLine:a};if(f)return j(f,L);const h=o.split(`
2
+ `),k=i?String(a+h.length-1).length:0;return m(p,{flexDirection:"column",children:h.map((e,r)=>{const n=a+r,g=c?.has(n)??!1;return d(p,{children:[i?d(x,{color:g?"yellow":void 0,dimColor:!g,children:[String(n).padStart(k)," "]}):void 0,m(x,{children:e})]},r)})})}export{q as Code,q as default};
@@ -1 +1 @@
1
- var g=Object.defineProperty;var c=(o,e)=>g(o,"name",{value:e,configurable:!0});import{jsxs as m,jsx as n}from"react/jsx-runtime";import{useState as j,useCallback as A}from"react";import D from"../ink/hooks/use-focus.js";import F from"../ink/hooks/use-input.js";import{Box as s}from"./box.js";import{Text as f}from"./text.js";var O=Object.defineProperty,y=c((o,e)=>O(o,"name",{value:e,configurable:!0}),"d");function T({accentColor:o="blue",autoFocus:e=!1,children:u,defaultOpen:p=!1,isDisabled:i=!1,isOpen:t,onToggle:a,title:b}){const{isFocused:r}=D({autoFocus:e,isActive:!i}),[v,x]=j(p),l=t??v;return F(A((C,h)=>{if(h.return||C===" "){const d=!l;t===void 0&&x(d),a?.(d)}},[l,t,a]),{isActive:!i&&r}),m(s,{flexDirection:"column",children:[m(s,{children:[n(f,{color:r?o:void 0,dimColor:i,children:l?"▼ ":"▶ "}),n(f,{bold:r,color:r?o:void 0,dimColor:i,children:b})]}),l?n(s,{flexDirection:"column",marginLeft:2,children:u}):void 0]})}c(T,"m");y(T,"Collapsible");export{T as Collapsible,T as default};
1
+ import{jsxs as a,jsx as l}from"react/jsx-runtime";import{useState as C,useCallback as g}from"react";import D from"../ink/hooks/use-focus.js";import F from"../ink/hooks/use-input.js";import{Box as t}from"./box.js";import{Text as d}from"./text.js";function L({accentColor:c="blue",autoFocus:m=!1,children:f,defaultOpen:u=!1,isDisabled:o=!1,isOpen:r,onToggle:s,title:p}){const{isFocused:e}=D({autoFocus:m,isActive:!o}),[x,b]=C(u),i=r??x;return F(g((h,v)=>{if(v.return||h===" "){const n=!i;r===void 0&&b(n),s?.(n)}},[i,r,s]),{isActive:!o&&e}),a(t,{flexDirection:"column",children:[a(t,{children:[l(d,{color:e?c:void 0,dimColor:o,children:i?"▼ ":"▶ "}),l(d,{bold:e,color:e?c:void 0,dimColor:o,children:p})]}),i?l(t,{flexDirection:"column",marginLeft:2,children:f}):void 0]})}export{L as Collapsible,L as default};
@@ -1,4 +1,4 @@
1
- var x=Object.defineProperty;var h=(r,e)=>x(r,"name",{value:e,configurable:!0});import{jsxs as d,jsx as o}from"react/jsx-runtime";import{Box as l}from"./box.js";import{Spinner as g}from"./spinner.js";import{Text as n}from"./text.js";var v=Object.defineProperty,a=h((r,e)=>v(r,"name",{value:e,configurable:!0}),"d");const C={error:"red",idle:"gray",running:"cyan",success:"green"},b=a(r=>r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`,"formatDuration"),y=a(r=>r==="running"?o(g,{type:"dots"}):{error:"✖",idle:"$",success:"✔"}[r],"resolveStatusIcon"),S=a((r,e)=>{if(!Number.isFinite(e))return r;const i=r.split(`
2
- `);if(i.length<=e)return r;const t=i.slice(0,e).join(`
3
- `),c=i.length-e;return`${t}
4
- … ${c} more line${c===1?"":"s"}`},"truncateOutput");function $({command:r,cwd:e,durationMs:i,exitCode:t,maxOutputRows:c=12,output:s,status:m="idle"}){const p=C[m],f=y(m),u=[];return i!==void 0&&u.push(d(n,{dimColor:!0,children:[" ",b(i)]},"duration")),t!==void 0&&m!=="running"&&u.push(d(n,{color:t===0?"green":"red",children:[" ","exit"," ",t]},"exit")),d(l,{borderColor:p,borderStyle:"round",flexDirection:"column",paddingX:1,children:[d(l,{children:[o(n,{color:p,children:f}),o(n,{children:" "}),o(l,{flexGrow:1,flexShrink:1,minWidth:0,children:o(n,{bold:!0,wrap:"truncate-end",children:r})}),e===void 0?void 0:d(n,{dimColor:!0,children:[" ","@",e]}),u.length===0?void 0:o(l,{flexShrink:0,children:u})]}),s===void 0?void 0:o(l,{flexDirection:"column",marginTop:1,children:typeof s=="string"?o(n,{children:S(s,c)}):s})]})}h($,"f");a($,"CommandBlock");export{$ as CommandBlock,$ as default};
1
+ import{jsxs as d,jsx as e}from"react/jsx-runtime";import{Box as l}from"./box.js";import{Spinner as p}from"./spinner.js";import{Text as n}from"./text.js";const f={error:"red",idle:"gray",running:"cyan",success:"green"},x=r=>r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`,g=r=>r==="running"?e(p,{type:"dots"}):{error:"✖",idle:"$",success:"✔"}[r],v=(r,i)=>{if(!Number.isFinite(i))return r;const o=r.split(`
2
+ `);if(o.length<=i)return r;const t=o.slice(0,i).join(`
3
+ `),s=o.length-i;return`${t}
4
+ … ${s} more line${s===1?"":"s"}`};function b({command:r,cwd:i,durationMs:o,exitCode:t,maxOutputRows:s=12,output:c,status:m="idle"}){const h=f[m],a=g(m),u=[];return o!==void 0&&u.push(d(n,{dimColor:!0,children:[" ",x(o)]},"duration")),t!==void 0&&m!=="running"&&u.push(d(n,{color:t===0?"green":"red",children:[" ","exit"," ",t]},"exit")),d(l,{borderColor:h,borderStyle:"round",flexDirection:"column",paddingX:1,children:[d(l,{children:[e(n,{color:h,children:a}),e(n,{children:" "}),e(l,{flexGrow:1,flexShrink:1,minWidth:0,children:e(n,{bold:!0,wrap:"truncate-end",children:r})}),i===void 0?void 0:d(n,{dimColor:!0,children:[" ","@",i]}),u.length===0?void 0:e(l,{flexShrink:0,children:u})]}),c===void 0?void 0:e(l,{flexDirection:"column",marginTop:1,children:typeof c=="string"?e(n,{children:v(c,s)}):c})]})}export{b as CommandBlock,b as default};
@@ -1 +1 @@
1
- var T=Object.defineProperty;var k=(i,l)=>T(i,"name",{value:l,configurable:!0});import{jsxs as u,jsx as n}from"react/jsx-runtime";import{useState as M,useRef as j,useMemo as A,useEffect as D,useCallback as F}from"react";import I from"../ink/hooks/use-focus.js";import L from"../ink/hooks/use-input.js";import{i as O}from"../packem_shared/input-utils-fAxzSlNh.js";import{Box as s}from"./box.js";import{Text as t}from"./text.js";var P=Object.defineProperty,S=k((i,l)=>P(i,"name",{value:l,configurable:!0}),"w");const B=S((i,l)=>{if(i.length===0)return 1;const p=[l.label,l.description??"",...l.keywords??[]].map(c=>c.toLowerCase()).filter(c=>c.length>0),f=i.toLowerCase();let m=0;for(const c of p){if(c.includes(f)){const h=c.indexOf(f);m=Math.max(m,100-h);continue}let x=0,g=0;for(const h of f){const d=c.indexOf(h,x);if(d===-1){g=0;break}g+=1,x=d+1}g===f.length&&(m=Math.max(m,20))}return m},"scoreCommand");function E({accentColor:i="cyan",autoFocus:l=!0,commands:p,emptyText:f="No results",limit:m=8,onCancel:c,onSelect:x,placeholder:g="Type a command or search..."}){const{isFocused:h}=I({autoFocus:l}),[d,y]=M(""),[v,C]=M(0),b=j(v);b.current=v;const a=A(()=>{const e=p.map(r=>({command:r,score:B(d,r)})).filter(({score:r})=>r>0);return e.sort((r,o)=>o.score-r.score),e.slice(0,m).map(({command:r})=>r)},[p,d,m]);return D(()=>{const e=Math.max(0,a.length-1);b.current>e&&(b.current=e,C(e))},[a]),L(F((e,r)=>{if(h){if(r.escape){c?.();return}if(r.downArrow){if(a.length===0)return;C(o=>Math.min(a.length-1,o+1));return}if(r.upArrow){C(o=>Math.max(0,o-1));return}if(r.return){const o=a[b.current];o&&x(o.id,d);return}if(r.backspace||r.delete){y(o=>o.slice(0,-1)),C(0);return}O(e,r)&&(y(o=>o+e),C(0))}},[h,a,d,x,c]),{isActive:h}),u(s,{borderColor:i,borderStyle:"round",flexDirection:"column",paddingX:1,children:[u(s,{children:[n(t,{color:i,children:"❯"}),u(t,{children:[" ",d.length===0?n(t,{dimColor:!0,children:g}):d]}),n(t,{inverse:!0,children:" "})]}),n(s,{marginTop:1,children:u(t,{dimColor:!0,children:[a.length," of ",p.length]})}),n(s,{flexDirection:"column",marginTop:1,children:a.length===0?n(t,{dimColor:!0,children:f}):a.map((e,r)=>{const o=r===v,w=o?i:void 0;return u(s,{flexDirection:"column",children:[u(s,{children:[n(t,{color:w,children:o?"▸ ":" "}),e.icon===void 0?void 0:u(t,{color:w,children:[e.icon," "]}),n(s,{flexGrow:1,flexShrink:1,minWidth:0,children:n(t,{bold:o,color:w,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:n(s,{flexShrink:0,children:u(t,{dimColor:!0,children:[" ",e.hotkey]})})]}),e.description===void 0?void 0:n(s,{marginLeft:2,children:n(t,{dimColor:!0,wrap:"truncate-end",children:e.description})})]},e.id)})})]})}k(E,"k");S(E,"CommandPalette");export{E as CommandPalette,E as default};
1
+ import{jsxs as a,jsx as n}from"react/jsx-runtime";import{useState as y,useRef as M,useMemo as T,useEffect as S,useCallback as F}from"react";import A from"../ink/hooks/use-focus.js";import D from"../ink/hooks/use-input.js";import{i as L}from"../packem_shared/input-utils-BSWCb4F_.js";import{Box as d}from"./box.js";import{Text as t}from"./text.js";const j=(m,f)=>{if(m.length===0)return 1;const p=[f.label,f.description??"",...f.keywords??[]].map(i=>i.toLowerCase()).filter(i=>i.length>0),h=m.toLowerCase();let s=0;for(const i of p){if(i.includes(h)){const u=i.indexOf(h);s=Math.max(s,100-u);continue}let x=0,g=0;for(const u of h){const c=i.indexOf(u,x);if(c===-1){g=0;break}g+=1,x=c+1}g===h.length&&(s=Math.max(s,20))}return s};function P({accentColor:m="cyan",autoFocus:f=!0,commands:p,emptyText:h="No results",limit:s=8,onCancel:i,onSelect:x,placeholder:g="Type a command or search..."}){const{isFocused:u}=A({autoFocus:f}),[c,v]=y(""),[w,C]=y(0),b=M(w);b.current=w;const l=T(()=>{const e=p.map(r=>({command:r,score:j(c,r)})).filter(({score:r})=>r>0);return e.sort((r,o)=>o.score-r.score),e.slice(0,s).map(({command:r})=>r)},[p,c,s]);return S(()=>{const e=Math.max(0,l.length-1);b.current>e&&(b.current=e,C(e))},[l]),D(F((e,r)=>{if(u){if(r.escape){i?.();return}if(r.downArrow){if(l.length===0)return;C(o=>Math.min(l.length-1,o+1));return}if(r.upArrow){C(o=>Math.max(0,o-1));return}if(r.return){const o=l[b.current];o&&x(o.id,c);return}if(r.backspace||r.delete){v(o=>o.slice(0,-1)),C(0);return}L(e,r)&&(v(o=>o+e),C(0))}},[u,l,c,x,i]),{isActive:u}),a(d,{borderColor:m,borderStyle:"round",flexDirection:"column",paddingX:1,children:[a(d,{children:[n(t,{color:m,children:"❯"}),a(t,{children:[" ",c.length===0?n(t,{dimColor:!0,children:g}):c]}),n(t,{inverse:!0,children:" "})]}),n(d,{marginTop:1,children:a(t,{dimColor:!0,children:[l.length," of ",p.length]})}),n(d,{flexDirection:"column",marginTop:1,children:l.length===0?n(t,{dimColor:!0,children:h}):l.map((e,r)=>{const o=r===w,k=o?m:void 0;return a(d,{flexDirection:"column",children:[a(d,{children:[n(t,{color:k,children:o?"▸ ":" "}),e.icon===void 0?void 0:a(t,{color:k,children:[e.icon," "]}),n(d,{flexGrow:1,flexShrink:1,minWidth:0,children:n(t,{bold:o,color:k,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:n(d,{flexShrink:0,children:a(t,{dimColor:!0,children:[" ",e.hotkey]})})]}),e.description===void 0?void 0:n(d,{marginLeft:2,children:n(t,{dimColor:!0,wrap:"truncate-end",children:e.description})})]},e.id)})})]})}export{P as CommandPalette,P as default};
@@ -1 +1 @@
1
- var D=Object.defineProperty;var s=(r,o)=>D(r,"name",{value:o,configurable:!0});import{jsxs as g,jsx as e}from"react/jsx-runtime";import{useState as A,useCallback as j}from"react";import B from"../ink/hooks/use-focus.js";import k from"../ink/hooks/use-input.js";import{Box as l}from"./box.js";import{Text as u}from"./text.js";var L=Object.defineProperty,p=s((r,o)=>L(r,"name",{value:o,configurable:!0}),"s");const S={danger:"red",info:"blue",warning:"yellow"},h=p(({color:r,isFocused:o,label:i})=>e(l,{backgroundColor:o?r:void 0,borderColor:o?r:void 0,borderStyle:"round",paddingX:1,children:e(u,{bold:o,color:o?"black":void 0,children:i})}),"ButtonLabel");function T({autoFocus:r=!0,cancelLabel:o="Cancel",children:i,confirmLabel:v="Confirm",defaultFocus:C="confirm",isDisabled:m=!1,onCancel:a,onConfirm:f,title:b,tone:y="info",width:x}){const[n,w]=A(C),t=S[y],{isFocused:F}=B({autoFocus:r,isActive:!m});return k(j((c,d)=>{if(d.leftArrow||d.rightArrow||c==="h"||c==="l"){w(n==="confirm"?"cancel":"confirm");return}if(d.return){n==="confirm"?f():a();return}if(d.escape||c==="n"){a();return}c==="y"&&f()},[n,f,a]),{isActive:!m&&F}),g(l,{borderColor:t,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:x,children:[b===void 0?void 0:e(l,{marginBottom:1,children:e(u,{bold:!0,color:t,children:b})}),i===void 0?void 0:e(l,{flexDirection:"column",marginBottom:1,children:typeof i=="string"?e(u,{children:i}):i}),g(l,{gap:2,justifyContent:"flex-end",children:[e(h,{color:t,isFocused:n==="cancel",label:o}),e(h,{color:t,isFocused:n==="confirm",label:v})]})]})}s(T,"g");p(T,"ConfirmDialog");export{T as ConfirmDialog,T as default};
1
+ import{jsxs as b,jsx as o}from"react/jsx-runtime";import{useState as w,useCallback as y}from"react";import k from"../ink/hooks/use-focus.js";import A from"../ink/hooks/use-input.js";import{Box as n}from"./box.js";import{Text as f}from"./text.js";const D={danger:"red",info:"blue",warning:"yellow"},p=({color:l,isFocused:r,label:i})=>o(n,{backgroundColor:r?l:void 0,borderColor:r?l:void 0,borderStyle:"round",paddingX:1,children:o(f,{bold:r,color:r?"black":void 0,children:i})});function X({autoFocus:l=!0,cancelLabel:r="Cancel",children:i,confirmLabel:h="Confirm",defaultFocus:g="confirm",isDisabled:u=!1,onCancel:a,onConfirm:s,title:m,tone:v="info",width:C}){const[e,x]=w(g),c=D[v],{isFocused:F}=k({autoFocus:l,isActive:!u});return A(y((t,d)=>{if(d.leftArrow||d.rightArrow||t==="h"||t==="l"){x(e==="confirm"?"cancel":"confirm");return}if(d.return){e==="confirm"?s():a();return}if(d.escape||t==="n"){a();return}t==="y"&&s()},[e,s,a]),{isActive:!u&&F}),b(n,{borderColor:c,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:C,children:[m===void 0?void 0:o(n,{marginBottom:1,children:o(f,{bold:!0,color:c,children:m})}),i===void 0?void 0:o(n,{flexDirection:"column",marginBottom:1,children:typeof i=="string"?o(f,{children:i}):i}),b(n,{gap:2,justifyContent:"flex-end",children:[o(p,{color:c,isFocused:e==="cancel",label:r}),o(p,{color:c,isFocused:e==="confirm",label:h})]})]})}export{X as ConfirmDialog,X as default};
@@ -1 +1 @@
1
- var m=Object.defineProperty;var t=(r,e)=>m(r,"name",{value:e,configurable:!0});import{jsx as l,jsxs as p}from"react/jsx-runtime";import{useRef as f,useCallback as C}from"react";import d from"../ink/hooks/use-input.js";import{Box as b}from"./box.js";import{Text as x}from"./text.js";var v=Object.defineProperty,y=t((r,e)=>v(r,"name",{value:e,configurable:!0}),"i");function h({defaultChoice:r="confirm",isDisabled:e=!1,onCancel:i,onConfirm:c,submitOnEnter:u=!0}){const n=f(c);n.current=c;const o=f(i);return o.current=i,d(C((a,s)=>{if(a.toLowerCase()==="y"){n.current();return}if(a.toLowerCase()==="n"){o.current();return}s.return&&u&&(r==="confirm"?n.current():o.current())},[u,r]),{isActive:!e}),l(b,{children:p(x,{dimColor:e,children:[r==="confirm"?"Y":"y","/",r==="cancel"?"N":"n"]})})}t(h,"s");y(h,"ConfirmInput");export{h as ConfirmInput,h as default};
1
+ import{jsx as m,jsxs as a}from"react/jsx-runtime";import{useRef as u,useCallback as l}from"react";import p from"../ink/hooks/use-input.js";import{Box as C}from"./box.js";import{Text as d}from"./text.js";function w({defaultChoice:r="confirm",isDisabled:o=!1,onCancel:t,onConfirm:i,submitOnEnter:c=!0}){const e=u(i);e.current=i;const n=u(t);return n.current=t,p(l((s,f)=>{if(s.toLowerCase()==="y"){e.current();return}if(s.toLowerCase()==="n"){n.current();return}f.return&&c&&(r==="confirm"?e.current():n.current())},[c,r]),{isActive:!o}),m(C,{children:a(d,{dimColor:o,children:[r==="confirm"?"Y":"y","/",r==="cancel"?"N":"n"]})})}export{w as ConfirmInput,w as default};
@@ -1 +1 @@
1
- var f=Object.defineProperty;var a=(e,r)=>f(e,"name",{value:r,configurable:!0});import{jsx as m,jsxs as s}from"react/jsx-runtime";import{useMemo as h}from"react";import v from"../ink/hooks/use-console-capture.js";import{Box as p}from"./box.js";import{Text as l}from"./text.js";var b=Object.defineProperty,u=a((e,r)=>b(e,"name",{value:r,configurable:!0}),"a");const w={debug:"gray",error:"red",info:"blue",log:"white",warn:"yellow"},x={debug:"DBG",error:"ERR",info:"INF",log:"LOG",warn:"WRN"},y=u(e=>{const r=new Date(e),t=String(r.getHours()).padStart(2,"0"),i=String(r.getMinutes()).padStart(2,"0"),n=String(r.getSeconds()).padStart(2,"0");return`${t}:${i}:${n}`},"formatTimestamp");function C({dock:e="bottom",filter:r,height:t=8,maxEntries:i=200,showLevel:n=!0,showTimestamp:g=!0}){const{entries:d}=v({filter:r,maxEntries:i}),c=h(()=>d.slice(-t),[d,t]);return m(p,{borderBottom:e==="top",borderBottomColor:"gray",borderTop:e==="bottom",borderTopColor:"gray",flexDirection:"column",height:t+1,children:c.length===0?m(l,{dimColor:!0,children:"Console output will appear here..."}):c.map(o=>s(p,{children:[g?s(l,{dimColor:!0,children:["[",y(o.timestamp),"]"," "]}):void 0,n?s(l,{color:w[o.level],children:[x[o.level]," "]}):void 0,m(l,{color:o.level==="error"?"red":o.level==="warn"?"yellow":void 0,children:o.message})]},o.id))})}a(C,"c");u(C,"ConsoleOverlay");export{C as ConsoleOverlay,C as default};
1
+ import{jsx as a,jsxs as d}from"react/jsx-runtime";import{useMemo as c}from"react";import g from"../ink/hooks/use-console-capture.js";import{Box as p}from"./box.js";import{Text as l}from"./text.js";const h={debug:"gray",error:"red",info:"blue",log:"white",warn:"yellow"},f={debug:"DBG",error:"ERR",info:"INF",log:"LOG",warn:"WRN"},b=t=>{const r=new Date(t),o=String(r.getHours()).padStart(2,"0"),i=String(r.getMinutes()).padStart(2,"0"),n=String(r.getSeconds()).padStart(2,"0");return`${o}:${i}:${n}`};function y({dock:t="bottom",filter:r,height:o=8,maxEntries:i=200,showLevel:n=!0,showTimestamp:u=!0}){const{entries:m}=g({filter:r,maxEntries:i}),s=c(()=>m.slice(-o),[m,o]);return a(p,{borderBottom:t==="top",borderBottomColor:"gray",borderTop:t==="bottom",borderTopColor:"gray",flexDirection:"column",height:o+1,children:s.length===0?a(l,{dimColor:!0,children:"Console output will appear here..."}):s.map(e=>d(p,{children:[u?d(l,{dimColor:!0,children:["[",b(e.timestamp),"]"," "]}):void 0,n?d(l,{color:h[e.level],children:[f[e.level]," "]}):void 0,a(l,{color:e.level==="error"?"red":e.level==="warn"?"yellow":void 0,children:e.message})]},e.id))})}export{y as ConsoleOverlay,y as default};
@@ -1 +1 @@
1
- var F=Object.defineProperty;var f=(i,n)=>F(i,"name",{value:n,configurable:!0});import{jsxs as h,jsx as g,Fragment as M}from"react/jsx-runtime";import{useState as j,useMemo as k,useCallback as b}from"react";import D from"../ink/hooks/use-focus.js";import S from"../ink/hooks/use-input.js";import{Box as v}from"./box.js";import{Text as y}from"./text.js";var I=Object.defineProperty,T=f((i,n)=>I(i,"name",{value:n,configurable:!0}),"g");function B({accentColor:i="blue",autoFocus:n=!1,defaultValue:C,isDisabled:l=!1,onChange:x,options:e,value:c}){const{isFocused:d}=D({autoFocus:n,isActive:!l}),w=C??e[0]?.id,[s,A]=j(w),u=c??s,t=k(()=>{if(u===void 0)return 0;const o=e.findIndex(r=>r.id===u);return Math.max(o,0)},[e,u]),m=b(o=>{const r=e[o];if(!r)return;const a=c??s;r.id!==a&&(c===void 0&&A(r.id),x?.(r.id))},[e,c,s,x]);S(b((o,r)=>{d&&(r.leftArrow||o==="h"?m(Math.max(0,t-1)):(r.rightArrow||o==="l")&&m(Math.min(e.length-1,t+1)))},[d,t,e.length,m]),{isActive:!l&&d});const p=e[t];return h(v,{flexDirection:"column",children:[g(v,{children:e.map((o,r)=>{const a=r===t;return h(y,{backgroundColor:a?i:void 0,color:a?"black":void 0,dimColor:l&&!a,children:[" ",o.icon===void 0?void 0:h(M,{children:[o.icon," "]}),o.label," "]},o.id)})}),p===void 0?void 0:g(v,{flexDirection:"column",marginTop:1,children:p.content})]})}f(B,"C");T(B,"ContentSwitcher");export{B as ContentSwitcher,B as default};
1
+ import{jsxs as u,jsx as v,Fragment as k}from"react/jsx-runtime";import{useState as w,useMemo as F,useCallback as p}from"react";import M from"../ink/hooks/use-focus.js";import D from"../ink/hooks/use-input.js";import{Box as m}from"./box.js";import{Text as j}from"./text.js";function $({accentColor:x="blue",autoFocus:g=!1,defaultValue:b,isDisabled:l=!1,onChange:f,options:r,value:t}){const{isFocused:a}=M({autoFocus:g,isActive:!l}),C=b??r[0]?.id,[c,A]=w(C),d=t??c,n=F(()=>{if(d===void 0)return 0;const o=r.findIndex(i=>i.id===d);return Math.max(o,0)},[r,d]),s=p(o=>{const i=r[o];if(!i)return;const e=t??c;i.id!==e&&(t===void 0&&A(i.id),f?.(i.id))},[r,t,c,f]);D(p((o,i)=>{a&&(i.leftArrow||o==="h"?s(Math.max(0,n-1)):(i.rightArrow||o==="l")&&s(Math.min(r.length-1,n+1)))},[a,n,r.length,s]),{isActive:!l&&a});const h=r[n];return u(m,{flexDirection:"column",children:[v(m,{children:r.map((o,i)=>{const e=i===n;return u(j,{backgroundColor:e?x:void 0,color:e?"black":void 0,dimColor:l&&!e,children:[" ",o.icon===void 0?void 0:u(k,{children:[o.icon," "]}),o.label," "]},o.id)})}),h===void 0?void 0:v(m,{flexDirection:"column",marginTop:1,children:h.content})]})}export{$ as ContentSwitcher,$ as default};
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode, Ref } from 'react';
2
2
  import { BoxProps as Props } from "./box.js";
3
3
  import 'type-fest';
4
- import "../packem_shared/dom.d-C1IxuLJ9.js";
4
+ import "../packem_shared/dom.d-B4kXbaVY.js";
5
5
  import 'yoga-layout';
6
6
  import "../packem_shared/cursor-helpers.d-BONB9tky.js";
7
7
  import '@visulima/colorize';
@@ -1 +1 @@
1
- import{C as r}from"../packem_shared/controlled-scroll-view-CcUS50jx.js";export{r as ControlledScrollView};
1
+ import{C as r}from"../packem_shared/controlled-scroll-view-t55HU9L8.js";export{r as ControlledScrollView};
@@ -1,6 +1,6 @@
1
1
  import React, { RefObject } from 'react';
2
2
  import { C as CursorShape } from "../packem_shared/cursor-helpers.d-BONB9tky.js";
3
- import { D as DOMElement } from "../packem_shared/dom.d-C1IxuLJ9.js";
3
+ import { D as DOMElement } from "../packem_shared/dom.d-B4kXbaVY.js";
4
4
  import 'yoga-layout';
5
5
  import '@visulima/colorize';
6
6
  import 'cli-boxes';
@@ -1 +1 @@
1
- var u=Object.defineProperty;var n=(e,r)=>u(e,"name",{value:r,configurable:!0});import{jsx as c}from"react/jsx-runtime";import{useMemo as f}from"react";var p=Object.defineProperty,m=n((e,r)=>p(e,"name",{value:r,configurable:!0}),"s");function l({anchorRef:e,shape:r,x:o=0,y:a=0}){const i=e??void 0,s=i===void 0&&o===0&&a===0,t=f(()=>({anchorRef:i,inline:s,shape:r,x:o,y:a}),[i,s,r,o,a]);return c("ink-cursor",{internal_cursor:t})}n(l,"u");m(l,"Cursor");export{l as Cursor,l as default};
1
+ import{jsx as a}from"react/jsx-runtime";import{useMemo as u}from"react";function p({anchorRef:i,shape:s,x:o=0,y:r=0}){const n=i??void 0,e=n===void 0&&o===0&&r===0,t=u(()=>({anchorRef:n,inline:e,shape:s,x:o,y:r}),[n,e,s,o,r]);return a("ink-cursor",{internal_cursor:t})}export{p as Cursor,p as default};
@@ -1 +1 @@
1
- var $=Object.defineProperty;var v=(e,r)=>$(e,"name",{value:r,configurable:!0});import{jsxs as b,jsx as t}from"react/jsx-runtime";import{useState as x,useCallback as h}from"react";import j from"../ink/hooks/use-focus.js";import C from"../ink/hooks/use-input.js";import{Box as l}from"./box.js";import{Calendar as V}from"./calendar.js";import{Text as n}from"./text.js";var B=Object.defineProperty,D=v((e,r)=>B(e,"name",{value:r,configurable:!0}),"y");const T=D(e=>{const r=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");return`${r}-${c}-${d}`},"defaultFormat");function E({accentColor:e="blue",autoFocus:r=!1,defaultValue:c,formatValue:d=T,isDisabled:u=!1,maxDate:S,minDate:F,onChange:g,placeholder:k="Pick a date",value:s}){const{isFocused:o}=j({autoFocus:r,isActive:!u}),[a,m]=x(!1),[y,A]=x(c),f=s??y;C(h((i,p)=>{!o||a||(p.return||i===" ")&&m(!0)},[o,a]),{isActive:!u&&o&&!a}),C(h((i,p)=>{p.escape&&m(!1)},[]),{isActive:!u&&o&&a});const P=h(i=>{s===void 0&&A(i),m(!1),g?.(i)},[s,g]);return b(l,{flexDirection:"column",children:[b(l,{borderColor:o?e:void 0,borderStyle:"round",paddingX:1,children:[t(n,{color:e,children:"📅 "}),f===void 0?t(n,{dimColor:!0,children:k}):t(n,{bold:!0,children:d(f)}),o&&!a?t(l,{marginLeft:1,children:t(n,{dimColor:!0,children:"(Enter to open)"})}):void 0]}),a?t(l,{marginTop:1,children:t(V,{accentColor:e,autoFocus:!0,defaultValue:f,maxDate:S,minDate:F,onSubmit:P})}):void 0]})}v(E,"S");D(E,"DatePicker");export{E as DatePicker,E as default};
1
+ import{jsxs as g,jsx as o}from"react/jsx-runtime";import{useState as C,useCallback as h}from"react";import $ from"../ink/hooks/use-focus.js";import b from"../ink/hooks/use-input.js";import{Box as i}from"./box.js";import{Calendar as T}from"./calendar.js";import{Text as l}from"./text.js";const V=e=>{const n=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");return`${n}-${c}-${d}`};function O({accentColor:e="blue",autoFocus:n=!1,defaultValue:c,formatValue:d=V,isDisabled:s=!1,maxDate:D,minDate:x,onChange:v,placeholder:S="Pick a date",value:u}){const{isFocused:r}=$({autoFocus:n,isActive:!s}),[t,m]=C(!1),[F,k]=C(c),f=u??F;b(h((a,p)=>{!r||t||(p.return||a===" ")&&m(!0)},[r,t]),{isActive:!s&&r&&!t}),b(h((a,p)=>{p.escape&&m(!1)},[]),{isActive:!s&&r&&t});const A=h(a=>{u===void 0&&k(a),m(!1),v?.(a)},[u,v]);return g(i,{flexDirection:"column",children:[g(i,{borderColor:r?e:void 0,borderStyle:"round",paddingX:1,children:[o(l,{color:e,children:"📅 "}),f===void 0?o(l,{dimColor:!0,children:S}):o(l,{bold:!0,children:d(f)}),r&&!t?o(i,{marginLeft:1,children:o(l,{dimColor:!0,children:"(Enter to open)"})}):void 0]}),t?o(i,{marginTop:1,children:o(T,{accentColor:e,autoFocus:!0,defaultValue:f,maxDate:D,minDate:x,onSubmit:A})}):void 0]})}export{O as DatePicker,O as default};
@@ -1 +1 @@
1
- var h=Object.defineProperty;var o=(l,r)=>h(l,"name",{value:r,configurable:!0});import{jsx as e,jsxs as m}from"react/jsx-runtime";import{Box as n}from"./box.js";import{Text as t}from"./text.js";var p=Object.defineProperty,s=o((l,r)=>p(l,"name",{value:r,configurable:!0}),"p");function u({columnGap:l=2,items:r,layout:a="inline",termColor:d="cyan",termWidth:f}){return a==="stacked"?e(n,{flexDirection:"column",gap:1,children:r.map((i,c)=>m(n,{flexDirection:"column",children:[e(t,{bold:!0,color:d,children:i.term}),e(t,{children:i.description})]},i.key??c))}):e(n,{flexDirection:"column",children:r.map((i,c)=>m(n,{gap:l,children:[e(n,{flexShrink:0,width:f,children:e(t,{color:d,children:i.term})}),e(n,{flexGrow:1,flexShrink:1,children:e(t,{children:i.description})})]},i.key??c))})}o(u,"c");s(u,"DefinitionList");export{u as DefinitionList,u as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Box as i}from"./box.js";import{Text as n}from"./text.js";function s({columnGap:d=2,items:t,layout:m="inline",termColor:c="cyan",termWidth:h}){return m==="stacked"?e(i,{flexDirection:"column",gap:1,children:t.map((r,l)=>o(i,{flexDirection:"column",children:[e(n,{bold:!0,color:c,children:r.term}),e(n,{children:r.description})]},r.key??l))}):e(i,{flexDirection:"column",children:t.map((r,l)=>o(i,{gap:d,children:[e(i,{flexShrink:0,width:h,children:e(n,{color:c,children:r.term})}),e(i,{flexGrow:1,flexShrink:1,children:e(n,{children:r.description})})]},r.key??l))})}export{s as DefinitionList,s as default};
@@ -5,7 +5,7 @@ import 'cli-boxes';
5
5
  import { b as ScrollViewRef } from "../packem_shared/scroll-view.d-DtpsgHLg.js";
6
6
  import "./box.js";
7
7
  import 'type-fest';
8
- import "../packem_shared/dom.d-C1IxuLJ9.js";
8
+ import "../packem_shared/dom.d-B4kXbaVY.js";
9
9
  import "../packem_shared/cursor-helpers.d-BONB9tky.js";
10
10
  import "../packem_shared/styles.d-cMo36xQz.js";
11
11
  type Props = {
@@ -1 +1 @@
1
- var M=Object.defineProperty;var f=(l,r)=>M(l,"name",{value:r,configurable:!0});import{jsx as o,jsxs as X}from"react/jsx-runtime";import{useRef as H}from"react";import I from"../ink/hooks/use-terminal-palette.js";import R from"../ink/hooks/use-window-size.js";import{Box as e}from"./box.js";import{Text as T}from"./text.js";import{ScrollView as V}from"../packem_shared/ScrollView-DKZ8OM-m.js";var Y=Object.defineProperty,q=f((l,r)=>Y(l,"name",{value:r,configurable:!0}),"b");const F=q(({backgroundColor:l,borderColor:r="cyan",borderStyle:g="round",children:b,columns:h,footer:d,maxHeight:n=.8,paddingX:i=2,paddingY:p=1,rows:x,scrollbarStyle:k="block",scrollRef:y,title:t,visible:C=!0,width:S=60})=>{const c=R(),{isLoading:w,palette:D}=I(),j=H(null),v=y??j;if(!C)return null;const m=h??(c.columns||80),a=x??(c.rows||24),s=l??(w?"black":D?.background??"black"),B=n<=1?Math.floor(a*n):Math.min(n,a-2),u=typeof t=="string"?o(e,{marginBottom:1,children:o(T,{bold:!0,color:r,children:t})}):t??null;return o(e,{alignItems:"center",height:a,justifyContent:"center",position:"absolute",width:m,children:X(e,{backgroundColor:s,borderBackgroundColor:s,borderColor:r,borderStyle:g,flexDirection:"column",maxHeight:B,opaque:!0,paddingY:p,width:Math.min(S,m-4),children:[u!=null&&o(e,{flexShrink:0,paddingX:i,children:u}),o(V,{flexGrow:1,flexShrink:1,paddingX:i,ref:v,scrollbar:!0,scrollbarColor:r,scrollbarStyle:k,children:b}),d!=null&&o(e,{alignItems:"center",flexDirection:"column",flexShrink:0,marginTop:1,paddingX:i,children:d})]})})},"Dialog");export{F as Dialog,F as default};
1
+ import{jsx as r,jsxs as j}from"react/jsx-runtime";import{useRef as M}from"react";import H from"../ink/hooks/use-terminal-palette.js";import I from"../ink/hooks/use-window-size.js";import{Box as o}from"./box.js";import{Text as R}from"./text.js";import{ScrollView as T}from"../packem_shared/ScrollView-BEgrtSnt.js";const A=({backgroundColor:u,borderColor:l="cyan",borderStyle:f="round",children:h,columns:g,footer:d,maxHeight:e=.8,paddingX:i=2,paddingY:p=1,rows:b,scrollbarStyle:x="block",scrollRef:k,title:n,visible:C=!0,width:S=60})=>{const c=I(),{isLoading:w,palette:y}=H(),B=M(null),D=k??B;if(!C)return null;const a=g??(c.columns||80),t=b??(c.rows||24),s=u??(w?"black":y?.background??"black"),X=e<=1?Math.floor(t*e):Math.min(e,t-2),m=typeof n=="string"?r(o,{marginBottom:1,children:r(R,{bold:!0,color:l,children:n})}):n??null;return r(o,{alignItems:"center",height:t,justifyContent:"center",position:"absolute",width:a,children:j(o,{backgroundColor:s,borderBackgroundColor:s,borderColor:l,borderStyle:f,flexDirection:"column",maxHeight:X,opaque:!0,paddingY:p,width:Math.min(S,a-4),children:[m!=null&&r(o,{flexShrink:0,paddingX:i,children:m}),r(T,{flexGrow:1,flexShrink:1,paddingX:i,ref:D,scrollbar:!0,scrollbarColor:l,scrollbarStyle:x,children:h}),d!=null&&r(o,{alignItems:"center",flexDirection:"column",flexShrink:0,marginTop:1,paddingX:i,children:d})]})})};export{A as Dialog,A as default};
@@ -1 +1 @@
1
- var M=Object.defineProperty;var v=(r,i)=>M(r,"name",{value:i,configurable:!0});import{jsx as u,jsxs as g,Fragment as $}from"react/jsx-runtime";import{createPatch as V,parsePatch as W,diffWords as j,diffChars as B}from"diff";import{useMemo as k,useState as U,useRef as q,useEffect as A}from"react";import{r as E,i as F,P as J,g as K,a as O}from"../packem_shared/token-to-elements-BAZpNZsu.js";import R from"../ink/hooks/use-window-size.js";import{Box as p}from"./box.js";import{Text as a}from"./text.js";var X=Object.defineProperty,x=v((r,i)=>X(r,"name",{value:i,configurable:!0}),"y");const L=x((r,i,n,d)=>{if(!i||n===void 0||n<1||n>i.length)return d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r});const o=i[n-1];return!o||o.length===0?d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r}):O(o)},"renderHighlightedContent"),S=x((r,i,n)=>{const[d,o]=U(null),h=q(!1);return A(()=>{if(h.current=!1,!i){o(null);return}const e=E(i);if(!F(e)){o(null);return}return(async()=>{try{const f=await J([e],n),l=K(f,r,e,n);h.current||o(l.tokens)}catch{h.current||o(null)}})(),()=>{h.current=!0}},[r,i,n]),d},"useHighlightedLines"),z=x((r,i,n="chars")=>{const d=W(r),o=[];for(const h of d)for(const e of h.hunks){const f=`@@ -${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines} @@`,l=[];let s=e.oldStart,c=e.newStart;for(const w of e.lines)w.startsWith("\\")||(w.startsWith("+")?l.push({content:w.slice(1),newLineNum:c++,type:"add"}):w.startsWith("-")?l.push({content:w.slice(1),oldLineNum:s++,type:"del"}):l.push({content:w.slice(1),newLineNum:c++,oldLineNum:s++,type:"context"}));if(i){const w=Q(l);for(const[N,t]of w)if(l[N].type==="del"&&l[t].type==="add"){const m=G(l[N].content,l[t].content,n);l[N].inlineDiff=m??void 0,l[N].pairedIndex=t,l[t].inlineDiff=m??void 0,l[t].pairedIndex=N}}o.push({header:f,lines:l})}return o},"parseDiffLines"),P=500,G=x((r,i,n="chars")=>{if(r.length>P||i.length>P)return null;const d=n==="words"?j(r,i):B(r,i),o=[],h=[];for(const e of d)e.removed?o.push({highlight:!0,value:e.value}):e.added?h.push({highlight:!0,value:e.value}):(o.push({highlight:!1,value:e.value}),h.push({highlight:!1,value:e.value}));return{addParts:h,delParts:o}},"computeInlineDiff"),C=x((r,i,n)=>u($,{children:r.map((d,o)=>d.highlight?u(a,{backgroundColor:n,color:"white",children:d.value},o):u(a,{color:i,children:d.value},o))}),"renderInlineParts"),Q=x(r=>{const i=new Map;let n=0;for(;n<r.length;){const d=n;for(;n<r.length&&r[n].type==="del";)n++;const o=n,h=n;for(;n<r.length&&r[n].type==="add";)n++;const e=n,f=o-d,l=e-h,s=Math.min(f,l);for(let c=0;c<s;c++)i.set(d+c,h+c),i.set(h+c,d+c);n===d&&n++}return i},"findInlinePairs");function H({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d}){return u(p,{flexDirection:"column",children:r.map((o,h)=>g(p,{flexDirection:"column",children:[h>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,u(a,{color:"cyan",dimColor:!0,children:o.header}),o.lines.map((e,f)=>{let l,s,c;switch(e.type){case"add":{s="+",c="green",l=e.inlineDiff?C(e.inlineDiff.addParts,"green","green"):L(e.content,i,e.newLineNum,"green");break}case"del":{s="-",c="red",l=e.inlineDiff?C(e.inlineDiff.delParts,"red","red"):L(e.content,n,e.oldLineNum,"red");break}default:{s=" ",c=void 0,l=L(e.content,n,e.oldLineNum);break}}return g(p,{children:[d?g(a,{color:c,dimColor:e.type==="context",children:[String(e.oldLineNum??"").padStart(4)," ",String(e.newLineNum??"").padStart(4)," "]}):void 0,u(a,{color:c,children:s}),l]},f)})]},h))})}v(H,"J");x(H,"UnifiedView");function I({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d,width:o}){const h=Math.floor(o/2)-1;return u(p,{flexDirection:"column",children:r.map((e,f)=>{const l=f>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,s=[],c=[];for(let N=0;N<e.lines.length;N++){const t=e.lines[N];switch(t.type){case"add":{t.pairedIndex===void 0&&(s.push({content:u(a,{dimColor:!0})}),c.push({content:L(t.content,i,t.newLineNum,"green"),lineNum:t.newLineNum}));break}case"context":{s.push({content:L(t.content,n,t.oldLineNum),lineNum:t.oldLineNum}),c.push({content:L(t.content,i,t.newLineNum),lineNum:t.newLineNum});break}case"del":{if(t.pairedIndex===void 0)s.push({content:L(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:u(a,{dimColor:!0})});else{const m=e.lines[t.pairedIndex];s.push({content:t.inlineDiff?C(t.inlineDiff.delParts,"red","red"):L(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:m.inlineDiff?C(m.inlineDiff.addParts,"green","green"):L(m.content,i,m.newLineNum,"green"),lineNum:m.newLineNum})}break}}}const w=Math.max(s.length,c.length);return g(p,{flexDirection:"column",children:[l,u(a,{color:"cyan",dimColor:!0,children:e.header}),Array.from({length:w},(N,t)=>{const m=s[t],D=c[t];return g(p,{flexDirection:"row",children:[g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(m?.lineNum??"").padStart(4)," "]}):void 0,m?.content]}),u(a,{dimColor:!0,children:"│"}),g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(D?.lineNum??"").padStart(4)," "]}):void 0,D?.content]})]},t)})]},f)})})}v(I,"K");x(I,"SplitView");function Y({context:r=3,diff:i,inlineDiff:n=!0,inlineDiffMode:d="chars",language:o,mode:h="unified",newLabel:e="new",newText:f="",oldLabel:l="old",oldText:s="",showLineNumbers:c=!0,theme:w="github-dark-default"}){const{columns:N}=R(),t=S(s,o,w),m=S(f,o,w),D=k(()=>i||V("file",s,f,l,e,{context:r}),[i,s,f,l,e,r]),b=k(()=>z(D,n,d),[D,n,d]);if(b.every(T=>T.lines.length===0))return u(p,{children:u(a,{dimColor:!0,children:"No differences found."})});const y=g(p,{flexDirection:"column",children:[g(a,{color:"red",dimColor:!0,children:["---"," ",l]}),g(a,{color:"green",dimColor:!0,children:["+++"," ",e]})]});return h==="split"?g(p,{flexDirection:"column",children:[y,u(I,{hunks:b,newHighlighted:m,oldHighlighted:t,showLineNumbers:c,width:N??80})]}):g(p,{flexDirection:"column",children:[y,u(H,{hunks:b,newHighlighted:m,oldHighlighted:t,showLineNumbers:c})]})}v(Y,"S");x(Y,"DiffView");export{Y as DiffView,Y as default};
1
+ import{jsx as u,jsxs as g,Fragment as P}from"react/jsx-runtime";import{createPatch as H,parsePatch as T,diffWords as I,diffChars as M}from"diff";import{useMemo as k,useState as W,useRef as B,useEffect as j}from"react";import{r as q,i as z,w as A,g as E,a as F}from"../packem_shared/token-to-elements-D6J6-P2A.js";import G from"../ink/hooks/use-window-size.js";import{Box as p}from"./box.js";import{Text as a}from"./text.js";const L=(r,i,n,d)=>{if(!i||n===void 0||n<1||n>i.length)return d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r});const o=i[n-1];return!o||o.length===0?d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r}):F(o)},y=(r,i,n)=>{const[d,o]=W(null),h=B(!1);return j(()=>{if(h.current=!1,!i){o(null);return}const e=q(i);if(!z(e)){o(null);return}return(async()=>{try{const f=await A([e],n),l=E(f,r,e,n);h.current||o(l.tokens)}catch{h.current||o(null)}})(),()=>{h.current=!0}},[r,i,n]),d},R=(r,i,n="chars")=>{const d=T(r),o=[];for(const h of d)for(const e of h.hunks){const f=`@@ -${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines} @@`,l=[];let s=e.oldStart,c=e.newStart;for(const w of e.lines)w.startsWith("\\")||(w.startsWith("+")?l.push({content:w.slice(1),newLineNum:c++,type:"add"}):w.startsWith("-")?l.push({content:w.slice(1),oldLineNum:s++,type:"del"}):l.push({content:w.slice(1),newLineNum:c++,oldLineNum:s++,type:"context"}));if(i){const w=V(l);for(const[N,t]of w)if(l[N].type==="del"&&l[t].type==="add"){const m=U(l[N].content,l[t].content,n);l[N].inlineDiff=m??void 0,l[N].pairedIndex=t,l[t].inlineDiff=m??void 0,l[t].pairedIndex=N}}o.push({header:f,lines:l})}return o},b=500,U=(r,i,n="chars")=>{if(r.length>b||i.length>b)return null;const d=n==="words"?I(r,i):M(r,i),o=[],h=[];for(const e of d)e.removed?o.push({highlight:!0,value:e.value}):e.added?h.push({highlight:!0,value:e.value}):(o.push({highlight:!1,value:e.value}),h.push({highlight:!1,value:e.value}));return{addParts:h,delParts:o}},D=(r,i,n)=>u(P,{children:r.map((d,o)=>d.highlight?u(a,{backgroundColor:n,color:"white",children:d.value},o):u(a,{color:i,children:d.value},o))}),V=r=>{const i=new Map;let n=0;for(;n<r.length;){const d=n;for(;n<r.length&&r[n].type==="del";)n++;const o=n,h=n;for(;n<r.length&&r[n].type==="add";)n++;const e=n,f=o-d,l=e-h,s=Math.min(f,l);for(let c=0;c<s;c++)i.set(d+c,h+c),i.set(h+c,d+c);n===d&&n++}return i};function X({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d}){return u(p,{flexDirection:"column",children:r.map((o,h)=>g(p,{flexDirection:"column",children:[h>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,u(a,{color:"cyan",dimColor:!0,children:o.header}),o.lines.map((e,f)=>{let l,s,c;switch(e.type){case"add":{s="+",c="green",l=e.inlineDiff?D(e.inlineDiff.addParts,"green","green"):L(e.content,i,e.newLineNum,"green");break}case"del":{s="-",c="red",l=e.inlineDiff?D(e.inlineDiff.delParts,"red","red"):L(e.content,n,e.oldLineNum,"red");break}default:{s=" ",c=void 0,l=L(e.content,n,e.oldLineNum);break}}return g(p,{children:[d?g(a,{color:c,dimColor:e.type==="context",children:[String(e.oldLineNum??"").padStart(4)," ",String(e.newLineNum??"").padStart(4)," "]}):void 0,u(a,{color:c,children:s}),l]},f)})]},h))})}function J({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d,width:o}){const h=Math.floor(o/2)-1;return u(p,{flexDirection:"column",children:r.map((e,f)=>{const l=f>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,s=[],c=[];for(let N=0;N<e.lines.length;N++){const t=e.lines[N];switch(t.type){case"add":{t.pairedIndex===void 0&&(s.push({content:u(a,{dimColor:!0})}),c.push({content:L(t.content,i,t.newLineNum,"green"),lineNum:t.newLineNum}));break}case"context":{s.push({content:L(t.content,n,t.oldLineNum),lineNum:t.oldLineNum}),c.push({content:L(t.content,i,t.newLineNum),lineNum:t.newLineNum});break}case"del":{if(t.pairedIndex===void 0)s.push({content:L(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:u(a,{dimColor:!0})});else{const m=e.lines[t.pairedIndex];s.push({content:t.inlineDiff?D(t.inlineDiff.delParts,"red","red"):L(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:m.inlineDiff?D(m.inlineDiff.addParts,"green","green"):L(m.content,i,m.newLineNum,"green"),lineNum:m.newLineNum})}break}}}const w=Math.max(s.length,c.length);return g(p,{flexDirection:"column",children:[l,u(a,{color:"cyan",dimColor:!0,children:e.header}),Array.from({length:w},(N,t)=>{const m=s[t],x=c[t];return g(p,{flexDirection:"row",children:[g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(m?.lineNum??"").padStart(4)," "]}):void 0,m?.content]}),u(a,{dimColor:!0,children:"│"}),g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(x?.lineNum??"").padStart(4)," "]}):void 0,x?.content]})]},t)})]},f)})})}function ee({context:r=3,diff:i,inlineDiff:n=!0,inlineDiffMode:d="chars",language:o,mode:h="unified",newLabel:e="new",newText:f="",oldLabel:l="old",oldText:s="",showLineNumbers:c=!0,theme:w="github-dark-default"}){const{columns:N}=G(),t=y(s,o,w),m=y(f,o,w),x=k(()=>i||H("file",s,f,l,e,{context:r}),[i,s,f,l,e,r]),v=k(()=>R(x,n,d),[x,n,d]);if(v.every(S=>S.lines.length===0))return u(p,{children:u(a,{dimColor:!0,children:"No differences found."})});const C=g(p,{flexDirection:"column",children:[g(a,{color:"red",dimColor:!0,children:["---"," ",l]}),g(a,{color:"green",dimColor:!0,children:["+++"," ",e]})]});return h==="split"?g(p,{flexDirection:"column",children:[C,u(J,{hunks:v,newHighlighted:m,oldHighlighted:t,showLineNumbers:c,width:N??80})]}):g(p,{flexDirection:"column",children:[C,u(X,{hunks:v,newHighlighted:m,oldHighlighted:t,showLineNumbers:c})]})}export{ee as DiffView,ee as default};