@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,153 +0,0 @@
|
|
|
1
|
-
import React, { createContext, useRef, useState, useCallback, useMemo, useContext, useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
const FocusContext = createContext({
|
|
4
|
-
activate() {
|
|
5
|
-
},
|
|
6
|
-
activeId: void 0,
|
|
7
|
-
add() {
|
|
8
|
-
},
|
|
9
|
-
deactivate() {
|
|
10
|
-
},
|
|
11
|
-
disableFocus() {
|
|
12
|
-
},
|
|
13
|
-
enableFocus() {
|
|
14
|
-
},
|
|
15
|
-
focus() {
|
|
16
|
-
},
|
|
17
|
-
focusNext() {
|
|
18
|
-
},
|
|
19
|
-
focusPrevious() {
|
|
20
|
-
},
|
|
21
|
-
remove() {
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
FocusContext.displayName = "TuiFocusContext";
|
|
25
|
-
const FocusProvider = ({ children }) => {
|
|
26
|
-
const itemsRef = useRef([]);
|
|
27
|
-
const [activeId, setActiveId] = useState(void 0);
|
|
28
|
-
const [isEnabled, setIsEnabled] = useState(true);
|
|
29
|
-
const add = useCallback((id, options) => {
|
|
30
|
-
if (itemsRef.current.some((e) => e.id === id)) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const entry = { autoFocus: options.autoFocus, id, isActive: true };
|
|
34
|
-
itemsRef.current = [...itemsRef.current, entry];
|
|
35
|
-
setActiveId((previous) => {
|
|
36
|
-
if (options.autoFocus && previous === void 0) {
|
|
37
|
-
return id;
|
|
38
|
-
}
|
|
39
|
-
if (itemsRef.current.filter((e) => e.isActive).length === 1 && previous === void 0) {
|
|
40
|
-
return id;
|
|
41
|
-
}
|
|
42
|
-
return previous;
|
|
43
|
-
});
|
|
44
|
-
}, []);
|
|
45
|
-
const remove = useCallback((id) => {
|
|
46
|
-
itemsRef.current = itemsRef.current.filter((e) => e.id !== id);
|
|
47
|
-
setActiveId((previous) => previous === id ? void 0 : previous);
|
|
48
|
-
}, []);
|
|
49
|
-
const activate = useCallback((id) => {
|
|
50
|
-
itemsRef.current = itemsRef.current.map((e) => e.id === id ? { ...e, isActive: true } : e);
|
|
51
|
-
}, []);
|
|
52
|
-
const deactivate = useCallback((id) => {
|
|
53
|
-
itemsRef.current = itemsRef.current.map((e) => e.id === id ? { ...e, isActive: false } : e);
|
|
54
|
-
setActiveId((previous) => previous === id ? void 0 : previous);
|
|
55
|
-
}, []);
|
|
56
|
-
const enableFocus = useCallback(() => setIsEnabled(true), []);
|
|
57
|
-
const disableFocus = useCallback(() => {
|
|
58
|
-
setIsEnabled(false);
|
|
59
|
-
setActiveId(void 0);
|
|
60
|
-
}, []);
|
|
61
|
-
const focusNext = useCallback(() => {
|
|
62
|
-
if (!isEnabled) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const active = itemsRef.current.filter((e) => e.isActive);
|
|
66
|
-
if (active.length === 0) {
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
setActiveId((previous) => {
|
|
70
|
-
if (previous === void 0) {
|
|
71
|
-
return active[0]?.id;
|
|
72
|
-
}
|
|
73
|
-
const index = active.findIndex((e) => e.id === previous);
|
|
74
|
-
return active[(index + 1) % active.length]?.id ?? active[0]?.id;
|
|
75
|
-
});
|
|
76
|
-
}, [isEnabled]);
|
|
77
|
-
const focusPrevious = useCallback(() => {
|
|
78
|
-
if (!isEnabled) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const active = itemsRef.current.filter((e) => e.isActive);
|
|
82
|
-
if (active.length === 0) {
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
setActiveId((previous) => {
|
|
86
|
-
if (previous === void 0) {
|
|
87
|
-
return active.at(-1)?.id;
|
|
88
|
-
}
|
|
89
|
-
const index = active.findIndex((e) => e.id === previous);
|
|
90
|
-
return active[(index - 1 + active.length) % active.length]?.id ?? active.at(-1)?.id;
|
|
91
|
-
});
|
|
92
|
-
}, [isEnabled]);
|
|
93
|
-
const focus = useCallback(
|
|
94
|
-
(id) => {
|
|
95
|
-
if (!isEnabled) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (itemsRef.current.some((e) => e.id === id && e.isActive)) {
|
|
99
|
-
setActiveId(id);
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
[isEnabled]
|
|
103
|
-
);
|
|
104
|
-
const value = useMemo(() => {
|
|
105
|
-
return {
|
|
106
|
-
activate,
|
|
107
|
-
activeId,
|
|
108
|
-
add,
|
|
109
|
-
deactivate,
|
|
110
|
-
disableFocus,
|
|
111
|
-
enableFocus,
|
|
112
|
-
focus,
|
|
113
|
-
focusNext,
|
|
114
|
-
focusPrevious,
|
|
115
|
-
remove
|
|
116
|
-
};
|
|
117
|
-
}, [activeId, add, remove, activate, deactivate, enableFocus, disableFocus, focusNext, focusPrevious, focus]);
|
|
118
|
-
return React.createElement(FocusContext.Provider, { value }, children);
|
|
119
|
-
};
|
|
120
|
-
const useFocus = ({ autoFocus = false, id: customId, isActive = true } = {}) => {
|
|
121
|
-
const { activate, activeId, add, deactivate, focus, remove } = useContext(FocusContext);
|
|
122
|
-
const id = useMemo(() => customId ?? Math.random().toString(36).slice(2, 7), [customId]);
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
add(id, { autoFocus });
|
|
125
|
-
return () => {
|
|
126
|
-
remove(id);
|
|
127
|
-
};
|
|
128
|
-
}, [id, autoFocus]);
|
|
129
|
-
useEffect(() => {
|
|
130
|
-
if (isActive) {
|
|
131
|
-
activate(id);
|
|
132
|
-
} else {
|
|
133
|
-
deactivate(id);
|
|
134
|
-
}
|
|
135
|
-
}, [isActive, id]);
|
|
136
|
-
return {
|
|
137
|
-
focus,
|
|
138
|
-
isFocused: Boolean(id) && activeId === id
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
const useFocusManager = () => {
|
|
142
|
-
const context = useContext(FocusContext);
|
|
143
|
-
return {
|
|
144
|
-
activeId: context.activeId,
|
|
145
|
-
disableFocus: context.disableFocus,
|
|
146
|
-
enableFocus: context.enableFocus,
|
|
147
|
-
focus: context.focus,
|
|
148
|
-
focusNext: context.focusNext,
|
|
149
|
-
focusPrevious: context.focusPrevious
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
export { FocusContext, FocusProvider, useFocus, useFocusManager };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import Box from './Box-W1w_NGin.js';
|
|
3
|
-
import Text from './Text-CtUwV89_.js';
|
|
4
|
-
|
|
5
|
-
const FormField = ({ children, description, error, isDisabled = false, label, required = false }) => jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
|
|
6
|
-
jsxs(Box, { children: [
|
|
7
|
-
jsx(Text, { bold: true, dimColor: isDisabled, children: label }),
|
|
8
|
-
required ? jsx(Text, { color: "red", children: " *" }) : void 0
|
|
9
|
-
] }),
|
|
10
|
-
jsx(Box, { marginTop: 0, children }),
|
|
11
|
-
error === void 0 ? description === void 0 ? void 0 : jsx(Text, { dimColor: true, children: description }) : jsx(Text, { color: "red", children: error })
|
|
12
|
-
] });
|
|
13
|
-
const Form = Object.assign(
|
|
14
|
-
({ accentColor = "blue", bordered = true, children, description, footer, title, width }) => {
|
|
15
|
-
const content = jsxs(Box, { flexDirection: "column", children: [
|
|
16
|
-
title === void 0 ? void 0 : jsx(Box, { marginBottom: 1, children: jsx(Text, { bold: true, color: accentColor, children: title }) }),
|
|
17
|
-
description === void 0 ? void 0 : jsx(Box, { marginBottom: 1, children: jsx(Text, { dimColor: true, children: description }) }),
|
|
18
|
-
jsx(Box, { flexDirection: "column", children }),
|
|
19
|
-
footer === void 0 ? void 0 : jsx(Box, { marginTop: 1, children: footer })
|
|
20
|
-
] });
|
|
21
|
-
if (!bordered) {
|
|
22
|
-
return jsx(Box, { flexDirection: "column", width, children: content });
|
|
23
|
-
}
|
|
24
|
-
return jsx(Box, { borderColor: accentColor, borderStyle: "round", flexDirection: "column", paddingX: 1, paddingY: 1, width, children: content });
|
|
25
|
-
},
|
|
26
|
-
{ Field: FormField }
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
export { FormField, Form as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import 'react';
|
|
3
|
-
import Box from './Box-W1w_NGin.js';
|
|
4
|
-
import useWindowSize from './useWindowSize-D3UU41mv.js';
|
|
5
|
-
|
|
6
|
-
const Fullscreen = ({ children }) => {
|
|
7
|
-
const { columns, rows } = useWindowSize();
|
|
8
|
-
return jsx(Box, { flexGrow: 1, height: rows, width: columns, children });
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export { Fullscreen as default };
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { c as createBrailleGrid } from './braille-BoEWoH2I.js';
|
|
4
|
-
import Box from './Box-W1w_NGin.js';
|
|
5
|
-
import Canvas from './Canvas-COttmLPX.js';
|
|
6
|
-
import Text from './Text-CtUwV89_.js';
|
|
7
|
-
|
|
8
|
-
const SIZES = {
|
|
9
|
-
large: { cols: 40, rows: 10 },
|
|
10
|
-
medium: { cols: 24, rows: 6 },
|
|
11
|
-
small: { cols: 16, rows: 4 }
|
|
12
|
-
};
|
|
13
|
-
const NEEDLE_RATIO = 0.9;
|
|
14
|
-
const ARC_ANGLE_STEPS_PER_PIXEL = 2;
|
|
15
|
-
const defaultFormat = (value) => String(Math.round(value));
|
|
16
|
-
const thresholdAtRatio = (thresholds, min, max, ratio) => {
|
|
17
|
-
const value = min + (max - min) * ratio;
|
|
18
|
-
for (const threshold of thresholds) {
|
|
19
|
-
if (value <= threshold.max) {
|
|
20
|
-
return threshold;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return thresholds[thresholds.length - 1];
|
|
24
|
-
};
|
|
25
|
-
function Gauge({
|
|
26
|
-
backgroundColor = "gray",
|
|
27
|
-
formatValue = defaultFormat,
|
|
28
|
-
label,
|
|
29
|
-
max = 100,
|
|
30
|
-
min = 0,
|
|
31
|
-
showLegend = false,
|
|
32
|
-
showValue = true,
|
|
33
|
-
size = "medium",
|
|
34
|
-
thresholds,
|
|
35
|
-
value
|
|
36
|
-
}) {
|
|
37
|
-
const { cols, rows } = SIZES[size];
|
|
38
|
-
const clampedValue = Math.max(min, Math.min(max, value));
|
|
39
|
-
const range = max - min || 1;
|
|
40
|
-
const ratio = (clampedValue - min) / range;
|
|
41
|
-
const sortedThresholds = useMemo(() => {
|
|
42
|
-
if (thresholds === void 0 || thresholds.length === 0) {
|
|
43
|
-
return void 0;
|
|
44
|
-
}
|
|
45
|
-
return [...thresholds].sort((a, b) => a.max - b.max);
|
|
46
|
-
}, [thresholds]);
|
|
47
|
-
const activeThreshold = useMemo(() => {
|
|
48
|
-
if (sortedThresholds === void 0) {
|
|
49
|
-
return void 0;
|
|
50
|
-
}
|
|
51
|
-
return thresholdAtRatio(sortedThresholds, min, max, ratio);
|
|
52
|
-
}, [sortedThresholds, min, max, ratio]);
|
|
53
|
-
const readout = formatValue(clampedValue);
|
|
54
|
-
return jsxs(Box, { flexDirection: "column", children: [
|
|
55
|
-
jsx(
|
|
56
|
-
Canvas,
|
|
57
|
-
{
|
|
58
|
-
draw: (context) => {
|
|
59
|
-
context.clear();
|
|
60
|
-
const pixelWidth = context.width * 2;
|
|
61
|
-
const pixelHeight = context.height * 4;
|
|
62
|
-
const cx = pixelWidth / 2;
|
|
63
|
-
const cy = pixelHeight - 1;
|
|
64
|
-
const rx = pixelWidth / 2 - 1;
|
|
65
|
-
const ry = pixelHeight - 1;
|
|
66
|
-
const radius = Math.max(1, Math.min(rx, ry));
|
|
67
|
-
const gridsByColor = /* @__PURE__ */ new Map();
|
|
68
|
-
const gridFor = (color) => {
|
|
69
|
-
const existing = gridsByColor.get(color);
|
|
70
|
-
if (existing !== void 0) {
|
|
71
|
-
return existing;
|
|
72
|
-
}
|
|
73
|
-
const grid = createBrailleGrid(context.width, context.height);
|
|
74
|
-
gridsByColor.set(color, grid);
|
|
75
|
-
return grid;
|
|
76
|
-
};
|
|
77
|
-
const arcSteps = Math.max(32, Math.round(Math.PI * radius) * ARC_ANGLE_STEPS_PER_PIXEL);
|
|
78
|
-
for (let step = 0; step <= arcSteps; step += 1) {
|
|
79
|
-
const stepRatio = step / arcSteps;
|
|
80
|
-
const angle = Math.PI * (1 - stepRatio);
|
|
81
|
-
const px = Math.round(cx + radius * Math.cos(angle));
|
|
82
|
-
const py = Math.round(cy - radius * Math.sin(angle));
|
|
83
|
-
let color;
|
|
84
|
-
if (stepRatio > ratio) {
|
|
85
|
-
color = backgroundColor;
|
|
86
|
-
} else if (sortedThresholds) {
|
|
87
|
-
const segment = thresholdAtRatio(sortedThresholds, min, max, stepRatio);
|
|
88
|
-
color = segment?.color ?? "cyan";
|
|
89
|
-
} else {
|
|
90
|
-
color = "cyan";
|
|
91
|
-
}
|
|
92
|
-
const grid = gridFor(color);
|
|
93
|
-
grid.plotPoint(px, py);
|
|
94
|
-
}
|
|
95
|
-
const needleRadius = radius * NEEDLE_RATIO;
|
|
96
|
-
const needleAngle = Math.PI * (1 - ratio);
|
|
97
|
-
const nx = Math.round(cx + needleRadius * Math.cos(needleAngle));
|
|
98
|
-
const ny = Math.round(cy - needleRadius * Math.sin(needleAngle));
|
|
99
|
-
const needleColor = activeThreshold?.color ?? "white";
|
|
100
|
-
const needleGrid = gridFor(needleColor);
|
|
101
|
-
needleGrid.plotLine(Math.round(cx), Math.round(cy), nx, ny);
|
|
102
|
-
for (const [color, grid] of gridsByColor) {
|
|
103
|
-
grid.flush(context, { color });
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
height: rows,
|
|
107
|
-
version: [value, min, max, size, thresholds, backgroundColor],
|
|
108
|
-
width: cols
|
|
109
|
-
}
|
|
110
|
-
),
|
|
111
|
-
showValue || label ? jsxs(Box, { flexDirection: "column", children: [
|
|
112
|
-
label === void 0 ? void 0 : jsx(Box, { justifyContent: "center", children: jsx(Text, { dimColor: true, children: label }) }),
|
|
113
|
-
showValue ? jsx(Box, { justifyContent: "center", children: jsx(Text, { bold: true, color: activeThreshold?.color ?? "white", children: readout }) }) : void 0
|
|
114
|
-
] }) : void 0,
|
|
115
|
-
showLegend && thresholds && thresholds.length > 0 ? jsx(Box, { gap: 2, justifyContent: "center", marginTop: 1, children: thresholds.map((threshold, index) => jsxs(Box, { gap: 1, children: [
|
|
116
|
-
jsx(Text, { color: threshold.color, children: "●" }),
|
|
117
|
-
jsx(Text, { dimColor: true, children: threshold.label ?? `≤ ${threshold.max}` })
|
|
118
|
-
] }, index)) }) : void 0
|
|
119
|
-
] });
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export { Gauge as default };
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { strip } from '@visulima/ansi';
|
|
3
|
-
import { multilineGradient } from '@visulima/colorize/gradient';
|
|
4
|
-
import { useMemo, Children, isValidElement, cloneElement } from 'react';
|
|
5
|
-
import Box from './Box-W1w_NGin.js';
|
|
6
|
-
import Text from './Text-CtUwV89_.js';
|
|
7
|
-
import Transform from './Transform-Cfyva2wd.js';
|
|
8
|
-
|
|
9
|
-
const presets = {
|
|
10
|
-
atlas: { colors: ["#feac5e", "#c779d0", "#4bc0c8"] },
|
|
11
|
-
cristal: { colors: ["#bdfff3", "#4ac29a"] },
|
|
12
|
-
fruit: { colors: ["#ff4e50", "#f9d423"] },
|
|
13
|
-
instagram: { colors: ["#833ab4", "#fd1d1d", "#fcb045"] },
|
|
14
|
-
mind: { colors: ["#473b7b", "#3584a7", "#30d2be"] },
|
|
15
|
-
morning: { colors: ["#ff5f6d", "#ffc371"], options: { interpolation: "hsv" } },
|
|
16
|
-
passion: { colors: ["#f43b47", "#453a94"] },
|
|
17
|
-
pastel: { colors: ["#74ebd5", "#74ecd5"], options: { hsvSpin: "long", interpolation: "hsv" } },
|
|
18
|
-
rainbow: { colors: ["#ff0000", "#ff0100"], options: { hsvSpin: "long", interpolation: "hsv" } },
|
|
19
|
-
retro: { colors: ["#3f51b1", "#5a55ae", "#7b5fac", "#8f6aae", "#a86aa4", "#cc6b8e", "#f18271", "#f3a469", "#f7c978"] },
|
|
20
|
-
summer: { colors: ["#fdbb2d", "#22c1c3"] },
|
|
21
|
-
teen: { colors: ["#77a1d3", "#79cbca", "#e684ae"] },
|
|
22
|
-
vice: { colors: ["#5ee7df", "#b490ca"], options: { interpolation: "hsv" } }
|
|
23
|
-
};
|
|
24
|
-
const containsBoxDescendant = (nodeChildren) => {
|
|
25
|
-
let hasBox = false;
|
|
26
|
-
const search = (value) => {
|
|
27
|
-
Children.forEach(value, (child) => {
|
|
28
|
-
if (hasBox) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
if (!isValidElement(child)) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
if (child.type === Box) {
|
|
35
|
-
hasBox = true;
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const childProps = child.props;
|
|
39
|
-
if (Object.hasOwn(childProps, "children")) {
|
|
40
|
-
search(childProps["children"]);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
search(nodeChildren);
|
|
45
|
-
return hasBox;
|
|
46
|
-
};
|
|
47
|
-
const hasChildrenProp = (properties) => Object.hasOwn(properties, "children");
|
|
48
|
-
const isPlainTextNode = (node) => typeof node === "string" || typeof node === "number";
|
|
49
|
-
const isNonRenderableChild = (node) => node === null || node === void 0 || typeof node === "boolean";
|
|
50
|
-
function Gradient({ children, colors, name }) {
|
|
51
|
-
if (name && colors) {
|
|
52
|
-
throw new Error("The `name` and `colors` props are mutually exclusive");
|
|
53
|
-
}
|
|
54
|
-
if (!name && !colors) {
|
|
55
|
-
throw new Error("Either `name` or `colors` prop must be provided");
|
|
56
|
-
}
|
|
57
|
-
const gradientFunction = useMemo(
|
|
58
|
-
() => name ? multilineGradient(presets[name].colors, presets[name].options) : multilineGradient(colors ?? []),
|
|
59
|
-
[name, colors]
|
|
60
|
-
);
|
|
61
|
-
const applyGradient = (text) => gradientFunction(strip(text));
|
|
62
|
-
const childrenCount = Children.count(children);
|
|
63
|
-
if (isPlainTextNode(children)) {
|
|
64
|
-
return jsx(Transform, { transform: applyGradient, children });
|
|
65
|
-
}
|
|
66
|
-
if (childrenCount === 1 && !containsBoxDescendant(children)) {
|
|
67
|
-
return jsx(Transform, { transform: applyGradient, children });
|
|
68
|
-
}
|
|
69
|
-
const applyGradientToChildren = (nodeChildren) => {
|
|
70
|
-
const nodes = [];
|
|
71
|
-
let bufferedText = "";
|
|
72
|
-
let nodeIndex = 0;
|
|
73
|
-
const createKey = () => {
|
|
74
|
-
const key = `gradient-node-${String(nodeIndex)}`;
|
|
75
|
-
nodeIndex += 1;
|
|
76
|
-
return key;
|
|
77
|
-
};
|
|
78
|
-
const pushTransformed = (node, key) => {
|
|
79
|
-
nodes.push(
|
|
80
|
-
jsx(Transform, { transform: applyGradient, children: node }, key)
|
|
81
|
-
);
|
|
82
|
-
};
|
|
83
|
-
const flushText = () => {
|
|
84
|
-
if (bufferedText === "") {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const text = bufferedText;
|
|
88
|
-
bufferedText = "";
|
|
89
|
-
pushTransformed(jsx(Text, { children: text }), createKey());
|
|
90
|
-
};
|
|
91
|
-
Children.forEach(nodeChildren, (child) => {
|
|
92
|
-
if (isNonRenderableChild(child)) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
if (isPlainTextNode(child)) {
|
|
96
|
-
bufferedText += String(child);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
flushText();
|
|
100
|
-
if (isValidElement(child)) {
|
|
101
|
-
const childKey = child.key ?? createKey();
|
|
102
|
-
const childProps = child.props;
|
|
103
|
-
if (child.type === Text) {
|
|
104
|
-
pushTransformed(child, childKey);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
if (child.type === Box) {
|
|
108
|
-
if (hasChildrenProp(childProps)) {
|
|
109
|
-
const childChildren = childProps["children"];
|
|
110
|
-
nodes.push(cloneElement(child, { key: childKey }, applyGradientToChildren(childChildren)));
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
nodes.push(cloneElement(child, { key: childKey }));
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
if (hasChildrenProp(childProps)) {
|
|
117
|
-
const childChildren = childProps["children"];
|
|
118
|
-
if (!containsBoxDescendant(childChildren)) {
|
|
119
|
-
pushTransformed(child, childKey);
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
nodes.push(cloneElement(child, { key: childKey }, applyGradientToChildren(childChildren)));
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
pushTransformed(child, childKey);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
nodes.push(child);
|
|
129
|
-
});
|
|
130
|
-
flushText();
|
|
131
|
-
return nodes;
|
|
132
|
-
};
|
|
133
|
-
return jsx(Fragment, { children: applyGradientToChildren(children) });
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export { Gradient as default };
|
|
@@ -1,29 +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 LEVEL_COLOR = {
|
|
6
|
-
1: "blueBright",
|
|
7
|
-
2: "cyanBright",
|
|
8
|
-
3: "magentaBright",
|
|
9
|
-
4: "yellowBright",
|
|
10
|
-
5: "green",
|
|
11
|
-
6: "white"
|
|
12
|
-
};
|
|
13
|
-
const LEVEL_PREFIX = {
|
|
14
|
-
1: "# ",
|
|
15
|
-
2: "## ",
|
|
16
|
-
3: "### ",
|
|
17
|
-
4: "#### ",
|
|
18
|
-
5: "##### ",
|
|
19
|
-
6: "###### "
|
|
20
|
-
};
|
|
21
|
-
function Heading({ children, color, level = 1, underline = false }) {
|
|
22
|
-
const resolvedColor = color ?? LEVEL_COLOR[level];
|
|
23
|
-
return jsx(Box, { flexDirection: "column", children: jsxs(Text, { bold: level <= 2, color: resolvedColor, underline, children: [
|
|
24
|
-
LEVEL_PREFIX[level],
|
|
25
|
-
children
|
|
26
|
-
] }) });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { Heading as default };
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import Box from './Box-W1w_NGin.js';
|
|
4
|
-
import Canvas from './Canvas-COttmLPX.js';
|
|
5
|
-
import Text from './Text-CtUwV89_.js';
|
|
6
|
-
|
|
7
|
-
const DEFAULT_PALETTE = ["#0b1e4f", "#1f3b96", "#3258c8", "#4e84ec", "#78b0ff"];
|
|
8
|
-
function Heatmap({
|
|
9
|
-
cellWidth = 2,
|
|
10
|
-
character = "█",
|
|
11
|
-
columnLabels,
|
|
12
|
-
data,
|
|
13
|
-
max: maxOverride,
|
|
14
|
-
min: minOverride,
|
|
15
|
-
palette = DEFAULT_PALETTE,
|
|
16
|
-
rowLabels,
|
|
17
|
-
textColor
|
|
18
|
-
}) {
|
|
19
|
-
const { cols, colWidth, extent, rows } = useMemo(() => {
|
|
20
|
-
const rowCount = data.length;
|
|
21
|
-
const colCount = data.reduce((widest, row) => Math.max(widest, row.length), 0);
|
|
22
|
-
let min = minOverride ?? Infinity;
|
|
23
|
-
let max = maxOverride ?? -Infinity;
|
|
24
|
-
if (minOverride === void 0 || maxOverride === void 0) {
|
|
25
|
-
for (const row of data) {
|
|
26
|
-
for (const value of row) {
|
|
27
|
-
if (minOverride === void 0 && value < min) {
|
|
28
|
-
min = value;
|
|
29
|
-
}
|
|
30
|
-
if (maxOverride === void 0 && value > max) {
|
|
31
|
-
max = value;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
cols: colCount,
|
|
38
|
-
colWidth: cellWidth,
|
|
39
|
-
extent: { max, min },
|
|
40
|
-
rows: rowCount
|
|
41
|
-
};
|
|
42
|
-
}, [data, minOverride, maxOverride, cellWidth]);
|
|
43
|
-
const width = cols * colWidth;
|
|
44
|
-
const height = rows;
|
|
45
|
-
return jsxs(Box, { children: [
|
|
46
|
-
rowLabels === void 0 ? void 0 : jsx(Box, { flexDirection: "column", marginRight: 1, children: Array.from({ length: rows }, (_, index) => jsx(Text, { dimColor: true, children: rowLabels[index] ?? "" }, index)) }),
|
|
47
|
-
jsxs(Box, { flexDirection: "column", children: [
|
|
48
|
-
jsx(
|
|
49
|
-
Canvas,
|
|
50
|
-
{
|
|
51
|
-
draw: (context) => {
|
|
52
|
-
context.clear();
|
|
53
|
-
const { max, min } = extent;
|
|
54
|
-
const range = max - min || 1;
|
|
55
|
-
const paletteLast = palette.length - 1;
|
|
56
|
-
for (let row = 0; row < rows; row += 1) {
|
|
57
|
-
for (let col = 0; col < cols; col += 1) {
|
|
58
|
-
const value = data[row]?.[col];
|
|
59
|
-
const background = value === void 0 ? void 0 : palette[Math.max(0, Math.min(paletteLast, Math.round((value - min) / range * paletteLast)))];
|
|
60
|
-
for (let offset = 0; offset < colWidth; offset += 1) {
|
|
61
|
-
context.setCell(col * colWidth + offset, row, character, {
|
|
62
|
-
background,
|
|
63
|
-
color: textColor
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
height,
|
|
70
|
-
version: [data, palette, cellWidth, minOverride, maxOverride],
|
|
71
|
-
width
|
|
72
|
-
}
|
|
73
|
-
),
|
|
74
|
-
columnLabels === void 0 ? void 0 : jsx(Box, { children: columnLabels.map((label, index) => jsx(Box, { width: colWidth, children: jsx(Text, { dimColor: true, wrap: "truncate-end", children: label }) }, index)) })
|
|
75
|
-
] })
|
|
76
|
-
] });
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export { Heatmap as default };
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import useWindowSize from './useWindowSize-D3UU41mv.js';
|
|
3
|
-
import Box from './Box-W1w_NGin.js';
|
|
4
|
-
import Text from './Text-CtUwV89_.js';
|
|
5
|
-
|
|
6
|
-
const keyLabels = {
|
|
7
|
-
backspace: "backspace",
|
|
8
|
-
delete: "del",
|
|
9
|
-
downArrow: "↓",
|
|
10
|
-
end: "end",
|
|
11
|
-
escape: "esc",
|
|
12
|
-
home: "home",
|
|
13
|
-
leftArrow: "←",
|
|
14
|
-
pageDown: "pgdn",
|
|
15
|
-
pageUp: "pgup",
|
|
16
|
-
return: "enter",
|
|
17
|
-
rightArrow: "→",
|
|
18
|
-
tab: "tab",
|
|
19
|
-
upArrow: "↑"
|
|
20
|
-
};
|
|
21
|
-
function formatKeyLabel(spec) {
|
|
22
|
-
const plusIndex = spec.indexOf("+");
|
|
23
|
-
if (plusIndex !== -1) {
|
|
24
|
-
const modifier = spec.slice(0, plusIndex);
|
|
25
|
-
const rest = spec.slice(plusIndex + 1);
|
|
26
|
-
return `${modifier}+${keyLabels[rest] ?? rest}`;
|
|
27
|
-
}
|
|
28
|
-
return keyLabels[spec] ?? spec;
|
|
29
|
-
}
|
|
30
|
-
function formatKeys(key) {
|
|
31
|
-
const keys = typeof key === "string" ? [key] : key;
|
|
32
|
-
return keys.map((k) => formatKeyLabel(k)).join("/");
|
|
33
|
-
}
|
|
34
|
-
function Help({ bindings, descriptionColor, keyColor = "cyan", maxColumns = 3, mode = "short", separator = " · " }) {
|
|
35
|
-
const { columns } = useWindowSize();
|
|
36
|
-
if (mode === "full") {
|
|
37
|
-
return renderFull(bindings, { columns, descriptionColor, keyColor, maxColumns });
|
|
38
|
-
}
|
|
39
|
-
return renderShort(bindings, { columns, descriptionColor, keyColor, separator });
|
|
40
|
-
}
|
|
41
|
-
function renderShort(bindings, options) {
|
|
42
|
-
const items = [];
|
|
43
|
-
let totalWidth = 0;
|
|
44
|
-
for (const [index, binding] of bindings.entries()) {
|
|
45
|
-
const keys = formatKeys(binding.key);
|
|
46
|
-
const pairText = `${keys} ${binding.description}`;
|
|
47
|
-
const separatorWidth = index > 0 ? options.separator.length : 0;
|
|
48
|
-
const pairWidth = separatorWidth + pairText.length;
|
|
49
|
-
if (totalWidth + pairWidth > options.columns && items.length > 0) {
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
if (index > 0) {
|
|
53
|
-
items.push(
|
|
54
|
-
jsx(Text, { dimColor: true, children: options.separator }, `sep-${index}`)
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
items.push(
|
|
58
|
-
jsxs(Box, { children: [
|
|
59
|
-
jsx(Text, { color: options.keyColor, children: keys }),
|
|
60
|
-
jsx(Text, { children: " " }),
|
|
61
|
-
options.descriptionColor ? jsx(Text, { color: options.descriptionColor, children: binding.description }) : jsx(Text, { dimColor: true, children: binding.description })
|
|
62
|
-
] }, `pair-${index}`)
|
|
63
|
-
);
|
|
64
|
-
totalWidth += pairWidth;
|
|
65
|
-
}
|
|
66
|
-
return jsx(Box, { flexDirection: "row", children: items });
|
|
67
|
-
}
|
|
68
|
-
function renderFull(bindings, options) {
|
|
69
|
-
const groups = /* @__PURE__ */ new Map();
|
|
70
|
-
for (const binding of bindings) {
|
|
71
|
-
const group = binding.group ?? "";
|
|
72
|
-
if (!groups.has(group)) {
|
|
73
|
-
groups.set(group, []);
|
|
74
|
-
}
|
|
75
|
-
groups.get(group).push(binding);
|
|
76
|
-
}
|
|
77
|
-
const groupEntries = [...groups.entries()];
|
|
78
|
-
const columnCount = Math.min(options.maxColumns, groupEntries.length || 1);
|
|
79
|
-
const columnWidth = Math.floor(options.columns / columnCount);
|
|
80
|
-
const columnNodes = [];
|
|
81
|
-
for (const [index, [groupName, groupBindings]] of groupEntries.entries()) {
|
|
82
|
-
const rows = [];
|
|
83
|
-
if (groupName) {
|
|
84
|
-
rows.push(
|
|
85
|
-
jsx(Text, { bold: true, children: groupName }, "title")
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
for (const [bIndex, binding] of groupBindings.entries()) {
|
|
89
|
-
const keys = formatKeys(binding.key);
|
|
90
|
-
rows.push(
|
|
91
|
-
jsxs(Box, { children: [
|
|
92
|
-
jsx(Text, { color: options.keyColor, children: keys }),
|
|
93
|
-
jsx(Text, { children: " " }),
|
|
94
|
-
options.descriptionColor ? jsx(Text, { color: options.descriptionColor, children: binding.description }) : jsx(Text, { dimColor: true, children: binding.description })
|
|
95
|
-
] }, `b-${bIndex}`)
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
columnNodes.push(
|
|
99
|
-
jsx(Box, { flexDirection: "column", width: columnWidth, children: rows }, `col-${index}`)
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
return jsx(Box, { flexDirection: "row", children: columnNodes });
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export { Help as default };
|