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

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 (73) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE.md +136 -6
  3. package/dist/components/box.d.ts +2 -2
  4. package/dist/components/controlled-scroll-view.d.ts +2 -2
  5. package/dist/components/controlled-scroll-view.js +1 -1
  6. package/dist/components/cursor.d.ts +3 -3
  7. package/dist/components/dialog.d.ts +3 -3
  8. package/dist/components/dialog.js +1 -1
  9. package/dist/components/progress-bar.d.ts +1 -1
  10. package/dist/components/scroll-bar-box.d.ts +2 -2
  11. package/dist/components/scroll-bar.d.ts +2 -2
  12. package/dist/components/scroll-list.d.ts +2 -2
  13. package/dist/components/scroll-list.js +1 -1
  14. package/dist/components/scroll-view.d.ts +2 -2
  15. package/dist/components/scroll-view.js +1 -1
  16. package/dist/components/static-render.d.ts +7 -3
  17. package/dist/components/static-render.js +1 -1
  18. package/dist/components/static.d.ts +1 -1
  19. package/dist/components/text.d.ts +1 -1
  20. package/dist/components/tree-view-entry.d.ts +2 -2
  21. package/dist/ink/hooks/use-app.d.ts +1 -1
  22. package/dist/ink/hooks/use-box-metrics.d.ts +6 -4
  23. package/dist/ink/hooks/use-box-metrics.js +1 -1
  24. package/dist/ink/hooks/use-focus-manager.d.ts +2 -1
  25. package/dist/ink/hooks/use-input.d.ts +1 -1
  26. package/dist/ink/hooks/use-input.js +1 -1
  27. package/dist/ink/hooks/use-linked-scroll.d.ts +2 -2
  28. package/dist/ink/hooks/use-paste.d.ts +2 -1
  29. package/dist/ink/hooks/use-paste.js +1 -1
  30. package/dist/ink/hooks/use-text-selection.d.ts +4 -4
  31. package/dist/ink/hooks/use-text-selection.js +1 -1
  32. package/dist/ink/index.d.ts +9 -7
  33. package/dist/ink/index.js +1 -1
  34. package/dist/packem_shared/ControlledScrollView-C8VKEcM3.js +1 -0
  35. package/dist/packem_shared/{DevTools-ClnTSU76.js → DevTools-DdB596Gm.js} +1 -1
  36. package/dist/packem_shared/{LayoutNode-Q7nU3hmO.js → LayoutNode-B0qeT8sl.js} +1 -1
  37. package/dist/packem_shared/{ScrollList-Dxgv-mhZ.js → ScrollList-TUuafnA1.js} +1 -1
  38. package/dist/packem_shared/{ScrollView-Dq2v5zJS.js → ScrollView-D9nrXw4U.js} +1 -1
  39. package/dist/packem_shared/{comparePoints-l0iqUoL_.js → comparePoints-Dhgn8lGv.js} +1 -1
  40. package/dist/packem_shared/{controlled-scroll-view-CikQ90_V.js → controlled-scroll-view-CFM7ZV9N.js} +1 -1
  41. package/dist/packem_shared/{dom-CMbdnYbk.js → dom-UWZI4lDM.js} +1 -1
  42. package/dist/packem_shared/{dom.d-BZZeZlyP.d.ts → dom.d-C-sqbtxD.d.ts} +10 -2
  43. package/dist/packem_shared/get-string-width-CbMPWEJO.js +1 -0
  44. package/dist/packem_shared/{getPathToRoot-Nb2eTx2o.js → getPathToRoot-CL45WosJ.js} +1 -1
  45. package/dist/packem_shared/getScrollHeight-ClEOyLHH.js +1 -0
  46. package/dist/packem_shared/{layout-P24eyWyL.js → layout-D5zRYQRE.js} +1 -1
  47. package/dist/packem_shared/{measure-text-CIs55Wao.js → measure-text-D-jVetsl.js} +2 -2
  48. package/dist/packem_shared/{measureElement-CRKlFSvD.js → measureElement-BP4fUMFg.js} +1 -1
  49. package/dist/packem_shared/processLayout-D2unRIYk.js +1 -0
  50. package/dist/packem_shared/{reconciler-BQvF1kRj.js → reconciler-C0e93MVj.js} +1 -1
  51. package/dist/packem_shared/{reconciler-tOH9yL_j.js → reconciler-ChRlmCI_.js} +1 -1
  52. package/dist/packem_shared/render-Cn56QShB.js +27 -0
  53. package/dist/packem_shared/{render-yGJFE4of.js → render-CqZntGO6.js} +1 -1
  54. package/dist/packem_shared/{render.d-BJmVQ_cd.d.ts → render.d-CZ__oorj.d.ts} +19 -1
  55. package/dist/packem_shared/{renderToString-GyN-Rw9F.js → renderToString-D3xqB85B.js} +1 -1
  56. package/dist/packem_shared/{renderToString-D4JqS-Zv.js → renderToString-DE1YWhbo.js} +1 -1
  57. package/dist/packem_shared/{renderTreeToBuffer-DWl5_yTW.js → renderTreeToBuffer-LnGZkEUX.js} +1 -1
  58. package/dist/packem_shared/{renderer-Cidd3s9K.js → renderer-DaPOmgCC.js} +6 -6
  59. package/dist/packem_shared/{selection.d-vfuEzv1p.d.ts → selection.d-t_tKgYYA.d.ts} +1 -1
  60. package/dist/packem_shared/{setEnableStyledLineCache-Aja0FbWo.js → setEnableStyledLineCache-Cke6_ZQt.js} +1 -1
  61. package/dist/packem_shared/{styles.d-i6Mejqz2.d.ts → styles.d-CLJdt-kg.d.ts} +35 -7
  62. package/dist/packem_shared/{text-width-DSx26OmB.js → text-width-CI9G0a-z.js} +1 -1
  63. package/dist/packem_shared/{wrapOrTruncateStyledLine-D29Fq7pW.js → wrapOrTruncateStyledLine-kyi6yijx.js} +1 -1
  64. package/dist/react/index.js +1 -1
  65. package/dist/testing/index.d.ts +4 -4
  66. package/dist/testing/index.js +1 -1
  67. package/index.js +539 -691
  68. package/package.json +17 -16
  69. package/dist/packem_shared/ControlledScrollView-X_OTc-Cw.js +0 -1
  70. package/dist/packem_shared/get-string-width-4oMZhv2Q.js +0 -1
  71. package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +0 -1
  72. package/dist/packem_shared/processLayout-Dmgf0LO6.js +0 -1
  73. package/dist/packem_shared/render-D9bHMHrx.js +0 -26
