@visulima/tui 1.0.0-alpha.5 → 1.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/core/index.js +1 -5
- package/dist/ink/index.d.ts +17 -36
- 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.d.ts +1 -1
- package/dist/testing/index.js +1 -152
- package/package.json +10 -10
- 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
- package/dist/packem_shared/{render.d-CNIzVQTh.d.ts → render.d-BR3gA-N8.d.ts} +4 -4
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import colorizeDefault from '@visulima/colorize';
|
|
3
|
-
import { useContext, useCallback } from 'react';
|
|
4
|
-
import { c as colorize } from './colorize-88_Vk8cn.js';
|
|
5
|
-
import { a as accessibilityContext } from './accessibility-context-BLelHhNU.js';
|
|
6
|
-
import { b as backgroundContext } from './background-context-BAUaxfOb.js';
|
|
7
|
-
|
|
8
|
-
function Text({
|
|
9
|
-
"aria-hidden": ariaHidden = false,
|
|
10
|
-
"aria-label": ariaLabel,
|
|
11
|
-
backgroundColor,
|
|
12
|
-
bold = false,
|
|
13
|
-
children,
|
|
14
|
-
color,
|
|
15
|
-
dimColor = false,
|
|
16
|
-
inverse = false,
|
|
17
|
-
italic = false,
|
|
18
|
-
strikethrough = false,
|
|
19
|
-
underline = false,
|
|
20
|
-
wrap = "wrap"
|
|
21
|
-
}) {
|
|
22
|
-
const { isScreenReaderEnabled } = useContext(accessibilityContext);
|
|
23
|
-
const inheritedBackgroundColor = useContext(backgroundContext);
|
|
24
|
-
const childrenOrAriaLabel = isScreenReaderEnabled && ariaLabel ? ariaLabel : children;
|
|
25
|
-
const transform = useCallback(
|
|
26
|
-
(children2) => {
|
|
27
|
-
if (dimColor) {
|
|
28
|
-
children2 = colorizeDefault.dim(children2);
|
|
29
|
-
}
|
|
30
|
-
if (color) {
|
|
31
|
-
children2 = colorize(children2, color, "foreground");
|
|
32
|
-
}
|
|
33
|
-
const effectiveBackgroundColor = backgroundColor ?? inheritedBackgroundColor;
|
|
34
|
-
if (effectiveBackgroundColor) {
|
|
35
|
-
children2 = colorize(children2, effectiveBackgroundColor, "background");
|
|
36
|
-
}
|
|
37
|
-
if (bold) {
|
|
38
|
-
children2 = colorizeDefault.bold(children2);
|
|
39
|
-
}
|
|
40
|
-
if (italic) {
|
|
41
|
-
children2 = colorizeDefault.italic(children2);
|
|
42
|
-
}
|
|
43
|
-
if (underline) {
|
|
44
|
-
children2 = colorizeDefault.underline(children2);
|
|
45
|
-
}
|
|
46
|
-
if (strikethrough) {
|
|
47
|
-
children2 = colorizeDefault.strikethrough(children2);
|
|
48
|
-
}
|
|
49
|
-
if (inverse) {
|
|
50
|
-
children2 = colorizeDefault.inverse(children2);
|
|
51
|
-
}
|
|
52
|
-
return children2;
|
|
53
|
-
},
|
|
54
|
-
[dimColor, color, backgroundColor, inheritedBackgroundColor, bold, italic, underline, strikethrough, inverse]
|
|
55
|
-
);
|
|
56
|
-
if (childrenOrAriaLabel === void 0 || childrenOrAriaLabel === null) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
if (isScreenReaderEnabled && ariaHidden) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
return jsx("ink-text", { internal_transform: transform, style: { flexDirection: "row", flexGrow: 0, flexShrink: 1, textWrap: wrap }, children: isScreenReaderEnabled && ariaLabel ? ariaLabel : children });
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export { Text as default };
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useRef, useCallback } from 'react';
|
|
3
|
-
import useInput from './useInput-DKZbqMRc.js';
|
|
4
|
-
import { i as isInsertableInput } from './input-utils-ViAEXa0Z.js';
|
|
5
|
-
import Box from './Box-W1w_NGin.js';
|
|
6
|
-
import Text from './Text-CtUwV89_.js';
|
|
7
|
-
|
|
8
|
-
const KILL_WORD_PATTERN = /\S+\s*$/;
|
|
9
|
-
const findSuggestion = (value, suggestions) => {
|
|
10
|
-
if (value.length === 0 || !suggestions) {
|
|
11
|
-
return void 0;
|
|
12
|
-
}
|
|
13
|
-
const match = suggestions.find((s) => s.startsWith(value));
|
|
14
|
-
return match?.slice(value.length) ?? void 0;
|
|
15
|
-
};
|
|
16
|
-
const NAV_NOT_HANDLED = -1;
|
|
17
|
-
const handleNavigation = (input, key, cursor, valueLength) => {
|
|
18
|
-
if (key.leftArrow) {
|
|
19
|
-
return Math.max(0, cursor - 1);
|
|
20
|
-
}
|
|
21
|
-
if (key.home || key.ctrl && input === "a") {
|
|
22
|
-
return 0;
|
|
23
|
-
}
|
|
24
|
-
if (key.end || key.ctrl && input === "e") {
|
|
25
|
-
return valueLength;
|
|
26
|
-
}
|
|
27
|
-
return NAV_NOT_HANDLED;
|
|
28
|
-
};
|
|
29
|
-
const handleEditing = (input, key, currentValue, cursor) => {
|
|
30
|
-
if (key.backspace && cursor > 0) {
|
|
31
|
-
return [currentValue.slice(0, cursor - 1) + currentValue.slice(cursor), cursor - 1];
|
|
32
|
-
}
|
|
33
|
-
if (key.delete && cursor < currentValue.length) {
|
|
34
|
-
return [currentValue.slice(0, cursor) + currentValue.slice(cursor + 1), cursor];
|
|
35
|
-
}
|
|
36
|
-
if (key.ctrl && input === "u") {
|
|
37
|
-
return [currentValue.slice(cursor), 0];
|
|
38
|
-
}
|
|
39
|
-
if (key.ctrl && input === "k") {
|
|
40
|
-
return [currentValue.slice(0, cursor), cursor];
|
|
41
|
-
}
|
|
42
|
-
if (key.ctrl && input === "w") {
|
|
43
|
-
const before = currentValue.slice(0, cursor);
|
|
44
|
-
const trimmed = before.replace(KILL_WORD_PATTERN, "");
|
|
45
|
-
return [trimmed + currentValue.slice(cursor), trimmed.length];
|
|
46
|
-
}
|
|
47
|
-
return void 0;
|
|
48
|
-
};
|
|
49
|
-
function TextInput({ defaultValue = "", isDisabled = false, mask = false, onChange, onSubmit, placeholder, suggestions }) {
|
|
50
|
-
const [value, setValueRaw] = useState(defaultValue);
|
|
51
|
-
const [cursor, setCursor] = useState(defaultValue.length);
|
|
52
|
-
const valueRef = useRef(value);
|
|
53
|
-
valueRef.current = value;
|
|
54
|
-
const cursorRef = useRef(cursor);
|
|
55
|
-
cursorRef.current = cursor;
|
|
56
|
-
const onChangeRef = useRef(onChange);
|
|
57
|
-
onChangeRef.current = onChange;
|
|
58
|
-
const onSubmitRef = useRef(onSubmit);
|
|
59
|
-
onSubmitRef.current = onSubmit;
|
|
60
|
-
const suggestion = findSuggestion(value, suggestions);
|
|
61
|
-
const inputHandler = useCallback(
|
|
62
|
-
(input, key) => {
|
|
63
|
-
const { current } = cursorRef;
|
|
64
|
-
const currentValue = valueRef.current;
|
|
65
|
-
if (key.return) {
|
|
66
|
-
const currentSuggestion = findSuggestion(currentValue, suggestions);
|
|
67
|
-
const finalValue = currentSuggestion ? currentValue + currentSuggestion : currentValue;
|
|
68
|
-
if (currentSuggestion) {
|
|
69
|
-
setValueRaw(finalValue);
|
|
70
|
-
setCursor(finalValue.length);
|
|
71
|
-
onChangeRef.current?.(finalValue);
|
|
72
|
-
}
|
|
73
|
-
onSubmitRef.current?.(finalValue);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (key.escape) {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (key.rightArrow) {
|
|
80
|
-
const currentSuggestion = findSuggestion(currentValue, suggestions);
|
|
81
|
-
if (current === currentValue.length && currentSuggestion) {
|
|
82
|
-
const completed = currentValue + currentSuggestion;
|
|
83
|
-
setValueRaw(completed);
|
|
84
|
-
setCursor(completed.length);
|
|
85
|
-
onChangeRef.current?.(completed);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
setCursor(Math.min(currentValue.length, current + 1));
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const navResult = handleNavigation(input, key, current, currentValue.length);
|
|
92
|
-
if (navResult !== NAV_NOT_HANDLED) {
|
|
93
|
-
setCursor(navResult);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const editResult = handleEditing(input, key, currentValue, current);
|
|
97
|
-
if (editResult) {
|
|
98
|
-
const [newValue, newCursor] = editResult;
|
|
99
|
-
setValueRaw(newValue);
|
|
100
|
-
setCursor(newCursor);
|
|
101
|
-
onChangeRef.current?.(newValue);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (isInsertableInput(input, key)) {
|
|
105
|
-
const next = currentValue.slice(0, current) + input + currentValue.slice(current);
|
|
106
|
-
setValueRaw(next);
|
|
107
|
-
setCursor(current + input.length);
|
|
108
|
-
onChangeRef.current?.(next);
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
[suggestions]
|
|
112
|
-
);
|
|
113
|
-
useInput(inputHandler, { isActive: !isDisabled });
|
|
114
|
-
const displayValue = mask ? "*".repeat(value.length) : value;
|
|
115
|
-
const beforeCursor = displayValue.slice(0, cursor);
|
|
116
|
-
const atCursor = displayValue[cursor];
|
|
117
|
-
const afterCursor = displayValue.slice(cursor + 1);
|
|
118
|
-
if (isDisabled) {
|
|
119
|
-
return jsx(Box, { children: jsx(Text, { dimColor: true, children: displayValue || placeholder || "" }) });
|
|
120
|
-
}
|
|
121
|
-
if (value.length === 0 && placeholder) {
|
|
122
|
-
return jsxs(Box, { children: [
|
|
123
|
-
jsx(Text, { dimColor: true, inverse: true, children: placeholder[0] }),
|
|
124
|
-
jsx(Text, { dimColor: true, children: placeholder.slice(1) })
|
|
125
|
-
] });
|
|
126
|
-
}
|
|
127
|
-
return jsxs(Box, { children: [
|
|
128
|
-
jsxs(Text, { children: [
|
|
129
|
-
beforeCursor,
|
|
130
|
-
jsx(Text, { inverse: true, children: atCursor ?? " " }),
|
|
131
|
-
afterCursor
|
|
132
|
-
] }),
|
|
133
|
-
suggestion ? jsx(Text, { dimColor: true, children: suggestion }) : void 0
|
|
134
|
-
] });
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export { TextInput as default };
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useRef, useState, useEffect, useMemo, useCallback } from 'react';
|
|
3
|
-
import useClipboard from './useClipboard-MNj6MNR-.js';
|
|
4
|
-
import useInput from './useInput-DKZbqMRc.js';
|
|
5
|
-
import usePaste from './usePaste-png73gvT.js';
|
|
6
|
-
import useTextBuffer from './useTextBuffer-C8fEe9Ly.js';
|
|
7
|
-
import { i as isInsertableInput } from './input-utils-ViAEXa0Z.js';
|
|
8
|
-
import Box from './Box-W1w_NGin.js';
|
|
9
|
-
import Text from './Text-CtUwV89_.js';
|
|
10
|
-
|
|
11
|
-
const getOrderedSelection = (cursor, anchor) => {
|
|
12
|
-
if (anchor.line < cursor.line || anchor.line === cursor.line && anchor.col < cursor.col) {
|
|
13
|
-
return { endCol: cursor.col, endLine: cursor.line, startCol: anchor.col, startLine: anchor.line };
|
|
14
|
-
}
|
|
15
|
-
return { endCol: anchor.col, endLine: anchor.line, startCol: cursor.col, startLine: cursor.line };
|
|
16
|
-
};
|
|
17
|
-
function Textarea({
|
|
18
|
-
defaultValue = "",
|
|
19
|
-
isDisabled = false,
|
|
20
|
-
isFocused = true,
|
|
21
|
-
maxRows,
|
|
22
|
-
onChange,
|
|
23
|
-
onSubmit,
|
|
24
|
-
placeholder,
|
|
25
|
-
rows = 5,
|
|
26
|
-
showLineNumbers = false,
|
|
27
|
-
tabSize = 2
|
|
28
|
-
}) {
|
|
29
|
-
const buffer = useTextBuffer(defaultValue);
|
|
30
|
-
const bufferRef = useRef(buffer);
|
|
31
|
-
bufferRef.current = buffer;
|
|
32
|
-
const { copy } = useClipboard();
|
|
33
|
-
const [scrollOffset, setScrollOffset] = useState(0);
|
|
34
|
-
const onChangeRef = useRef(onChange);
|
|
35
|
-
onChangeRef.current = onChange;
|
|
36
|
-
const onSubmitRef = useRef(onSubmit);
|
|
37
|
-
onSubmitRef.current = onSubmit;
|
|
38
|
-
const previousValueRef = useRef(defaultValue);
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (buffer.value !== previousValueRef.current) {
|
|
41
|
-
previousValueRef.current = buffer.value;
|
|
42
|
-
onChangeRef.current?.(buffer.value);
|
|
43
|
-
}
|
|
44
|
-
}, [buffer.value]);
|
|
45
|
-
const visibleRows = useMemo(() => {
|
|
46
|
-
if (maxRows) {
|
|
47
|
-
return Math.min(Math.max(rows, buffer.lines.length), maxRows);
|
|
48
|
-
}
|
|
49
|
-
return rows;
|
|
50
|
-
}, [rows, maxRows, buffer.lines.length]);
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
setScrollOffset((offset) => {
|
|
53
|
-
if (buffer.cursor.line < offset) {
|
|
54
|
-
return buffer.cursor.line;
|
|
55
|
-
}
|
|
56
|
-
if (buffer.cursor.line >= offset + visibleRows) {
|
|
57
|
-
return buffer.cursor.line - visibleRows + 1;
|
|
58
|
-
}
|
|
59
|
-
return offset;
|
|
60
|
-
});
|
|
61
|
-
}, [buffer.cursor.line, visibleRows]);
|
|
62
|
-
const inputHandler = useCallback(
|
|
63
|
-
(input, key) => {
|
|
64
|
-
const b = bufferRef.current;
|
|
65
|
-
if (key.return && (key.meta || key.ctrl)) {
|
|
66
|
-
onSubmitRef.current?.(b.value);
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
if (key.return) {
|
|
70
|
-
b.newline();
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
if (key.escape) {
|
|
74
|
-
b.clearSelection();
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
if (key.tab) {
|
|
78
|
-
b.insert(" ".repeat(tabSize));
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (key.ctrl && input === "z") {
|
|
82
|
-
b.undo();
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (key.ctrl && (input === "y" || key.shift && input === "Z")) {
|
|
86
|
-
b.redo();
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (key.ctrl && input === "c" && b.hasSelection()) {
|
|
90
|
-
copy(b.getSelectedText());
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
if (key.ctrl && (input === "A" || input === "a" && key.shift)) {
|
|
94
|
-
b.selectAll();
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (key.upArrow) {
|
|
98
|
-
b.moveCursor("up", key.shift);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
if (key.downArrow) {
|
|
102
|
-
b.moveCursor("down", key.shift);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
if (key.leftArrow) {
|
|
106
|
-
b.moveCursor("left", key.shift);
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
if (key.rightArrow) {
|
|
110
|
-
b.moveCursor("right", key.shift);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (key.home) {
|
|
114
|
-
if (key.ctrl) {
|
|
115
|
-
b.moveToStart(key.shift);
|
|
116
|
-
} else {
|
|
117
|
-
b.moveToLineStart(key.shift);
|
|
118
|
-
}
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (key.end) {
|
|
122
|
-
if (key.ctrl) {
|
|
123
|
-
b.moveToEnd(key.shift);
|
|
124
|
-
} else {
|
|
125
|
-
b.moveToLineEnd(key.shift);
|
|
126
|
-
}
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
if (key.ctrl && input === "a") {
|
|
130
|
-
b.moveToLineStart(key.shift);
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
if (key.ctrl && input === "e") {
|
|
134
|
-
b.moveToLineEnd(key.shift);
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
if (key.backspace) {
|
|
138
|
-
b.deleteBack();
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
if (key.delete) {
|
|
142
|
-
b.deleteForward();
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
if (key.ctrl && input === "u") {
|
|
146
|
-
b.deleteToLineStart();
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
if (key.ctrl && input === "k") {
|
|
150
|
-
b.deleteToLineEnd();
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
if (key.ctrl && input === "w") {
|
|
154
|
-
b.deleteWord();
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
if (isInsertableInput(input, key)) {
|
|
158
|
-
if (b.hasSelection()) {
|
|
159
|
-
b.replaceSelection(input);
|
|
160
|
-
} else {
|
|
161
|
-
b.insert(input);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
[copy, tabSize]
|
|
166
|
-
);
|
|
167
|
-
useInput(inputHandler, { isActive: isFocused && !isDisabled });
|
|
168
|
-
const pasteHandler = useCallback((text) => {
|
|
169
|
-
const b = bufferRef.current;
|
|
170
|
-
if (b.hasSelection()) {
|
|
171
|
-
b.replaceSelection(text);
|
|
172
|
-
} else {
|
|
173
|
-
b.insert(text);
|
|
174
|
-
}
|
|
175
|
-
}, []);
|
|
176
|
-
usePaste(pasteHandler, { isActive: isFocused && !isDisabled });
|
|
177
|
-
const visibleLines = buffer.lines.slice(scrollOffset, scrollOffset + visibleRows);
|
|
178
|
-
const lineNumberWidth = showLineNumbers ? String(buffer.lines.length).length + 1 : 0;
|
|
179
|
-
const sel = buffer.anchor ? getOrderedSelection(buffer.cursor, buffer.anchor) : null;
|
|
180
|
-
if (isDisabled) {
|
|
181
|
-
return jsx(Box, { flexDirection: "column", children: visibleLines.map((line, index) => {
|
|
182
|
-
const lineNumber = scrollOffset + index;
|
|
183
|
-
return jsxs(Box, { children: [
|
|
184
|
-
showLineNumbers ? jsxs(Text, { dimColor: true, children: [
|
|
185
|
-
String(lineNumber + 1).padStart(lineNumberWidth),
|
|
186
|
-
" "
|
|
187
|
-
] }) : void 0,
|
|
188
|
-
jsx(Text, { dimColor: true, children: line || (lineNumber === 0 && placeholder ? placeholder : "") })
|
|
189
|
-
] }, lineNumber);
|
|
190
|
-
}) });
|
|
191
|
-
}
|
|
192
|
-
if (buffer.value.length === 0 && placeholder) {
|
|
193
|
-
const placeholderLines = placeholder.split("\n").slice(0, visibleRows);
|
|
194
|
-
return jsx(Box, { flexDirection: "column", children: placeholderLines.map((pLine, index) => jsxs(Box, { children: [
|
|
195
|
-
showLineNumbers ? jsxs(Text, { dimColor: true, children: [
|
|
196
|
-
String(index + 1).padStart(lineNumberWidth),
|
|
197
|
-
" "
|
|
198
|
-
] }) : void 0,
|
|
199
|
-
index === 0 ? jsxs(Text, { children: [
|
|
200
|
-
jsx(Text, { dimColor: true, inverse: true, children: pLine[0] ?? " " }),
|
|
201
|
-
jsx(Text, { dimColor: true, children: pLine.slice(1) })
|
|
202
|
-
] }) : jsx(Text, { dimColor: true, children: pLine })
|
|
203
|
-
] }, index)) });
|
|
204
|
-
}
|
|
205
|
-
return jsx(Box, { flexDirection: "column", children: visibleLines.map((line, index) => {
|
|
206
|
-
const lineNumber = scrollOffset + index;
|
|
207
|
-
const isCursorLine = lineNumber === buffer.cursor.line;
|
|
208
|
-
return jsxs(Box, { children: [
|
|
209
|
-
showLineNumbers ? jsxs(Text, { dimColor: !isCursorLine, children: [
|
|
210
|
-
String(lineNumber + 1).padStart(lineNumberWidth),
|
|
211
|
-
" "
|
|
212
|
-
] }) : void 0,
|
|
213
|
-
jsx(Text, { children: renderLine(line, lineNumber, buffer.cursor, sel) })
|
|
214
|
-
] }, lineNumber);
|
|
215
|
-
}) });
|
|
216
|
-
}
|
|
217
|
-
function renderLine(line, lineNumber, cursor, sel) {
|
|
218
|
-
const isCursorLine = lineNumber === cursor.line;
|
|
219
|
-
const cursorCol = isCursorLine ? cursor.col : -1;
|
|
220
|
-
const lineSelected = sel && lineNumber >= sel.startLine && lineNumber <= sel.endLine;
|
|
221
|
-
if (!lineSelected && !isCursorLine) {
|
|
222
|
-
return jsx(Fragment, { children: line });
|
|
223
|
-
}
|
|
224
|
-
if (!lineSelected) {
|
|
225
|
-
const before = line.slice(0, cursorCol);
|
|
226
|
-
const at = line[cursorCol];
|
|
227
|
-
const after = line.slice(cursorCol + 1);
|
|
228
|
-
return jsxs(Fragment, { children: [
|
|
229
|
-
before,
|
|
230
|
-
jsx(Text, { inverse: true, children: at ?? " " }),
|
|
231
|
-
after
|
|
232
|
-
] });
|
|
233
|
-
}
|
|
234
|
-
const selStart = lineNumber === sel.startLine ? sel.startCol : 0;
|
|
235
|
-
const selEnd = lineNumber === sel.endLine ? sel.endCol : line.length;
|
|
236
|
-
const beforeSel = line.slice(0, selStart);
|
|
237
|
-
const selected = line.slice(selStart, selEnd);
|
|
238
|
-
const afterSel = line.slice(selEnd);
|
|
239
|
-
if (isCursorLine && (cursorCol < selStart || cursorCol >= selEnd)) {
|
|
240
|
-
const parts = [];
|
|
241
|
-
let key = 0;
|
|
242
|
-
if (cursorCol < selStart) {
|
|
243
|
-
parts.push(jsx(Text, { children: line.slice(0, cursorCol) }, key++));
|
|
244
|
-
parts.push(
|
|
245
|
-
jsx(Text, { inverse: true, children: line[cursorCol] ?? " " }, key++)
|
|
246
|
-
);
|
|
247
|
-
parts.push(jsx(Text, { children: line.slice(cursorCol + 1, selStart) }, key++));
|
|
248
|
-
parts.push(
|
|
249
|
-
jsx(Text, { inverse: true, children: selected }, key++)
|
|
250
|
-
);
|
|
251
|
-
parts.push(jsx(Text, { children: afterSel }, key++));
|
|
252
|
-
} else {
|
|
253
|
-
parts.push(jsx(Text, { children: beforeSel }, key++));
|
|
254
|
-
parts.push(
|
|
255
|
-
jsx(Text, { inverse: true, children: selected }, key++)
|
|
256
|
-
);
|
|
257
|
-
parts.push(jsx(Text, { children: line.slice(selEnd, cursorCol) }, key++));
|
|
258
|
-
parts.push(
|
|
259
|
-
jsx(Text, { inverse: true, children: line[cursorCol] ?? " " }, key++)
|
|
260
|
-
);
|
|
261
|
-
parts.push(jsx(Text, { children: line.slice(cursorCol + 1) }, key++));
|
|
262
|
-
}
|
|
263
|
-
return jsx(Fragment, { children: parts });
|
|
264
|
-
}
|
|
265
|
-
return jsxs(Fragment, { children: [
|
|
266
|
-
beforeSel,
|
|
267
|
-
jsx(Text, { inverse: true, children: selected }),
|
|
268
|
-
afterSel
|
|
269
|
-
] });
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export { Textarea as default };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useImperativeHandle } from 'react';
|
|
3
|
-
import useTimer from './useTimer-DnBtbhB5.js';
|
|
4
|
-
import { f as formatDuration } from './format-time-BGmnDukX.js';
|
|
5
|
-
import Text from './Text-CtUwV89_.js';
|
|
6
|
-
|
|
7
|
-
const Timer = ({ autoStart, bold, color, duration, format = formatDuration, interval, onTimeout, ref }) => {
|
|
8
|
-
const timer = useTimer({ autoStart, duration, interval, onTimeout });
|
|
9
|
-
useImperativeHandle(ref, () => {
|
|
10
|
-
return {
|
|
11
|
-
reset: timer.reset,
|
|
12
|
-
start: timer.start,
|
|
13
|
-
stop: timer.stop,
|
|
14
|
-
toggle: timer.toggle
|
|
15
|
-
};
|
|
16
|
-
}, [timer.reset, timer.start, timer.stop, timer.toggle]);
|
|
17
|
-
return jsx(Text, { bold, color, children: format(timer.remaining) });
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export { Timer as default };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsxs, 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
|
-
import { V as VARIANT_CONFIG } from './variant-config-DSZoX5TM.js';
|
|
6
|
-
|
|
7
|
-
function Toast({ children, duration = 4e3, onDismiss, title, variant = "info", visible, width }) {
|
|
8
|
-
const [internalVisible, setInternalVisible] = useState(true);
|
|
9
|
-
const isVisible = visible ?? internalVisible;
|
|
10
|
-
const onDismissRef = useRef(onDismiss);
|
|
11
|
-
onDismissRef.current = onDismiss;
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
if (visible !== void 0 || duration <= 0 || !isVisible) {
|
|
14
|
-
return void 0;
|
|
15
|
-
}
|
|
16
|
-
const timer = setTimeout(() => {
|
|
17
|
-
setInternalVisible(false);
|
|
18
|
-
onDismissRef.current?.();
|
|
19
|
-
}, duration);
|
|
20
|
-
return () => {
|
|
21
|
-
clearTimeout(timer);
|
|
22
|
-
};
|
|
23
|
-
}, [duration, visible, isVisible]);
|
|
24
|
-
if (!isVisible) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const { color, icon } = VARIANT_CONFIG[variant];
|
|
28
|
-
return jsxs(Box, { borderColor: color, borderStyle: "round", gap: 1, paddingX: 1, width, children: [
|
|
29
|
-
jsx(Text, { color, children: icon }),
|
|
30
|
-
jsxs(Box, { flexDirection: "column", flexGrow: 1, children: [
|
|
31
|
-
title === void 0 ? void 0 : jsx(Text, { bold: true, children: title }),
|
|
32
|
-
jsx(Text, { children })
|
|
33
|
-
] })
|
|
34
|
-
] });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { Toast as default };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import Box from './Box-W1w_NGin.js';
|
|
3
|
-
import Text from './Text-CtUwV89_.js';
|
|
4
|
-
|
|
5
|
-
const PLACEMENT_STYLE = {
|
|
6
|
-
bottom: { flexDirection: "column", orderFirst: false },
|
|
7
|
-
left: { flexDirection: "row", orderFirst: true },
|
|
8
|
-
right: { flexDirection: "row", orderFirst: false },
|
|
9
|
-
top: { flexDirection: "column", orderFirst: true }
|
|
10
|
-
};
|
|
11
|
-
function Tooltip({ children, color = "gray", content, isVisible = true, placement = "right" }) {
|
|
12
|
-
const { flexDirection, orderFirst } = PLACEMENT_STYLE[placement];
|
|
13
|
-
const tooltip = isVisible ? jsx(
|
|
14
|
-
Box,
|
|
15
|
-
{
|
|
16
|
-
borderColor: color,
|
|
17
|
-
borderStyle: "round",
|
|
18
|
-
flexShrink: 0,
|
|
19
|
-
marginLeft: placement === "right" ? 1 : 0,
|
|
20
|
-
marginRight: placement === "left" ? 1 : 0,
|
|
21
|
-
paddingX: 1,
|
|
22
|
-
children: typeof content === "string" ? jsx(Text, { color, children: content }) : content
|
|
23
|
-
}
|
|
24
|
-
) : void 0;
|
|
25
|
-
return jsxs(Box, { alignItems: "center", flexDirection, children: [
|
|
26
|
-
orderFirst ? tooltip : void 0,
|
|
27
|
-
jsx(Box, { children }),
|
|
28
|
-
orderFirst ? void 0 : tooltip
|
|
29
|
-
] });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { Tooltip as default };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useContext } from 'react';
|
|
3
|
-
import { a as accessibilityContext } from './accessibility-context-BLelHhNU.js';
|
|
4
|
-
|
|
5
|
-
const TRANSFORM_STYLE = { flexDirection: "row", flexGrow: 0, flexShrink: 1 };
|
|
6
|
-
function Transform({ accessibilityLabel, children, transform }) {
|
|
7
|
-
const { isScreenReaderEnabled } = useContext(accessibilityContext);
|
|
8
|
-
if (children === void 0 || children === null) {
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
return jsx("ink-text", { internal_transform: transform, style: TRANSFORM_STYLE, children: isScreenReaderEnabled && accessibilityLabel ? accessibilityLabel : children });
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { Transform as default };
|
|
@@ -1,108 +0,0 @@
|
|
|
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 };
|