@visulima/tui 1.0.0-alpha.6 → 1.0.0-alpha.7

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 (412) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/core/index.js +1 -5
  3. package/dist/ink/index.d.ts +15 -34
  4. package/dist/ink/index.js +1 -155
  5. package/dist/packem_chunks/devtools.js +3 -26
  6. package/dist/packem_shared/Accordion-BXsqchV-.js +1 -0
  7. package/dist/packem_shared/Alert-BhYVMHtR.js +1 -0
  8. package/dist/packem_shared/AnimatePresence-Eu7Z8KHc.js +1 -0
  9. package/dist/packem_shared/ApprovalPrompt-BSn0FT1g.js +1 -0
  10. package/dist/packem_shared/AreaChart-Chy-frI7.js +1 -0
  11. package/dist/packem_shared/Badge-B8WPyRsK.js +1 -0
  12. package/dist/packem_shared/BarChart-rpZtlMcF.js +1 -0
  13. package/dist/packem_shared/BigText-CRpwUzrt.js +1 -0
  14. package/dist/packem_shared/BlinkDot-BvnRuWP8.js +1 -0
  15. package/dist/packem_shared/Box-BwqSvWuq.js +1 -0
  16. package/dist/packem_shared/Breadcrumb-D0hClbRV.js +1 -0
  17. package/dist/packem_shared/Button-B89Yvbc6.js +1 -0
  18. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +1 -0
  19. package/dist/packem_shared/Calendar-Dmflvm2S.js +1 -0
  20. package/dist/packem_shared/Canvas-CKg6WV47.js +1 -0
  21. package/dist/packem_shared/Card-B_9fXdtU.js +1 -0
  22. package/dist/packem_shared/Cell-BrXn3jxY.js +1 -0
  23. package/dist/packem_shared/Checkbox-BN71eCWU.js +1 -0
  24. package/dist/packem_shared/Code-HhevcyiH.js +2 -0
  25. package/dist/packem_shared/Collapsible-u6uf_FdV.js +1 -0
  26. package/dist/packem_shared/CommandBlock-B-nslpCv.js +4 -0
  27. package/dist/packem_shared/CommandPalette-CEFdaURo.js +1 -0
  28. package/dist/packem_shared/ConfirmDialog-5Jje_Xpu.js +1 -0
  29. package/dist/packem_shared/ConfirmInput-D44Mb9oo.js +1 -0
  30. package/dist/packem_shared/ConsoleOverlay-CM3APfgP.js +1 -0
  31. package/dist/packem_shared/ContentSwitcher-Dm5BkrCt.js +1 -0
  32. package/dist/packem_shared/ControlledScrollView-DI8KZOQB.js +1 -0
  33. package/dist/packem_shared/Cursor-BoLFIMol.js +1 -0
  34. package/dist/packem_shared/DatePicker-CnSrFFAE.js +1 -0
  35. package/dist/packem_shared/DefinitionList-v8RDuF_R.js +1 -0
  36. package/dist/packem_shared/DevTools-O8EbCfHa.js +1 -0
  37. package/dist/packem_shared/Dialog-CTaL8pn0.js +1 -0
  38. package/dist/packem_shared/DiffView-BUIFqUB0.js +1 -0
  39. package/dist/packem_shared/Divider-C47bKmqu.js +1 -0
  40. package/dist/packem_shared/FilePicker-CUo7R5Qb.js +1 -0
  41. package/dist/packem_shared/FocusContext-Xy0cwJpO.js +1 -0
  42. package/dist/packem_shared/FormField-af3aUpRL.js +1 -0
  43. package/dist/packem_shared/Fullscreen-CuJ8y0s0.js +1 -0
  44. package/dist/packem_shared/Gauge-Dz-usH__.js +1 -0
  45. package/dist/packem_shared/Gradient-DYNc0GZA.js +1 -0
  46. package/dist/packem_shared/Heading-mwEYza3Y.js +1 -0
  47. package/dist/packem_shared/Heatmap-ChL97U1-.js +1 -0
  48. package/dist/packem_shared/Help-Zcelyw_U.js +1 -0
  49. package/dist/packem_shared/Histogram-FIf2F83d.js +1 -0
  50. package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +1 -0
  51. package/dist/packem_shared/InputParser-rZKjY_7Y.js +2 -0
  52. package/dist/packem_shared/KEY-Bk8B-3h_.js +1 -0
  53. package/dist/packem_shared/Kbd-DpkPp4jB.js +1 -0
  54. package/dist/packem_shared/LayoutNode-rxblE317.js +1 -0
  55. package/dist/packem_shared/LineChart-BXE_girm.js +1 -0
  56. package/dist/packem_shared/Link-i2o2EG4-.js +1 -0
  57. package/dist/packem_shared/LoadingIndicator-TC1Fjwyt.js +1 -0
  58. package/dist/packem_shared/Markdown-R1XqK63D.js +1 -0
  59. package/dist/packem_shared/MaskedInput-J01phOZs.js +1 -0
  60. package/dist/packem_shared/Menu-CfrH4ymk.js +1 -0
  61. package/dist/packem_shared/MessageBubble-BmBBU2Rm.js +1 -0
  62. package/dist/packem_shared/ModelBadge-D3wrXncu.js +1 -0
  63. package/dist/packem_shared/MouseProvider-pjza-lpc.js +1 -0
  64. package/dist/packem_shared/MultiSelect-Dqmn-bVo.js +1 -0
  65. package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +1 -0
  66. package/dist/packem_shared/Newline-BSG4iUqp.js +2 -0
  67. package/dist/packem_shared/OperationTree-DksxjMIV.js +1 -0
  68. package/dist/packem_shared/OptionList-CNx7r9yN.js +1 -0
  69. package/dist/packem_shared/OrderedList-BeDy035w.js +1 -0
  70. package/dist/packem_shared/Paginator-B56s6bhS.js +1 -0
  71. package/dist/packem_shared/Paragraph-BqJlH0R-.js +1 -0
  72. package/dist/packem_shared/Placeholder-GMpHRGC8.js +1 -0
  73. package/dist/packem_shared/ProgressBar-Bj3fmORR.js +1 -0
  74. package/dist/packem_shared/RadioGroup-Br8BeEwS.js +1 -0
  75. package/dist/packem_shared/Renderer-DJXooAsp.js +1 -0
  76. package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +1 -0
  77. package/dist/packem_shared/ScatterPlot-OhfYco5l.js +1 -0
  78. package/dist/packem_shared/ScrollBar-Da5Y3z7N.js +1 -0
  79. package/dist/packem_shared/ScrollBarBox-Dz6F-Eat.js +1 -0
  80. package/dist/packem_shared/ScrollList-DiVGyEjv.js +1 -0
  81. package/dist/packem_shared/ScrollView-BojONotI.js +1 -0
  82. package/dist/packem_shared/SearchInput-BoPTRbhV.js +1 -0
  83. package/dist/packem_shared/SelectInput-CAJ7SCBq.js +1 -0
  84. package/dist/packem_shared/SelectInputIndicator-N1n8ULHs.js +1 -0
  85. package/dist/packem_shared/SelectInputItem-BEkbmobs.js +1 -0
  86. package/dist/packem_shared/ShimmerText-CuGQ2NDC.js +1 -0
  87. package/dist/packem_shared/Slider-Cg_tJpKa.js +1 -0
  88. package/dist/packem_shared/Spacer-eT3HOrXk.js +1 -0
  89. package/dist/packem_shared/Sparkline-T6_FPVET.js +1 -0
  90. package/dist/packem_shared/Spinner-B0-A50pu.js +1 -0
  91. package/dist/packem_shared/Static-DLynr5pn.js +1 -0
  92. package/dist/packem_shared/Static-jzLPaHJF.js +1 -0
  93. package/dist/packem_shared/StaticRender-BgD61E7x.js +1 -0
  94. package/dist/packem_shared/StatusLine-Ch4jjef1.js +1 -0
  95. package/dist/packem_shared/StatusMessage-B1qfKeMM.js +1 -0
  96. package/dist/packem_shared/Stepper-CNPAqxiU.js +1 -0
  97. package/dist/packem_shared/Stopwatch-CAx2EWwq.js +1 -0
  98. package/dist/packem_shared/StreamingText-BYOKSB2T.js +1 -0
  99. package/dist/packem_shared/Switch-DzSpKYu7.js +1 -0
  100. package/dist/packem_shared/Tab-BcXzSUdj.js +1 -0
  101. package/dist/packem_shared/Table-DJp1TLrR.js +1 -0
  102. package/dist/packem_shared/Tabs-D68z0SOt.js +1 -0
  103. package/dist/packem_shared/Tag-BvLHnYRn.js +1 -0
  104. package/dist/packem_shared/Text-mTAve9R2.js +1 -0
  105. package/dist/packem_shared/TextInput-C_gYQlnF.js +1 -0
  106. package/dist/packem_shared/Textarea-C2ET_oMb.js +2 -0
  107. package/dist/packem_shared/Timer-CI3aQX65.js +1 -0
  108. package/dist/packem_shared/Toast-Drvc8XfG.js +1 -0
  109. package/dist/packem_shared/Tooltip-C5UnQlLd.js +1 -0
  110. package/dist/packem_shared/Transform-fYmcdqRT.js +1 -0
  111. package/dist/packem_shared/Transition-CJDBKYUB.js +1 -0
  112. package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +1 -0
  113. package/dist/packem_shared/TreeView-DjhacGJ5.js +1 -0
  114. package/dist/packem_shared/TuiApp-DrjI_i-R.js +1 -0
  115. package/dist/packem_shared/TuiContext-BoJvG3NN.js +3 -0
  116. package/dist/packem_shared/UnorderedList-BnfqexZs.js +1 -0
  117. package/dist/packem_shared/accessibility-context-DDyHTwmA.js +1 -0
  118. package/dist/packem_shared/animation-context-DW3p-vpk.js +1 -0
  119. package/dist/packem_shared/ansi-parser-B6uXaq65.js +1 -0
  120. package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +1 -0
  121. package/dist/packem_shared/app-context-BVpKlG1z.js +1 -0
  122. package/dist/packem_shared/background-context-rjOaWFki.js +1 -0
  123. package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
  124. package/dist/packem_shared/braille-BBjIoaN0.js +1 -0
  125. package/dist/packem_shared/colorize-DbTZMrJO.js +1 -0
  126. package/dist/packem_shared/comparePoints-C85EsmNz.js +1 -0
  127. package/dist/packem_shared/controlled-scroll-view-CmrAEvJk.js +1 -0
  128. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +2 -0
  129. package/dist/packem_shared/createLinkedScrollGroup-BMTJ7rAj.js +1 -0
  130. package/dist/packem_shared/createMemoryStorage-QVZNXbWz.js +2 -0
  131. package/dist/packem_shared/createScreen-CrLrxA6t.js +3 -0
  132. package/dist/packem_shared/cursor-context-CFviBqPX.js +1 -0
  133. package/dist/packem_shared/dom-4y__5fWB.js +1 -0
  134. package/dist/packem_shared/focus-context-CsT69klR.js +1 -0
  135. package/dist/packem_shared/format-time-C7Q-hQZq.js +1 -0
  136. package/dist/packem_shared/getPathToRoot-B2tKmx3i.js +1 -0
  137. package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +1 -0
  138. package/dist/packem_shared/input-utils-fAxzSlNh.js +1 -0
  139. package/dist/packem_shared/isIntersecting-B3KbKTmu.js +1 -0
  140. package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +1 -0
  141. package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +1 -0
  142. package/dist/packem_shared/kittyFlags-C3rZLbcK.js +1 -0
  143. package/dist/packem_shared/line-chart-DrM8PwnI.js +1 -0
  144. package/dist/packem_shared/measure-element-DSp7YDus.js +2 -0
  145. package/dist/packem_shared/measure-text-DDjHT1jD.js +3 -0
  146. package/dist/packem_shared/measureElement-DA8WqFP_.js +1 -0
  147. package/dist/packem_shared/mouse-context-DaARgUu1.js +1 -0
  148. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +1 -0
  149. package/dist/packem_shared/processLayout-DXDfFb_d.js +1 -0
  150. package/dist/packem_shared/reconciler-BuOP-TZ6.js +1 -0
  151. package/dist/packem_shared/reconciler-DSYCrIZs.js +1 -0
  152. package/dist/packem_shared/render-DDqtMAFN.js +1 -0
  153. package/dist/packem_shared/render-_r0K9K11.js +28 -0
  154. package/dist/packem_shared/renderToString-DeqOWRP8.js +4 -0
  155. package/dist/packem_shared/renderToString-IYYPyASm.js +2 -0
  156. package/dist/packem_shared/renderTreeToBuffer-DPkoCgP2.js +2 -0
  157. package/dist/packem_shared/renderer-D2p6av2X.js +17 -0
  158. package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +1 -0
  159. package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.js +1 -0
  160. package/dist/packem_shared/stderr-context-BzEaUICS.js +1 -0
  161. package/dist/packem_shared/stdin-context-BTaaFagk.js +1 -0
  162. package/dist/packem_shared/stdout-context-BnblEPez.js +1 -0
  163. package/dist/packem_shared/text-width-CZ9vPvM0.js +2 -0
  164. package/dist/packem_shared/token-to-elements-BYxT6J_Q.js +1 -0
  165. package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +1 -0
  166. package/dist/packem_shared/useAnimation-B9we6ZzL.js +1 -0
  167. package/dist/packem_shared/useApp-B6fvM42d.js +1 -0
  168. package/dist/packem_shared/useBoxMetrics-D5pkIr6P.js +1 -0
  169. package/dist/packem_shared/useClipboard-CBxy0hT8.js +1 -0
  170. package/dist/packem_shared/useColorBlindness-BvWcu2Bb.js +1 -0
  171. package/dist/packem_shared/useConsoleCapture-BxiG8iLJ.js +1 -0
  172. package/dist/packem_shared/useCursor-CPu8T5Db.js +1 -0
  173. package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +1 -0
  174. package/dist/packem_shared/useFocus-DSmziO_x.js +1 -0
  175. package/dist/packem_shared/useFocusManager-Uapn3LQo.js +1 -0
  176. package/dist/packem_shared/useForm-CzV-Oext.js +1 -0
  177. package/dist/packem_shared/useHotkey-D0dGey14.js +1 -0
  178. package/dist/packem_shared/useInput-D1_jG26Z.js +2 -0
  179. package/dist/packem_shared/useInterval-AobjZT3u.js +1 -0
  180. package/dist/packem_shared/useIsScreenReaderEnabled-DjWHh-II.js +1 -0
  181. package/dist/packem_shared/useKeyBindings-zabkEJQs.js +1 -0
  182. package/dist/packem_shared/useKeyChord-CICQIxXj.js +1 -0
  183. package/dist/packem_shared/useMouseAction-2dRfU1vE.js +1 -0
  184. package/dist/packem_shared/useMouseContext-C746G7kY.js +1 -0
  185. package/dist/packem_shared/useMousePosition-BTWfV4JK.js +1 -0
  186. package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +1 -0
  187. package/dist/packem_shared/useOnMouseHover-D3DczIol.js +1 -0
  188. package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +1 -0
  189. package/dist/packem_shared/usePaste-CKKB9H-Z.js +1 -0
  190. package/dist/packem_shared/useScrollAcceleration-NrY1oVMs.js +1 -0
  191. package/dist/packem_shared/useScrollInput-Caghtn-Q.js +1 -0
  192. package/dist/packem_shared/useStderr-BDZb6InG.js +1 -0
  193. package/dist/packem_shared/useStdin-DKa4h35k.js +1 -0
  194. package/dist/packem_shared/useStdout-B-2lX4C5.js +1 -0
  195. package/dist/packem_shared/useStopwatch-DffK7iMh.js +1 -0
  196. package/dist/packem_shared/useTerminalPalette-Cv7tSduR.js +1 -0
  197. package/dist/packem_shared/useTextBuffer-DekkGLxI.js +4 -0
  198. package/dist/packem_shared/useTextSelection-CGT0GLDR.js +1 -0
  199. package/dist/packem_shared/useTimeout-7LEFYTnG.js +1 -0
  200. package/dist/packem_shared/useTimer-DyoqSyGi.js +1 -0
  201. package/dist/packem_shared/useTreeView-8UlTK6sW.js +1 -0
  202. package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +1 -0
  203. package/dist/packem_shared/useWindowSize-yDZsXF8z.js +1 -0
  204. package/dist/packem_shared/utils-THUhYKG2.js +1 -0
  205. package/dist/packem_shared/variant-config-BJqpNo7H.js +1 -0
  206. package/dist/packem_shared/waitFor-Dj5zfL5s.js +4 -0
  207. package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +3 -0
  208. package/dist/react/index.js +1 -9
  209. package/dist/testing/index.js +1 -152
  210. package/package.json +9 -9
  211. package/dist/packem_shared/Accordion-BG-yfIkV.js +0 -80
  212. package/dist/packem_shared/Alert-BLcwIW8V.js +0 -17
  213. package/dist/packem_shared/AnimatePresence-D8nEOr_B.js +0 -98
  214. package/dist/packem_shared/ApprovalPrompt-BXdPros1.js +0 -104
  215. package/dist/packem_shared/AreaChart-CmTcxLum.js +0 -116
  216. package/dist/packem_shared/Badge-CUfbXwAB.js +0 -13
  217. package/dist/packem_shared/BarChart-DWRae67P.js +0 -87
  218. package/dist/packem_shared/BigText-CVq2X7B5.js +0 -24
  219. package/dist/packem_shared/BlinkDot-CrbHMR3L.js +0 -11
  220. package/dist/packem_shared/Box-W1w_NGin.js +0 -71
  221. package/dist/packem_shared/Breadcrumb-CPdNxVYs.js +0 -26
  222. package/dist/packem_shared/Button-CBmTbJ_D.js +0 -57
  223. package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-BsMy5Ewl.js +0 -81
  224. package/dist/packem_shared/Calendar-C2Qxt-LA.js +0 -139
  225. package/dist/packem_shared/Canvas-COttmLPX.js +0 -246
  226. package/dist/packem_shared/Card-D3tGkNCm.js +0 -24
  227. package/dist/packem_shared/Cell-DCg1kJY-.js +0 -48
  228. package/dist/packem_shared/Checkbox-Dpy_4Lws.js +0 -49
  229. package/dist/packem_shared/Code-CwzzbsLx.js +0 -53
  230. package/dist/packem_shared/Collapsible-BMDrXf5C.js +0 -45
  231. package/dist/packem_shared/CommandBlock-jdOGJPjY.js +0 -80
  232. package/dist/packem_shared/CommandPalette-B5IfUQwi.js +0 -146
  233. package/dist/packem_shared/ConfirmDialog-5XJv3Cc4.js +0 -67
  234. package/dist/packem_shared/ConfirmInput-CxUS0XAA.js +0 -44
  235. package/dist/packem_shared/ConsoleOverlay-BvnCEgjG.js +0 -57
  236. package/dist/packem_shared/ContentSwitcher-BHFpO5Za.js +0 -81
  237. package/dist/packem_shared/ControlledScrollView-C2wOOlJO.js +0 -5
  238. package/dist/packem_shared/Cursor-DiW7YoSK.js +0 -18
  239. package/dist/packem_shared/DatePicker-CPejKoqS.js +0 -73
  240. package/dist/packem_shared/DefinitionList-BAwr0l5J.js +0 -18
  241. package/dist/packem_shared/DevTools-BdxRSkhL.js +0 -63
  242. package/dist/packem_shared/Dialog-S9r7Izff.js +0 -71
  243. package/dist/packem_shared/DiffView-BR4T6-Sj.js +0 -329
  244. package/dist/packem_shared/Divider-DocXIqNn.js +0 -30
  245. package/dist/packem_shared/FilePicker-BZ55oF_n.js +0 -261
  246. package/dist/packem_shared/FocusContext-D5wFxSRz.js +0 -153
  247. package/dist/packem_shared/FormField-BSG16cnA.js +0 -29
  248. package/dist/packem_shared/Fullscreen-DO7voOq5.js +0 -11
  249. package/dist/packem_shared/Gauge-CKXUXxft.js +0 -122
  250. package/dist/packem_shared/Gradient-Dg0NezWc.js +0 -136
  251. package/dist/packem_shared/Heading-BnR7McmP.js +0 -29
  252. package/dist/packem_shared/Heatmap-_jqISOU0.js +0 -79
  253. package/dist/packem_shared/Help-0yZ_IcQg.js +0 -105
  254. package/dist/packem_shared/Histogram-CB6XcmZW.js +0 -92
  255. package/dist/packem_shared/IMECompositionBuffer-Dl3S0KnF.js +0 -55
  256. package/dist/packem_shared/InputParser-BlsfeY9J.js +0 -158
  257. package/dist/packem_shared/KEY-STOdi-nc.js +0 -74
  258. package/dist/packem_shared/Kbd-BNDXQgey.js +0 -19
  259. package/dist/packem_shared/LayoutNode-DAkKg9TE.js +0 -129
  260. package/dist/packem_shared/LineChart-ef3HF816.js +0 -7
  261. package/dist/packem_shared/Link-DZ2Tiq1m.js +0 -66
  262. package/dist/packem_shared/LoadingIndicator-DzbLGfyJ.js +0 -13
  263. package/dist/packem_shared/Markdown-33bpCUoe.js +0 -212
  264. package/dist/packem_shared/MaskedInput-Ctr6v2dO.js +0 -119
  265. package/dist/packem_shared/Menu-CeKxhEix.js +0 -112
  266. package/dist/packem_shared/MessageBubble-BMoU8L2Q.js +0 -26
  267. package/dist/packem_shared/ModelBadge-CNIxPs7v.js +0 -40
  268. package/dist/packem_shared/MouseProvider-CekPbXCh.js +0 -136
  269. package/dist/packem_shared/MultiSelect-yz7-w0Zv.js +0 -129
  270. package/dist/packem_shared/NAMED_COLORS-DcI3erCu.js +0 -300
  271. package/dist/packem_shared/Newline-DBtYEg8x.js +0 -7
  272. package/dist/packem_shared/OperationTree-Dudx5o1o.js +0 -67
  273. package/dist/packem_shared/OptionList-CTyqQaZ1.js +0 -24
  274. package/dist/packem_shared/OrderedList-VsvSmHUC.js +0 -26
  275. package/dist/packem_shared/Paginator-DmGogvEI.js +0 -104
  276. package/dist/packem_shared/Paragraph-CNNhfepo.js +0 -9
  277. package/dist/packem_shared/Placeholder-DkM69Q8Z.js +0 -29
  278. package/dist/packem_shared/ProgressBar-B7cS4uQm.js +0 -22
  279. package/dist/packem_shared/RadioGroup-B4F9PUyL.js +0 -108
  280. package/dist/packem_shared/Renderer-zZ5O3vxc.js +0 -31
  281. package/dist/packem_shared/ResizeObserverEntry-Vr8GZ74x.js +0 -102
  282. package/dist/packem_shared/ScatterPlot-CWOg4G5h.js +0 -63
  283. package/dist/packem_shared/ScrollBar-DFeWH43I.js +0 -106
  284. package/dist/packem_shared/ScrollBarBox-C7VL6Izd.js +0 -72
  285. package/dist/packem_shared/ScrollList-DRcr_RrN.js +0 -227
  286. package/dist/packem_shared/ScrollView-C6rdlGwU.js +0 -196
  287. package/dist/packem_shared/SearchInput-cB8zFhSg.js +0 -32
  288. package/dist/packem_shared/SelectInput-WzZSqp72.js +0 -260
  289. package/dist/packem_shared/SelectInputIndicator-DKeN6v5Z.js +0 -9
  290. package/dist/packem_shared/SelectInputItem-CxFL3spM.js +0 -8
  291. package/dist/packem_shared/ShimmerText-B2VbPUSB.js +0 -34
  292. package/dist/packem_shared/Slider-BOrNTOQe.js +0 -116
  293. package/dist/packem_shared/Spacer-DhmXyTb8.js +0 -8
  294. package/dist/packem_shared/Sparkline-BSbjPrwK.js +0 -44
  295. package/dist/packem_shared/Spinner-BcO5BCAa.js +0 -1942
  296. package/dist/packem_shared/Static-DpTd6Eed.js +0 -22
  297. package/dist/packem_shared/Static-xmD9giJj.js +0 -18
  298. package/dist/packem_shared/StaticRender-C3XWvJdC.js +0 -69
  299. package/dist/packem_shared/StatusLine-DQNUstN9.js +0 -22
  300. package/dist/packem_shared/StatusMessage-BYTL6Pl-.js +0 -14
  301. package/dist/packem_shared/Stepper-CmUPRK3z.js +0 -60
  302. package/dist/packem_shared/Stopwatch-zqLQAxXC.js +0 -21
  303. package/dist/packem_shared/StreamingText-BmuoJtGu.js +0 -38
  304. package/dist/packem_shared/Switch-DcPdy8nm.js +0 -59
  305. package/dist/packem_shared/Tab-C6r5q4hR.js +0 -7
  306. package/dist/packem_shared/Table-Bgxo87Df.js +0 -88
  307. package/dist/packem_shared/Tabs-DubuHdYV.js +0 -164
  308. package/dist/packem_shared/Tag-CCqM7Ee9.js +0 -35
  309. package/dist/packem_shared/Text-CtUwV89_.js +0 -65
  310. package/dist/packem_shared/TextInput-C9r7zT0U.js +0 -137
  311. package/dist/packem_shared/Textarea-CGmgt-Nl.js +0 -272
  312. package/dist/packem_shared/Timer-D7ZZ0_wz.js +0 -20
  313. package/dist/packem_shared/Toast-DXSCXFPY.js +0 -37
  314. package/dist/packem_shared/Tooltip-SvVjj-2k.js +0 -32
  315. package/dist/packem_shared/Transform-Cfyva2wd.js +0 -14
  316. package/dist/packem_shared/Transition-CbNfKhaj.js +0 -108
  317. package/dist/packem_shared/TreeNodeMap-CtJUvBnd.js +0 -155
  318. package/dist/packem_shared/TreeView-DGlZeSsK.js +0 -148
  319. package/dist/packem_shared/TuiApp-DtdgNRWa.js +0 -122
  320. package/dist/packem_shared/TuiContext-lXmJFd-x.js +0 -418
  321. package/dist/packem_shared/UnorderedList-D8RPaEAW.js +0 -33
  322. package/dist/packem_shared/accessibility-context-BLelHhNU.js +0 -7
  323. package/dist/packem_shared/animation-context-BcJg8Jr6.js +0 -15
  324. package/dist/packem_shared/ansi-parser-BOP8fNdT.js +0 -43
  325. package/dist/packem_shared/ansi-tokenizer-LHq2LUWA.js +0 -307
  326. package/dist/packem_shared/app-context-CP0U6H7O.js +0 -11
  327. package/dist/packem_shared/background-context-BAUaxfOb.js +0 -5
  328. package/dist/packem_shared/boxes-oi3WUbyR.js +0 -92
  329. package/dist/packem_shared/braille-BoEWoH2I.js +0 -93
  330. package/dist/packem_shared/colorize-88_Vk8cn.js +0 -48
  331. package/dist/packem_shared/comparePoints-CAAlhiMS.js +0 -287
  332. package/dist/packem_shared/controlled-scroll-view-DJXfdWMm.js +0 -286
  333. package/dist/packem_shared/createInlineLoop-Dnfm1ZSJ.js +0 -99
  334. package/dist/packem_shared/createLinkedScrollGroup-Djw4Ceo0.js +0 -44
  335. package/dist/packem_shared/createMemoryStorage-esFJ61La.js +0 -115
  336. package/dist/packem_shared/createScreen-Dh0sZlQ0.js +0 -38
  337. package/dist/packem_shared/cursor-context-JxRzlqAx.js +0 -9
  338. package/dist/packem_shared/dom-CrbpQgat.js +0 -228
  339. package/dist/packem_shared/focus-context-CWkYtgcm.js +0 -26
  340. package/dist/packem_shared/format-time-BGmnDukX.js +0 -12
  341. package/dist/packem_shared/getPathToRoot-BbvlppLC.js +0 -4
  342. package/dist/packem_shared/getScrollHeight-Cz3CDQN2.js +0 -63
  343. package/dist/packem_shared/input-utils-ViAEXa0Z.js +0 -19
  344. package/dist/packem_shared/isIntersecting-fEXHJN5R.js +0 -10
  345. package/dist/packem_shared/isOsc52Supported-G0k4sXJx.js +0 -36
  346. package/dist/packem_shared/isTerminalPaletteQuerySupported-EeiwMKbr.js +0 -93
  347. package/dist/packem_shared/kittyFlags-bNNf_9kX.js +0 -26
  348. package/dist/packem_shared/line-chart-VGU2l7pu.js +0 -139
  349. package/dist/packem_shared/measure-element-Bc6PEaIe.js +0 -405
  350. package/dist/packem_shared/measure-text-BdOhbOeh.js +0 -1256
  351. package/dist/packem_shared/measureElement-DTELRaij.js +0 -4
  352. package/dist/packem_shared/mouse-context-BUHWKEIe.js +0 -6
  353. package/dist/packem_shared/parseSgrMouse-4hpBJBsW.js +0 -1
  354. package/dist/packem_shared/processLayout-B0Coz0Ua.js +0 -2
  355. package/dist/packem_shared/reconciler-Dd7Z0A97.js +0 -696
  356. package/dist/packem_shared/reconciler-mzMwSOft.js +0 -221
  357. package/dist/packem_shared/render-Bm9Oa1sG.js +0 -2799
  358. package/dist/packem_shared/render-CjlKdg4m.js +0 -199
  359. package/dist/packem_shared/renderToString-CWYS1ZXE.js +0 -86
  360. package/dist/packem_shared/renderToString-DB3ILWFm.js +0 -62
  361. package/dist/packem_shared/renderTreeToBuffer-CDDTGyZn.js +0 -311
  362. package/dist/packem_shared/renderer-GE9OLNNM.js +0 -1437
  363. package/dist/packem_shared/setEnableStyledLineCache-D5f4favX.js +0 -2
  364. package/dist/packem_shared/squashTextNodesWithMap-iqm6OMMT.js +0 -100
  365. package/dist/packem_shared/stderr-context-Bj4Mf7v7.js +0 -17
  366. package/dist/packem_shared/stdin-context-Bq_GNJ3z.js +0 -38
  367. package/dist/packem_shared/stdout-context-CgjWeCdO.js +0 -17
  368. package/dist/packem_shared/text-width-Db-AxMea.js +0 -43
  369. package/dist/packem_shared/token-to-elements-CK4s8MJd.js +0 -249
  370. package/dist/packem_shared/treeViewTheme-BpSw9TMf.js +0 -52
  371. package/dist/packem_shared/useAnimation-DV22qxiJ.js +0 -62
  372. package/dist/packem_shared/useApp-Cbi788rV.js +0 -6
  373. package/dist/packem_shared/useBoxMetrics-_5icypir.js +0 -54
  374. package/dist/packem_shared/useClipboard-MNj6MNR-.js +0 -23
  375. package/dist/packem_shared/useColorBlindness-D_sTIhcb.js +0 -30
  376. package/dist/packem_shared/useConsoleCapture-Dvt7G1W1.js +0 -61
  377. package/dist/packem_shared/useCursor-DS6LjIgv.js +0 -19
  378. package/dist/packem_shared/useElementDimensions-CAoKitVD.js +0 -67
  379. package/dist/packem_shared/useFocus-DLoGQJd9.js +0 -37
  380. package/dist/packem_shared/useFocusManager-UeZWtnNc.js +0 -16
  381. package/dist/packem_shared/useForm-sQENbEuv.js +0 -88
  382. package/dist/packem_shared/useHotkey-D9giUX3q.js +0 -112
  383. package/dist/packem_shared/useInput-DKZbqMRc.js +0 -594
  384. package/dist/packem_shared/useInterval-CSXM8c2I.js +0 -32
  385. package/dist/packem_shared/useIsScreenReaderEnabled-BeoVqo1R.js +0 -9
  386. package/dist/packem_shared/useKeyBindings-S4fSIEAk.js +0 -66
  387. package/dist/packem_shared/useKeyChord-BmXGNuEO.js +0 -114
  388. package/dist/packem_shared/useMouseAction-C5gZ2nj7.js +0 -29
  389. package/dist/packem_shared/useMouseContext-D-rFy60Q.js +0 -12
  390. package/dist/packem_shared/useMousePosition-BHBJ-kBk.js +0 -25
  391. package/dist/packem_shared/useOnMouseClick--ZIyBOBO.js +0 -35
  392. package/dist/packem_shared/useOnMouseHover-26diuXUC.js +0 -32
  393. package/dist/packem_shared/useOnMouseState-NO_Kda_C.js +0 -13
  394. package/dist/packem_shared/usePaste-png73gvT.js +0 -35
  395. package/dist/packem_shared/useScrollAcceleration-R9LfrPVG.js +0 -73
  396. package/dist/packem_shared/useScrollInput-DfzRGQFe.js +0 -72
  397. package/dist/packem_shared/useStderr-BSWerMZ7.js +0 -6
  398. package/dist/packem_shared/useStdin-Rf0zPzVA.js +0 -7
  399. package/dist/packem_shared/useStdout-B5yRcg9N.js +0 -6
  400. package/dist/packem_shared/useStopwatch-C__Zu6hd.js +0 -33
  401. package/dist/packem_shared/useTerminalPalette-CtFG2JTq.js +0 -38
  402. package/dist/packem_shared/useTextBuffer-C8fEe9Ly.js +0 -398
  403. package/dist/packem_shared/useTextSelection-ChrYZXsn.js +0 -50
  404. package/dist/packem_shared/useTimeout-DuCqgWPX.js +0 -34
  405. package/dist/packem_shared/useTimer-DnBtbhB5.js +0 -46
  406. package/dist/packem_shared/useTreeView-mkN5Di7w.js +0 -101
  407. package/dist/packem_shared/useTreeViewState-BpS_KZ-K.js +0 -502
  408. package/dist/packem_shared/useWindowSize-D3UU41mv.js +0 -20
  409. package/dist/packem_shared/utils-BgdlrbOH.js +0 -140
  410. package/dist/packem_shared/variant-config-DSZoX5TM.js +0 -8
  411. package/dist/packem_shared/waitFor-Cv9M2jKA.js +0 -39
  412. package/dist/packem_shared/wrapOrTruncateStyledLine-49Mne3t3.js +0 -147
