@visulima/tui 1.0.0-alpha.2 → 1.0.0-alpha.4
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 +59 -0
- package/LICENSE.md +63 -9
- package/README.md +6 -6
- package/dist/core/index.js +3 -3
- package/dist/ink/canvas/braille.d.ts +22 -0
- package/dist/ink/canvas/buffer.d.ts +67 -0
- package/dist/ink/components/accordion.d.ts +52 -0
- package/dist/ink/components/animate-presence.d.ts +15 -0
- package/dist/ink/components/approval-prompt.d.ts +55 -0
- package/dist/ink/components/area-chart.d.ts +54 -0
- package/dist/ink/components/bar-chart.d.ts +57 -0
- package/dist/ink/components/blink-dot.d.ts +30 -0
- package/dist/ink/components/breadcrumb.d.ts +28 -0
- package/dist/ink/components/button.d.ts +38 -0
- package/dist/ink/components/calendar.d.ts +60 -0
- package/dist/ink/components/canvas.d.ts +38 -0
- package/dist/ink/components/card.d.ts +46 -0
- package/dist/ink/components/chart-utils.d.ts +54 -0
- package/dist/ink/components/checkbox.d.ts +39 -0
- package/dist/ink/components/collapsible.d.ts +43 -0
- package/dist/ink/components/command-block.d.ts +38 -0
- package/dist/ink/components/command-palette.d.ts +72 -0
- package/dist/ink/components/confirm-dialog.d.ts +63 -0
- package/dist/ink/components/content-switcher.d.ts +49 -0
- package/dist/ink/components/date-picker.d.ts +53 -0
- package/dist/ink/components/definition-list.d.ts +37 -0
- package/dist/ink/components/divider.d.ts +40 -0
- package/dist/ink/components/file-picker/{FilePicker.d.ts → file-picker.d.ts} +2 -19
- package/dist/ink/components/file-picker/types.d.ts +1 -4
- package/dist/ink/components/file-picker/use-file-system.d.ts +1 -1
- package/dist/ink/components/form.d.ts +74 -0
- package/dist/ink/components/gauge.d.ts +75 -0
- package/dist/ink/components/heading.d.ts +27 -0
- package/dist/ink/components/heatmap.d.ts +51 -0
- package/dist/ink/components/{Help.d.ts → help.d.ts} +4 -9
- package/dist/ink/components/histogram.d.ts +52 -0
- package/dist/ink/components/kbd.d.ts +27 -0
- package/dist/ink/components/line-chart.d.ts +94 -0
- package/dist/ink/components/loading-indicator.d.ts +24 -0
- package/dist/ink/components/masked-input.d.ts +41 -0
- package/dist/ink/components/menu.d.ts +70 -0
- package/dist/ink/components/message-bubble.d.ts +35 -0
- package/dist/ink/components/model-badge.d.ts +32 -0
- package/dist/ink/components/operation-tree.d.ts +46 -0
- package/dist/ink/components/option-list.d.ts +41 -0
- package/dist/ink/components/{Paginator.d.ts → paginator.d.ts} +4 -20
- package/dist/ink/components/paragraph.d.ts +31 -0
- package/dist/ink/components/placeholder.d.ts +47 -0
- package/dist/ink/components/{ProgressBar.d.ts → progress-bar.d.ts} +1 -1
- package/dist/ink/components/radio-group.d.ts +62 -0
- package/dist/ink/components/scatter-plot.d.ts +23 -0
- package/dist/ink/components/scroll/{ControlledScrollView.d.ts → controlled-scroll-view.d.ts} +1 -1
- package/dist/ink/components/scroll/index.d.ts +10 -10
- package/dist/ink/components/scroll/{ScrollBarBox.d.ts → scroll-bar-box.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollBar.d.ts → scroll-bar.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollList.d.ts → scroll-list.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollView.d.ts → scroll-view.d.ts} +1 -1
- package/dist/ink/components/search-input.d.ts +46 -0
- package/dist/ink/components/{SelectInput.d.ts → select-input.d.ts} +2 -2
- package/dist/ink/components/shimmer-text.d.ts +39 -0
- package/dist/ink/components/sparkline.d.ts +30 -0
- package/dist/ink/components/{Spinner.d.ts → spinner.d.ts} +2 -4
- package/dist/ink/components/{StaticRender.d.ts → static-render.d.ts} +14 -2
- package/dist/ink/components/status-line.d.ts +30 -0
- package/dist/ink/components/stepper.d.ts +42 -0
- package/dist/ink/components/{Stopwatch.d.ts → stopwatch.d.ts} +5 -7
- package/dist/ink/components/streaming-text.d.ts +38 -0
- package/dist/ink/components/switch.d.ts +46 -0
- package/dist/ink/components/{Tabs.d.ts → tabs.d.ts} +1 -1
- package/dist/ink/components/tag.d.ts +30 -0
- package/dist/ink/components/{Timer.d.ts → timer.d.ts} +5 -7
- package/dist/ink/components/toast.d.ts +41 -0
- package/dist/ink/components/tooltip.d.ts +36 -0
- package/dist/ink/components/transition.d.ts +53 -0
- package/dist/ink/components/tree-view/theme.d.ts +2 -2
- package/dist/ink/cursor-helpers.d.ts +0 -3
- package/dist/ink/dom.d.ts +9 -8
- package/dist/ink/hooks/use-animation.d.ts +0 -2
- package/dist/ink/hooks/use-app.d.ts +1 -1
- package/dist/ink/hooks/use-focus-manager.d.ts +1 -1
- package/dist/ink/hooks/use-form.d.ts +70 -0
- package/dist/ink/hooks/use-hotkey.d.ts +37 -0
- package/dist/ink/hooks/use-interval.d.ts +25 -0
- package/dist/ink/hooks/use-key-bindings.d.ts +4 -6
- package/dist/ink/hooks/use-key-chord.d.ts +26 -0
- package/dist/ink/hooks/use-linked-scroll.d.ts +1 -1
- package/dist/ink/hooks/use-persistent-state.d.ts +56 -0
- package/dist/ink/hooks/use-stderr.d.ts +1 -1
- package/dist/ink/hooks/use-stdin.d.ts +1 -1
- package/dist/ink/hooks/use-stdout.d.ts +1 -1
- package/dist/ink/hooks/use-stopwatch.d.ts +1 -3
- package/dist/ink/hooks/use-timeout.d.ts +24 -0
- package/dist/ink/hooks/use-timer.d.ts +0 -2
- package/dist/ink/index.d.ts +228 -92
- package/dist/ink/index.js +132 -77
- package/dist/ink/ink.d.ts +7 -6
- package/dist/ink/mouse/constants.d.ts +5 -50
- package/dist/ink/mouse/index.d.ts +2 -2
- package/dist/ink/output.d.ts +2 -1
- package/dist/ink/styled-line.d.ts +10 -0
- package/dist/ink/write-synchronized.d.ts +2 -2
- package/dist/packem_shared/Accordion-BG-yfIkV.js +80 -0
- package/dist/packem_shared/{Alert-Dr3s_LD9.js → Alert-BLcwIW8V.js} +2 -2
- package/dist/packem_shared/AnimatePresence-D8nEOr_B.js +98 -0
- package/dist/packem_shared/ApprovalPrompt-BXdPros1.js +104 -0
- package/dist/packem_shared/AreaChart-CmTcxLum.js +116 -0
- package/dist/packem_shared/{Badge-Dk7EGGM6.js → Badge-CUfbXwAB.js} +1 -1
- package/dist/packem_shared/BarChart-DWRae67P.js +87 -0
- package/dist/packem_shared/{BigText-CjMdY63X.js → BigText-CVq2X7B5.js} +1 -1
- package/dist/packem_shared/BlinkDot-CrbHMR3L.js +11 -0
- package/dist/packem_shared/{Box-D_pSJ9Jp.js → Box-W1w_NGin.js} +4 -6
- package/dist/packem_shared/Breadcrumb-CPdNxVYs.js +26 -0
- package/dist/packem_shared/Button-CBmTbJ_D.js +57 -0
- package/dist/packem_shared/Calendar-C2Qxt-LA.js +139 -0
- package/dist/packem_shared/Canvas-COttmLPX.js +246 -0
- package/dist/packem_shared/Card-D3tGkNCm.js +24 -0
- package/dist/packem_shared/Checkbox-Dpy_4Lws.js +49 -0
- package/dist/packem_shared/{Code-DjQvPBD9.js → Code-CwzzbsLx.js} +3 -3
- package/dist/packem_shared/Collapsible-BMDrXf5C.js +45 -0
- package/dist/packem_shared/CommandBlock-jdOGJPjY.js +80 -0
- package/dist/packem_shared/CommandPalette-B5IfUQwi.js +146 -0
- package/dist/packem_shared/ConfirmDialog-5XJv3Cc4.js +67 -0
- package/dist/packem_shared/{ConfirmInput-85Y4kRQW.js → ConfirmInput-CxUS0XAA.js} +3 -3
- package/dist/packem_shared/{ConsoleOverlay-DBNa4vtj.js → ConsoleOverlay-BvnCEgjG.js} +2 -2
- package/dist/packem_shared/ContentSwitcher-BHFpO5Za.js +81 -0
- package/dist/packem_shared/ControlledScrollView-C2wOOlJO.js +5 -0
- package/dist/packem_shared/DatePicker-CPejKoqS.js +73 -0
- package/dist/packem_shared/DefinitionList-BAwr0l5J.js +18 -0
- package/dist/packem_shared/{DevTools-aMPIsaHx.js → DevTools-BdxRSkhL.js} +6 -4
- package/dist/packem_shared/{Dialog-DsSNAVgC.js → Dialog-S9r7Izff.js} +5 -5
- package/dist/packem_shared/{DiffView-hqaw-2S6.js → DiffView-BR4T6-Sj.js} +4 -4
- package/dist/packem_shared/Divider-DocXIqNn.js +30 -0
- package/dist/packem_shared/{FilePicker-DNwFxRhq.js → FilePicker-BZ55oF_n.js} +39 -32
- package/dist/packem_shared/FormField-BSG16cnA.js +29 -0
- package/dist/packem_shared/{Fullscreen-DrElAE1o.js → Fullscreen-DO7voOq5.js} +2 -2
- package/dist/packem_shared/Gauge-CKXUXxft.js +122 -0
- package/dist/packem_shared/{Gradient-Ql5P0GUd.js → Gradient-Dg0NezWc.js} +3 -3
- package/dist/packem_shared/Heading-BnR7McmP.js +29 -0
- package/dist/packem_shared/Heatmap-_jqISOU0.js +79 -0
- package/dist/packem_shared/{Help-6wanGG38.js → Help-0yZ_IcQg.js} +4 -11
- package/dist/packem_shared/Histogram-cgAjY5AJ.js +92 -0
- package/dist/packem_shared/{InputParser-BKHpWfvN.js → InputParser-BlsfeY9J.js} +8 -6
- package/dist/packem_shared/KEY-STOdi-nc.js +74 -0
- package/dist/packem_shared/Kbd-BNDXQgey.js +19 -0
- package/dist/packem_shared/{LayoutNode-Cjnsodiy.js → LayoutNode-DAkKg9TE.js} +5 -7
- package/dist/packem_shared/LineChart-ef3HF816.js +7 -0
- package/dist/packem_shared/{Link-COcKYfGT.js → Link-DZ2Tiq1m.js} +2 -2
- package/dist/packem_shared/LoadingIndicator-DzbLGfyJ.js +13 -0
- package/dist/packem_shared/{Markdown-y1ISztof.js → Markdown-33bpCUoe.js} +8 -8
- package/dist/packem_shared/MaskedInput-Ctr6v2dO.js +119 -0
- package/dist/packem_shared/Menu-CeKxhEix.js +112 -0
- package/dist/packem_shared/MessageBubble-BMoU8L2Q.js +26 -0
- package/dist/packem_shared/ModelBadge-CNIxPs7v.js +40 -0
- package/dist/packem_shared/{MouseProvider-Y9TSSEGl.js → MouseProvider-CekPbXCh.js} +3 -3
- package/dist/packem_shared/{MultiSelect-ChoLUcDI.js → MultiSelect-yz7-w0Zv.js} +4 -4
- package/dist/packem_shared/{NAMED_COLORS-a4QBvb5r.js → NAMED_COLORS-DcI3erCu.js} +79 -41
- package/dist/packem_shared/OperationTree-Dudx5o1o.js +67 -0
- package/dist/packem_shared/OptionList-CTyqQaZ1.js +24 -0
- package/dist/packem_shared/{OrderedList-Cp7pXr6m.js → OrderedList-VsvSmHUC.js} +2 -2
- package/dist/packem_shared/{Paginator-D1AuD-kj.js → Paginator-DmGogvEI.js} +44 -44
- package/dist/packem_shared/Paragraph-CNNhfepo.js +9 -0
- package/dist/packem_shared/Placeholder-DkM69Q8Z.js +29 -0
- package/dist/packem_shared/{ProgressBar-DOfpVagn.js → ProgressBar-B7cS4uQm.js} +2 -2
- package/dist/packem_shared/RadioGroup-B4F9PUyL.js +108 -0
- package/dist/packem_shared/{ResizeObserverEntry-Br4seLeQ.js → ResizeObserverEntry-Vr8GZ74x.js} +4 -4
- package/dist/packem_shared/ScatterPlot-CWOg4G5h.js +63 -0
- package/dist/packem_shared/{ScrollBar-EWAs2Uc7.js → ScrollBar-DFeWH43I.js} +2 -2
- package/dist/packem_shared/{ScrollBarBox-DTNNlh7R.js → ScrollBarBox-C7VL6Izd.js} +2 -2
- package/dist/packem_shared/{ScrollList-DCeIFL8M.js → ScrollList-DRcr_RrN.js} +2 -2
- package/dist/packem_shared/{ScrollView-v3MCNIyX.js → ScrollView-C6rdlGwU.js} +4 -4
- package/dist/packem_shared/SearchInput-cB8zFhSg.js +32 -0
- package/dist/packem_shared/{SelectInput-BN2TMyxp.js → SelectInput-WzZSqp72.js} +6 -6
- package/dist/packem_shared/{SelectInputIndicator-DkRMoH_b.js → SelectInputIndicator-DKeN6v5Z.js} +2 -2
- package/dist/packem_shared/{SelectInputItem-BF9LQgKu.js → SelectInputItem-CxFL3spM.js} +1 -1
- package/dist/packem_shared/ShimmerText-B2VbPUSB.js +34 -0
- package/dist/packem_shared/{Slider-BWD7xZX6.js → Slider-BOrNTOQe.js} +3 -3
- package/dist/packem_shared/{Spacer-Bs4ER-HK.js → Spacer-DhmXyTb8.js} +1 -1
- package/dist/packem_shared/Sparkline-BSbjPrwK.js +44 -0
- package/dist/packem_shared/Spinner-BcO5BCAa.js +1942 -0
- package/dist/packem_shared/StaticRender-C3XWvJdC.js +69 -0
- package/dist/packem_shared/StatusLine-DQNUstN9.js +22 -0
- package/dist/packem_shared/{StatusMessage-BtSYxzwb.js → StatusMessage-BYTL6Pl-.js} +2 -2
- package/dist/packem_shared/Stepper-CmUPRK3z.js +60 -0
- package/dist/packem_shared/Stopwatch-zqLQAxXC.js +21 -0
- package/dist/packem_shared/StreamingText-BmuoJtGu.js +38 -0
- package/dist/packem_shared/Switch-DcPdy8nm.js +59 -0
- package/dist/packem_shared/{Table-D-rSVlzb.js → Table-Bgxo87Df.js} +11 -5
- package/dist/packem_shared/{Tabs-hki-KRnx.js → Tabs-DubuHdYV.js} +30 -19
- package/dist/packem_shared/Tag-CCqM7Ee9.js +35 -0
- package/dist/packem_shared/{Text-DvAUdZcK.js → Text-CtUwV89_.js} +2 -2
- package/dist/packem_shared/{TextInput-C79WEQ5U.js → TextInput-C9r7zT0U.js} +3 -3
- package/dist/packem_shared/{Textarea-Dj06R6Zd.js → Textarea-CGmgt-Nl.js} +5 -5
- package/dist/packem_shared/Timer-D7ZZ0_wz.js +20 -0
- package/dist/packem_shared/Toast-DXSCXFPY.js +37 -0
- package/dist/packem_shared/Tooltip-SvVjj-2k.js +32 -0
- package/dist/packem_shared/{Transform-BHxY_dAM.js → Transform-Cfyva2wd.js} +1 -1
- package/dist/packem_shared/Transition-CbNfKhaj.js +108 -0
- package/dist/packem_shared/{TreeView-C2062dtj.js → TreeView-DGlZeSsK.js} +4 -4
- package/dist/packem_shared/{TuiApp-DfxOnXqi.js → TuiApp-DtdgNRWa.js} +4 -2
- package/dist/packem_shared/{TuiContext-CqEjMyXd.js → TuiContext-lXmJFd-x.js} +6 -3
- package/dist/packem_shared/{UnorderedList-DhnadWjX.js → UnorderedList-D8RPaEAW.js} +2 -2
- package/dist/packem_shared/{ansi-parser-0BdVTKho.js → ansi-parser-BOP8fNdT.js} +6 -4
- package/dist/packem_shared/braille-BoEWoH2I.js +93 -0
- package/dist/packem_shared/{comparePoints-CGMDnd3_.js → comparePoints-CAAlhiMS.js} +2 -2
- package/dist/packem_shared/{ControlledScrollView-BlOaxcsN.js → controlled-scroll-view-DJXfdWMm.js} +2 -2
- package/dist/packem_shared/{createInlineLoop-BxMmcq9D.js → createInlineLoop-Dnfm1ZSJ.js} +19 -13
- package/dist/packem_shared/createMemoryStorage-esFJ61La.js +115 -0
- package/dist/packem_shared/createScreen-Dh0sZlQ0.js +38 -0
- package/dist/packem_shared/{dom-DvzhsAez.js → dom-CrbpQgat.js} +17 -14
- package/dist/packem_shared/{getPathToRoot-a1wbwxfL.js → getPathToRoot-BbvlppLC.js} +2 -2
- package/dist/packem_shared/{getScrollHeight-BubfU_df.js → getScrollHeight-Cz3CDQN2.js} +5 -5
- package/dist/packem_shared/line-chart-VGU2l7pu.js +139 -0
- package/dist/packem_shared/{measure-element-Reza_yfC.js → measure-element-Bc6PEaIe.js} +26 -17
- package/dist/packem_shared/{measure-text-DItZYotK.js → measure-text-BdOhbOeh.js} +74 -7
- package/dist/packem_shared/{measureElement-CTgFCmKd.js → measureElement-DTELRaij.js} +2 -2
- package/dist/packem_shared/parseSgrMouse-4hpBJBsW.js +1 -0
- package/dist/packem_shared/{processLayout-BQ9kXfd3.js → processLayout-B0Coz0Ua.js} +1 -1
- package/dist/packem_shared/{reconciler-gfmqURLy.js → reconciler-Dd7Z0A97.js} +21 -5
- package/dist/packem_shared/{reconciler-BXf6miSS.js → reconciler-mzMwSOft.js} +23 -13
- package/dist/packem_shared/{render-BAwdjfki.js → render-Bm9Oa1sG.js} +72 -79
- package/dist/packem_shared/{render-Bpjhf0lD.js → render-CjlKdg4m.js} +15 -11
- package/dist/packem_shared/{renderToString-ClIaXgrC.js → renderToString-CWYS1ZXE.js} +4 -4
- package/dist/packem_shared/{renderToString-Cfg55DRD.js → renderToString-DB3ILWFm.js} +4 -4
- package/dist/packem_shared/{renderTreeToBuffer-D3mo7M7m.js → renderTreeToBuffer-CDDTGyZn.js} +8 -5
- package/dist/packem_shared/{renderer-B3wROkeg.js → renderer-GE9OLNNM.js} +47 -41
- package/dist/packem_shared/{setEnableStyledLineCache-BpskngSJ.js → setEnableStyledLineCache-D5f4favX.js} +1 -1
- package/dist/packem_shared/{text-width-DhuarWcB.js → text-width-Db-AxMea.js} +2 -1
- package/dist/packem_shared/{token-to-elements-BRFl_rzw.js → token-to-elements-CK4s8MJd.js} +2 -2
- package/dist/packem_shared/{useAnimation-kj31sA-T.js → useAnimation-DV22qxiJ.js} +2 -2
- package/dist/packem_shared/{useApp-DPQlRzi5.js → useApp-Cbi788rV.js} +1 -1
- package/dist/packem_shared/{useBoxMetrics-rBjKc-g4.js → useBoxMetrics-_5icypir.js} +2 -2
- package/dist/packem_shared/{useClipboard-B_9-adw1.js → useClipboard-MNj6MNR-.js} +1 -1
- package/dist/packem_shared/{useCursor-BIJzc8k9.js → useCursor-DS6LjIgv.js} +1 -1
- package/dist/packem_shared/{useFocus-CNl5QHHf.js → useFocus-DLoGQJd9.js} +2 -2
- package/dist/packem_shared/{useFocusManager-BPYaUuKQ.js → useFocusManager-UeZWtnNc.js} +1 -1
- package/dist/packem_shared/useForm-sQENbEuv.js +88 -0
- package/dist/packem_shared/useHotkey-D9giUX3q.js +112 -0
- package/dist/packem_shared/{useInput-Cfp5zB2s.js → useInput-DKZbqMRc.js} +2 -2
- package/dist/packem_shared/useInterval-CSXM8c2I.js +32 -0
- package/dist/packem_shared/{useIsScreenReaderEnabled-CnGKCe0f.js → useIsScreenReaderEnabled-BeoVqo1R.js} +1 -1
- package/dist/packem_shared/{useKeyBindings-B78l1E1n.js → useKeyBindings-S4fSIEAk.js} +2 -2
- package/dist/packem_shared/useKeyChord-BmXGNuEO.js +114 -0
- package/dist/packem_shared/{usePaste-Ct8J4AGR.js → usePaste-png73gvT.js} +2 -2
- package/dist/packem_shared/{useScrollInput-D3CpBq_a.js → useScrollInput-DfzRGQFe.js} +2 -2
- package/dist/packem_shared/{useStderr-CAOVUh4E.js → useStderr-BSWerMZ7.js} +1 -1
- package/dist/packem_shared/{useStdin-X-O0kd-n.js → useStdin-Rf0zPzVA.js} +1 -1
- package/dist/packem_shared/{useStdout-DyF6DSH0.js → useStdout-B5yRcg9N.js} +1 -1
- package/dist/packem_shared/{useStopwatch-qC4Beai4.js → useStopwatch-C__Zu6hd.js} +2 -2
- package/dist/packem_shared/{useTerminalPalette-BaWO2c4Q.js → useTerminalPalette-CtFG2JTq.js} +2 -2
- package/dist/packem_shared/{useTextSelection-mXtxgsPK.js → useTextSelection-ChrYZXsn.js} +2 -2
- package/dist/packem_shared/useTimeout-DuCqgWPX.js +34 -0
- package/dist/packem_shared/{useTimer-CPQ7j827.js → useTimer-DnBtbhB5.js} +1 -1
- package/dist/packem_shared/{useTreeView-BT57P3Kx.js → useTreeView-mkN5Di7w.js} +1 -1
- package/dist/packem_shared/{useWindowSize-ugEmGZJm.js → useWindowSize-D3UU41mv.js} +1 -1
- package/dist/packem_shared/waitFor-Cv9M2jKA.js +39 -0
- package/dist/packem_shared/{wrapOrTruncateStyledLine-DN3Nogoc.js → wrapOrTruncateStyledLine-49Mne3t3.js} +1 -1
- package/dist/react/index.js +7 -7
- package/dist/react/layout.d.ts +0 -2
- package/dist/testing/index.d.ts +4 -4
- package/dist/testing/index.js +6 -114
- package/dist/testing/wait-for.d.ts +0 -1
- package/index.js +691 -539
- package/package.json +17 -17
- package/dist/ink/components/file-picker/index.d.ts +0 -3
- package/dist/ink/components/tree-view/index.d.ts +0 -11
- package/dist/packem_shared/ControlledScrollView-DfAhcufF.js +0 -5
- package/dist/packem_shared/Spinner-BuI-kN4p.js +0 -1799
- package/dist/packem_shared/StaticRender-tYwH6QXl.js +0 -33
- package/dist/packem_shared/Stopwatch-DjtTCyHn.js +0 -23
- package/dist/packem_shared/Timer-wi9zuh4n.js +0 -22
- package/dist/packem_shared/parseSgrMouse-BHVBPP9G.js +0 -1
- /package/dist/ink/components/{AccessibilityContext.d.ts → accessibility-context.d.ts} +0 -0
- /package/dist/ink/components/{Alert.d.ts → alert.d.ts} +0 -0
- /package/dist/ink/components/{AnimationContext.d.ts → animation-context.d.ts} +0 -0
- /package/dist/ink/components/{AppContext.d.ts → app-context.d.ts} +0 -0
- /package/dist/ink/components/{App.d.ts → app.d.ts} +0 -0
- /package/dist/ink/components/{BackgroundContext.d.ts → background-context.d.ts} +0 -0
- /package/dist/ink/components/{Badge.d.ts → badge.d.ts} +0 -0
- /package/dist/ink/components/{BigText.d.ts → big-text.d.ts} +0 -0
- /package/dist/ink/components/{Box.d.ts → box.d.ts} +0 -0
- /package/dist/ink/components/{Code.d.ts → code.d.ts} +0 -0
- /package/dist/ink/components/{ConfirmInput.d.ts → confirm-input.d.ts} +0 -0
- /package/dist/ink/components/{ConsoleOverlay.d.ts → console-overlay.d.ts} +0 -0
- /package/dist/ink/components/{CursorContext.d.ts → cursor-context.d.ts} +0 -0
- /package/dist/ink/components/{Cursor.d.ts → cursor.d.ts} +0 -0
- /package/dist/ink/components/{Dialog.d.ts → dialog.d.ts} +0 -0
- /package/dist/ink/components/{DiffView.d.ts → diff-view.d.ts} +0 -0
- /package/dist/ink/components/{ErrorBoundary.d.ts → error-boundary.d.ts} +0 -0
- /package/dist/ink/components/{ErrorOverview.d.ts → error-overview.d.ts} +0 -0
- /package/dist/ink/components/{FocusContext.d.ts → focus-context.d.ts} +0 -0
- /package/dist/ink/components/{Gradient.d.ts → gradient.d.ts} +0 -0
- /package/dist/ink/components/{Link.d.ts → link.d.ts} +0 -0
- /package/dist/ink/components/{Markdown.d.ts → markdown.d.ts} +0 -0
- /package/dist/ink/components/{MultiSelect.d.ts → multi-select.d.ts} +0 -0
- /package/dist/ink/components/{Newline.d.ts → newline.d.ts} +0 -0
- /package/dist/ink/components/{OrderedList.d.ts → ordered-list.d.ts} +0 -0
- /package/dist/ink/components/{SelectInputIndicator.d.ts → select-input-indicator.d.ts} +0 -0
- /package/dist/ink/components/{SelectInputItem.d.ts → select-input-item.d.ts} +0 -0
- /package/dist/ink/components/{Slider.d.ts → slider.d.ts} +0 -0
- /package/dist/ink/components/{Spacer.d.ts → spacer.d.ts} +0 -0
- /package/dist/ink/components/{Static.d.ts → static.d.ts} +0 -0
- /package/dist/ink/components/{StatusMessage.d.ts → status-message.d.ts} +0 -0
- /package/dist/ink/components/{StderrContext.d.ts → stderr-context.d.ts} +0 -0
- /package/dist/ink/components/{StdinContext.d.ts → stdin-context.d.ts} +0 -0
- /package/dist/ink/components/{StdoutContext.d.ts → stdout-context.d.ts} +0 -0
- /package/dist/ink/components/{Tab.d.ts → tab.d.ts} +0 -0
- /package/dist/ink/components/{Table.d.ts → table.d.ts} +0 -0
- /package/dist/ink/components/{TextInput.d.ts → text-input.d.ts} +0 -0
- /package/dist/ink/components/{Text.d.ts → text.d.ts} +0 -0
- /package/dist/ink/components/{Textarea.d.ts → textarea.d.ts} +0 -0
- /package/dist/ink/components/{Transform.d.ts → transform.d.ts} +0 -0
- /package/dist/ink/components/tree-view/{TreeViewNode.d.ts → tree-view-node.d.ts} +0 -0
- /package/dist/ink/components/tree-view/{TreeView.d.ts → tree-view.d.ts} +0 -0
- /package/dist/ink/components/{UnorderedList.d.ts → unordered-list.d.ts} +0 -0
- /package/dist/ink/mouse/{Fullscreen.d.ts → fullscreen.d.ts} +0 -0
- /package/dist/ink/mouse/{MouseProvider.d.ts → mouse-provider.d.ts} +0 -0
- /package/dist/packem_shared/{AccessibilityContext-BLelHhNU.js → accessibility-context-BLelHhNU.js} +0 -0
- /package/dist/packem_shared/{AnimationContext-BcJg8Jr6.js → animation-context-BcJg8Jr6.js} +0 -0
- /package/dist/packem_shared/{AppContext-CP0U6H7O.js → app-context-CP0U6H7O.js} +0 -0
- /package/dist/packem_shared/{BackgroundContext-BAUaxfOb.js → background-context-BAUaxfOb.js} +0 -0
- /package/dist/packem_shared/{CursorContext-JxRzlqAx.js → cursor-context-JxRzlqAx.js} +0 -0
- /package/dist/packem_shared/{FocusContext-CWkYtgcm.js → focus-context-CWkYtgcm.js} +0 -0
- /package/dist/packem_shared/{StderrContext-Bj4Mf7v7.js → stderr-context-Bj4Mf7v7.js} +0 -0
- /package/dist/packem_shared/{StdinContext-Bq_GNJ3z.js → stdin-context-Bq_GNJ3z.js} +0 -0
- /package/dist/packem_shared/{StdoutContext-CgjWeCdO.js → stdout-context-CgjWeCdO.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import '@visulima/string';
|
|
2
|
-
export { c as clearStringWidthCache, a as clearStyledLineCache, m as default, i as inkCharacterWidth, k as measureStyledLine, s as setEnableStyledLineCache, b as setStringWidthFunction, l as splitStyledLineByNewline, d as styledLineWidth, t as toStyledLine } from './measure-text-
|
|
2
|
+
export { c as clearStringWidthCache, a as clearStyledLineCache, m as default, i as inkCharacterWidth, k as measureStyledLine, s as setEnableStyledLineCache, b as setStringWidthFunction, l as splitStyledLineByNewline, d as styledLineWidth, t as toStyledLine } from './measure-text-BdOhbOeh.js';
|
|
@@ -32,8 +32,9 @@ function measureTextBlock(text, wrapWidth) {
|
|
|
32
32
|
let wrappedRows = 0;
|
|
33
33
|
for (const line of lines) {
|
|
34
34
|
const lineWidth = getStringWidth(line);
|
|
35
|
-
if (lineWidth > maxLineWidth)
|
|
35
|
+
if (lineWidth > maxLineWidth) {
|
|
36
36
|
maxLineWidth = lineWidth;
|
|
37
|
+
}
|
|
37
38
|
wrappedRows += wrapWidth > 0 ? countWrappedRowsForLine(line, wrapWidth) : 0;
|
|
38
39
|
}
|
|
39
40
|
return { maxLineWidth, wrappedRows };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import Box from './Box-
|
|
3
|
-
import Text from './Text-
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
4
|
|
|
5
5
|
const LANGUAGE_IMPORT_MAP = {
|
|
6
6
|
bash: () => import('@shikijs/langs/bash'),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext, useState, useRef, useCallback, useLayoutEffect } from 'react';
|
|
2
|
-
import { a as animationContext } from './
|
|
2
|
+
import { a as animationContext } from './animation-context-BcJg8Jr6.js';
|
|
3
3
|
|
|
4
4
|
const defaultAnimationInterval = 100;
|
|
5
5
|
const maximumTimerInterval = 2147483647;
|
|
@@ -20,7 +20,7 @@ function useAnimation(options) {
|
|
|
20
20
|
}, []);
|
|
21
21
|
useLayoutEffect(() => {
|
|
22
22
|
if (!isActive) {
|
|
23
|
-
return;
|
|
23
|
+
return void 0;
|
|
24
24
|
}
|
|
25
25
|
setAnimState(zeroAnimState);
|
|
26
26
|
let startTime = 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useCallback, useEffect, useMemo } from 'react';
|
|
2
|
-
import { a as addLayoutListener } from './dom-
|
|
3
|
-
import useStdout from './useStdout-
|
|
2
|
+
import { a as addLayoutListener } from './dom-CrbpQgat.js';
|
|
3
|
+
import useStdout from './useStdout-B5yRcg9N.js';
|
|
4
4
|
|
|
5
5
|
const emptyMetrics = {
|
|
6
6
|
height: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, useCallback } from 'react';
|
|
2
2
|
import { isOsc52Supported, writeOsc52 } from './isOsc52Supported-G0k4sXJx.js';
|
|
3
|
-
import useStdout from './useStdout-
|
|
3
|
+
import useStdout from './useStdout-B5yRcg9N.js';
|
|
4
4
|
|
|
5
5
|
const useClipboard = (options = {}) => {
|
|
6
6
|
const { target = "c" } = options;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext, useRef, useCallback, useInsertionEffect } from 'react';
|
|
2
|
-
import { C as CursorContext } from './
|
|
2
|
+
import { C as CursorContext } from './cursor-context-JxRzlqAx.js';
|
|
3
3
|
|
|
4
4
|
const useCursor = () => {
|
|
5
5
|
const context = useContext(CursorContext);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext, useMemo, useEffect } from 'react';
|
|
2
|
-
import { F as FocusContext } from './
|
|
3
|
-
import useStdin from './useStdin-
|
|
2
|
+
import { F as FocusContext } from './focus-context-CWkYtgcm.js';
|
|
3
|
+
import useStdin from './useStdin-Rf0zPzVA.js';
|
|
4
4
|
|
|
5
5
|
const useFocus = ({ autoFocus = false, id: customId, isActive = true } = {}) => {
|
|
6
6
|
const { isRawModeSupported, setRawMode } = useStdin();
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { useMemo, useState, useRef, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
const deriveInitialValues = (fields) => {
|
|
4
|
+
const values = {};
|
|
5
|
+
for (const name of Object.keys(fields)) {
|
|
6
|
+
values[name] = fields[name].initialValue;
|
|
7
|
+
}
|
|
8
|
+
return values;
|
|
9
|
+
};
|
|
10
|
+
const useForm = (options) => {
|
|
11
|
+
const { fields, onSubmit } = options;
|
|
12
|
+
const initialValues = useMemo(() => deriveInitialValues(fields), [fields]);
|
|
13
|
+
const [values, setValues] = useState(initialValues);
|
|
14
|
+
const [errors, setErrors] = useState({});
|
|
15
|
+
const [touched, setTouchedState] = useState({});
|
|
16
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
17
|
+
const valuesRef = useRef(values);
|
|
18
|
+
valuesRef.current = values;
|
|
19
|
+
const validateField = useCallback(
|
|
20
|
+
(name, value, allValues = valuesRef.current) => {
|
|
21
|
+
const config = fields[name];
|
|
22
|
+
return config?.validate?.(value, allValues);
|
|
23
|
+
},
|
|
24
|
+
[fields]
|
|
25
|
+
);
|
|
26
|
+
const setValue = useCallback(
|
|
27
|
+
(name, value) => {
|
|
28
|
+
const nextValues = { ...valuesRef.current, [name]: value };
|
|
29
|
+
valuesRef.current = nextValues;
|
|
30
|
+
setValues(nextValues);
|
|
31
|
+
const error = validateField(name, value, nextValues);
|
|
32
|
+
setErrors((previous) => {
|
|
33
|
+
if (error === void 0) {
|
|
34
|
+
const next = { ...previous };
|
|
35
|
+
delete next[name];
|
|
36
|
+
return next;
|
|
37
|
+
}
|
|
38
|
+
return { ...previous, [name]: error };
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
[validateField]
|
|
42
|
+
);
|
|
43
|
+
const setTouched = useCallback((name, isTouched = true) => {
|
|
44
|
+
setTouchedState((previous) => {
|
|
45
|
+
return { ...previous, [name]: isTouched };
|
|
46
|
+
});
|
|
47
|
+
}, []);
|
|
48
|
+
const reset = useCallback(() => {
|
|
49
|
+
setValues(initialValues);
|
|
50
|
+
setErrors({});
|
|
51
|
+
setTouchedState({});
|
|
52
|
+
}, [initialValues]);
|
|
53
|
+
const submit = useCallback(async () => {
|
|
54
|
+
const nextErrors = {};
|
|
55
|
+
const nextTouched = {};
|
|
56
|
+
for (const key of Object.keys(fields)) {
|
|
57
|
+
nextTouched[key] = true;
|
|
58
|
+
const error = validateField(key, valuesRef.current[key]);
|
|
59
|
+
if (error !== void 0) {
|
|
60
|
+
nextErrors[key] = error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
setErrors(nextErrors);
|
|
64
|
+
setTouchedState(nextTouched);
|
|
65
|
+
if (Object.keys(nextErrors).length > 0) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
try {
|
|
69
|
+
setIsSubmitting(true);
|
|
70
|
+
await onSubmit?.(valuesRef.current);
|
|
71
|
+
return true;
|
|
72
|
+
} finally {
|
|
73
|
+
setIsSubmitting(false);
|
|
74
|
+
}
|
|
75
|
+
}, [fields, validateField, onSubmit]);
|
|
76
|
+
return {
|
|
77
|
+
errors,
|
|
78
|
+
isSubmitting,
|
|
79
|
+
reset,
|
|
80
|
+
setTouched,
|
|
81
|
+
setValue,
|
|
82
|
+
submit,
|
|
83
|
+
touched,
|
|
84
|
+
values
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export { useForm as default };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
3
|
+
|
|
4
|
+
const NAMED_KEYS = /* @__PURE__ */ new Set([
|
|
5
|
+
"backspace",
|
|
6
|
+
"delete",
|
|
7
|
+
"downArrow",
|
|
8
|
+
"end",
|
|
9
|
+
"escape",
|
|
10
|
+
"home",
|
|
11
|
+
"leftArrow",
|
|
12
|
+
"pageDown",
|
|
13
|
+
"pageUp",
|
|
14
|
+
"return",
|
|
15
|
+
"rightArrow",
|
|
16
|
+
"tab",
|
|
17
|
+
"upArrow"
|
|
18
|
+
]);
|
|
19
|
+
const parseShortcut = (shortcut) => {
|
|
20
|
+
const parts = shortcut.split("+").map((part) => part.trim()).filter((part) => part.length > 0);
|
|
21
|
+
const descriptor = {};
|
|
22
|
+
for (const part of parts) {
|
|
23
|
+
const lower = part.toLowerCase();
|
|
24
|
+
switch (lower) {
|
|
25
|
+
case "alt":
|
|
26
|
+
case "cmd":
|
|
27
|
+
case "meta": {
|
|
28
|
+
descriptor.meta = true;
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
case "control":
|
|
32
|
+
case "ctrl": {
|
|
33
|
+
descriptor.ctrl = true;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
case "shift": {
|
|
37
|
+
descriptor.shift = true;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
default: {
|
|
41
|
+
if (NAMED_KEYS.has(lower)) {
|
|
42
|
+
descriptor.name = lower;
|
|
43
|
+
} else {
|
|
44
|
+
switch (lower) {
|
|
45
|
+
case "down": {
|
|
46
|
+
descriptor.name = "downArrow";
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
case "enter": {
|
|
50
|
+
descriptor.name = "return";
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case "esc": {
|
|
54
|
+
descriptor.name = "escape";
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
case "left": {
|
|
58
|
+
descriptor.name = "leftArrow";
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case "right": {
|
|
62
|
+
descriptor.name = "rightArrow";
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case "up": {
|
|
66
|
+
descriptor.name = "upArrow";
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
default: {
|
|
70
|
+
descriptor.input = part;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return descriptor;
|
|
78
|
+
};
|
|
79
|
+
const matches = (descriptor, input, key) => {
|
|
80
|
+
if (descriptor.ctrl !== void 0 && descriptor.ctrl !== key.ctrl) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (descriptor.shift !== void 0 && descriptor.shift !== key.shift) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
if (descriptor.meta !== void 0 && descriptor.meta !== key.meta) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
if (descriptor.name !== void 0) {
|
|
90
|
+
return Boolean(key[descriptor.name]);
|
|
91
|
+
}
|
|
92
|
+
if (descriptor.input !== void 0) {
|
|
93
|
+
return input === descriptor.input;
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
};
|
|
97
|
+
const useHotkey = (shortcut, callback, options) => {
|
|
98
|
+
const descriptor = typeof shortcut === "string" ? parseShortcut(shortcut) : shortcut;
|
|
99
|
+
useInput(
|
|
100
|
+
useCallback(
|
|
101
|
+
(input, key) => {
|
|
102
|
+
if (matches(descriptor, input, key)) {
|
|
103
|
+
callback();
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
[shortcut, callback]
|
|
107
|
+
),
|
|
108
|
+
{ isActive: options?.isActive ?? true }
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export { useHotkey as default };
|
|
@@ -23,8 +23,8 @@ const {
|
|
|
23
23
|
Buffer
|
|
24
24
|
} = __cjs_getBuiltinModule("node:buffer");
|
|
25
25
|
import { kittyModifiers } from './kittyFlags-bNNf_9kX.js';
|
|
26
|
-
import { r as reconcilerInstance } from './reconciler-
|
|
27
|
-
import { useStdinContext } from './useStdin-
|
|
26
|
+
import { r as reconcilerInstance } from './reconciler-Dd7Z0A97.js';
|
|
27
|
+
import { useStdinContext } from './useStdin-Rf0zPzVA.js';
|
|
28
28
|
|
|
29
29
|
const metaKeyCodeRe = /^\u001B([a-z0-9])$/i;
|
|
30
30
|
const functionKeyRe = /^\u001B+([ON[]|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useRef, useLayoutEffect, useEffect, useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
const useInterval = (callback, interval, options) => {
|
|
4
|
+
const { isActive = true } = options ?? {};
|
|
5
|
+
const callbackRef = useRef(callback);
|
|
6
|
+
const timerRef = useRef(void 0);
|
|
7
|
+
useLayoutEffect(() => {
|
|
8
|
+
callbackRef.current = callback;
|
|
9
|
+
}, [callback]);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (!isActive || interval <= 0 || !Number.isFinite(interval)) {
|
|
12
|
+
return void 0;
|
|
13
|
+
}
|
|
14
|
+
const id = setInterval(() => {
|
|
15
|
+
callbackRef.current();
|
|
16
|
+
}, interval);
|
|
17
|
+
timerRef.current = id;
|
|
18
|
+
return () => {
|
|
19
|
+
clearInterval(id);
|
|
20
|
+
timerRef.current = void 0;
|
|
21
|
+
};
|
|
22
|
+
}, [interval, isActive]);
|
|
23
|
+
const clear = useCallback(() => {
|
|
24
|
+
if (timerRef.current !== void 0) {
|
|
25
|
+
clearInterval(timerRef.current);
|
|
26
|
+
timerRef.current = void 0;
|
|
27
|
+
}
|
|
28
|
+
}, []);
|
|
29
|
+
return { clear };
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { useInterval as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { a as accessibilityContext } from './
|
|
2
|
+
import { a as accessibilityContext } from './accessibility-context-BLelHhNU.js';
|
|
3
3
|
|
|
4
4
|
const useIsScreenReaderEnabled = () => {
|
|
5
5
|
const { isScreenReaderEnabled } = useContext(accessibilityContext);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRef, useCallback, useMemo } from 'react';
|
|
2
|
-
import useInput from './useInput-
|
|
2
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
3
3
|
|
|
4
4
|
const specialKeyFields = /* @__PURE__ */ new Set([
|
|
5
5
|
"backspace",
|
|
@@ -16,7 +16,7 @@ const specialKeyFields = /* @__PURE__ */ new Set([
|
|
|
16
16
|
"tab",
|
|
17
17
|
"upArrow"
|
|
18
18
|
]);
|
|
19
|
-
const modifierFields = /* @__PURE__ */ new Set(["ctrl", "
|
|
19
|
+
const modifierFields = /* @__PURE__ */ new Set(["ctrl", "hyper", "meta", "shift", "super"]);
|
|
20
20
|
function matchesKey(spec, input, key) {
|
|
21
21
|
const plusIndex = spec.indexOf("+");
|
|
22
22
|
if (plusIndex !== -1) {
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { useRef, useCallback } from 'react';
|
|
2
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
3
|
+
|
|
4
|
+
const resolveKeyName = (input, key) => {
|
|
5
|
+
if (key.escape) {
|
|
6
|
+
return "escape";
|
|
7
|
+
}
|
|
8
|
+
if (key.return) {
|
|
9
|
+
return "return";
|
|
10
|
+
}
|
|
11
|
+
if (key.tab) {
|
|
12
|
+
return "tab";
|
|
13
|
+
}
|
|
14
|
+
if (key.backspace) {
|
|
15
|
+
return "backspace";
|
|
16
|
+
}
|
|
17
|
+
if (key.delete) {
|
|
18
|
+
return "delete";
|
|
19
|
+
}
|
|
20
|
+
if (key.home) {
|
|
21
|
+
return "home";
|
|
22
|
+
}
|
|
23
|
+
if (key.end) {
|
|
24
|
+
return "end";
|
|
25
|
+
}
|
|
26
|
+
if (key.pageUp) {
|
|
27
|
+
return "pageup";
|
|
28
|
+
}
|
|
29
|
+
if (key.pageDown) {
|
|
30
|
+
return "pagedown";
|
|
31
|
+
}
|
|
32
|
+
if (key.upArrow) {
|
|
33
|
+
return "up";
|
|
34
|
+
}
|
|
35
|
+
if (key.downArrow) {
|
|
36
|
+
return "down";
|
|
37
|
+
}
|
|
38
|
+
if (key.leftArrow) {
|
|
39
|
+
return "left";
|
|
40
|
+
}
|
|
41
|
+
if (key.rightArrow) {
|
|
42
|
+
return "right";
|
|
43
|
+
}
|
|
44
|
+
if (input === " ") {
|
|
45
|
+
return "space";
|
|
46
|
+
}
|
|
47
|
+
if (!input || input.length === 0) {
|
|
48
|
+
return void 0;
|
|
49
|
+
}
|
|
50
|
+
return input;
|
|
51
|
+
};
|
|
52
|
+
const keyToString = (input, key) => {
|
|
53
|
+
const name = resolveKeyName(input, key);
|
|
54
|
+
if (name === void 0) {
|
|
55
|
+
return void 0;
|
|
56
|
+
}
|
|
57
|
+
const parts = [];
|
|
58
|
+
if (key.ctrl) {
|
|
59
|
+
parts.push("ctrl");
|
|
60
|
+
}
|
|
61
|
+
if (key.meta) {
|
|
62
|
+
parts.push("meta");
|
|
63
|
+
}
|
|
64
|
+
if (key.shift) {
|
|
65
|
+
parts.push("shift");
|
|
66
|
+
}
|
|
67
|
+
parts.push(name);
|
|
68
|
+
return parts.join("+");
|
|
69
|
+
};
|
|
70
|
+
const normalizeStep = (step) => step.trim().toLowerCase();
|
|
71
|
+
const useKeyChord = (sequence, callback, options) => {
|
|
72
|
+
const { isActive = true, resetAfter = 1e3 } = options ?? {};
|
|
73
|
+
const progressRef = useRef(0);
|
|
74
|
+
const lastStepAtRef = useRef(0);
|
|
75
|
+
const callbackRef = useRef(callback);
|
|
76
|
+
callbackRef.current = callback;
|
|
77
|
+
useInput(
|
|
78
|
+
useCallback(
|
|
79
|
+
(input, key) => {
|
|
80
|
+
const now = Date.now();
|
|
81
|
+
if (resetAfter > 0 && progressRef.current > 0 && now - lastStepAtRef.current > resetAfter) {
|
|
82
|
+
progressRef.current = 0;
|
|
83
|
+
}
|
|
84
|
+
const pressed = keyToString(input, key);
|
|
85
|
+
if (pressed === void 0 || sequence.length === 0) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const expected = sequence[progressRef.current];
|
|
89
|
+
if (expected === void 0) {
|
|
90
|
+
progressRef.current = 0;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (normalizeStep(pressed) === normalizeStep(expected)) {
|
|
94
|
+
progressRef.current += 1;
|
|
95
|
+
lastStepAtRef.current = now;
|
|
96
|
+
if (progressRef.current >= sequence.length) {
|
|
97
|
+
progressRef.current = 0;
|
|
98
|
+
callbackRef.current();
|
|
99
|
+
}
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
progressRef.current = 0;
|
|
103
|
+
if (normalizeStep(pressed) === normalizeStep(sequence[0] ?? "")) {
|
|
104
|
+
progressRef.current = 1;
|
|
105
|
+
lastStepAtRef.current = now;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
[sequence, resetAfter]
|
|
109
|
+
),
|
|
110
|
+
{ isActive }
|
|
111
|
+
);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export { useKeyChord as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffectEvent, useEffect } from 'react';
|
|
2
|
-
import { r as reconcilerInstance } from './reconciler-
|
|
3
|
-
import { useStdinContext } from './useStdin-
|
|
2
|
+
import { r as reconcilerInstance } from './reconciler-Dd7Z0A97.js';
|
|
3
|
+
import { useStdinContext } from './useStdin-Rf0zPzVA.js';
|
|
4
4
|
|
|
5
5
|
const usePaste = (handler, options = {}) => {
|
|
6
6
|
const { internal_eventEmitter, setBracketedPasteMode, setRawMode } = useStdinContext();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import useFocus from './useFocus-
|
|
2
|
-
import useInput from './useInput-
|
|
1
|
+
import useFocus from './useFocus-DLoGQJd9.js';
|
|
2
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
3
3
|
|
|
4
4
|
const useScrollInput = (options) => {
|
|
5
5
|
const { getViewportHeight, isActive = true, scrollBy, scrollToBottom, scrollToTop, vimBindings = false } = options;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
|
-
import { S as StdinContext } from './
|
|
2
|
+
import { S as StdinContext } from './stdin-context-Bq_GNJ3z.js';
|
|
3
3
|
|
|
4
4
|
const useStdin = () => useContext(StdinContext);
|
|
5
5
|
const useStdinContext = () => useContext(StdinContext);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useCallback, useRef } from 'react';
|
|
2
|
-
import useAnimation from './useAnimation-
|
|
2
|
+
import useAnimation from './useAnimation-DV22qxiJ.js';
|
|
3
3
|
|
|
4
4
|
function useStopwatch(options) {
|
|
5
5
|
const { autoStart = false, interval = 1e3 } = options ?? {};
|
|
@@ -23,7 +23,7 @@ function useStopwatch(options) {
|
|
|
23
23
|
const elapsedRef = useRef(elapsed);
|
|
24
24
|
elapsedRef.current = elapsed;
|
|
25
25
|
const lap = useCallback(() => {
|
|
26
|
-
const current = elapsedRef
|
|
26
|
+
const { current } = elapsedRef;
|
|
27
27
|
setLaps((previous) => [...previous, current]);
|
|
28
28
|
return current;
|
|
29
29
|
}, []);
|
package/dist/packem_shared/{useTerminalPalette-BaWO2c4Q.js → useTerminalPalette-CtFG2JTq.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState, useMemo, useEffect } from 'react';
|
|
2
2
|
import { isTerminalPaletteQuerySupported, queryTerminalPalette } from './isTerminalPaletteQuerySupported-EeiwMKbr.js';
|
|
3
|
-
import { useStdinContext } from './useStdin-
|
|
4
|
-
import useStdout from './useStdout-
|
|
3
|
+
import { useStdinContext } from './useStdin-Rf0zPzVA.js';
|
|
4
|
+
import useStdout from './useStdout-B5yRcg9N.js';
|
|
5
5
|
|
|
6
6
|
const useTerminalPalette = () => {
|
|
7
7
|
const { stdin } = useStdinContext();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
2
|
-
import { Selection, Range } from './comparePoints-
|
|
3
|
-
import useClipboard from './useClipboard-
|
|
2
|
+
import { Selection, Range } from './comparePoints-CAAlhiMS.js';
|
|
3
|
+
import useClipboard from './useClipboard-MNj6MNR-.js';
|
|
4
4
|
|
|
5
5
|
const useTextSelection = (ref, options = {}) => {
|
|
6
6
|
const { copyOnSelect = false, isActive = true, onSelectionChange } = options;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useRef, useState, useCallback, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const useTimeout = (callback, delay, options) => {
|
|
4
|
+
const { isActive = true } = options ?? {};
|
|
5
|
+
const callbackRef = useRef(callback);
|
|
6
|
+
const timerRef = useRef(void 0);
|
|
7
|
+
const [bump, setBump] = useState(0);
|
|
8
|
+
callbackRef.current = callback;
|
|
9
|
+
const cancel = useCallback(() => {
|
|
10
|
+
if (timerRef.current !== void 0) {
|
|
11
|
+
clearTimeout(timerRef.current);
|
|
12
|
+
timerRef.current = void 0;
|
|
13
|
+
}
|
|
14
|
+
}, []);
|
|
15
|
+
const reset = useCallback(() => {
|
|
16
|
+
setBump((previous) => previous + 1);
|
|
17
|
+
}, []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!isActive || delay < 0 || !Number.isFinite(delay)) {
|
|
20
|
+
return void 0;
|
|
21
|
+
}
|
|
22
|
+
const id = setTimeout(() => {
|
|
23
|
+
callbackRef.current();
|
|
24
|
+
}, delay);
|
|
25
|
+
timerRef.current = id;
|
|
26
|
+
return () => {
|
|
27
|
+
clearTimeout(id);
|
|
28
|
+
timerRef.current = void 0;
|
|
29
|
+
};
|
|
30
|
+
}, [delay, isActive, bump]);
|
|
31
|
+
return { cancel, reset };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export { useTimeout as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
-
import useAnimation from './useAnimation-
|
|
2
|
+
import useAnimation from './useAnimation-DV22qxiJ.js';
|
|
3
3
|
|
|
4
4
|
function useTimer(options) {
|
|
5
5
|
const { autoStart = false, duration, interval = 1e3, onTimeout } = options;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRef, useCallback } from 'react';
|
|
2
|
-
import useInput from './useInput-
|
|
2
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
3
3
|
|
|
4
4
|
function useTreeView({ isDisabled = false, loadChildren, onLoadError, selectionMode, state }) {
|
|
5
5
|
const loadingReference = useRef(/* @__PURE__ */ new Set());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
2
|
import { g as getWindowSize } from './utils-BgdlrbOH.js';
|
|
3
|
-
import useStdout from './useStdout-
|
|
3
|
+
import useStdout from './useStdout-B5yRcg9N.js';
|
|
4
4
|
|
|
5
5
|
const useWindowSize = () => {
|
|
6
6
|
const { stdout } = useStdout();
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const waitFor = async (condition, screenText, options = {}) => {
|
|
2
|
+
const timeout = options.timeout ?? 3e3;
|
|
3
|
+
const interval = options.interval ?? 50;
|
|
4
|
+
const start = Date.now();
|
|
5
|
+
let lastError = new Error("waitFor timed out");
|
|
6
|
+
const check = () => {
|
|
7
|
+
if (typeof condition === "string") {
|
|
8
|
+
const current = screenText();
|
|
9
|
+
if (!current.includes(condition)) {
|
|
10
|
+
throw new Error(`Timed out waiting for text: "${condition}"
|
|
11
|
+
|
|
12
|
+
Screen content:
|
|
13
|
+
${current}`);
|
|
14
|
+
}
|
|
15
|
+
} else {
|
|
16
|
+
condition();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
while (Date.now() - start < timeout) {
|
|
20
|
+
try {
|
|
21
|
+
check();
|
|
22
|
+
return;
|
|
23
|
+
} catch (error) {
|
|
24
|
+
lastError = error;
|
|
25
|
+
}
|
|
26
|
+
await new Promise((resolve) => {
|
|
27
|
+
setTimeout(resolve, interval);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
check();
|
|
32
|
+
return;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
lastError = error;
|
|
35
|
+
}
|
|
36
|
+
throw lastError;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export { waitFor };
|