@visulima/tui 1.0.0-alpha.23 → 1.0.0-alpha.24
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 +45 -0
- package/README.md +17 -0
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/animate-presence.js +1 -1
- package/dist/components/approval-prompt.js +1 -1
- package/dist/components/area-chart.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/bar-chart.js +1 -1
- package/dist/components/big-text.js +1 -1
- package/dist/components/blink-dot.js +1 -1
- package/dist/components/box.d.ts +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/canvas.d.ts +1 -1
- package/dist/components/canvas.js +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/code.js +2 -2
- package/dist/components/collapsible.js +1 -1
- package/dist/components/command-block.js +4 -4
- package/dist/components/command-palette.js +1 -1
- package/dist/components/confirm-dialog.js +1 -1
- package/dist/components/confirm-input.js +1 -1
- package/dist/components/console-overlay.js +1 -1
- package/dist/components/content-switcher.js +1 -1
- package/dist/components/controlled-scroll-view.d.ts +1 -1
- package/dist/components/controlled-scroll-view.js +1 -1
- package/dist/components/cursor.d.ts +1 -1
- package/dist/components/cursor.js +1 -1
- package/dist/components/date-picker.js +1 -1
- package/dist/components/definition-list.js +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/diff-view.js +1 -1
- package/dist/components/divider.js +1 -1
- package/dist/components/file-picker-entry.js +1 -1
- package/dist/components/form.js +1 -1
- package/dist/components/gauge.js +1 -1
- package/dist/components/gradient.js +1 -1
- package/dist/components/heading.js +1 -1
- package/dist/components/heatmap.js +1 -1
- package/dist/components/help.js +1 -1
- package/dist/components/histogram.js +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/line-chart.js +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/loading-indicator.js +1 -1
- package/dist/components/markdown.js +1 -1
- package/dist/components/masked-input.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/message-bubble.js +1 -1
- package/dist/components/model-badge.js +1 -1
- package/dist/components/multi-select.js +1 -1
- package/dist/components/newline.js +2 -2
- package/dist/components/operation-tree.js +1 -1
- package/dist/components/option-list.js +1 -1
- package/dist/components/ordered-list.js +1 -1
- package/dist/components/paginator.js +1 -1
- package/dist/components/paragraph.js +1 -1
- package/dist/components/placeholder.js +1 -1
- package/dist/components/progress-bar.js +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/scatter-plot.js +1 -1
- package/dist/components/scroll-bar-box.d.ts +1 -1
- package/dist/components/scroll-bar-box.js +1 -1
- package/dist/components/scroll-bar.d.ts +1 -1
- package/dist/components/scroll-bar.js +1 -1
- package/dist/components/scroll-list.d.ts +1 -1
- package/dist/components/scroll-list.js +1 -1
- package/dist/components/scroll-view.d.ts +1 -1
- package/dist/components/scroll-view.js +1 -1
- package/dist/components/search-input.js +1 -1
- package/dist/components/select-input-indicator.js +1 -1
- package/dist/components/select-input-item.js +1 -1
- package/dist/components/select-input.js +1 -1
- package/dist/components/shimmer-text.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/spacer.js +1 -1
- package/dist/components/sparkline.js +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/static-render.d.ts +1 -1
- package/dist/components/static-render.js +1 -1
- package/dist/components/static.js +1 -1
- package/dist/components/status-line.js +1 -1
- package/dist/components/status-message.js +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/stopwatch.js +1 -1
- package/dist/components/streaming-text.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/tab.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/text-input.js +1 -1
- package/dist/components/text.js +1 -1
- package/dist/components/textarea.js +2 -2
- package/dist/components/timer.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/transform.js +1 -1
- package/dist/components/transition.js +1 -1
- package/dist/components/tree-view-entry.d.ts +1 -1
- package/dist/components/tree-view-entry.js +1 -1
- package/dist/components/unordered-list.js +1 -1
- package/dist/core/index.js +1 -1
- package/dist/ink/hooks/use-animation.js +1 -1
- package/dist/ink/hooks/use-app.js +1 -1
- package/dist/ink/hooks/use-box-metrics.d.ts +1 -1
- package/dist/ink/hooks/use-box-metrics.js +1 -1
- package/dist/ink/hooks/use-clipboard.js +1 -1
- package/dist/ink/hooks/use-color-blindness.js +1 -1
- package/dist/ink/hooks/use-console-capture.js +1 -1
- package/dist/ink/hooks/use-cursor.js +1 -1
- package/dist/ink/hooks/use-focus-manager.js +1 -1
- package/dist/ink/hooks/use-focus.js +1 -1
- package/dist/ink/hooks/use-form.js +1 -1
- package/dist/ink/hooks/use-hotkey.js +1 -1
- package/dist/ink/hooks/use-input.js +2 -2
- package/dist/ink/hooks/use-interval.js +1 -1
- package/dist/ink/hooks/use-is-screen-reader-enabled.js +1 -1
- package/dist/ink/hooks/use-key-bindings.js +1 -1
- package/dist/ink/hooks/use-key-chord.js +1 -1
- package/dist/ink/hooks/use-linked-scroll.d.ts +1 -1
- package/dist/ink/hooks/use-linked-scroll.js +1 -1
- package/dist/ink/hooks/use-paste.js +1 -1
- package/dist/ink/hooks/use-persistent-state.d.ts +12 -3
- package/dist/ink/hooks/use-persistent-state.js +2 -2
- package/dist/ink/hooks/use-scroll-acceleration.js +1 -1
- package/dist/ink/hooks/use-scroll-input.js +1 -1
- package/dist/ink/hooks/use-stderr.js +1 -1
- package/dist/ink/hooks/use-stdin.js +1 -1
- package/dist/ink/hooks/use-stdout.js +1 -1
- package/dist/ink/hooks/use-stopwatch.js +1 -1
- package/dist/ink/hooks/use-terminal-palette.js +1 -1
- package/dist/ink/hooks/use-text-buffer.js +4 -4
- package/dist/ink/hooks/use-text-selection.d.ts +2 -2
- package/dist/ink/hooks/use-text-selection.js +1 -1
- package/dist/ink/hooks/use-timeout.js +1 -1
- package/dist/ink/hooks/use-timer.js +1 -1
- package/dist/ink/hooks/use-window-size.js +1 -1
- package/dist/ink/index.d.ts +17 -62
- package/dist/ink/index.js +1 -1
- package/dist/ink/mouse/use-element-position.d.ts +31 -0
- package/dist/ink/mouse/use-element-position.js +1 -0
- package/dist/ink/mouse/use-mouse-action.d.ts +5 -0
- package/dist/ink/mouse/use-mouse-action.js +1 -0
- package/dist/ink/mouse/use-mouse-position.d.ts +5 -0
- package/dist/ink/mouse/use-mouse-position.js +1 -0
- package/dist/ink/mouse/use-mouse.d.ts +5 -0
- package/dist/ink/mouse/use-mouse.js +1 -0
- package/dist/ink/mouse/use-on-mouse-click.d.ts +16 -0
- package/dist/ink/mouse/use-on-mouse-click.js +1 -0
- package/dist/ink/mouse/use-on-mouse-hover.d.ts +10 -0
- package/dist/ink/mouse/use-on-mouse-hover.js +1 -0
- package/dist/ink/mouse/use-on-mouse-state.d.ts +13 -0
- package/dist/ink/mouse/use-on-mouse-state.js +1 -0
- package/dist/packem_chunks/devtools.js +1 -1
- package/dist/packem_shared/COLOR_BLINDNESS_COMPENSATION-Ilnoyeqc.js +1 -0
- package/dist/packem_shared/ControlledScrollView-BoN5Oi-p.js +1 -0
- package/dist/packem_shared/DevTools-k6uiVzqv.js +1 -0
- package/dist/packem_shared/FilePicker-BLS9nOPz.js +1 -0
- package/dist/packem_shared/FocusContext-C2Sosxa4.js +1 -0
- package/dist/packem_shared/Fullscreen-BRhuBLBh.js +1 -0
- package/dist/packem_shared/IMECompositionBuffer-VhC9HRCv.js +1 -0
- package/dist/packem_shared/InputParser-CtwkCbrQ.js +2 -0
- package/dist/packem_shared/KEY-C--kOw41.js +1 -0
- package/dist/packem_shared/LayoutNode-LPYsuzBg.js +1 -0
- package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +1 -0
- package/dist/packem_shared/NAMED_COLORS-82DpREQV.js +1 -0
- package/dist/packem_shared/Range-BsVYNWtg.js +1 -0
- package/dist/packem_shared/Renderer-DsskdkUd.js +1 -0
- package/dist/packem_shared/ResizeObserver-aX8XOr2u.js +1 -0
- package/dist/packem_shared/ScrollBar-BKCK8jsb.js +1 -0
- package/dist/packem_shared/ScrollBarBox-CBhLo6eZ.js +1 -0
- package/dist/packem_shared/ScrollList-DyFyVs6I.js +1 -0
- package/dist/packem_shared/ScrollView-BEgrtSnt.js +1 -0
- package/dist/packem_shared/Static-DSzsElz4.js +1 -0
- package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +1 -0
- package/dist/packem_shared/TreeView-BsvLCsf0.js +1 -0
- package/dist/packem_shared/TuiApp-BPL8v1i1.js +1 -0
- package/dist/packem_shared/TuiContext-BNmP0lMY.js +3 -0
- package/dist/packem_shared/ansi-parser-DlgLtOYO.js +1 -0
- package/dist/packem_shared/ansi-tokenizer-BU67A126.js +1 -0
- package/dist/packem_shared/braille-ch3O5D7I.js +1 -0
- package/dist/packem_shared/calculateScroll-D4Y_JR4H.js +1 -0
- package/dist/packem_shared/calculateScrollbarLayout--eUVRLw7.js +1 -0
- package/dist/packem_shared/clearOsc52-BUpnQOav.js +1 -0
- package/dist/packem_shared/clearStringWidthCache-DKFjfJuB.js +1 -0
- package/dist/packem_shared/colorize-DU4YZkp3.js +1 -0
- package/dist/packem_shared/controlled-scroll-view-t55HU9L8.js +1 -0
- package/dist/packem_shared/createInlineLoop-BT40Wpmx.js +2 -0
- package/dist/packem_shared/createScreen-DoYpyL0V.js +3 -0
- package/dist/packem_shared/dom-rphpG0kf.js +1 -0
- package/dist/packem_shared/{dom.d-C1IxuLJ9.d.ts → dom.d-B4kXbaVY.d.ts} +35 -0
- package/dist/packem_shared/format-time-fjoQHMxD.js +1 -0
- package/dist/packem_shared/{getPathToRoot-BuAM_kmj.js → getPathToRoot-PDJeqiEH.js} +1 -1
- package/dist/packem_shared/input-utils-BSWCb4F_.js +1 -0
- package/dist/packem_shared/isIntersecting-Bo2npvMR.js +1 -0
- package/dist/packem_shared/isTerminalPaletteQuerySupported-BYzmqq9-.js +1 -0
- package/dist/packem_shared/kittyFlags-g8ALyoCU.js +1 -0
- package/dist/packem_shared/line-chart-C7CUrvVs.js +1 -0
- package/dist/packem_shared/load-native-root-binding-DDikxNox.js +1 -0
- package/dist/packem_shared/measure-element-Cs7_proT.js +2 -0
- package/dist/packem_shared/measure-text-B7juNq4Y.js +3 -0
- package/dist/packem_shared/mouse-context.d-BfL9xGk_.d.ts +30 -0
- package/dist/packem_shared/parseSgrMouse-bUrqPrh-.js +1 -0
- package/dist/packem_shared/processLayout-tAee0ytT.js +1 -0
- package/dist/packem_shared/reconciler-ClpU7Y-V.js +1 -0
- package/dist/packem_shared/reconciler-DhUGYWCr.js +1 -0
- package/dist/packem_shared/render-DFZ8NHlG.js +1 -0
- package/dist/packem_shared/render-v2x7ZRzT.js +24 -0
- package/dist/packem_shared/{render.d-DuyG0zip.d.ts → render.d-CBnYBDk2.d.ts} +1 -1
- package/dist/packem_shared/renderToString-C2YmVNLG.js +4 -0
- package/dist/packem_shared/renderToString-L_bpw4OQ.js +2 -0
- package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +2 -0
- package/dist/packem_shared/renderer-COXHo5Xk.js +17 -0
- package/dist/packem_shared/{selection.d-Dbha5bMS.d.ts → selection.d-CI3_p8wg.d.ts} +1 -1
- package/dist/packem_shared/squashTextNodesWithMap-BmUSBPfc.js +1 -0
- package/dist/packem_shared/stderr-context-Bvnik0hL.js +1 -0
- package/dist/packem_shared/stdin-context-88AhuztD.js +1 -0
- package/dist/packem_shared/text-width-e49vlbQH.js +2 -0
- package/dist/packem_shared/token-to-elements-D6J6-P2A.js +1 -0
- package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +1 -0
- package/dist/packem_shared/useTreeView-D5ifGwG3.js +1 -0
- package/dist/packem_shared/useTreeViewState-BiTJakkh.js +1 -0
- package/dist/packem_shared/utils-Bup8lyK8.js +1 -0
- package/dist/packem_shared/waitFor-CTAki32d.js +4 -0
- package/dist/packem_shared/wrapOrTruncateStyledLine-46W8bTtv.js +3 -0
- package/dist/react/index.js +1 -1
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/index.js +1 -1
- package/index.js +691 -539
- package/package.json +48 -23
- package/dist/packem_shared/COLOR_BLINDNESS_SIMULATION-DqErf7XX.js +0 -1
- package/dist/packem_shared/ControlledScrollView-CIc-x1Cx.js +0 -1
- package/dist/packem_shared/DevTools-ClAYpMVI.js +0 -1
- package/dist/packem_shared/FilePicker-tYj_CIau.js +0 -1
- package/dist/packem_shared/FocusContext-Xy0cwJpO.js +0 -1
- package/dist/packem_shared/Fullscreen-CxLd1-Zu.js +0 -1
- package/dist/packem_shared/IMECompositionBuffer-C89PhiOu.js +0 -1
- package/dist/packem_shared/InputParser-B_qZcN3r.js +0 -2
- package/dist/packem_shared/KEY-Bk8B-3h_.js +0 -1
- package/dist/packem_shared/LayoutNode-B8zej4dm.js +0 -1
- package/dist/packem_shared/MouseProvider-PnIUKURs.js +0 -1
- package/dist/packem_shared/NAMED_COLORS-B9fJsYdg.js +0 -1
- package/dist/packem_shared/Renderer-DJXooAsp.js +0 -1
- package/dist/packem_shared/ResizeObserverEntry-Dq0dk8Kq.js +0 -1
- package/dist/packem_shared/ScrollBar-U_37hlIT.js +0 -1
- package/dist/packem_shared/ScrollBarBox-DwiCxilX.js +0 -1
- package/dist/packem_shared/ScrollList-C7nZ9ufK.js +0 -1
- package/dist/packem_shared/ScrollView-DKZ8OM-m.js +0 -1
- package/dist/packem_shared/Static-DLynr5pn.js +0 -1
- package/dist/packem_shared/TreeNodeMap-CspqSCpb.js +0 -1
- package/dist/packem_shared/TreeView-C0Iv3et8.js +0 -1
- package/dist/packem_shared/TuiApp-BVDXP0Cv.js +0 -1
- package/dist/packem_shared/TuiContext-BoJvG3NN.js +0 -3
- package/dist/packem_shared/ansi-parser-B6uXaq65.js +0 -1
- package/dist/packem_shared/ansi-tokenizer-DqX9nJuk.js +0 -1
- package/dist/packem_shared/braille-BBjIoaN0.js +0 -1
- package/dist/packem_shared/colorize-DbTZMrJO.js +0 -1
- package/dist/packem_shared/comparePoints-C3NJirbh.js +0 -1
- package/dist/packem_shared/controlled-scroll-view-CcUS50jx.js +0 -1
- package/dist/packem_shared/createInlineLoop-DRNZ7jqH.js +0 -2
- package/dist/packem_shared/createScreen-CrLrxA6t.js +0 -3
- package/dist/packem_shared/dom-CXB-19sK.js +0 -1
- package/dist/packem_shared/format-time-C7Q-hQZq.js +0 -1
- package/dist/packem_shared/getScrollHeight-ClEOyLHH.js +0 -1
- package/dist/packem_shared/input-utils-fAxzSlNh.js +0 -1
- package/dist/packem_shared/isIntersecting-B3KbKTmu.js +0 -1
- package/dist/packem_shared/isOsc52Supported-DKK7Uee6.js +0 -1
- package/dist/packem_shared/isTerminalPaletteQuerySupported-Dn2hFAZ_.js +0 -1
- package/dist/packem_shared/kittyFlags-C3rZLbcK.js +0 -1
- package/dist/packem_shared/layout-BMo200nF.js +0 -2
- package/dist/packem_shared/line-chart-kf7uhR0K.js +0 -1
- package/dist/packem_shared/measure-text-Ce2widM1.js +0 -3
- package/dist/packem_shared/measureElement-BTtTFZg4.js +0 -1
- package/dist/packem_shared/parseSgrMouse-Ccj70ijb.js +0 -1
- package/dist/packem_shared/processLayout-FEKj_mWu.js +0 -1
- package/dist/packem_shared/reconciler-DIfG72R9.js +0 -1
- package/dist/packem_shared/reconciler-DYE5h4K4.js +0 -1
- package/dist/packem_shared/render-BRR1ESvR.js +0 -26
- package/dist/packem_shared/render-Dh7HMhK1.js +0 -1
- package/dist/packem_shared/renderToString-BbQiRHrd.js +0 -2
- package/dist/packem_shared/renderToString-vEQyGmv6.js +0 -4
- package/dist/packem_shared/renderTreeToBuffer-CZilzyhN.js +0 -2
- package/dist/packem_shared/renderer-maLLQcut.js +0 -17
- package/dist/packem_shared/setEnableStyledLineCache-DSbMbENc.js +0 -1
- package/dist/packem_shared/squashTextNodesWithMap-DCdi3SZ2.js +0 -1
- package/dist/packem_shared/stderr-context-BzEaUICS.js +0 -1
- package/dist/packem_shared/stdin-context-BTaaFagk.js +0 -1
- package/dist/packem_shared/text-width-BU2eeTWn.js +0 -2
- package/dist/packem_shared/token-to-elements-BAZpNZsu.js +0 -1
- package/dist/packem_shared/treeViewTheme-1RIZyB4M.js +0 -1
- package/dist/packem_shared/useElementDimensions-qJ_WXFZ9.js +0 -1
- package/dist/packem_shared/useMouseAction-2dRfU1vE.js +0 -1
- package/dist/packem_shared/useMouseContext-C746G7kY.js +0 -1
- package/dist/packem_shared/useMousePosition-BTWfV4JK.js +0 -1
- package/dist/packem_shared/useOnMouseClick-nY8xLZmt.js +0 -1
- package/dist/packem_shared/useOnMouseHover-D3DczIol.js +0 -1
- package/dist/packem_shared/useOnMouseState-cRK8QvzD.js +0 -1
- package/dist/packem_shared/useTreeView-BoMMeRPq.js +0 -1
- package/dist/packem_shared/useTreeViewState-CRPCUWrb.js +0 -1
- package/dist/packem_shared/utils-CoviI5Vm.js +0 -1
- package/dist/packem_shared/waitFor-Dj5zfL5s.js +0 -4
- package/dist/packem_shared/wrapOrTruncateStyledLine-C5rcIrNb.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,48 @@
|
|
|
1
|
+
## @visulima/tui [1.0.0-alpha.24](https://github.com/visulima/visulima/compare/@visulima/tui@1.0.0-alpha.23...@visulima/tui@1.0.0-alpha.24) (2026-06-13)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **tui:** guard Spinner against unknown spinner name ([94ea8fd](https://github.com/visulima/visulima/commit/94ea8fd639a6ae66799f42996f731720aa363c31))
|
|
6
|
+
* **tui:** harden persistent-state and fix export/sideeffects drift ([40a0dbe](https://github.com/visulima/visulima/commit/40a0dbedc317af0e02d2e87314295c66c276991f))
|
|
7
|
+
|
|
8
|
+
### Performance Improvements
|
|
9
|
+
|
|
10
|
+
* **tui:** avoid per-keystroke Key allocation and double key-enumeration in prepareUpdate ([f87f6c7](https://github.com/visulima/visulima/commit/f87f6c789324b21ca49c8415b71ba95bdfc94ac2))
|
|
11
|
+
|
|
12
|
+
### Documentation
|
|
13
|
+
|
|
14
|
+
* **tui:** correct sideEffects guidance ([e41d2bb](https://github.com/visulima/visulima/commit/e41d2bb33807d227b94eba973dcf6fa21e01566c))
|
|
15
|
+
|
|
16
|
+
### Code Refactoring
|
|
17
|
+
|
|
18
|
+
* **tui:** reformat NAPI loader and src to prettier style ([38f99e5](https://github.com/visulima/visulima/commit/38f99e521be081fefb134e0ad25172fbb4de2965))
|
|
19
|
+
* **tui:** unify napi root-binding loader ([84172fc](https://github.com/visulima/visulima/commit/84172fcb8675881313066fd5dc96d2d452e1d3f2))
|
|
20
|
+
|
|
21
|
+
### Tests
|
|
22
|
+
|
|
23
|
+
* **tui:** de-flake toggle focus management ([ceb4007](https://github.com/visulima/visulima/commit/ceb4007728f7e97894ec2a0734acc2f1f5edca78))
|
|
24
|
+
* **tui:** skip flaky suspense-animation test on macos ([68e3933](https://github.com/visulima/visulima/commit/68e3933f7756a0a40427d93e09c060858a62e5e4))
|
|
25
|
+
|
|
26
|
+
### Build System
|
|
27
|
+
|
|
28
|
+
* **deps:** update tui dependencies ([7bd603d](https://github.com/visulima/visulima/commit/7bd603db3d0efa7f5e8d5427df34d9bdc4b747dd))
|
|
29
|
+
* regenerate bundled-license manifests and types ordering ([af26588](https://github.com/visulima/visulima/commit/af26588d75aaa937fd4862800560bd4070a4878c))
|
|
30
|
+
|
|
31
|
+
### Continuous Integration
|
|
32
|
+
|
|
33
|
+
* stabilize flaky tests and drop markdown lint ([91e110a](https://github.com/visulima/visulima/commit/91e110a30b1ef8ca16f0632253a9e4d13856d8f9))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Dependencies
|
|
37
|
+
|
|
38
|
+
* **@visulima/ansi:** upgraded to 4.0.0-alpha.17
|
|
39
|
+
* **@visulima/colorize:** upgraded to 2.0.0-alpha.14
|
|
40
|
+
* **@visulima/error:** upgraded to 6.0.0-alpha.33
|
|
41
|
+
* **@visulima/spinner:** upgraded to 1.0.0-alpha.4
|
|
42
|
+
* **@visulima/string:** upgraded to 3.0.0-alpha.17
|
|
43
|
+
* **@visulima/boxen:** upgraded to 3.0.0-alpha.14
|
|
44
|
+
* **@visulima/tabular:** upgraded to 4.0.0-alpha.14
|
|
45
|
+
|
|
1
46
|
## @visulima/tui [1.0.0-alpha.23](https://github.com/visulima/visulima/compare/@visulima/tui@1.0.0-alpha.22...@visulima/tui@1.0.0-alpha.23) (2026-06-04)
|
|
2
47
|
|
|
3
48
|
|
package/README.md
CHANGED
|
@@ -132,6 +132,23 @@ const Spinner = () => {
|
|
|
132
132
|
|
|
133
133
|
Returns `{ frame, time, delta, reset }`. See the [full hooks reference](https://visulima.com/packages/tui/hooks#useanimation) for detailed return values, more examples (sine waves, physics, pausable, reset), and `maxFps` interaction.
|
|
134
134
|
|
|
135
|
+
The full list of hooks (each at `@visulima/tui/hooks/<name>`): `use-animation`, `use-app`, `use-box-metrics`, `use-clipboard`, `use-color-blindness`, `use-console-capture`, `use-cursor`, `use-element-position`, `use-focus`, `use-focus-manager`, `use-form`, `use-hotkey`, `use-input`, `use-interval`, `use-is-screen-reader-enabled`, `use-key-bindings`, `use-key-chord`, `use-linked-scroll`, `use-mouse`, `use-mouse-action`, `use-mouse-position`, `use-on-mouse-click`, `use-on-mouse-hover`, `use-on-mouse-state`, `use-paste`, `use-persistent-state`, `use-scroll-acceleration`, `use-scroll-input`, `use-stderr`, `use-stdin`, `use-stdout`, `use-stopwatch`, `use-terminal-palette`, `use-text-buffer`, `use-text-selection`, `use-timeout`, `use-timer`, `use-window-size`. See the [hooks reference](https://visulima.com/packages/tui/hooks) for details.
|
|
136
|
+
|
|
137
|
+
## Component Catalog
|
|
138
|
+
|
|
139
|
+
`@visulima/tui` ships 90+ components, each at its own subpath `@visulima/tui/components/<name>`:
|
|
140
|
+
|
|
141
|
+
- **Layout & text**: `box`, `text`, `paragraph`, `heading`, `divider`, `spacer`, `newline`, `transform`, `gradient`, `big-text`, `shimmer-text`, `streaming-text`, `placeholder`, `link`, `kbd`, `code`, `markdown`, `diff-view`.
|
|
142
|
+
- **Lists & data**: `ordered-list`, `unordered-list`, `definition-list`, `option-list`, `table`, `tree-view`, `operation-tree`, `breadcrumb`, `paginator`, `tag`, `badge`, `model-badge`.
|
|
143
|
+
- **Inputs & forms**: `text-input`, `textarea`, `masked-input`, `search-input`, `confirm-input`, `select-input` (`select-input-item`, `select-input-indicator`), `multi-select`, `checkbox`, `radio-group`, `switch`, `slider`, `date-picker`, `calendar`, `form`, `button`, `file-picker`.
|
|
144
|
+
- **Feedback & status**: `alert`, `toast`, `status-line`, `status-message`, `progress-bar`, `gauge`, `spinner`, `loading-indicator`, `blink-dot`, `stepper`, `timer`, `stopwatch`, `cursor`.
|
|
145
|
+
- **Overlays & navigation**: `dialog`, `confirm-dialog`, `approval-prompt`, `command-palette`, `command-block`, `menu`, `tooltip`, `tab`, `tabs`, `content-switcher`, `accordion`, `collapsible`, `help`, `console-overlay`, `message-bubble`.
|
|
146
|
+
- **Charts & viz**: `area-chart`, `bar-chart`, `line-chart`, `scatter-plot`, `histogram`, `heatmap`, `sparkline`, `canvas`, `card`.
|
|
147
|
+
- **Scrolling**: `scroll-view`, `controlled-scroll-view`, `scroll-list`, `scroll-bar`, `scroll-bar-box`.
|
|
148
|
+
- **Animation & rendering**: `animate-presence`, `transition`, `static`, `static-render`.
|
|
149
|
+
|
|
150
|
+
Browse the live gallery and per-component APIs in the [component docs](https://visulima.com/packages/tui/components).
|
|
151
|
+
|
|
135
152
|
## Documentation
|
|
136
153
|
|
|
137
154
|
Full documentation, API reference, component gallery, and guides are available at:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as m,jsxs as a}from"react/jsx-runtime";import{useState as b,useRef as F,useCallback as v}from"react";import j from"../ink/hooks/use-focus.js";import k from"../ink/hooks/use-input.js";import{Box as u}from"./box.js";import{Text as A}from"./text.js";function M({accentColor:g="blue",allowMultiple:d=!1,autoFocus:w=!1,defaultExpanded:i,isDisabled:c=!1,items:l}){const{isFocused:s}=j({autoFocus:w,isActive:!c}),[C,D]=b(()=>i===void 0||i.length===0?[]:d?i:i.slice(0,1)),[f,p]=b(0),n=F(f);n.current=f;const x=v(r=>{D(e=>{const o=e.includes(r);return d?o?e.filter(t=>t!==r):[...e,r]:o?[]:[r]})},[d]);return k(v((r,e)=>{if(!s)return;const o=l.length;if((e.downArrow||r==="j")&&n.current<o-1)p(n.current+1);else if((e.upArrow||r==="k")&&n.current>0)p(n.current-1);else if(e.return||r===" "){const t=l[n.current];t&&x(t.id)}},[s,l,x]),{isActive:!c&&s}),m(u,{flexDirection:"column",children:l.map((r,e)=>{const o=C.includes(r.id),t=s&&e===f,h=t?g:void 0;return a(u,{flexDirection:"column",children:[a(u,{children:[a(A,{color:h,dimColor:c,children:[t?"▸ ":" ",o?"▼ ":"▶ "]}),m(A,{bold:t,color:h,dimColor:c,children:r.title})]}),o?m(u,{flexDirection:"column",marginBottom:1,marginLeft:4,children:r.content}):void 0]},r.id)})})}export{M as Accordion,M as default};
|
package/dist/components/alert.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as l,jsx as r}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Text as i}from"./text.js";import{o as f}from"../packem_shared/variant-config-BJqpNo7H.js";function p({children:t,title:e,variant:d}){const{color:n,icon:c}=f[d];return l(o,{borderColor:n,borderStyle:"round",flexGrow:1,gap:1,paddingX:1,children:[r(o,{flexShrink:0,children:r(i,{color:n,children:c})}),l(o,{flexDirection:"column",flexGrow:1,flexShrink:1,gap:1,minWidth:0,children:[e?r(i,{bold:!0,children:e}):void 0,r(i,{children:t})]})]})}export{p as Alert,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as y}from"react/jsx-runtime";import{useState as k,Children as f,isValidElement as a,useEffect as w,useCallback as d,cloneElement as m}from"react";import{Box as E}from"./box.js";const p=s=>{const{key:r}=s;if(r!==null)return r},x=s=>s.type?.isAnimatable===!0?!0:typeof s.props=="object"&&s.props!==null&&"show"in s.props;function A({children:s}){const[r,c]=k(()=>{const e=[];return f.forEach(s,t=>{if(!a(t))return;const n=p(t);n!==void 0&&e.push({element:t,key:n,show:!0})}),e});w(()=>{const e=new Map;f.forEach(s,t=>{if(!a(t))return;const n=p(t);n!==void 0&&e.set(n,t)}),c(t=>{const n=[],i=new Set;let l=!1;for(const o of t)if(e.has(o.key)){const u=e.get(o.key);(!o.show||o.element!==u)&&(l=!0),n.push({element:u,key:o.key,show:!0}),i.add(o.key)}else o.show&&(l=!0),n.push({...o,show:!1});for(const[o,u]of e)i.has(o)||(l=!0,n.push({element:u,key:o,show:!0}));return l?n:t})},[s]);const h=d(e=>{c(t=>t.filter(n=>n.key!==e))},[]);return y(E,{flexDirection:"column",children:r.map(e=>{if(!x(e.element))return m(e.element,{key:e.key});const t=e.element.props.onExit;return m(e.element,{key:e.key,onExit:()=>{t?.(),h(e.key)},show:e.show})})})}export{A as AnimatePresence,A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as n,jsx as o}from"react/jsx-runtime";import{useCallback as v}from"react";import x from"../ink/hooks/use-focus.js";import S from"../ink/hooks/use-input.js";import{Box as i}from"./box.js";import{Text as e}from"./text.js";const C={high:"red",low:"green",medium:"yellow"},k={high:"HIGH RISK",low:"LOW RISK",medium:"MEDIUM RISK"},A=r=>{if(r===null)return"null";if(typeof r=="string")return r;if(typeof r=="number"||typeof r=="boolean")return String(r);try{return JSON.stringify(r)}catch{return String(r)}};function O({accentColor:r,autoFocus:b=!0,children:u,description:m,isDisabled:h=!1,onDecision:l,params:p,risk:f="medium",tool:y}){const d=C[f],a=r??d,{isFocused:w}=x({autoFocus:b,isActive:!h});S(v((t,c)=>{const s=t.toLowerCase();if(s==="y"||c.return){l("allow-once");return}if(s==="a"){l("allow-always");return}(s==="n"||c.escape)&&l("deny")},[l]),{isActive:!h&&w});const g=p===void 0?[]:Object.entries(p);return n(i,{borderColor:d,borderStyle:"round",flexDirection:"column",paddingX:1,children:[n(i,{children:[n(e,{backgroundColor:d,color:"black",children:[" ",k[f]," "]}),n(e,{children:[" ",o(e,{bold:!0,children:y})]})]}),m===void 0?void 0:o(i,{marginTop:1,children:o(e,{children:m})}),g.length===0?void 0:o(i,{flexDirection:"column",marginTop:1,children:g.map(([t,c])=>n(i,{children:[n(e,{color:"cyan",children:[t,"="]}),o(e,{wrap:"truncate-end",children:A(c)})]},t))}),u===void 0?void 0:o(i,{marginTop:1,children:u}),o(i,{marginTop:1,children:n(e,{children:["Allow? [",o(e,{bold:!0,color:a,children:"y"}),"es /"," ",o(e,{bold:!0,color:a,children:"a"}),"lways /"," ",o(e,{bold:!0,color:a,children:"n"}),"o ]"]})})]})}export{O as ApprovalPrompt,O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as b,jsx as m}from"react/jsx-runtime";import{useMemo as A}from"react";import{c as P}from"../packem_shared/braille-ch3O5D7I.js";import{Box as M}from"./box.js";import{Canvas as Y}from"./canvas.js";import{t as _,p as F,c as L,D,a as u}from"../packem_shared/line-chart-C7CUrvVs.js";import{Text as w}from"./text.js";const S=D,V={heavy:"▓",light:"░",medium:"▒"};function H({axisColor:I="gray",fillDensity:y="medium",height:g=10,maxY:p,minY:h,palette:d=S,series:f,showLegend:C=!0,width:N=40}){const s=A(()=>{const o=f.map((r,c)=>({color:F(r,c,d),points:_(r.data),series:r})),t=L(o);return{list:o,xMax:t.xMax===Number.NEGATIVE_INFINITY?1:t.xMax,xMin:t.xMin===Number.POSITIVE_INFINITY?0:t.xMin,yMax:p??(t.yMax===Number.NEGATIVE_INFINITY?1:t.yMax),yMin:h??(t.yMin===Number.POSITIVE_INFINITY?0:t.yMin)}},[f,d,h,p]),T=V[y];return b(M,{flexDirection:"column",children:[m(Y,{draw:o=>{o.clear();const t=o.width*2,r=o.height*4,c={xMax:s.xMax,xMin:s.xMin,yMax:s.yMax,yMin:s.yMin};for(const{color:a,points:n}of s.list)if(n.length!==0)for(let l=0;l<o.width;l+=1){let i;for(const e of n){const{px:x,py:v}=u(e,c,t,r);if(Math.floor(x/2)===l){const E=Math.floor(v/4);(i===void 0||E<i)&&(i=E)}}if(i!==void 0)for(let e=i+1;e<o.height;e+=1)o.setCell(l,e,T,{color:a,dim:!0})}for(let a=0;a<o.width;a+=2)o.setCell(a,o.height-1,"·",{color:I,dim:!0});for(const{color:a,points:n}of s.list){if(n.length===0)continue;const l=P(o.width,o.height);let i=u(n[0],c,t,r);l.plotPoint(i.px,i.py);for(let e=1;e<n.length;e+=1){const x=u(n[e],c,t,r);l.plotLine(i.px,i.py,x.px,x.py),i=x}l.flush(o,{bold:!0,color:a})}},height:g,version:[f,N,g,h,p,y,I,d],width:N}),C?m(M,{gap:2,marginTop:1,children:s.list.map(({color:o,series:t},r)=>b(M,{gap:1,children:[m(w,{color:o,children:T}),m(w,{children:t.label??`Series ${r+1}`})]},`${r}:${t.label??""}`))}):void 0]})}export{H as AreaChart,H as default};
|
package/dist/components/badge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as a,jsx as n}from"react/jsx-runtime";import{Text as o}from"./text.js";function l({children:r,color:t="magenta"}){const e=typeof r=="string"?r.toUpperCase():r;return a(o,{backgroundColor:t,children:[" ",n(o,{color:"black",children:e})," "]})}export{l as Badge,l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as e,jsxs as B}from"react/jsx-runtime";import{useMemo as E}from"react";import{Box as o}from"./box.js";import{Canvas as C}from"./canvas.js";import{Text as p}from"./text.js";const j=["cyan","magenta","yellow","green","blue","red"],D=(r,t)=>{if(t!==void 0)return t;if(r.length===0)return 0;let a=r[0].value;for(let u=1;u<r.length;u+=1){const{value:h}=r[u];h>a&&(a=h)}return a},S=(r,t,a)=>a.color??t[r%t.length]??"cyan";function z({data:r,height:t=10,max:a,orientation:u="vertical",palette:h=j,showLabels:w=!0,showValues:g=!1,width:k}){const c=E(()=>D(r,a),[r,a]);if(u==="horizontal"){const i=k??24;return e(o,{flexDirection:"column",children:r.map((l,s)=>{const v=c===0?0:l.value/c,m=S(s,h,l);return B(o,{gap:1,children:[w&&l.label!==void 0?e(o,{flexShrink:0,minWidth:8,children:e(p,{dimColor:!0,wrap:"truncate-end",children:l.label})}):void 0,e(o,{flexGrow:1,flexShrink:1,children:e(C,{draw:f=>{f.clear(),f.drawHBar(0,0,i,v,{color:m})},height:1,version:[l.value,c,m,i],width:i})}),g?e(o,{flexShrink:0,children:e(p,{children:String(l.value)})}):void 0]},s)})})}const n=2,d=1,b=k??Math.max(r.length*(n+d),1);return B(o,{flexDirection:"column",children:[e(C,{draw:i=>{i.clear(),r.forEach((l,s)=>{const v=c===0?0:l.value/c,m=S(s,h,l),f=s*(n+d);for(let x=0;x<n;x+=1)i.drawVBar(f+x,0,t,v,{color:m})})},height:t,version:[r,c,h,n,d,t],width:b}),g?e(o,{children:r.map((i,l)=>e(o,{width:n+d,children:e(p,{dimColor:!0,children:String(i.value).padEnd(n+d," ")})},l))}):void 0,w?e(o,{children:r.map((i,l)=>e(o,{width:n+d,children:e(p,{dimColor:!0,wrap:"truncate-end",children:(i.label??"").padEnd(n+d," ")})},l))}):void 0]})}export{z as BarChart,z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import m from"cfonts";import{useMemo as p}from"react";import{Text as f}from"./text.js";const u={align:"left",backgroundColor:"transparent",colors:["system"],font:"block",letterSpacing:1,lineHeight:1,maxLength:0,space:!0};function b({align:t,backgroundColor:e,colors:o,font:r,letterSpacing:n,lineHeight:a,maxLength:i,space:c,text:g}){const l=p(()=>m.render(g,{...u,align:t,backgroundColor:e,colors:o,font:r,letterSpacing:n,lineHeight:a,maxLength:i,space:c}),[g,t,e,o,r,n,a,i,c]);return s(f,{children:l&&l.string})}export{b as BigText,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";import l from"../ink/hooks/use-animation.js";import{Text as m}from"./text.js";function h({character:t="●",color:o="red",interval:e=800,isActive:r=!0}){const{frame:i}=l({interval:Math.max(1,Math.floor(e/2)),isActive:r}),a=!r||i%2===0;return c(m,{color:o,children:a?t:" "})}export{h as BlinkDot,h as default};
|
package/dist/components/box.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactNode, PropsWithChildren, RefAttributes, ForwardRefExoticComponent } from 'react';
|
|
2
2
|
import { Except } from 'type-fest';
|
|
3
|
-
import { D as DOMElement } from "../packem_shared/dom.d-
|
|
3
|
+
import { D as DOMElement } from "../packem_shared/dom.d-B4kXbaVY.js";
|
|
4
4
|
import { S as Styles } from "../packem_shared/styles.d-cMo36xQz.js";
|
|
5
5
|
import 'yoga-layout';
|
|
6
6
|
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as a,jsxs as o,Fragment as d}from"react/jsx-runtime";import{Fragment as c}from"react";import{Box as s}from"./box.js";import{Text as l}from"./text.js";function b({currentColor:n="blue",items:i,separator:m="›"}){return a(s,{children:i.map((r,e)=>{const t=e===i.length-1;return o(c,{children:[e>0?o(l,{dimColor:!0,children:[" ",m," "]}):void 0,o(l,{bold:t,color:t?n:void 0,dimColor:!t,children:[r.icon===void 0?void 0:o(d,{children:[r.icon," "]}),r.label]})]},r.key??`${e}:${r.label}`)})})}export{b as Breadcrumb,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as d,jsxs as f}from"react/jsx-runtime";import{useCallback as p}from"react";import b from"../ink/hooks/use-focus.js";import g from"../ink/hooks/use-input.js";import{Box as e}from"./box.js";import{Text as c}from"./text.js";const h="round",y=(i,s,a,r)=>{if(!a){if(i==="primary"&&s)return"black";if(s)return r}};function A({accentColor:i="blue",autoFocus:s=!1,children:a,isDisabled:r=!1,onPress:l,variant:n="primary"}){const{isFocused:o}=b({autoFocus:s,isActive:!r});g(p((m,u)=>{o&&(u.return||m===" ")&&l?.()},[o,l]),{isActive:!r&&o});const t=y(n,o,r,i);return n==="ghost"?d(e,{paddingX:1,children:f(c,{bold:o,color:t,dimColor:r,children:[o?"▸ ":" ",a]})}):d(e,{backgroundColor:n==="primary"&&o?i:void 0,borderColor:n==="outline"?o?i:"gray":n==="secondary"||o?i:void 0,borderStyle:h,paddingX:1,children:d(c,{bold:o,color:t,dimColor:r,children:a})})}export{A as Button,A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as y,jsx as u}from"react/jsx-runtime";import{useMemo as w,useState as V,useRef as W,useCallback as S}from"react";import I from"../ink/hooks/use-focus.js";import K from"../ink/hooks/use-input.js";import{Box as h}from"./box.js";import{Text as b}from"./text.js";const P=["January","February","March","April","May","June","July","August","September","October","November","December"],k=["Su","Mo","Tu","We","Th","Fr","Sa"],p=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),x=(e,r)=>{const i=e.getFullYear(),l=e.getMonth()+r,g=new Date(i,l+1,0).getDate(),a=Math.min(e.getDate(),g);return new Date(i,l,a)},T=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),J=(e,r,i)=>r!==void 0&&e<p(r)||i!==void 0&&e>p(i),X=(e,r,i)=>{const l=(new Date(e,r,1).getDay()-i+7)%7,g=new Date(e,r+1,0).getDate(),a=[];for(let o=0;o<l;o+=1)a.push(void 0);for(let o=1;o<=g;o+=1)a.push(new Date(e,r,o));for(;a.length%7!==0;)a.push(void 0);const D=[];for(let o=0;o<a.length;o+=7)D.push(a.slice(o,o+7));return D};function Z({accentColor:e="blue",autoFocus:r=!1,defaultValue:i,firstDayOfWeek:l=1,isDisabled:g=!1,maxDate:a,minDate:D,onChange:o,onSubmit:F,selectedColor:$="green",value:f}){const{isFocused:m}=I({autoFocus:r,isActive:!g}),M=w(()=>p(new Date),[]),j=p(f??i??M),[O,B]=V(j),c=f?p(f):O,v=W(c);v.current=c;const E=w(()=>[...k.slice(l),...k.slice(0,l)],[l]),N=w(()=>X(c.getFullYear(),c.getMonth(),l),[c,l]),d=S(s=>{const n=p(s);J(n,D,a)||(f===void 0&&B(n),o?.(n))},[f,o,D,a]);K(S((s,n)=>{if(!m)return;const{current:t}=v;n.leftArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-1)):n.rightArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+1)):n.upArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()-7)):n.downArrow?d(new Date(t.getFullYear(),t.getMonth(),t.getDate()+7)):n.pageUp?d(x(t,-1)):n.pageDown?d(x(t,1)):n.return&&F?.(t)},[m,d,F]),{isActive:!g&&m});const R=`${P[c.getMonth()]} ${c.getFullYear()}`;return y(h,{borderColor:m?e:void 0,borderStyle:"round",flexDirection:"column",paddingX:1,children:[u(h,{justifyContent:"center",children:u(b,{bold:!0,color:e,children:R})}),u(h,{marginTop:1,children:E.map(s=>u(h,{width:3,children:u(b,{dimColor:!0,children:s.padEnd(2," ")})},s))}),N.map((s,n)=>u(h,{children:s.map((t,C)=>{if(t===void 0)return u(h,{width:3,children:u(b,{children:" "})},C);const Y=T(t,M),A=T(t,c),U=J(t,D,a);return u(h,{width:3,children:y(b,{backgroundColor:A&&m?e:void 0,bold:Y,color:A&&m?"black":Y?$:void 0,dimColor:U||g,children:[String(t.getDate()).padStart(2," ")," "]})},C)})},n))]})}export{Z as Calendar,Z as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { C as CanvasContext } from "../packem_shared/buffer.d-EJkZr8uH.js";
|
|
3
|
-
export {
|
|
3
|
+
export type { a as CanvasColor, b as CellStyle } from "../packem_shared/buffer.d-EJkZr8uH.js";
|
|
4
4
|
type Props = {
|
|
5
5
|
/**
|
|
6
6
|
* Imperative draw callback. Mutates the underlying typed-array buffer via
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as $}from"react/jsx-runtime";import{useRef as k,useMemo as _,Fragment as j}from"react";import{a as D}from"../packem_shared/colorize-DU4YZkp3.js";import{Box as z}from"./box.js";import{Text as E}from"./text.js";const T=Math.trunc(1),I=2,A=32,F=0,H=()=>{const c=new Map,r=[void 0];return{decode:l=>r[l],encode:l=>{if(l===void 0)return F;const h=typeof l=="number"?`n:${l}`:`s:${l}`,u=c.get(h);if(u!==void 0)return u;const w=r.length;return r.push(l),c.set(h,w),w}}},C=[9601,9602,9603,9604,9605,9606,9607,9608],S=[9615,9614,9613,9612,9611,9610,9609,9608],U=9608,L=c=>{if(!c)return 0;let r=0;return c.bold&&(r|=T),c.dim&&(r|=I),r},P=c=>typeof c=="number"?c:c.codePointAt(0)??A,O=(c,r)=>{const l=Math.max(0,c*r),h=new Uint32Array(l),u=new Uint32Array(l),w=new Int32Array(l),x=new Int32Array(l),y=new Uint8Array(r),{decode:p,encode:m}=H();h.fill(A);const b=n=>{n>=0&&n<r&&(y[n]=1)},g=(n,t,s,i)=>{if(n<0||n>=c||t<0||t>=r)return;const e=t*c+n,d=P(s),a=m(i?.color),o=m(i?.background),f=L(i);h[e]===d&&u[e]===f&&w[e]===a&&x[e]===o||(h[e]=d,u[e]=f,w[e]=a,x[e]=o,y[t]=1)};return{bg:x,chars:h,colorDecoder:p,context:{clear:()=>{h.fill(A),u.fill(0),w.fill(0),x.fill(0),y.fill(1)},drawHBar:(n,t,s,i,e)=>{if(s<=0||t<0||t>=r)return;const d=Math.max(0,Math.min(1,i)),a=s*S.length,o=Math.round(d*a),f=Math.floor(o/S.length),B=o%S.length;for(let M=0;M<s;M+=1){const v=n+M;M<f?g(v,t,U,e):M===f&&B>0?g(v,t,S[B-1],e):g(v,t,A,e)}b(t)},drawRect:(n,t,s,i,e,d)=>{if(s<=0||i<=0)return;const a=P(e);for(let o=0;o<i;o+=1){for(let f=0;f<s;f+=1)g(n+f,t+o,a,d);b(t+o)}},drawText:(n,t,s,i)=>{if(t<0||t>=r||s.length===0)return;let e=0;for(const d of s)g(n+e,t,d,i),e+=1;b(t)},drawVBar:(n,t,s,i,e)=>{if(s<=0||n<0||n>=c)return;const d=Math.max(0,Math.min(1,i)),a=s*C.length,o=Math.round(d*a),f=Math.floor(o/C.length),B=o%C.length;for(let M=0;M<s;M+=1){const v=s-M-1,R=t+M;v<f?g(n,R,U,e):v===f&&B>0?g(n,R,C[B-1],e):g(n,R,A,e),b(R)}},height:r,setCell:g,width:c},dirty:y,fg:w,height:r,styles:u,width:c}},V=(c,r)=>{const{bg:l,chars:h,colorDecoder:u,fg:w,styles:x,width:y}=c,p=r*y;let m="",b=0,g=x[p],n=w[p],t=l[p];const s=i=>{let e="";for(let f=b;f<i;f+=1)e+=String.fromCodePoint(h[p+f]);const d=u(n),a=u(t);let o=e;d!==void 0&&(o=D(o,typeof d=="number"?String(d):d,"foreground")),a!==void 0&&(o=D(o,typeof a=="number"?String(a):a,"background")),(g&T)!==0&&(o=`\x1B[1m${o}\x1B[22m`),(g&I)!==0&&(o=`\x1B[2m${o}\x1B[22m`),m+=o};for(let i=1;i<y;i+=1){const e=x[p+i],d=w[p+i],a=l[p+i];(e!==g||d!==n||a!==t)&&(s(i),b=i,g=e,n=d,t=a)}return s(y),m};function Q({draw:c,height:r,version:l,width:h}){const u=k(void 0),w=k(void 0);(u.current?.width!==h||u.current.height!==r)&&(u.current=O(h,r),w.current={hasRendered:!1,lines:Array.from({length:r}).fill("")});const x=u.current,y=w.current,p=_(()=>{c(x.context);for(let m=0;m<x.height;m+=1)y.hasRendered&&x.dirty[m]===0||(y.lines[m]=V(x,m),x.dirty[m]=0);return y.hasRendered=!0,[...y.lines]},[l,h,r]);return $(z,{flexDirection:"column",flexShrink:0,height:r,width:h,children:p.map((m,b)=>$(j,{children:$(E,{wrap:"truncate-end",children:m})},b))})}export{Q as Canvas,Q as default};
|
package/dist/components/card.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as r,jsx as i}from"react/jsx-runtime";import{Box as o}from"./box.js";import{Divider as u}from"./divider.js";import{Text as c}from"./text.js";function b({borderColor:m,borderStyle:h="round",children:a,footer:l,headerRight:e,subtitle:d,title:t,titleColor:f,width:n}){return r(o,{borderColor:m,borderStyle:h,flexDirection:"column",paddingX:1,width:n,children:[t!==void 0||d!==void 0||e!==void 0?r(o,{flexDirection:"column",marginBottom:1,children:[r(o,{justifyContent:"space-between",children:[i(o,{children:t===void 0?void 0:i(c,{bold:!0,color:f,children:t})}),e===void 0?void 0:i(o,{children:e})]}),d===void 0?void 0:i(c,{dimColor:!0,children:d})]}):void 0,i(o,{flexDirection:"column",children:a}),l===void 0?void 0:r(o,{flexDirection:"column",marginTop:1,children:[i(u,{dimColor:!0,length:typeof n=="number"?Math.max(1,n-4):void 0}),i(o,{marginTop:1,children:l})]})]})}export{b as Card,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as d,jsx as v}from"react/jsx-runtime";import{useState as C,useCallback as x}from"react";import b from"../ink/hooks/use-focus.js";import k from"../ink/hooks/use-input.js";import{Box as F}from"./box.js";import{Text as l}from"./text.js";const g="☒",j="☐";function q({accentColor:s="blue",autoFocus:m=!1,children:c,defaultChecked:n=!1,isChecked:i,isDisabled:e=!1,onChange:t}){const{isFocused:o}=b({autoFocus:m,isActive:!e}),[u,f]=C(n),r=i??u;return k(x((h,p)=>{if(o&&(p.return||h===" ")){const a=!r;i===void 0&&f(a),t?.(a)}},[o,r,i,t]),{isActive:!e&&o}),d(F,{gap:1,children:[d(l,{color:o?s:void 0,dimColor:e,children:[o?"▸ ":" ",r?g:j]}),c===void 0?void 0:v(l,{color:o?s:void 0,dimColor:e,children:c})]})}export{q as Checkbox,q as default};
|
package/dist/components/code.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
`),
|
|
1
|
+
import{jsx as m,jsxs as d}from"react/jsx-runtime";import{useState as w,useRef as S,useEffect as T}from"react";import{r as b,i as v,w as y,g as C,t as j}from"../packem_shared/token-to-elements-D6J6-P2A.js";import{Box as p}from"./box.js";import{Text as x}from"./text.js";function q({code:o,highlightLines:c,language:s,showLineNumbers:i=!1,startLine:a=1,theme:l="github-dark-default"}){const[f,u]=w(null),t=S(!1);T(()=>{t.current=!1;const e=s?b(s):"text";if(e!=="text"&&!v(e)){u(null);return}return(async()=>{try{const r=await y(e==="text"?[]:[e],l),n=C(r,o,e,l);t.current||u(n.tokens)}catch{t.current||u(null)}})(),()=>{t.current=!0}},[o,s,l]);const L={highlightLines:c,showLineNumbers:i,startLine:a};if(f)return j(f,L);const h=o.split(`
|
|
2
|
+
`),k=i?String(a+h.length-1).length:0;return m(p,{flexDirection:"column",children:h.map((e,r)=>{const n=a+r,g=c?.has(n)??!1;return d(p,{children:[i?d(x,{color:g?"yellow":void 0,dimColor:!g,children:[String(n).padStart(k)," "]}):void 0,m(x,{children:e})]},r)})})}export{q as Code,q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as a,jsx as l}from"react/jsx-runtime";import{useState as C,useCallback as g}from"react";import D from"../ink/hooks/use-focus.js";import F from"../ink/hooks/use-input.js";import{Box as t}from"./box.js";import{Text as d}from"./text.js";function L({accentColor:c="blue",autoFocus:m=!1,children:f,defaultOpen:u=!1,isDisabled:o=!1,isOpen:r,onToggle:s,title:p}){const{isFocused:e}=D({autoFocus:m,isActive:!o}),[x,b]=C(u),i=r??x;return F(g((h,v)=>{if(v.return||h===" "){const n=!i;r===void 0&&b(n),s?.(n)}},[i,r,s]),{isActive:!o&&e}),a(t,{flexDirection:"column",children:[a(t,{children:[l(d,{color:e?c:void 0,dimColor:o,children:i?"▼ ":"▶ "}),l(d,{bold:e,color:e?c:void 0,dimColor:o,children:p})]}),i?l(t,{flexDirection:"column",marginLeft:2,children:f}):void 0]})}export{L as Collapsible,L as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
`);if(
|
|
3
|
-
`),
|
|
4
|
-
… ${
|
|
1
|
+
import{jsxs as d,jsx as e}from"react/jsx-runtime";import{Box as l}from"./box.js";import{Spinner as p}from"./spinner.js";import{Text as n}from"./text.js";const f={error:"red",idle:"gray",running:"cyan",success:"green"},x=r=>r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(2)}s`,g=r=>r==="running"?e(p,{type:"dots"}):{error:"✖",idle:"$",success:"✔"}[r],v=(r,i)=>{if(!Number.isFinite(i))return r;const o=r.split(`
|
|
2
|
+
`);if(o.length<=i)return r;const t=o.slice(0,i).join(`
|
|
3
|
+
`),s=o.length-i;return`${t}
|
|
4
|
+
… ${s} more line${s===1?"":"s"}`};function b({command:r,cwd:i,durationMs:o,exitCode:t,maxOutputRows:s=12,output:c,status:m="idle"}){const h=f[m],a=g(m),u=[];return o!==void 0&&u.push(d(n,{dimColor:!0,children:[" ",x(o)]},"duration")),t!==void 0&&m!=="running"&&u.push(d(n,{color:t===0?"green":"red",children:[" ","exit"," ",t]},"exit")),d(l,{borderColor:h,borderStyle:"round",flexDirection:"column",paddingX:1,children:[d(l,{children:[e(n,{color:h,children:a}),e(n,{children:" "}),e(l,{flexGrow:1,flexShrink:1,minWidth:0,children:e(n,{bold:!0,wrap:"truncate-end",children:r})}),i===void 0?void 0:d(n,{dimColor:!0,children:[" ","@",i]}),u.length===0?void 0:e(l,{flexShrink:0,children:u})]}),c===void 0?void 0:e(l,{flexDirection:"column",marginTop:1,children:typeof c=="string"?e(n,{children:v(c,s)}):c})]})}export{b as CommandBlock,b as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as a,jsx as n}from"react/jsx-runtime";import{useState as y,useRef as M,useMemo as T,useEffect as S,useCallback as F}from"react";import A from"../ink/hooks/use-focus.js";import D from"../ink/hooks/use-input.js";import{i as L}from"../packem_shared/input-utils-BSWCb4F_.js";import{Box as d}from"./box.js";import{Text as t}from"./text.js";const j=(m,f)=>{if(m.length===0)return 1;const p=[f.label,f.description??"",...f.keywords??[]].map(i=>i.toLowerCase()).filter(i=>i.length>0),h=m.toLowerCase();let s=0;for(const i of p){if(i.includes(h)){const u=i.indexOf(h);s=Math.max(s,100-u);continue}let x=0,g=0;for(const u of h){const c=i.indexOf(u,x);if(c===-1){g=0;break}g+=1,x=c+1}g===h.length&&(s=Math.max(s,20))}return s};function P({accentColor:m="cyan",autoFocus:f=!0,commands:p,emptyText:h="No results",limit:s=8,onCancel:i,onSelect:x,placeholder:g="Type a command or search..."}){const{isFocused:u}=A({autoFocus:f}),[c,v]=y(""),[w,C]=y(0),b=M(w);b.current=w;const l=T(()=>{const e=p.map(r=>({command:r,score:j(c,r)})).filter(({score:r})=>r>0);return e.sort((r,o)=>o.score-r.score),e.slice(0,s).map(({command:r})=>r)},[p,c,s]);return S(()=>{const e=Math.max(0,l.length-1);b.current>e&&(b.current=e,C(e))},[l]),D(F((e,r)=>{if(u){if(r.escape){i?.();return}if(r.downArrow){if(l.length===0)return;C(o=>Math.min(l.length-1,o+1));return}if(r.upArrow){C(o=>Math.max(0,o-1));return}if(r.return){const o=l[b.current];o&&x(o.id,c);return}if(r.backspace||r.delete){v(o=>o.slice(0,-1)),C(0);return}L(e,r)&&(v(o=>o+e),C(0))}},[u,l,c,x,i]),{isActive:u}),a(d,{borderColor:m,borderStyle:"round",flexDirection:"column",paddingX:1,children:[a(d,{children:[n(t,{color:m,children:"❯"}),a(t,{children:[" ",c.length===0?n(t,{dimColor:!0,children:g}):c]}),n(t,{inverse:!0,children:" "})]}),n(d,{marginTop:1,children:a(t,{dimColor:!0,children:[l.length," of ",p.length]})}),n(d,{flexDirection:"column",marginTop:1,children:l.length===0?n(t,{dimColor:!0,children:h}):l.map((e,r)=>{const o=r===w,k=o?m:void 0;return a(d,{flexDirection:"column",children:[a(d,{children:[n(t,{color:k,children:o?"▸ ":" "}),e.icon===void 0?void 0:a(t,{color:k,children:[e.icon," "]}),n(d,{flexGrow:1,flexShrink:1,minWidth:0,children:n(t,{bold:o,color:k,wrap:"truncate-end",children:e.label})}),e.hotkey===void 0?void 0:n(d,{flexShrink:0,children:a(t,{dimColor:!0,children:[" ",e.hotkey]})})]}),e.description===void 0?void 0:n(d,{marginLeft:2,children:n(t,{dimColor:!0,wrap:"truncate-end",children:e.description})})]},e.id)})})]})}export{P as CommandPalette,P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as b,jsx as o}from"react/jsx-runtime";import{useState as w,useCallback as y}from"react";import k from"../ink/hooks/use-focus.js";import A from"../ink/hooks/use-input.js";import{Box as n}from"./box.js";import{Text as f}from"./text.js";const D={danger:"red",info:"blue",warning:"yellow"},p=({color:l,isFocused:r,label:i})=>o(n,{backgroundColor:r?l:void 0,borderColor:r?l:void 0,borderStyle:"round",paddingX:1,children:o(f,{bold:r,color:r?"black":void 0,children:i})});function X({autoFocus:l=!0,cancelLabel:r="Cancel",children:i,confirmLabel:h="Confirm",defaultFocus:g="confirm",isDisabled:u=!1,onCancel:a,onConfirm:s,title:m,tone:v="info",width:C}){const[e,x]=w(g),c=D[v],{isFocused:F}=k({autoFocus:l,isActive:!u});return A(y((t,d)=>{if(d.leftArrow||d.rightArrow||t==="h"||t==="l"){x(e==="confirm"?"cancel":"confirm");return}if(d.return){e==="confirm"?s():a();return}if(d.escape||t==="n"){a();return}t==="y"&&s()},[e,s,a]),{isActive:!u&&F}),b(n,{borderColor:c,borderStyle:"round",flexDirection:"column",paddingX:1,paddingY:1,width:C,children:[m===void 0?void 0:o(n,{marginBottom:1,children:o(f,{bold:!0,color:c,children:m})}),i===void 0?void 0:o(n,{flexDirection:"column",marginBottom:1,children:typeof i=="string"?o(f,{children:i}):i}),b(n,{gap:2,justifyContent:"flex-end",children:[o(p,{color:c,isFocused:e==="cancel",label:r}),o(p,{color:c,isFocused:e==="confirm",label:h})]})]})}export{X as ConfirmDialog,X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as m,jsxs as a}from"react/jsx-runtime";import{useRef as u,useCallback as l}from"react";import p from"../ink/hooks/use-input.js";import{Box as C}from"./box.js";import{Text as d}from"./text.js";function w({defaultChoice:r="confirm",isDisabled:o=!1,onCancel:t,onConfirm:i,submitOnEnter:c=!0}){const e=u(i);e.current=i;const n=u(t);return n.current=t,p(l((s,f)=>{if(s.toLowerCase()==="y"){e.current();return}if(s.toLowerCase()==="n"){n.current();return}f.return&&c&&(r==="confirm"?e.current():n.current())},[c,r]),{isActive:!o}),m(C,{children:a(d,{dimColor:o,children:[r==="confirm"?"Y":"y","/",r==="cancel"?"N":"n"]})})}export{w as ConfirmInput,w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as a,jsxs as d}from"react/jsx-runtime";import{useMemo as c}from"react";import g from"../ink/hooks/use-console-capture.js";import{Box as p}from"./box.js";import{Text as l}from"./text.js";const h={debug:"gray",error:"red",info:"blue",log:"white",warn:"yellow"},f={debug:"DBG",error:"ERR",info:"INF",log:"LOG",warn:"WRN"},b=t=>{const r=new Date(t),o=String(r.getHours()).padStart(2,"0"),i=String(r.getMinutes()).padStart(2,"0"),n=String(r.getSeconds()).padStart(2,"0");return`${o}:${i}:${n}`};function y({dock:t="bottom",filter:r,height:o=8,maxEntries:i=200,showLevel:n=!0,showTimestamp:u=!0}){const{entries:m}=g({filter:r,maxEntries:i}),s=c(()=>m.slice(-o),[m,o]);return a(p,{borderBottom:t==="top",borderBottomColor:"gray",borderTop:t==="bottom",borderTopColor:"gray",flexDirection:"column",height:o+1,children:s.length===0?a(l,{dimColor:!0,children:"Console output will appear here..."}):s.map(e=>d(p,{children:[u?d(l,{dimColor:!0,children:["[",b(e.timestamp),"]"," "]}):void 0,n?d(l,{color:h[e.level],children:[f[e.level]," "]}):void 0,a(l,{color:e.level==="error"?"red":e.level==="warn"?"yellow":void 0,children:e.message})]},e.id))})}export{y as ConsoleOverlay,y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as u,jsx as v,Fragment as k}from"react/jsx-runtime";import{useState as w,useMemo as F,useCallback as p}from"react";import M from"../ink/hooks/use-focus.js";import D from"../ink/hooks/use-input.js";import{Box as m}from"./box.js";import{Text as j}from"./text.js";function $({accentColor:x="blue",autoFocus:g=!1,defaultValue:b,isDisabled:l=!1,onChange:f,options:r,value:t}){const{isFocused:a}=M({autoFocus:g,isActive:!l}),C=b??r[0]?.id,[c,A]=w(C),d=t??c,n=F(()=>{if(d===void 0)return 0;const o=r.findIndex(i=>i.id===d);return Math.max(o,0)},[r,d]),s=p(o=>{const i=r[o];if(!i)return;const e=t??c;i.id!==e&&(t===void 0&&A(i.id),f?.(i.id))},[r,t,c,f]);D(p((o,i)=>{a&&(i.leftArrow||o==="h"?s(Math.max(0,n-1)):(i.rightArrow||o==="l")&&s(Math.min(r.length-1,n+1)))},[a,n,r.length,s]),{isActive:!l&&a});const h=r[n];return u(m,{flexDirection:"column",children:[v(m,{children:r.map((o,i)=>{const e=i===n;return u(j,{backgroundColor:e?x:void 0,color:e?"black":void 0,dimColor:l&&!e,children:[" ",o.icon===void 0?void 0:u(k,{children:[o.icon," "]}),o.label," "]},o.id)})}),h===void 0?void 0:v(m,{flexDirection:"column",marginTop:1,children:h.content})]})}export{$ as ContentSwitcher,$ as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode, Ref } from 'react';
|
|
2
2
|
import { BoxProps as Props } from "./box.js";
|
|
3
3
|
import 'type-fest';
|
|
4
|
-
import "../packem_shared/dom.d-
|
|
4
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
5
5
|
import 'yoga-layout';
|
|
6
6
|
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
7
7
|
import '@visulima/colorize';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as r}from"../packem_shared/controlled-scroll-view-
|
|
1
|
+
import{C as r}from"../packem_shared/controlled-scroll-view-t55HU9L8.js";export{r as ControlledScrollView};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
2
|
import { C as CursorShape } from "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
3
|
-
import { D as DOMElement } from "../packem_shared/dom.d-
|
|
3
|
+
import { D as DOMElement } from "../packem_shared/dom.d-B4kXbaVY.js";
|
|
4
4
|
import 'yoga-layout';
|
|
5
5
|
import '@visulima/colorize';
|
|
6
6
|
import 'cli-boxes';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{useMemo as u}from"react";function p({anchorRef:i,shape:s,x:o=0,y:r=0}){const n=i??void 0,e=n===void 0&&o===0&&r===0,t=u(()=>({anchorRef:n,inline:e,shape:s,x:o,y:r}),[n,e,s,o,r]);return a("ink-cursor",{internal_cursor:t})}export{p as Cursor,p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsxs as g,jsx as o}from"react/jsx-runtime";import{useState as C,useCallback as h}from"react";import $ from"../ink/hooks/use-focus.js";import b from"../ink/hooks/use-input.js";import{Box as i}from"./box.js";import{Calendar as T}from"./calendar.js";import{Text as l}from"./text.js";const V=e=>{const n=e.getFullYear(),c=String(e.getMonth()+1).padStart(2,"0"),d=String(e.getDate()).padStart(2,"0");return`${n}-${c}-${d}`};function O({accentColor:e="blue",autoFocus:n=!1,defaultValue:c,formatValue:d=V,isDisabled:s=!1,maxDate:D,minDate:x,onChange:v,placeholder:S="Pick a date",value:u}){const{isFocused:r}=$({autoFocus:n,isActive:!s}),[t,m]=C(!1),[F,k]=C(c),f=u??F;b(h((a,p)=>{!r||t||(p.return||a===" ")&&m(!0)},[r,t]),{isActive:!s&&r&&!t}),b(h((a,p)=>{p.escape&&m(!1)},[]),{isActive:!s&&r&&t});const A=h(a=>{u===void 0&&k(a),m(!1),v?.(a)},[u,v]);return g(i,{flexDirection:"column",children:[g(i,{borderColor:r?e:void 0,borderStyle:"round",paddingX:1,children:[o(l,{color:e,children:"📅 "}),f===void 0?o(l,{dimColor:!0,children:S}):o(l,{bold:!0,children:d(f)}),r&&!t?o(i,{marginLeft:1,children:o(l,{dimColor:!0,children:"(Enter to open)"})}):void 0]}),t?o(i,{marginTop:1,children:o(T,{accentColor:e,autoFocus:!0,defaultValue:f,maxDate:D,minDate:x,onSubmit:A})}):void 0]})}export{O as DatePicker,O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Box as i}from"./box.js";import{Text as n}from"./text.js";function s({columnGap:d=2,items:t,layout:m="inline",termColor:c="cyan",termWidth:h}){return m==="stacked"?e(i,{flexDirection:"column",gap:1,children:t.map((r,l)=>o(i,{flexDirection:"column",children:[e(n,{bold:!0,color:c,children:r.term}),e(n,{children:r.description})]},r.key??l))}):e(i,{flexDirection:"column",children:t.map((r,l)=>o(i,{gap:d,children:[e(i,{flexShrink:0,width:h,children:e(n,{color:c,children:r.term})}),e(i,{flexGrow:1,flexShrink:1,children:e(n,{children:r.description})})]},r.key??l))})}export{s as DefinitionList,s as default};
|
|
@@ -5,7 +5,7 @@ import 'cli-boxes';
|
|
|
5
5
|
import { b as ScrollViewRef } from "../packem_shared/scroll-view.d-DtpsgHLg.js";
|
|
6
6
|
import "./box.js";
|
|
7
7
|
import 'type-fest';
|
|
8
|
-
import "../packem_shared/dom.d-
|
|
8
|
+
import "../packem_shared/dom.d-B4kXbaVY.js";
|
|
9
9
|
import "../packem_shared/cursor-helpers.d-BONB9tky.js";
|
|
10
10
|
import "../packem_shared/styles.d-cMo36xQz.js";
|
|
11
11
|
type Props = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as r,jsxs as j}from"react/jsx-runtime";import{useRef as M}from"react";import H from"../ink/hooks/use-terminal-palette.js";import I from"../ink/hooks/use-window-size.js";import{Box as o}from"./box.js";import{Text as R}from"./text.js";import{ScrollView as T}from"../packem_shared/ScrollView-BEgrtSnt.js";const A=({backgroundColor:u,borderColor:l="cyan",borderStyle:f="round",children:h,columns:g,footer:d,maxHeight:e=.8,paddingX:i=2,paddingY:p=1,rows:b,scrollbarStyle:x="block",scrollRef:k,title:n,visible:C=!0,width:S=60})=>{const c=I(),{isLoading:w,palette:y}=H(),B=M(null),D=k??B;if(!C)return null;const a=g??(c.columns||80),t=b??(c.rows||24),s=u??(w?"black":y?.background??"black"),X=e<=1?Math.floor(t*e):Math.min(e,t-2),m=typeof n=="string"?r(o,{marginBottom:1,children:r(R,{bold:!0,color:l,children:n})}):n??null;return r(o,{alignItems:"center",height:t,justifyContent:"center",position:"absolute",width:a,children:j(o,{backgroundColor:s,borderBackgroundColor:s,borderColor:l,borderStyle:f,flexDirection:"column",maxHeight:X,opaque:!0,paddingY:p,width:Math.min(S,a-4),children:[m!=null&&r(o,{flexShrink:0,paddingX:i,children:m}),r(T,{flexGrow:1,flexShrink:1,paddingX:i,ref:D,scrollbar:!0,scrollbarColor:l,scrollbarStyle:x,children:h}),d!=null&&r(o,{alignItems:"center",flexDirection:"column",flexShrink:0,marginTop:1,paddingX:i,children:d})]})})};export{A as Dialog,A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{jsx as u,jsxs as g,Fragment as P}from"react/jsx-runtime";import{createPatch as H,parsePatch as T,diffWords as I,diffChars as M}from"diff";import{useMemo as k,useState as W,useRef as B,useEffect as j}from"react";import{r as q,i as z,w as A,g as E,a as F}from"../packem_shared/token-to-elements-D6J6-P2A.js";import G from"../ink/hooks/use-window-size.js";import{Box as p}from"./box.js";import{Text as a}from"./text.js";const L=(r,i,n,d)=>{if(!i||n===void 0||n<1||n>i.length)return d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r});const o=i[n-1];return!o||o.length===0?d?u(a,{color:d,children:r}):u(a,{dimColor:!0,children:r}):F(o)},y=(r,i,n)=>{const[d,o]=W(null),h=B(!1);return j(()=>{if(h.current=!1,!i){o(null);return}const e=q(i);if(!z(e)){o(null);return}return(async()=>{try{const f=await A([e],n),l=E(f,r,e,n);h.current||o(l.tokens)}catch{h.current||o(null)}})(),()=>{h.current=!0}},[r,i,n]),d},R=(r,i,n="chars")=>{const d=T(r),o=[];for(const h of d)for(const e of h.hunks){const f=`@@ -${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines} @@`,l=[];let s=e.oldStart,c=e.newStart;for(const w of e.lines)w.startsWith("\\")||(w.startsWith("+")?l.push({content:w.slice(1),newLineNum:c++,type:"add"}):w.startsWith("-")?l.push({content:w.slice(1),oldLineNum:s++,type:"del"}):l.push({content:w.slice(1),newLineNum:c++,oldLineNum:s++,type:"context"}));if(i){const w=V(l);for(const[N,t]of w)if(l[N].type==="del"&&l[t].type==="add"){const m=U(l[N].content,l[t].content,n);l[N].inlineDiff=m??void 0,l[N].pairedIndex=t,l[t].inlineDiff=m??void 0,l[t].pairedIndex=N}}o.push({header:f,lines:l})}return o},b=500,U=(r,i,n="chars")=>{if(r.length>b||i.length>b)return null;const d=n==="words"?I(r,i):M(r,i),o=[],h=[];for(const e of d)e.removed?o.push({highlight:!0,value:e.value}):e.added?h.push({highlight:!0,value:e.value}):(o.push({highlight:!1,value:e.value}),h.push({highlight:!1,value:e.value}));return{addParts:h,delParts:o}},D=(r,i,n)=>u(P,{children:r.map((d,o)=>d.highlight?u(a,{backgroundColor:n,color:"white",children:d.value},o):u(a,{color:i,children:d.value},o))}),V=r=>{const i=new Map;let n=0;for(;n<r.length;){const d=n;for(;n<r.length&&r[n].type==="del";)n++;const o=n,h=n;for(;n<r.length&&r[n].type==="add";)n++;const e=n,f=o-d,l=e-h,s=Math.min(f,l);for(let c=0;c<s;c++)i.set(d+c,h+c),i.set(h+c,d+c);n===d&&n++}return i};function X({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d}){return u(p,{flexDirection:"column",children:r.map((o,h)=>g(p,{flexDirection:"column",children:[h>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,u(a,{color:"cyan",dimColor:!0,children:o.header}),o.lines.map((e,f)=>{let l,s,c;switch(e.type){case"add":{s="+",c="green",l=e.inlineDiff?D(e.inlineDiff.addParts,"green","green"):L(e.content,i,e.newLineNum,"green");break}case"del":{s="-",c="red",l=e.inlineDiff?D(e.inlineDiff.delParts,"red","red"):L(e.content,n,e.oldLineNum,"red");break}default:{s=" ",c=void 0,l=L(e.content,n,e.oldLineNum);break}}return g(p,{children:[d?g(a,{color:c,dimColor:e.type==="context",children:[String(e.oldLineNum??"").padStart(4)," ",String(e.newLineNum??"").padStart(4)," "]}):void 0,u(a,{color:c,children:s}),l]},f)})]},h))})}function J({hunks:r,newHighlighted:i,oldHighlighted:n,showLineNumbers:d,width:o}){const h=Math.floor(o/2)-1;return u(p,{flexDirection:"column",children:r.map((e,f)=>{const l=f>0?u(p,{marginBottom:0,marginTop:0,children:u(a,{dimColor:!0,children:"···"})}):void 0,s=[],c=[];for(let N=0;N<e.lines.length;N++){const t=e.lines[N];switch(t.type){case"add":{t.pairedIndex===void 0&&(s.push({content:u(a,{dimColor:!0})}),c.push({content:L(t.content,i,t.newLineNum,"green"),lineNum:t.newLineNum}));break}case"context":{s.push({content:L(t.content,n,t.oldLineNum),lineNum:t.oldLineNum}),c.push({content:L(t.content,i,t.newLineNum),lineNum:t.newLineNum});break}case"del":{if(t.pairedIndex===void 0)s.push({content:L(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:u(a,{dimColor:!0})});else{const m=e.lines[t.pairedIndex];s.push({content:t.inlineDiff?D(t.inlineDiff.delParts,"red","red"):L(t.content,n,t.oldLineNum,"red"),lineNum:t.oldLineNum}),c.push({content:m.inlineDiff?D(m.inlineDiff.addParts,"green","green"):L(m.content,i,m.newLineNum,"green"),lineNum:m.newLineNum})}break}}}const w=Math.max(s.length,c.length);return g(p,{flexDirection:"column",children:[l,u(a,{color:"cyan",dimColor:!0,children:e.header}),Array.from({length:w},(N,t)=>{const m=s[t],x=c[t];return g(p,{flexDirection:"row",children:[g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(m?.lineNum??"").padStart(4)," "]}):void 0,m?.content]}),u(a,{dimColor:!0,children:"│"}),g(p,{width:h,children:[d?g(a,{dimColor:!0,children:[String(x?.lineNum??"").padStart(4)," "]}):void 0,x?.content]})]},t)})]},f)})})}function ee({context:r=3,diff:i,inlineDiff:n=!0,inlineDiffMode:d="chars",language:o,mode:h="unified",newLabel:e="new",newText:f="",oldLabel:l="old",oldText:s="",showLineNumbers:c=!0,theme:w="github-dark-default"}){const{columns:N}=G(),t=y(s,o,w),m=y(f,o,w),x=k(()=>i||H("file",s,f,l,e,{context:r}),[i,s,f,l,e,r]),v=k(()=>R(x,n,d),[x,n,d]);if(v.every(S=>S.lines.length===0))return u(p,{children:u(a,{dimColor:!0,children:"No differences found."})});const C=g(p,{flexDirection:"column",children:[g(a,{color:"red",dimColor:!0,children:["---"," ",l]}),g(a,{color:"green",dimColor:!0,children:["+++"," ",e]})]});return h==="split"?g(p,{flexDirection:"column",children:[C,u(J,{hunks:v,newHighlighted:m,oldHighlighted:t,showLineNumbers:c,width:N??80})]}):g(p,{flexDirection:"column",children:[C,u(X,{hunks:v,newHighlighted:m,oldHighlighted:t,showLineNumbers:c})]})}export{ee as DiffView,ee as default};
|