@@ -0,0 +1,4 @@
1
+ var _=Object.defineProperty;var U=(o,c)=>_(o,"name",{value:c,configurable:!0});import{useState as z,useRef as b,useCallback as u,useMemo as X}from"react";var Q=Object.defineProperty,m=U((o,c)=>Q(o,"name",{value:c,configurable:!0}),"S");const nn=300,en=100,ln=/\S+\s*$/,x=m(o=>{const c=o.split(`
2
+ `);return c.length===0?[""]:c},"splitLines"),rn=m(o=>o.join(`
3
+ `),"joinLines"),h=m(o=>({anchor:o.anchor,cursor:{...o.cursor},lines:[...o.lines]}),"snapOf"),L=m((o,c,i)=>i?{...o,anchor:o.anchor??o.cursor,cursor:c}:{...o,anchor:null,cursor:c},"withSelection"),Y=m((o,c)=>c.line<o.line||c.line===o.line&&c.col<o.col?{end:o,start:c}:{end:c,start:o},"getSelectionRange"),v=m(o=>{if(!o.anchor)return null;const{end:c,start:i}=Y(o.cursor,o.anchor),a=[...o.lines],d=a[i.line].slice(0,i.col),f=a[c.line].slice(c.col);return a.splice(i.line,c.line-i.line+1,d+f),{anchor:null,cursor:i,lines:a}},"deleteSelectionFromState"),j=m((o,c)=>{const i=v(o)??o,a=[...i.lines],{col:d,line:f}=i.cursor,T=a[f].slice(0,d),S=a[f].slice(d),t=x(c);if(t.length===1)return a[f]=T+t[0]+S,{anchor:null,cursor:{col:d+t[0].length,line:f},lines:a};const k=T+t[0],w=t.at(-1)+S,M=t.slice(1,-1);return a.splice(f,1,k,...M,w),{anchor:null,cursor:{col:t.at(-1).length,line:f+t.length-1},lines:a}},"insertIntoState"),tn=m((o="")=>{const[c,i]=z(()=>{const n=x(o);return{anchor:null,cursor:{col:n.at(-1).length,line:n.length-1},lines:n}}),a=b([]),d=b([]),f=b(0),T=b(c.cursor.col);T.current=c.cursor.col;const S=b(c);S.current=c;const t=u(n=>{const e=Date.now();e-f.current<nn&&a.current.length>0||(a.current.push(n),a.current.length>en&&a.current.shift()),d.current=[],f.current=e},[]),k=u(()=>S.current.anchor!==null,[]),w=u(()=>{const n=S.current;if(!n.anchor)return"";const{end:e,start:l}=Y(n.cursor,n.anchor);if(l.line===e.line)return n.lines[l.line].slice(l.col,e.col);const r=[];r.push(n.lines[l.line].slice(l.col));for(let s=l.line+1;s<e.line;s++)r.push(n.lines[s]);return r.push(n.lines[e.line].slice(0,e.col)),r.join(`
4
+ `)},[]),M=u(n=>{i(e=>(t(h(e)),j(e,n)))},[t]),C=u(()=>{i(n=>{t(h(n));const e=v(n)??n,l=[...e.lines],{col:r,line:s}=e.cursor,g=l[s].slice(0,r),p=l[s].slice(r);return l.splice(s,1,g,p),{anchor:null,cursor:{col:0,line:s+1},lines:l}})},[t]),E=u(()=>{i(n=>{if(n.anchor)return t(h(n)),v(n)??n;const{col:e,line:l}=n.cursor;if(e===0&&l===0)return n;t(h(n));const r=[...n.lines];if(e===0){const s=r[l-1],g=s.length;return r[l-1]=s+r[l],r.splice(l,1),{anchor:null,cursor:{col:g,line:l-1},lines:r}}return r[l]=r[l].slice(0,e-1)+r[l].slice(e),{anchor:null,cursor:{col:e-1,line:l},lines:r}})},[t]),y=u(()=>{i(n=>{if(n.anchor)return t(h(n)),v(n)??n;const{col:e,line:l}=n.cursor,r=n.lines[l];if(e===r.length&&l===n.lines.length-1)return n;t(h(n));const s=[...n.lines];return e===r.length?(s[l]=r+s[l+1],s.splice(l+1,1),{anchor:null,cursor:n.cursor,lines:s}):(s[l]=r.slice(0,e)+r.slice(e+1),{anchor:null,cursor:n.cursor,lines:s})})},[t]),B=u(()=>{i(n=>{t(h(n));const e=[...n.lines],{line:l}=n.cursor;if(e.length===1)return{anchor:null,cursor:{col:0,line:0},lines:[""]};e.splice(l,1);const r=Math.min(l,e.length-1);return{anchor:null,cursor:{col:Math.min(n.cursor.col,e[r].length),line:r},lines:e}})},[t]),F=u(()=>{i(n=>{t(h(n));const e=[...n.lines],{col:l,line:r}=n.cursor;return e[r]=e[r].slice(0,l),{...n,anchor:null,lines:e}})},[t]),O=u(()=>{i(n=>{t(h(n));const e=[...n.lines],{col:l,line:r}=n.cursor;return e[r]=e[r].slice(l),{anchor:null,cursor:{col:0,line:r},lines:e}})},[t]),R=u(()=>{i(n=>{if(t(h(n)),n.anchor)return v(n)??n;const{col:e,line:l}=n.cursor,r=n.lines[l].slice(0,e).replace(ln,""),s=[...n.lines];return s[l]=r+n.lines[l].slice(e),{anchor:null,cursor:{col:r.length,line:l},lines:s}})},[t]),A=u((n,e=!1)=>{i(l=>{const{col:r,line:s}=l.cursor;let g=s,p=r;switch(n){case"down":{s<l.lines.length-1&&(g=s+1,p=Math.min(T.current,l.lines[g].length));break}case"left":{r>0?p=r-1:s>0&&(g=s-1,p=l.lines[g].length);break}case"right":{const Z=l.lines[s].length;r<Z?p=r+1:s<l.lines.length-1&&(g=s+1,p=0);break}case"up":{s>0&&(g=s-1,p=Math.min(T.current,l.lines[g].length));break}}return L(l,{col:p,line:g},e)})},[]),D=u((n=!1)=>{i(e=>L(e,{col:0,line:e.cursor.line},n))},[]),I=u((n=!1)=>{i(e=>L(e,{col:e.lines[e.cursor.line].length,line:e.cursor.line},n))},[]),P=u((n=!1)=>{i(e=>L(e,{col:0,line:0},n))},[]),V=u((n=!1)=>{i(e=>{const l=e.lines.length-1;return L(e,{col:e.lines[l].length,line:l},n)})},[]),W=u(()=>{i(n=>{const e=n.lines.length-1;return{...n,anchor:{col:0,line:0},cursor:{col:n.lines[e].length,line:e}}})},[]),$=u(()=>{i(n=>n.anchor?{...n,anchor:null}:n)},[]),q=u(()=>{i(n=>n.anchor?(t(h(n)),v(n)??n):n)},[t]),G=u(n=>{i(e=>{if(!e.anchor)return t(h(e)),j(e,n);t(h(e));const l=v(e)??e;return j(l,n)})},[t]),H=u(n=>{const e=x(n);i({anchor:null,cursor:{col:e.at(-1).length,line:e.length-1},lines:e}),a.current=[],d.current=[]},[]),J=u(()=>{const n=a.current.pop();n&&(d.current.push(h(S.current)),i(n))},[]),K=u(()=>{const n=d.current.pop();n&&(a.current.push(h(S.current)),i(n))},[]),N=X(()=>rn(c.lines),[c.lines]);return X(()=>({anchor:c.anchor,clearSelection:$,cursor:c.cursor,deleteBack:E,deleteForward:y,deleteLine:B,deleteSelection:q,deleteToLineEnd:F,deleteToLineStart:O,deleteWord:R,getSelectedText:w,hasSelection:k,insert:M,lines:c.lines,moveCursor:A,moveToEnd:V,moveToLineEnd:I,moveToLineStart:D,moveToStart:P,newline:C,redo:K,replaceSelection:G,selectAll:W,setValue:H,undo:J,value:N}),[c.anchor,c.cursor,c.lines,N,$,E,y,B,q,F,O,R,w,k,M,A,V,I,D,P,C,K,G,W,H,J])},"useTextBuffer");export{tn as default};
@@ -0,0 +1 @@
1
+ var S=Object.defineProperty;var m=(n,o)=>S(n,"name",{value:o,configurable:!0});import{useRef as d,useState as C,useEffect as R,useCallback as p,useMemo as b}from"react";import{Selection as y,Range as A}from"./comparePoints-C85EsmNz.js";import h from"./useClipboard-CBxy0hT8.js";var x=Object.defineProperty,w=m((n,o)=>x(n,"name",{value:o,configurable:!0}),"f");const E=w((n,o={})=>{const{copyOnSelect:c=!1,isActive:r=!0,onSelectionChange:l}=o,{copy:s}=h(),e=d(new y).current,[a,v]=C(""),u=d(l);u.current=l,R(()=>r?e.onChange(()=>{const t=e.toString();v(t),u.current?.(t),c&&t.length>0&&s(t)}):void 0,[r,e,c,s]);const i=p(()=>{const t=n.current;if(!t||!r)return;e.removeAllRanges();const g=new A;g.selectNodeContents(t),e.addRange(g)},[n,r,e]),f=p(()=>{e.removeAllRanges()},[e]);return b(()=>({clearSelection:f,selectAll:i,selectedText:a,selection:e}),[f,a,i,e])},"useTextSelection");export{E as default};
@@ -0,0 +1 @@
1
+ var d=Object.defineProperty;var n=(r,e)=>d(r,"name",{value:e,configurable:!0});import{useRef as o,useState as b,useCallback as s,useEffect as T}from"react";var p=Object.defineProperty,g=n((r,e)=>p(r,"name",{value:e,configurable:!0}),"i");const x=g((r,e,a)=>{const{isActive:c=!0}=a??{},i=o(r),t=o(void 0),[f,l]=b(0);i.current=r;const m=s(()=>{t.current!==void 0&&(clearTimeout(t.current),t.current=void 0)},[]),v=s(()=>{l(u=>u+1)},[]);return T(()=>{if(!c||e<0||!Number.isFinite(e))return;const u=setTimeout(()=>{i.current()},e);return t.current=u,()=>{clearTimeout(u),t.current=void 0}},[e,c,f]),{cancel:m,reset:v}},"useTimeout");export{x as default};
@@ -0,0 +1 @@
1
+ var T=Object.defineProperty;var f=(e,t)=>T(e,"name",{value:t,configurable:!0});import{useState as h,useRef as m,useEffect as y,useCallback as u}from"react";import E from"./useAnimation-B9we6ZzL.js";var j=Object.defineProperty,k=f((e,t)=>j(e,"name",{value:t,configurable:!0}),"f");function A(e){const{autoStart:t=!1,duration:v,interval:g=1e3,onTimeout:o}=e,[n,r]=h(t),l=m(o);l.current=o;const i=m(!1),{reset:c,time:p}=E({interval:g,isActive:n}),s=Math.max(0,v-p),a=s<=0;y(()=>{a&&n&&(r(!1),i.current||(i.current=!0,l.current?.()))},[a,n]);const d=u(()=>{a||r(!0)},[a]),b=u(()=>{r(!1)},[]),x=u(()=>{r(S=>S?!1:s>0)},[s]),R=u(()=>{r(!1),i.current=!1,c()},[c]);return{isFinished:a,isRunning:n,remaining:s,reset:R,start:d,stop:b,toggle:x}}f(A,"S");k(A,"useTimer");export{A as default};
@@ -0,0 +1 @@
1
+ var I=Object.defineProperty;var a=(s,n)=>I(s,"name",{value:n,configurable:!0});import{useRef as d,useCallback as w}from"react";import m from"./useInput-D1_jG26Z.js";var B=Object.defineProperty,C=a((s,n)=>B(s,"name",{value:n,configurable:!0}),"h");function E({isDisabled:s=!1,loadChildren:n,onLoadError:f,selectionMode:l,state:e}){const i=d(new Set),o=d(e);o.current=e;const h=d(n);h.current=n;const p=d(f);p.current=f;const g=w(async r=>{if(i.current.has(r))return;const t=h.current;if(!t)return;const c=o.current.nodeMap.get(r);if(!(!c||c.childrenIds.length>0)){i.current.add(r),o.current.setLoading(r,!0);try{const u=await t(c.node);o.current.insertChildren(r,u),o.current.expandNode(r)}catch(u){const x=u instanceof Error?u:new Error(String(u));o.current.setChildrenError(r),p.current?.(r,x)}finally{o.current.setLoading(r,!1),i.current.delete(r)}}},[]);m((r,t)=>{if(t.downArrow){e.focusNext();return}if(t.upArrow){e.focusPrevious();return}if(t.rightArrow){if(e.focusedId&&e.expandedIds.has(e.focusedId))e.focusFirstChild();else if(e.focusedId){if(n){const c=e.nodeMap.get(e.focusedId);if(c&&c.hasChildren&&c.childrenIds.length===0){g(e.focusedId).catch(()=>{});return}}e.expand()}return}if(t.leftArrow){e.focusedId&&e.expandedIds.has(e.focusedId)?e.collapse():e.focusParent();return}if(t.return){l==="none"?e.toggleExpanded():e.select();return}if(r===" "){l==="multiple"?e.select():e.toggleExpanded();return}if(r==="\x1B[H"||r==="\x1B[1~"||r==="\x1BOH"){e.focusFirst();return}(r==="\x1B[F"||r==="\x1B[4~"||r==="\x1BOF")&&e.focusLast()},{isActive:!s})}a(E,"useTreeView");C(E,"useTreeView");export{E as useTreeView};
@@ -0,0 +1 @@
1
+ var K=Object.defineProperty;var c=(e,t)=>K(e,"name",{value:t,configurable:!0});import{useReducer as Q,useState as W,useRef as g,useEffect as S,useMemo as X,useCallback as r}from"react";import{TreeNodeMap as Y}from"./TreeNodeMap-CspqSCpb.js";var Z=Object.defineProperty,h=c((e,t)=>Z(e,"name",{value:t,configurable:!0}),"a");function f(e){const t=new Map;for(const[d,s]of e.entries())t.set(s,d);return t}c(f,"f");h(f,"buildVisibleIdIndex");function x(e,t){if(e.visibleNodeCount>=e.visibleIds.length)return{viewportFromIndex:0,viewportToIndex:e.visibleIds.length};let d=e.viewportFromIndex,s=e.viewportToIndex;return t>=s&&(s=t+1,d=s-e.visibleNodeCount),t<d&&(d=t,s=d+e.visibleNodeCount),{viewportFromIndex:Math.max(0,d),viewportToIndex:Math.min(e.visibleIds.length,s)}}c(x,"x");h(x,"adjustViewport");function b(e,t){if(e.visibleNodeCount>=t.length)return{viewportFromIndex:0,viewportToIndex:t.length};const d=e.focusedId?t.indexOf(e.focusedId):-1;if(d<0)return{viewportFromIndex:0,viewportToIndex:Math.min(e.visibleNodeCount,t.length)};let s=Math.min(e.viewportToIndex,t.length),o=Math.max(0,s-e.visibleNodeCount);return d>=s&&(s=d+1,o=s-e.visibleNodeCount),d<o&&(o=d,s=o+e.visibleNodeCount),{viewportFromIndex:Math.max(0,o),viewportToIndex:Math.min(t.length,s)}}c(b,"h");h(b,"adjustViewportForNewVisible");function v(e,t){switch(t.type){case"collapse":return e.focusedId?v(e,{nodeId:e.focusedId,type:"collapse-node"}):e;case"collapse-all":{const d=new Set,s=e.nodeMap.getVisibleIds(d);return{...e,expandedIds:d,focusedId:s[0],previousExpandedIds:e.expandedIds,viewportFromIndex:0,viewportToIndex:Math.min(e.visibleNodeCount,s.length),visibleIdIndex:f(s),visibleIds:s}}case"collapse-node":{const{nodeId:d}=t;if(!e.expandedIds.has(d))return e;const s=new Set(e.expandedIds);s.delete(d);const o=e.nodeMap.getVisibleIds(s);let l=e.focusedId;return l!==void 0&&l!==d&&e.nodeMap.isDescendantOf(l,d)&&(l=d),{...e,expandedIds:s,focusedId:l,previousExpandedIds:e.expandedIds,visibleIdIndex:f(o),visibleIds:o,...b({...e,focusedId:l},o)}}case"expand":return e.focusedId?v(e,{nodeId:e.focusedId,type:"expand-node"}):e;case"expand-all":{const d=new Set;for(const[o,l]of e.nodeMap.entries())l.hasChildren&&d.add(o);const s=e.nodeMap.getVisibleIds(d);return{...e,expandedIds:d,previousExpandedIds:e.expandedIds,visibleIdIndex:f(s),visibleIds:s,...b({...e},s)}}case"expand-node":{const{nodeId:d}=t;if(!e.nodeMap.get(d)?.hasChildren||e.expandedIds.has(d))return e;const s=new Set(e.expandedIds);s.add(d);const o=e.nodeMap.getVisibleIds(s);return{...e,expandedIds:s,previousExpandedIds:e.expandedIds,visibleIdIndex:f(o),visibleIds:o,...b({...e},o)}}case"focus-first":return e.visibleIds.length===0?e:{...e,focusedId:e.visibleIds[0],viewportFromIndex:0,viewportToIndex:Math.min(e.visibleNodeCount,e.visibleIds.length)};case"focus-first-child":{if(!e.focusedId)return e;const d=e.nodeMap.get(e.focusedId);if(!d||d.childrenIds.length===0||!e.expandedIds.has(e.focusedId))return e;const s=d.childrenIds[0],o=e.visibleIdIndex.get(s)??-1;return o<0?e:{...e,focusedId:s,...x(e,o)}}case"focus-last":{if(e.visibleIds.length===0)return e;const d=e.visibleIds.length-1;return{...e,focusedId:e.visibleIds[d],...x(e,d)}}case"focus-next":{if(!e.focusedId)return e;const d=e.visibleIdIndex.get(e.focusedId)??-1;if(d<0||d>=e.visibleIds.length-1)return e;const s=e.visibleIds[d+1];return{...e,focusedId:s,...x(e,d+1)}}case"focus-parent":{if(!e.focusedId)return e;const d=e.nodeMap.get(e.focusedId);if(!d?.parentId)return e;const s=e.visibleIdIndex.get(d.parentId)??-1;return s<0?e:{...e,focusedId:d.parentId,...x(e,s)}}case"focus-previous":{if(!e.focusedId)return e;const d=e.visibleIdIndex.get(e.focusedId)??-1;if(d<=0)return e;const s=e.visibleIds[d-1];return{...e,focusedId:s,...x(e,d-1)}}case"insert-children":{if(!e.nodeMap.get(t.parentId))return e;const d=e.nodeMap.withChildren(t.parentId,t.children),s=d.getVisibleIds(e.expandedIds);return{...e,nodeMap:d,visibleIdIndex:f(s),visibleIds:s}}case"reset":return t.state;case"select":{if(!e.focusedId||e.selectionMode==="none")return e;if(e.selectionMode==="single"){const s=new Set([e.focusedId]);return{...e,previousSelectedIds:e.selectedIds,selectedIds:s}}const d=new Set(e.selectedIds);return d.has(e.focusedId)?d.delete(e.focusedId):d.add(e.focusedId),{...e,previousSelectedIds:e.selectedIds,selectedIds:d}}case"set-children-error":{const d=new Set(e.loadingIds);return d.delete(t.nodeId),{...e,loadingIds:d}}case"set-loading":{const d=new Set(e.loadingIds);return t.isLoading?d.add(t.nodeId):d.delete(t.nodeId),{...e,loadingIds:d}}case"toggle-expanded":return e.focusedId?e.expandedIds.has(e.focusedId)?v(e,{type:"collapse"}):v(e,{type:"expand"}):e;default:return e}}c(v,"reducer");h(v,"reducer");function m({data:e,defaultExpanded:t,defaultSelected:d,selectionMode:s,visibleNodeCount:o}){const l=new Y(e);let I;if(t==="all"){I=new Set;for(const[w,M]of l.entries())M.hasChildren&&I.add(w)}else t?I=new Set(t):I=new Set;const u=l.getVisibleIds(I),n=s!=="none"&&d?new Set(d):new Set,i=Math.min(o,u.length);return{expandedIds:I,focusedId:u[0],loadingIds:new Set,nodeMap:l,previousExpandedIds:I,previousSelectedIds:n,selectedIds:n,selectionMode:s,viewportFromIndex:0,viewportToIndex:i,visibleIdIndex:f(u),visibleIds:u,visibleNodeCount:o}}c(m,"createDefaultState");h(m,"createDefaultState");function _({data:e,defaultExpanded:t,defaultSelected:d,onExpandChange:s,onFocusChange:o,onSelectChange:l,selectionMode:I="none",visibleNodeCount:u=1/0}){const[n,i]=Q(v,{data:e,defaultExpanded:t,defaultSelected:d,selectionMode:I,visibleNodeCount:u},m),[w,M]=W(e);e!==w&&(i({state:m({data:e,defaultExpanded:t,defaultSelected:d,selectionMode:I,visibleNodeCount:u}),type:"reset"}),M(e));const C=g(o);C.current=o;const y=g(s);y.current=s;const N=g(l);N.current=l;const F=g(!0);S(()=>{if(F.current){F.current=!1;return}n.focusedId&&C.current?.(n.focusedId)},[n.focusedId]),S(()=>{n.expandedIds!==n.previousExpandedIds&&y.current?.(n.expandedIds)},[n.expandedIds,n.previousExpandedIds]),S(()=>{n.selectedIds!==n.previousSelectedIds&&N.current?.(n.selectedIds)},[n.selectedIds,n.previousSelectedIds]);const T=X(()=>n.visibleIds.slice(n.viewportFromIndex,n.viewportToIndex).map(a=>{const p=n.nodeMap.get(a);return{node:p.node,state:{depth:p.depth,hasChildren:p.hasChildren,isExpanded:n.expandedIds.has(a),isFocused:a===n.focusedId,isLoading:n.loadingIds.has(a),isSelected:n.selectedIds.has(a)}}}),[n.visibleIds,n.viewportFromIndex,n.viewportToIndex,n.focusedId,n.expandedIds,n.selectedIds,n.nodeMap,n.loadingIds]),E=r(()=>{i({type:"focus-next"})},[]),V=r(()=>{i({type:"focus-previous"})},[]),L=r(()=>{i({type:"focus-first"})},[]),D=r(()=>{i({type:"focus-last"})},[]),j=r(()=>{i({type:"expand"})},[]),O=r(a=>{i({nodeId:a,type:"expand-node"})},[]),P=r(()=>{i({type:"collapse"})},[]),A=r(a=>{i({nodeId:a,type:"collapse-node"})},[]),R=r(()=>{i({type:"toggle-expanded"})},[]),k=r(()=>{i({type:"expand-all"})},[]),U=r(()=>{i({type:"collapse-all"})},[]),q=r(()=>{i({type:"select"})},[]),z=r(()=>{i({type:"focus-parent"})},[]),B=r(()=>{i({type:"focus-first-child"})},[]),G=r((a,p)=>{i({isLoading:p,nodeId:a,type:"set-loading"})},[]),H=r(a=>{i({nodeId:a,type:"set-children-error"})},[]),J=r((a,p)=>{i({children:p,parentId:a,type:"insert-children"})},[]);return{collapse:P,collapseAll:U,collapseNode:A,expand:j,expandAll:k,expandedIds:n.expandedIds,expandNode:O,focusedId:n.focusedId,focusFirst:L,focusFirstChild:B,focusLast:D,focusNext:E,focusParent:z,focusPrevious:V,hasScrollDown:n.viewportToIndex<n.visibleIds.length,hasScrollUp:n.viewportFromIndex>0,insertChildren:J,loadingIds:n.loadingIds,nodeMap:n.nodeMap,select:q,selectedIds:n.selectedIds,setChildrenError:H,setLoading:G,toggleExpanded:R,viewportFromIndex:n.viewportFromIndex,viewportNodes:T,viewportToIndex:n.viewportToIndex,visibleCount:n.visibleIds.length}}c(_,"useTreeViewState");h(_,"useTreeViewState");export{m as createDefaultState,v as reducer,_ as useTreeViewState};
@@ -0,0 +1 @@
1
+ var f=Object.defineProperty;var o=(e,r)=>f(e,"name",{value:r,configurable:!0});import{useState as u,useEffect as a}from"react";import{g as s}from"./utils-THUhYKG2.js";import m from"./useStdout-B-2lX4C5.js";var c=Object.defineProperty,n=o((e,r)=>c(e,"name",{value:r,configurable:!0}),"t");const l=n(()=>{const{stdout:e}=m(),[r,i]=u(()=>s(e));return a(()=>{const t=n(()=>{i(s(e))},"onResize");return e.on("resize",t),()=>{e.off("resize",t)}},[e]),r},"useWindowSize");export{l as default};
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var u=(e,r)=>g(e,"name",{value:r,configurable:!0});import{createRequire as y}from"node:module";const _=y(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=u(e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[r,t]=c.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return c.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),o=c,{execFileSync:O}=d("node:child_process"),i=d("node:fs"),h=d("node:tty");var S=Object.defineProperty,n=u((e,r)=>S(e,"name",{value:r,configurable:!0}),"n");const N=80,b=24,f=n((e,r,{shell:t,env:s}={})=>O(e,r,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:500,shell:t,env:s}).trim(),"exec"),a=n((e,r)=>({columns:Number.parseInt(e,10),rows:Number.parseInt(r,10)}),"create"),w=n((e,r)=>{const{columns:t,rows:s}=a(e,r);if(!(Number.isNaN(t)||Number.isNaN(s))&&!(t===N&&s===b))return{columns:t,rows:s}},"createIfNotDefault"),I=n(()=>{if(o.platform!=="linux")return!0;try{const e=i.readFileSync("/proc/self/stat","utf8"),r=e.lastIndexOf(") ");if(r===-1)return!1;const t=e.slice(r+2).trim().split(/\s+/),s=Number.parseInt(t[2],10),l=Number.parseInt(t[5],10);return Number.isNaN(s)||Number.isNaN(l)||l<=0?!1:s===l}catch{return!1}},"isForegroundProcess");function v(){const{env:e,stdout:r,stderr:t}=o;if(r?.columns&&r?.rows)return a(r.columns,r.rows);if(t?.columns&&t?.rows)return a(t.columns,t.rows);if(e.COLUMNS&&e.LINES)return a(e.COLUMNS,e.LINES);const s={columns:N,rows:b};return o.platform==="win32"?m()??s:o.platform==="darwin"?p()??m()??s:p()??m()??j()??s}u(v,"O");n(v,"terminalSize");const p=n(()=>{try{const e=o.platform==="darwin"?i.constants.O_EVTONLY|i.constants.O_NONBLOCK:i.constants.O_NONBLOCK,{columns:r,rows:t}=h.WriteStream(i.openSync("/dev/tty",e));return{columns:r,rows:t}}catch{}},"devTty"),m=n(()=>{try{const e=f("tput",["cols"],{env:{TERM:"dumb",...o.env}}),r=f("tput",["lines"],{env:{TERM:"dumb",...o.env}});if(e&&r)return w(e,r)}catch{}},"tput"),j=n(()=>{try{if(!I())return;const e=f("resize",["-u"]).match(/\d+/g);if(e.length===2)return w(e[0],e[1])}catch{}},"resize");var L=Object.defineProperty,T=u((e,r)=>L(e,"name",{value:r,configurable:!0}),"s");const z=T(e=>{const{columns:r,rows:t}=e;if(r&&t)return{columns:r,rows:t};const s=v();return{columns:r||s.columns||80,rows:t||s.rows||24}},"getWindowSize");export{z as g};
@@ -0,0 +1 @@
1
+ const o={error:{color:"red",icon:"✖"},info:{color:"blue",icon:"ℹ"},success:{color:"green",icon:"✔"},warning:{color:"yellow",icon:"⚠"}};export{o};
@@ -0,0 +1,4 @@
1
+ var f=Object.defineProperty;var c=(t,r)=>f(t,"name",{value:r,configurable:!0});var l=Object.defineProperty,i=c((t,r)=>l(t,"name",{value:r,configurable:!0}),"n");const h=i(async(t,r,n={})=>{const w=n.timeout??3e3,s=n.interval??50,u=Date.now();let o=new Error("waitFor timed out");const a=i(()=>{if(typeof t=="string"){const e=r();if(!e.includes(t))throw new Error(`Timed out waiting for text: "${t}"
2
+
3
+ Screen content:
4
+ ${e}`)}else t()},"check");for(;Date.now()-u<w;){try{a();return}catch(e){o=e}await new Promise(e=>{setTimeout(e,s)})}try{a();return}catch(e){o=e}throw o},"waitFor");export{h as waitFor};
@@ -0,0 +1,3 @@
1
+ var y=Object.defineProperty;var p=(e,n)=>y(e,"name",{value:n,configurable:!0});import{S as V,d as m,i as h}from"./measure-text-DDjHT1jD.js";var b=Object.defineProperty,g=p((e,n)=>b(e,"name",{value:n,configurable:!0}),"g");const S=g((e,n,u="end")=>{if(n<1)return new V;if(m(e)<=n)return e;const r=new V;if(r.pushChar("…",0),n===1)return r;if(u==="start"){let t=0,s=e.length;for(let l=e.length-1;l>=0&&(t+=h(e.getValue(l)),!(t>n-1));l--)s=l;return r.combine(e.slice(s))}if(u==="middle"){const t=Math.ceil(n/2),s=n-t;let l=0,c=0;for(let i=0;i<e.length;i++){const d=h(e.getValue(i));if(c+d>t-1)break;c+=d,l=i+1}let a=e.length;c=0;for(let i=e.length-1;i>=0&&(c+=h(e.getValue(i)),!(c>s));i--)a=i;return e.slice(0,l).combine(r,e.slice(a))}let f=0,o=0;for(let t=0;t<e.length;t++){const s=h(e.getValue(t));if(o+s>n-1)break;o+=s,f=t+1}return e.slice(0,f).combine(r)},"truncateStyledLine"),w=g((e,n)=>{const u=[];let r=0,f=0,o=!0,t=0;for(;t<e.length;){const s=e.getValue(t);if(s===`
2
+ `){u.push(e.slice(r,t)),r=t+1,f=0,o=!0,t++;continue}let l=t,c=0;if(s===" ")c=h(" "),l=t+1;else for(;l<e.length&&e.getValue(l)!==" "&&e.getValue(l)!==`
3
+ `;)c+=h(e.getValue(l)),l++;if(f+c>n&&f>0){if(s===" "&&!o&&!e.hasStyles(t)){t=l;continue}let a=t;for(;a>r&&e.getValue(a-1)===" "&&!e.hasStyles(a-1);)a--;u.push(e.slice(r,a)),r=t,f=0;continue}if(f===0&&c>n){let a=t,i=0;for(;a<l;){const d=h(e.getValue(a));i+d>n&&i>0&&(u.push(e.slice(r,a)),r=a,i=0),i+=d,a++}f=i,t=l,o=!1}else f+=c,t=l,s!==" "&&(o=!1)}return(r<e.length||u.length===0)&&u.push(e.slice(r)),u},"wrapStyledLine"),v=g((e,n,u="wrap")=>{if(u.startsWith("truncate")){let r="end";return u==="truncate-middle"?r="middle":u==="truncate-start"&&(r="start"),[S(e,n,r)]}return w(e,n)},"wrapOrTruncateStyledLine");export{v as wrapOrTruncateStyledLine};
@@ -1,9 +1 @@
1
- export { DevTools } from '../packem_shared/DevTools-BdxRSkhL.js';
2
- export { FocusContext, FocusProvider, useFocus, useFocusManager } from '../packem_shared/FocusContext-D5wFxSRz.js';
3
- export { TuiContext, measureElement, useApp, useBoxMetrics, useCursor, useInput, useIsScreenReaderEnabled, useMouse, usePaste, useScrollable, useStderr, useStdin, useStdout, useTextInput, useTuiContext, useWindowSize } from '../packem_shared/TuiContext-lXmJFd-x.js';
4
- export { render, renderInline } from '../packem_shared/render-CjlKdg4m.js';
5
- export { renderToString } from '../packem_shared/renderToString-DB3ILWFm.js';
6
- export { Static } from '../packem_shared/Static-xmD9giJj.js';
7
- export { LayoutNode } from '../packem_shared/LayoutNode-DAkKg9TE.js';
8
- export { NAMED_COLORS, applyStyles, resolveColor } from '../packem_shared/NAMED_COLORS-DcI3erCu.js';
9
- export { renderTreeToBuffer } from '../packem_shared/renderTreeToBuffer-CDDTGyZn.js';
1
+ import{DevTools as o}from"../packem_shared/DevTools-O8EbCfHa.js";import{FocusContext as u,FocusProvider as s,useFocus as n,useFocusManager as p}from"../packem_shared/FocusContext-Xy0cwJpO.js";import{TuiContext as d,measureElement as f,useApp as l,useBoxMetrics as m,useCursor as a,useInput as i,useIsScreenReaderEnabled as S,useMouse as c,usePaste as T,useScrollable as C,useStderr as F,useStdin as I,useStdout as M,useTextInput as v,useTuiContext as y,useWindowSize as E}from"../packem_shared/TuiContext-BoJvG3NN.js";import{render as g,renderInline as A}from"../packem_shared/render-DDqtMAFN.js";import{renderToString as D}from"../packem_shared/renderToString-IYYPyASm.js";import{Static as N}from"../packem_shared/Static-DLynr5pn.js";import{LayoutNode as P}from"../packem_shared/LayoutNode-rxblE317.js";import{NAMED_COLORS as w,applyStyles as z,resolveColor as W}from"../packem_shared/NAMED_COLORS-B9fJsYdg.js";import{renderTreeToBuffer as h}from"../packem_shared/renderTreeToBuffer-DPkoCgP2.js";export{o as DevTools,u as FocusContext,s as FocusProvider,P as LayoutNode,w as NAMED_COLORS,N as Static,d as TuiContext,z as applyStyles,f as measureElement,g as render,A as renderInline,D as renderToString,h as renderTreeToBuffer,W as resolveColor,l as useApp,m as useBoxMetrics,a as useCursor,n as useFocus,p as useFocusManager,i as useInput,S as useIsScreenReaderEnabled,c as useMouse,T as usePaste,C as useScrollable,F as useStderr,I as useStdin,M as useStdout,v as useTextInput,y as useTuiContext,E as useWindowSize};
@@ -1,152 +1 @@
1
- import { createRequire as __cjs_createRequire } from "node:module";
2
-
3
- const __cjs_require = __cjs_createRequire(import.meta.url);
4
-
5
- const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
6
-
7
- const __cjs_getBuiltinModule = (module) => {
8
- // Check if we're in Node.js and version supports getBuiltinModule
9
- if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
10
- const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
11
- // Node.js 20.16.0+ and 22.3.0+
12
- if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
13
- return __cjs_getProcess.getBuiltinModule(module);
14
- }
15
- }
16
- // Fallback to createRequire
17
- return __cjs_require(module);
18
- };
19
-
20
- const EventEmitter = __cjs_getBuiltinModule("node:events");
21
- import render from '../packem_shared/render-Bm9Oa1sG.js';
22
- import { createKeySender } from '../packem_shared/KEY-STOdi-nc.js';
23
- export { KEY } from '../packem_shared/KEY-STOdi-nc.js';
24
- import { createScreen } from '../packem_shared/createScreen-Dh0sZlQ0.js';
25
- import { waitFor } from '../packem_shared/waitFor-Cv9M2jKA.js';
26
-
27
- class Stdout extends EventEmitter {
28
- columns;
29
- _lastFrame;
30
- _frames = [];
31
- constructor(columns = 100) {
32
- super();
33
- this.columns = columns;
34
- }
35
- get frames() {
36
- return this._frames;
37
- }
38
- lastFrame() {
39
- return this._lastFrame;
40
- }
41
- write = (frame) => {
42
- this._frames.push(frame);
43
- this._lastFrame = frame;
44
- return true;
45
- };
46
- }
47
- class Stderr extends EventEmitter {
48
- columns;
49
- _lastFrame;
50
- _frames = [];
51
- constructor(columns = 100) {
52
- super();
53
- this.columns = columns;
54
- }
55
- get frames() {
56
- return this._frames;
57
- }
58
- lastFrame() {
59
- return this._lastFrame;
60
- }
61
- write = (frame) => {
62
- this._frames.push(frame);
63
- this._lastFrame = frame;
64
- return true;
65
- };
66
- }
67
- class Stdin extends EventEmitter {
68
- isTTY = true;
69
- pendingData;
70
- write = (data) => {
71
- this.pendingData = data;
72
- this.emit("readable");
73
- this.emit("data", data);
74
- return true;
75
- };
76
- read() {
77
- const { pendingData } = this;
78
- this.pendingData = void 0;
79
- return pendingData;
80
- }
81
- setEncoding() {
82
- return this;
83
- }
84
- setRawMode() {
85
- return this;
86
- }
87
- resume() {
88
- return this;
89
- }
90
- pause() {
91
- return this;
92
- }
93
- ref() {
94
- return this;
95
- }
96
- unref() {
97
- return this;
98
- }
99
- }
100
- const instances = [];
101
- const testRender = (node, testOptions = {}) => {
102
- const { columns, options: renderOptions } = testOptions;
103
- const stdout = new Stdout(columns);
104
- const stderr = new Stderr(columns);
105
- const stdin = new Stdin();
106
- const instance = render(node, {
107
- debug: true,
108
- exitOnCtrlC: false,
109
- patchConsole: false,
110
- stderr,
111
- stdin,
112
- stdout,
113
- ...renderOptions
114
- });
115
- instances.push(instance);
116
- const screen = createScreen(() => stdout.lastFrame(), stdout.frames);
117
- const keys = createKeySender((data) => stdin.write(data));
118
- const flush = async () => {
119
- await new Promise((resolve) => {
120
- setTimeout(resolve, 0);
121
- });
122
- await new Promise((resolve) => {
123
- setTimeout(resolve, 0);
124
- });
125
- };
126
- return {
127
- cleanup: instance.cleanup,
128
- flush,
129
- get frames() {
130
- return stdout.frames;
131
- },
132
- keys,
133
- lastFrame: () => stdout.lastFrame(),
134
- rerender: instance.rerender,
135
- screen,
136
- stderr,
137
- stdin,
138
- stdout,
139
- unmount: instance.unmount,
140
- async waitFor(condition, options) {
141
- await waitFor(condition, () => screen.text(), options);
142
- }
143
- };
144
- };
145
- const cleanup = () => {
146
- for (const instance of instances) {
147
- instance.cleanup();
148
- }
149
- instances.length = 0;
150
- };
151
-
152
- export { cleanup, createKeySender, createScreen, testRender as render, waitFor };
1
+ var w=Object.defineProperty;var a=(t,e)=>w(t,"name",{value:e,configurable:!0});import{createRequire as F}from"node:module";import x from"../packem_shared/render-_r0K9K11.js";import{createKeySender as y}from"../packem_shared/KEY-Bk8B-3h_.js";import{KEY as $}from"../packem_shared/KEY-Bk8B-3h_.js";import{createScreen as T}from"../packem_shared/createScreen-CrLrxA6t.js";import{waitFor as j}from"../packem_shared/waitFor-Dj5zfL5s.js";const b=F(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=a(t=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,i]=o.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return o.getBuiltinModule(t)}return b(t)},"__cjs_getBuiltinModule"),l=v("node:events");var R=Object.defineProperty,r=a((t,e)=>R(t,"name",{value:e,configurable:!0}),"t");class S extends l{static{a(this,"v")}static{r(this,"Stdout")}columns;_lastFrame;_frames=[];constructor(e=100){super(),this.columns=e}get frames(){return this._frames}lastFrame(){return this._lastFrame}write=r(e=>(this._frames.push(e),this._lastFrame=e,!0),"write")}class D extends l{static{a(this,"x")}static{r(this,"Stderr")}columns;_lastFrame;_frames=[];constructor(e=100){super(),this.columns=e}get frames(){return this._frames}lastFrame(){return this._lastFrame}write=r(e=>(this._frames.push(e),this._lastFrame=e,!0),"write")}class P extends l{static{a(this,"R")}static{r(this,"Stdin")}isTTY=!0;pendingData;write=r(e=>(this.pendingData=e,this.emit("readable"),this.emit("data",e),!0),"write");read(){const{pendingData:e}=this;return this.pendingData=void 0,e}setEncoding(){return this}setRawMode(){return this}resume(){return this}pause(){return this}ref(){return this}unref(){return this}}const c=[],O=r((t,e={})=>{const{columns:i,options:p}=e,n=new S(i),d=new D(i),m=new P,u=x(t,{debug:!0,exitOnCtrlC:!1,patchConsole:!1,stderr:d,stdin:m,stdout:n,...p});c.push(u);const f=T(()=>n.lastFrame(),n.frames),h=y(s=>m.write(s)),_=r(async()=>{await new Promise(s=>{setTimeout(s,0)}),await new Promise(s=>{setTimeout(s,0)})},"flush");return{cleanup:u.cleanup,flush:_,get frames(){return n.frames},keys:h,lastFrame:r(()=>n.lastFrame(),"lastFrame"),rerender:u.rerender,screen:f,stderr:d,stdin:m,stdout:n,unmount:u.unmount,async waitFor(s,g){await j(s,()=>f.text(),g)}}},"testRender"),Y=r(()=>{for(const t of c)t.cleanup();c.length=0},"cleanup");export{$ as KEY,Y as cleanup,y as createKeySender,T as createScreen,O as render,j as waitFor};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/tui",
3
- "version": "1.0.0-alpha.6",
3
+ "version": "1.0.0-alpha.7",
4
4
  "description": "React-based TUI library powered by a native Rust diff engine, drop-in Ink-compatible API",
