@visulima/tui 1.0.0-alpha.2 → 1.0.0-alpha.3
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 +53 -0
- package/LICENSE.md +63 -9
- package/README.md +3 -3
- package/dist/core/index.js +3 -3
- package/dist/ink/canvas/braille.d.ts +22 -0
- package/dist/ink/canvas/buffer.d.ts +67 -0
- package/dist/ink/components/accordion.d.ts +52 -0
- package/dist/ink/components/animate-presence.d.ts +15 -0
- package/dist/ink/components/approval-prompt.d.ts +55 -0
- package/dist/ink/components/area-chart.d.ts +54 -0
- package/dist/ink/components/bar-chart.d.ts +57 -0
- package/dist/ink/components/blink-dot.d.ts +30 -0
- package/dist/ink/components/breadcrumb.d.ts +28 -0
- package/dist/ink/components/button.d.ts +38 -0
- package/dist/ink/components/calendar.d.ts +60 -0
- package/dist/ink/components/canvas.d.ts +38 -0
- package/dist/ink/components/card.d.ts +46 -0
- package/dist/ink/components/chart-utils.d.ts +54 -0
- package/dist/ink/components/checkbox.d.ts +39 -0
- package/dist/ink/components/collapsible.d.ts +43 -0
- package/dist/ink/components/command-block.d.ts +38 -0
- package/dist/ink/components/command-palette.d.ts +72 -0
- package/dist/ink/components/confirm-dialog.d.ts +63 -0
- package/dist/ink/components/content-switcher.d.ts +49 -0
- package/dist/ink/components/date-picker.d.ts +53 -0
- package/dist/ink/components/definition-list.d.ts +37 -0
- package/dist/ink/components/divider.d.ts +40 -0
- package/dist/ink/components/file-picker/{FilePicker.d.ts → file-picker.d.ts} +2 -19
- package/dist/ink/components/file-picker/types.d.ts +1 -4
- package/dist/ink/components/file-picker/use-file-system.d.ts +1 -1
- package/dist/ink/components/form.d.ts +74 -0
- package/dist/ink/components/gauge.d.ts +75 -0
- package/dist/ink/components/heading.d.ts +27 -0
- package/dist/ink/components/heatmap.d.ts +51 -0
- package/dist/ink/components/{Help.d.ts → help.d.ts} +4 -9
- package/dist/ink/components/histogram.d.ts +52 -0
- package/dist/ink/components/kbd.d.ts +27 -0
- package/dist/ink/components/line-chart.d.ts +94 -0
- package/dist/ink/components/loading-indicator.d.ts +24 -0
- package/dist/ink/components/masked-input.d.ts +41 -0
- package/dist/ink/components/menu.d.ts +70 -0
- package/dist/ink/components/message-bubble.d.ts +35 -0
- package/dist/ink/components/model-badge.d.ts +32 -0
- package/dist/ink/components/operation-tree.d.ts +46 -0
- package/dist/ink/components/option-list.d.ts +41 -0
- package/dist/ink/components/{Paginator.d.ts → paginator.d.ts} +4 -20
- package/dist/ink/components/paragraph.d.ts +31 -0
- package/dist/ink/components/placeholder.d.ts +47 -0
- package/dist/ink/components/{ProgressBar.d.ts → progress-bar.d.ts} +1 -1
- package/dist/ink/components/radio-group.d.ts +62 -0
- package/dist/ink/components/scatter-plot.d.ts +23 -0
- package/dist/ink/components/scroll/{ControlledScrollView.d.ts → controlled-scroll-view.d.ts} +1 -1
- package/dist/ink/components/scroll/index.d.ts +10 -10
- package/dist/ink/components/scroll/{ScrollBarBox.d.ts → scroll-bar-box.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollBar.d.ts → scroll-bar.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollList.d.ts → scroll-list.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollView.d.ts → scroll-view.d.ts} +1 -1
- package/dist/ink/components/search-input.d.ts +46 -0
- package/dist/ink/components/{SelectInput.d.ts → select-input.d.ts} +2 -2
- package/dist/ink/components/shimmer-text.d.ts +39 -0
- package/dist/ink/components/sparkline.d.ts +30 -0
- package/dist/ink/components/{Spinner.d.ts → spinner.d.ts} +2 -4
- package/dist/ink/components/{StaticRender.d.ts → static-render.d.ts} +14 -2
- package/dist/ink/components/status-line.d.ts +30 -0
- package/dist/ink/components/stepper.d.ts +42 -0
- package/dist/ink/components/{Stopwatch.d.ts → stopwatch.d.ts} +5 -7
- package/dist/ink/components/streaming-text.d.ts +38 -0
- package/dist/ink/components/switch.d.ts +46 -0
- package/dist/ink/components/{Tabs.d.ts → tabs.d.ts} +1 -1
- package/dist/ink/components/tag.d.ts +30 -0
- package/dist/ink/components/{Timer.d.ts → timer.d.ts} +5 -7
- package/dist/ink/components/toast.d.ts +41 -0
- package/dist/ink/components/tooltip.d.ts +36 -0
- package/dist/ink/components/transition.d.ts +53 -0
- package/dist/ink/components/tree-view/theme.d.ts +2 -2
- package/dist/ink/cursor-helpers.d.ts +0 -3
- package/dist/ink/dom.d.ts +9 -8
- package/dist/ink/hooks/use-animation.d.ts +0 -2
- package/dist/ink/hooks/use-app.d.ts +1 -1
- package/dist/ink/hooks/use-focus-manager.d.ts +1 -1
- package/dist/ink/hooks/use-form.d.ts +70 -0
- package/dist/ink/hooks/use-hotkey.d.ts +37 -0
- package/dist/ink/hooks/use-interval.d.ts +25 -0
- package/dist/ink/hooks/use-key-bindings.d.ts +4 -6
- package/dist/ink/hooks/use-key-chord.d.ts +26 -0
- package/dist/ink/hooks/use-linked-scroll.d.ts +1 -1
- package/dist/ink/hooks/use-persistent-state.d.ts +56 -0
- package/dist/ink/hooks/use-stderr.d.ts +1 -1
- package/dist/ink/hooks/use-stdin.d.ts +1 -1
- package/dist/ink/hooks/use-stdout.d.ts +1 -1
- package/dist/ink/hooks/use-stopwatch.d.ts +1 -3
- package/dist/ink/hooks/use-timeout.d.ts +24 -0
- package/dist/ink/hooks/use-timer.d.ts +0 -2
- package/dist/ink/index.d.ts +228 -92
- package/dist/ink/index.js +132 -77
- package/dist/ink/ink.d.ts +7 -6
- package/dist/ink/mouse/constants.d.ts +5 -50
- package/dist/ink/mouse/index.d.ts +2 -2
- package/dist/ink/output.d.ts +2 -1
- package/dist/ink/styled-line.d.ts +10 -0
- package/dist/ink/write-synchronized.d.ts +2 -2
- package/dist/packem_shared/Accordion-BG-yfIkV.js +80 -0
- package/dist/packem_shared/{Alert-Dr3s_LD9.js → Alert-BLcwIW8V.js} +2 -2
- package/dist/packem_shared/AnimatePresence-D8nEOr_B.js +98 -0
- package/dist/packem_shared/ApprovalPrompt-BXdPros1.js +104 -0
- package/dist/packem_shared/AreaChart-CmTcxLum.js +116 -0
- package/dist/packem_shared/{Badge-Dk7EGGM6.js → Badge-CUfbXwAB.js} +1 -1
- package/dist/packem_shared/BarChart-DWRae67P.js +87 -0
- package/dist/packem_shared/{BigText-CjMdY63X.js → BigText-CVq2X7B5.js} +1 -1
- package/dist/packem_shared/BlinkDot-CrbHMR3L.js +11 -0
- package/dist/packem_shared/{Box-D_pSJ9Jp.js → Box-W1w_NGin.js} +4 -6
- package/dist/packem_shared/Breadcrumb-CPdNxVYs.js +26 -0
- package/dist/packem_shared/Button-CBmTbJ_D.js +57 -0
- package/dist/packem_shared/Calendar-C2Qxt-LA.js +139 -0
- package/dist/packem_shared/Canvas-COttmLPX.js +246 -0
- package/dist/packem_shared/Card-D3tGkNCm.js +24 -0
- package/dist/packem_shared/Checkbox-Dpy_4Lws.js +49 -0
- package/dist/packem_shared/{Code-DjQvPBD9.js → Code-CwzzbsLx.js} +3 -3
- package/dist/packem_shared/Collapsible-BMDrXf5C.js +45 -0
- package/dist/packem_shared/CommandBlock-jdOGJPjY.js +80 -0
- package/dist/packem_shared/CommandPalette-B5IfUQwi.js +146 -0
- package/dist/packem_shared/ConfirmDialog-5XJv3Cc4.js +67 -0
- package/dist/packem_shared/{ConfirmInput-85Y4kRQW.js → ConfirmInput-CxUS0XAA.js} +3 -3
- package/dist/packem_shared/{ConsoleOverlay-DBNa4vtj.js → ConsoleOverlay-BvnCEgjG.js} +2 -2
- package/dist/packem_shared/ContentSwitcher-BHFpO5Za.js +81 -0
- package/dist/packem_shared/ControlledScrollView-C2wOOlJO.js +5 -0
- package/dist/packem_shared/DatePicker-CPejKoqS.js +73 -0
- package/dist/packem_shared/DefinitionList-BAwr0l5J.js +18 -0
- package/dist/packem_shared/{DevTools-aMPIsaHx.js → DevTools-BdxRSkhL.js} +6 -4
- package/dist/packem_shared/{Dialog-DsSNAVgC.js → Dialog-S9r7Izff.js} +5 -5
- package/dist/packem_shared/{DiffView-hqaw-2S6.js → DiffView-BR4T6-Sj.js} +4 -4
- package/dist/packem_shared/Divider-DocXIqNn.js +30 -0
- package/dist/packem_shared/{FilePicker-DNwFxRhq.js → FilePicker-BZ55oF_n.js} +39 -32
- package/dist/packem_shared/FormField-BSG16cnA.js +29 -0
- package/dist/packem_shared/{Fullscreen-DrElAE1o.js → Fullscreen-DO7voOq5.js} +2 -2
- package/dist/packem_shared/Gauge-CKXUXxft.js +122 -0
- package/dist/packem_shared/{Gradient-Ql5P0GUd.js → Gradient-Dg0NezWc.js} +3 -3
- package/dist/packem_shared/Heading-BnR7McmP.js +29 -0
- package/dist/packem_shared/Heatmap-_jqISOU0.js +79 -0
- package/dist/packem_shared/{Help-6wanGG38.js → Help-0yZ_IcQg.js} +4 -11
- package/dist/packem_shared/Histogram-cgAjY5AJ.js +92 -0
- package/dist/packem_shared/{InputParser-BKHpWfvN.js → InputParser-BlsfeY9J.js} +8 -6
- package/dist/packem_shared/KEY-STOdi-nc.js +74 -0
- package/dist/packem_shared/Kbd-BNDXQgey.js +19 -0
- package/dist/packem_shared/{LayoutNode-Cjnsodiy.js → LayoutNode-DAkKg9TE.js} +5 -7
- package/dist/packem_shared/LineChart-ef3HF816.js +7 -0
- package/dist/packem_shared/{Link-COcKYfGT.js → Link-DZ2Tiq1m.js} +2 -2
- package/dist/packem_shared/LoadingIndicator-DzbLGfyJ.js +13 -0
- package/dist/packem_shared/{Markdown-y1ISztof.js → Markdown-33bpCUoe.js} +8 -8
- package/dist/packem_shared/MaskedInput-Ctr6v2dO.js +119 -0
- package/dist/packem_shared/Menu-CeKxhEix.js +112 -0
- package/dist/packem_shared/MessageBubble-BMoU8L2Q.js +26 -0
- package/dist/packem_shared/ModelBadge-CNIxPs7v.js +40 -0
- package/dist/packem_shared/{MouseProvider-Y9TSSEGl.js → MouseProvider-CekPbXCh.js} +3 -3
- package/dist/packem_shared/{MultiSelect-ChoLUcDI.js → MultiSelect-yz7-w0Zv.js} +4 -4
- package/dist/packem_shared/{NAMED_COLORS-a4QBvb5r.js → NAMED_COLORS-DcI3erCu.js} +79 -41
- package/dist/packem_shared/OperationTree-Dudx5o1o.js +67 -0
- package/dist/packem_shared/OptionList-CTyqQaZ1.js +24 -0
- package/dist/packem_shared/{OrderedList-Cp7pXr6m.js → OrderedList-VsvSmHUC.js} +2 -2
- package/dist/packem_shared/{Paginator-D1AuD-kj.js → Paginator-DmGogvEI.js} +44 -44
- package/dist/packem_shared/Paragraph-CNNhfepo.js +9 -0
- package/dist/packem_shared/Placeholder-DkM69Q8Z.js +29 -0
- package/dist/packem_shared/{ProgressBar-DOfpVagn.js → ProgressBar-B7cS4uQm.js} +2 -2
- package/dist/packem_shared/RadioGroup-B4F9PUyL.js +108 -0
- package/dist/packem_shared/{ResizeObserverEntry-Br4seLeQ.js → ResizeObserverEntry-Vr8GZ74x.js} +4 -4
- package/dist/packem_shared/ScatterPlot-CWOg4G5h.js +63 -0
- package/dist/packem_shared/{ScrollBar-EWAs2Uc7.js → ScrollBar-DFeWH43I.js} +2 -2
- package/dist/packem_shared/{ScrollBarBox-DTNNlh7R.js → ScrollBarBox-C7VL6Izd.js} +2 -2
- package/dist/packem_shared/{ScrollList-DCeIFL8M.js → ScrollList-DRcr_RrN.js} +2 -2
- package/dist/packem_shared/{ScrollView-v3MCNIyX.js → ScrollView-C6rdlGwU.js} +4 -4
- package/dist/packem_shared/SearchInput-cB8zFhSg.js +32 -0
- package/dist/packem_shared/{SelectInput-BN2TMyxp.js → SelectInput-WzZSqp72.js} +6 -6
- package/dist/packem_shared/{SelectInputIndicator-DkRMoH_b.js → SelectInputIndicator-DKeN6v5Z.js} +2 -2
- package/dist/packem_shared/{SelectInputItem-BF9LQgKu.js → SelectInputItem-CxFL3spM.js} +1 -1
- package/dist/packem_shared/ShimmerText-B2VbPUSB.js +34 -0
- package/dist/packem_shared/{Slider-BWD7xZX6.js → Slider-BOrNTOQe.js} +3 -3
- package/dist/packem_shared/{Spacer-Bs4ER-HK.js → Spacer-DhmXyTb8.js} +1 -1
- package/dist/packem_shared/Sparkline-BSbjPrwK.js +44 -0
- package/dist/packem_shared/Spinner-BcO5BCAa.js +1942 -0
- package/dist/packem_shared/StaticRender-C3XWvJdC.js +69 -0
- package/dist/packem_shared/StatusLine-DQNUstN9.js +22 -0
- package/dist/packem_shared/{StatusMessage-BtSYxzwb.js → StatusMessage-BYTL6Pl-.js} +2 -2
- package/dist/packem_shared/Stepper-CmUPRK3z.js +60 -0
- package/dist/packem_shared/Stopwatch-zqLQAxXC.js +21 -0
- package/dist/packem_shared/StreamingText-BmuoJtGu.js +38 -0
- package/dist/packem_shared/Switch-DcPdy8nm.js +59 -0
- package/dist/packem_shared/{Table-D-rSVlzb.js → Table-Bgxo87Df.js} +11 -5
- package/dist/packem_shared/{Tabs-hki-KRnx.js → Tabs-DubuHdYV.js} +30 -19
- package/dist/packem_shared/Tag-CCqM7Ee9.js +35 -0
- package/dist/packem_shared/{Text-DvAUdZcK.js → Text-CtUwV89_.js} +2 -2
- package/dist/packem_shared/{TextInput-C79WEQ5U.js → TextInput-C9r7zT0U.js} +3 -3
- package/dist/packem_shared/{Textarea-Dj06R6Zd.js → Textarea-CGmgt-Nl.js} +5 -5
- package/dist/packem_shared/Timer-D7ZZ0_wz.js +20 -0
- package/dist/packem_shared/Toast-DXSCXFPY.js +37 -0
- package/dist/packem_shared/Tooltip-SvVjj-2k.js +32 -0
- package/dist/packem_shared/{Transform-BHxY_dAM.js → Transform-Cfyva2wd.js} +1 -1
- package/dist/packem_shared/Transition-CbNfKhaj.js +108 -0
- package/dist/packem_shared/{TreeView-C2062dtj.js → TreeView-DGlZeSsK.js} +4 -4
- package/dist/packem_shared/{TuiApp-DfxOnXqi.js → TuiApp-DtdgNRWa.js} +4 -2
- package/dist/packem_shared/{TuiContext-CqEjMyXd.js → TuiContext-lXmJFd-x.js} +6 -3
- package/dist/packem_shared/{UnorderedList-DhnadWjX.js → UnorderedList-D8RPaEAW.js} +2 -2
- package/dist/packem_shared/{ansi-parser-0BdVTKho.js → ansi-parser-BOP8fNdT.js} +6 -4
- package/dist/packem_shared/braille-BoEWoH2I.js +93 -0
- package/dist/packem_shared/{comparePoints-CGMDnd3_.js → comparePoints-CAAlhiMS.js} +2 -2
- package/dist/packem_shared/{ControlledScrollView-BlOaxcsN.js → controlled-scroll-view-DJXfdWMm.js} +2 -2
- package/dist/packem_shared/{createInlineLoop-BxMmcq9D.js → createInlineLoop-Dnfm1ZSJ.js} +19 -13
- package/dist/packem_shared/createMemoryStorage-esFJ61La.js +115 -0
- package/dist/packem_shared/createScreen-Dh0sZlQ0.js +38 -0
- package/dist/packem_shared/{dom-DvzhsAez.js → dom-CrbpQgat.js} +17 -14
- package/dist/packem_shared/{getPathToRoot-a1wbwxfL.js → getPathToRoot-BbvlppLC.js} +2 -2
- package/dist/packem_shared/{getScrollHeight-BubfU_df.js → getScrollHeight-Cz3CDQN2.js} +5 -5
- package/dist/packem_shared/line-chart-VGU2l7pu.js +139 -0
- package/dist/packem_shared/{measure-element-Reza_yfC.js → measure-element-Bc6PEaIe.js} +26 -17
- package/dist/packem_shared/{measure-text-DItZYotK.js → measure-text-BdOhbOeh.js} +74 -7
- package/dist/packem_shared/{measureElement-CTgFCmKd.js → measureElement-DTELRaij.js} +2 -2
- package/dist/packem_shared/parseSgrMouse-4hpBJBsW.js +1 -0
- package/dist/packem_shared/{processLayout-BQ9kXfd3.js → processLayout-B0Coz0Ua.js} +1 -1
- package/dist/packem_shared/{reconciler-gfmqURLy.js → reconciler-Dd7Z0A97.js} +21 -5
- package/dist/packem_shared/{reconciler-BXf6miSS.js → reconciler-mzMwSOft.js} +23 -13
- package/dist/packem_shared/{render-BAwdjfki.js → render-Bm9Oa1sG.js} +72 -79
- package/dist/packem_shared/{render-Bpjhf0lD.js → render-CjlKdg4m.js} +15 -11
- package/dist/packem_shared/{renderToString-ClIaXgrC.js → renderToString-CWYS1ZXE.js} +4 -4
- package/dist/packem_shared/{renderToString-Cfg55DRD.js → renderToString-DB3ILWFm.js} +4 -4
- package/dist/packem_shared/{renderTreeToBuffer-D3mo7M7m.js → renderTreeToBuffer-CDDTGyZn.js} +8 -5
- package/dist/packem_shared/{renderer-B3wROkeg.js → renderer-GE9OLNNM.js} +47 -41
- package/dist/packem_shared/{setEnableStyledLineCache-BpskngSJ.js → setEnableStyledLineCache-D5f4favX.js} +1 -1
- package/dist/packem_shared/{text-width-DhuarWcB.js → text-width-Db-AxMea.js} +2 -1
- package/dist/packem_shared/{token-to-elements-BRFl_rzw.js → token-to-elements-CK4s8MJd.js} +2 -2
- package/dist/packem_shared/{useAnimation-kj31sA-T.js → useAnimation-DV22qxiJ.js} +2 -2
- package/dist/packem_shared/{useApp-DPQlRzi5.js → useApp-Cbi788rV.js} +1 -1
- package/dist/packem_shared/{useBoxMetrics-rBjKc-g4.js → useBoxMetrics-_5icypir.js} +2 -2
- package/dist/packem_shared/{useClipboard-B_9-adw1.js → useClipboard-MNj6MNR-.js} +1 -1
- package/dist/packem_shared/{useCursor-BIJzc8k9.js → useCursor-DS6LjIgv.js} +1 -1
- package/dist/packem_shared/{useFocus-CNl5QHHf.js → useFocus-DLoGQJd9.js} +2 -2
- package/dist/packem_shared/{useFocusManager-BPYaUuKQ.js → useFocusManager-UeZWtnNc.js} +1 -1
- package/dist/packem_shared/useForm-sQENbEuv.js +88 -0
- package/dist/packem_shared/useHotkey-D9giUX3q.js +112 -0
- package/dist/packem_shared/{useInput-Cfp5zB2s.js → useInput-DKZbqMRc.js} +2 -2
- package/dist/packem_shared/useInterval-CSXM8c2I.js +32 -0
- package/dist/packem_shared/{useIsScreenReaderEnabled-CnGKCe0f.js → useIsScreenReaderEnabled-BeoVqo1R.js} +1 -1
- package/dist/packem_shared/{useKeyBindings-B78l1E1n.js → useKeyBindings-S4fSIEAk.js} +2 -2
- package/dist/packem_shared/useKeyChord-BmXGNuEO.js +114 -0
- package/dist/packem_shared/{usePaste-Ct8J4AGR.js → usePaste-png73gvT.js} +2 -2
- package/dist/packem_shared/{useScrollInput-D3CpBq_a.js → useScrollInput-DfzRGQFe.js} +2 -2
- package/dist/packem_shared/{useStderr-CAOVUh4E.js → useStderr-BSWerMZ7.js} +1 -1
- package/dist/packem_shared/{useStdin-X-O0kd-n.js → useStdin-Rf0zPzVA.js} +1 -1
- package/dist/packem_shared/{useStdout-DyF6DSH0.js → useStdout-B5yRcg9N.js} +1 -1
- package/dist/packem_shared/{useStopwatch-qC4Beai4.js → useStopwatch-C__Zu6hd.js} +2 -2
- package/dist/packem_shared/{useTerminalPalette-BaWO2c4Q.js → useTerminalPalette-CtFG2JTq.js} +2 -2
- package/dist/packem_shared/{useTextSelection-mXtxgsPK.js → useTextSelection-ChrYZXsn.js} +2 -2
- package/dist/packem_shared/useTimeout-DuCqgWPX.js +34 -0
- package/dist/packem_shared/{useTimer-CPQ7j827.js → useTimer-DnBtbhB5.js} +1 -1
- package/dist/packem_shared/{useTreeView-BT57P3Kx.js → useTreeView-mkN5Di7w.js} +1 -1
- package/dist/packem_shared/{useWindowSize-ugEmGZJm.js → useWindowSize-D3UU41mv.js} +1 -1
- package/dist/packem_shared/waitFor-Cv9M2jKA.js +39 -0
- package/dist/packem_shared/{wrapOrTruncateStyledLine-DN3Nogoc.js → wrapOrTruncateStyledLine-49Mne3t3.js} +1 -1
- package/dist/react/index.js +7 -7
- package/dist/react/layout.d.ts +0 -2
- package/dist/testing/index.d.ts +4 -4
- package/dist/testing/index.js +6 -114
- package/dist/testing/wait-for.d.ts +0 -1
- package/index.js +691 -539
- package/package.json +17 -17
- package/dist/ink/components/file-picker/index.d.ts +0 -3
- package/dist/ink/components/tree-view/index.d.ts +0 -11
- package/dist/packem_shared/ControlledScrollView-DfAhcufF.js +0 -5
- package/dist/packem_shared/Spinner-BuI-kN4p.js +0 -1799
- package/dist/packem_shared/StaticRender-tYwH6QXl.js +0 -33
- package/dist/packem_shared/Stopwatch-DjtTCyHn.js +0 -23
- package/dist/packem_shared/Timer-wi9zuh4n.js +0 -22
- package/dist/packem_shared/parseSgrMouse-BHVBPP9G.js +0 -1
- /package/dist/ink/components/{AccessibilityContext.d.ts → accessibility-context.d.ts} +0 -0
- /package/dist/ink/components/{Alert.d.ts → alert.d.ts} +0 -0
- /package/dist/ink/components/{AnimationContext.d.ts → animation-context.d.ts} +0 -0
- /package/dist/ink/components/{AppContext.d.ts → app-context.d.ts} +0 -0
- /package/dist/ink/components/{App.d.ts → app.d.ts} +0 -0
- /package/dist/ink/components/{BackgroundContext.d.ts → background-context.d.ts} +0 -0
- /package/dist/ink/components/{Badge.d.ts → badge.d.ts} +0 -0
- /package/dist/ink/components/{BigText.d.ts → big-text.d.ts} +0 -0
- /package/dist/ink/components/{Box.d.ts → box.d.ts} +0 -0
- /package/dist/ink/components/{Code.d.ts → code.d.ts} +0 -0
- /package/dist/ink/components/{ConfirmInput.d.ts → confirm-input.d.ts} +0 -0
- /package/dist/ink/components/{ConsoleOverlay.d.ts → console-overlay.d.ts} +0 -0
- /package/dist/ink/components/{CursorContext.d.ts → cursor-context.d.ts} +0 -0
- /package/dist/ink/components/{Cursor.d.ts → cursor.d.ts} +0 -0
- /package/dist/ink/components/{Dialog.d.ts → dialog.d.ts} +0 -0
- /package/dist/ink/components/{DiffView.d.ts → diff-view.d.ts} +0 -0
- /package/dist/ink/components/{ErrorBoundary.d.ts → error-boundary.d.ts} +0 -0
- /package/dist/ink/components/{ErrorOverview.d.ts → error-overview.d.ts} +0 -0
- /package/dist/ink/components/{FocusContext.d.ts → focus-context.d.ts} +0 -0
- /package/dist/ink/components/{Gradient.d.ts → gradient.d.ts} +0 -0
- /package/dist/ink/components/{Link.d.ts → link.d.ts} +0 -0
- /package/dist/ink/components/{Markdown.d.ts → markdown.d.ts} +0 -0
- /package/dist/ink/components/{MultiSelect.d.ts → multi-select.d.ts} +0 -0
- /package/dist/ink/components/{Newline.d.ts → newline.d.ts} +0 -0
- /package/dist/ink/components/{OrderedList.d.ts → ordered-list.d.ts} +0 -0
- /package/dist/ink/components/{SelectInputIndicator.d.ts → select-input-indicator.d.ts} +0 -0
- /package/dist/ink/components/{SelectInputItem.d.ts → select-input-item.d.ts} +0 -0
- /package/dist/ink/components/{Slider.d.ts → slider.d.ts} +0 -0
- /package/dist/ink/components/{Spacer.d.ts → spacer.d.ts} +0 -0
- /package/dist/ink/components/{Static.d.ts → static.d.ts} +0 -0
- /package/dist/ink/components/{StatusMessage.d.ts → status-message.d.ts} +0 -0
- /package/dist/ink/components/{StderrContext.d.ts → stderr-context.d.ts} +0 -0
- /package/dist/ink/components/{StdinContext.d.ts → stdin-context.d.ts} +0 -0
- /package/dist/ink/components/{StdoutContext.d.ts → stdout-context.d.ts} +0 -0
- /package/dist/ink/components/{Tab.d.ts → tab.d.ts} +0 -0
- /package/dist/ink/components/{Table.d.ts → table.d.ts} +0 -0
- /package/dist/ink/components/{TextInput.d.ts → text-input.d.ts} +0 -0
- /package/dist/ink/components/{Text.d.ts → text.d.ts} +0 -0
- /package/dist/ink/components/{Textarea.d.ts → textarea.d.ts} +0 -0
- /package/dist/ink/components/{Transform.d.ts → transform.d.ts} +0 -0
- /package/dist/ink/components/tree-view/{TreeViewNode.d.ts → tree-view-node.d.ts} +0 -0
- /package/dist/ink/components/tree-view/{TreeView.d.ts → tree-view.d.ts} +0 -0
- /package/dist/ink/components/{UnorderedList.d.ts → unordered-list.d.ts} +0 -0
- /package/dist/ink/mouse/{Fullscreen.d.ts → fullscreen.d.ts} +0 -0
- /package/dist/ink/mouse/{MouseProvider.d.ts → mouse-provider.d.ts} +0 -0
- /package/dist/packem_shared/{AccessibilityContext-BLelHhNU.js → accessibility-context-BLelHhNU.js} +0 -0
- /package/dist/packem_shared/{AnimationContext-BcJg8Jr6.js → animation-context-BcJg8Jr6.js} +0 -0
- /package/dist/packem_shared/{AppContext-CP0U6H7O.js → app-context-CP0U6H7O.js} +0 -0
- /package/dist/packem_shared/{BackgroundContext-BAUaxfOb.js → background-context-BAUaxfOb.js} +0 -0
- /package/dist/packem_shared/{CursorContext-JxRzlqAx.js → cursor-context-JxRzlqAx.js} +0 -0
- /package/dist/packem_shared/{FocusContext-CWkYtgcm.js → focus-context-CWkYtgcm.js} +0 -0
- /package/dist/packem_shared/{StderrContext-Bj4Mf7v7.js → stderr-context-Bj4Mf7v7.js} +0 -0
- /package/dist/packem_shared/{StdinContext-Bq_GNJ3z.js → stdin-context-Bq_GNJ3z.js} +0 -0
- /package/dist/packem_shared/{StdoutContext-CgjWeCdO.js → stdout-context-CgjWeCdO.js} +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useEffect } from 'react';
|
|
3
|
+
import Box from './Box-W1w_NGin.js';
|
|
4
|
+
import Text from './Text-CtUwV89_.js';
|
|
5
|
+
|
|
6
|
+
const renderFade = (progress, children) => {
|
|
7
|
+
if (progress >= 1) {
|
|
8
|
+
return jsx(Box, { children });
|
|
9
|
+
}
|
|
10
|
+
if (progress <= 0) {
|
|
11
|
+
return jsx(Box, {});
|
|
12
|
+
}
|
|
13
|
+
return jsx(Box, { children: typeof children === "string" ? jsx(Text, { dimColor: progress < 0.7, children }) : children });
|
|
14
|
+
};
|
|
15
|
+
const slideOffset = (progress, distance) => Math.max(0, Math.min(distance, Math.round((1 - progress) * distance)));
|
|
16
|
+
const renderSlide = (axis, sign) => (progress, children, distance) => {
|
|
17
|
+
const offset = slideOffset(progress, distance);
|
|
18
|
+
if (progress >= 1) {
|
|
19
|
+
return jsx(Box, { children });
|
|
20
|
+
}
|
|
21
|
+
if (progress <= 0) {
|
|
22
|
+
return jsx(Box, {});
|
|
23
|
+
}
|
|
24
|
+
if (axis === "x") {
|
|
25
|
+
return jsx(Box, { paddingLeft: sign === 1 ? offset : 0, paddingRight: sign === -1 ? offset : 0, children });
|
|
26
|
+
}
|
|
27
|
+
return jsx(Box, { flexDirection: "column", paddingBottom: sign === -1 ? offset : 0, paddingTop: sign === 1 ? offset : 0, children });
|
|
28
|
+
};
|
|
29
|
+
const renderReveal = (progress, children, distance) => {
|
|
30
|
+
if (progress >= 1) {
|
|
31
|
+
return jsx(Box, { children });
|
|
32
|
+
}
|
|
33
|
+
if (progress <= 0) {
|
|
34
|
+
return jsx(Box, {});
|
|
35
|
+
}
|
|
36
|
+
const rows = Math.max(0, Math.min(distance, Math.round(progress * distance)));
|
|
37
|
+
return jsx(Box, { flexDirection: "column", height: rows, overflowY: "hidden", children });
|
|
38
|
+
};
|
|
39
|
+
const PRESET_RENDERERS = {
|
|
40
|
+
fade: renderFade,
|
|
41
|
+
reveal: renderReveal,
|
|
42
|
+
"slide-down": renderSlide("y", -1),
|
|
43
|
+
"slide-left": renderSlide("x", -1),
|
|
44
|
+
"slide-right": renderSlide("x", 1),
|
|
45
|
+
"slide-up": renderSlide("y", 1)
|
|
46
|
+
};
|
|
47
|
+
const resolvePhase = (show, progress) => {
|
|
48
|
+
if (show) {
|
|
49
|
+
return progress >= 1 ? "entered" : "entering";
|
|
50
|
+
}
|
|
51
|
+
return progress <= 0 ? "exited" : "exiting";
|
|
52
|
+
};
|
|
53
|
+
function Transition({ children, distance = 4, duration = 240, onExit, preset = "fade", show = true, tickInterval = 30 }) {
|
|
54
|
+
const [progress, setProgress] = useState(show ? 1 : 0);
|
|
55
|
+
const targetRef = useRef(show ? 1 : 0);
|
|
56
|
+
const startRef = useRef(Date.now());
|
|
57
|
+
const startProgressRef = useRef(show ? 1 : 0);
|
|
58
|
+
const completedRef = useRef(!show);
|
|
59
|
+
const onExitRef = useRef(onExit);
|
|
60
|
+
onExitRef.current = onExit;
|
|
61
|
+
const [animationKey, setAnimationKey] = useState(0);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
const target = show ? 1 : 0;
|
|
64
|
+
if (targetRef.current === target) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
targetRef.current = target;
|
|
68
|
+
startRef.current = Date.now();
|
|
69
|
+
startProgressRef.current = progress;
|
|
70
|
+
completedRef.current = false;
|
|
71
|
+
setAnimationKey((previous) => previous + 1);
|
|
72
|
+
}, [show]);
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const target = targetRef.current;
|
|
75
|
+
if (startProgressRef.current === target) {
|
|
76
|
+
if (target === 0 && !completedRef.current) {
|
|
77
|
+
completedRef.current = true;
|
|
78
|
+
onExitRef.current?.();
|
|
79
|
+
}
|
|
80
|
+
return void 0;
|
|
81
|
+
}
|
|
82
|
+
const id = setInterval(() => {
|
|
83
|
+
const elapsed = Date.now() - startRef.current;
|
|
84
|
+
const ratio = duration <= 0 ? 1 : Math.min(1, elapsed / duration);
|
|
85
|
+
const next = startProgressRef.current + (target - startProgressRef.current) * ratio;
|
|
86
|
+
setProgress(next);
|
|
87
|
+
if (ratio >= 1) {
|
|
88
|
+
clearInterval(id);
|
|
89
|
+
if (target === 0 && !completedRef.current) {
|
|
90
|
+
completedRef.current = true;
|
|
91
|
+
onExitRef.current?.();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, tickInterval);
|
|
95
|
+
return () => {
|
|
96
|
+
clearInterval(id);
|
|
97
|
+
};
|
|
98
|
+
}, [animationKey, duration, tickInterval]);
|
|
99
|
+
const phase = resolvePhase(show, progress);
|
|
100
|
+
if (phase === "exited" && !show) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
const renderer = PRESET_RENDERERS[preset];
|
|
104
|
+
return renderer(progress, children, distance);
|
|
105
|
+
}
|
|
106
|
+
const TransitionWithMarker = Object.assign(Transition, { isAnimatable: true });
|
|
107
|
+
|
|
108
|
+
export { TransitionWithMarker as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import useIsScreenReaderEnabled from './useIsScreenReaderEnabled-
|
|
3
|
-
import Box from './Box-
|
|
4
|
-
import Text from './Text-
|
|
2
|
+
import useIsScreenReaderEnabled from './useIsScreenReaderEnabled-BeoVqo1R.js';
|
|
3
|
+
import Box from './Box-W1w_NGin.js';
|
|
4
|
+
import Text from './Text-CtUwV89_.js';
|
|
5
5
|
import { theme } from './treeViewTheme-BpSw9TMf.js';
|
|
6
|
-
import { useTreeView } from './useTreeView-
|
|
6
|
+
import { useTreeView } from './useTreeView-mkN5Di7w.js';
|
|
7
7
|
import { useTreeViewState } from './useTreeViewState-BpS_KZ-K.js';
|
|
8
8
|
|
|
9
9
|
const POINTER = "❯";
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { createDecMode, setMode, resetMode } from '@visulima/ansi';
|
|
1
2
|
import EventEmitter from 'eventemitter3';
|
|
2
3
|
import { Renderer, TerminalGuard } from './Renderer-zZ5O3vxc.js';
|
|
3
4
|
|
|
4
|
-
const
|
|
5
|
-
const
|
|
5
|
+
const SynchronizedOutputMode = createDecMode(2026);
|
|
6
|
+
const DEC_2026_ON = setMode(SynchronizedOutputMode);
|
|
7
|
+
const DEC_2026_OFF = resetMode(SynchronizedOutputMode);
|
|
6
8
|
class TuiApp extends EventEmitter {
|
|
7
9
|
renderer;
|
|
8
10
|
terminal = null;
|
|
@@ -136,8 +136,9 @@ const usePaste = (handler, options = {}) => {
|
|
|
136
136
|
};
|
|
137
137
|
const useTuiContext = () => {
|
|
138
138
|
const context = useContext(TuiContext);
|
|
139
|
-
if (!context)
|
|
139
|
+
if (!context) {
|
|
140
140
|
throw new Error("useTuiContext must be used within a TUI App environment");
|
|
141
|
+
}
|
|
141
142
|
return context;
|
|
142
143
|
};
|
|
143
144
|
const useApp = () => {
|
|
@@ -199,8 +200,9 @@ const useStdin = () => {
|
|
|
199
200
|
};
|
|
200
201
|
};
|
|
201
202
|
const measureElement = (node) => {
|
|
202
|
-
if (!node || !node.yogaNode)
|
|
203
|
+
if (!node || !node.yogaNode) {
|
|
203
204
|
return { height: 0, width: 0 };
|
|
205
|
+
}
|
|
204
206
|
return {
|
|
205
207
|
height: node.yogaNode.getComputedHeight() ?? 0,
|
|
206
208
|
width: node.yogaNode.getComputedWidth() ?? 0
|
|
@@ -268,8 +270,9 @@ const useScrollable = ({ contentHeight, viewportHeight }) => {
|
|
|
268
270
|
};
|
|
269
271
|
const useMouse = (handler) => {
|
|
270
272
|
const context = useContext(TuiContext);
|
|
271
|
-
if (!context)
|
|
273
|
+
if (!context) {
|
|
272
274
|
throw new Error("useMouse must be used within a TUI App environment");
|
|
275
|
+
}
|
|
273
276
|
const handlerRef = useRef(handler);
|
|
274
277
|
useEffect(() => {
|
|
275
278
|
handlerRef.current = handler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import Box from './Box-
|
|
3
|
-
import Text from './Text-
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_MARKERS = ["─", "◦", "▪"];
|
|
6
6
|
const resolveMarkers = (marker) => {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { enableNormalMouse, enableAnyEventMouse, enableSgrMouse, disableSgrMouse, disableAnyEventMouse, disableNormalMouse } from '@visulima/ansi';
|
|
2
|
+
|
|
1
3
|
const ANSI_CODES = {
|
|
2
4
|
// SET_VT200_MOUSE - Terminal will send event on button pressed with mouse position
|
|
3
|
-
mouseButton: { off:
|
|
5
|
+
mouseButton: { off: disableNormalMouse, on: enableNormalMouse },
|
|
4
6
|
// SET_ANY_EVENT_MOUSE - Terminal will send event on button pressed and motion
|
|
5
|
-
mouseMotion: { off:
|
|
6
|
-
// SET_URXVT_EXT_MODE_MOUSE
|
|
7
|
+
mouseMotion: { off: disableAnyEventMouse, on: enableAnyEventMouse },
|
|
8
|
+
// SET_URXVT_EXT_MODE_MOUSE — no dedicated helper in @visulima/ansi
|
|
7
9
|
mouseMotionOthers: { off: "\x1B[?1015l", on: "\x1B[?1015h" },
|
|
8
10
|
// SET_SGR_EXT_MODE_MOUSE - Another mouse protocol that extends coordinate mapping (without it, supports only 223 rows and columns)
|
|
9
|
-
mouseSGR: { off:
|
|
11
|
+
mouseSGR: { off: disableSgrMouse, on: enableSgrMouse }};
|
|
10
12
|
const SGR_MOUSE_PATTERN = /\[<(\d+);(\d+);(\d+)(M)$/i;
|
|
11
13
|
|
|
12
14
|
const CLICK_BUTTONS = { 0: "left", 1: "middle", 2: "right" };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const BRAILLE_BASE = 10240;
|
|
2
|
+
const BRAILLE_BITS = [
|
|
3
|
+
1,
|
|
4
|
+
8,
|
|
5
|
+
// row 0: col 0, col 1
|
|
6
|
+
2,
|
|
7
|
+
16,
|
|
8
|
+
// row 1
|
|
9
|
+
4,
|
|
10
|
+
32,
|
|
11
|
+
// row 2
|
|
12
|
+
64,
|
|
13
|
+
128
|
|
14
|
+
// row 3
|
|
15
|
+
];
|
|
16
|
+
const createBrailleGrid = (cellWidth, cellHeight) => {
|
|
17
|
+
const pixelWidth = Math.max(0, cellWidth * 2);
|
|
18
|
+
const pixelHeight = Math.max(0, cellHeight * 4);
|
|
19
|
+
const bits = new Uint8Array(cellWidth * cellHeight);
|
|
20
|
+
const dirty = new Uint8Array(cellWidth * cellHeight);
|
|
21
|
+
const plotPoint = (x, y) => {
|
|
22
|
+
if (x < 0 || y < 0 || x >= pixelWidth || y >= pixelHeight) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const cellX = Math.floor(x / 2);
|
|
26
|
+
const cellY = Math.floor(y / 4);
|
|
27
|
+
const subX = x % 2;
|
|
28
|
+
const subY = y % 4;
|
|
29
|
+
const bit = BRAILLE_BITS[subY * 2 + subX];
|
|
30
|
+
const index = cellY * cellWidth + cellX;
|
|
31
|
+
if ((bits[index] & bit) === 0) {
|
|
32
|
+
bits[index] = (bits[index] ?? 0) | bit;
|
|
33
|
+
dirty[index] = 1;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const plotLine = (x0, y0, x1, y1) => {
|
|
37
|
+
let x = Math.round(x0);
|
|
38
|
+
let y = Math.round(y0);
|
|
39
|
+
const endX = Math.round(x1);
|
|
40
|
+
const endY = Math.round(y1);
|
|
41
|
+
const dx = Math.abs(endX - x);
|
|
42
|
+
const sx = x < endX ? 1 : -1;
|
|
43
|
+
const dy = -Math.abs(endY - y);
|
|
44
|
+
const sy = y < endY ? 1 : -1;
|
|
45
|
+
let error = dx + dy;
|
|
46
|
+
while (true) {
|
|
47
|
+
plotPoint(x, y);
|
|
48
|
+
if (x === endX && y === endY) {
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
const error2 = 2 * error;
|
|
52
|
+
if (error2 >= dy) {
|
|
53
|
+
if (x === endX) {
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
error += dy;
|
|
57
|
+
x += sx;
|
|
58
|
+
}
|
|
59
|
+
if (error2 <= dx) {
|
|
60
|
+
if (y === endY) {
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
error += dx;
|
|
64
|
+
y += sy;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
cellHeight,
|
|
70
|
+
cellWidth,
|
|
71
|
+
clear: () => {
|
|
72
|
+
bits.fill(0);
|
|
73
|
+
dirty.fill(0);
|
|
74
|
+
},
|
|
75
|
+
flush: (context, style) => {
|
|
76
|
+
for (const [index, bit] of bits.entries()) {
|
|
77
|
+
if (dirty[index] === 0) {
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const cellX = index % cellWidth;
|
|
81
|
+
const cellY = Math.floor(index / cellWidth);
|
|
82
|
+
const codepoint = BRAILLE_BASE + bit;
|
|
83
|
+
context.setCell(cellX, cellY, codepoint, style);
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
pixelHeight,
|
|
87
|
+
pixelWidth,
|
|
88
|
+
plotLine,
|
|
89
|
+
plotPoint
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export { createBrailleGrid as c };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getPathToRoot } from './dom-
|
|
2
|
-
import { t as toStyledLine } from './measure-text-
|
|
1
|
+
import { g as getPathToRoot } from './dom-CrbpQgat.js';
|
|
2
|
+
import { t as toStyledLine } from './measure-text-BdOhbOeh.js';
|
|
3
3
|
import { squashTextNodesWithMap } from './squashTextNodesWithMap-iqm6OMMT.js';
|
|
4
4
|
|
|
5
5
|
const getPlainTextFromDomNode = (node) => {
|
package/dist/packem_shared/{ControlledScrollView-BlOaxcsN.js → controlled-scroll-view-DJXfdWMm.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useRef, useCallback, useLayoutEffect, isValidElement, useImperativeHandle, Fragment } from 'react';
|
|
3
|
-
import { m as measureElement } from './measure-element-
|
|
4
|
-
import Box from './Box-
|
|
3
|
+
import { m as measureElement } from './measure-element-Bc6PEaIe.js';
|
|
4
|
+
import Box from './Box-W1w_NGin.js';
|
|
5
5
|
|
|
6
6
|
const useStateRef = (initialValue) => {
|
|
7
7
|
const [state, setStateInternal] = useState(initialValue);
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { createDecMode, setMode, resetMode, BracketedPasteMode, cursorUp, cursorToColumn1, cursorHide, REQUEST_CURSOR_POSITION, cursorPosition, eraseLine, cursorShow } from '@visulima/ansi';
|
|
1
2
|
import { terminalSize, Renderer } from './Renderer-zZ5O3vxc.js';
|
|
2
3
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
4
|
+
const SynchronizedOutputMode = createDecMode(2026);
|
|
5
|
+
const DEC_2026_ON = setMode(SynchronizedOutputMode);
|
|
6
|
+
const DEC_2026_OFF = resetMode(SynchronizedOutputMode);
|
|
7
|
+
const enableBracketedPaste = setMode(BracketedPasteMode);
|
|
8
|
+
const disableBracketedPaste = resetMode(BracketedPasteMode);
|
|
5
9
|
function createInlineLoop(paint, options = {}) {
|
|
6
10
|
const reservedRows = options.rows ?? 10;
|
|
7
11
|
const fps = options.fps ?? 60;
|
|
@@ -28,7 +32,7 @@ function createInlineLoop(paint, options = {}) {
|
|
|
28
32
|
}
|
|
29
33
|
function startRendering(cursorRow) {
|
|
30
34
|
regionTopRow = cursorRow - renderRows;
|
|
31
|
-
write(
|
|
35
|
+
write(cursorUp(renderRows) + cursorToColumn1);
|
|
32
36
|
renderer.setRowOffset(regionTopRow);
|
|
33
37
|
tick();
|
|
34
38
|
interval = setInterval(
|
|
@@ -43,16 +47,17 @@ function createInlineLoop(paint, options = {}) {
|
|
|
43
47
|
cols = size.cols;
|
|
44
48
|
const termRows = size.rows;
|
|
45
49
|
renderRows = Math.min(reservedRows, termRows);
|
|
46
|
-
if (process.stdin.isTTY)
|
|
50
|
+
if (process.stdin.isTTY) {
|
|
47
51
|
process.stdin.setRawMode(true);
|
|
52
|
+
}
|
|
48
53
|
process.stdin.resume();
|
|
49
54
|
process.stdin.setEncoding("utf8");
|
|
50
55
|
renderer = new Renderer(cols, renderRows);
|
|
51
56
|
buf = new Uint32Array(cols * renderRows * 2);
|
|
52
|
-
write(
|
|
53
|
-
write(
|
|
57
|
+
write(cursorHide);
|
|
58
|
+
write(enableBracketedPaste);
|
|
54
59
|
write("\n".repeat(renderRows));
|
|
55
|
-
write(
|
|
60
|
+
write(REQUEST_CURSOR_POSITION);
|
|
56
61
|
process.on("SIGINT", stop);
|
|
57
62
|
let cprBuf = "";
|
|
58
63
|
const onData = (chunk) => {
|
|
@@ -73,17 +78,18 @@ function createInlineLoop(paint, options = {}) {
|
|
|
73
78
|
if (renderer) {
|
|
74
79
|
if (onExit === "destroy") {
|
|
75
80
|
for (let i = 0; i < renderRows; i++) {
|
|
76
|
-
write(
|
|
81
|
+
write(cursorPosition(regionTopRow + 1 + i, 1) + eraseLine);
|
|
77
82
|
}
|
|
78
|
-
write(
|
|
83
|
+
write(cursorPosition(regionTopRow + 1, 1));
|
|
79
84
|
} else {
|
|
80
|
-
write(
|
|
85
|
+
write(cursorPosition(regionTopRow + renderRows + 1, 1));
|
|
81
86
|
}
|
|
82
|
-
write(
|
|
83
|
-
write(
|
|
87
|
+
write(disableBracketedPaste);
|
|
88
|
+
write(cursorShow);
|
|
84
89
|
}
|
|
85
|
-
if (process.stdin.isTTY)
|
|
90
|
+
if (process.stdin.isTTY) {
|
|
86
91
|
process.stdin.setRawMode(false);
|
|
92
|
+
}
|
|
87
93
|
process.stdin.pause();
|
|
88
94
|
process.exit(0);
|
|
89
95
|
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
|
|
6
|
+
|
|
7
|
+
const __cjs_getBuiltinModule = (module) => {
|
|
8
|
+
// Check if we're in Node.js and version supports getBuiltinModule
|
|
9
|
+
if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
|
|
10
|
+
const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
|
|
11
|
+
// Node.js 20.16.0+ and 22.3.0+
|
|
12
|
+
if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
|
|
13
|
+
return __cjs_getProcess.getBuiltinModule(module);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// Fallback to createRequire
|
|
17
|
+
return __cjs_require(module);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const {
|
|
21
|
+
mkdirSync,
|
|
22
|
+
writeFileSync,
|
|
23
|
+
renameSync,
|
|
24
|
+
readFileSync
|
|
25
|
+
} = __cjs_getBuiltinModule("node:fs");
|
|
26
|
+
const {
|
|
27
|
+
homedir
|
|
28
|
+
} = __cjs_getBuiltinModule("node:os");
|
|
29
|
+
const path = __cjs_getBuiltinModule("node:path");
|
|
30
|
+
const process = __cjs_getProcess;
|
|
31
|
+
import { useRef, useState, useCallback } from 'react';
|
|
32
|
+
|
|
33
|
+
const createMemoryStorage = () => {
|
|
34
|
+
const memory = /* @__PURE__ */ new Map();
|
|
35
|
+
return {
|
|
36
|
+
read: (key) => memory.get(key),
|
|
37
|
+
write: (key, value) => {
|
|
38
|
+
memory.set(key, value);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
const createFileStorage = (namespace) => {
|
|
43
|
+
const filePath = path.join(homedir(), ".cache", "visulima-tui", `${namespace}.json`);
|
|
44
|
+
const reportError = (operation, error) => {
|
|
45
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
46
|
+
process.stderr.write(`[visulima/tui] persistent-state ${operation} failed: ${message}
|
|
47
|
+
`);
|
|
48
|
+
};
|
|
49
|
+
const load = () => {
|
|
50
|
+
try {
|
|
51
|
+
const raw = readFileSync(filePath, "utf8");
|
|
52
|
+
const parsed = JSON.parse(raw);
|
|
53
|
+
if (parsed && typeof parsed === "object") {
|
|
54
|
+
return parsed;
|
|
55
|
+
}
|
|
56
|
+
return {};
|
|
57
|
+
} catch (error) {
|
|
58
|
+
const code = error?.code;
|
|
59
|
+
if (code !== "ENOENT" && code !== "EACCES") {
|
|
60
|
+
reportError("read", error);
|
|
61
|
+
}
|
|
62
|
+
return {};
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
read: (key) => load()[key],
|
|
67
|
+
write: (key, value) => {
|
|
68
|
+
const directory = path.dirname(filePath);
|
|
69
|
+
const temporaryPath = `${filePath}.tmp.${process.pid}`;
|
|
70
|
+
try {
|
|
71
|
+
mkdirSync(directory, { recursive: true });
|
|
72
|
+
const current = load();
|
|
73
|
+
current[key] = value;
|
|
74
|
+
writeFileSync(temporaryPath, JSON.stringify(current, null, 2), {
|
|
75
|
+
encoding: "utf8",
|
|
76
|
+
flag: "w"
|
|
77
|
+
});
|
|
78
|
+
renameSync(temporaryPath, filePath);
|
|
79
|
+
} catch (error) {
|
|
80
|
+
reportError("write", error);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
const readInitial = (storage, key, fallback) => {
|
|
86
|
+
const raw = storage.read(key);
|
|
87
|
+
if (raw === void 0) {
|
|
88
|
+
return fallback;
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
return JSON.parse(raw);
|
|
92
|
+
} catch {
|
|
93
|
+
return fallback;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const usePersistentState = (key, initialValue, options) => {
|
|
97
|
+
const storageRef = useRef(options?.storage ?? createFileStorage(options?.namespace ?? "tui"));
|
|
98
|
+
const [value, setValue] = useState(() => readInitial(storageRef.current, key, initialValue));
|
|
99
|
+
const update = useCallback(
|
|
100
|
+
(next) => {
|
|
101
|
+
setValue((previous) => {
|
|
102
|
+
const resolved = typeof next === "function" ? next(previous) : next;
|
|
103
|
+
try {
|
|
104
|
+
storageRef.current.write(key, JSON.stringify(resolved));
|
|
105
|
+
} catch {
|
|
106
|
+
}
|
|
107
|
+
return resolved;
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
[key]
|
|
111
|
+
);
|
|
112
|
+
return [value, update];
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export { createFileStorage, createMemoryStorage, usePersistentState as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { strip } from '@visulima/ansi';
|
|
2
|
+
|
|
3
|
+
const createScreen = (lastFrame, allFrames) => {
|
|
4
|
+
const clean = (s) => {
|
|
5
|
+
if (s === void 0) {
|
|
6
|
+
return "";
|
|
7
|
+
}
|
|
8
|
+
return strip(s);
|
|
9
|
+
};
|
|
10
|
+
return {
|
|
11
|
+
contains(text) {
|
|
12
|
+
return this.text().includes(text);
|
|
13
|
+
},
|
|
14
|
+
frames() {
|
|
15
|
+
return allFrames.map((f) => strip(f));
|
|
16
|
+
},
|
|
17
|
+
line(n) {
|
|
18
|
+
return this.text().split("\n")[n] ?? "";
|
|
19
|
+
},
|
|
20
|
+
lines() {
|
|
21
|
+
return this.text().split("\n").filter((l) => l.trim() !== "");
|
|
22
|
+
},
|
|
23
|
+
matches(pattern) {
|
|
24
|
+
return pattern.test(this.text());
|
|
25
|
+
},
|
|
26
|
+
rawFrames() {
|
|
27
|
+
return [...allFrames];
|
|
28
|
+
},
|
|
29
|
+
rawText() {
|
|
30
|
+
return lastFrame() ?? "";
|
|
31
|
+
},
|
|
32
|
+
text() {
|
|
33
|
+
return clean(lastFrame());
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { createScreen };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Yoga from 'yoga-layout';
|
|
2
|
-
import { m as measureText } from './measure-text-
|
|
2
|
+
import { m as measureText } from './measure-text-BdOhbOeh.js';
|
|
3
3
|
import squashTextNodes from './squashTextNodesWithMap-iqm6OMMT.js';
|
|
4
4
|
import { wordWrap, truncate } from '@visulima/string';
|
|
5
5
|
|
|
@@ -56,6 +56,9 @@ const createNode = (nodeName) => {
|
|
|
56
56
|
}
|
|
57
57
|
return node;
|
|
58
58
|
};
|
|
59
|
+
const markNodeAndParentIfStaticAsDirty = (node) => {
|
|
60
|
+
markNodeAsDirty(node.nodeName === "ink-static-render" && node.cachedRender ? node.parentNode : node);
|
|
61
|
+
};
|
|
59
62
|
const appendChildNode = (node, childNode) => {
|
|
60
63
|
if (childNode.parentNode) {
|
|
61
64
|
removeChildNode(childNode.parentNode, childNode);
|
|
@@ -65,9 +68,7 @@ const appendChildNode = (node, childNode) => {
|
|
|
65
68
|
if (childNode.yogaNode) {
|
|
66
69
|
node.yogaNode?.insertChild(childNode.yogaNode, node.yogaNode.getChildCount());
|
|
67
70
|
}
|
|
68
|
-
|
|
69
|
-
markNodeAsDirty(node);
|
|
70
|
-
}
|
|
71
|
+
markNodeAndParentIfStaticAsDirty(node);
|
|
71
72
|
};
|
|
72
73
|
const insertBeforeNode = (node, newChildNode, beforeChildNode) => {
|
|
73
74
|
if (newChildNode.parentNode) {
|
|
@@ -87,9 +88,7 @@ const insertBeforeNode = (node, newChildNode, beforeChildNode) => {
|
|
|
87
88
|
node.yogaNode?.insertChild(newChildNode.yogaNode, yogaIndex);
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
-
markNodeAsDirty(node);
|
|
92
|
-
}
|
|
91
|
+
markNodeAndParentIfStaticAsDirty(node);
|
|
93
92
|
};
|
|
94
93
|
const removeChildNode = (node, removeNode) => {
|
|
95
94
|
if (removeNode.yogaNode) {
|
|
@@ -103,9 +102,7 @@ const removeChildNode = (node, removeNode) => {
|
|
|
103
102
|
if (index !== -1) {
|
|
104
103
|
node.childNodes.splice(index, 1);
|
|
105
104
|
}
|
|
106
|
-
|
|
107
|
-
markNodeAsDirty(node);
|
|
108
|
-
}
|
|
105
|
+
markNodeAndParentIfStaticAsDirty(node);
|
|
109
106
|
};
|
|
110
107
|
const setAttribute = (node, key, value) => {
|
|
111
108
|
if (key === "internal_accessibility") {
|
|
@@ -138,7 +135,7 @@ const measureTextNode = function(node, width) {
|
|
|
138
135
|
return dimensions;
|
|
139
136
|
}
|
|
140
137
|
const textWrap = node.style?.textWrap ?? "wrap";
|
|
141
|
-
const wrappedText = wrapText(text, width, textWrap);
|
|
138
|
+
const wrappedText = wrapText(text, Math.floor(width), textWrap);
|
|
142
139
|
return measureText(wrappedText);
|
|
143
140
|
};
|
|
144
141
|
const findClosestYogaNode = (node) => {
|
|
@@ -148,14 +145,20 @@ const findClosestYogaNode = (node) => {
|
|
|
148
145
|
return node.yogaNode ?? findClosestYogaNode(node.parentNode);
|
|
149
146
|
};
|
|
150
147
|
const markNodeAsDirty = (node) => {
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
if (node?.nodeName === "#text" || node?.nodeName === "ink-text" || node?.nodeName === "ink-virtual-text") {
|
|
149
|
+
const yogaNode = findClosestYogaNode(node);
|
|
150
|
+
yogaNode?.markDirty();
|
|
151
|
+
}
|
|
153
152
|
let current = node;
|
|
154
153
|
while (current) {
|
|
155
154
|
if (current.nodeName === "ink-text" || current.nodeName === "ink-virtual-text") {
|
|
156
155
|
current.internal_textCache = void 0;
|
|
157
156
|
}
|
|
158
|
-
if ("
|
|
157
|
+
if ("childNodes" in current) {
|
|
158
|
+
const shouldPreserveStaticCache = current !== node && current.nodeName === "ink-static-render" && Boolean(current.cachedRender);
|
|
159
|
+
if (shouldPreserveStaticCache) {
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
159
162
|
current.cachedRender = void 0;
|
|
160
163
|
}
|
|
161
164
|
current = current.parentNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'yoga-layout';
|
|
2
|
-
import './measure-text-
|
|
2
|
+
import './measure-text-BdOhbOeh.js';
|
|
3
3
|
import './squashTextNodesWithMap-iqm6OMMT.js';
|
|
4
|
-
export { a as addLayoutListener, d as appendChildNode, c as createNode, f as createTextNode, e as emitLayoutListeners, g as getPathToRoot, b as insertBeforeNode, i as isNodeSelectable, m as markNodeAsDirty, r as removeChildNode, j as setAttribute, k as setCachedRender, h as setStyle, s as setTextNodeValue } from './dom-
|
|
4
|
+
export { a as addLayoutListener, d as appendChildNode, c as createNode, f as createTextNode, e as emitLayoutListeners, g as getPathToRoot, b as insertBeforeNode, i as isNodeSelectable, m as markNodeAsDirty, r as removeChildNode, j as setAttribute, k as setCachedRender, h as setStyle, s as setTextNodeValue } from './dom-CrbpQgat.js';
|
|
@@ -22,10 +22,10 @@ const calculateScrollDimensions = (node) => {
|
|
|
22
22
|
}
|
|
23
23
|
const scrollHeight = maxBottom - top + yogaNode.getComputedPadding(Yoga.EDGE_BOTTOM);
|
|
24
24
|
const scrollWidth = maxRight - left + yogaNode.getComputedPadding(Yoga.EDGE_RIGHT);
|
|
25
|
-
return { scrollHeight, scrollWidth };
|
|
25
|
+
return { scrollHeight: Math.round(scrollHeight), scrollWidth: Math.round(scrollWidth) };
|
|
26
26
|
};
|
|
27
|
-
const getScrollHeight = (node) => node.internal_scrollState?.scrollHeight ?? 0;
|
|
28
|
-
const getScrollWidth = (node) => node.internal_scrollState?.scrollWidth ?? 0;
|
|
27
|
+
const getScrollHeight = (node) => Math.round(node.internal_scrollState?.scrollHeight ?? 0);
|
|
28
|
+
const getScrollWidth = (node) => Math.round(node.internal_scrollState?.scrollWidth ?? 0);
|
|
29
29
|
const calculateScroll = (node) => {
|
|
30
30
|
const { yogaNode } = node;
|
|
31
31
|
if (!yogaNode) {
|
|
@@ -57,7 +57,7 @@ const calculateScroll = (node) => {
|
|
|
57
57
|
scrollWidth
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
-
const getScrollTop = (node) => node.internal_scrollState?.scrollTop ?? 0;
|
|
61
|
-
const getScrollLeft = (node) => node.internal_scrollState?.scrollLeft ?? 0;
|
|
60
|
+
const getScrollTop = (node) => Math.round(node.internal_scrollState?.scrollTop ?? 0);
|
|
61
|
+
const getScrollLeft = (node) => Math.round(node.internal_scrollState?.scrollLeft ?? 0);
|
|
62
62
|
|
|
63
63
|
export { calculateScroll, getScrollHeight, getScrollLeft, getScrollTop, getScrollWidth };
|