package/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## @visulima/tui [1.0.0-alpha.17](https://github.com/visulima/visulima/compare/@visulima/tui@1.0.0-alpha.16...@visulima/tui@1.0.0-alpha.17) (2026-05-19)
2
+
3
+ ### Features
4
+
5
+ * **tui:** flush scrolled-off lines to terminal scrollback ([7856378](https://github.com/visulima/visulima/commit/78563780b60d506651013dee372bbad4a183bcb0))
6
+
7
+ ### Bug Fixes
8
+
9
+ * **tui:** correct peer deps and runtime type-fest ([ececda1](https://github.com/visulima/visulima/commit/ececda1cf823ff39e0a1a0e4f1d64015088c42ff))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * **@visulima/error:** upgraded to 6.0.0-alpha.26
15
+
1
16
  ## @visulima/tui [1.0.0-alpha.16](https://github.com/visulima/visulima/compare/@visulima/tui@1.0.0-alpha.15...@visulima/tui@1.0.0-alpha.16) (2026-05-16)
2
17
 
3
18
  ### Miscellaneous Chores
package/LICENSE.md CHANGED
@@ -2002,14 +2002,11 @@ Repository: git+https://github.com/visulima/visulima.git
2002
2002
  > >
2003
2003
  > >
2004
2004
  > > # Licenses of bundled types
2005
- > >
2006
2005
  > > The published @visulima/string artifact additionally contains code with the following licenses:
2007
2006
  > > MIT
2008
2007
  > >
2009
2008
  > > # Bundled types:
2010
- > >
2011
2009
  > > ## fastest-levenshtein
2012
- > >
2013
2010
  > > License: MIT
2014
2011
  > > By: Kasper U. Weihe
2015
2012
  > > Repository: git+https://github.com/ka-weihe/fastest-levenshtein.git
@@ -2035,6 +2032,74 @@ Repository: git+https://github.com/visulima/visulima.git
2035
2032
  > > > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2036
2033
  > > > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2037
2034
  > > > SOFTWARE.
2035
+ > >
2036
+ > > ---------------------------------------
2037
+ > >
2038
+ > > ## get-east-asian-width
2039
+ > > License: MIT
2040
+ > > By: Sindre Sorhus
2041
+ > > Repository: sindresorhus/get-east-asian-width
2042
+ > >
2043
+ > > > MIT License
2044
+ > > >
2045
+ > > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
2046
+ > > >
2047
+ > > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2048
+ > > >
2049
+ > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2050
+ > > >
2051
+ > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2052
+ > >
2053
+ > > ---------------------------------------
2054
+ > >
2055
+ > > ## indent-string
2056
+ > > License: MIT
2057
+ > > By: Sindre Sorhus
2058
+ > > Repository: sindresorhus/indent-string
2059
+ > >
2060
+ > > > MIT License
2061
+ > > >
2062
+ > > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
2063
+ > > >
2064
+ > > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2065
+ > > >
2066
+ > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2067
+ > > >
2068
+ > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2069
+ > >
2070
+ > > ---------------------------------------
2071
+ > >
2072
+ > > ## redent
2073
+ > > License: MIT
2074
+ > > By: Sindre Sorhus
2075
+ > > Repository: sindresorhus/redent
2076
+ > >
2077
+ > > > MIT License
2078
+ > > >
2079
+ > > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
2080
+ > > >
2081
+ > > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2082
+ > > >
2083
+ > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2084
+ > > >
2085
+ > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2086
+ > >
2087
+ > > ---------------------------------------
2088
+ > >
2089
+ > > ## strip-indent
2090
+ > > License: MIT
2091
+ > > By: Sindre Sorhus
2092
+ > > Repository: sindresorhus/strip-indent
2093
+ > >
2094
+ > > > MIT License
2095
+ > > >
2096
+ > > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
2097
+ > > >
2098
+ > > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2099
+ > > >
2100
+ > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2101
+ > > >
2102
+ > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2038
2103
  >
2039
2104
  > ---------------------------------------
2040
2105
  >
@@ -2599,14 +2664,11 @@ Repository: git+https://github.com/visulima/visulima.git
2599
2664
  > >
2600
2665
  > >
2601
2666
  > > # Licenses of bundled types
2602
- > >
2603
2667
  > > The published @visulima/string artifact additionally contains code with the following licenses:
2604
2668
  > > MIT
2605
2669
  > >
2606
2670
  > > # Bundled types:
2607
- > >
2608
2671
  > > ## fastest-levenshtein
2609
- > >
2610
2672
  > > License: MIT
2611
2673
  > > By: Kasper U. Weihe
2612
2674
  > > Repository: git+https://github.com/ka-weihe/fastest-levenshtein.git
@@ -2632,6 +2694,74 @@ Repository: git+https://github.com/visulima/visulima.git
2632
2694
  > > > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2633
2695
  > > > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2634
2696
  > > > SOFTWARE.
2697
+ > >
2698
+ > > ---------------------------------------
2699
+ > >
2700
+ > > ## get-east-asian-width
2701
+ > > License: MIT
2702
+ > > By: Sindre Sorhus
2703
+ > > Repository: sindresorhus/get-east-asian-width
2704
+ > >
2705
+ > > > MIT License
2706
+ > > >
2707
+ > > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
2708
+ > > >
2709
+ > > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2710
+ > > >
2711
+ > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2712
+ > > >
2713
+ > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2714
+ > >
2715
+ > > ---------------------------------------
2716
+ > >
2717
+ > > ## indent-string
2718
+ > > License: MIT
2719
+ > > By: Sindre Sorhus
2720
+ > > Repository: sindresorhus/indent-string
2721
+ > >
2722
+ > > > MIT License
2723
+ > > >
2724
+ > > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
2725
+ > > >
2726
+ > > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2727
+ > > >
2728
+ > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2729
+ > > >
2730
+ > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2731
+ > >
2732
+ > > ---------------------------------------
2733
+ > >
2734
+ > > ## redent
2735
+ > > License: MIT
2736
+ > > By: Sindre Sorhus
2737
+ > > Repository: sindresorhus/redent
2738
+ > >
2739
+ > > > MIT License
2740
+ > > >
2741
+ > > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
2742
+ > > >
2743
+ > > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2744
+ > > >
2745
+ > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2746
+ > > >
2747
+ > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2748
+ > >
2749
+ > > ---------------------------------------
2750
+ > >
2751
+ > > ## strip-indent
2752
+ > > License: MIT
2753
+ > > By: Sindre Sorhus
2754
+ > > Repository: sindresorhus/strip-indent
2755
+ > >
2756
+ > > > MIT License
2757
+ > > >
2758
+ > > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
2759
+ > > >
2760
+ > > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2761
+ > > >
2762
+ > > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
2763
+ > > >
2764
+ > > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2635
2765
 
2636
2766
  ---------------------------------------
2637
2767
 
@@ -1,7 +1,7 @@
1
1
  import { ReactNode, PropsWithChildren, RefAttributes, ForwardRefExoticComponent } from 'react';
2
2
  import { Except } from 'type-fest';
3
- import { a as DOMElement } from "../packem_shared/dom.d-BZZeZlyP.js";
4
- import { S as Styles } from "../packem_shared/styles.d-i6Mejqz2.js";
3
+ import { D as DOMElement } from "../packem_shared/dom.d-C-sqbtxD.js";
4
+ import { S as Styles } from "../packem_shared/styles.d-CLJdt-kg.js";
5
5
  import 'yoga-layout';
6
6
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
7
7
  type Props = Except<Styles, "textWrap"> & {
@@ -1,9 +1,9 @@
1
1
  import React, { ReactNode, Ref } from 'react';
2
2
  import { BoxProps as Props } from "./box.js";
3
3
  import 'type-fest';
4
- import "../packem_shared/dom.d-BZZeZlyP.js";
4
+ import "../packem_shared/dom.d-C-sqbtxD.js";
5
5
  import 'yoga-layout';
6
- import "../packem_shared/styles.d-i6Mejqz2.js";
6
+ import "../packem_shared/styles.d-CLJdt-kg.js";
7
7
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
8
8
  interface ControlledScrollViewProps extends Props {
9
9
  children?: ReactNode;
@@ -1 +1 @@
1
- import{C as r}from"../packem_shared/controlled-scroll-view-CikQ90_V.js";export{r as ControlledScrollView};
1
+ import{C as r}from"../packem_shared/controlled-scroll-view-CFM7ZV9N.js";export{r as ControlledScrollView};
@@ -1,9 +1,9 @@
1
1
  import React, { RefObject } from 'react';
2
- import { a as DOMElement } from "../packem_shared/dom.d-BZZeZlyP.js";
2
+ import { D as DOMElement } from "../packem_shared/dom.d-C-sqbtxD.js";
3
3
  import 'yoga-layout';
4
- import "../packem_shared/styles.d-i6Mejqz2.js";
5
- import "../packem_shared/index.server.d-eZWyC2Ku.js";
6
4
  import 'type-fest';
5
+ import "../packem_shared/styles.d-CLJdt-kg.js";
6
+ import "../packem_shared/index.server.d-eZWyC2Ku.js";
7
7
  type Props = {
8
8
  /**
9
9
  * Optional reference to anchor cursor coordinates to a different element.
@@ -1,10 +1,10 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
+ import 'type-fest';
2
3
  import 'yoga-layout';
3
4
  import { b as ScrollViewRef } from "../packem_shared/scroll-view.d-DtpsgHLg.js";
4
5
  import "./box.js";
5
- import 'type-fest';
6
- import "../packem_shared/dom.d-BZZeZlyP.js";
7
- import "../packem_shared/styles.d-i6Mejqz2.js";
6
+ import "../packem_shared/dom.d-C-sqbtxD.js";
7
+ import "../packem_shared/styles.d-CLJdt-kg.js";
8
8
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
9
9
  type Props = {
10
10
  /**
@@ -1 +1 @@
1
- var M=Object.defineProperty;var f=(l,r)=>M(l,"name",{value:r,configurable:!0});import{jsx as o,jsxs as X}from"react/jsx-runtime";import{useRef as H}from"react";import I from"../ink/hooks/use-terminal-palette.js";import R from"../ink/hooks/use-window-size.js";import{Box as e}from"./box.js";import{Text as T}from"./text.js";import{ScrollView as V}from"../packem_shared/ScrollView-Dq2v5zJS.js";var Y=Object.defineProperty,q=f((l,r)=>Y(l,"name",{value:r,configurable:!0}),"b");const F=q(({backgroundColor:l,borderColor:r="cyan",borderStyle:g="round",children:b,columns:h,footer:d,maxHeight:n=.8,paddingX:i=2,paddingY:p=1,rows:x,scrollbarStyle:k="block",scrollRef:y,title:t,visible:C=!0,width:S=60})=>{const c=R(),{isLoading:w,palette:D}=I(),j=H(null),v=y??j;if(!C)return null;const m=h??(c.columns||80),a=x??(c.rows||24),s=l??(w?"black":D?.background??"black"),B=n<=1?Math.floor(a*n):Math.min(n,a-2),u=typeof t=="string"?o(e,{marginBottom:1,children:o(T,{bold:!0,color:r,children:t})}):t??null;return o(e,{alignItems:"center",height:a,justifyContent:"center",position:"absolute",width:m,children:X(e,{backgroundColor:s,borderBackgroundColor:s,borderColor:r,borderStyle:g,flexDirection:"column",maxHeight:B,opaque:!0,paddingY:p,width:Math.min(S,m-4),children:[u!=null&&o(e,{flexShrink:0,paddingX:i,children:u}),o(V,{flexGrow:1,flexShrink:1,paddingX:i,ref:v,scrollbar:!0,scrollbarColor:r,scrollbarStyle:k,children:b}),d!=null&&o(e,{alignItems:"center",flexDirection:"column",flexShrink:0,marginTop:1,paddingX:i,children:d})]})})},"Dialog");export{F as Dialog,F as default};
1
+ var M=Object.defineProperty;var f=(l,r)=>M(l,"name",{value:r,configurable:!0});import{jsx as o,jsxs as X}from"react/jsx-runtime";import{useRef as H}from"react";import I from"../ink/hooks/use-terminal-palette.js";import R from"../ink/hooks/use-window-size.js";import{Box as e}from"./box.js";import{Text as T}from"./text.js";import{ScrollView as V}from"../packem_shared/ScrollView-D9nrXw4U.js";var Y=Object.defineProperty,q=f((l,r)=>Y(l,"name",{value:r,configurable:!0}),"b");const F=q(({backgroundColor:l,borderColor:r="cyan",borderStyle:g="round",children:b,columns:h,footer:d,maxHeight:n=.8,paddingX:i=2,paddingY:p=1,rows:x,scrollbarStyle:k="block",scrollRef:y,title:t,visible:C=!0,width:S=60})=>{const c=R(),{isLoading:w,palette:D}=I(),j=H(null),v=y??j;if(!C)return null;const m=h??(c.columns||80),a=x??(c.rows||24),s=l??(w?"black":D?.background??"black"),B=n<=1?Math.floor(a*n):Math.min(n,a-2),u=typeof t=="string"?o(e,{marginBottom:1,children:o(T,{bold:!0,color:r,children:t})}):t??null;return o(e,{alignItems:"center",height:a,justifyContent:"center",position:"absolute",width:m,children:X(e,{backgroundColor:s,borderBackgroundColor:s,borderColor:r,borderStyle:g,flexDirection:"column",maxHeight:B,opaque:!0,paddingY:p,width:Math.min(S,m-4),children:[u!=null&&o(e,{flexShrink:0,paddingX:i,children:u}),o(V,{flexGrow:1,flexShrink:1,paddingX:i,ref:v,scrollbar:!0,scrollbarColor:r,scrollbarStyle:k,children:b}),d!=null&&o(e,{alignItems:"center",flexDirection:"column",flexShrink:0,marginTop:1,paddingX:i,children:d})]})})},"Dialog");export{F as Dialog,F as default};
@@ -2,7 +2,7 @@ import { ReactElement } from 'react';
2
2
  import { Props as Props$1 } from "./text.js";
3
3
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
4
4
  import 'type-fest';
5
- import "../packem_shared/styles.d-i6Mejqz2.js";
5
+ import "../packem_shared/styles.d-CLJdt-kg.js";
6
6
  import 'yoga-layout';
7
7
  type Props = {
8
8
  /** Fill glyph repeated across the completed portion of the progress bar. Defaults to "█". */
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { BoxProps as Props } from "./box.js";
3
3
  import 'type-fest';
4
- import "../packem_shared/dom.d-BZZeZlyP.js";
4
+ import "../packem_shared/dom.d-C-sqbtxD.js";
5
5
  import 'yoga-layout';
6
- import "../packem_shared/styles.d-i6Mejqz2.js";
6
+ import "../packem_shared/styles.d-CLJdt-kg.js";
7
7
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
8
8
  interface ScrollBarBoxProps extends Props {
9
9
  children?: React.ReactNode;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { BoxProps as Props } from "./box.js";
3
3
  import 'type-fest';
4
- import "../packem_shared/dom.d-BZZeZlyP.js";
4
+ import "../packem_shared/dom.d-C-sqbtxD.js";
5
5
  import 'yoga-layout';
6
- import "../packem_shared/styles.d-i6Mejqz2.js";
6
+ import "../packem_shared/styles.d-CLJdt-kg.js";
7
7
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
8
8
  type ScrollBarPlacement = "inset" | "left" | "right";
9
9
  type ScrollBarStyle = Props["borderStyle"] | "block" | "line" | "thick" | "dots";
@@ -2,9 +2,9 @@ import React, { Ref } from 'react';
2
2
  import { a as ScrollViewProps, b as ScrollViewRef } from "../packem_shared/scroll-view.d-DtpsgHLg.js";
3
3
  import "./box.js";
4
4
  import 'type-fest';
5
- import "../packem_shared/dom.d-BZZeZlyP.js";
5
+ import "../packem_shared/dom.d-C-sqbtxD.js";
6
6
  import 'yoga-layout';
7
- import "../packem_shared/styles.d-i6Mejqz2.js";
7
+ import "../packem_shared/styles.d-CLJdt-kg.js";
8
8
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
9
9
  type ScrollAlignment = "auto" | "bottom" | "center" | "top";
10
10
  interface ScrollListProps extends ScrollViewProps {
@@ -1 +1 @@
1
- import{ScrollList as l}from"../packem_shared/ScrollList-Dxgv-mhZ.js";export{l as ScrollList};
1
+ import{ScrollList as l}from"../packem_shared/ScrollList-TUuafnA1.js";export{l as ScrollList};
@@ -2,7 +2,7 @@ export { S as ScrollView, type a as ScrollViewProps, type b as ScrollViewRef } f
2
2
  import 'react';
3
3
  import "./box.js";
4
4
  import 'type-fest';
5
- import "../packem_shared/dom.d-BZZeZlyP.js";
5
+ import "../packem_shared/dom.d-C-sqbtxD.js";
6
6
  import 'yoga-layout';
7
- import "../packem_shared/styles.d-i6Mejqz2.js";
7
+ import "../packem_shared/styles.d-CLJdt-kg.js";
8
8
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
@@ -1 +1 @@
1
- import{ScrollView as e}from"../packem_shared/ScrollView-Dq2v5zJS.js";export{e as ScrollView};
1
+ import{ScrollView as e}from"../packem_shared/ScrollView-D9nrXw4U.js";export{e as ScrollView};
@@ -1,8 +1,9 @@
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 { D as DOMElement } from "../packem_shared/dom.d-C-sqbtxD.js";
3
+ import { S as Styles } from "../packem_shared/styles.d-CLJdt-kg.js";
5
4
  import 'yoga-layout';
5
+ import 'type-fest';
6
+ import "../packem_shared/index.server.d-eZWyC2Ku.js";
6
7
 
7
8
  /**
8
9
  * StaticRender component — pre-renders children once and caches the result.
@@ -31,18 +32,21 @@ import 'yoga-layout';
31
32
  /**
32
33
  * @property children Render function invoked once to produce the cached content.
33
34
  * @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.
35
+ * @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
36
  * @property style Optional style applied to the static-render container.
35
37
  * @property width Optional fixed width for the cached region.
36
38
  */
37
39
  type Props = {
38
40
  readonly children: () => ReactNode;
39
41
  readonly deps?: DependencyList;
42
+ readonly onRender?: (node: DOMElement) => void;
40
43
  readonly style?: Styles;
41
44
  readonly width?: number;
42
45
  };
43
46
  declare const StaticRender: ({
44
47
  children,
45
48
  deps,
49
+ onRender,
46
50
  style,
47
51
  width
48
52
  }: 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,5 +1,5 @@
1
1
  import { ReactNode, ReactElement } from 'react';
2
- import { S as Styles } from "../packem_shared/styles.d-i6Mejqz2.js";
2
+ import { S as Styles } from "../packem_shared/styles.d-CLJdt-kg.js";
3
3
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
4
4
  import 'type-fest';
5
5
  import 'yoga-layout';
@@ -1,7 +1,7 @@
1
1
  import { A as AnsiColors } from "../packem_shared/index.server.d-eZWyC2Ku.js";
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-CLJdt-kg.js";
5
5
  import 'yoga-layout';
6
6
  type Props = {
7
7
  /**
@@ -2,9 +2,9 @@ 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-C-sqbtxD.js";
6
6
  import 'yoga-layout';
7
- import "../packem_shared/styles.d-i6Mejqz2.js";
7
+ import "../packem_shared/styles.d-CLJdt-kg.js";
8
8
  import "../packem_shared/index.server.d-eZWyC2Ku.js";
9
9
  type StyleFunctionProps = {
10
10
  readonly depth?: number;
@@ -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,9 @@
1
1
  import { RefObject } from 'react';
2
- import { a as DOMElement } from "../../packem_shared/dom.d-BZZeZlyP.js";
2
+ import { D as DOMElement } from "../../packem_shared/dom.d-C-sqbtxD.js";
3
3
  import 'yoga-layout';
4
- import "../../packem_shared/styles.d-i6Mejqz2.js";
5
- import "../../packem_shared/index.server.d-eZWyC2Ku.js";
6
4
  import 'type-fest';
5
+ import "../../packem_shared/styles.d-CLJdt-kg.js";
6
+ import "../../packem_shared/index.server.d-eZWyC2Ku.js";
7
7
  /**
8
8
  * Metrics of a box element.
9
9
  *
@@ -43,7 +43,9 @@ type UseBoxMetricsResult = BoxMetrics & {
43
43
  * @example
44
44
  * ```tsx
45
45
  import {useRef} from 'react';
46
- import {Box, Text, useBoxMetrics} from 'ink';
46
+ import {Box} from '@visulima/tui/components/box';
47
+ import {Text} from '@visulima/tui/components/text';
48
+ import {useBoxMetrics} from '@visulima/tui/hooks/use-box-metrics';
47
49
 
48
50
  const Example = () => {
49
51
  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-UWZI4lDM.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-ChRlmCI_.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,9 +2,9 @@ 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-C-sqbtxD.js";
6
6
  import 'yoga-layout';
7
- import "../../packem_shared/styles.d-i6Mejqz2.js";
7
+ import "../../packem_shared/styles.d-CLJdt-kg.js";
8
8
  import "../../packem_shared/index.server.d-eZWyC2Ku.js";
9
9
  type UseLinkedScrollReturn = {
10
10
  /**
@@ -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-ChRlmCI_.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,10 @@
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 { D as DOMElement } from "../../packem_shared/dom.d-C-sqbtxD.js";
3
+ import { S as Selection } from "../../packem_shared/selection.d-t_tKgYYA.js";
4
4
  import 'yoga-layout';
5
- import "../../packem_shared/styles.d-i6Mejqz2.js";
6
- import "../../packem_shared/index.server.d-eZWyC2Ku.js";
7
5
  import 'type-fest';
6
+ import "../../packem_shared/styles.d-CLJdt-kg.js";
7
+ import "../../packem_shared/index.server.d-eZWyC2Ku.js";
8
8
  type UseTextSelectionOptions = {
9
9
  /**
10
10
  * 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-Dhgn8lGv.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};