5
5
  "keywords": [
6
6
  "cli",
@@ -100,14 +100,14 @@
100
100
  }
101
101
  },
102
102
  "optionalDependencies": {
103
- "@visulima/tui-binding-darwin-arm64": "1.0.0-alpha.6",
104
- "@visulima/tui-binding-linux-arm64-musl": "1.0.0-alpha.6",
105
- "@visulima/tui-binding-linux-arm64-gnu": "1.0.0-alpha.6",
106
- "@visulima/tui-binding-darwin-x64": "1.0.0-alpha.6",
107
- "@visulima/tui-binding-linux-x64-gnu": "1.0.0-alpha.6",
108
- "@visulima/tui-binding-linux-x64-musl": "1.0.0-alpha.6",
109
- "@visulima/tui-binding-win32-arm64-msvc": "1.0.0-alpha.6",
110
- "@visulima/tui-binding-win32-x64-msvc": "1.0.0-alpha.6"
103
+ "@visulima/tui-binding-darwin-arm64": "1.0.0-alpha.7",
104
+ "@visulima/tui-binding-linux-arm64-musl": "1.0.0-alpha.7",
105
+ "@visulima/tui-binding-darwin-x64": "1.0.0-alpha.7",
106
+ "@visulima/tui-binding-linux-arm64-gnu": "1.0.0-alpha.7",
107
+ "@visulima/tui-binding-linux-x64-gnu": "1.0.0-alpha.7",
108
+ "@visulima/tui-binding-linux-x64-musl": "1.0.0-alpha.7",
109
+ "@visulima/tui-binding-win32-x64-msvc": "1.0.0-alpha.7",
110
+ "@visulima/tui-binding-win32-arm64-msvc": "1.0.0-alpha.7"
111
111
  },
