@visulima/tui 1.0.0-alpha.16 → 1.0.0-alpha.18

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 (166) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/LICENSE.md +218 -253
  3. package/dist/components/accordion.d.ts +1 -1
  4. package/dist/components/approval-prompt.d.ts +1 -1
  5. package/dist/components/area-chart.d.ts +1 -1
  6. package/dist/components/badge.d.ts +1 -1
  7. package/dist/components/bar-chart.d.ts +1 -1
  8. package/dist/components/blink-dot.d.ts +1 -1
  9. package/dist/components/box.d.ts +4 -3
  10. package/dist/components/breadcrumb.d.ts +1 -1
  11. package/dist/components/button.d.ts +1 -1
  12. package/dist/components/calendar.d.ts +1 -1
  13. package/dist/components/canvas.js +1 -1
  14. package/dist/components/card.d.ts +1 -1
  15. package/dist/components/checkbox.d.ts +1 -1
  16. package/dist/components/collapsible.d.ts +1 -1
  17. package/dist/components/command-palette.d.ts +1 -1
  18. package/dist/components/content-switcher.d.ts +1 -1
  19. package/dist/components/controlled-scroll-view.d.ts +4 -3
  20. package/dist/components/controlled-scroll-view.js +1 -1
  21. package/dist/components/cursor.d.ts +4 -3
  22. package/dist/components/date-picker.d.ts +1 -1
  23. package/dist/components/definition-list.d.ts +1 -1
  24. package/dist/components/dialog.d.ts +5 -4
  25. package/dist/components/dialog.js +1 -1
  26. package/dist/components/divider.d.ts +1 -1
  27. package/dist/components/form.d.ts +1 -1
  28. package/dist/components/gauge.d.ts +1 -1
  29. package/dist/components/gradient.d.ts +1 -18
  30. package/dist/components/gradient.js +1 -4
  31. package/dist/components/heading.d.ts +1 -1
  32. package/dist/components/heatmap.d.ts +1 -1
  33. package/dist/components/histogram.d.ts +1 -1
  34. package/dist/components/kbd.d.ts +1 -1
  35. package/dist/components/line-chart.d.ts +1 -1
  36. package/dist/components/link.js +1 -1
  37. package/dist/components/loading-indicator.d.ts +2 -2
  38. package/dist/components/menu.d.ts +1 -1
  39. package/dist/components/message-bubble.d.ts +1 -1
  40. package/dist/components/model-badge.d.ts +1 -1
  41. package/dist/components/multi-select.d.ts +1 -1
  42. package/dist/components/option-list.d.ts +1 -1
  43. package/dist/components/paragraph.d.ts +1 -1
  44. package/dist/components/placeholder.d.ts +1 -1
  45. package/dist/components/progress-bar.d.ts +3 -2
  46. package/dist/components/radio-group.d.ts +1 -1
  47. package/dist/components/scatter-plot.d.ts +1 -1
  48. package/dist/components/scroll-bar-box.d.ts +4 -3
  49. package/dist/components/scroll-bar.d.ts +4 -3
  50. package/dist/components/scroll-list.d.ts +4 -3
  51. package/dist/components/scroll-list.js +1 -1
  52. package/dist/components/scroll-view.d.ts +4 -3
  53. package/dist/components/scroll-view.js +1 -1
  54. package/dist/components/search-input.d.ts +1 -1
  55. package/dist/components/select-input-indicator.d.ts +1 -1
  56. package/dist/components/select-input-item.d.ts +1 -1
  57. package/dist/components/select-input.d.ts +1 -1
  58. package/dist/components/shimmer-text.d.ts +1 -1
  59. package/dist/components/slider.d.ts +1 -1
  60. package/dist/components/sparkline.d.ts +1 -1
  61. package/dist/components/spinner.d.ts +1 -1
  62. package/dist/components/spinner.js +1 -1
  63. package/dist/components/static-render.d.ts +8 -3
  64. package/dist/components/static-render.js +1 -1
  65. package/dist/components/static.d.ts +3 -2
  66. package/dist/components/status-line.d.ts +1 -1
  67. package/dist/components/stepper.d.ts +1 -1
  68. package/dist/components/streaming-text.d.ts +1 -1
  69. package/dist/components/switch.d.ts +1 -1
  70. package/dist/components/tabs.d.ts +1 -1
  71. package/dist/components/tag.d.ts +1 -1
  72. package/dist/components/text.d.ts +3 -2
  73. package/dist/components/text.js +1 -1
  74. package/dist/components/tooltip.d.ts +1 -1
  75. package/dist/components/tree-view-entry.d.ts +4 -3
  76. package/dist/core/index.d.ts +2 -1
  77. package/dist/core/index.js +1 -1
  78. package/dist/ink/hooks/use-app.d.ts +1 -1
  79. package/dist/ink/hooks/use-box-metrics.d.ts +7 -4
  80. package/dist/ink/hooks/use-box-metrics.js +1 -1
  81. package/dist/ink/hooks/use-focus-manager.d.ts +2 -1
  82. package/dist/ink/hooks/use-input.d.ts +1 -1
  83. package/dist/ink/hooks/use-input.js +1 -1
  84. package/dist/ink/hooks/use-linked-scroll.d.ts +4 -3
  85. package/dist/ink/hooks/use-paste.d.ts +2 -1
  86. package/dist/ink/hooks/use-paste.js +1 -1
  87. package/dist/ink/hooks/use-text-selection.d.ts +5 -4
  88. package/dist/ink/hooks/use-text-selection.js +1 -1
  89. package/dist/ink/hooks/use-window-size.js +1 -1
  90. package/dist/ink/index.d.ts +10 -7
  91. package/dist/ink/index.js +1 -1
  92. package/dist/packem_shared/ControlledScrollView-CIc-x1Cx.js +1 -0
  93. package/dist/packem_shared/{DevTools-ClnTSU76.js → DevTools-ClAYpMVI.js} +1 -1
  94. package/dist/packem_shared/InputParser-B_qZcN3r.js +2 -0
  95. package/dist/packem_shared/{LayoutNode-Q7nU3hmO.js → LayoutNode-B8zej4dm.js} +1 -1
  96. package/dist/packem_shared/{MouseProvider-CHU5DuwC.js → MouseProvider-PnIUKURs.js} +1 -1
  97. package/dist/packem_shared/{ScrollList-Dxgv-mhZ.js → ScrollList-C7nZ9ufK.js} +1 -1
  98. package/dist/packem_shared/{ScrollView-Dq2v5zJS.js → ScrollView-DKZ8OM-m.js} +1 -1
  99. package/dist/packem_shared/TuiApp-BVDXP0Cv.js +1 -0
  100. package/dist/packem_shared/ansi-parser-B6uXaq65.js +1 -0
  101. package/dist/packem_shared/colorize-DbTZMrJO.js +1 -0
  102. package/dist/packem_shared/{comparePoints-l0iqUoL_.js → comparePoints-YxQfR_zq.js} +1 -1
  103. package/dist/packem_shared/{controlled-scroll-view-CikQ90_V.js → controlled-scroll-view-CcUS50jx.js} +1 -1
  104. package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +2 -0
  105. package/dist/packem_shared/createScreen-CrLrxA6t.js +3 -0
  106. package/dist/packem_shared/dom-BG-LS10p.js +1 -0
  107. package/dist/packem_shared/{dom.d-BZZeZlyP.d.ts → dom.d-CcFuBd-k.d.ts} +11 -1
  108. package/dist/packem_shared/{getPathToRoot-Nb2eTx2o.js → getPathToRoot-D5Hns9Er.js} +1 -1
  109. package/dist/packem_shared/getScrollHeight-ClEOyLHH.js +1 -0
  110. package/dist/packem_shared/input.d-CgxV2e8U.d.ts +90 -0
  111. package/dist/packem_shared/{layout-P24eyWyL.js → layout-BMo200nF.js} +1 -1
  112. package/dist/packem_shared/measure-text-DDjHT1jD.js +3 -0
  113. package/dist/packem_shared/{measureElement-CRKlFSvD.js → measureElement-BTtTFZg4.js} +1 -1
  114. package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +1 -0
  115. package/dist/packem_shared/processLayout-FEKj_mWu.js +1 -0
  116. package/dist/packem_shared/{reconciler-tOH9yL_j.js → reconciler-CUbhOvcr.js} +1 -1
  117. package/dist/packem_shared/{reconciler-BQvF1kRj.js → reconciler-DIfG72R9.js} +1 -1
  118. package/dist/packem_shared/{render-yGJFE4of.js → render-Dh7HMhK1.js} +1 -1
  119. package/dist/packem_shared/render-bdbSzkJo.js +26 -0
  120. package/dist/packem_shared/{render.d-BJmVQ_cd.d.ts → render.d-B1kiO3Ca.d.ts} +19 -1
  121. package/dist/packem_shared/{renderToString-D4JqS-Zv.js → renderToString-BbQiRHrd.js} +1 -1
  122. package/dist/packem_shared/{renderToString-GyN-Rw9F.js → renderToString-DVE0cEHt.js} +1 -1
  123. package/dist/packem_shared/renderTreeToBuffer-CZilzyhN.js +2 -0
  124. package/dist/packem_shared/renderer-Cfi6ZyHf.js +17 -0
  125. package/dist/packem_shared/{selection.d-vfuEzv1p.d.ts → selection.d-DAh7REnW.d.ts} +1 -1
  126. package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +1 -0
  127. package/dist/packem_shared/squashTextNodesWithMap-DCdi3SZ2.js +1 -0
  128. package/dist/packem_shared/{styles.d-i6Mejqz2.d.ts → styles.d-cMo36xQz.d.ts} +37 -105
  129. package/dist/packem_shared/text-width-BU2eeTWn.js +2 -0
  130. package/dist/packem_shared/utils-CoviI5Vm.js +1 -0
  131. package/dist/packem_shared/{wrapOrTruncateStyledLine-D29Fq7pW.js → wrapOrTruncateStyledLine-BZ00SM8i.js} +1 -1
  132. package/dist/react/index.d.ts +2 -1
  133. package/dist/react/index.js +1 -1
  134. package/dist/testing/index.d.ts +5 -4
  135. package/dist/testing/index.js +1 -1
  136. package/index.js +539 -691
  137. package/package.json +28 -16
  138. package/dist/packem_shared/ControlledScrollView-X_OTc-Cw.js +0 -1
  139. package/dist/packem_shared/InputParser-Cfi5GVKV.js +0 -2
  140. package/dist/packem_shared/TuiApp-BSWPFrDu.js +0 -1
  141. package/dist/packem_shared/ansi-parser-C5JuL732.js +0 -1
  142. package/dist/packem_shared/boxes-DyY_LXCi.js +0 -1
  143. package/dist/packem_shared/colorize-gy_cY-wC.js +0 -2
  144. package/dist/packem_shared/constants-D12jy2Zh-RSfxu1eM.js +0 -1
  145. package/dist/packem_shared/createInlineLoop-fhXU93QT.js +0 -2
  146. package/dist/packem_shared/createScreen-87XLHZq6.js +0 -3
  147. package/dist/packem_shared/dom-CMbdnYbk.js +0 -8
  148. package/dist/packem_shared/erase-DeDffywz.js +0 -1
  149. package/dist/packem_shared/get-string-width-4oMZhv2Q.js +0 -1
  150. package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +0 -1
  151. package/dist/packem_shared/index-LwZN2xbk.js +0 -75
  152. package/dist/packem_shared/index.d-Bk52cbgN.d.ts +0 -14
  153. package/dist/packem_shared/index.server.d-eZWyC2Ku.d.ts +0 -5
  154. package/dist/packem_shared/input.d-D-Yxqha8.d.ts +0 -172
  155. package/dist/packem_shared/measure-text-CIs55Wao.js +0 -3
  156. package/dist/packem_shared/mode-BOIU4Roy.js +0 -1
  157. package/dist/packem_shared/parseSgrMouse-DoBY7MKw.js +0 -1
  158. package/dist/packem_shared/processLayout-Dmgf0LO6.js +0 -1
  159. package/dist/packem_shared/render-D9bHMHrx.js +0 -26
  160. package/dist/packem_shared/renderTreeToBuffer-DWl5_yTW.js +0 -2
  161. package/dist/packem_shared/renderer-Cidd3s9K.js +0 -17
  162. package/dist/packem_shared/setEnableStyledLineCache-Aja0FbWo.js +0 -1
  163. package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.js +0 -1
  164. package/dist/packem_shared/strip-C6HQYmlg.js +0 -1
  165. package/dist/packem_shared/text-width-DSx26OmB.js +0 -2
  166. package/dist/packem_shared/utils-THUhYKG2.js +0 -1
@@ -1,4 +1,4 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
@@ -1,4 +1,4 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
@@ -1,4 +1,4 @@
1
- import { S as SpinnerName } from "../packem_shared/index.d-Bk52cbgN.js";
1
+ import { SpinnerName } from '@visulima/spinner';
2
2
  import { ReactElement } from 'react';
