@visulima/tui 1.0.0-alpha.6 → 1.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/core/index.js +1 -5
- package/dist/ink/index.d.ts +15 -34
- package/dist/ink/index.js +1 -155
- package/dist/packem_chunks/devtools.js +3 -26
- package/dist/packem_shared/Accordion-BXsqchV-.js +1 -0
- package/dist/packem_shared/Alert-BhYVMHtR.js +1 -0
- package/dist/packem_shared/AnimatePresence-Eu7Z8KHc.js +1 -0
- package/dist/packem_shared/ApprovalPrompt-BSn0FT1g.js +1 -0
- package/dist/packem_shared/AreaChart-Chy-frI7.js +1 -0
- package/dist/packem_shared/Badge-B8WPyRsK.js +1 -0
- package/dist/packem_shared/BarChart-rpZtlMcF.js +1 -0
- package/dist/packem_shared/BigText-CRpwUzrt.js +1 -0
- package/dist/packem_shared/BlinkDot-BvnRuWP8.js +1 -0
- package/dist/packem_shared/Box-BwqSvWuq.js +1 -0
- package/dist/packem_shared/Breadcrumb-D0hClbRV.js +1 -0
- package/dist/packem_shared/Button-B89Yvbc6.js +1 -0
- package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +1 -0
- package/dist/packem_shared/Calendar-Dmflvm2S.js +1 -0
- package/dist/packem_shared/Canvas-CKg6WV47.js +1 -0
- package/dist/packem_shared/Card-B_9fXdtU.js +1 -0
- package/dist/packem_shared/Cell-BrXn3jxY.js +1 -0
- package/dist/packem_shared/Checkbox-BN71eCWU.js +1 -0
- package/dist/packem_shared/Code-HhevcyiH.js +2 -0
- package/dist/packem_shared/Collapsible-u6uf_FdV.js +1 -0
- package/dist/packem_shared/CommandBlock-B-nslpCv.js +4 -0
- package/dist/packem_shared/CommandPalette-CEFdaURo.js +1 -0
- package/dist/packem_shared/ConfirmDialog-5Jje_Xpu.js +1 -0
- package/dist/packem_shared/ConfirmInput-D44Mb9oo.js +1 -0
- package/dist/packem_shared/ConsoleOverlay-CM3APfgP.js +1 -0
- package/dist/packem_shared/ContentSwitcher-Dm5BkrCt.js +1 -0
- package/dist/packem_shared/ControlledScrollView-DI8KZOQB.js +1 -0
- package/dist/packem_shared/Cursor-BoLFIMol.js +1 -0
- package/dist/packem_shared/DatePicker-CnSrFFAE.js +1 -0
- package/dist/packem_shared/DefinitionList-v8RDuF_R.js +1 -0
- package/dist/packem_shared/DevTools-O8EbCfHa.js +1 -0
- package/dist/packem_shared/Dialog-CTaL8pn0.js +1 -0
- package/dist/packem_shared/DiffView-BUIFqUB0.js +1 -0
- package/dist/packem_shared/Divider-C47bKmqu.js +1 -0
- package/dist/packem_shared/FilePicker-CUo7R5Qb.js +1 -0
- package/dist/packem_shared/FocusContext-Xy0cwJpO.js +1 -0
- package/dist/packem_shared/FormField-af3aUpRL.js +1 -0
- package/dist/packem_shared/Fullscreen-CuJ8y0s0.js +1 -0
- package/dist/packem_shared/Gauge-Dz-usH__.js +1 -0
- package/dist/packem_shared/Gradient-DYNc0GZA.js +1 -0
- package/dist/packem_shared/Heading-mwEYza3Y.js +1 -0
- package/dist/packem_shared/Heatmap-ChL97U1-.js +1 -0
- package/dist/packem_shared/Help-Zcelyw_U.js +1 -0
- package/dist/packem_shared/Histogram-FIf2F83d.js +1 -0
- package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +1 -0
- package/dist/packem_shared/InputParser-rZKjY_7Y.js +2 -0
- package/dist/packem_shared/KEY-Bk8B-3h_.js +1 -0
- package/dist/packem_shared/Kbd-DpkPp4jB.js +1 -0
- package/dist/packem_shared/LayoutNode-rxblE317.js +1 -0
- package/dist/packem_shared/LineChart-BXE_girm.js +1 -0
- package/dist/packem_shared/Link-i2o2EG4-.js +1 -0
- package/dist/packem_shared/LoadingIndicator-TC1Fjwyt.js +1 -0
- package/dist/packem_shared/Markdown-R1XqK63D.js +1 -0
- package/dist/packem_shared/MaskedInput-J01phOZs.js +1 -0
- package/dist/packem_shared/Menu-CfrH4ymk.js +1 -0
- package/dist/packem_shared/MessageBubble-BmBBU2Rm.js +1 -0
- package/dist/packem_shared/ModelBadge-D3wrXncu.js +1 -0
- package/dist/packem_shared/MouseProvider-pjza-lpc.js +1 -0
- package/dist/packem_shared/MultiSelect-Dqmn-bVo.js +1 -0
- package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +1 -0
- package/dist/packem_shared/Newline-BSG4iUqp.js +2 -0
- package/dist/packem_shared/OperationTree-DksxjMIV.js +1 -0
- package/dist/packem_shared/OptionList-CNx7r9yN.js +1 -0
- package/dist/packem_shared/OrderedList-BeDy035w.js +1 -0
- package/dist/packem_shared/Paginator-B56s6bhS.js +1 -0
- package/dist/packem_shared/Paragraph-BqJlH0R-.js +1 -0
- package/dist/packem_shared/Placeholder-GMpHRGC8.js +1 -0
- package/dist/packem_shared/ProgressBar-Bj3fmORR.js +1 -0
- package/dist/packem_shared/RadioGroup-Br8BeEwS.js +1 -0
- package/dist/packem_shared/Renderer-DJXooAsp.js +1 -0
- package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +1 -0
- package/dist/packem_shared/ScatterPlot-OhfYco5l.js +1 -0
- package/dist/packem_shared/ScrollBar-Da5Y3z7N.js +1 -0
- package/dist/packem_shared/ScrollBarBox-Dz6F-Eat.js +1 -0
- package/dist/packem_shared/ScrollList-DiVGyEjv.js +1 -0
- package/dist/packem_shared/ScrollView-BojONotI.js +1 -0
- package/dist/packem_shared/SearchInput-BoPTRbhV.js +1 -0
- package/dist/packem_shared/SelectInput-CAJ7SCBq.js +1 -0
- package/dist/packem_shared/SelectInputIndicator-N1n8ULHs.js +1 -0
- package/dist/packem_shared/SelectInputItem-BEkbmobs.js +1 -0
- package/dist/packem_shared/ShimmerText-CuGQ2NDC.js +1 -0
- package/dist/packem_shared/Slider-Cg_tJpKa.js +1 -0
- package/dist/packem_shared/Spacer-eT3HOrXk.js +1 -0
- package/dist/packem_shared/Sparkline-T6_FPVET.js +1 -0
- package/dist/packem_shared/Spinner-B0-A50pu.js +1 -0
- package/dist/packem_shared/Static-DLynr5pn.js +1 -0
- package/dist/packem_shared/Static-jzLPaHJF.js +1 -0
- package/dist/packem_shared/StaticRender-BgD61E7x.js +1 -0
- package/dist/packem_shared/StatusLine-Ch4jjef1.js +1 -0
- package/dist/packem_shared/StatusMessage-B1qfKeMM.js +1 -0
- package/dist/packem_shared/Stepper-CNPAqxiU.js +1 -0
- package/dist/packem_shared/Stopwatch-CAx2EWwq.js +1 -0
- package/dist/packem_shared/StreamingText-BYOKSB2T.js +1 -0
- package/dist/packem_shared/Switch-DzSpKYu7.js +1 -0
- package/dist/packem_shared/Tab-BcXzSUdj.js +1 -0
- package/dist/packem_shared/Table-DJp1TLrR.js +1 -0
- package/dist/packem_shared/Tabs-D68z0SOt.js +1 -0
- package/dist/packem_shared/Tag-BvLHnYRn.js +1 -0
- package/dist/packem_shared/Text-mTAve9R2.js +1 -0
- package/dist/packem_shared/TextInput-C_gYQlnF.js +1 -0
- package/dist/packem_shared/Textarea-C2ET_oMb.js +2 -0
- package/dist/packem_shared/Timer-CI3aQX65.js +1 -0
- package/dist/packem_shared/Toast-Drvc8XfG.js +1 -0
- package/dist/packem_shared/Tooltip-C5UnQlLd.js +1 -0
- package/dist/packem_shared/Transform-fYmcdqRT.js +1 -0
- package/dist/packem_shared/Transition-CJDBKYUB.js +1 -0
- package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +1 -0
- package/dist/packem_shared/TreeView-DjhacGJ5.js +1 -0
- package/dist/packem_shared/TuiApp-DrjI_i-R.js +1 -0
- package/dist/packem_shared/TuiContext-BoJvG3NN.js +3 -0
- package/dist/packem_shared/UnorderedList-BnfqexZs.js +1 -0
- package/dist/packem_shared/accessibility-context-DDyHTwmA.js +1 -0
- package/dist/packem_shared/animation-context-DW3p-vpk.js +1 -0
- package/dist/packem_shared/ansi-parser-B6uXaq65.js +1 -0
- package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +1 -0
- package/dist/packem_shared/app-context-BVpKlG1z.js +1 -0
- package/dist/packem_shared/background-context-rjOaWFki.js +1 -0
- package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
- package/dist/packem_shared/braille-BBjIoaN0.js +1 -0
- package/dist/packem_shared/colorize-DbTZMrJO.js +1 -0
- package/dist/packem_shared/comparePoints-C85EsmNz.js +1 -0
- package/dist/packem_shared/controlled-scroll-view-CmrAEvJk.js +1 -0
- package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +2 -0
- package/dist/packem_shared/createLinkedScrollGroup-BMTJ7rAj.js +1 -0
- package/dist/packem_shared/createMemoryStorage-QVZNXbWz.js +2 -0
- package/dist/packem_shared/createScreen-CrLrxA6t.js +3 -0
- package/dist/packem_shared/cursor-context-CFviBqPX.js +1 -0
- package/dist/packem_shared/dom-4y__5fWB.js +1 -0
- package/dist/packem_shared/focus-context-CsT69klR.js +1 -0
- package/dist/packem_shared/format-time-C7Q-hQZq.js +1 -0
- package/dist/packem_shared/getPathToRoot-B2tKmx3i.js +1 -0
- package/dist/packem_shared/getScrollHeight-BTEY8ewu.js +1 -0
- package/dist/packem_shared/input-utils-fAxzSlNh.js +1 -0
- package/dist/packem_shared/isIntersecting-B3KbKTmu.js +1 -0
- package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +1 -0
- package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +1 -0
- package/dist/packem_shared/kittyFlags-C3rZLbcK.js +1 -0
- package/dist/packem_shared/line-chart-DrM8PwnI.js +1 -0
- package/dist/packem_shared/measure-element-DSp7YDus.js +2 -0
- package/dist/packem_shared/measure-text-DDjHT1jD.js +3 -0
- package/dist/packem_shared/measureElement-DA8WqFP_.js +1 -0
- package/dist/packem_shared/mouse-context-DaARgUu1.js +1 -0
- package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +1 -0
- package/dist/packem_shared/processLayout-DXDfFb_d.js +1 -0
- package/dist/packem_shared/reconciler-BuOP-TZ6.js +1 -0
- package/dist/packem_shared/reconciler-DSYCrIZs.js +1 -0
- package/dist/packem_shared/render-DDqtMAFN.js +1 -0
- package/dist/packem_shared/render-_r0K9K11.js +28 -0
- package/dist/packem_shared/renderToString-DeqOWRP8.js +4 -0
- package/dist/packem_shared/renderToString-IYYPyASm.js +2 -0
- package/dist/packem_shared/renderTreeToBuffer-DPkoCgP2.js +2 -0
- package/dist/packem_shared/renderer-D2p6av2X.js +17 -0
- package/dist/packem_shared/setEnableStyledLineCache-D2gZbwFM.js +1 -0
- package/dist/packem_shared/squashTextNodesWithMap-Cpqmc45i.js +1 -0
- package/dist/packem_shared/stderr-context-BzEaUICS.js +1 -0
- package/dist/packem_shared/stdin-context-BTaaFagk.js +1 -0
- package/dist/packem_shared/stdout-context-BnblEPez.js +1 -0
- package/dist/packem_shared/text-width-CZ9vPvM0.js +2 -0
- package/dist/packem_shared/token-to-elements-BYxT6J_Q.js +1 -0
- package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +1 -0
- package/dist/packem_shared/useAnimation-B9we6ZzL.js +1 -0
- package/dist/packem_shared/useApp-B6fvM42d.js +1 -0
- package/dist/packem_shared/useBoxMetrics-D5pkIr6P.js +1 -0
- package/dist/packem_shared/useClipboard-CBxy0hT8.js +1 -0
- package/dist/packem_shared/useColorBlindness-BvWcu2Bb.js +1 -0
- package/dist/packem_shared/useConsoleCapture-BxiG8iLJ.js +1 -0
- package/dist/packem_shared/useCursor-CPu8T5Db.js +1 -0
- package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +1 -0
- package/dist/packem_shared/useFocus-DSmziO_x.js +1 -0
- package/dist/packem_shared/useFocusManager-Uapn3LQo.js +1 -0
- package/dist/packem_shared/useForm-CzV-Oext.js +1 -0
- package/dist/packem_shared/useHotkey-D0dGey14.js +1 -0
- package/dist/packem_shared/useInput-D1_jG26Z.js +2 -0
- package/dist/packem_shared/useInterval-AobjZT3u.js +1 -0
- package/dist/packem_shared/useIsScreenReaderEnabled-DjWHh-II.js +1 -0
- package/dist/packem_shared/useKeyBindings-zabkEJQs.js +1 -0
- package/dist/packem_shared/useKeyChord-CICQIxXj.js +1 -0
- package/dist/packem_shared/useMouseAction-2dRfU1vE.js +1 -0
- package/dist/packem_shared/useMouseContext-C746G7kY.js +1 -0
- package/dist/packem_shared/useMousePosition-BTWfV4JK.js +1 -0
- package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +1 -0
- package/dist/packem_shared/useOnMouseHover-D3DczIol.js +1 -0
- package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +1 -0
- package/dist/packem_shared/usePaste-CKKB9H-Z.js +1 -0
- package/dist/packem_shared/useScrollAcceleration-NrY1oVMs.js +1 -0
- package/dist/packem_shared/useScrollInput-Caghtn-Q.js +1 -0
- package/dist/packem_shared/useStderr-BDZb6InG.js +1 -0
- package/dist/packem_shared/useStdin-DKa4h35k.js +1 -0
- package/dist/packem_shared/useStdout-B-2lX4C5.js +1 -0
- package/dist/packem_shared/useStopwatch-DffK7iMh.js +1 -0
- package/dist/packem_shared/useTerminalPalette-Cv7tSduR.js +1 -0
- package/dist/packem_shared/useTextBuffer-DekkGLxI.js +4 -0
- package/dist/packem_shared/useTextSelection-CGT0GLDR.js +1 -0
- package/dist/packem_shared/useTimeout-7LEFYTnG.js +1 -0
- package/dist/packem_shared/useTimer-DyoqSyGi.js +1 -0
- package/dist/packem_shared/useTreeView-8UlTK6sW.js +1 -0
- package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +1 -0
- package/dist/packem_shared/useWindowSize-yDZsXF8z.js +1 -0
- package/dist/packem_shared/utils-THUhYKG2.js +1 -0
- package/dist/packem_shared/variant-config-BJqpNo7H.js +1 -0
- package/dist/packem_shared/waitFor-Dj5zfL5s.js +4 -0
- package/dist/packem_shared/wrapOrTruncateStyledLine-BZ00SM8i.js +3 -0
- package/dist/react/index.js +1 -9
- package/dist/testing/index.js +1 -152
- package/package.json +9 -9
- package/dist/packem_shared/Accordion-BG-yfIkV.js +0 -80
- package/dist/packem_shared/Alert-BLcwIW8V.js +0 -17
- package/dist/packem_shared/AnimatePresence-D8nEOr_B.js +0 -98
- package/dist/packem_shared/ApprovalPrompt-BXdPros1.js +0 -104
- package/dist/packem_shared/AreaChart-CmTcxLum.js +0 -116
- package/dist/packem_shared/Badge-CUfbXwAB.js +0 -13
- package/dist/packem_shared/BarChart-DWRae67P.js +0 -87
- package/dist/packem_shared/BigText-CVq2X7B5.js +0 -24
- package/dist/packem_shared/BlinkDot-CrbHMR3L.js +0 -11
- package/dist/packem_shared/Box-W1w_NGin.js +0 -71
- package/dist/packem_shared/Breadcrumb-CPdNxVYs.js +0 -26
- package/dist/packem_shared/Button-CBmTbJ_D.js +0 -57
- package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-BsMy5Ewl.js +0 -81
- package/dist/packem_shared/Calendar-C2Qxt-LA.js +0 -139
- package/dist/packem_shared/Canvas-COttmLPX.js +0 -246
- package/dist/packem_shared/Card-D3tGkNCm.js +0 -24
- package/dist/packem_shared/Cell-DCg1kJY-.js +0 -48
- package/dist/packem_shared/Checkbox-Dpy_4Lws.js +0 -49
- package/dist/packem_shared/Code-CwzzbsLx.js +0 -53
- package/dist/packem_shared/Collapsible-BMDrXf5C.js +0 -45
- package/dist/packem_shared/CommandBlock-jdOGJPjY.js +0 -80
- package/dist/packem_shared/CommandPalette-B5IfUQwi.js +0 -146
- package/dist/packem_shared/ConfirmDialog-5XJv3Cc4.js +0 -67
- package/dist/packem_shared/ConfirmInput-CxUS0XAA.js +0 -44
- package/dist/packem_shared/ConsoleOverlay-BvnCEgjG.js +0 -57
- package/dist/packem_shared/ContentSwitcher-BHFpO5Za.js +0 -81
- package/dist/packem_shared/ControlledScrollView-C2wOOlJO.js +0 -5
- package/dist/packem_shared/Cursor-DiW7YoSK.js +0 -18
- package/dist/packem_shared/DatePicker-CPejKoqS.js +0 -73
- package/dist/packem_shared/DefinitionList-BAwr0l5J.js +0 -18
- package/dist/packem_shared/DevTools-BdxRSkhL.js +0 -63
- package/dist/packem_shared/Dialog-S9r7Izff.js +0 -71
- package/dist/packem_shared/DiffView-BR4T6-Sj.js +0 -329
- package/dist/packem_shared/Divider-DocXIqNn.js +0 -30
- package/dist/packem_shared/FilePicker-BZ55oF_n.js +0 -261
- package/dist/packem_shared/FocusContext-D5wFxSRz.js +0 -153
- package/dist/packem_shared/FormField-BSG16cnA.js +0 -29
- package/dist/packem_shared/Fullscreen-DO7voOq5.js +0 -11
- package/dist/packem_shared/Gauge-CKXUXxft.js +0 -122
- package/dist/packem_shared/Gradient-Dg0NezWc.js +0 -136
- package/dist/packem_shared/Heading-BnR7McmP.js +0 -29
- package/dist/packem_shared/Heatmap-_jqISOU0.js +0 -79
- package/dist/packem_shared/Help-0yZ_IcQg.js +0 -105
- package/dist/packem_shared/Histogram-CB6XcmZW.js +0 -92
- package/dist/packem_shared/IMECompositionBuffer-Dl3S0KnF.js +0 -55
- package/dist/packem_shared/InputParser-BlsfeY9J.js +0 -158
- package/dist/packem_shared/KEY-STOdi-nc.js +0 -74
- package/dist/packem_shared/Kbd-BNDXQgey.js +0 -19
- package/dist/packem_shared/LayoutNode-DAkKg9TE.js +0 -129
- package/dist/packem_shared/LineChart-ef3HF816.js +0 -7
- package/dist/packem_shared/Link-DZ2Tiq1m.js +0 -66
- package/dist/packem_shared/LoadingIndicator-DzbLGfyJ.js +0 -13
- package/dist/packem_shared/Markdown-33bpCUoe.js +0 -212
- package/dist/packem_shared/MaskedInput-Ctr6v2dO.js +0 -119
- package/dist/packem_shared/Menu-CeKxhEix.js +0 -112
- package/dist/packem_shared/MessageBubble-BMoU8L2Q.js +0 -26
- package/dist/packem_shared/ModelBadge-CNIxPs7v.js +0 -40
- package/dist/packem_shared/MouseProvider-CekPbXCh.js +0 -136
- package/dist/packem_shared/MultiSelect-yz7-w0Zv.js +0 -129
- package/dist/packem_shared/NAMED_COLORS-DcI3erCu.js +0 -300
- package/dist/packem_shared/Newline-DBtYEg8x.js +0 -7
- package/dist/packem_shared/OperationTree-Dudx5o1o.js +0 -67
- package/dist/packem_shared/OptionList-CTyqQaZ1.js +0 -24
- package/dist/packem_shared/OrderedList-VsvSmHUC.js +0 -26
- package/dist/packem_shared/Paginator-DmGogvEI.js +0 -104
- package/dist/packem_shared/Paragraph-CNNhfepo.js +0 -9
- package/dist/packem_shared/Placeholder-DkM69Q8Z.js +0 -29
- package/dist/packem_shared/ProgressBar-B7cS4uQm.js +0 -22
- package/dist/packem_shared/RadioGroup-B4F9PUyL.js +0 -108
- package/dist/packem_shared/Renderer-zZ5O3vxc.js +0 -31
- package/dist/packem_shared/ResizeObserverEntry-Vr8GZ74x.js +0 -102
- package/dist/packem_shared/ScatterPlot-CWOg4G5h.js +0 -63
- package/dist/packem_shared/ScrollBar-DFeWH43I.js +0 -106
- package/dist/packem_shared/ScrollBarBox-C7VL6Izd.js +0 -72
- package/dist/packem_shared/ScrollList-DRcr_RrN.js +0 -227
- package/dist/packem_shared/ScrollView-C6rdlGwU.js +0 -196
- package/dist/packem_shared/SearchInput-cB8zFhSg.js +0 -32
- package/dist/packem_shared/SelectInput-WzZSqp72.js +0 -260
- package/dist/packem_shared/SelectInputIndicator-DKeN6v5Z.js +0 -9
- package/dist/packem_shared/SelectInputItem-CxFL3spM.js +0 -8
- package/dist/packem_shared/ShimmerText-B2VbPUSB.js +0 -34
- package/dist/packem_shared/Slider-BOrNTOQe.js +0 -116
- package/dist/packem_shared/Spacer-DhmXyTb8.js +0 -8
- package/dist/packem_shared/Sparkline-BSbjPrwK.js +0 -44
- package/dist/packem_shared/Spinner-BcO5BCAa.js +0 -1942
- package/dist/packem_shared/Static-DpTd6Eed.js +0 -22
- package/dist/packem_shared/Static-xmD9giJj.js +0 -18
- package/dist/packem_shared/StaticRender-C3XWvJdC.js +0 -69
- package/dist/packem_shared/StatusLine-DQNUstN9.js +0 -22
- package/dist/packem_shared/StatusMessage-BYTL6Pl-.js +0 -14
- package/dist/packem_shared/Stepper-CmUPRK3z.js +0 -60
- package/dist/packem_shared/Stopwatch-zqLQAxXC.js +0 -21
- package/dist/packem_shared/StreamingText-BmuoJtGu.js +0 -38
- package/dist/packem_shared/Switch-DcPdy8nm.js +0 -59
- package/dist/packem_shared/Tab-C6r5q4hR.js +0 -7
- package/dist/packem_shared/Table-Bgxo87Df.js +0 -88
- package/dist/packem_shared/Tabs-DubuHdYV.js +0 -164
- package/dist/packem_shared/Tag-CCqM7Ee9.js +0 -35
- package/dist/packem_shared/Text-CtUwV89_.js +0 -65
- package/dist/packem_shared/TextInput-C9r7zT0U.js +0 -137
- package/dist/packem_shared/Textarea-CGmgt-Nl.js +0 -272
- package/dist/packem_shared/Timer-D7ZZ0_wz.js +0 -20
- package/dist/packem_shared/Toast-DXSCXFPY.js +0 -37
- package/dist/packem_shared/Tooltip-SvVjj-2k.js +0 -32
- package/dist/packem_shared/Transform-Cfyva2wd.js +0 -14
- package/dist/packem_shared/Transition-CbNfKhaj.js +0 -108
- package/dist/packem_shared/TreeNodeMap-CtJUvBnd.js +0 -155
- package/dist/packem_shared/TreeView-DGlZeSsK.js +0 -148
- package/dist/packem_shared/TuiApp-DtdgNRWa.js +0 -122
- package/dist/packem_shared/TuiContext-lXmJFd-x.js +0 -418
- package/dist/packem_shared/UnorderedList-D8RPaEAW.js +0 -33
- package/dist/packem_shared/accessibility-context-BLelHhNU.js +0 -7
- package/dist/packem_shared/animation-context-BcJg8Jr6.js +0 -15
- package/dist/packem_shared/ansi-parser-BOP8fNdT.js +0 -43
- package/dist/packem_shared/ansi-tokenizer-LHq2LUWA.js +0 -307
- package/dist/packem_shared/app-context-CP0U6H7O.js +0 -11
- package/dist/packem_shared/background-context-BAUaxfOb.js +0 -5
- package/dist/packem_shared/boxes-oi3WUbyR.js +0 -92
- package/dist/packem_shared/braille-BoEWoH2I.js +0 -93
- package/dist/packem_shared/colorize-88_Vk8cn.js +0 -48
- package/dist/packem_shared/comparePoints-CAAlhiMS.js +0 -287
- package/dist/packem_shared/controlled-scroll-view-DJXfdWMm.js +0 -286
- package/dist/packem_shared/createInlineLoop-Dnfm1ZSJ.js +0 -99
- package/dist/packem_shared/createLinkedScrollGroup-Djw4Ceo0.js +0 -44
- package/dist/packem_shared/createMemoryStorage-esFJ61La.js +0 -115
- package/dist/packem_shared/createScreen-Dh0sZlQ0.js +0 -38
- package/dist/packem_shared/cursor-context-JxRzlqAx.js +0 -9
- package/dist/packem_shared/dom-CrbpQgat.js +0 -228
- package/dist/packem_shared/focus-context-CWkYtgcm.js +0 -26
- package/dist/packem_shared/format-time-BGmnDukX.js +0 -12
- package/dist/packem_shared/getPathToRoot-BbvlppLC.js +0 -4
- package/dist/packem_shared/getScrollHeight-Cz3CDQN2.js +0 -63
- package/dist/packem_shared/input-utils-ViAEXa0Z.js +0 -19
- package/dist/packem_shared/isIntersecting-fEXHJN5R.js +0 -10
- package/dist/packem_shared/isOsc52Supported-G0k4sXJx.js +0 -36
- package/dist/packem_shared/isTerminalPaletteQuerySupported-EeiwMKbr.js +0 -93
- package/dist/packem_shared/kittyFlags-bNNf_9kX.js +0 -26
- package/dist/packem_shared/line-chart-VGU2l7pu.js +0 -139
- package/dist/packem_shared/measure-element-Bc6PEaIe.js +0 -405
- package/dist/packem_shared/measure-text-BdOhbOeh.js +0 -1256
- package/dist/packem_shared/measureElement-DTELRaij.js +0 -4
- package/dist/packem_shared/mouse-context-BUHWKEIe.js +0 -6
- package/dist/packem_shared/parseSgrMouse-4hpBJBsW.js +0 -1
- package/dist/packem_shared/processLayout-B0Coz0Ua.js +0 -2
- package/dist/packem_shared/reconciler-Dd7Z0A97.js +0 -696
- package/dist/packem_shared/reconciler-mzMwSOft.js +0 -221
- package/dist/packem_shared/render-Bm9Oa1sG.js +0 -2799
- package/dist/packem_shared/render-CjlKdg4m.js +0 -199
- package/dist/packem_shared/renderToString-CWYS1ZXE.js +0 -86
- package/dist/packem_shared/renderToString-DB3ILWFm.js +0 -62
- package/dist/packem_shared/renderTreeToBuffer-CDDTGyZn.js +0 -311
- package/dist/packem_shared/renderer-GE9OLNNM.js +0 -1437
- package/dist/packem_shared/setEnableStyledLineCache-D5f4favX.js +0 -2
- package/dist/packem_shared/squashTextNodesWithMap-iqm6OMMT.js +0 -100
- package/dist/packem_shared/stderr-context-Bj4Mf7v7.js +0 -17
- package/dist/packem_shared/stdin-context-Bq_GNJ3z.js +0 -38
- package/dist/packem_shared/stdout-context-CgjWeCdO.js +0 -17
- package/dist/packem_shared/text-width-Db-AxMea.js +0 -43
- package/dist/packem_shared/token-to-elements-CK4s8MJd.js +0 -249
- package/dist/packem_shared/treeViewTheme-BpSw9TMf.js +0 -52
- package/dist/packem_shared/useAnimation-DV22qxiJ.js +0 -62
- package/dist/packem_shared/useApp-Cbi788rV.js +0 -6
- package/dist/packem_shared/useBoxMetrics-_5icypir.js +0 -54
- package/dist/packem_shared/useClipboard-MNj6MNR-.js +0 -23
- package/dist/packem_shared/useColorBlindness-D_sTIhcb.js +0 -30
- package/dist/packem_shared/useConsoleCapture-Dvt7G1W1.js +0 -61
- package/dist/packem_shared/useCursor-DS6LjIgv.js +0 -19
- package/dist/packem_shared/useElementDimensions-CAoKitVD.js +0 -67
- package/dist/packem_shared/useFocus-DLoGQJd9.js +0 -37
- package/dist/packem_shared/useFocusManager-UeZWtnNc.js +0 -16
- package/dist/packem_shared/useForm-sQENbEuv.js +0 -88
- package/dist/packem_shared/useHotkey-D9giUX3q.js +0 -112
- package/dist/packem_shared/useInput-DKZbqMRc.js +0 -594
- package/dist/packem_shared/useInterval-CSXM8c2I.js +0 -32
- package/dist/packem_shared/useIsScreenReaderEnabled-BeoVqo1R.js +0 -9
- package/dist/packem_shared/useKeyBindings-S4fSIEAk.js +0 -66
- package/dist/packem_shared/useKeyChord-BmXGNuEO.js +0 -114
- package/dist/packem_shared/useMouseAction-C5gZ2nj7.js +0 -29
- package/dist/packem_shared/useMouseContext-D-rFy60Q.js +0 -12
- package/dist/packem_shared/useMousePosition-BHBJ-kBk.js +0 -25
- package/dist/packem_shared/useOnMouseClick--ZIyBOBO.js +0 -35
- package/dist/packem_shared/useOnMouseHover-26diuXUC.js +0 -32
- package/dist/packem_shared/useOnMouseState-NO_Kda_C.js +0 -13
- package/dist/packem_shared/usePaste-png73gvT.js +0 -35
- package/dist/packem_shared/useScrollAcceleration-R9LfrPVG.js +0 -73
- package/dist/packem_shared/useScrollInput-DfzRGQFe.js +0 -72
- package/dist/packem_shared/useStderr-BSWerMZ7.js +0 -6
- package/dist/packem_shared/useStdin-Rf0zPzVA.js +0 -7
- package/dist/packem_shared/useStdout-B5yRcg9N.js +0 -6
- package/dist/packem_shared/useStopwatch-C__Zu6hd.js +0 -33
- package/dist/packem_shared/useTerminalPalette-CtFG2JTq.js +0 -38
- package/dist/packem_shared/useTextBuffer-C8fEe9Ly.js +0 -398
- package/dist/packem_shared/useTextSelection-ChrYZXsn.js +0 -50
- package/dist/packem_shared/useTimeout-DuCqgWPX.js +0 -34
- package/dist/packem_shared/useTimer-DnBtbhB5.js +0 -46
- package/dist/packem_shared/useTreeView-mkN5Di7w.js +0 -101
- package/dist/packem_shared/useTreeViewState-BpS_KZ-K.js +0 -502
- package/dist/packem_shared/useWindowSize-D3UU41mv.js +0 -20
- package/dist/packem_shared/utils-BgdlrbOH.js +0 -140
- package/dist/packem_shared/variant-config-DSZoX5TM.js +0 -8
- package/dist/packem_shared/waitFor-Cv9M2jKA.js +0 -39
- package/dist/packem_shared/wrapOrTruncateStyledLine-49Mne3t3.js +0 -147
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
class TreeNodeMap {
|
|
2
|
-
/** All node IDs in DFS order. */
|
|
3
|
-
orderedIds;
|
|
4
|
-
/** Root-level node IDs. */
|
|
5
|
-
rootIds;
|
|
6
|
-
/** Map from node ID to FlatNode. */
|
|
7
|
-
map;
|
|
8
|
-
constructor(data) {
|
|
9
|
-
this.map = /* @__PURE__ */ new Map();
|
|
10
|
-
this.orderedIds = [];
|
|
11
|
-
this.rootIds = [];
|
|
12
|
-
this.buildFromData(data);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Iterate over all entries.
|
|
16
|
-
*/
|
|
17
|
-
entries() {
|
|
18
|
-
return this.map.entries();
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Get a flat node by ID.
|
|
22
|
-
*/
|
|
23
|
-
get(id) {
|
|
24
|
-
return this.map.get(id);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Total number of nodes in the tree.
|
|
28
|
-
*/
|
|
29
|
-
get size() {
|
|
30
|
-
return this.map.size;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Given a set of expanded node IDs, return the ordered list of
|
|
34
|
-
* VISIBLE node IDs (i.e., a node is visible if all its ancestors
|
|
35
|
-
* are expanded).
|
|
36
|
-
*
|
|
37
|
-
* Uses iterative DFS, skipping collapsed subtrees.
|
|
38
|
-
*/
|
|
39
|
-
getVisibleIds(expandedIds) {
|
|
40
|
-
const result = [];
|
|
41
|
-
const stack = [];
|
|
42
|
-
for (let index = this.rootIds.length - 1; index >= 0; index--) {
|
|
43
|
-
stack.push(this.rootIds[index]);
|
|
44
|
-
}
|
|
45
|
-
while (stack.length > 0) {
|
|
46
|
-
const id = stack.pop();
|
|
47
|
-
result.push(id);
|
|
48
|
-
const flatNode = this.map.get(id);
|
|
49
|
-
if (flatNode && expandedIds.has(id) && flatNode.childrenIds.length > 0) {
|
|
50
|
-
for (let index = flatNode.childrenIds.length - 1; index >= 0; index--) {
|
|
51
|
-
stack.push(flatNode.childrenIds[index]);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return result;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Check if a node is a descendant of another node.
|
|
59
|
-
*/
|
|
60
|
-
isDescendantOf(nodeId, ancestorId) {
|
|
61
|
-
let currentId = nodeId;
|
|
62
|
-
while (currentId !== void 0) {
|
|
63
|
-
const flat = this.map.get(currentId);
|
|
64
|
-
if (!flat) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
if (flat.parentId === ancestorId) {
|
|
68
|
-
return true;
|
|
69
|
-
}
|
|
70
|
-
currentId = flat.parentId;
|
|
71
|
-
}
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Insert dynamically-loaded children under a parent node.
|
|
76
|
-
* Returns a new TreeNodeMap (immutable operation).
|
|
77
|
-
*
|
|
78
|
-
* Rebuilds the full tree from the current map state (not the original
|
|
79
|
-
* input data), so successive calls for different parents are safe.
|
|
80
|
-
*/
|
|
81
|
-
withChildren(parentId, children) {
|
|
82
|
-
const parentFlat = this.map.get(parentId);
|
|
83
|
-
if (!parentFlat) {
|
|
84
|
-
return this;
|
|
85
|
-
}
|
|
86
|
-
const rebuildFromMap = (id) => {
|
|
87
|
-
const flat = this.map.get(id);
|
|
88
|
-
if (id === parentId) {
|
|
89
|
-
return { ...flat.node, children };
|
|
90
|
-
}
|
|
91
|
-
if (flat.childrenIds.length > 0) {
|
|
92
|
-
return { ...flat.node, children: flat.childrenIds.map((childId) => rebuildFromMap(childId)) };
|
|
93
|
-
}
|
|
94
|
-
return flat.node;
|
|
95
|
-
};
|
|
96
|
-
const rootData = this.rootIds.map((nodeId) => rebuildFromMap(nodeId));
|
|
97
|
-
return new TreeNodeMap(rootData);
|
|
98
|
-
}
|
|
99
|
-
buildFromData(data) {
|
|
100
|
-
const stack = [];
|
|
101
|
-
for (let index = data.length - 1; index >= 0; index--) {
|
|
102
|
-
stack.push({
|
|
103
|
-
depth: 0,
|
|
104
|
-
node: data[index],
|
|
105
|
-
parentId: void 0,
|
|
106
|
-
siblingIndex: index,
|
|
107
|
-
siblings: data
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
for (const node of data) {
|
|
111
|
-
this.rootIds.push(node.id);
|
|
112
|
-
}
|
|
113
|
-
let flatIndex = 0;
|
|
114
|
-
while (stack.length > 0) {
|
|
115
|
-
const entry = stack.pop();
|
|
116
|
-
const { depth, node, parentId, siblingIndex, siblings } = entry;
|
|
117
|
-
if (this.map.has(node.id)) {
|
|
118
|
-
throw new Error(`TreeView: Duplicate node id '${node.id}' found. All node ids must be unique.`);
|
|
119
|
-
}
|
|
120
|
-
const children = node.children ?? [];
|
|
121
|
-
const hasChildren = children.length > 0 || node.isParent === true;
|
|
122
|
-
const childrenIds = children.map((c) => c.id);
|
|
123
|
-
const previousSiblingId = siblingIndex > 0 ? siblings[siblingIndex - 1].id : void 0;
|
|
124
|
-
const nextSiblingId = siblingIndex < siblings.length - 1 ? siblings[siblingIndex + 1].id : void 0;
|
|
125
|
-
const flatNode = {
|
|
126
|
-
childrenIds,
|
|
127
|
-
depth,
|
|
128
|
-
flatIndex,
|
|
129
|
-
hasChildren,
|
|
130
|
-
nextSiblingId,
|
|
131
|
-
node,
|
|
132
|
-
parentId,
|
|
133
|
-
previousSiblingId,
|
|
134
|
-
siblingCount: siblings.length,
|
|
135
|
-
siblingIndex
|
|
136
|
-
};
|
|
137
|
-
this.map.set(node.id, flatNode);
|
|
138
|
-
this.orderedIds.push(node.id);
|
|
139
|
-
flatIndex++;
|
|
140
|
-
if (hasChildren) {
|
|
141
|
-
for (let index = children.length - 1; index >= 0; index--) {
|
|
142
|
-
stack.push({
|
|
143
|
-
depth: depth + 1,
|
|
144
|
-
node: children[index],
|
|
145
|
-
parentId: node.id,
|
|
146
|
-
siblingIndex: index,
|
|
147
|
-
siblings: children
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export { TreeNodeMap };
|
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import useIsScreenReaderEnabled from './useIsScreenReaderEnabled-BeoVqo1R.js';
|
|
3
|
-
import Box from './Box-W1w_NGin.js';
|
|
4
|
-
import Text from './Text-CtUwV89_.js';
|
|
5
|
-
import { theme } from './treeViewTheme-BpSw9TMf.js';
|
|
6
|
-
import { useTreeView } from './useTreeView-mkN5Di7w.js';
|
|
7
|
-
import { useTreeViewState } from './useTreeViewState-BpS_KZ-K.js';
|
|
8
|
-
|
|
9
|
-
const POINTER = "❯";
|
|
10
|
-
const TRIANGLE_DOWN = "▾";
|
|
11
|
-
const TRIANGLE_RIGHT = "▸";
|
|
12
|
-
const CHECKBOX_ON = "☒";
|
|
13
|
-
const CHECKBOX_OFF = "☐";
|
|
14
|
-
const TICK = "✔";
|
|
15
|
-
const LOADING = "⟳";
|
|
16
|
-
function buildNodeAriaLabel(label, nodeState, siblingPosition, siblingCount) {
|
|
17
|
-
const { depth, hasChildren, isExpanded, isLoading, isSelected } = nodeState;
|
|
18
|
-
const parts = [label, `item ${siblingPosition} of ${siblingCount}`];
|
|
19
|
-
if (depth > 0) {
|
|
20
|
-
parts.push(`depth ${depth}`);
|
|
21
|
-
}
|
|
22
|
-
if (hasChildren) {
|
|
23
|
-
parts.push(isExpanded ? "expanded" : "collapsed");
|
|
24
|
-
}
|
|
25
|
-
if (isLoading) {
|
|
26
|
-
parts.push("loading");
|
|
27
|
-
}
|
|
28
|
-
if (isSelected) {
|
|
29
|
-
parts.push("selected");
|
|
30
|
-
}
|
|
31
|
-
return parts.join(", ");
|
|
32
|
-
}
|
|
33
|
-
function buildNodeAriaState(nodeState, selectionMode) {
|
|
34
|
-
const state = {};
|
|
35
|
-
if (nodeState.hasChildren) {
|
|
36
|
-
state.expanded = nodeState.isExpanded;
|
|
37
|
-
}
|
|
38
|
-
if (selectionMode !== "none") {
|
|
39
|
-
state.selected = nodeState.isSelected;
|
|
40
|
-
}
|
|
41
|
-
return Object.keys(state).length > 0 ? state : void 0;
|
|
42
|
-
}
|
|
43
|
-
function TreeViewNode({ isScreenReaderEnabled, node, nodeState, selectionMode, siblingCount, siblingPosition, styles }) {
|
|
44
|
-
const { depth, hasChildren, isExpanded, isFocused, isLoading, isSelected } = nodeState;
|
|
45
|
-
let expandChar = " ";
|
|
46
|
-
if (isLoading) {
|
|
47
|
-
expandChar = LOADING;
|
|
48
|
-
} else if (hasChildren) {
|
|
49
|
-
expandChar = isExpanded ? TRIANGLE_DOWN : TRIANGLE_RIGHT;
|
|
50
|
-
}
|
|
51
|
-
const ariaLabel = isScreenReaderEnabled ? buildNodeAriaLabel(node.label, nodeState, siblingPosition, siblingCount) : void 0;
|
|
52
|
-
return jsxs(Box, { ...styles.node({ isFocused }), "aria-role": "listitem", "aria-state": buildNodeAriaState(nodeState, selectionMode), children: [
|
|
53
|
-
ariaLabel && jsx(Text, { "aria-label": ariaLabel }),
|
|
54
|
-
isFocused && jsx(Text, { ...styles.focusIndicator(), "aria-hidden": true, children: POINTER }),
|
|
55
|
-
depth > 0 && jsx(Box, { ...styles.indent({ depth }), "aria-hidden": true }),
|
|
56
|
-
selectionMode === "multiple" && jsx(Text, { ...styles.selectedIndicator(), "aria-hidden": true, children: isSelected ? CHECKBOX_ON : CHECKBOX_OFF }),
|
|
57
|
-
jsx(Text, { ...isLoading ? styles.loadingIndicator() : styles.expandIndicator({ isExpanded }), "aria-hidden": true, children: expandChar }),
|
|
58
|
-
jsx(Text, { ...styles.label({ isFocused, isSelected }), children: node.label }),
|
|
59
|
-
selectionMode === "single" && isSelected && jsxs(Text, { ...styles.selectedIndicator(), "aria-hidden": true, children: [
|
|
60
|
-
" ",
|
|
61
|
-
TICK
|
|
62
|
-
] })
|
|
63
|
-
] });
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function TreeView({
|
|
67
|
-
ariaLabel = "Tree view",
|
|
68
|
-
data,
|
|
69
|
-
defaultExpanded,
|
|
70
|
-
defaultSelected,
|
|
71
|
-
isDisabled = false,
|
|
72
|
-
loadChildren,
|
|
73
|
-
onExpandChange,
|
|
74
|
-
onFocusChange,
|
|
75
|
-
onLoadError,
|
|
76
|
-
onSelectChange,
|
|
77
|
-
renderNode,
|
|
78
|
-
selectionMode = "none",
|
|
79
|
-
visibleNodeCount
|
|
80
|
-
}) {
|
|
81
|
-
const state = useTreeViewState({
|
|
82
|
-
data,
|
|
83
|
-
defaultExpanded,
|
|
84
|
-
defaultSelected,
|
|
85
|
-
onExpandChange,
|
|
86
|
-
onFocusChange,
|
|
87
|
-
onSelectChange,
|
|
88
|
-
selectionMode,
|
|
89
|
-
visibleNodeCount
|
|
90
|
-
});
|
|
91
|
-
useTreeView({
|
|
92
|
-
isDisabled,
|
|
93
|
-
loadChildren,
|
|
94
|
-
onLoadError,
|
|
95
|
-
selectionMode,
|
|
96
|
-
state
|
|
97
|
-
});
|
|
98
|
-
const { styles } = theme;
|
|
99
|
-
const isScreenReaderEnabled = useIsScreenReaderEnabled();
|
|
100
|
-
return (
|
|
101
|
-
// Ink's aria-role enum does not include "tree"/"treeitem"/"group",
|
|
102
|
-
// so we use "list"/"listitem" as the closest available semantic match.
|
|
103
|
-
jsxs(Box, { ...styles.container(), "aria-role": "list", children: [
|
|
104
|
-
isScreenReaderEnabled && jsx(Text, { "aria-label": ariaLabel }),
|
|
105
|
-
state.hasScrollUp && jsxs(Text, { "aria-label": `${state.viewportFromIndex} more items above`, dimColor: true, children: [
|
|
106
|
-
" ",
|
|
107
|
-
"↑",
|
|
108
|
-
state.viewportFromIndex,
|
|
109
|
-
" ",
|
|
110
|
-
"more above"
|
|
111
|
-
] }),
|
|
112
|
-
state.viewportNodes.map(({ node, state: nodeState }) => {
|
|
113
|
-
const flatNode = state.nodeMap.get(node.id);
|
|
114
|
-
const siblingPosition = flatNode ? flatNode.siblingIndex + 1 : 1;
|
|
115
|
-
const siblingCount = flatNode ? flatNode.siblingCount : 1;
|
|
116
|
-
if (renderNode) {
|
|
117
|
-
const nodeAriaLabel = isScreenReaderEnabled ? buildNodeAriaLabel(node.label, nodeState, siblingPosition, siblingCount) : void 0;
|
|
118
|
-
return jsxs(Box, { "aria-role": "listitem", "aria-state": buildNodeAriaState(nodeState, selectionMode), children: [
|
|
119
|
-
nodeAriaLabel && jsx(Text, { "aria-label": nodeAriaLabel }),
|
|
120
|
-
renderNode({ node, state: nodeState })
|
|
121
|
-
] }, node.id);
|
|
122
|
-
}
|
|
123
|
-
return jsx(
|
|
124
|
-
TreeViewNode,
|
|
125
|
-
{
|
|
126
|
-
isScreenReaderEnabled,
|
|
127
|
-
node,
|
|
128
|
-
nodeState,
|
|
129
|
-
selectionMode,
|
|
130
|
-
siblingCount,
|
|
131
|
-
siblingPosition,
|
|
132
|
-
styles
|
|
133
|
-
},
|
|
134
|
-
node.id
|
|
135
|
-
);
|
|
136
|
-
}),
|
|
137
|
-
state.hasScrollDown && jsxs(Text, { "aria-label": `${state.visibleCount - state.viewportToIndex} more items below`, dimColor: true, children: [
|
|
138
|
-
" ",
|
|
139
|
-
"↓",
|
|
140
|
-
state.visibleCount - state.viewportToIndex,
|
|
141
|
-
" ",
|
|
142
|
-
"more below"
|
|
143
|
-
] })
|
|
144
|
-
] })
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export { TreeView };
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { createDecMode, setMode, resetMode } from '@visulima/ansi';
|
|
2
|
-
import EventEmitter from 'eventemitter3';
|
|
3
|
-
import { Renderer, TerminalGuard } from './Renderer-zZ5O3vxc.js';
|
|
4
|
-
|
|
5
|
-
const SynchronizedOutputMode = createDecMode(2026);
|
|
6
|
-
const DEC_2026_ON = setMode(SynchronizedOutputMode);
|
|
7
|
-
const DEC_2026_OFF = resetMode(SynchronizedOutputMode);
|
|
8
|
-
class TuiApp extends EventEmitter {
|
|
9
|
-
renderer;
|
|
10
|
-
terminal = null;
|
|
11
|
-
backBuffer;
|
|
12
|
-
width;
|
|
13
|
-
height;
|
|
14
|
-
isRunning = false;
|
|
15
|
-
stdoutBuffer = [];
|
|
16
|
-
stderrBuffer = [];
|
|
17
|
-
constructor() {
|
|
18
|
-
super();
|
|
19
|
-
this.width = process.stdout.columns || 80;
|
|
20
|
-
this.height = process.stdout.rows || 24;
|
|
21
|
-
this.renderer = new Renderer(this.width, this.height);
|
|
22
|
-
this.backBuffer = new Uint32Array(this.width * this.height * 2);
|
|
23
|
-
}
|
|
24
|
-
/** Enters raw mode + alternate screen. Does NOT start any render loop. */
|
|
25
|
-
start() {
|
|
26
|
-
if (this.isRunning) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
this.terminal = new TerminalGuard(true);
|
|
30
|
-
this.isRunning = true;
|
|
31
|
-
}
|
|
32
|
-
/** Request a clean exit — restores terminal, stops input, exits the process. */
|
|
33
|
-
quit() {
|
|
34
|
-
this.emit("quit");
|
|
35
|
-
}
|
|
36
|
-
/** Exits raw mode + alternate screen, then flushes any buffered stdout/stderr. */
|
|
37
|
-
stop() {
|
|
38
|
-
this.isRunning = false;
|
|
39
|
-
this.terminal?.leave();
|
|
40
|
-
this.terminal = null;
|
|
41
|
-
if (this.stdoutBuffer.length > 0) {
|
|
42
|
-
process.stdout.write(this.stdoutBuffer.join(""));
|
|
43
|
-
this.stdoutBuffer = [];
|
|
44
|
-
}
|
|
45
|
-
if (this.stderrBuffer.length > 0) {
|
|
46
|
-
process.stderr.write(this.stderrBuffer.join(""));
|
|
47
|
-
this.stderrBuffer = [];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Buffer a write to stdout. While the alternate screen is active, writing
|
|
52
|
-
* directly would corrupt the TUI. Buffered output is flushed on stop().
|
|
53
|
-
*/
|
|
54
|
-
writeStdout(text) {
|
|
55
|
-
if (this.isRunning) {
|
|
56
|
-
this.stdoutBuffer.push(text);
|
|
57
|
-
} else {
|
|
58
|
-
process.stdout.write(text);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Buffer a write to stderr. While the alternate screen is active, writing
|
|
63
|
-
* directly would corrupt the TUI. Buffered output is flushed on stop().
|
|
64
|
-
*/
|
|
65
|
-
writeStderr(text) {
|
|
66
|
-
if (this.isRunning) {
|
|
67
|
-
this.stderrBuffer.push(text);
|
|
68
|
-
} else {
|
|
69
|
-
process.stderr.write(text);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
/** Returns the shared Uint32Array back-buffer (width * height * 2 u32 cells). */
|
|
73
|
-
getBuffer() {
|
|
74
|
-
return this.backBuffer;
|
|
75
|
-
}
|
|
76
|
-
/** Returns current terminal dimensions. */
|
|
77
|
-
getSize() {
|
|
78
|
-
return { height: this.height, width: this.width };
|
|
79
|
-
}
|
|
80
|
-
/** Update terminal dimensions (called on SIGWINCH). */
|
|
81
|
-
resize(width, height) {
|
|
82
|
-
this.width = width;
|
|
83
|
-
this.height = height;
|
|
84
|
-
this.renderer = new Renderer(width, height);
|
|
85
|
-
this.backBuffer = new Uint32Array(width * height * 2);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Callbacks fired on every frame after React paints the buffer but before
|
|
89
|
-
* the Rust diff engine flushes to stdout. Use for direct buffer painting
|
|
90
|
-
* that needs to overlay React output (animated graphs, overlays, FPS counters).
|
|
91
|
-
* Multiple listeners are supported — they fire in registration order.
|
|
92
|
-
*/
|
|
93
|
-
beforeFlushListeners = [];
|
|
94
|
-
onBeforeFlush(function_) {
|
|
95
|
-
this.beforeFlushListeners.push(function_);
|
|
96
|
-
return () => {
|
|
97
|
-
this.beforeFlushListeners = this.beforeFlushListeners.filter((f) => f !== function_);
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Layout + paint synchronously. Called from the render loop on every dirty frame,
|
|
102
|
-
* and directly on resize for immediate response.
|
|
103
|
-
*/
|
|
104
|
-
paintNow(calculateLayout, renderToBuffer) {
|
|
105
|
-
if (!this.isRunning) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
calculateLayout(this.width, this.height);
|
|
109
|
-
renderToBuffer(this.backBuffer, this.width, this.height);
|
|
110
|
-
for (const function_ of this.beforeFlushListeners) {
|
|
111
|
-
function_(this.backBuffer, this.width, this.height);
|
|
112
|
-
}
|
|
113
|
-
this.renderer.writeRaw(DEC_2026_ON);
|
|
114
|
-
try {
|
|
115
|
-
this.renderer.render(this.backBuffer);
|
|
116
|
-
} finally {
|
|
117
|
-
this.renderer.writeRaw(DEC_2026_OFF);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export { TuiApp };
|