@visulima/tui 1.0.0-alpha.6 → 1.0.0-alpha.8
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 +21 -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,287 +0,0 @@
|
|
|
1
|
-
import { g as getPathToRoot } from './dom-CrbpQgat.js';
|
|
2
|
-
import { t as toStyledLine } from './measure-text-BdOhbOeh.js';
|
|
3
|
-
import { squashTextNodesWithMap } from './squashTextNodesWithMap-iqm6OMMT.js';
|
|
4
|
-
|
|
5
|
-
const getPlainTextFromDomNode = (node) => {
|
|
6
|
-
if (node.nodeName === "#text") {
|
|
7
|
-
const styledLine2 = toStyledLine(node.nodeValue);
|
|
8
|
-
const charOffsetMap2 = /* @__PURE__ */ new Map([[node, { end: styledLine2.length, start: 0 }]]);
|
|
9
|
-
return { charOffsetMap: charOffsetMap2, styledLine: styledLine2 };
|
|
10
|
-
}
|
|
11
|
-
const charOffsetMap = /* @__PURE__ */ new Map();
|
|
12
|
-
const offsetRef = { current: 0 };
|
|
13
|
-
const text = squashTextNodesWithMap(node, charOffsetMap, offsetRef);
|
|
14
|
-
const styledLine = toStyledLine(text);
|
|
15
|
-
charOffsetMap.set(node, { end: styledLine.length, start: 0 });
|
|
16
|
-
return { charOffsetMap, styledLine };
|
|
17
|
-
};
|
|
18
|
-
const getRangeCharacterOffsets = (range, charOffsetMap) => {
|
|
19
|
-
if (!range.startContainer || !range.endContainer) {
|
|
20
|
-
return void 0;
|
|
21
|
-
}
|
|
22
|
-
const getOffset = (node, offset) => {
|
|
23
|
-
const nodeRange = charOffsetMap.get(node);
|
|
24
|
-
if (!nodeRange) {
|
|
25
|
-
return void 0;
|
|
26
|
-
}
|
|
27
|
-
if (node.nodeName === "#text") {
|
|
28
|
-
return nodeRange.start + offset;
|
|
29
|
-
}
|
|
30
|
-
const element = node;
|
|
31
|
-
if (offset >= element.childNodes.length) {
|
|
32
|
-
return nodeRange.end;
|
|
33
|
-
}
|
|
34
|
-
const child = element.childNodes[offset];
|
|
35
|
-
const childRange = charOffsetMap.get(child);
|
|
36
|
-
if (childRange) {
|
|
37
|
-
return childRange.start;
|
|
38
|
-
}
|
|
39
|
-
for (let index = offset - 1; index >= 0; index--) {
|
|
40
|
-
const sibling = element.childNodes[index];
|
|
41
|
-
const siblingRange = charOffsetMap.get(sibling);
|
|
42
|
-
if (siblingRange) {
|
|
43
|
-
return siblingRange.end;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return nodeRange.start;
|
|
47
|
-
};
|
|
48
|
-
const start = getOffset(range.startContainer, range.startOffset);
|
|
49
|
-
const end = getOffset(range.endContainer, range.endOffset);
|
|
50
|
-
if (start === void 0 || end === void 0) {
|
|
51
|
-
return void 0;
|
|
52
|
-
}
|
|
53
|
-
return { end, start };
|
|
54
|
-
};
|
|
55
|
-
const comparePoints = (nodeA, offsetA, nodeB, offsetB) => {
|
|
56
|
-
if (nodeA === nodeB) {
|
|
57
|
-
return offsetA === offsetB ? 0 : offsetA < offsetB ? -1 : 1;
|
|
58
|
-
}
|
|
59
|
-
const pathA = getPathToRoot(nodeA);
|
|
60
|
-
const pathB = getPathToRoot(nodeB);
|
|
61
|
-
let lca;
|
|
62
|
-
let index = 0;
|
|
63
|
-
while (index < pathA.length && index < pathB.length && pathA[index] === pathB[index]) {
|
|
64
|
-
lca = pathA[index];
|
|
65
|
-
index++;
|
|
66
|
-
}
|
|
67
|
-
if (!lca) {
|
|
68
|
-
return 0;
|
|
69
|
-
}
|
|
70
|
-
if (index === pathA.length) {
|
|
71
|
-
const childB2 = pathB[index];
|
|
72
|
-
const indexChildB2 = nodeA.childNodes.indexOf(childB2);
|
|
73
|
-
if (offsetA <= indexChildB2) {
|
|
74
|
-
return -1;
|
|
75
|
-
}
|
|
76
|
-
return 1;
|
|
77
|
-
}
|
|
78
|
-
if (index === pathB.length) {
|
|
79
|
-
const childA2 = pathA[index];
|
|
80
|
-
const indexChildA2 = nodeB.childNodes.indexOf(childA2);
|
|
81
|
-
if (indexChildA2 < offsetB) {
|
|
82
|
-
return -1;
|
|
83
|
-
}
|
|
84
|
-
return 1;
|
|
85
|
-
}
|
|
86
|
-
const childA = pathA[index];
|
|
87
|
-
const childB = pathB[index];
|
|
88
|
-
const indexChildA = lca.childNodes.indexOf(childA);
|
|
89
|
-
const indexChildB = lca.childNodes.indexOf(childB);
|
|
90
|
-
return indexChildA < indexChildB ? -1 : 1;
|
|
91
|
-
};
|
|
92
|
-
class Range {
|
|
93
|
-
startContainer = void 0;
|
|
94
|
-
startOffset = 0;
|
|
95
|
-
endContainer = void 0;
|
|
96
|
-
endOffset = 0;
|
|
97
|
-
collapsed = true;
|
|
98
|
-
commonAncestorContainer = void 0;
|
|
99
|
-
setStart(node, offset) {
|
|
100
|
-
this.startContainer = node;
|
|
101
|
-
this.startOffset = offset;
|
|
102
|
-
this.updateCollapsed();
|
|
103
|
-
this.updateCommonAncestor();
|
|
104
|
-
}
|
|
105
|
-
setEnd(node, offset) {
|
|
106
|
-
this.endContainer = node;
|
|
107
|
-
this.endOffset = offset;
|
|
108
|
-
this.updateCollapsed();
|
|
109
|
-
this.updateCommonAncestor();
|
|
110
|
-
}
|
|
111
|
-
collapse(toStart) {
|
|
112
|
-
if (toStart) {
|
|
113
|
-
this.endContainer = this.startContainer;
|
|
114
|
-
this.endOffset = this.startOffset;
|
|
115
|
-
} else {
|
|
116
|
-
this.startContainer = this.endContainer;
|
|
117
|
-
this.startOffset = this.endOffset;
|
|
118
|
-
}
|
|
119
|
-
this.collapsed = true;
|
|
120
|
-
this.updateCommonAncestor();
|
|
121
|
-
}
|
|
122
|
-
selectNode(node) {
|
|
123
|
-
if (!node.parentNode) {
|
|
124
|
-
throw new Error("Node has no parent");
|
|
125
|
-
}
|
|
126
|
-
const index = node.parentNode.childNodes.indexOf(node);
|
|
127
|
-
this.setStart(node.parentNode, index);
|
|
128
|
-
this.setEnd(node.parentNode, index + 1);
|
|
129
|
-
}
|
|
130
|
-
selectNodeContents(node) {
|
|
131
|
-
this.setStart(node, 0);
|
|
132
|
-
if (node.nodeName === "#text") {
|
|
133
|
-
this.setEnd(node, node.nodeValue.length);
|
|
134
|
-
} else {
|
|
135
|
-
this.setEnd(node, node.childNodes.length);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
toString() {
|
|
139
|
-
if (this.collapsed || !this.startContainer || !this.endContainer) {
|
|
140
|
-
return "";
|
|
141
|
-
}
|
|
142
|
-
if (!this.commonAncestorContainer) {
|
|
143
|
-
return "";
|
|
144
|
-
}
|
|
145
|
-
const { charOffsetMap, styledLine } = getPlainTextFromDomNode(this.commonAncestorContainer);
|
|
146
|
-
const offsets = getRangeCharacterOffsets(this, charOffsetMap);
|
|
147
|
-
if (!offsets) {
|
|
148
|
-
return "";
|
|
149
|
-
}
|
|
150
|
-
const sliced = styledLine.slice(offsets.start, offsets.end);
|
|
151
|
-
return sliced.getTextRange(0, sliced.length);
|
|
152
|
-
}
|
|
153
|
-
updateCollapsed() {
|
|
154
|
-
this.collapsed = this.startContainer === this.endContainer && this.startOffset === this.endOffset;
|
|
155
|
-
}
|
|
156
|
-
updateCommonAncestor() {
|
|
157
|
-
if (!this.startContainer || !this.endContainer) {
|
|
158
|
-
this.commonAncestorContainer = void 0;
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (this.startContainer === this.endContainer) {
|
|
162
|
-
this.commonAncestorContainer = this.startContainer;
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
const startPath = getPathToRoot(this.startContainer);
|
|
166
|
-
const endPath = getPathToRoot(this.endContainer);
|
|
167
|
-
let common;
|
|
168
|
-
for (let index = 0; index < Math.min(startPath.length, endPath.length); index++) {
|
|
169
|
-
if (startPath[index] === endPath[index]) {
|
|
170
|
-
common = startPath[index];
|
|
171
|
-
} else {
|
|
172
|
-
break;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
this.commonAncestorContainer = common;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
class Selection {
|
|
179
|
-
anchorNode = void 0;
|
|
180
|
-
anchorOffset = 0;
|
|
181
|
-
focusNode = void 0;
|
|
182
|
-
focusOffset = 0;
|
|
183
|
-
isCollapsed = true;
|
|
184
|
-
rangeCount = 0;
|
|
185
|
-
ranges = [];
|
|
186
|
-
listeners = /* @__PURE__ */ new Set();
|
|
187
|
-
onChange(listener) {
|
|
188
|
-
this.listeners.add(listener);
|
|
189
|
-
return () => {
|
|
190
|
-
this.listeners.delete(listener);
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
toString() {
|
|
194
|
-
return this.ranges.map((range) => range.toString()).join("");
|
|
195
|
-
}
|
|
196
|
-
getRangeAt(index) {
|
|
197
|
-
return this.ranges[index];
|
|
198
|
-
}
|
|
199
|
-
addRange(range) {
|
|
200
|
-
if (!this.ranges.includes(range)) {
|
|
201
|
-
this.ranges.push(range);
|
|
202
|
-
this.rangeCount = this.ranges.length;
|
|
203
|
-
if (this.rangeCount === 1) {
|
|
204
|
-
this.anchorNode = range.startContainer;
|
|
205
|
-
this.anchorOffset = range.startOffset;
|
|
206
|
-
this.focusNode = range.endContainer;
|
|
207
|
-
this.focusOffset = range.endOffset;
|
|
208
|
-
this.isCollapsed = range.collapsed;
|
|
209
|
-
}
|
|
210
|
-
this.notifyChange();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
removeRange(range) {
|
|
214
|
-
const index = this.ranges.indexOf(range);
|
|
215
|
-
if (index !== -1) {
|
|
216
|
-
this.ranges.splice(index, 1);
|
|
217
|
-
this.rangeCount = this.ranges.length;
|
|
218
|
-
if (this.rangeCount === 0) {
|
|
219
|
-
this.clearState();
|
|
220
|
-
}
|
|
221
|
-
this.notifyChange();
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
removeAllRanges() {
|
|
225
|
-
this.ranges = [];
|
|
226
|
-
this.rangeCount = 0;
|
|
227
|
-
this.clearState();
|
|
228
|
-
this.notifyChange();
|
|
229
|
-
}
|
|
230
|
-
collapse(node, offset) {
|
|
231
|
-
this.removeAllRanges();
|
|
232
|
-
const range = new Range();
|
|
233
|
-
range.setStart(node, offset);
|
|
234
|
-
range.setEnd(node, offset);
|
|
235
|
-
this.addRange(range);
|
|
236
|
-
}
|
|
237
|
-
containsNode(node, allowPartialContainment = false) {
|
|
238
|
-
if (!node.parentNode) {
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
const parent = node.parentNode;
|
|
242
|
-
const index = parent.childNodes.indexOf(node);
|
|
243
|
-
const nodeStartContainer = parent;
|
|
244
|
-
const nodeStartOffset = index;
|
|
245
|
-
const nodeEndContainer = parent;
|
|
246
|
-
const nodeEndOffset = index + 1;
|
|
247
|
-
return this.ranges.some((range) => {
|
|
248
|
-
if (!range.startContainer || !range.endContainer) {
|
|
249
|
-
return false;
|
|
250
|
-
}
|
|
251
|
-
const startToStart = comparePoints(range.startContainer, range.startOffset, nodeStartContainer, nodeStartOffset);
|
|
252
|
-
const endToEnd = comparePoints(range.endContainer, range.endOffset, nodeEndContainer, nodeEndOffset);
|
|
253
|
-
if (allowPartialContainment) {
|
|
254
|
-
const startToEnd = comparePoints(range.startContainer, range.startOffset, nodeEndContainer, nodeEndOffset);
|
|
255
|
-
const endToStart = comparePoints(range.endContainer, range.endOffset, nodeStartContainer, nodeStartOffset);
|
|
256
|
-
return startToEnd < 0 && endToStart > 0;
|
|
257
|
-
}
|
|
258
|
-
return startToStart <= 0 && endToEnd >= 0;
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
clearState() {
|
|
262
|
-
this.anchorNode = void 0;
|
|
263
|
-
this.anchorOffset = 0;
|
|
264
|
-
this.focusNode = void 0;
|
|
265
|
-
this.focusOffset = 0;
|
|
266
|
-
this.isCollapsed = true;
|
|
267
|
-
}
|
|
268
|
-
notifyChange() {
|
|
269
|
-
for (const listener of this.listeners) {
|
|
270
|
-
listener();
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
const applySelectionToStyledLine = (line, range) => {
|
|
275
|
-
if (line.length === 0 || range.start >= range.end) {
|
|
276
|
-
return line;
|
|
277
|
-
}
|
|
278
|
-
const result = line.clone();
|
|
279
|
-
const selStart = Math.max(0, range.start);
|
|
280
|
-
const selEnd = Math.min(line.length, range.end);
|
|
281
|
-
for (let i = selStart; i < selEnd; i++) {
|
|
282
|
-
result.setInverted(i, true);
|
|
283
|
-
}
|
|
284
|
-
return result;
|
|
285
|
-
};
|
|
286
|
-
|
|
287
|
-
export { Range, Selection, applySelectionToStyledLine, comparePoints };
|
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useRef, useCallback, useLayoutEffect, isValidElement, useImperativeHandle, Fragment } from 'react';
|
|
3
|
-
import { m as measureElement } from './measure-element-Bc6PEaIe.js';
|
|
4
|
-
import Box from './Box-W1w_NGin.js';
|
|
5
|
-
|
|
6
|
-
const useStateRef = (initialValue) => {
|
|
7
|
-
const [state, setStateInternal] = useState(initialValue);
|
|
8
|
-
const ref = useRef(initialValue);
|
|
9
|
-
const setState = useCallback((update) => {
|
|
10
|
-
const nextValue = typeof update === "function" ? update(ref.current) : update;
|
|
11
|
-
ref.current = nextValue;
|
|
12
|
-
setStateInternal(nextValue);
|
|
13
|
-
}, []);
|
|
14
|
-
const getState = useCallback(() => ref.current, []);
|
|
15
|
-
return [state, setState, getState];
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const MeasurableItem = ({
|
|
19
|
-
children,
|
|
20
|
-
index,
|
|
21
|
-
measureKey,
|
|
22
|
-
onMeasure,
|
|
23
|
-
width
|
|
24
|
-
}) => {
|
|
25
|
-
const ref = useRef(null);
|
|
26
|
-
useLayoutEffect(() => {
|
|
27
|
-
if (ref.current) {
|
|
28
|
-
const { height } = measureElement(ref.current);
|
|
29
|
-
onMeasure(index, height);
|
|
30
|
-
}
|
|
31
|
-
}, [index, onMeasure, width, measureKey, children]);
|
|
32
|
-
return jsx(Box, { flexDirection: "column", flexShrink: 0, ref, width: "100%", children });
|
|
33
|
-
};
|
|
34
|
-
const toChildArray = (children) => {
|
|
35
|
-
if (children == null) {
|
|
36
|
-
return [];
|
|
37
|
-
}
|
|
38
|
-
if (Array.isArray(children)) {
|
|
39
|
-
const result = [];
|
|
40
|
-
for (let index = 0; index < children.length; index += 1) {
|
|
41
|
-
const child = children[index];
|
|
42
|
-
if (isValidElement(child) && child.type === Fragment) {
|
|
43
|
-
result.push(...toChildArray(child.props.children));
|
|
44
|
-
} else {
|
|
45
|
-
result.push(child);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
if (isValidElement(children) && children.type === Fragment) {
|
|
51
|
-
return toChildArray(children.props.children);
|
|
52
|
-
}
|
|
53
|
-
return [children];
|
|
54
|
-
};
|
|
55
|
-
const ControlledScrollView = ({
|
|
56
|
-
children,
|
|
57
|
-
debug = false,
|
|
58
|
-
onContentHeightChange,
|
|
59
|
-
onItemHeightChange,
|
|
60
|
-
onViewportSizeChange,
|
|
61
|
-
overscan = 3,
|
|
62
|
-
ref,
|
|
63
|
-
scrollOffset,
|
|
64
|
-
virtualize = false,
|
|
65
|
-
...boxProps
|
|
66
|
-
}) => {
|
|
67
|
-
const hasMeasuredRef = useRef(false);
|
|
68
|
-
const [viewportSize, setViewportSize, getViewportSize] = useStateRef({
|
|
69
|
-
height: 0,
|
|
70
|
-
width: 0
|
|
71
|
-
});
|
|
72
|
-
const [contentHeight, setContentHeight, getContentHeight] = useStateRef(0);
|
|
73
|
-
const [itemMeasureKeys, setItemMeasureKeys] = useState({});
|
|
74
|
-
const viewportRef = useRef(null);
|
|
75
|
-
const previousContentHeightRef = useRef(0);
|
|
76
|
-
useLayoutEffect(() => {
|
|
77
|
-
if (contentHeight !== previousContentHeightRef.current) {
|
|
78
|
-
onContentHeightChange?.(contentHeight, previousContentHeightRef.current);
|
|
79
|
-
previousContentHeightRef.current = contentHeight;
|
|
80
|
-
}
|
|
81
|
-
}, [contentHeight, onContentHeightChange]);
|
|
82
|
-
const itemHeightsRef = useRef({});
|
|
83
|
-
const itemKeysRef = useRef([]);
|
|
84
|
-
const itemOffsetsRef = useRef([]);
|
|
85
|
-
const firstInvalidOffsetIndexRef = useRef(0);
|
|
86
|
-
const handleItemMeasure = useCallback(
|
|
87
|
-
(index, height) => {
|
|
88
|
-
const key = itemKeysRef.current[index] ?? index;
|
|
89
|
-
if (itemHeightsRef.current[key] !== height) {
|
|
90
|
-
const previousHeight = itemHeightsRef.current[key] ?? 0;
|
|
91
|
-
itemHeightsRef.current = {
|
|
92
|
-
...itemHeightsRef.current,
|
|
93
|
-
[key]: height
|
|
94
|
-
};
|
|
95
|
-
let newTotalHeight = 0;
|
|
96
|
-
for (let i = 0; i < itemKeysRef.current.length; i += 1) {
|
|
97
|
-
const itemKey = itemKeysRef.current[i];
|
|
98
|
-
if (itemKey != null) {
|
|
99
|
-
newTotalHeight += itemHeightsRef.current[itemKey] ?? 0;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const currentHeight = getContentHeight();
|
|
103
|
-
if (newTotalHeight !== currentHeight) {
|
|
104
|
-
setContentHeight(newTotalHeight);
|
|
105
|
-
}
|
|
106
|
-
onItemHeightChange?.(index, height, previousHeight);
|
|
107
|
-
firstInvalidOffsetIndexRef.current = Math.min(firstInvalidOffsetIndexRef.current, index + 1);
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
[onItemHeightChange, getContentHeight, setContentHeight]
|
|
111
|
-
);
|
|
112
|
-
const measureViewport = useCallback(() => {
|
|
113
|
-
if (viewportRef.current) {
|
|
114
|
-
const { height, width } = measureElement(viewportRef.current);
|
|
115
|
-
const currentSize = getViewportSize();
|
|
116
|
-
if (width !== currentSize.width || height !== currentSize.height) {
|
|
117
|
-
onViewportSizeChange?.({ height, width }, currentSize);
|
|
118
|
-
setViewportSize({ height, width });
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}, [viewportRef, onViewportSizeChange, getViewportSize, setViewportSize]);
|
|
122
|
-
useLayoutEffect(() => {
|
|
123
|
-
measureViewport();
|
|
124
|
-
});
|
|
125
|
-
const previousChildrenRef = useRef(null);
|
|
126
|
-
if (previousChildrenRef.current !== children) {
|
|
127
|
-
previousChildrenRef.current = children;
|
|
128
|
-
const newItemKeys = [];
|
|
129
|
-
const newItemHeights = {};
|
|
130
|
-
const childArray2 = toChildArray(children);
|
|
131
|
-
childArray2.forEach((child, index) => {
|
|
132
|
-
if (!child) {
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const key = isValidElement(child) ? child.key : null;
|
|
136
|
-
const effectiveKey = key ?? index;
|
|
137
|
-
newItemKeys[index] = effectiveKey;
|
|
138
|
-
const itemHeight = itemHeightsRef.current[effectiveKey] ?? 0;
|
|
139
|
-
newItemHeights[effectiveKey] = itemHeight;
|
|
140
|
-
});
|
|
141
|
-
itemHeightsRef.current = newItemHeights;
|
|
142
|
-
itemKeysRef.current = newItemKeys;
|
|
143
|
-
itemOffsetsRef.current = Array.from({ length: newItemKeys.length }).fill(0);
|
|
144
|
-
firstInvalidOffsetIndexRef.current = 0;
|
|
145
|
-
let newTotalHeight = 0;
|
|
146
|
-
newItemKeys.forEach((itemKey) => {
|
|
147
|
-
newTotalHeight += newItemHeights[itemKey] ?? 0;
|
|
148
|
-
});
|
|
149
|
-
const currentHeight = getContentHeight();
|
|
150
|
-
if (newTotalHeight !== currentHeight) {
|
|
151
|
-
setContentHeight(newTotalHeight);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
useImperativeHandle(ref, () => {
|
|
155
|
-
return {
|
|
156
|
-
getBottomOffset: () => Math.max(0, getContentHeight() - getViewportSize().height),
|
|
157
|
-
getContentHeight,
|
|
158
|
-
getItemHeight: (index) => {
|
|
159
|
-
const key = itemKeysRef.current[index] ?? index;
|
|
160
|
-
return itemHeightsRef.current[key] ?? 0;
|
|
161
|
-
},
|
|
162
|
-
getItemPosition: (index) => {
|
|
163
|
-
if (index < 0 || index >= itemKeysRef.current.length) {
|
|
164
|
-
return null;
|
|
165
|
-
}
|
|
166
|
-
if (index >= firstInvalidOffsetIndexRef.current) {
|
|
167
|
-
let currentOffset = 0;
|
|
168
|
-
let startIndex = 0;
|
|
169
|
-
if (firstInvalidOffsetIndexRef.current > 0) {
|
|
170
|
-
startIndex = firstInvalidOffsetIndexRef.current;
|
|
171
|
-
const previousIndex = startIndex - 1;
|
|
172
|
-
const previousKey = itemKeysRef.current[previousIndex] ?? previousIndex;
|
|
173
|
-
const previousHeight = itemHeightsRef.current[previousKey] ?? 0;
|
|
174
|
-
currentOffset = (itemOffsetsRef.current[previousIndex] ?? 0) + previousHeight;
|
|
175
|
-
}
|
|
176
|
-
for (let i = startIndex; i <= index; i += 1) {
|
|
177
|
-
itemOffsetsRef.current[i] = currentOffset;
|
|
178
|
-
const key2 = itemKeysRef.current[i] ?? i;
|
|
179
|
-
const height2 = itemHeightsRef.current[key2] ?? 0;
|
|
180
|
-
currentOffset += height2;
|
|
181
|
-
}
|
|
182
|
-
firstInvalidOffsetIndexRef.current = index + 1;
|
|
183
|
-
}
|
|
184
|
-
const top = itemOffsetsRef.current[index] ?? 0;
|
|
185
|
-
const key = itemKeysRef.current[index] ?? index;
|
|
186
|
-
const height = itemHeightsRef.current[key] ?? 0;
|
|
187
|
-
return { height, top };
|
|
188
|
-
},
|
|
189
|
-
getViewportHeight: () => getViewportSize().height,
|
|
190
|
-
remeasure: measureViewport,
|
|
191
|
-
remeasureItem: (index) => {
|
|
192
|
-
setItemMeasureKeys((previous) => {
|
|
193
|
-
return {
|
|
194
|
-
...previous,
|
|
195
|
-
[index]: (previous[index] ?? 0) + 1
|
|
196
|
-
};
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
};
|
|
200
|
-
}, [measureViewport, getContentHeight, getViewportSize, setItemMeasureKeys]);
|
|
201
|
-
const childArray = toChildArray(children);
|
|
202
|
-
if (!hasMeasuredRef.current && contentHeight > 0) {
|
|
203
|
-
hasMeasuredRef.current = true;
|
|
204
|
-
}
|
|
205
|
-
let firstRenderIndex = 0;
|
|
206
|
-
let lastRenderIndex = childArray.length - 1;
|
|
207
|
-
let aboveSpacerHeight = 0;
|
|
208
|
-
let belowSpacerHeight = 0;
|
|
209
|
-
const allItemsMeasured = childArray.length > 0 && childArray.every((_, index) => {
|
|
210
|
-
const key = itemKeysRef.current[index] ?? index;
|
|
211
|
-
return (itemHeightsRef.current[key] ?? 0) > 0;
|
|
212
|
-
});
|
|
213
|
-
const shouldVirtualize = virtualize && hasMeasuredRef.current && allItemsMeasured;
|
|
214
|
-
if (shouldVirtualize) {
|
|
215
|
-
const totalItems = itemKeysRef.current.length;
|
|
216
|
-
if (firstInvalidOffsetIndexRef.current < totalItems) {
|
|
217
|
-
let currentOffset = 0;
|
|
218
|
-
let startIndex = 0;
|
|
219
|
-
if (firstInvalidOffsetIndexRef.current > 0) {
|
|
220
|
-
startIndex = firstInvalidOffsetIndexRef.current;
|
|
221
|
-
const previousIndex = startIndex - 1;
|
|
222
|
-
const previousKey = itemKeysRef.current[previousIndex] ?? previousIndex;
|
|
223
|
-
const previousHeight = itemHeightsRef.current[previousKey] ?? 0;
|
|
224
|
-
currentOffset = (itemOffsetsRef.current[previousIndex] ?? 0) + previousHeight;
|
|
225
|
-
}
|
|
226
|
-
for (let i = startIndex; i < totalItems; i += 1) {
|
|
227
|
-
itemOffsetsRef.current[i] = currentOffset;
|
|
228
|
-
const key = itemKeysRef.current[i] ?? i;
|
|
229
|
-
currentOffset += itemHeightsRef.current[key] ?? 0;
|
|
230
|
-
}
|
|
231
|
-
firstInvalidOffsetIndexRef.current = totalItems;
|
|
232
|
-
}
|
|
233
|
-
const viewEnd = scrollOffset + viewportSize.height;
|
|
234
|
-
firstRenderIndex = childArray.length;
|
|
235
|
-
lastRenderIndex = -1;
|
|
236
|
-
for (let i = 0; i < totalItems; i += 1) {
|
|
237
|
-
const itemTop = itemOffsetsRef.current[i] ?? 0;
|
|
238
|
-
const key = itemKeysRef.current[i] ?? i;
|
|
239
|
-
const itemHeight = itemHeightsRef.current[key] ?? 0;
|
|
240
|
-
const itemBottom = itemTop + itemHeight;
|
|
241
|
-
if (itemBottom > scrollOffset && itemTop < viewEnd) {
|
|
242
|
-
if (i < firstRenderIndex) {
|
|
243
|
-
firstRenderIndex = i;
|
|
244
|
-
}
|
|
245
|
-
lastRenderIndex = i;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
if (firstRenderIndex > lastRenderIndex) {
|
|
249
|
-
firstRenderIndex = 0;
|
|
250
|
-
lastRenderIndex = -1;
|
|
251
|
-
}
|
|
252
|
-
firstRenderIndex = Math.max(0, firstRenderIndex - overscan);
|
|
253
|
-
lastRenderIndex = Math.min(childArray.length - 1, Math.max(-1, lastRenderIndex) + overscan);
|
|
254
|
-
aboveSpacerHeight = itemOffsetsRef.current[firstRenderIndex] ?? 0;
|
|
255
|
-
if (lastRenderIndex < childArray.length - 1) {
|
|
256
|
-
const lastKey = itemKeysRef.current[lastRenderIndex] ?? lastRenderIndex;
|
|
257
|
-
const lastItemBottom = (itemOffsetsRef.current[lastRenderIndex] ?? 0) + (itemHeightsRef.current[lastKey] ?? 0);
|
|
258
|
-
belowSpacerHeight = contentHeight - lastItemBottom;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
return jsx(Box, { ...boxProps, children: jsx(Box, { ref: viewportRef, width: "100%", children: jsx(Box, { overflow: debug ? void 0 : "hidden", width: "100%", children: jsxs(Box, { flexDirection: "column", marginTop: -scrollOffset, width: "100%", children: [
|
|
262
|
-
shouldVirtualize && aboveSpacerHeight > 0 && jsx(Box, { height: aboveSpacerHeight }),
|
|
263
|
-
childArray.map((child, index) => {
|
|
264
|
-
if (!child) {
|
|
265
|
-
return null;
|
|
266
|
-
}
|
|
267
|
-
if (shouldVirtualize && (index < firstRenderIndex || index > lastRenderIndex)) {
|
|
268
|
-
return null;
|
|
269
|
-
}
|
|
270
|
-
return jsx(
|
|
271
|
-
MeasurableItem,
|
|
272
|
-
{
|
|
273
|
-
index,
|
|
274
|
-
measureKey: itemMeasureKeys[index],
|
|
275
|
-
onMeasure: handleItemMeasure,
|
|
276
|
-
width: viewportSize.width,
|
|
277
|
-
children: child
|
|
278
|
-
},
|
|
279
|
-
isValidElement(child) ? child.key ?? index : index
|
|
280
|
-
);
|
|
281
|
-
}),
|
|
282
|
-
shouldVirtualize && belowSpacerHeight > 0 && jsx(Box, { height: belowSpacerHeight })
|
|
283
|
-
] }) }) }) });
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
export { ControlledScrollView as C, useStateRef as u };
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { createDecMode, setMode, resetMode, BracketedPasteMode, cursorUp, cursorToColumn1, cursorHide, REQUEST_CURSOR_POSITION, cursorPosition, eraseLine, cursorShow } from '@visulima/ansi';
|
|
2
|
-
import { terminalSize, Renderer } from './Renderer-zZ5O3vxc.js';
|
|
3
|
-
|
|
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);
|
|
9
|
-
function createInlineLoop(paint, options = {}) {
|
|
10
|
-
const reservedRows = options.rows ?? 10;
|
|
11
|
-
const fps = options.fps ?? 60;
|
|
12
|
-
const onExit = options.onExit ?? "preserve";
|
|
13
|
-
let interval = null;
|
|
14
|
-
let renderer = null;
|
|
15
|
-
let buf = null;
|
|
16
|
-
let cols = 80;
|
|
17
|
-
let renderRows = 10;
|
|
18
|
-
let frame = 0;
|
|
19
|
-
let regionTopRow = 1;
|
|
20
|
-
function write(s) {
|
|
21
|
-
renderer.writeRaw(s);
|
|
22
|
-
}
|
|
23
|
-
function tick() {
|
|
24
|
-
buf.fill(0);
|
|
25
|
-
paint(buf, cols, renderRows, frame++);
|
|
26
|
-
write(DEC_2026_ON);
|
|
27
|
-
try {
|
|
28
|
-
renderer.render(buf);
|
|
29
|
-
} finally {
|
|
30
|
-
write(DEC_2026_OFF);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
function startRendering(cursorRow) {
|
|
34
|
-
regionTopRow = cursorRow - renderRows;
|
|
35
|
-
write(cursorUp(renderRows) + cursorToColumn1);
|
|
36
|
-
renderer.setRowOffset(regionTopRow);
|
|
37
|
-
tick();
|
|
38
|
-
interval = setInterval(
|
|
39
|
-
() => {
|
|
40
|
-
tick();
|
|
41
|
-
},
|
|
42
|
-
Math.round(1e3 / fps)
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
function start() {
|
|
46
|
-
const size = terminalSize();
|
|
47
|
-
cols = size.cols;
|
|
48
|
-
const termRows = size.rows;
|
|
49
|
-
renderRows = Math.min(reservedRows, termRows);
|
|
50
|
-
if (process.stdin.isTTY) {
|
|
51
|
-
process.stdin.setRawMode(true);
|
|
52
|
-
}
|
|
53
|
-
process.stdin.resume();
|
|
54
|
-
process.stdin.setEncoding("utf8");
|
|
55
|
-
renderer = new Renderer(cols, renderRows);
|
|
56
|
-
buf = new Uint32Array(cols * renderRows * 2);
|
|
57
|
-
write(cursorHide);
|
|
58
|
-
write(enableBracketedPaste);
|
|
59
|
-
write("\n".repeat(renderRows));
|
|
60
|
-
write(REQUEST_CURSOR_POSITION);
|
|
61
|
-
process.on("SIGINT", stop);
|
|
62
|
-
let cprBuf = "";
|
|
63
|
-
const onData = (chunk) => {
|
|
64
|
-
cprBuf += chunk;
|
|
65
|
-
const m = cprBuf.match(/\u001B\[(\d+);(\d+)R/);
|
|
66
|
-
if (m) {
|
|
67
|
-
process.stdin.off("data", onData);
|
|
68
|
-
startRendering(Number.parseInt(m[1], 10));
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
process.stdin.on("data", onData);
|
|
72
|
-
}
|
|
73
|
-
function stop() {
|
|
74
|
-
if (interval) {
|
|
75
|
-
clearInterval(interval);
|
|
76
|
-
interval = null;
|
|
77
|
-
}
|
|
78
|
-
if (renderer) {
|
|
79
|
-
if (onExit === "destroy") {
|
|
80
|
-
for (let i = 0; i < renderRows; i++) {
|
|
81
|
-
write(cursorPosition(regionTopRow + 1 + i, 1) + eraseLine);
|
|
82
|
-
}
|
|
83
|
-
write(cursorPosition(regionTopRow + 1, 1));
|
|
84
|
-
} else {
|
|
85
|
-
write(cursorPosition(regionTopRow + renderRows + 1, 1));
|
|
86
|
-
}
|
|
87
|
-
write(disableBracketedPaste);
|
|
88
|
-
write(cursorShow);
|
|
89
|
-
}
|
|
90
|
-
if (process.stdin.isTTY) {
|
|
91
|
-
process.stdin.setRawMode(false);
|
|
92
|
-
}
|
|
93
|
-
process.stdin.pause();
|
|
94
|
-
process.exit(0);
|
|
95
|
-
}
|
|
96
|
-
return { start, stop };
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export { createInlineLoop };
|