3
3
  type Props = {
4
4
  /**
@@ -1 +1 @@
1
- var v=Object.defineProperty;var _=(r,e)=>v(r,"name",{value:e,configurable:!0});import{jsx as o}from"react/jsx-runtime";import c from"../ink/hooks/use-animation.js";import{Text as g}from"./text.js";var d=Object.defineProperty,f=_((r,e)=>d(r,"name",{value:e,configurable:!0}),"a"),u=Object.defineProperty,n=f((r,e)=>u(r,"name",{value:e,configurable:!0}),"e"),p={interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},b={interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},h={interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},w={interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},y={interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},O={interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},S={interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},k={interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},j={interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},P={interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},x={interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},B={interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},$={interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},q={interval:80,frames:["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},M={interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},D={interval:80,frames:["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},H={interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},C={interval:130,frames:["-","\\","|","/"]},R={interval:100,frames:["⠂","-","–","—","–","-"]},T={interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},z={interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},A={interval:400,frames:[". ",".. ","..."," "]},F={interval:200,frames:[". ",".. ","..."," .."," ."," "]},I={interval:70,frames:["✶","✸","✹","✺","✹","✷"]},L={interval:80,frames:["+","x","*"]},N={interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},Q={interval:100,frames:["☱","☲","☴"]},V={interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},W={interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},E={interval:140,frames:[" ",".","o","O","@","*"," "]},G={interval:120,frames:[".","o","O","°","O","o","."]},J={interval:100,frames:["▓","▒","░"]},K={interval:120,frames:["⠁","⠂","⠄","⠂"]},X={interval:120,frames:["▖","▘","▝","▗"]},Y={interval:100,frames:["▌","▀","▐","▄"]},Z={interval:50,frames:["◢","◣","◤","◥"]},U={interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},rr={interval:100,frames:["◜","◠","◝","◞","◡","◟"]},er={interval:120,frames:["◡","⊙","◠"]},_r={interval:180,frames:["◰","◳","◲","◱"]},ar={interval:120,frames:["◴","◷","◶","◵"]},tr={interval:50,frames:["◐","◓","◑","◒"]},nr={interval:100,frames:["╫","╪"]},lr={interval:250,frames:["⊶","⊷"]},sr={interval:80,frames:["▫","▪"]},ir={interval:120,frames:["□","■"]},mr={interval:100,frames:["■","□","▪","▫"]},fr={interval:100,frames:["▮","▯"]},vr={interval:300,frames:["ဝ","၀"]},or={interval:80,frames:["⦾","⦿"]},cr={interval:100,frames:["◍","◌"]},gr={interval:100,frames:["◉","◎"]},dr={interval:100,frames:["㊂","㊀","㊁"]},ur={interval:50,frames:["⧇","⧆"]},pr={interval:120,frames:["☗","☖"]},br={interval:80,frames:["=","*","-"]},hr={interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},wr={interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},yr={interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},Or={interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},Sr={interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},kr={interval:200,frames:["😄 ","😝 "]},jr={interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},Pr={interval:100,frames:["💛 ","💙 ","💜 ","💚 ","💗 "]},xr={interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},Br={interval:180,frames:["🌍 ","🌎 ","🌏 "]},$r={interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},qr={interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},Mr={interval:140,frames:["🚶 ","🏃 "]},Dr={interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},Hr={interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},Cr={interval:100,frames:["d","q","p","b"]},Rr={interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},Tr={interval:400,frames:["🌲","🎄"]},zr={interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},Ar={interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},Fr={interval:150,frames:["-","=","≡"]},Ir={interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},Lr={interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},Nr={interval:80,frames:["🤜    🤛 ","🤜    🤛 ","🤜    🤛 "," 🤜  🤛  ","  🤜🤛   "," 🤜✨🤛   ","🤜 ✨ 🤛  "]},Qr={interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},Vr={interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ ","  ","  ","  "]},Wr={interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},Er={interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},Gr={interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},Jr={interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},Kr={interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},Xr={interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},Yr={interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},Zr={interval:80,frames:["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]};const l={dots:p,dots2:b,dots3:h,dots4:w,dots5:y,dots6:O,dots7:S,dots8:k,dots9:j,dots10:P,dots11:x,dots12:B,dots13:$,dots14:q,dots8Bit:M,dotsCircle:D,sand:H,line:C,line2:R,rollingLine:T,pipe:z,simpleDots:A,simpleDotsScrolling:F,star:I,star2:L,flip:N,hamburger:Q,growVertical:V,growHorizontal:W,balloon:E,balloon2:G,noise:J,bounce:K,boxBounce:X,boxBounce2:Y,triangle:Z,binary:U,arc:rr,circle:er,squareCorners:_r,circleQuarters:ar,circleHalves:tr,squish:nr,toggle:lr,toggle2:sr,toggle3:ir,toggle4:mr,toggle5:fr,toggle6:vr,toggle7:or,toggle8:cr,toggle9:gr,toggle10:dr,toggle11:ur,toggle12:pr,toggle13:br,arrow:hr,arrow2:wr,arrow3:yr,bouncingBar:Or,bouncingBall:Sr,smiley:kr,monkey:jr,hearts:Pr,clock:xr,earth:Br,material:$r,moon:qr,runner:Mr,pong:Dr,shark:Hr,dqpb:Cr,weather:Rr,christmas:Tr,grenade:zr,point:Ar,layer:Fr,betaWave:Ir,fingerDance:Lr,fistBump:Nr,soccerHeader:Qr,mindblown:Vr,speaker:Wr,orangePulse:Er,bluePulse:Gr,orangeBluePulse:Jr,timeTravel:Kr,aesthetic:Xr,dwarfFortress:Yr,fish:Zr};var Ur=Object.defineProperty,re=n((r,e)=>Ur(r,"name",{value:e,configurable:!0}),"o");const m=Object.keys(l);function s(){const r=Math.floor(Math.random()*m.length),e=m[r];return l[e]}_(s,"i");f(s,"Ir");n(s,"randomSpinner");re(s,"randomSpinner");var ee=Object.defineProperty,i=n((r,e)=>ee(r,"name",{value:e,configurable:!0}),"r");const _e={breathe:{frames:["⠀","⠂","⠌","⡑","⢕","⢝","⣫","⣟","⣿","⣟","⣫","⢝","⢕","⡑","⠌","⠂","⠀"],interval:100},cascade:{frames:["⠀⠀⠀⠀","⠁⠀⠀⠀","⠋⠀⠀⠀","⠞⠁⠀⠀","⡴⠋⠀⠀","⣠⠞⠁⠀","⢀⡴⠋⠀","⠀⣠⠞⠁","⠀⢀⡴⠋","⠀⠀⣠⠞","⠀⠀⢀⡴","⠀⠀⠀⣠","⠀⠀⠀⢀"],interval:60},checkerboard:{frames:["⢕⢕⢕","⡪⡪⡪","⢊⠔⡡","⡡⢊⠔"],interval:250},columns:{frames:["⡀⠀⠀","⡄⠀⠀","⡆⠀⠀","⡇⠀⠀","⣇⠀⠀","⣧⠀⠀","⣷⠀⠀","⣿⠀⠀","⣿⡀⠀","⣿⡄⠀","⣿⡆⠀","⣿⡇⠀","⣿⣇⠀","⣿⣧⠀","⣿⣷⠀","⣿⣿⠀","⣿⣿⡀","⣿⣿⡄","⣿⣿⡆","⣿⣿⡇","⣿⣿⣇","⣿⣿⣧","⣿⣿⣷","⣿⣿⣿","⣿⣿⣿","⠀⠀⠀"],interval:60},diagSwipe:{frames:["⠁⠀","⠋⠀","⠟⠁","⡿⠋","⣿⠟","⣿⡿","⣿⣿","⣿⣿","⣾⣿","⣴⣿","⣠⣾","⢀⣴","⠀⣠","⠀⢀","⠀⠀","⠀⠀"],interval:60},dna:{frames:["⠋⠉⠙⠚","⠉⠙⠚⠒","⠙⠚⠒⠂","⠚⠒⠂⠂","⠒⠂⠂⠒","⠂⠂⠒⠲","⠂⠒⠲⠴","⠒⠲⠴⠤","⠲⠴⠤⠄","⠴⠤⠄⠋","⠤⠄⠋⠉","⠄⠋⠉⠙"],interval:80},doubleArrow:{frames:["⇐","⇖","⇑","⇗","⇒","⇘","⇓","⇙"],interval:100},fillSweep:{frames:["⣀⣀","⣤⣤","⣶⣶","⣿⣿","⣿⣿","⣿⣿","⣶⣶","⣤⣤","⣀⣀","⠀⠀","⠀⠀"],interval:100},helix:{frames:["⢌⣉⢎⣉","⣉⡱⣉⡱","⣉⢎⣉⢎","⡱⣉⡱⣉","⢎⣉⢎⣉","⣉⡱⣉⡱","⣉⢎⣉⢎","⡱⣉⡱⣉","⢎⣉⢎⣉","⣉⡱⣉⡱","⣉⢎⣉⢎","⡱⣉⡱⣉","⢎⣉⢎⣉","⣉⡱⣉⡱","⣉⢎⣉⢎","⡱⣉⡱⣉"],interval:80},infinity:{frames:["⢎⡱⣉⠆","⢎⡱⣈⠆","⢎⡱⣀⠆","⢎⡱⣀⠄","⢎⡱⣀ ","⢎⡱⡀ ","⢎⡱ ","⢎⡱ ","⢎⡡ ","⢎⡠ ","⢆⡠ ","⢄⡠ ","⢀⡠ "," ⡠ "," ⠠ "," ⠰ "," ⠐ "," ⠐⠁ "," ⠐⠉ "," ⠐⠉⠂"," ⠐⠉⠆"," ⠐⢉⠆"," ⠐⣉⠆"," ⠰⣉⠆"," ⠰⣉⠆"," ⠱⣉⠆","⠈⠱⣉⠆","⠊⠱⣉⠆","⠎⠱⣉⠆","⢎⠱⣉⠆","⢎⡱⣉⠆","⢎⡱⣉⠆"],interval:60},orbit:{frames:["⠃","⠉","⠘","⠰","⢠","⣀","⡄","⠆"],interval:100},pulse:{frames:["⠀⠶⠀","⠰⣿⠆","⢾⣉⡷","⣏⠀⣹","⡁⠀⢈"],interval:180},rain:{frames:["⢁⠂⠔⠈","⠂⠌⡠⠐","⠄⡐⢀⠡","⡈⠠⠀⢂","⠐⢀⠁⠄","⠠⠁⠊⡀","⢁⠂⠔⠈","⠂⠌⡠⠐","⠄⡐⢀⠡","⡈⠠⠀⢂","⠐⢀⠁⠄","⠠⠁⠊⡀"],interval:100},scan:{frames:["⠀⠀⠀⠀","⡇⠀⠀⠀","⣿⠀⠀⠀","⢸⡇⠀⠀","⠀⣿⠀⠀","⠀⢸⡇⠀","⠀⠀⣿⠀","⠀⠀⢸⡇","⠀⠀⠀⣿","⠀⠀⠀⢸"],interval:70},scanline:{frames:["⠉⠉⠉","⠓⠓⠓","⠦⠦⠦","⣄⣄⣄","⠦⠦⠦","⠓⠓⠓"],interval:120},snake:{frames:["⣁⡀","⣉⠀","⡉⠁","⠉⠉","⠈⠙","⠀⠛","⠐⠚","⠒⠒","⠖⠂","⠶⠀","⠦⠄","⠤⠤","⠠⢤","⠀⣤","⢀⣠","⣀⣀"],interval:80},sparkle:{frames:["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],interval:150},wave:{frames:["⠁⠂⠄⡀","⠂⠄⡀⢀","⠄⡀⢀⠠","⡀⢀⠠⠐","⢀⠠⠐⠈","⠠⠐⠈⠁","⠐⠈⠁⠂","⠈⠁⠂⠄"],interval:100},waveRows:{frames:["⠖⠉⠉⠑","⡠⠖⠉⠉","⣠⡠⠖⠉","⣄⣠⡠⠖","⠢⣄⣠⡠","⠙⠢⣄⣠","⠉⠙⠢⣄","⠊⠉⠙⠢","⠜⠊⠉⠙","⡤⠜⠊⠉","⣀⡤⠜⠊","⢤⣀⡤⠜","⠣⢤⣀⡤","⠑⠣⢤⣀","⠉⠑⠣⢤","⠋⠉⠑⠣"],interval:90}},a={...l,..._e},ae=i(r=>a[r],"getSpinner");i(()=>{const r=Object.keys(a),e=Math.floor(Math.random()*r.length),t=r[e];return a[t]},"getRandomSpinner");i(()=>Object.keys(a),"getSpinnerNames");var te=Object.defineProperty,ne=_((r,e)=>te(r,"name",{value:e,configurable:!0}),"t");function le({type:r="dots"}){const e=ae(r),{frame:t}=c({interval:e.interval});return o(g,{children:e.frames[t%e.frames.length]})}_(le,"n");ne(le,"Spinner");export{le as Spinner,le as default};
1
+ var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});import{jsx as a}from"react/jsx-runtime";import{getSpinner as i}from"@visulima/spinner";import m from"../ink/hooks/use-animation.js";import{Text as f}from"./text.js";var p=Object.defineProperty,s=t((e,r)=>p(e,"name",{value:r,configurable:!0}),"t");function l({type:e="dots"}){const r=i(e),{frame:n}=m({interval:r.interval});return a(f,{children:r.frames[n%r.frames.length]})}t(l,"n");s(l,"Spinner");export{l as Spinner,l as default};
@@ -1,8 +1,10 @@
1
1
  import React, { ReactNode, DependencyList } from 'react';
2
- import { S as Styles } from "../packem_shared/styles.d-i6Mejqz2.js";
3
- import "../packem_shared/index.server.d-eZWyC2Ku.js";
4
- import 'type-fest';
2
+ import { a as DOMElement } from "../packem_shared/dom.d-CcFuBd-k.js";
3
+ import { S as Styles } from "../packem_shared/styles.d-cMo36xQz.js";
5
4
  import 'yoga-layout';
5
+ import '@visulima/colorize';
6
+ import 'cli-boxes';
7
+ import 'type-fest';
6
8
 
7
9
  /**
8
10
  * StaticRender component — pre-renders children once and caches the result.
@@ -31,18 +33,21 @@ import 'yoga-layout';
31
33
  /**
32
34
  * @property children Render function invoked once to produce the cached content.
33
35
  * @property deps Dependencies that control when the static content is re-rendered. When any dependency changes (shallow, Object.is comparison), the cache is invalidated and children() is invoked again. If omitted, the cache is invalidated whenever the children function reference changes.
36
+ * @property onRender Callback fired after the static content has been rendered and cached. The node's cachedRender holds the measured width/height — useful for reacting to the cached block's size without setting up a full ResizeObserver.
34
37
  * @property style Optional style applied to the static-render container.
35
38
  * @property width Optional fixed width for the cached region.
36
39
  */
37
40
  type Props = {
38
41
  readonly children: () => ReactNode;
39
42
  readonly deps?: DependencyList;
43
+ readonly onRender?: (node: DOMElement) => void;
40
44
  readonly style?: Styles;
41
45
  readonly width?: number;
42
46
  };
43
47
  declare const StaticRender: ({
44
48
  children,
45
49
  deps,
50
+ onRender,
46
51
  style,
47
52
  width
48
53
  }: Props) => React.ReactNode;
@@ -1 +1 @@
1
- var p=Object.defineProperty;var d=(e,r)=>p(e,"name",{value:r,configurable:!0});import{jsx as v}from"react/jsx-runtime";import{useRef as s,useLayoutEffect as R,useEffect as m,useMemo as y}from"react";var b=Object.defineProperty,f=d((e,r)=>b(e,"name",{value:r,configurable:!0}),"u");const g=f((e,r)=>{if(e===r)return!0;if(!e||!r||e.length!==r.length)return!1;for(const[u,c]of e.entries())if(!Object.is(c,r[u]))return!1;return!0},"areDepsEqual"),x=f(({children:e,deps:r,style:u,width:c})=>{const n=s(null),a=s(!1),l=s(r),o=s(e);let i=!1;r!==void 0?g(l.current,r)||(i=!0,l.current=r):e!==o.current&&(i=!0,o.current=e),i&&(a.current=!1,n.current&&(n.current.cachedRender=void 0)),R(()=>{const t=n.current;t&&(t.internal_onRendered=()=>{a.current=!0})}),m(()=>()=>{const t=n.current;t&&(t.cachedRender=void 0,t.internal_onRendered=void 0)},[]);const h=y(()=>({...u,width:c}),[u,c]);return v("ink-static-render",{ref:n,style:h,children:a.current?null:e()})},"StaticRender");export{x as StaticRender,x as default};
1
+ var p=Object.defineProperty;var R=(e,r)=>p(e,"name",{value:r,configurable:!0});import{jsx as v}from"react/jsx-runtime";import{useRef as u,useLayoutEffect as y,useEffect as b,useMemo as g}from"react";var j=Object.defineProperty,h=R((e,r)=>j(e,"name",{value:r,configurable:!0}),"u");const E=h((e,r)=>{if(e===r)return!0;if(!e||!r||e.length!==r.length)return!1;for(const[c,a]of e.entries())if(!Object.is(a,r[c]))return!1;return!0},"areDepsEqual"),O=h(({children:e,deps:r,onRender:c,style:a,width:s})=>{const n=u(null),i=u(!1),d=u(r),l=u(e),f=u(c);f.current=c;let o=!1;r!==void 0?E(d.current,r)||(o=!0,d.current=r):e!==l.current&&(o=!0,l.current=e),o&&(i.current=!1,n.current&&(n.current.cachedRender=void 0)),y(()=>{const t=n.current;t&&(t.internal_onRendered=()=>{i.current=!0,f.current?.(t)})}),b(()=>()=>{const t=n.current;t&&(t.cachedRender=void 0,t.internal_onRendered=void 0)},[]);const m=g(()=>({...a,width:s}),[a,s]);return v("ink-static-render",{ref:n,style:m,children:i.current?null:e()})},"StaticRender");export{O as StaticRender,O as default};
@@ -1,6 +1,7 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
- import { S as Styles } from "../packem_shared/styles.d-i6Mejqz2.js";
3
- import "../packem_shared/index.server.d-eZWyC2Ku.js";
2
+ import { S as Styles } from "../packem_shared/styles.d-cMo36xQz.js";
3
+ import '@visulima/colorize';
4
+ import 'cli-boxes';
4
5
  import 'type-fest';
5
6
  import 'yoga-layout';
6
7
  type Props<T> = {
@@ -1,4 +1,4 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
@@ -1,4 +1,4 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type StepStatus = "active" | "completed" | "error" | "pending";
@@ -1,4 +1,4 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
@@ -1,4 +1,4 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type Props = {
@@ -1,4 +1,4 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  import { Props as Props$1 } from "./tab.js";
@@ -1,4 +1,4 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type TagVariant = "outline" | "solid" | "subtle";
@@ -1,7 +1,8 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
- import { S as Styles } from "../packem_shared/styles.d-i6Mejqz2.js";
4
+ import { S as Styles } from "../packem_shared/styles.d-cMo36xQz.js";
5
+ import 'cli-boxes';
5
6
  import 'yoga-layout';
6
7
  type Props = {
7
8
  /**
@@ -1 +1 @@
1
- var w=Object.defineProperty;var n=(t,e)=>w(t,"name",{value:e,configurable:!0});import{jsx as j}from"react/jsx-runtime";import{g as a,d as p}from"../packem_shared/colorize-gy_cY-wC.js";import{useContext as h,useCallback as y}from"react";import{a as S}from"../packem_shared/accessibility-context-DDyHTwmA.js";import{b as T}from"../packem_shared/background-context-rjOaWFki.js";var $=Object.defineProperty,A=n((t,e)=>$(t,"name",{value:e,configurable:!0}),"g");function D({"aria-hidden":t=!1,"aria-label":e,backgroundColor:s,bold:o=!1,children:d,color:l,dimColor:f=!1,inverse:c=!1,italic:u=!1,strikethrough:b=!1,underline:m=!1,wrap:k="wrap"}){const{isScreenReaderEnabled:i}=h(S),x=h(T),C=i&&e?e:d,v=y(r=>{f&&(r=a.dim(r)),l&&(r=p(r,l,"foreground"));const g=s??x;return g&&(r=p(r,g,"background")),o&&(r=a.bold(r)),u&&(r=a.italic(r)),m&&(r=a.underline(r)),b&&(r=a.strikethrough(r)),c&&(r=a.inverse(r)),r},[f,l,s,x,o,u,m,b,c]);return C==null||i&&t?null:j("ink-text",{internal_transform:v,style:{flexDirection:"row",flexGrow:0,flexShrink:1,textWrap:k},children:i&&e?e:d})}n(D,"c");A(D,"Text");export{D as Text,D as default};
1
+ var w=Object.defineProperty;var n=(t,e)=>w(t,"name",{value:e,configurable:!0});import{jsx as j}from"react/jsx-runtime";import a from"@visulima/colorize";import{useContext as g,useCallback as y}from"react";import{d as h}from"../packem_shared/colorize-DbTZMrJO.js";import{a as S}from"../packem_shared/accessibility-context-DDyHTwmA.js";import{b as T}from"../packem_shared/background-context-rjOaWFki.js";var A=Object.defineProperty,D=n((t,e)=>A(t,"name",{value:e,configurable:!0}),"g");function E({"aria-hidden":t=!1,"aria-label":e,backgroundColor:s,bold:o=!1,children:f,color:l,dimColor:d=!1,inverse:c=!1,italic:u=!1,strikethrough:m=!1,underline:b=!1,wrap:k="wrap"}){const{isScreenReaderEnabled:i}=g(S),x=g(T),C=i&&e?e:f,v=y(r=>{d&&(r=a.dim(r)),l&&(r=h(r,l,"foreground"));const p=s??x;return p&&(r=h(r,p,"background")),o&&(r=a.bold(r)),u&&(r=a.italic(r)),b&&(r=a.underline(r)),m&&(r=a.strikethrough(r)),c&&(r=a.inverse(r)),r},[d,l,s,x,o,u,b,m,c]);return C==null||i&&t?null:j("ink-text",{internal_transform:v,style:{flexDirection:"row",flexGrow:0,flexShrink:1,textWrap:k},children:i&&e?e:f})}n(E,"c");D(E,"Text");export{E as Text,E as default};
@@ -1,4 +1,4 @@
1
- import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
1
+ import { AnsiColors } from '@visulima/colorize';
2
2
  import { ReactNode, ReactElement } from 'react';
3
3
  import { LiteralUnion } from 'type-fest';
4
4
  type TooltipPlacement = "bottom" | "left" | "right" | "top";
@@ -2,10 +2,11 @@ import { BoxProps as Props$1 } from "./box.js";
2
2
  import { Props as Props$2 } from "./text.js";
3
3
  import { ReactNode, ReactElement } from 'react';
4
4
  import 'type-fest';
5
- import "../packem_shared/dom.d-BZZeZlyP.js";
5
+ import "../packem_shared/dom.d-CcFuBd-k.js";
6
6
  import 'yoga-layout';
7
- import "../packem_shared/styles.d-i6Mejqz2.js";
8
- import "../packem_shared/index.server.d-eZWyC2Ku.js";
7
+ import '@visulima/colorize';
8
+ import 'cli-boxes';
9
+ import "../packem_shared/styles.d-cMo36xQz.js";
9
10
  type StyleFunctionProps = {
10
11
  readonly depth?: number;
11
12
  readonly hasChildren?: boolean;
@@ -1,4 +1,5 @@
1
- export { I as InlineLoop, a as InlineOptions, b as InlinePaintFn, c as InputParser, M as MouseEvent, T as TuiApp, d as createInlineLoop } from "../packem_shared/input.d-D-Yxqha8.js";
1
+ export { I as InlineLoop, a as InlineOptions, b as InlinePaintFn, c as InputParser, M as MouseEvent, T as TuiApp, d as createInlineLoop } from "../packem_shared/input.d-CgxV2e8U.js";
2
+ import 'tseep';
2
3
  /**
3
4
  * 2×u32 per-cell back-buffer layout:
4
5
  * buffer[idx * 2] = charCode (Unicode codepoint, u32)
@@ -1 +1 @@
1
- import{TuiApp as o}from"../packem_shared/TuiApp-BSWPFrDu.js";import{Cell as t,StyleMasks as m}from"../packem_shared/Cell-BrXn3jxY.js";import{createInlineLoop as l}from"../packem_shared/createInlineLoop-fhXU93QT.js";import{InputParser as f}from"../packem_shared/InputParser-Cfi5GVKV.js";import{Renderer as x,TerminalGuard as s,terminalSize as u}from"../packem_shared/Renderer-DJXooAsp.js";export{t as Cell,f as InputParser,x as Renderer,m as StyleMasks,s as TerminalGuard,o as TuiApp,l as createInlineLoop,u as terminalSize};
1
+ import{TuiApp as o}from"../packem_shared/TuiApp-BVDXP0Cv.js";import{Cell as t,StyleMasks as m}from"../packem_shared/Cell-BrXn3jxY.js";import{createInlineLoop as l}from"../packem_shared/createInlineLoop-DRNZ7jqH.js";import{InputParser as f}from"../packem_shared/InputParser-B_qZcN3r.js";import{Renderer as x,TerminalGuard as s,terminalSize as u}from"../packem_shared/Renderer-DJXooAsp.js";export{t as Cell,f as InputParser,x as Renderer,m as StyleMasks,s as TerminalGuard,o as TuiApp,l as createInlineLoop,u as terminalSize};
@@ -13,7 +13,7 @@ type Props = {
13
13
  * @example
14
14
  * ```jsx
15
15
  * import {useEffect} from 'react';
16
- * import {useApp} from 'ink';
16
+ * import {useApp} from '@visulima/tui/hooks/use-app';
17
17
 
18
18
  const Example = () => {
19
19
  const {waitUntilRenderFlush} = useApp();
@@ -1,9 +1,10 @@
1
1
  import { RefObject } from 'react';
2
- import { a as DOMElement } from "../../packem_shared/dom.d-BZZeZlyP.js";
2
+ import { a as DOMElement } from "../../packem_shared/dom.d-CcFuBd-k.js";
3
3
  import 'yoga-layout';
4
- import "../../packem_shared/styles.d-i6Mejqz2.js";
5
- import "../../packem_shared/index.server.d-eZWyC2Ku.js";
4
+ import '@visulima/colorize';
5
+ import 'cli-boxes';
6
6
  import 'type-fest';
7
+ import "../../packem_shared/styles.d-cMo36xQz.js";
7
8
  /**
8
9
  * Metrics of a box element.
9
10
  *
@@ -43,7 +44,9 @@ type UseBoxMetricsResult = BoxMetrics & {
43
44
  * @example
44
45
  * ```tsx
45
46
  import {useRef} from 'react';
46
- import {Box, Text, useBoxMetrics} from 'ink';
47
+ import {Box} from '@visulima/tui/components/box';
48
+ import {Text} from '@visulima/tui/components/text';
49
+ import {useBoxMetrics} from '@visulima/tui/hooks/use-box-metrics';
47
50
 
48
51
  const Example = () => {
49
52
  const ref = useRef(null);
@@ -1 +1 @@
1
- var p=Object.defineProperty;var n=(t,r)=>p(t,"name",{value:r,configurable:!0});import{useState as s,useCallback as m,useEffect as i,useMemo as g}from"react";import{a as N}from"../../packem_shared/dom-CMbdnYbk.js";var v=Object.defineProperty,f=n((t,r)=>v(t,"name",{value:r,configurable:!0}),"n");const d={height:0,left:0,top:0,width:0},c=f(t=>{if(t)return t.parentNode?c(t.parentNode):t.nodeName==="ink-root"?t:void 0},"findRootNode"),w=f(t=>{const[r,h]=s(d),[a,l]=s(!1),u=m(()=>{const e=t.current?.yogaNode?.getComputedLayout()??d;h(o=>o.width!==e.width||o.height!==e.height||o.left!==e.left||o.top!==e.top?e:o),l(!!t.current)},[t]);return i(u),i(()=>{const e=c(t.current);if(e)return N(e,u)}),g(()=>({...r,hasMeasured:a}),[r,a])},"useBoxMetrics");export{w as default,w as useBoxMetrics};
1
+ var p=Object.defineProperty;var n=(t,r)=>p(t,"name",{value:r,configurable:!0});import{useState as s,useCallback as m,useEffect as i,useMemo as g}from"react";import{a as N}from"../../packem_shared/dom-BG-LS10p.js";var v=Object.defineProperty,f=n((t,r)=>v(t,"name",{value:r,configurable:!0}),"n");const d={height:0,left:0,top:0,width:0},c=f(t=>{if(t)return t.parentNode?c(t.parentNode):t.nodeName==="ink-root"?t:void 0},"findRootNode"),w=f(t=>{const[r,h]=s(d),[a,l]=s(!1),u=m(()=>{const e=t.current?.yogaNode?.getComputedLayout()??d;h(o=>o.width!==e.width||o.height!==e.height||o.left!==e.left||o.top!==e.top?e:o),l(!!t.current)},[t]);return i(u),i(()=>{const e=c(t.current);if(e)return N(e,u)}),g(()=>({...r,hasMeasured:a}),[r,a])},"useBoxMetrics");export{w as default,w as useBoxMetrics};
@@ -18,7 +18,8 @@ type Output = {
18
18
  * The ID of the currently focused component, or `undefined` if no component is focused.
19
19
  * @example
20
20
  * ```tsx
21
- * import {Text, useFocusManager} from 'ink';
21
+ * import {Text} from '@visulima/tui/components/text';
22
+ * import {useFocusManager} from '@visulima/tui/hooks/use-focus-manager';
22
23
  *
23
24
  * const Example = () => {
24
25
  * const {activeId} = useFocusManager();
@@ -128,7 +128,7 @@ type Options = {
128
128
  * major version.
129
129
  *
130
130
  * ```
131
- * import {useInput} from 'ink';
131
+ * import {useInput} from '@visulima/tui/hooks/use-input';
132
132
  *
133
133
  * const UserInput = () => {
134
134
  * useInput((input, key) => {
@@ -1,2 +1,2 @@
1
- var K=Object.defineProperty;var m=(e,r)=>K(e,"name",{value:r,configurable:!0});import{createRequire as S}from"node:module";import{useRef as I,useEffectEvent as $,useEffect as w}from"react";import{IMECompositionBuffer as q,isIMEInput as j}from"../../packem_shared/IMECompositionBuffer-C89PhiOu.js";import{kittyModifiers as u}from"../../packem_shared/kittyFlags-C3rZLbcK.js";import{L as x}from"../../packem_shared/reconciler-tOH9yL_j.js";import{useStdinContext as N}from"./use-stdin.js";const _=S(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,E=m(e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[r,s]=h.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return h.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{Buffer:M}=E("node:buffer");var T=Object.defineProperty,c=m((e,r)=>T(e,"name",{value:r,configurable:!0}),"i");const D=/^\u001B([a-z0-9])$/i,R=/^\u001B+([ON[]|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,C={"[1~":"home","[2$":"insert","[2^":"insert","[2~":"insert","[3$":"delete","[3^":"delete","[3~":"delete","[4~":"end","[5$":"pageup","[5^":"pageup","[5~":"pageup","[6$":"pagedown","[6^":"pagedown","[6~":"pagedown","[7$":"home","[7^":"home","[7~":"home","[8$":"end","[8^":"end","[8~":"end","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[[5~":"pageup","[[6~":"pagedown","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[A":"up","[a":"up","[B":"down","[b":"down","[C":"right","[c":"right","[D":"left","[d":"left","[E":"clear","[e":"clear","[F":"end","[H":"home","[P":"f1","[Q":"f2","[R":"f3","[S":"f4","[Z":"tab",OA:"up",Oa:"up",OB:"down",Ob:"down",OC:"right",Oc:"right",OD:"left",Od:"left",OE:"clear",Oe:"clear",OF:"end",OH:"home",OP:"f1",OQ:"f2",OR:"f3",OS:"f4"},Z=[...Object.values(C),"backspace"],F=c(e=>["[2$","[3$","[5$","[6$","[7$","[8$","[a","[b","[c","[d","[e","[Z"].includes(e),"isShiftKey"),U=c(e=>["[2^","[3^","[5^","[6^","[7^","[8^","Oa","Ob","Oc","Od","Oe"].includes(e),"isCtrlKey"),P=/^\u001B\[(\d+)(?:;(\d+)(?::(\d+))?(?:;([\d:]+))?)?u$/,z=/^\u001B\[(\d+);(\d+):(\d+)([A-Z~])$/i,H={A:"up",B:"down",C:"right",D:"left",E:"clear",F:"end",H:"home",P:"f1",Q:"f2",R:"f3",S:"f4"},Q={2:"insert",3:"delete",5:"pageup",6:"pagedown",7:"home",8:"end",11:"f1",12:"f2",13:"f3",14:"f4",15:"f5",17:"f6",18:"f7",19:"f8",20:"f9",21:"f10",23:"f11",24:"f12"},A={8:"backspace",9:"tab",27:"escape",127:"backspace",57358:"capslock",57359:"scrolllock",57360:"numlock",57361:"printscreen",57362:"pause",57363:"menu",57376:"f13",57377:"f14",57378:"f15",57379:"f16",57380:"f17",57381:"f18",57382:"f19",57383:"f20",57384:"f21",57385:"f22",57386:"f23",57387:"f24",57388:"f25",57389:"f26",57390:"f27",57391:"f28",57392:"f29",57393:"f30",57394:"f31",57395:"f32",57396:"f33",57397:"f34",57398:"f35",57399:"kp0",57400:"kp1",57401:"kp2",57402:"kp3",57403:"kp4",57404:"kp5",57405:"kp6",57406:"kp7",57407:"kp8",57408:"kp9",57409:"kpdecimal",57410:"kpdivide",57411:"kpmultiply",57412:"kpsubtract",57413:"kpadd",57414:"kpenter",57415:"kpequal",57416:"kpseparator",57417:"kpleft",57418:"kpright",57419:"kpup",57420:"kpdown",57421:"kppageup",57422:"kppagedown",57423:"kphome",57424:"kpend",57425:"kpinsert",57426:"kpdelete",57427:"kpbegin",57428:"mediaplay",57429:"mediapause",57430:"mediaplaypause",57431:"mediareverse",57432:"mediastop",57433:"mediafastforward",57434:"mediarewind",57435:"mediatracknext",57436:"mediatrackprevious",57437:"mediarecord",57438:"lowervolume",57439:"raisevolume",57440:"mutevolume",57441:"leftshift",57442:"leftcontrol",57443:"leftalt",57444:"leftsuper",57445:"lefthyper",57446:"leftmeta",57447:"rightshift",57448:"rightcontrol",57449:"rightalt",57450:"rightsuper",57451:"righthyper",57452:"rightmeta",57453:"isoLevel3Shift",57454:"isoLevel5Shift"},L=c(e=>e>=0&&e<=1114111&&!(e>=55296&&e<=57343),"isValidCodepoint"),y=c(e=>L(e)?String.fromCodePoint(e):"?","safeFromCodePoint");function B(e){return e===3?"release":e===2?"repeat":"press"}m(B,"k");c(B,"resolveEventType");function O(e){return{capsLock:!!(e&u.capsLock),ctrl:!!(e&u.ctrl),hyper:!!(e&u.hyper),meta:!!(e&u.meta),numLock:!!(e&u.numLock),option:!!(e&u.alt),shift:!!(e&u.shift),super:!!(e&u.super)}}m(O,"h");c(O,"parseKittyModifiers");const V=c(e=>{const r=P.exec(e);if(!r)return null;const s=Number.parseInt(r[1],10),p=r[2]?Math.max(0,Number.parseInt(r[2],10)-1):0,t=r[3]?Number.parseInt(r[3],10):1,l=r[4];if(!L(s))return null;let n;l&&(n=l.split(":").map(k=>y(Number.parseInt(k,10))).join(""));let i,f;return s===32?(i="space",f=!0):s===13?(i="return",f=!0):A[s]?(i=A[s],f=!1):s>=1&&s<=26?(i=String.fromCodePoint(s+96),f=!1):(i=y(s).toLowerCase(),f=!0),f&&!n&&(n=y(s)),{name:i,...O(p),eventType:B(t),isKittyProtocol:!0,isPrintable:f,raw:e,sequence:e,text:n}},"parseKittyKeypress"),W=c(e=>{const r=z.exec(e);if(!r)return null;const s=Number.parseInt(r[1],10),p=Math.max(0,Number.parseInt(r[2],10)-1),t=Number.parseInt(r[3],10),l=r[4],n=l==="~"?Q[s]:H[l];return n?{name:n,...O(p),eventType:B(t),isKittyProtocol:!0,isPrintable:!1,raw:e,sequence:e}:null},"parseKittySpecialKey"),G=c((e="")=>{let r;M.isBuffer(e)?e[0]>127&&e[1]===void 0?(e[0]-=128,e=`\x1B${String(e)}`):e=String(e):e!==void 0&&typeof e!="string"?e=String(e):e||(e="");const s=V(e);if(s)return s;const p=W(e);if(p)return p;if(P.test(e))return{ctrl:!1,isKittyProtocol:!0,isPrintable:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};const t={ctrl:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};switch(t.sequence=t.sequence||e||t.name,e){case"\r":case"\x1B\r":{t.raw=void 0,t.name="return",t.option=e.length===2;break}case`
1
+ var K=Object.defineProperty;var m=(e,r)=>K(e,"name",{value:r,configurable:!0});import{createRequire as S}from"node:module";import{useRef as I,useEffectEvent as $,useEffect as w}from"react";import{IMECompositionBuffer as q,isIMEInput as j}from"../../packem_shared/IMECompositionBuffer-C89PhiOu.js";import{kittyModifiers as u}from"../../packem_shared/kittyFlags-C3rZLbcK.js";import{L as x}from"../../packem_shared/reconciler-CUbhOvcr.js";import{useStdinContext as N}from"./use-stdin.js";const _=S(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,E=m(e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[r,s]=h.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return h.getBuiltinModule(e)}return _(e)},"__cjs_getBuiltinModule"),{Buffer:M}=E("node:buffer");var T=Object.defineProperty,c=m((e,r)=>T(e,"name",{value:r,configurable:!0}),"i");const D=/^\u001B([a-z0-9])$/i,R=/^\u001B+([ON[]|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,C={"[1~":"home","[2$":"insert","[2^":"insert","[2~":"insert","[3$":"delete","[3^":"delete","[3~":"delete","[4~":"end","[5$":"pageup","[5^":"pageup","[5~":"pageup","[6$":"pagedown","[6^":"pagedown","[6~":"pagedown","[7$":"home","[7^":"home","[7~":"home","[8$":"end","[8^":"end","[8~":"end","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[[5~":"pageup","[[6~":"pagedown","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[A":"up","[a":"up","[B":"down","[b":"down","[C":"right","[c":"right","[D":"left","[d":"left","[E":"clear","[e":"clear","[F":"end","[H":"home","[P":"f1","[Q":"f2","[R":"f3","[S":"f4","[Z":"tab",OA:"up",Oa:"up",OB:"down",Ob:"down",OC:"right",Oc:"right",OD:"left",Od:"left",OE:"clear",Oe:"clear",OF:"end",OH:"home",OP:"f1",OQ:"f2",OR:"f3",OS:"f4"},Z=[...Object.values(C),"backspace"],F=c(e=>["[2$","[3$","[5$","[6$","[7$","[8$","[a","[b","[c","[d","[e","[Z"].includes(e),"isShiftKey"),U=c(e=>["[2^","[3^","[5^","[6^","[7^","[8^","Oa","Ob","Oc","Od","Oe"].includes(e),"isCtrlKey"),P=/^\u001B\[(\d+)(?:;(\d+)(?::(\d+))?(?:;([\d:]+))?)?u$/,z=/^\u001B\[(\d+);(\d+):(\d+)([A-Z~])$/i,H={A:"up",B:"down",C:"right",D:"left",E:"clear",F:"end",H:"home",P:"f1",Q:"f2",R:"f3",S:"f4"},Q={2:"insert",3:"delete",5:"pageup",6:"pagedown",7:"home",8:"end",11:"f1",12:"f2",13:"f3",14:"f4",15:"f5",17:"f6",18:"f7",19:"f8",20:"f9",21:"f10",23:"f11",24:"f12"},A={8:"backspace",9:"tab",27:"escape",127:"backspace",57358:"capslock",57359:"scrolllock",57360:"numlock",57361:"printscreen",57362:"pause",57363:"menu",57376:"f13",57377:"f14",57378:"f15",57379:"f16",57380:"f17",57381:"f18",57382:"f19",57383:"f20",57384:"f21",57385:"f22",57386:"f23",57387:"f24",57388:"f25",57389:"f26",57390:"f27",57391:"f28",57392:"f29",57393:"f30",57394:"f31",57395:"f32",57396:"f33",57397:"f34",57398:"f35",57399:"kp0",57400:"kp1",57401:"kp2",57402:"kp3",57403:"kp4",57404:"kp5",57405:"kp6",57406:"kp7",57407:"kp8",57408:"kp9",57409:"kpdecimal",57410:"kpdivide",57411:"kpmultiply",57412:"kpsubtract",57413:"kpadd",57414:"kpenter",57415:"kpequal",57416:"kpseparator",57417:"kpleft",57418:"kpright",57419:"kpup",57420:"kpdown",57421:"kppageup",57422:"kppagedown",57423:"kphome",57424:"kpend",57425:"kpinsert",57426:"kpdelete",57427:"kpbegin",57428:"mediaplay",57429:"mediapause",57430:"mediaplaypause",57431:"mediareverse",57432:"mediastop",57433:"mediafastforward",57434:"mediarewind",57435:"mediatracknext",57436:"mediatrackprevious",57437:"mediarecord",57438:"lowervolume",57439:"raisevolume",57440:"mutevolume",57441:"leftshift",57442:"leftcontrol",57443:"leftalt",57444:"leftsuper",57445:"lefthyper",57446:"leftmeta",57447:"rightshift",57448:"rightcontrol",57449:"rightalt",57450:"rightsuper",57451:"righthyper",57452:"rightmeta",57453:"isoLevel3Shift",57454:"isoLevel5Shift"},L=c(e=>e>=0&&e<=1114111&&!(e>=55296&&e<=57343),"isValidCodepoint"),y=c(e=>L(e)?String.fromCodePoint(e):"?","safeFromCodePoint");function B(e){return e===3?"release":e===2?"repeat":"press"}m(B,"k");c(B,"resolveEventType");function O(e){return{capsLock:!!(e&u.capsLock),ctrl:!!(e&u.ctrl),hyper:!!(e&u.hyper),meta:!!(e&u.meta),numLock:!!(e&u.numLock),option:!!(e&u.alt),shift:!!(e&u.shift),super:!!(e&u.super)}}m(O,"h");c(O,"parseKittyModifiers");const V=c(e=>{const r=P.exec(e);if(!r)return null;const s=Number.parseInt(r[1],10),p=r[2]?Math.max(0,Number.parseInt(r[2],10)-1):0,t=r[3]?Number.parseInt(r[3],10):1,l=r[4];if(!L(s))return null;let n;l&&(n=l.split(":").map(k=>y(Number.parseInt(k,10))).join(""));let i,f;return s===32?(i="space",f=!0):s===13?(i="return",f=!0):A[s]?(i=A[s],f=!1):s>=1&&s<=26?(i=String.fromCodePoint(s+96),f=!1):(i=y(s).toLowerCase(),f=!0),f&&!n&&(n=y(s)),{name:i,...O(p),eventType:B(t),isKittyProtocol:!0,isPrintable:f,raw:e,sequence:e,text:n}},"parseKittyKeypress"),W=c(e=>{const r=z.exec(e);if(!r)return null;const s=Number.parseInt(r[1],10),p=Math.max(0,Number.parseInt(r[2],10)-1),t=Number.parseInt(r[3],10),l=r[4],n=l==="~"?Q[s]:H[l];return n?{name:n,...O(p),eventType:B(t),isKittyProtocol:!0,isPrintable:!1,raw:e,sequence:e}:null},"parseKittySpecialKey"),G=c((e="")=>{let r;M.isBuffer(e)?e[0]>127&&e[1]===void 0?(e[0]-=128,e=`\x1B${String(e)}`):e=String(e):e!==void 0&&typeof e!="string"?e=String(e):e||(e="");const s=V(e);if(s)return s;const p=W(e);if(p)return p;if(P.test(e))return{ctrl:!1,isKittyProtocol:!0,isPrintable:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};const t={ctrl:!1,meta:!1,name:"",option:!1,raw:e,sequence:e,shift:!1};switch(t.sequence=t.sequence||e||t.name,e){case"\r":case"\x1B\r":{t.raw=void 0,t.name="return",t.option=e.length===2;break}case`
2
2
  `:{t.name="enter";break}case" ":{t.name="tab";break}case" ":case"\x1B ":{t.name="space",t.meta=e.length===2;break}case"\b":case"\x1B\b":{t.name="backspace",t.meta=e.charAt(0)==="\x1B";break}case"\x1B":case"\x1B\x1B":{t.name="escape",t.meta=e.length===2;break}case"\x1B":case"":{t.name="backspace",t.meta=e.charAt(0)==="\x1B";break}default:if(e.length===1&&e<="")t.name=String.fromCharCode(e.charCodeAt(0)+97-1),t.ctrl=!0;else if(e.length===1&&e>="0"&&e<="9")t.name="number";else if(e.length===1&&e>="a"&&e<="z")t.name=e;else if(e.length===1&&e>="A"&&e<="Z")t.name=e.toLowerCase(),t.shift=!0;else if(r=D.exec(e))t.meta=!0,t.shift=/^[A-Z]$/.test(r[1]);else if(r=R.exec(e)){const l=[...e];l[0]==="\x1B"&&l[1]==="\x1B"&&(t.option=!0);const n=[r[1],r[2],r[4],r[6]].filter(Boolean).join(""),i=(r[3]||r[5]||1)-1;t.ctrl=!!(i&4),t.meta=!!(i&10),t.shift=!!(i&1),t.code=n,t.name=C[n]??"",t.shift=F(n)||t.shift,t.ctrl=U(n)||t.ctrl}}return t},"parseKeypress");var J=Object.defineProperty,v=m((e,r)=>J(e,"name",{value:r,configurable:!0}),"l");const ne=v((e,r={})=>{const{internal_eventEmitter:s,internal_exitOnCtrlC:p,setRawMode:t,stdin:l}=N(),n=r.imeEnabled??!0,i=r.imeTimeout??50,f=I(void 0),k=$(e);w(()=>{if(n)return f.current=new q({onFlush:v(g=>{const d={backspace:!1,capsLock:!1,ctrl:!1,delete:!1,downArrow:!1,end:!1,escape:!1,home:!1,hyper:!1,leftArrow:!1,meta:!1,numLock:!1,pageDown:!1,pageUp:!1,return:!1,rightArrow:!1,shift:!1,super:!1,tab:!1,upArrow:!1};x.discreteUpdates(()=>{k(g,d)})},"onFlush"),timeout:i}),()=>{f.current?.destroy(),f.current=void 0}},[n,i]),w(()=>{if(r.isActive!==!1)return t(!0),()=>{t(!1)}},[r.isActive,t]),w(()=>{if(r.isActive===!1)return;const g=v(d=>{if(n&&j(d)){f.current?.add(d);return}f.current?.flush();const a=G(d),b={backspace:a.name==="backspace",capsLock:a.capsLock??!1,ctrl:a.ctrl,delete:a.name==="delete",downArrow:a.name==="down",end:a.name==="end",escape:a.name==="escape",eventType:a.eventType,home:a.name==="home",hyper:a.hyper??!1,leftArrow:a.name==="left",meta:a.meta||a.option,numLock:a.numLock??!1,pageDown:a.name==="pagedown",pageUp:a.name==="pageup",return:a.name==="return",rightArrow:a.name==="right",shift:a.shift,super:a.super??!1,tab:a.name==="tab",upArrow:a.name==="up"};let o;a.isKittyProtocol?a.isPrintable?o=a.text??a.name:a.ctrl&&a.name.length===1?o=a.name:o="":a.ctrl?o=a.name:o=a.sequence,!a.isKittyProtocol&&Z.includes(a.name)&&(o=""),o.startsWith("\x1B")&&(o=o.slice(1)),o.length===1&&typeof o[0]=="string"&&/[A-Z]/.test(o[0])&&(b.shift=!0),!(o==="c"&&b.ctrl&&p)&&(!a.name&&o===""||x.discreteUpdates(()=>{k(o,b)}))},"handleData");return s.on("input",g),()=>{s.removeListener("input",g)}},[r.isActive,l,p,n])},"useInput");export{ne as default,ne as useInput};
@@ -2,10 +2,11 @@ import { RefObject } from 'react';
2
2
  import { b as ScrollViewRef } from "../../packem_shared/scroll-view.d-DtpsgHLg.js";
3
3
  import "../../components/box.js";
4
4
  import 'type-fest';
5
- import "../../packem_shared/dom.d-BZZeZlyP.js";
5
+ import "../../packem_shared/dom.d-CcFuBd-k.js";
6
6
  import 'yoga-layout';
7
- import "../../packem_shared/styles.d-i6Mejqz2.js";
8
- import "../../packem_shared/index.server.d-eZWyC2Ku.js";
7
+ import '@visulima/colorize';
8
+ import 'cli-boxes';
9
+ import "../../packem_shared/styles.d-cMo36xQz.js";
9
10
  type UseLinkedScrollReturn = {
10
11
  /**
11
12
  * Callback to pass to ScrollView's `onScroll` prop.
@@ -21,7 +21,8 @@ type Options = {
21
21
  * removed in the next major version.
22
22
  *
23
23
  * ```
24
- * import {useInput, usePaste} from 'ink';
24
+ * import {useInput} from '@visulima/tui/hooks/use-input';
25
+ * import {usePaste} from '@visulima/tui/hooks/use-paste';
25
26
  *
26
27
  * const MyInput = () => {
27
28
  * useInput((input, key) => {
@@ -1 +1 @@
1
- var l=Object.defineProperty;var n=(t,e)=>l(t,"name",{value:e,configurable:!0});import{useEffectEvent as v,useEffect as f}from"react";import{L as d}from"../../packem_shared/reconciler-tOH9yL_j.js";import{useStdinContext as m}from"./use-stdin.js";var p=Object.defineProperty,o=n((t,e)=>p(t,"name",{value:e,configurable:!0}),"n");const x=o((t,e={})=>{const{internal_eventEmitter:s,setBracketedPasteMode:r,setRawMode:a}=m(),c=v(t);f(()=>{if(e.isActive!==!1)return a(!0),r(!0),()=>{a(!1),r(!1)}},[e.isActive,a,r]),f(()=>{if(e.isActive===!1)return;const i=o(u=>{d.discreteUpdates(()=>{c(u)})},"handlePaste");return s.on("paste",i),()=>{s.removeListener("paste",i)}},[e.isActive,s])},"usePaste");export{x as default,x as usePaste};
1
+ var l=Object.defineProperty;var n=(t,e)=>l(t,"name",{value:e,configurable:!0});import{useEffectEvent as v,useEffect as f}from"react";import{L as d}from"../../packem_shared/reconciler-CUbhOvcr.js";import{useStdinContext as m}from"./use-stdin.js";var p=Object.defineProperty,o=n((t,e)=>p(t,"name",{value:e,configurable:!0}),"n");const x=o((t,e={})=>{const{internal_eventEmitter:s,setBracketedPasteMode:r,setRawMode:a}=m(),c=v(t);f(()=>{if(e.isActive!==!1)return a(!0),r(!0),()=>{a(!1),r(!1)}},[e.isActive,a,r]),f(()=>{if(e.isActive===!1)return;const i=o(u=>{d.discreteUpdates(()=>{c(u)})},"handlePaste");return s.on("paste",i),()=>{s.removeListener("paste",i)}},[e.isActive,s])},"usePaste");export{x as default,x as usePaste};
@@ -1,10 +1,11 @@
1
1
  import { RefObject } from 'react';
2
- import { a as DOMElement } from "../../packem_shared/dom.d-BZZeZlyP.js";
3
- import { S as Selection } from "../../packem_shared/selection.d-vfuEzv1p.js";
2
+ import { a as DOMElement } from "../../packem_shared/dom.d-CcFuBd-k.js";
3
+ import { S as Selection } from "../../packem_shared/selection.d-DAh7REnW.js";
4
4
  import 'yoga-layout';
5
- import "../../packem_shared/styles.d-i6Mejqz2.js";
6
- import "../../packem_shared/index.server.d-eZWyC2Ku.js";
5
+ import '@visulima/colorize';
6
+ import 'cli-boxes';
7
7
  import 'type-fest';
8
+ import "../../packem_shared/styles.d-cMo36xQz.js";
8
9
  type UseTextSelectionOptions = {
9
10
  /**
10
11
  * Automatically copy selected text to clipboard when selection changes.
@@ -1 +1 @@
1
- var v=Object.defineProperty;var m=(n,o)=>v(n,"name",{value:o,configurable:!0});import{useRef as d,useState as x,useEffect as R,useCallback as p,useMemo as y}from"react";import{Selection as A,Range as C}from"../../packem_shared/comparePoints-l0iqUoL_.js";import b from"./use-clipboard.js";var h=Object.defineProperty,T=m((n,o)=>h(n,"name",{value:o,configurable:!0}),"f");const E=T((n,o={})=>{const{copyOnSelect:c=!1,isActive:r=!0,onSelectionChange:s}=o,{copy:l}=b(),e=d(new A).current,[a,S]=x(""),u=d(s);u.current=s,R(()=>r?e.onChange(()=>{const t=e.toString();S(t),u.current?.(t),c&&t.length>0&&l(t)}):void 0,[r,e,c,l]);const i=p(()=>{const t=n.current;if(!t||!r)return;e.removeAllRanges();const g=new C;g.selectNodeContents(t),e.addRange(g)},[n,r,e]),f=p(()=>{e.removeAllRanges()},[e]);return y(()=>({clearSelection:f,selectAll:i,selectedText:a,selection:e}),[f,a,i,e])},"useTextSelection");export{E as default,E as useTextSelection};
1
+ var v=Object.defineProperty;var m=(n,o)=>v(n,"name",{value:o,configurable:!0});import{useRef as d,useState as x,useEffect as R,useCallback as p,useMemo as y}from"react";import{Selection as A,Range as C}from"../../packem_shared/comparePoints-YxQfR_zq.js";import b from"./use-clipboard.js";var h=Object.defineProperty,T=m((n,o)=>h(n,"name",{value:o,configurable:!0}),"f");const E=T((n,o={})=>{const{copyOnSelect:c=!1,isActive:r=!0,onSelectionChange:s}=o,{copy:l}=b(),e=d(new A).current,[a,S]=x(""),u=d(s);u.current=s,R(()=>r?e.onChange(()=>{const t=e.toString();S(t),u.current?.(t),c&&t.length>0&&l(t)}):void 0,[r,e,c,l]);const i=p(()=>{const t=n.current;if(!t||!r)return;e.removeAllRanges();const g=new C;g.selectNodeContents(t),e.addRange(g)},[n,r,e]),f=p(()=>{e.removeAllRanges()},[e]);return y(()=>({clearSelection:f,selectAll:i,selectedText:a,selection:e}),[f,a,i,e])},"useTextSelection");export{E as default,E as useTextSelection};
@@ -1 +1 @@
1
- var u=Object.defineProperty;var t=(e,o)=>u(e,"name",{value:o,configurable:!0});import{useState as a,useEffect as f}from"react";import{g as s}from"../../packem_shared/utils-THUhYKG2.js";import m from"./use-stdout.js";var c=Object.defineProperty,i=t((e,o)=>c(e,"name",{value:o,configurable:!0}),"t");const g=i(()=>{const{stdout:e}=m(),[o,n]=a(()=>s(e));return f(()=>{const r=i(()=>{n(s(e))},"onResize");return e.on("resize",r),()=>{e.off("resize",r)}},[e]),o},"useWindowSize");export{g as default,g as useWindowSize};
1
+ var u=Object.defineProperty;var t=(e,o)=>u(e,"name",{value:o,configurable:!0});import{useState as a,useEffect as f}from"react";import{g as s}from"../../packem_shared/utils-CoviI5Vm.js";import m from"./use-stdout.js";var c=Object.defineProperty,i=t((e,o)=>c(e,"name",{value:o,configurable:!0}),"t");const g=i(()=>{const{stdout:e}=m(),[o,n]=a(()=>s(e));return f(()=>{const r=i(()=>{n(s(e))},"onResize");return e.on("resize",r),()=>{e.off("resize",r)}},[e]),o},"useWindowSize");export{g as default,g as useWindowSize};
@@ -1,18 +1,19 @@
1
1
  export { type C as ClipboardTarget, c as clearOsc52, i as isOsc52Supported, w as writeOsc52 } from "../packem_shared/clipboard.d-D6lZTQ21.js";
2
2
  export { b as COLOR_BLINDNESS_COMPENSATION, c as COLOR_BLINDNESS_SIMULATION, type C as ColorBlindnessType, type a as ColorMatrix, I as IDENTITY_MATRIX, d as applyColorMatrix, h as hexToRgb, r as rgbToHex, t as transformHexColor } from "../packem_shared/color-matrix.d-DSXLsB64.js";
3
- import { a as DOMElement, D as DOMNode, S as StyledLine } from "../packem_shared/dom.d-BZZeZlyP.js";
4
- export { R as ResizeObserver, type b as ResizeObserverCallback, c as ResizeObserverEntry, type d as ScrollState, type e as StickyHeader, f as calculateScroll, g as getPathToRoot, h as getScrollHeight, i as getScrollLeft, j as getScrollTop, k as getScrollWidth, l as isNodeSelectable } from "../packem_shared/dom.d-BZZeZlyP.js";
5
- export { type I as Instance, type K as KittyFlagName, type a as KittyKeyboardOptions, type R as RenderOptions, k as kittyFlags, b as kittyModifiers, r as render } from "../packem_shared/render.d-BJmVQ_cd.js";
3
+ import { a as DOMElement, D as DOMNode, S as StyledLine } from "../packem_shared/dom.d-CcFuBd-k.js";
4
+ export { R as ResizeObserver, type b as ResizeObserverCallback, c as ResizeObserverEntry, type d as ScrollState, type e as StickyHeader, f as calculateScroll, g as getPathToRoot, h as getScrollHeight, i as getScrollLeft, j as getScrollTop, k as getScrollWidth, l as isNodeSelectable } from "../packem_shared/dom.d-CcFuBd-k.js";
5
+ export { type I as Instance, type K as KittyFlagName, type a as KittyKeyboardOptions, type R as RenderOptions, k as kittyFlags, b as kittyModifiers, r as render } from "../packem_shared/render.d-B1kiO3Ca.js";
6
6
  import 'node:stream';
7
7
  export { type C as CursorPosition } from "../packem_shared/cursor-helpers.d-BIvqz0TZ.js";
8
8
  import { EventEmitter } from 'node:events';
9
9
  import React, { PropsWithChildren, RefObject, ReactNode } from 'react';
10
- export { R as Range, S as Selection, a as applySelectionToStyledLine, c as comparePoints } from "../packem_shared/selection.d-vfuEzv1p.js";
10
+ export { R as Range, S as Selection, a as applySelectionToStyledLine, c as comparePoints } from "../packem_shared/selection.d-DAh7REnW.js";
11
11
  export { type T as TerminalPalette, i as isTerminalPaletteQuerySupported, q as queryTerminalPalette } from "../packem_shared/terminal-palette.d-D2SQjfn-.js";
12
12
  import 'yoga-layout';
13
- import "../packem_shared/styles.d-i6Mejqz2.js";
14
- import "../packem_shared/index.server.d-eZWyC2Ku.js";
13
+ import '@visulima/colorize';
14
+ import 'cli-boxes';
15
15
  import 'type-fest';
16
+ import "../packem_shared/styles.d-cMo36xQz.js";
16
17
  /**
17
18
  * Detect whether a string contains non-ASCII characters that are likely
18
19
  * IME (Input Method Editor) composition input — CJK ideographs, Hangul,
@@ -363,7 +364,9 @@ type RenderToStringOptions = {
363
364
 
364
365
  @example
365
366
  ```
366
- import {renderToString, Text, Box} from 'ink';
367
+ import {renderToString} from '@visulima/tui';
368
+ import {Box} from '@visulima/tui/components/box';
369
+ import {Text} from '@visulima/tui/components/text';
367
370
 
368
371
  const output = renderToString(
369
372
  <Box padding={1}>
package/dist/ink/index.js CHANGED
@@ -1 +1 @@
1
- import{clearOsc52 as o,isOsc52Supported as r,writeOsc52 as a}from"../packem_shared/isOsc52Supported-DKK7Uee6.js";import{COLOR_BLINDNESS_COMPENSATION as l,COLOR_BLINDNESS_SIMULATION as i,IDENTITY_MATRIX as n,applyColorMatrix as u,hexToRgb as f,rgbToHex as p,transformHexColor as c}from"../packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js";import{g as d,i as x}from"../packem_shared/dom-CMbdnYbk.js";import{IMECompositionBuffer as S,isIMEInput as h}from"../packem_shared/IMECompositionBuffer-C89PhiOu.js";import{kittyFlags as M,kittyModifiers as O}from"../packem_shared/kittyFlags-C3rZLbcK.js";import{c as I,a as L,b,g as C,d as E,e as N,f as R,h as B,i as P,j as H,k as v,l as W,P as k,p as A}from"../packem_shared/layout-P24eyWyL.js";import{c as D,a as F,i as z,s as q,b as w,t as j}from"../packem_shared/measure-text-CIs55Wao.js";import{default as U}from"../packem_shared/render-D9bHMHrx.js";import{default as X}from"../packem_shared/renderToString-GyN-Rw9F.js";import{default as G,ResizeObserverEntry as J}from"../packem_shared/ResizeObserverEntry-Dq0dk8Kq.js";import{calculateScroll as Z,getScrollHeight as $,getScrollLeft as ee,getScrollTop as te,getScrollWidth as oe}from"../packem_shared/getScrollHeight-BTEY8ewu.js";import{Range as ae,Selection as se,applySelectionToStyledLine as le,comparePoints as ie}from"../packem_shared/comparePoints-l0iqUoL_.js";import{squashTextNodesWithMap as ue}from"../packem_shared/squashTextNodesWithMap-Cpqmc45i.js";import{isTerminalPaletteQuerySupported as pe,queryTerminalPalette as ce}from"../packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js";import{wrapOrTruncateStyledLine as de}from"../packem_shared/wrapOrTruncateStyledLine-D29Fq7pW.js";import{default as ge}from"../packem_shared/Fullscreen-CxLd1-Zu.js";import{default as he}from"../packem_shared/MouseProvider-CHU5DuwC.js";import{default as Me}from"../packem_shared/isIntersecting-B3KbKTmu.js";import{default as ye}from"../packem_shared/useMouseAction-2dRfU1vE.js";import{default as Le}from"../packem_shared/useMouseContext-C746G7kY.js";import{default as Ce}from"../packem_shared/useMousePosition-BTWfV4JK.js";import{default as Ne}from"../packem_shared/useOnMouseHover-D3DczIol.js";import{default as Be}from"../packem_shared/useOnMouseState-cRK8QvzD.js";import{a as He}from"../packem_shared/ansi-parser-C5JuL732.js";import{useElementDimensions as We,useElementPosition as ke}from"../packem_shared/useElementDimensions-qJ_WXFZ9.js";import{useOnMouseClick as _e}from"../packem_shared/useOnMouseClick-nY8xLZmt.js";export{l as COLOR_BLINDNESS_COMPENSATION,i as COLOR_BLINDNESS_SIMULATION,ge as Fullscreen,n as IDENTITY_MATRIX,S as IMECompositionBuffer,he as MouseProvider,ae as Range,G as ResizeObserver,J as ResizeObserverEntry,se as Selection,u as applyColorMatrix,le as applySelectionToStyledLine,Z as calculateScroll,I as calculateScrollbarLayout,L as calculateScrollbarThumb,o as clearOsc52,D as clearStringWidthCache,F as clearStyledLineCache,b as collectSortedFragments,ie as comparePoints,C as getAddedScrollHeight,E as getBoundingBox,N as getHorizontalScrollbarBoundingBox,R as getInnerHeight,B as getInnerWidth,d as getPathToRoot,P as getRelativeLeft,H as getRelativeTop,$ as getScrollHeight,ee as getScrollLeft,te as getScrollTop,oe as getScrollWidth,v as getText,W as getVerticalScrollbarBoundingBox,f as hexToRgb,z as inkCharacterWidth,h as isIMEInput,Me as isIntersecting,x as isNodeSelectable,r as isOsc52Supported,pe as isTerminalPaletteQuerySupported,M as kittyFlags,O as kittyModifiers,k as measureElement,He as parseSgrMouse,A as processLayout,ce as queryTerminalPalette,U as render,X as renderToString,p as rgbToHex,q as setEnableStyledLineCache,w as setStringWidthFunction,ue as squashTextNodesWithMap,j as toStyledLine,c as transformHexColor,We as useElementDimensions,ke as useElementPosition,ye as useMouseAction,Le as useMouseContext,Ce as useMousePosition,_e as useOnMouseClick,Ne as useOnMouseHover,Be as useOnMouseState,de as wrapOrTruncateStyledLine,a as writeOsc52};
1
+ import{clearOsc52 as o,isOsc52Supported as r,writeOsc52 as a}from"../packem_shared/isOsc52Supported-DKK7Uee6.js";import{COLOR_BLINDNESS_COMPENSATION as l,COLOR_BLINDNESS_SIMULATION as i,IDENTITY_MATRIX as n,applyColorMatrix as u,hexToRgb as f,rgbToHex as p,transformHexColor as c}from"../packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js";import{g as d,i as x}from"../packem_shared/dom-BG-LS10p.js";import{IMECompositionBuffer as S,isIMEInput as h}from"../packem_shared/IMECompositionBuffer-C89PhiOu.js";import{kittyFlags as M,kittyModifiers as O}from"../packem_shared/kittyFlags-C3rZLbcK.js";import{c as I,a as L,b,g as C,d as E,e as N,f as R,h as B,i as P,j as H,k as v,l as W,P as k,p as A}from"../packem_shared/layout-BMo200nF.js";import{c as D,a as F,i as z,s as q,b as w,t as j}from"../packem_shared/measure-text-DDjHT1jD.js";import{default as U}from"../packem_shared/render-bdbSzkJo.js";import{default as X}from"../packem_shared/renderToString-DVE0cEHt.js";import{default as G,ResizeObserverEntry as J}from"../packem_shared/ResizeObserverEntry-Dq0dk8Kq.js";import{calculateScroll as Z,getScrollHeight as $,getScrollLeft as ee,getScrollTop as te,getScrollWidth as oe}from"../packem_shared/getScrollHeight-ClEOyLHH.js";import{Range as ae,Selection as se,applySelectionToStyledLine as le,comparePoints as ie}from"../packem_shared/comparePoints-YxQfR_zq.js";import{squashTextNodesWithMap as ue}from"../packem_shared/squashTextNodesWithMap-DCdi3SZ2.js";import{isTerminalPaletteQuerySupported as pe,queryTerminalPalette as ce}from"../packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js";import{wrapOrTruncateStyledLine as de}from"../packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js";import{default as ge}from"../packem_shared/Fullscreen-CxLd1-Zu.js";import{default as he}from"../packem_shared/MouseProvider-PnIUKURs.js";import{default as Me}from"../packem_shared/isIntersecting-B3KbKTmu.js";import{default as ye}from"../packem_shared/useMouseAction-2dRfU1vE.js";import{default as Le}from"../packem_shared/useMouseContext-C746G7kY.js";import{default as Ce}from"../packem_shared/useMousePosition-BTWfV4JK.js";import{default as Ne}from"../packem_shared/useOnMouseHover-D3DczIol.js";import{default as Be}from"../packem_shared/useOnMouseState-cRK8QvzD.js";import{a as He}from"../packem_shared/ansi-parser-B6uXaq65.js";import{useElementDimensions as We,useElementPosition as ke}from"../packem_shared/useElementDimensions-qJ_WXFZ9.js";import{useOnMouseClick as _e}from"../packem_shared/useOnMouseClick-nY8xLZmt.js";export{l as COLOR_BLINDNESS_COMPENSATION,i as COLOR_BLINDNESS_SIMULATION,ge as Fullscreen,n as IDENTITY_MATRIX,S as IMECompositionBuffer,he as MouseProvider,ae as Range,G as ResizeObserver,J as ResizeObserverEntry,se as Selection,u as applyColorMatrix,le as applySelectionToStyledLine,Z as calculateScroll,I as calculateScrollbarLayout,L as calculateScrollbarThumb,o as clearOsc52,D as clearStringWidthCache,F as clearStyledLineCache,b as collectSortedFragments,ie as comparePoints,C as getAddedScrollHeight,E as getBoundingBox,N as getHorizontalScrollbarBoundingBox,R as getInnerHeight,B as getInnerWidth,d as getPathToRoot,P as getRelativeLeft,H as getRelativeTop,$ as getScrollHeight,ee as getScrollLeft,te as getScrollTop,oe as getScrollWidth,v as getText,W as getVerticalScrollbarBoundingBox,f as hexToRgb,z as inkCharacterWidth,h as isIMEInput,Me as isIntersecting,x as isNodeSelectable,r as isOsc52Supported,pe as isTerminalPaletteQuerySupported,M as kittyFlags,O as kittyModifiers,k as measureElement,He as parseSgrMouse,A as processLayout,ce as queryTerminalPalette,U as render,X as renderToString,p as rgbToHex,q as setEnableStyledLineCache,w as setStringWidthFunction,ue as squashTextNodesWithMap,j as toStyledLine,c as transformHexColor,We as useElementDimensions,ke as useElementPosition,ye as useMouseAction,Le as useMouseContext,Ce as useMousePosition,_e as useOnMouseClick,Ne as useOnMouseHover,Be as useOnMouseState,de as wrapOrTruncateStyledLine,a as writeOsc52};
@@ -0,0 +1 @@
1
+ import"react/jsx-runtime";import"react";import"./layout-BMo200nF.js";import"../components/box.js";import{C as l}from"./controlled-scroll-view-CcUS50jx.js";export{l as ControlledScrollView};
@@ -1 +1 @@
1
- var w=Object.defineProperty;var l=(e,r)=>w(e,"name",{value:r,configurable:!0});import{jsxs as a,jsx as c}from"react/jsx-runtime";import{useState as D,useRef as d,useEffect as T}from"react";import{useWindowSize as S,useTuiContext as b}from"./TuiContext-BoJvG3NN.js";import{_Box as i,_Spacer as g,_Text as v}from"./render-yGJFE4of.js";var j=Object.defineProperty,s=l((e,r)=>j(e,"name",{value:r,configurable:!0}),"s");function p(){const{app:e}=b(),[r,u]=D(0),t=d(0),n=d(Date.now()),o=d(null);return T(()=>{const h=s(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{u(0),t.current=0,n.current=Date.now()},2e3),t.current++;const f=Date.now(),m=f-n.current;m>=500&&(u(Math.round(t.current/m*1e3)),t.current=0,n.current=f)},"onRender"),x=e.onBeforeFlush(()=>{h()});return()=>{x(),o.current&&clearTimeout(o.current)}},[e]),r}l(p,"h");s(p,"useFpsCounter");const y=s(({fps:e})=>{const r=e===0?"--":String(e);return c(i,{borderColor:"gray",borderStyle:"round",paddingX:1,children:a(v,{dim:!0,children:[r," ","updates/sec"]})})},"FpsHud"),k=s(({children:e,enabled:r=!0})=>{const u=p(),{columns:t,rows:n}=S();return a(i,{flexDirection:"column",height:n,width:t,children:[c(i,{flexGrow:1,children:e}),r&&a(i,{flexDirection:"row",flexShrink:0,children:[c(g,{}),c(y,{fps:u})]})]})},"DevTools");export{k as DevTools};
1
+ var w=Object.defineProperty;var l=(e,r)=>w(e,"name",{value:r,configurable:!0});import{jsxs as a,jsx as c}from"react/jsx-runtime";import{useState as D,useRef as d,useEffect as T}from"react";import{useWindowSize as S,useTuiContext as b}from"./TuiContext-BoJvG3NN.js";import{_Box as i,_Spacer as g,_Text as v}from"./render-Dh7HMhK1.js";var j=Object.defineProperty,s=l((e,r)=>j(e,"name",{value:r,configurable:!0}),"s");function p(){const{app:e}=b(),[r,u]=D(0),t=d(0),n=d(Date.now()),o=d(null);return T(()=>{const h=s(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{u(0),t.current=0,n.current=Date.now()},2e3),t.current++;const f=Date.now(),m=f-n.current;m>=500&&(u(Math.round(t.current/m*1e3)),t.current=0,n.current=f)},"onRender"),x=e.onBeforeFlush(()=>{h()});return()=>{x(),o.current&&clearTimeout(o.current)}},[e]),r}l(p,"h");s(p,"useFpsCounter");const y=s(({fps:e})=>{const r=e===0?"--":String(e);return c(i,{borderColor:"gray",borderStyle:"round",paddingX:1,children:a(v,{dim:!0,children:[r," ","updates/sec"]})})},"FpsHud"),k=s(({children:e,enabled:r=!0})=>{const u=p(),{columns:t,rows:n}=S();return a(i,{flexDirection:"column",height:n,width:t,children:[c(i,{flexGrow:1,children:e}),r&&a(i,{flexDirection:"row",flexShrink:0,children:[c(g,{}),c(y,{fps:u})]})]})},"DevTools");export{k as DevTools};
@@ -0,0 +1,2 @@
1
+ var p=Object.defineProperty;var d=(r,t)=>p(r,"name",{value:t,configurable:!0});import{EventEmitter as c}from"tseep";var B=Object.defineProperty,x=d((r,t)=>B(r,"name",{value:t,configurable:!0}),"h");class b extends c{static{d(this,"InputParser")}constructor(t){super(),this.stdin=t}stdin;static{x(this,"InputParser")}_boundHandleData=null;_pasteBuffer=null;start(){typeof this.stdin.setRawMode=="function"&&this.stdin.setRawMode(!0),this.stdin.resume(),this.stdin.setEncoding("utf8"),this._boundHandleData=this.handleData.bind(this),this.stdin.on("data",this._boundHandleData)}stop(){typeof this.stdin.setRawMode=="function"&&this.stdin.setRawMode(!1),this.stdin.pause(),this._boundHandleData&&(this.stdin.removeListener("data",this._boundHandleData),this._boundHandleData=null)}handleData(t){if(t===""){this.emit("exit");return}if(t.includes("\x1B[200~")||this._pasteBuffer!==null){if(this._pasteBuffer===null?this._pasteBuffer=t.replace("\x1B[200~",""):this._pasteBuffer+=t,this._pasteBuffer.includes("\x1B[201~")){const e=this._pasteBuffer.replace("\x1B[201~","");this._pasteBuffer=null,this.emit("paste",e),this.listenerCount("paste")===0&&this.emit("data",e)}return}if(t.length===1){const e=t.charCodeAt(0);if(e>=1&&e<=26&&e!==3&&e!==9&&e!==10&&e!==13){const s=String.fromCharCode(e+96);this.emit("ctrl",s),this.emit("data",t,{ctrl:!0});return}}if(t==="\x1B[A"){this.emit("keydown","up");return}if(t==="\x1B[B"){this.emit("keydown","down");return}if(t==="\x1B[C"){this.emit("keydown","right");return}if(t==="\x1B[D"){this.emit("keydown","left");return}if(t===" "){this.emit("keydown","tab");return}if(t==="\x1B[Z"){this.emit("keydown","shift-tab");return}if(t==="\x1B"){this.emit("keydown","escape");return}if(t==="\r"||t===`
2
+ `){this.emit("keydown","enter");return}if(t===""){this.emit("keydown","backspace");return}if(t==="\x1B[3~"){this.emit("keydown","delete");return}if(t==="\x1B[5~"){this.emit("keydown","pageUp");return}if(t==="\x1B[6~"){this.emit("keydown","pageDown");return}if(t==="\x1B[H"||t==="\x1B[1~"){this.emit("keydown","home");return}if(t==="\x1B[F"||t==="\x1B[4~"){this.emit("keydown","end");return}if(t.length===2&&t[0]==="\x1B"){this.emit("meta",t[1]),this.emit("data",t,{meta:!0});return}if(t.startsWith("\x1B[<")){const e=t.match(/\u001B\[<(\d+);(\d+);(\d+)(M)/i);if(e){const s=Number.parseInt(e[1]),u=Number.parseInt(e[2])-1,h=Number.parseInt(e[3])-1,a=e[4]==="m",o=(s&4)!==0,f=(s&8)!==0,l=(s&16)!==0,n=s&-29;let i=null;if(n===0&&!a?i="left":n===1&&!a?i="middle":n===2&&!a?i="right":n===64?i="scrollUp":n===65&&(i="scrollDown"),i){const m={button:i,ctrl:l,meta:f,shift:o,x:u,y:h};this.emit("mouse",m),i==="left"&&this.emit("click",{x:u,y:h})}}return}this.emit("data",t)}}export{b as InputParser};
@@ -1 +1 @@
1
- var c=Object.defineProperty;var g=(d,t)=>c(d,"name",{value:t,configurable:!0});import a from"yoga-layout";import{m as y}from"./text-width-DSx26OmB.js";var u=Object.defineProperty,N=g((d,t)=>u(d,"name",{value:t,configurable:!0}),"h");const l=new Map;class E{static{g(this,"LayoutNode")}static{N(this,"LayoutNode")}yogaNode;children=[];parent=null;_destroyed=!1;_hidden=!1;transform;_text;fg=255;bg=255;styles=0;_style;set text(t){this._text=t,t===void 0?this.yogaNode.unsetMeasureFunc():this.yogaNode.setMeasureFunc((e,o,r,n)=>{if(t.length===0)return{height:0,width:0};const i=y(t,Number.MAX_SAFE_INTEGER);let s=i.maxLineWidth;o===a.MEASURE_MODE_EXACTLY?s=Math.max(0,Math.floor(e)):o===a.MEASURE_MODE_AT_MOST&&(s=Math.min(i.maxLineWidth,Math.max(0,Math.floor(e))));let h=i.wrappedRows;return s>0&&(h=y(t,s).wrappedRows),n===a.MEASURE_MODE_EXACTLY?h=Math.max(0,Math.floor(r)):n===a.MEASURE_MODE_AT_MOST&&(h=Math.min(h,Math.max(0,Math.floor(r)))),{height:h,width:s}})}get text(){return this._text}constructor(){this.yogaNode=a.Node.create(),this.yogaNode.setFlexDirection(a.FLEX_DIRECTION_COLUMN)}insertChild(t,e){const o=l.get(t.yogaNode);o&&o.removeChild(t);const r=t.yogaNode.getParent();r&&r.removeChild(t.yogaNode);const n=this.yogaNode.getChildCount(),i=Math.min(e,n);try{this.yogaNode.insertChild(t.yogaNode,i)}catch{return}t.parent=this,this.children.splice(i,0,t),l.set(t.yogaNode,this)}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){const e=this.children.indexOf(t);if(e!==-1){this.children.splice(e,1),t.parent=null,l.delete(t.yogaNode);const o=t.yogaNode.getParent();o&&o.removeChild(t.yogaNode)}}destroy(){if(this._destroyed)return;this._destroyed=!0;for(const e of this.children)e.parent===this&&(e.parent=null);this.children=[],l.delete(this.yogaNode);const t=this.yogaNode.getParent();t&&t.removeChild(this.yogaNode),this.yogaNode.free()}calculateLayout(t,e){this.yogaNode.setWidth(t),this.yogaNode.setHeight(e),this.yogaNode.calculateLayout(t,e,a.DIRECTION_LTR)}getLayout(){return this.yogaNode.getComputedLayout()}}export{E as LayoutNode};
1
+ var c=Object.defineProperty;var g=(d,t)=>c(d,"name",{value:t,configurable:!0});import a from"yoga-layout";import{m as y}from"./text-width-BU2eeTWn.js";var u=Object.defineProperty,N=g((d,t)=>u(d,"name",{value:t,configurable:!0}),"h");const l=new Map;class E{static{g(this,"LayoutNode")}static{N(this,"LayoutNode")}yogaNode;children=[];parent=null;_destroyed=!1;_hidden=!1;transform;_text;fg=255;bg=255;styles=0;_style;set text(t){this._text=t,t===void 0?this.yogaNode.unsetMeasureFunc():this.yogaNode.setMeasureFunc((e,o,r,n)=>{if(t.length===0)return{height:0,width:0};const i=y(t,Number.MAX_SAFE_INTEGER);let s=i.maxLineWidth;o===a.MEASURE_MODE_EXACTLY?s=Math.max(0,Math.floor(e)):o===a.MEASURE_MODE_AT_MOST&&(s=Math.min(i.maxLineWidth,Math.max(0,Math.floor(e))));let h=i.wrappedRows;return s>0&&(h=y(t,s).wrappedRows),n===a.MEASURE_MODE_EXACTLY?h=Math.max(0,Math.floor(r)):n===a.MEASURE_MODE_AT_MOST&&(h=Math.min(h,Math.max(0,Math.floor(r)))),{height:h,width:s}})}get text(){return this._text}constructor(){this.yogaNode=a.Node.create(),this.yogaNode.setFlexDirection(a.FLEX_DIRECTION_COLUMN)}insertChild(t,e){const o=l.get(t.yogaNode);o&&o.removeChild(t);const r=t.yogaNode.getParent();r&&r.removeChild(t.yogaNode);const n=this.yogaNode.getChildCount(),i=Math.min(e,n);try{this.yogaNode.insertChild(t.yogaNode,i)}catch{return}t.parent=this,this.children.splice(i,0,t),l.set(t.yogaNode,this)}remove(){this.parent&&this.parent.removeChild(this)}removeChild(t){const e=this.children.indexOf(t);if(e!==-1){this.children.splice(e,1),t.parent=null,l.delete(t.yogaNode);const o=t.yogaNode.getParent();o&&o.removeChild(t.yogaNode)}}destroy(){if(this._destroyed)return;this._destroyed=!0;for(const e of this.children)e.parent===this&&(e.parent=null);this.children=[],l.delete(this.yogaNode);const t=this.yogaNode.getParent();t&&t.removeChild(this.yogaNode),this.yogaNode.free()}calculateLayout(t,e){this.yogaNode.setWidth(t),this.yogaNode.setHeight(e),this.yogaNode.calculateLayout(t,e,a.DIRECTION_LTR)}getLayout(){return this.yogaNode.getComputedLayout()}}export{E as LayoutNode};
@@ -1 +1 @@
1
- var _=Object.defineProperty;var d=(e,t)=>_(e,"name",{value:t,configurable:!0});import{createRequire as T}from"node:module";import{jsx as j}from"react/jsx-runtime";import{useRef as f,useReducer as w,useEffect as k,useMemo as E}from"react";import{useStdinContext as B}from"../ink/hooks/use-stdin.js";import P from"../ink/hooks/use-stdout.js";import{M as n,a as $}from"./ansi-parser-C5JuL732.js";import{o as q}from"./mouse-context-DaARgUu1.js";const h=T(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=d(e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[t,i]=u.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return u.getBuiltinModule(e)}return h(e)},"__cjs_getBuiltinModule"),{EventEmitter:x}=M("node:events"),R=u;var O=Object.defineProperty,b=d((e,t)=>O(e,"name",{value:t,configurable:!0}),"l");const S={button:null,click:null,drag:null,position:{x:0,y:0},scroll:null},G=b((e,t)=>{switch(t.type){case"click":return{...e,button:t.button,click:t.click,position:t.position};case"click-reset":return{...e,button:null,click:null};case"drag":return{...e,button:t.button,drag:t.drag,position:t.position};case"move":return{...e,position:t.position};case"scroll":return{...e,position:t.position,scroll:t.scroll};case"scroll-reset":return{...e,scroll:null};default:return e}},"mouseReducer"),H=b(({children:e})=>{const{internal_eventEmitter:t}=B(),{stdout:i}=P(),l=f(new x),[s,c]=w(G,S),p=f(void 0),m=f(void 0);k(()=>{const a=i.isTTY?i:R.stdout;return a.write(n.mouseButton.on+n.mouseMotion.on+n.mouseMotionOthers.on+n.mouseSGR.on),()=>{a.write(n.mouseSGR.off+n.mouseMotionOthers.off+n.mouseMotion.off+n.mouseButton.off)}},[i]),k(()=>{const a=b(y=>{const o=$(y);if(!o)return;const r={x:o.x,y:o.y};switch(l.current.emit("position",r),o.type){case"click":{c({button:o.button,click:o.action,position:r,type:"click"}),l.current.emit("click",r,o.action,o.button),clearTimeout(p.current),p.current=setTimeout(()=>{c({type:"click-reset"})},100);break}case"drag":{const g=o.action==="press"?"dragging":null;c({button:o.button,drag:g,position:r,type:"drag"}),l.current.emit("drag",r,g,o.button);break}case"move":{c({position:r,type:"move"});break}case"scroll":{c({position:r,scroll:o.direction,type:"scroll"}),l.current.emit("scroll",r,o.direction),clearTimeout(m.current),m.current=setTimeout(()=>{c({type:"scroll-reset"})},100);break}}},"handleInput");return t.on("input",a),()=>{t.off("input",a),clearTimeout(p.current),clearTimeout(m.current)}},[t]);const v=E(()=>({button:s.button,click:s.click,drag:s.drag,events:l.current,position:s.position,scroll:s.scroll}),[s]);return j(q,{value:v,children:e})},"MouseProvider");export{H as default};
1
+ var _=Object.defineProperty;var d=(e,t)=>_(e,"name",{value:t,configurable:!0});import{createRequire as T}from"node:module";import{jsx as j}from"react/jsx-runtime";import{useRef as f,useReducer as w,useEffect as k,useMemo as E}from"react";import{useStdinContext as B}from"../ink/hooks/use-stdin.js";import P from"../ink/hooks/use-stdout.js";import{M as n,a as $}from"./ansi-parser-B6uXaq65.js";import{o as q}from"./mouse-context-DaARgUu1.js";const h=T(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=d(e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[t,i]=u.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return u.getBuiltinModule(e)}return h(e)},"__cjs_getBuiltinModule"),{EventEmitter:x}=M("node:events"),R=u;var O=Object.defineProperty,b=d((e,t)=>O(e,"name",{value:t,configurable:!0}),"l");const S={button:null,click:null,drag:null,position:{x:0,y:0},scroll:null},G=b((e,t)=>{switch(t.type){case"click":return{...e,button:t.button,click:t.click,position:t.position};case"click-reset":return{...e,button:null,click:null};case"drag":return{...e,button:t.button,drag:t.drag,position:t.position};case"move":return{...e,position:t.position};case"scroll":return{...e,position:t.position,scroll:t.scroll};case"scroll-reset":return{...e,scroll:null};default:return e}},"mouseReducer"),H=b(({children:e})=>{const{internal_eventEmitter:t}=B(),{stdout:i}=P(),l=f(new x),[s,c]=w(G,S),p=f(void 0),m=f(void 0);k(()=>{const a=i.isTTY?i:R.stdout;return a.write(n.mouseButton.on+n.mouseMotion.on+n.mouseMotionOthers.on+n.mouseSGR.on),()=>{a.write(n.mouseSGR.off+n.mouseMotionOthers.off+n.mouseMotion.off+n.mouseButton.off)}},[i]),k(()=>{const a=b(y=>{const o=$(y);if(!o)return;const r={x:o.x,y:o.y};switch(l.current.emit("position",r),o.type){case"click":{c({button:o.button,click:o.action,position:r,type:"click"}),l.current.emit("click",r,o.action,o.button),clearTimeout(p.current),p.current=setTimeout(()=>{c({type:"click-reset"})},100);break}case"drag":{const g=o.action==="press"?"dragging":null;c({button:o.button,drag:g,position:r,type:"drag"}),l.current.emit("drag",r,g,o.button);break}case"move":{c({position:r,type:"move"});break}case"scroll":{c({position:r,scroll:o.direction,type:"scroll"}),l.current.emit("scroll",r,o.direction),clearTimeout(m.current),m.current=setTimeout(()=>{c({type:"scroll-reset"})},100);break}}},"handleInput");return t.on("input",a),()=>{t.off("input",a),clearTimeout(p.current),clearTimeout(m.current)}},[t]);const v=E(()=>({button:s.button,click:s.click,drag:s.drag,events:l.current,position:s.position,scroll:s.scroll}),[s]);return j(q,{value:v,children:e})},"MouseProvider");export{H as default};