112
112
  "engines": {
113
113
  "node": "^22.14.0 || >=24.10.0"
@@ -1,80 +0,0 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { useState, useRef, useCallback } from 'react';
3
- import useFocus from './useFocus-DLoGQJd9.js';
4
- import useInput from './useInput-DKZbqMRc.js';
5
- import Box from './Box-W1w_NGin.js';
6
- import Text from './Text-CtUwV89_.js';
7
-
8
- function Accordion({
9
- accentColor = "blue",
10
- allowMultiple = false,
11
- autoFocus = false,
12
- defaultExpanded,
13
- isDisabled = false,
14
- items
15
- }) {
16
- const { isFocused } = useFocus({ autoFocus, isActive: !isDisabled });
17
- const [expanded, setExpanded] = useState(() => {
18
- if (defaultExpanded === void 0 || defaultExpanded.length === 0) {
19
- return [];
20
- }
21
- if (!allowMultiple) {
22
- return defaultExpanded.slice(0, 1);
23
- }
24
- return defaultExpanded;
25
- });
26
- const [focusedIndex, setFocusedIndex] = useState(0);
27
- const focusedIndexRef = useRef(focusedIndex);
28
- focusedIndexRef.current = focusedIndex;
29
- const toggle = useCallback(
30
- (id) => {
31
- setExpanded((previous) => {
32
- const isOpen = previous.includes(id);
33
- if (allowMultiple) {
34
- return isOpen ? previous.filter((x) => x !== id) : [...previous, id];
35
- }
36
- return isOpen ? [] : [id];
37
- });
38
- },
39
- [allowMultiple]
40
- );
41
- useInput(
42
- useCallback(
43
- (input, key) => {
44
- if (!isFocused) {
45
- return;
46
- }
47
- const total = items.length;
48
- if ((key.downArrow || input === "j") && focusedIndexRef.current < total - 1) {
49
- setFocusedIndex(focusedIndexRef.current + 1);
50
- } else if ((key.upArrow || input === "k") && focusedIndexRef.current > 0) {
51
- setFocusedIndex(focusedIndexRef.current - 1);
52
- } else if (key.return || input === " ") {
53
- const target = items[focusedIndexRef.current];
54
- if (target) {
55
- toggle(target.id);
56
- }
57
- }
58
- },
59
- [isFocused, items, toggle]
60
- ),
61
- { isActive: !isDisabled && isFocused }
62
- );
63
- return jsx(Box, { flexDirection: "column", children: items.map((item, index) => {
64
- const isOpen = expanded.includes(item.id);
65
- const isItemFocused = isFocused && index === focusedIndex;
66
- const color = isItemFocused ? accentColor : void 0;
67
- return jsxs(Box, { flexDirection: "column", children: [
68
- jsxs(Box, { children: [
69
- jsxs(Text, { color, dimColor: isDisabled, children: [
70
- isItemFocused ? "▸ " : " ",
71
- isOpen ? "▼ " : "▶ "
72
- ] }),
73
- jsx(Text, { bold: isItemFocused, color, dimColor: isDisabled, children: item.title })
74
- ] }),
75
- isOpen ? jsx(Box, { flexDirection: "column", marginBottom: 1, marginLeft: 4, children: item.content }) : void 0
76
- ] }, item.id);
77
- }) });
78
- }
79
-
80
- export { Accordion as default };
@@ -1,17 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import Box from './Box-W1w_NGin.js';
3
- import Text from './Text-CtUwV89_.js';
4
- import { V as VARIANT_CONFIG } from './variant-config-DSZoX5TM.js';
5
-
6
- function Alert({ children, title, variant }) {
7
- const { color, icon } = VARIANT_CONFIG[variant];
8
- return jsxs(Box, { borderColor: color, borderStyle: "round", flexGrow: 1, gap: 1, paddingX: 1, children: [
9
- jsx(Box, { flexShrink: 0, children: jsx(Text, { color, children: icon }) }),
10
- jsxs(Box, { flexDirection: "column", flexGrow: 1, flexShrink: 1, gap: 1, minWidth: 0, children: [
11
- title ? jsx(Text, { bold: true, children: title }) : void 0,
12
- jsx(Text, { children })
13
- ] })
14
- ] });
15
- }
16
-
17
- export { Alert as default };
@@ -1,98 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
- import { useState, Children, isValidElement, useEffect, useCallback, cloneElement } from 'react';
3
- import Box from './Box-W1w_NGin.js';
4
-
5
- const getKey = (element) => {
6
- const { key } = element;
7
- return key == null ? void 0 : String(key);
8
- };
9
- const isAnimatable = (element) => {
10
- const type = element.type;
11
- if (type?.isAnimatable === true) {
12
- return true;
13
- }
14
- return typeof element.props === "object" && element.props !== null && "show" in element.props;
15
- };
16
- function AnimatePresence({ children }) {
17
- const [slots, setSlots] = useState(() => {
18
- const collected = [];
19
- Children.forEach(children, (child) => {
20
- if (!isValidElement(child)) {
21
- return;
22
- }
23
- const key = getKey(child);
24
- if (key === void 0) {
25
- return;
26
- }
27
- collected.push({
28
- element: isAnimatable(child) ? child : child,
29
- key,
30
- show: true
31
- });
32
- });
33
- return collected;
34
- });
35
- useEffect(() => {
36
- const incoming = /* @__PURE__ */ new Map();
37
- Children.forEach(children, (child) => {
38
- if (!isValidElement(child)) {
39
- return;
40
- }
41
- const key = getKey(child);
42
- if (key === void 0) {
43
- return;
44
- }
45
- incoming.set(key, isAnimatable(child) ? child : child);
46
- });
47
- setSlots((previous) => {
48
- const next = [];
49
- const seen = /* @__PURE__ */ new Set();
50
- let changed = false;
51
- for (const slot of previous) {
52
- if (incoming.has(slot.key)) {
53
- const nextElement = incoming.get(slot.key);
54
- if (!slot.show || slot.element !== nextElement) {
55
- changed = true;
56
- }
57
- next.push({
58
- element: nextElement,
59
- key: slot.key,
60
- show: true
61
- });
62
- seen.add(slot.key);
63
- } else {
64
- if (slot.show) {
65
- changed = true;
66
- }
67
- next.push({ ...slot, show: false });
68
- }
69
- }
70
- for (const [key, element] of incoming) {
71
- if (!seen.has(key)) {
72
- changed = true;
73
- next.push({ element, key, show: true });
74
- }
75
- }
76
- return changed ? next : previous;
77
- });
78
- }, [children]);
79
- const removeSlot = useCallback((key) => {
80
- setSlots((previous) => previous.filter((slot) => slot.key !== key));
81
- }, []);
82
- return jsx(Box, { flexDirection: "column", children: slots.map((slot) => {
83
- if (!isAnimatable(slot.element)) {
84
- return cloneElement(slot.element, { key: slot.key });
85
- }
86
- const originalOnExit = slot.element.props.onExit;
87
- return cloneElement(slot.element, {
88
- key: slot.key,
89
- onExit: () => {
90
- originalOnExit?.();
91
- removeSlot(slot.key);
92
- },
93
- show: slot.show
94
- });
95
- }) });
96
- }
97
-
98
- export { AnimatePresence as default };
@@ -1,104 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { useCallback } from 'react';
3
- import useFocus from './useFocus-DLoGQJd9.js';
4
- import useInput from './useInput-DKZbqMRc.js';
5
- import Box from './Box-W1w_NGin.js';
6
- import Text from './Text-CtUwV89_.js';
7
-
8
- const RISK_COLOR = {
9
- high: "red",
10
- low: "green",
11
- medium: "yellow"
12
- };
13
- const RISK_LABEL = {
14
- high: "HIGH RISK",
15
- low: "LOW RISK",
16
- medium: "MEDIUM RISK"
17
- };
18
- const formatParameterValue = (value) => {
19
- if (value === null) {
20
- return "null";
21
- }
22
- if (typeof value === "string") {
23
- return value;
24
- }
25
- if (typeof value === "number" || typeof value === "boolean") {
26
- return String(value);
27
- }
28
- try {
29
- return JSON.stringify(value);
30
- } catch {
31
- return String(value);
32
- }
33
- };
34
- function ApprovalPrompt({
35
- accentColor,
36
- autoFocus = true,
37
- children,
38
- description,
39
- isDisabled = false,
40
- onDecision,
41
- params,
42
- risk = "medium",
43
- tool
44
- }) {
45
- const riskColor = RISK_COLOR[risk];
46
- const color = accentColor ?? riskColor;
47
- const { isFocused } = useFocus({ autoFocus, isActive: !isDisabled });
48
- useInput(
49
- useCallback(
50
- (input, key) => {
51
- const typed = input.toLowerCase();
52
- if (typed === "y" || key.return) {
53
- onDecision("allow-once");
54
- return;
55
- }
56
- if (typed === "a") {
57
- onDecision("allow-always");
58
- return;
59
- }
60
- if (typed === "n" || key.escape) {
61
- onDecision("deny");
62
- }
63
- },
64
- [onDecision]
65
- ),
66
- { isActive: !isDisabled && isFocused }
67
- );
68
- const parameterEntries = params === void 0 ? [] : Object.entries(params);
69
- return jsxs(Box, { borderColor: riskColor, borderStyle: "round", flexDirection: "column", paddingX: 1, children: [
70
- jsxs(Box, { children: [
71
- jsxs(Text, { backgroundColor: riskColor, color: "black", children: [
72
- " ",
73
- RISK_LABEL[risk],
74
- " "
75
- ] }),
76
- jsxs(Text, { children: [
77
- " ",
78
- jsx(Text, { bold: true, children: tool })
79
- ] })
80
- ] }),
81
- description === void 0 ? void 0 : jsx(Box, { marginTop: 1, children: jsx(Text, { children: description }) }),
82
- parameterEntries.length === 0 ? void 0 : jsx(Box, { flexDirection: "column", marginTop: 1, children: parameterEntries.map(([name, value]) => jsxs(Box, { children: [
83
- jsxs(Text, { color: "cyan", children: [
84
- name,
85
- "="
86
- ] }),
87
- jsx(Text, { wrap: "truncate-end", children: formatParameterValue(value) })
88
- ] }, name)) }),
89
- children === void 0 ? void 0 : jsx(Box, { marginTop: 1, children }),
90
- jsx(Box, { marginTop: 1, children: jsxs(Text, { children: [
91
- "Allow? [",
92
- jsx(Text, { bold: true, color, children: "y" }),
93
- "es /",
94
- " ",
95
- jsx(Text, { bold: true, color, children: "a" }),
96
- "lways /",
97
- " ",
98
- jsx(Text, { bold: true, color, children: "n" }),
99
- "o ]"
100
- ] }) })
101
- ] });
102
- }
103
-
104
- export { ApprovalPrompt as default };