@visulima/tui 1.0.0-alpha.2 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +53 -0
- package/LICENSE.md +63 -9
- package/README.md +3 -3
- package/dist/core/index.js +3 -3
- package/dist/ink/canvas/braille.d.ts +22 -0
- package/dist/ink/canvas/buffer.d.ts +67 -0
- package/dist/ink/components/accordion.d.ts +52 -0
- package/dist/ink/components/animate-presence.d.ts +15 -0
- package/dist/ink/components/approval-prompt.d.ts +55 -0
- package/dist/ink/components/area-chart.d.ts +54 -0
- package/dist/ink/components/bar-chart.d.ts +57 -0
- package/dist/ink/components/blink-dot.d.ts +30 -0
- package/dist/ink/components/breadcrumb.d.ts +28 -0
- package/dist/ink/components/button.d.ts +38 -0
- package/dist/ink/components/calendar.d.ts +60 -0
- package/dist/ink/components/canvas.d.ts +38 -0
- package/dist/ink/components/card.d.ts +46 -0
- package/dist/ink/components/chart-utils.d.ts +54 -0
- package/dist/ink/components/checkbox.d.ts +39 -0
- package/dist/ink/components/collapsible.d.ts +43 -0
- package/dist/ink/components/command-block.d.ts +38 -0
- package/dist/ink/components/command-palette.d.ts +72 -0
- package/dist/ink/components/confirm-dialog.d.ts +63 -0
- package/dist/ink/components/content-switcher.d.ts +49 -0
- package/dist/ink/components/date-picker.d.ts +53 -0
- package/dist/ink/components/definition-list.d.ts +37 -0
- package/dist/ink/components/divider.d.ts +40 -0
- package/dist/ink/components/file-picker/{FilePicker.d.ts → file-picker.d.ts} +2 -19
- package/dist/ink/components/file-picker/types.d.ts +1 -4
- package/dist/ink/components/file-picker/use-file-system.d.ts +1 -1
- package/dist/ink/components/form.d.ts +74 -0
- package/dist/ink/components/gauge.d.ts +75 -0
- package/dist/ink/components/heading.d.ts +27 -0
- package/dist/ink/components/heatmap.d.ts +51 -0
- package/dist/ink/components/{Help.d.ts → help.d.ts} +4 -9
- package/dist/ink/components/histogram.d.ts +52 -0
- package/dist/ink/components/kbd.d.ts +27 -0
- package/dist/ink/components/line-chart.d.ts +94 -0
- package/dist/ink/components/loading-indicator.d.ts +24 -0
- package/dist/ink/components/masked-input.d.ts +41 -0
- package/dist/ink/components/menu.d.ts +70 -0
- package/dist/ink/components/message-bubble.d.ts +35 -0
- package/dist/ink/components/model-badge.d.ts +32 -0
- package/dist/ink/components/operation-tree.d.ts +46 -0
- package/dist/ink/components/option-list.d.ts +41 -0
- package/dist/ink/components/{Paginator.d.ts → paginator.d.ts} +4 -20
- package/dist/ink/components/paragraph.d.ts +31 -0
- package/dist/ink/components/placeholder.d.ts +47 -0
- package/dist/ink/components/{ProgressBar.d.ts → progress-bar.d.ts} +1 -1
- package/dist/ink/components/radio-group.d.ts +62 -0
- package/dist/ink/components/scatter-plot.d.ts +23 -0
- package/dist/ink/components/scroll/{ControlledScrollView.d.ts → controlled-scroll-view.d.ts} +1 -1
- package/dist/ink/components/scroll/index.d.ts +10 -10
- package/dist/ink/components/scroll/{ScrollBarBox.d.ts → scroll-bar-box.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollBar.d.ts → scroll-bar.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollList.d.ts → scroll-list.d.ts} +1 -1
- package/dist/ink/components/scroll/{ScrollView.d.ts → scroll-view.d.ts} +1 -1
- package/dist/ink/components/search-input.d.ts +46 -0
- package/dist/ink/components/{SelectInput.d.ts → select-input.d.ts} +2 -2
- package/dist/ink/components/shimmer-text.d.ts +39 -0
- package/dist/ink/components/sparkline.d.ts +30 -0
- package/dist/ink/components/{Spinner.d.ts → spinner.d.ts} +2 -4
- package/dist/ink/components/{StaticRender.d.ts → static-render.d.ts} +14 -2
- package/dist/ink/components/status-line.d.ts +30 -0
- package/dist/ink/components/stepper.d.ts +42 -0
- package/dist/ink/components/{Stopwatch.d.ts → stopwatch.d.ts} +5 -7
- package/dist/ink/components/streaming-text.d.ts +38 -0
- package/dist/ink/components/switch.d.ts +46 -0
- package/dist/ink/components/{Tabs.d.ts → tabs.d.ts} +1 -1
- package/dist/ink/components/tag.d.ts +30 -0
- package/dist/ink/components/{Timer.d.ts → timer.d.ts} +5 -7
- package/dist/ink/components/toast.d.ts +41 -0
- package/dist/ink/components/tooltip.d.ts +36 -0
- package/dist/ink/components/transition.d.ts +53 -0
- package/dist/ink/components/tree-view/theme.d.ts +2 -2
- package/dist/ink/cursor-helpers.d.ts +0 -3
- package/dist/ink/dom.d.ts +9 -8
- package/dist/ink/hooks/use-animation.d.ts +0 -2
- package/dist/ink/hooks/use-app.d.ts +1 -1
- package/dist/ink/hooks/use-focus-manager.d.ts +1 -1
- package/dist/ink/hooks/use-form.d.ts +70 -0
- package/dist/ink/hooks/use-hotkey.d.ts +37 -0
- package/dist/ink/hooks/use-interval.d.ts +25 -0
- package/dist/ink/hooks/use-key-bindings.d.ts +4 -6
- package/dist/ink/hooks/use-key-chord.d.ts +26 -0
- package/dist/ink/hooks/use-linked-scroll.d.ts +1 -1
- package/dist/ink/hooks/use-persistent-state.d.ts +56 -0
- package/dist/ink/hooks/use-stderr.d.ts +1 -1
- package/dist/ink/hooks/use-stdin.d.ts +1 -1
- package/dist/ink/hooks/use-stdout.d.ts +1 -1
- package/dist/ink/hooks/use-stopwatch.d.ts +1 -3
- package/dist/ink/hooks/use-timeout.d.ts +24 -0
- package/dist/ink/hooks/use-timer.d.ts +0 -2
- package/dist/ink/index.d.ts +228 -92
- package/dist/ink/index.js +132 -77
- package/dist/ink/ink.d.ts +7 -6
- package/dist/ink/mouse/constants.d.ts +5 -50
- package/dist/ink/mouse/index.d.ts +2 -2
- package/dist/ink/output.d.ts +2 -1
- package/dist/ink/styled-line.d.ts +10 -0
- package/dist/ink/write-synchronized.d.ts +2 -2
- package/dist/packem_shared/Accordion-BG-yfIkV.js +80 -0
- package/dist/packem_shared/{Alert-Dr3s_LD9.js → Alert-BLcwIW8V.js} +2 -2
- package/dist/packem_shared/AnimatePresence-D8nEOr_B.js +98 -0
- package/dist/packem_shared/ApprovalPrompt-BXdPros1.js +104 -0
- package/dist/packem_shared/AreaChart-CmTcxLum.js +116 -0
- package/dist/packem_shared/{Badge-Dk7EGGM6.js → Badge-CUfbXwAB.js} +1 -1
- package/dist/packem_shared/BarChart-DWRae67P.js +87 -0
- package/dist/packem_shared/{BigText-CjMdY63X.js → BigText-CVq2X7B5.js} +1 -1
- package/dist/packem_shared/BlinkDot-CrbHMR3L.js +11 -0
- package/dist/packem_shared/{Box-D_pSJ9Jp.js → Box-W1w_NGin.js} +4 -6
- package/dist/packem_shared/Breadcrumb-CPdNxVYs.js +26 -0
- package/dist/packem_shared/Button-CBmTbJ_D.js +57 -0
- package/dist/packem_shared/Calendar-C2Qxt-LA.js +139 -0
- package/dist/packem_shared/Canvas-COttmLPX.js +246 -0
- package/dist/packem_shared/Card-D3tGkNCm.js +24 -0
- package/dist/packem_shared/Checkbox-Dpy_4Lws.js +49 -0
- package/dist/packem_shared/{Code-DjQvPBD9.js → Code-CwzzbsLx.js} +3 -3
- package/dist/packem_shared/Collapsible-BMDrXf5C.js +45 -0
- package/dist/packem_shared/CommandBlock-jdOGJPjY.js +80 -0
- package/dist/packem_shared/CommandPalette-B5IfUQwi.js +146 -0
- package/dist/packem_shared/ConfirmDialog-5XJv3Cc4.js +67 -0
- package/dist/packem_shared/{ConfirmInput-85Y4kRQW.js → ConfirmInput-CxUS0XAA.js} +3 -3
- package/dist/packem_shared/{ConsoleOverlay-DBNa4vtj.js → ConsoleOverlay-BvnCEgjG.js} +2 -2
- package/dist/packem_shared/ContentSwitcher-BHFpO5Za.js +81 -0
- package/dist/packem_shared/ControlledScrollView-C2wOOlJO.js +5 -0
- package/dist/packem_shared/DatePicker-CPejKoqS.js +73 -0
- package/dist/packem_shared/DefinitionList-BAwr0l5J.js +18 -0
- package/dist/packem_shared/{DevTools-aMPIsaHx.js → DevTools-BdxRSkhL.js} +6 -4
- package/dist/packem_shared/{Dialog-DsSNAVgC.js → Dialog-S9r7Izff.js} +5 -5
- package/dist/packem_shared/{DiffView-hqaw-2S6.js → DiffView-BR4T6-Sj.js} +4 -4
- package/dist/packem_shared/Divider-DocXIqNn.js +30 -0
- package/dist/packem_shared/{FilePicker-DNwFxRhq.js → FilePicker-BZ55oF_n.js} +39 -32
- package/dist/packem_shared/FormField-BSG16cnA.js +29 -0
- package/dist/packem_shared/{Fullscreen-DrElAE1o.js → Fullscreen-DO7voOq5.js} +2 -2
- package/dist/packem_shared/Gauge-CKXUXxft.js +122 -0
- package/dist/packem_shared/{Gradient-Ql5P0GUd.js → Gradient-Dg0NezWc.js} +3 -3
- package/dist/packem_shared/Heading-BnR7McmP.js +29 -0
- package/dist/packem_shared/Heatmap-_jqISOU0.js +79 -0
- package/dist/packem_shared/{Help-6wanGG38.js → Help-0yZ_IcQg.js} +4 -11
- package/dist/packem_shared/Histogram-cgAjY5AJ.js +92 -0
- package/dist/packem_shared/{InputParser-BKHpWfvN.js → InputParser-BlsfeY9J.js} +8 -6
- package/dist/packem_shared/KEY-STOdi-nc.js +74 -0
- package/dist/packem_shared/Kbd-BNDXQgey.js +19 -0
- package/dist/packem_shared/{LayoutNode-Cjnsodiy.js → LayoutNode-DAkKg9TE.js} +5 -7
- package/dist/packem_shared/LineChart-ef3HF816.js +7 -0
- package/dist/packem_shared/{Link-COcKYfGT.js → Link-DZ2Tiq1m.js} +2 -2
- package/dist/packem_shared/LoadingIndicator-DzbLGfyJ.js +13 -0
- package/dist/packem_shared/{Markdown-y1ISztof.js → Markdown-33bpCUoe.js} +8 -8
- package/dist/packem_shared/MaskedInput-Ctr6v2dO.js +119 -0
- package/dist/packem_shared/Menu-CeKxhEix.js +112 -0
- package/dist/packem_shared/MessageBubble-BMoU8L2Q.js +26 -0
- package/dist/packem_shared/ModelBadge-CNIxPs7v.js +40 -0
- package/dist/packem_shared/{MouseProvider-Y9TSSEGl.js → MouseProvider-CekPbXCh.js} +3 -3
- package/dist/packem_shared/{MultiSelect-ChoLUcDI.js → MultiSelect-yz7-w0Zv.js} +4 -4
- package/dist/packem_shared/{NAMED_COLORS-a4QBvb5r.js → NAMED_COLORS-DcI3erCu.js} +79 -41
- package/dist/packem_shared/OperationTree-Dudx5o1o.js +67 -0
- package/dist/packem_shared/OptionList-CTyqQaZ1.js +24 -0
- package/dist/packem_shared/{OrderedList-Cp7pXr6m.js → OrderedList-VsvSmHUC.js} +2 -2
- package/dist/packem_shared/{Paginator-D1AuD-kj.js → Paginator-DmGogvEI.js} +44 -44
- package/dist/packem_shared/Paragraph-CNNhfepo.js +9 -0
- package/dist/packem_shared/Placeholder-DkM69Q8Z.js +29 -0
- package/dist/packem_shared/{ProgressBar-DOfpVagn.js → ProgressBar-B7cS4uQm.js} +2 -2
- package/dist/packem_shared/RadioGroup-B4F9PUyL.js +108 -0
- package/dist/packem_shared/{ResizeObserverEntry-Br4seLeQ.js → ResizeObserverEntry-Vr8GZ74x.js} +4 -4
- package/dist/packem_shared/ScatterPlot-CWOg4G5h.js +63 -0
- package/dist/packem_shared/{ScrollBar-EWAs2Uc7.js → ScrollBar-DFeWH43I.js} +2 -2
- package/dist/packem_shared/{ScrollBarBox-DTNNlh7R.js → ScrollBarBox-C7VL6Izd.js} +2 -2
- package/dist/packem_shared/{ScrollList-DCeIFL8M.js → ScrollList-DRcr_RrN.js} +2 -2
- package/dist/packem_shared/{ScrollView-v3MCNIyX.js → ScrollView-C6rdlGwU.js} +4 -4
- package/dist/packem_shared/SearchInput-cB8zFhSg.js +32 -0
- package/dist/packem_shared/{SelectInput-BN2TMyxp.js → SelectInput-WzZSqp72.js} +6 -6
- package/dist/packem_shared/{SelectInputIndicator-DkRMoH_b.js → SelectInputIndicator-DKeN6v5Z.js} +2 -2
- package/dist/packem_shared/{SelectInputItem-BF9LQgKu.js → SelectInputItem-CxFL3spM.js} +1 -1
- package/dist/packem_shared/ShimmerText-B2VbPUSB.js +34 -0
- package/dist/packem_shared/{Slider-BWD7xZX6.js → Slider-BOrNTOQe.js} +3 -3
- package/dist/packem_shared/{Spacer-Bs4ER-HK.js → Spacer-DhmXyTb8.js} +1 -1
- package/dist/packem_shared/Sparkline-BSbjPrwK.js +44 -0
- package/dist/packem_shared/Spinner-BcO5BCAa.js +1942 -0
- package/dist/packem_shared/StaticRender-C3XWvJdC.js +69 -0
- package/dist/packem_shared/StatusLine-DQNUstN9.js +22 -0
- package/dist/packem_shared/{StatusMessage-BtSYxzwb.js → StatusMessage-BYTL6Pl-.js} +2 -2
- package/dist/packem_shared/Stepper-CmUPRK3z.js +60 -0
- package/dist/packem_shared/Stopwatch-zqLQAxXC.js +21 -0
- package/dist/packem_shared/StreamingText-BmuoJtGu.js +38 -0
- package/dist/packem_shared/Switch-DcPdy8nm.js +59 -0
- package/dist/packem_shared/{Table-D-rSVlzb.js → Table-Bgxo87Df.js} +11 -5
- package/dist/packem_shared/{Tabs-hki-KRnx.js → Tabs-DubuHdYV.js} +30 -19
- package/dist/packem_shared/Tag-CCqM7Ee9.js +35 -0
- package/dist/packem_shared/{Text-DvAUdZcK.js → Text-CtUwV89_.js} +2 -2
- package/dist/packem_shared/{TextInput-C79WEQ5U.js → TextInput-C9r7zT0U.js} +3 -3
- package/dist/packem_shared/{Textarea-Dj06R6Zd.js → Textarea-CGmgt-Nl.js} +5 -5
- package/dist/packem_shared/Timer-D7ZZ0_wz.js +20 -0
- package/dist/packem_shared/Toast-DXSCXFPY.js +37 -0
- package/dist/packem_shared/Tooltip-SvVjj-2k.js +32 -0
- package/dist/packem_shared/{Transform-BHxY_dAM.js → Transform-Cfyva2wd.js} +1 -1
- package/dist/packem_shared/Transition-CbNfKhaj.js +108 -0
- package/dist/packem_shared/{TreeView-C2062dtj.js → TreeView-DGlZeSsK.js} +4 -4
- package/dist/packem_shared/{TuiApp-DfxOnXqi.js → TuiApp-DtdgNRWa.js} +4 -2
- package/dist/packem_shared/{TuiContext-CqEjMyXd.js → TuiContext-lXmJFd-x.js} +6 -3
- package/dist/packem_shared/{UnorderedList-DhnadWjX.js → UnorderedList-D8RPaEAW.js} +2 -2
- package/dist/packem_shared/{ansi-parser-0BdVTKho.js → ansi-parser-BOP8fNdT.js} +6 -4
- package/dist/packem_shared/braille-BoEWoH2I.js +93 -0
- package/dist/packem_shared/{comparePoints-CGMDnd3_.js → comparePoints-CAAlhiMS.js} +2 -2
- package/dist/packem_shared/{ControlledScrollView-BlOaxcsN.js → controlled-scroll-view-DJXfdWMm.js} +2 -2
- package/dist/packem_shared/{createInlineLoop-BxMmcq9D.js → createInlineLoop-Dnfm1ZSJ.js} +19 -13
- package/dist/packem_shared/createMemoryStorage-esFJ61La.js +115 -0
- package/dist/packem_shared/createScreen-Dh0sZlQ0.js +38 -0
- package/dist/packem_shared/{dom-DvzhsAez.js → dom-CrbpQgat.js} +17 -14
- package/dist/packem_shared/{getPathToRoot-a1wbwxfL.js → getPathToRoot-BbvlppLC.js} +2 -2
- package/dist/packem_shared/{getScrollHeight-BubfU_df.js → getScrollHeight-Cz3CDQN2.js} +5 -5
- package/dist/packem_shared/line-chart-VGU2l7pu.js +139 -0
- package/dist/packem_shared/{measure-element-Reza_yfC.js → measure-element-Bc6PEaIe.js} +26 -17
- package/dist/packem_shared/{measure-text-DItZYotK.js → measure-text-BdOhbOeh.js} +74 -7
- package/dist/packem_shared/{measureElement-CTgFCmKd.js → measureElement-DTELRaij.js} +2 -2
- package/dist/packem_shared/parseSgrMouse-4hpBJBsW.js +1 -0
- package/dist/packem_shared/{processLayout-BQ9kXfd3.js → processLayout-B0Coz0Ua.js} +1 -1
- package/dist/packem_shared/{reconciler-gfmqURLy.js → reconciler-Dd7Z0A97.js} +21 -5
- package/dist/packem_shared/{reconciler-BXf6miSS.js → reconciler-mzMwSOft.js} +23 -13
- package/dist/packem_shared/{render-BAwdjfki.js → render-Bm9Oa1sG.js} +72 -79
- package/dist/packem_shared/{render-Bpjhf0lD.js → render-CjlKdg4m.js} +15 -11
- package/dist/packem_shared/{renderToString-ClIaXgrC.js → renderToString-CWYS1ZXE.js} +4 -4
- package/dist/packem_shared/{renderToString-Cfg55DRD.js → renderToString-DB3ILWFm.js} +4 -4
- package/dist/packem_shared/{renderTreeToBuffer-D3mo7M7m.js → renderTreeToBuffer-CDDTGyZn.js} +8 -5
- package/dist/packem_shared/{renderer-B3wROkeg.js → renderer-GE9OLNNM.js} +47 -41
- package/dist/packem_shared/{setEnableStyledLineCache-BpskngSJ.js → setEnableStyledLineCache-D5f4favX.js} +1 -1
- package/dist/packem_shared/{text-width-DhuarWcB.js → text-width-Db-AxMea.js} +2 -1
- package/dist/packem_shared/{token-to-elements-BRFl_rzw.js → token-to-elements-CK4s8MJd.js} +2 -2
- package/dist/packem_shared/{useAnimation-kj31sA-T.js → useAnimation-DV22qxiJ.js} +2 -2
- package/dist/packem_shared/{useApp-DPQlRzi5.js → useApp-Cbi788rV.js} +1 -1
- package/dist/packem_shared/{useBoxMetrics-rBjKc-g4.js → useBoxMetrics-_5icypir.js} +2 -2
- package/dist/packem_shared/{useClipboard-B_9-adw1.js → useClipboard-MNj6MNR-.js} +1 -1
- package/dist/packem_shared/{useCursor-BIJzc8k9.js → useCursor-DS6LjIgv.js} +1 -1
- package/dist/packem_shared/{useFocus-CNl5QHHf.js → useFocus-DLoGQJd9.js} +2 -2
- package/dist/packem_shared/{useFocusManager-BPYaUuKQ.js → useFocusManager-UeZWtnNc.js} +1 -1
- package/dist/packem_shared/useForm-sQENbEuv.js +88 -0
- package/dist/packem_shared/useHotkey-D9giUX3q.js +112 -0
- package/dist/packem_shared/{useInput-Cfp5zB2s.js → useInput-DKZbqMRc.js} +2 -2
- package/dist/packem_shared/useInterval-CSXM8c2I.js +32 -0
- package/dist/packem_shared/{useIsScreenReaderEnabled-CnGKCe0f.js → useIsScreenReaderEnabled-BeoVqo1R.js} +1 -1
- package/dist/packem_shared/{useKeyBindings-B78l1E1n.js → useKeyBindings-S4fSIEAk.js} +2 -2
- package/dist/packem_shared/useKeyChord-BmXGNuEO.js +114 -0
- package/dist/packem_shared/{usePaste-Ct8J4AGR.js → usePaste-png73gvT.js} +2 -2
- package/dist/packem_shared/{useScrollInput-D3CpBq_a.js → useScrollInput-DfzRGQFe.js} +2 -2
- package/dist/packem_shared/{useStderr-CAOVUh4E.js → useStderr-BSWerMZ7.js} +1 -1
- package/dist/packem_shared/{useStdin-X-O0kd-n.js → useStdin-Rf0zPzVA.js} +1 -1
- package/dist/packem_shared/{useStdout-DyF6DSH0.js → useStdout-B5yRcg9N.js} +1 -1
- package/dist/packem_shared/{useStopwatch-qC4Beai4.js → useStopwatch-C__Zu6hd.js} +2 -2
- package/dist/packem_shared/{useTerminalPalette-BaWO2c4Q.js → useTerminalPalette-CtFG2JTq.js} +2 -2
- package/dist/packem_shared/{useTextSelection-mXtxgsPK.js → useTextSelection-ChrYZXsn.js} +2 -2
- package/dist/packem_shared/useTimeout-DuCqgWPX.js +34 -0
- package/dist/packem_shared/{useTimer-CPQ7j827.js → useTimer-DnBtbhB5.js} +1 -1
- package/dist/packem_shared/{useTreeView-BT57P3Kx.js → useTreeView-mkN5Di7w.js} +1 -1
- package/dist/packem_shared/{useWindowSize-ugEmGZJm.js → useWindowSize-D3UU41mv.js} +1 -1
- package/dist/packem_shared/waitFor-Cv9M2jKA.js +39 -0
- package/dist/packem_shared/{wrapOrTruncateStyledLine-DN3Nogoc.js → wrapOrTruncateStyledLine-49Mne3t3.js} +1 -1
- package/dist/react/index.js +7 -7
- package/dist/react/layout.d.ts +0 -2
- package/dist/testing/index.d.ts +4 -4
- package/dist/testing/index.js +6 -114
- package/dist/testing/wait-for.d.ts +0 -1
- package/index.js +691 -539
- package/package.json +17 -17
- package/dist/ink/components/file-picker/index.d.ts +0 -3
- package/dist/ink/components/tree-view/index.d.ts +0 -11
- package/dist/packem_shared/ControlledScrollView-DfAhcufF.js +0 -5
- package/dist/packem_shared/Spinner-BuI-kN4p.js +0 -1799
- package/dist/packem_shared/StaticRender-tYwH6QXl.js +0 -33
- package/dist/packem_shared/Stopwatch-DjtTCyHn.js +0 -23
- package/dist/packem_shared/Timer-wi9zuh4n.js +0 -22
- package/dist/packem_shared/parseSgrMouse-BHVBPP9G.js +0 -1
- /package/dist/ink/components/{AccessibilityContext.d.ts → accessibility-context.d.ts} +0 -0
- /package/dist/ink/components/{Alert.d.ts → alert.d.ts} +0 -0
- /package/dist/ink/components/{AnimationContext.d.ts → animation-context.d.ts} +0 -0
- /package/dist/ink/components/{AppContext.d.ts → app-context.d.ts} +0 -0
- /package/dist/ink/components/{App.d.ts → app.d.ts} +0 -0
- /package/dist/ink/components/{BackgroundContext.d.ts → background-context.d.ts} +0 -0
- /package/dist/ink/components/{Badge.d.ts → badge.d.ts} +0 -0
- /package/dist/ink/components/{BigText.d.ts → big-text.d.ts} +0 -0
- /package/dist/ink/components/{Box.d.ts → box.d.ts} +0 -0
- /package/dist/ink/components/{Code.d.ts → code.d.ts} +0 -0
- /package/dist/ink/components/{ConfirmInput.d.ts → confirm-input.d.ts} +0 -0
- /package/dist/ink/components/{ConsoleOverlay.d.ts → console-overlay.d.ts} +0 -0
- /package/dist/ink/components/{CursorContext.d.ts → cursor-context.d.ts} +0 -0
- /package/dist/ink/components/{Cursor.d.ts → cursor.d.ts} +0 -0
- /package/dist/ink/components/{Dialog.d.ts → dialog.d.ts} +0 -0
- /package/dist/ink/components/{DiffView.d.ts → diff-view.d.ts} +0 -0
- /package/dist/ink/components/{ErrorBoundary.d.ts → error-boundary.d.ts} +0 -0
- /package/dist/ink/components/{ErrorOverview.d.ts → error-overview.d.ts} +0 -0
- /package/dist/ink/components/{FocusContext.d.ts → focus-context.d.ts} +0 -0
- /package/dist/ink/components/{Gradient.d.ts → gradient.d.ts} +0 -0
- /package/dist/ink/components/{Link.d.ts → link.d.ts} +0 -0
- /package/dist/ink/components/{Markdown.d.ts → markdown.d.ts} +0 -0
- /package/dist/ink/components/{MultiSelect.d.ts → multi-select.d.ts} +0 -0
- /package/dist/ink/components/{Newline.d.ts → newline.d.ts} +0 -0
- /package/dist/ink/components/{OrderedList.d.ts → ordered-list.d.ts} +0 -0
- /package/dist/ink/components/{SelectInputIndicator.d.ts → select-input-indicator.d.ts} +0 -0
- /package/dist/ink/components/{SelectInputItem.d.ts → select-input-item.d.ts} +0 -0
- /package/dist/ink/components/{Slider.d.ts → slider.d.ts} +0 -0
- /package/dist/ink/components/{Spacer.d.ts → spacer.d.ts} +0 -0
- /package/dist/ink/components/{Static.d.ts → static.d.ts} +0 -0
- /package/dist/ink/components/{StatusMessage.d.ts → status-message.d.ts} +0 -0
- /package/dist/ink/components/{StderrContext.d.ts → stderr-context.d.ts} +0 -0
- /package/dist/ink/components/{StdinContext.d.ts → stdin-context.d.ts} +0 -0
- /package/dist/ink/components/{StdoutContext.d.ts → stdout-context.d.ts} +0 -0
- /package/dist/ink/components/{Tab.d.ts → tab.d.ts} +0 -0
- /package/dist/ink/components/{Table.d.ts → table.d.ts} +0 -0
- /package/dist/ink/components/{TextInput.d.ts → text-input.d.ts} +0 -0
- /package/dist/ink/components/{Text.d.ts → text.d.ts} +0 -0
- /package/dist/ink/components/{Textarea.d.ts → textarea.d.ts} +0 -0
- /package/dist/ink/components/{Transform.d.ts → transform.d.ts} +0 -0
- /package/dist/ink/components/tree-view/{TreeViewNode.d.ts → tree-view-node.d.ts} +0 -0
- /package/dist/ink/components/tree-view/{TreeView.d.ts → tree-view.d.ts} +0 -0
- /package/dist/ink/components/{UnorderedList.d.ts → unordered-list.d.ts} +0 -0
- /package/dist/ink/mouse/{Fullscreen.d.ts → fullscreen.d.ts} +0 -0
- /package/dist/ink/mouse/{MouseProvider.d.ts → mouse-provider.d.ts} +0 -0
- /package/dist/packem_shared/{AccessibilityContext-BLelHhNU.js → accessibility-context-BLelHhNU.js} +0 -0
- /package/dist/packem_shared/{AnimationContext-BcJg8Jr6.js → animation-context-BcJg8Jr6.js} +0 -0
- /package/dist/packem_shared/{AppContext-CP0U6H7O.js → app-context-CP0U6H7O.js} +0 -0
- /package/dist/packem_shared/{BackgroundContext-BAUaxfOb.js → background-context-BAUaxfOb.js} +0 -0
- /package/dist/packem_shared/{CursorContext-JxRzlqAx.js → cursor-context-JxRzlqAx.js} +0 -0
- /package/dist/packem_shared/{FocusContext-CWkYtgcm.js → focus-context-CWkYtgcm.js} +0 -0
- /package/dist/packem_shared/{StderrContext-Bj4Mf7v7.js → stderr-context-Bj4Mf7v7.js} +0 -0
- /package/dist/packem_shared/{StdinContext-Bq_GNJ3z.js → stdin-context-Bq_GNJ3z.js} +0 -0
- /package/dist/packem_shared/{StdoutContext-CgjWeCdO.js → stdout-context-CgjWeCdO.js} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
|
+
|
|
5
|
+
function ModelBadge({ color = "magenta", icon, model, provider, variant = "solid" }) {
|
|
6
|
+
const chip = (content) => {
|
|
7
|
+
const renderedIcon = icon === void 0 ? void 0 : jsxs(Fragment, { children: [
|
|
8
|
+
icon,
|
|
9
|
+
" "
|
|
10
|
+
] });
|
|
11
|
+
if (variant === "outline") {
|
|
12
|
+
return jsx(Box, { borderColor: color, borderStyle: "round", paddingX: 1, children: jsxs(Text, { color, children: [
|
|
13
|
+
renderedIcon,
|
|
14
|
+
content
|
|
15
|
+
] }) });
|
|
16
|
+
}
|
|
17
|
+
if (variant === "subtle") {
|
|
18
|
+
return jsxs(Text, { color, children: [
|
|
19
|
+
renderedIcon,
|
|
20
|
+
content
|
|
21
|
+
] });
|
|
22
|
+
}
|
|
23
|
+
return jsxs(Text, { backgroundColor: color, color: "black", children: [
|
|
24
|
+
" ",
|
|
25
|
+
renderedIcon,
|
|
26
|
+
content,
|
|
27
|
+
" "
|
|
28
|
+
] });
|
|
29
|
+
};
|
|
30
|
+
if (provider === void 0) {
|
|
31
|
+
return chip(model);
|
|
32
|
+
}
|
|
33
|
+
return jsxs(Box, { children: [
|
|
34
|
+
jsx(Text, { dimColor: true, children: provider }),
|
|
35
|
+
jsx(Text, { dimColor: true, children: "/" }),
|
|
36
|
+
chip(model)
|
|
37
|
+
] });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { ModelBadge as default };
|
|
@@ -23,9 +23,9 @@ const {
|
|
|
23
23
|
} = __cjs_getBuiltinModule("node:events");
|
|
24
24
|
const process = __cjs_getProcess;
|
|
25
25
|
import { useRef, useReducer, useEffect, useMemo } from 'react';
|
|
26
|
-
import { useStdinContext } from './useStdin-
|
|
27
|
-
import useStdout from './useStdout-
|
|
28
|
-
import { A as ANSI_CODES, p as parseSgrMouse } from './ansi-parser-
|
|
26
|
+
import { useStdinContext } from './useStdin-Rf0zPzVA.js';
|
|
27
|
+
import useStdout from './useStdout-B5yRcg9N.js';
|
|
28
|
+
import { A as ANSI_CODES, p as parseSgrMouse } from './ansi-parser-BOP8fNdT.js';
|
|
29
29
|
import { M as MouseContext } from './mouse-context-BUHWKEIe.js';
|
|
30
30
|
|
|
31
31
|
const initialMouseState = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useReducer, useState, useRef, useMemo, useCallback } from 'react';
|
|
3
|
-
import useInput from './useInput-
|
|
4
|
-
import useWindowSize from './useWindowSize-
|
|
5
|
-
import Box from './Box-
|
|
6
|
-
import Text from './Text-
|
|
3
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
4
|
+
import useWindowSize from './useWindowSize-D3UU41mv.js';
|
|
5
|
+
import Box from './Box-W1w_NGin.js';
|
|
6
|
+
import Text from './Text-CtUwV89_.js';
|
|
7
7
|
|
|
8
8
|
const EMPTY_DEFAULT = [];
|
|
9
9
|
const multiSelectReducer = (state, action) => {
|
|
@@ -86,61 +86,83 @@ const applyPositionStyles = (node, style) => {
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
const applyMarginStyles = (node, style) => {
|
|
89
|
-
if ("margin" in style)
|
|
89
|
+
if ("margin" in style) {
|
|
90
90
|
node.setMargin(Yoga.EDGE_ALL, style.margin ?? 0);
|
|
91
|
-
|
|
91
|
+
}
|
|
92
|
+
if ("marginX" in style) {
|
|
92
93
|
node.setMargin(Yoga.EDGE_HORIZONTAL, style.marginX ?? 0);
|
|
93
|
-
|
|
94
|
+
}
|
|
95
|
+
if ("marginY" in style) {
|
|
94
96
|
node.setMargin(Yoga.EDGE_VERTICAL, style.marginY ?? 0);
|
|
95
|
-
|
|
97
|
+
}
|
|
98
|
+
if ("marginLeft" in style) {
|
|
96
99
|
node.setMargin(Yoga.EDGE_LEFT, style.marginLeft ?? 0);
|
|
97
|
-
|
|
100
|
+
}
|
|
101
|
+
if ("marginRight" in style) {
|
|
98
102
|
node.setMargin(Yoga.EDGE_RIGHT, style.marginRight ?? 0);
|
|
99
|
-
|
|
103
|
+
}
|
|
104
|
+
if ("marginTop" in style) {
|
|
100
105
|
node.setMargin(Yoga.EDGE_TOP, style.marginTop ?? 0);
|
|
101
|
-
|
|
106
|
+
}
|
|
107
|
+
if ("marginBottom" in style) {
|
|
102
108
|
node.setMargin(Yoga.EDGE_BOTTOM, style.marginBottom ?? 0);
|
|
109
|
+
}
|
|
103
110
|
};
|
|
104
111
|
const applyPaddingStyles = (node, style) => {
|
|
105
|
-
if ("padding" in style)
|
|
112
|
+
if ("padding" in style) {
|
|
106
113
|
node.setPadding(Yoga.EDGE_ALL, style.padding ?? 0);
|
|
107
|
-
|
|
114
|
+
}
|
|
115
|
+
if ("paddingX" in style) {
|
|
108
116
|
node.setPadding(Yoga.EDGE_HORIZONTAL, style.paddingX ?? 0);
|
|
109
|
-
|
|
117
|
+
}
|
|
118
|
+
if ("paddingY" in style) {
|
|
110
119
|
node.setPadding(Yoga.EDGE_VERTICAL, style.paddingY ?? 0);
|
|
111
|
-
|
|
120
|
+
}
|
|
121
|
+
if ("paddingLeft" in style) {
|
|
112
122
|
node.setPadding(Yoga.EDGE_LEFT, style.paddingLeft ?? 0);
|
|
113
|
-
|
|
123
|
+
}
|
|
124
|
+
if ("paddingRight" in style) {
|
|
114
125
|
node.setPadding(Yoga.EDGE_RIGHT, style.paddingRight ?? 0);
|
|
115
|
-
|
|
126
|
+
}
|
|
127
|
+
if ("paddingTop" in style) {
|
|
116
128
|
node.setPadding(Yoga.EDGE_TOP, style.paddingTop ?? 0);
|
|
117
|
-
|
|
129
|
+
}
|
|
130
|
+
if ("paddingBottom" in style) {
|
|
118
131
|
node.setPadding(Yoga.EDGE_BOTTOM, style.paddingBottom ?? 0);
|
|
132
|
+
}
|
|
119
133
|
};
|
|
120
134
|
const applyFlexStyles = (node, style) => {
|
|
121
|
-
if ("flexGrow" in style)
|
|
135
|
+
if ("flexGrow" in style) {
|
|
122
136
|
node.setFlexGrow(style.flexGrow ?? 0);
|
|
123
|
-
|
|
137
|
+
}
|
|
138
|
+
if ("flexShrink" in style) {
|
|
124
139
|
node.setFlexShrink(style.flexShrink ?? 1);
|
|
140
|
+
}
|
|
125
141
|
if ("flexWrap" in style) {
|
|
126
142
|
node.setFlexWrap(style.flexWrap === "nowrap" ? Yoga.WRAP_NO_WRAP : style.flexWrap === "wrap" ? Yoga.WRAP_WRAP : Yoga.WRAP_WRAP_REVERSE);
|
|
127
143
|
}
|
|
128
144
|
if ("flexDirection" in style) {
|
|
129
|
-
if (style.flexDirection === "row")
|
|
145
|
+
if (style.flexDirection === "row") {
|
|
130
146
|
node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW);
|
|
131
|
-
|
|
147
|
+
}
|
|
148
|
+
if (style.flexDirection === "row-reverse") {
|
|
132
149
|
node.setFlexDirection(Yoga.FLEX_DIRECTION_ROW_REVERSE);
|
|
133
|
-
|
|
150
|
+
}
|
|
151
|
+
if (style.flexDirection === "column") {
|
|
134
152
|
node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN);
|
|
135
|
-
|
|
153
|
+
}
|
|
154
|
+
if (style.flexDirection === "column-reverse") {
|
|
136
155
|
node.setFlexDirection(Yoga.FLEX_DIRECTION_COLUMN_REVERSE);
|
|
156
|
+
}
|
|
137
157
|
}
|
|
138
158
|
if ("flexBasis" in style) {
|
|
139
|
-
if (typeof style.flexBasis === "number")
|
|
159
|
+
if (typeof style.flexBasis === "number") {
|
|
140
160
|
node.setFlexBasis(style.flexBasis);
|
|
141
|
-
else if (typeof style.flexBasis === "string")
|
|
161
|
+
} else if (typeof style.flexBasis === "string") {
|
|
142
162
|
node.setFlexBasisPercent(Number.parseInt(style.flexBasis, 10));
|
|
143
|
-
else
|
|
163
|
+
} else {
|
|
164
|
+
node.setFlexBasis(Number.NaN);
|
|
165
|
+
}
|
|
144
166
|
}
|
|
145
167
|
if ("alignItems" in style) {
|
|
146
168
|
const map = {
|
|
@@ -188,41 +210,54 @@ const applyFlexStyles = (node, style) => {
|
|
|
188
210
|
};
|
|
189
211
|
const applyDimensionStyles = (node, style) => {
|
|
190
212
|
if ("width" in style) {
|
|
191
|
-
if (typeof style.width === "number")
|
|
213
|
+
if (typeof style.width === "number") {
|
|
192
214
|
node.setWidth(style.width);
|
|
193
|
-
else if (typeof style.width === "string")
|
|
215
|
+
} else if (typeof style.width === "string") {
|
|
194
216
|
node.setWidthPercent(Number.parseInt(style.width, 10));
|
|
195
|
-
else
|
|
217
|
+
} else {
|
|
218
|
+
node.setWidthAuto();
|
|
219
|
+
}
|
|
196
220
|
}
|
|
197
221
|
if ("height" in style) {
|
|
198
|
-
if (typeof style.height === "number")
|
|
222
|
+
if (typeof style.height === "number") {
|
|
199
223
|
node.setHeight(style.height);
|
|
200
|
-
else if (typeof style.height === "string")
|
|
224
|
+
} else if (typeof style.height === "string") {
|
|
201
225
|
node.setHeightPercent(Number.parseInt(style.height, 10));
|
|
202
|
-
else
|
|
226
|
+
} else {
|
|
227
|
+
node.setHeightAuto();
|
|
228
|
+
}
|
|
203
229
|
}
|
|
204
230
|
if ("minWidth" in style) {
|
|
205
|
-
if (typeof style.minWidth === "string")
|
|
231
|
+
if (typeof style.minWidth === "string") {
|
|
206
232
|
node.setMinWidthPercent(Number.parseInt(style.minWidth, 10));
|
|
207
|
-
else
|
|
233
|
+
} else {
|
|
234
|
+
node.setMinWidth(style.minWidth ?? 0);
|
|
235
|
+
}
|
|
208
236
|
}
|
|
209
237
|
if ("minHeight" in style) {
|
|
210
|
-
if (typeof style.minHeight === "string")
|
|
238
|
+
if (typeof style.minHeight === "string") {
|
|
211
239
|
node.setMinHeightPercent(Number.parseInt(style.minHeight, 10));
|
|
212
|
-
else
|
|
240
|
+
} else {
|
|
241
|
+
node.setMinHeight(style.minHeight ?? 0);
|
|
242
|
+
}
|
|
213
243
|
}
|
|
214
244
|
if ("maxWidth" in style) {
|
|
215
|
-
if (typeof style.maxWidth === "string")
|
|
245
|
+
if (typeof style.maxWidth === "string") {
|
|
216
246
|
node.setMaxWidthPercent(Number.parseInt(style.maxWidth, 10));
|
|
217
|
-
else
|
|
247
|
+
} else {
|
|
248
|
+
node.setMaxWidth(style.maxWidth);
|
|
249
|
+
}
|
|
218
250
|
}
|
|
219
251
|
if ("maxHeight" in style) {
|
|
220
|
-
if (typeof style.maxHeight === "string")
|
|
252
|
+
if (typeof style.maxHeight === "string") {
|
|
221
253
|
node.setMaxHeightPercent(Number.parseInt(style.maxHeight, 10));
|
|
222
|
-
else
|
|
254
|
+
} else {
|
|
255
|
+
node.setMaxHeight(style.maxHeight);
|
|
256
|
+
}
|
|
223
257
|
}
|
|
224
|
-
if ("aspectRatio" in style)
|
|
258
|
+
if ("aspectRatio" in style) {
|
|
225
259
|
node.setAspectRatio(style.aspectRatio);
|
|
260
|
+
}
|
|
226
261
|
};
|
|
227
262
|
const applyDisplayStyles = (node, style) => {
|
|
228
263
|
if ("display" in style) {
|
|
@@ -241,12 +276,15 @@ const applyBorderStyles = (node, style, currentStyle) => {
|
|
|
241
276
|
node.setBorder(Yoga.EDGE_RIGHT, currentStyle.borderRight === false ? 0 : borderWidth);
|
|
242
277
|
};
|
|
243
278
|
const applyGapStyles = (node, style) => {
|
|
244
|
-
if ("gap" in style)
|
|
279
|
+
if ("gap" in style) {
|
|
245
280
|
node.setGap(Yoga.GUTTER_ALL, style.gap ?? 0);
|
|
246
|
-
|
|
281
|
+
}
|
|
282
|
+
if ("columnGap" in style) {
|
|
247
283
|
node.setGap(Yoga.GUTTER_COLUMN, style.columnGap ?? 0);
|
|
248
|
-
|
|
284
|
+
}
|
|
285
|
+
if ("rowGap" in style) {
|
|
249
286
|
node.setGap(Yoga.GUTTER_ROW, style.rowGap ?? 0);
|
|
287
|
+
}
|
|
250
288
|
};
|
|
251
289
|
const applyStyles = (node, style = {}, currentStyle = style) => {
|
|
252
290
|
applyPositionStyles(node, style);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Spinner from './Spinner-BcO5BCAa.js';
|
|
4
|
+
import Text from './Text-CtUwV89_.js';
|
|
5
|
+
|
|
6
|
+
const STATUS_COLOR = {
|
|
7
|
+
completed: "green",
|
|
8
|
+
error: "red",
|
|
9
|
+
pending: "gray",
|
|
10
|
+
running: "cyan",
|
|
11
|
+
skipped: "yellow"
|
|
12
|
+
};
|
|
13
|
+
const STATUS_ICON = {
|
|
14
|
+
completed: "✔",
|
|
15
|
+
error: "✖",
|
|
16
|
+
pending: "○",
|
|
17
|
+
skipped: "⊘"
|
|
18
|
+
};
|
|
19
|
+
const formatDuration = (ms) => {
|
|
20
|
+
if (ms < 1e3) {
|
|
21
|
+
return `${Math.round(ms)}ms`;
|
|
22
|
+
}
|
|
23
|
+
if (ms < 6e4) {
|
|
24
|
+
return `${(ms / 1e3).toFixed(1)}s`;
|
|
25
|
+
}
|
|
26
|
+
const totalSeconds = Math.round(ms / 1e3);
|
|
27
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
28
|
+
const seconds = totalSeconds % 60;
|
|
29
|
+
return `${minutes}m ${seconds}s`;
|
|
30
|
+
};
|
|
31
|
+
const NodeLine = ({ isLast, node, prefix, showSpinner }) => {
|
|
32
|
+
const color = STATUS_COLOR[node.status];
|
|
33
|
+
const connector = prefix.length === 0 ? "" : isLast ? "└─ " : "├─ ";
|
|
34
|
+
const childPrefix = prefix + (isLast ? " " : "│ ");
|
|
35
|
+
return jsxs(Fragment, { children: [
|
|
36
|
+
jsxs(Box, { children: [
|
|
37
|
+
jsx(Text, { dimColor: true, children: prefix }),
|
|
38
|
+
jsx(Text, { dimColor: true, children: connector }),
|
|
39
|
+
jsx(Box, { flexShrink: 0, children: jsx(Text, { color, children: node.status === "running" ? showSpinner ? jsx(Spinner, { type: "dots" }) : "…" : STATUS_ICON[node.status] }) }),
|
|
40
|
+
jsx(Text, { children: " " }),
|
|
41
|
+
jsx(Box, { flexGrow: 1, flexShrink: 1, minWidth: 0, children: jsx(
|
|
42
|
+
Text,
|
|
43
|
+
{
|
|
44
|
+
bold: node.status === "running",
|
|
45
|
+
color: node.status === "pending" ? "gray" : void 0,
|
|
46
|
+
dimColor: node.status === "skipped",
|
|
47
|
+
wrap: "truncate-end",
|
|
48
|
+
children: node.label
|
|
49
|
+
}
|
|
50
|
+
) }),
|
|
51
|
+
node.durationMs === void 0 ? void 0 : jsx(Box, { flexShrink: 0, children: jsxs(Text, { dimColor: true, children: [
|
|
52
|
+
" ",
|
|
53
|
+
formatDuration(node.durationMs)
|
|
54
|
+
] }) })
|
|
55
|
+
] }),
|
|
56
|
+
node.details === void 0 ? void 0 : jsxs(Box, { children: [
|
|
57
|
+
jsx(Text, { dimColor: true, children: childPrefix }),
|
|
58
|
+
jsx(Text, { dimColor: true, children: node.details })
|
|
59
|
+
] }),
|
|
60
|
+
node.children?.map((child, index, all) => jsx(NodeLine, { isLast: index === all.length - 1, node: child, prefix: childPrefix, showSpinner }, child.id))
|
|
61
|
+
] });
|
|
62
|
+
};
|
|
63
|
+
function OperationTree({ nodes, showSpinner = true }) {
|
|
64
|
+
return jsx(Box, { flexDirection: "column", children: nodes.map((node, index) => jsx(NodeLine, { isLast: index === nodes.length - 1, node, prefix: "", showSpinner }, node.id)) });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { OperationTree as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
function OptionList({ accentColor = "blue", bordered = false, currentId, iconColumnWidth = 2, options }) {
|
|
6
|
+
const list = jsx(Box, { flexDirection: "column", children: options.map((option) => {
|
|
7
|
+
const isCurrent = option.id === currentId;
|
|
8
|
+
const color = isCurrent ? accentColor : void 0;
|
|
9
|
+
return jsxs(Box, { flexDirection: "column", children: [
|
|
10
|
+
jsxs(Box, { children: [
|
|
11
|
+
jsx(Box, { flexShrink: 0, width: iconColumnWidth, children: jsx(Text, { color, children: option.icon ?? (isCurrent ? "▸" : " ") }) }),
|
|
12
|
+
jsx(Box, { flexGrow: 1, flexShrink: 1, minWidth: 0, children: jsx(Text, { bold: isCurrent, color, wrap: "truncate-end", children: option.label }) }),
|
|
13
|
+
option.trailing === void 0 ? void 0 : jsx(Box, { flexShrink: 0, children: option.trailing })
|
|
14
|
+
] }),
|
|
15
|
+
option.description === void 0 ? void 0 : jsx(Box, { marginLeft: iconColumnWidth, children: jsx(Text, { dimColor: true, wrap: "truncate-end", children: option.description }) })
|
|
16
|
+
] }, option.id);
|
|
17
|
+
}) });
|
|
18
|
+
if (!bordered) {
|
|
19
|
+
return list;
|
|
20
|
+
}
|
|
21
|
+
return jsx(Box, { borderStyle: "round", paddingX: 1, children: list });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { OptionList as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import Box from './Box-
|
|
3
|
-
import Text from './Text-
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
4
|
|
|
5
5
|
const renderList = (items, parentMarker) => {
|
|
6
6
|
const maxWidth = String(items.length).length;
|
|
@@ -1,10 +1,47 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState,
|
|
3
|
-
import useInput from './useInput-
|
|
4
|
-
import Box from './Box-
|
|
5
|
-
import Text from './Text-
|
|
2
|
+
import { useState, useCallback } from 'react';
|
|
3
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
4
|
+
import Box from './Box-W1w_NGin.js';
|
|
5
|
+
import Text from './Text-CtUwV89_.js';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const Indicator = ({
|
|
8
|
+
color,
|
|
9
|
+
currentPage,
|
|
10
|
+
style,
|
|
11
|
+
totalPages
|
|
12
|
+
}) => {
|
|
13
|
+
if (style === "fraction") {
|
|
14
|
+
return jsxs(Text, { children: [
|
|
15
|
+
jsx(Text, { color, children: currentPage + 1 }),
|
|
16
|
+
jsxs(Text, { dimColor: true, children: [
|
|
17
|
+
"/",
|
|
18
|
+
totalPages
|
|
19
|
+
] })
|
|
20
|
+
] });
|
|
21
|
+
}
|
|
22
|
+
if (style === "numeric") {
|
|
23
|
+
const previousArrow = currentPage > 0 ? jsx(Text, { color, children: "‹ " }) : jsx(Text, { dimColor: true, children: "‹ " });
|
|
24
|
+
const nextArrow = currentPage < totalPages - 1 ? jsx(Text, { color, children: " ›" }) : jsx(Text, { dimColor: true, children: " ›" });
|
|
25
|
+
return jsxs(Box, { children: [
|
|
26
|
+
previousArrow,
|
|
27
|
+
jsx(Text, { color, children: currentPage + 1 }),
|
|
28
|
+
jsxs(Text, { dimColor: true, children: [
|
|
29
|
+
" ",
|
|
30
|
+
"/",
|
|
31
|
+
totalPages
|
|
32
|
+
] }),
|
|
33
|
+
nextArrow
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
const dots = Array.from({ length: totalPages }, (_, i) => {
|
|
37
|
+
if (i === currentPage) {
|
|
38
|
+
return jsx(Text, { color, children: "●" }, i);
|
|
39
|
+
}
|
|
40
|
+
return jsx(Text, { dimColor: true, children: "○" }, i);
|
|
41
|
+
});
|
|
42
|
+
return jsx(Box, { gap: 1, children: dots });
|
|
43
|
+
};
|
|
44
|
+
const Paginator = ({
|
|
8
45
|
children,
|
|
9
46
|
defaultPage = 0,
|
|
10
47
|
indicatorColor = "cyan",
|
|
@@ -14,17 +51,12 @@ function Paginator({
|
|
|
14
51
|
page: controlledPage,
|
|
15
52
|
pageSize,
|
|
16
53
|
style = "dots"
|
|
17
|
-
}) {
|
|
54
|
+
}) => {
|
|
18
55
|
const isControlled = controlledPage !== void 0;
|
|
19
56
|
const [internalPage, setInternalPage] = useState(defaultPage);
|
|
20
57
|
const currentPage = isControlled ? controlledPage : internalPage;
|
|
21
58
|
const totalPages = Math.max(1, Math.ceil(items.length / pageSize));
|
|
22
59
|
const safePage = Math.max(0, Math.min(currentPage, totalPages - 1));
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
if (isControlled) {
|
|
25
|
-
setInternalPage(controlledPage);
|
|
26
|
-
}
|
|
27
|
-
}, [isControlled, controlledPage]);
|
|
28
60
|
const setPage = useCallback(
|
|
29
61
|
(newPage) => {
|
|
30
62
|
const clamped = Math.max(0, Math.min(newPage, totalPages - 1));
|
|
@@ -67,38 +99,6 @@ function Paginator({
|
|
|
67
99
|
children(pageItems, meta),
|
|
68
100
|
totalPages > 1 && jsx(Indicator, { color: indicatorColor, currentPage: safePage, style, totalPages })
|
|
69
101
|
] });
|
|
70
|
-
}
|
|
71
|
-
function Indicator({
|
|
72
|
-
color,
|
|
73
|
-
currentPage,
|
|
74
|
-
style,
|
|
75
|
-
totalPages
|
|
76
|
-
}) {
|
|
77
|
-
if (style === "fraction") {
|
|
78
|
-
return jsxs(Text, { children: [
|
|
79
|
-
jsx(Text, { color, children: currentPage + 1 }),
|
|
80
|
-
jsxs(Text, { dimColor: true, children: [
|
|
81
|
-
"/",
|
|
82
|
-
totalPages
|
|
83
|
-
] })
|
|
84
|
-
] });
|
|
85
|
-
}
|
|
86
|
-
if (style === "numeric") {
|
|
87
|
-
return jsxs(Box, { children: [
|
|
88
|
-
currentPage > 0 ? jsx(Text, { color, children: "‹ " }) : jsx(Text, { dimColor: true, children: "‹ " }),
|
|
89
|
-
jsx(Text, { color, children: currentPage + 1 }),
|
|
90
|
-
jsxs(Text, { dimColor: true, children: [
|
|
91
|
-
" / ",
|
|
92
|
-
totalPages
|
|
93
|
-
] }),
|
|
94
|
-
currentPage < totalPages - 1 ? jsx(Text, { color, children: " ›" }) : jsx(Text, { dimColor: true, children: " ›" })
|
|
95
|
-
] });
|
|
96
|
-
}
|
|
97
|
-
const dots = Array.from(
|
|
98
|
-
{ length: totalPages },
|
|
99
|
-
(_, i) => i === currentPage ? jsx(Text, { color, children: "●" }, i) : jsx(Text, { dimColor: true, children: "○" }, i)
|
|
100
|
-
);
|
|
101
|
-
return jsx(Box, { gap: 1, children: dots });
|
|
102
|
-
}
|
|
102
|
+
};
|
|
103
103
|
|
|
104
104
|
export { Paginator as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import Box from './Box-W1w_NGin.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
|
+
|
|
5
|
+
function Paragraph({ children, color, dimColor = false, marginBottom = 1, marginTop = 0 }) {
|
|
6
|
+
return jsx(Box, { flexDirection: "column", marginBottom, marginTop, children: jsx(Text, { color, dimColor, children }) });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { Paragraph as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import useAnimation from './useAnimation-DV22qxiJ.js';
|
|
3
|
+
import useWindowSize from './useWindowSize-D3UU41mv.js';
|
|
4
|
+
import Box from './Box-W1w_NGin.js';
|
|
5
|
+
import Text from './Text-CtUwV89_.js';
|
|
6
|
+
|
|
7
|
+
const DEFAULT_WIDTHS = [1, 0.85, 0.6];
|
|
8
|
+
function Placeholder({
|
|
9
|
+
animated = true,
|
|
10
|
+
character = "█",
|
|
11
|
+
color = "gray",
|
|
12
|
+
interval = 500,
|
|
13
|
+
rows = 3,
|
|
14
|
+
width,
|
|
15
|
+
widths = DEFAULT_WIDTHS
|
|
16
|
+
}) {
|
|
17
|
+
const { frame } = useAnimation({ interval, isActive: animated });
|
|
18
|
+
const { columns } = useWindowSize();
|
|
19
|
+
const dim = animated && frame % 2 === 0;
|
|
20
|
+
const baseWidth = width ?? Math.max(1, columns);
|
|
21
|
+
return jsx(Box, { flexDirection: "column", width, children: Array.from({ length: rows }, (_, index) => {
|
|
22
|
+
const ratio = widths.length > 0 ? widths[index % widths.length] ?? 1 : 1;
|
|
23
|
+
const effectiveWidth = Math.max(1, Math.round(baseWidth * ratio));
|
|
24
|
+
const fill = character.repeat(effectiveWidth);
|
|
25
|
+
return jsx(Box, { width: effectiveWidth, children: jsx(Text, { color, dimColor: dim, wrap: "truncate-end", children: fill }) }, index);
|
|
26
|
+
}) });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Placeholder as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import useWindowSize from './useWindowSize-
|
|
3
|
-
import Text from './Text-
|
|
2
|
+
import useWindowSize from './useWindowSize-D3UU41mv.js';
|
|
3
|
+
import Text from './Text-CtUwV89_.js';
|
|
4
4
|
|
|
5
5
|
function ProgressBar({
|
|
6
6
|
character = "█",
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useRef, useCallback } from 'react';
|
|
3
|
+
import useFocus from './useFocus-DLoGQJd9.js';
|
|
4
|
+
import useInput from './useInput-DKZbqMRc.js';
|
|
5
|
+
import Box from './Box-W1w_NGin.js';
|
|
6
|
+
import Text from './Text-CtUwV89_.js';
|
|
7
|
+
|
|
8
|
+
const initialFocusIndex = (options, selectedValue) => {
|
|
9
|
+
if (selectedValue === void 0) {
|
|
10
|
+
return 0;
|
|
11
|
+
}
|
|
12
|
+
const index = options.findIndex((option) => option.value === selectedValue);
|
|
13
|
+
return Math.max(index, 0);
|
|
14
|
+
};
|
|
15
|
+
function RadioGroup({
|
|
16
|
+
accentColor = "blue",
|
|
17
|
+
autoFocus = false,
|
|
18
|
+
commitOnNavigate = true,
|
|
19
|
+
defaultValue,
|
|
20
|
+
isDisabled = false,
|
|
21
|
+
onChange,
|
|
22
|
+
onSubmit,
|
|
23
|
+
options,
|
|
24
|
+
orientation = "vertical",
|
|
25
|
+
value
|
|
26
|
+
}) {
|
|
27
|
+
const { isFocused } = useFocus({ autoFocus, isActive: !isDisabled });
|
|
28
|
+
const [internal, setInternal] = useState(defaultValue ?? options[0]?.value);
|
|
29
|
+
const current = value ?? internal;
|
|
30
|
+
const [focusedIndex, setFocusedIndex] = useState(() => initialFocusIndex(options, current));
|
|
31
|
+
const focusedIndexRef = useRef(focusedIndex);
|
|
32
|
+
focusedIndexRef.current = focusedIndex;
|
|
33
|
+
const commit = useCallback(
|
|
34
|
+
(index) => {
|
|
35
|
+
const target = options[index];
|
|
36
|
+
if (!target) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const currentValue = value ?? internal;
|
|
40
|
+
if (target.value === currentValue) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (value === void 0) {
|
|
44
|
+
setInternal(target.value);
|
|
45
|
+
}
|
|
46
|
+
onChange?.(target.value);
|
|
47
|
+
},
|
|
48
|
+
[options, value, internal, onChange]
|
|
49
|
+
);
|
|
50
|
+
useInput(
|
|
51
|
+
useCallback(
|
|
52
|
+
(input, key) => {
|
|
53
|
+
if (!isFocused) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const total = options.length;
|
|
57
|
+
if (total === 0) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const moveNext = key.downArrow && orientation === "vertical" || key.rightArrow && orientation === "horizontal" || input === "j";
|
|
61
|
+
const movePrevious = key.upArrow && orientation === "vertical" || key.leftArrow && orientation === "horizontal" || input === "k";
|
|
62
|
+
if (moveNext) {
|
|
63
|
+
const nextIndex = Math.min(total - 1, focusedIndexRef.current + 1);
|
|
64
|
+
setFocusedIndex(nextIndex);
|
|
65
|
+
if (commitOnNavigate) {
|
|
66
|
+
commit(nextIndex);
|
|
67
|
+
}
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (movePrevious) {
|
|
71
|
+
const nextIndex = Math.max(0, focusedIndexRef.current - 1);
|
|
72
|
+
setFocusedIndex(nextIndex);
|
|
73
|
+
if (commitOnNavigate) {
|
|
74
|
+
commit(nextIndex);
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (input === " ") {
|
|
79
|
+
commit(focusedIndexRef.current);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (key.return) {
|
|
83
|
+
if (!commitOnNavigate) {
|
|
84
|
+
commit(focusedIndexRef.current);
|
|
85
|
+
}
|
|
86
|
+
const submitValue = options[focusedIndexRef.current]?.value ?? current;
|
|
87
|
+
if (submitValue !== void 0) {
|
|
88
|
+
onSubmit?.(submitValue);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
[isFocused, options, orientation, commit, commitOnNavigate, current, onSubmit]
|
|
93
|
+
),
|
|
94
|
+
{ isActive: !isDisabled && isFocused }
|
|
95
|
+
);
|
|
96
|
+
return jsx(Box, { flexDirection: orientation === "vertical" ? "column" : "row", gap: orientation === "vertical" ? 0 : 2, children: options.map((option, index) => {
|
|
97
|
+
const isSelected = option.value === current;
|
|
98
|
+
const isItemFocused = isFocused && index === focusedIndex;
|
|
99
|
+
const color = (isSelected || isItemFocused) && isFocused ? accentColor : void 0;
|
|
100
|
+
return jsxs(Box, { gap: 1, children: [
|
|
101
|
+
jsx(Text, { color, dimColor: isDisabled, children: isSelected ? "●" : "○" }),
|
|
102
|
+
jsx(Text, { bold: isItemFocused, color, dimColor: isDisabled, children: option.label }),
|
|
103
|
+
option.description === void 0 ? void 0 : jsx(Text, { dimColor: true, children: option.description })
|
|
104
|
+
] }, option.key ?? option.value);
|
|
105
|
+
}) });
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export { RadioGroup as default };
|
package/dist/packem_shared/{ResizeObserverEntry-Br4seLeQ.js → ResizeObserverEntry-Vr8GZ74x.js}
RENAMED
|
@@ -21,8 +21,8 @@ class ResizeObserver {
|
|
|
21
21
|
element.resizeObservers.add(this);
|
|
22
22
|
let lastMeasuredSize = element.internal_lastMeasuredSize;
|
|
23
23
|
if (lastMeasuredSize === void 0 && element.yogaNode) {
|
|
24
|
-
const width = element.yogaNode.getComputedWidth();
|
|
25
|
-
const height = element.yogaNode.getComputedHeight();
|
|
24
|
+
const width = Math.round(element.yogaNode.getComputedWidth());
|
|
25
|
+
const height = Math.round(element.yogaNode.getComputedHeight());
|
|
26
26
|
if (!Number.isNaN(width) && !Number.isNaN(height)) {
|
|
27
27
|
lastMeasuredSize = { height, width };
|
|
28
28
|
element.internal_lastMeasuredSize = lastMeasuredSize;
|
|
@@ -61,8 +61,8 @@ class ResizeObserver {
|
|
|
61
61
|
function measureAndExtractObservers(node, observerEntries, forceCache = false) {
|
|
62
62
|
const hasObservers = node.resizeObservers && node.resizeObservers.size > 0;
|
|
63
63
|
if ((hasObservers || forceCache) && node.yogaNode) {
|
|
64
|
-
const width = node.yogaNode.getComputedWidth();
|
|
65
|
-
const height = node.yogaNode.getComputedHeight();
|
|
64
|
+
const width = Math.round(node.yogaNode.getComputedWidth());
|
|
65
|
+
const height = Math.round(node.yogaNode.getComputedHeight());
|
|
66
66
|
if (!Number.isNaN(width) && !Number.isNaN(height)) {
|
|
67
67
|
const lastSize = node.internal_lastMeasuredSize;
|
|
68
68
|
if (lastSize?.width !== width || lastSize.height !== height) {
|