@visulima/tui 1.0.8 → 2.0.1
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 +4 -0
- package/LICENSE.md +54 -2444
- package/MIGRATION-GUIDE.md +164 -0
- package/README.md +15 -12
- package/dist/components/box.d.ts +26 -27
- package/dist/components/canvas.d.ts +26 -31
- package/dist/components/canvas.js +1 -1
- package/dist/components/cursor.d.ts +40 -46
- package/dist/components/error-boundary.d.ts +16 -0
- package/dist/components/error-boundary.js +1 -0
- package/dist/components/error-overview.d.ts +6 -0
- package/dist/components/error-overview.js +1 -0
- package/dist/components/newline.d.ts +6 -8
- package/dist/components/spacer.d.ts +4 -4
- package/dist/components/static-render.d.ts +10 -42
- package/dist/components/static.d.ts +13 -14
- package/dist/components/text.d.ts +34 -48
- package/dist/components/transform.d.ts +7 -11
- package/dist/core/index.d.ts +11 -12
- package/dist/core/index.js +1 -1
- package/dist/ink/canvas/index.d.ts +24 -0
- package/dist/ink/canvas/index.js +1 -0
- package/dist/ink/hooks/use-animation.d.ts +22 -22
- package/dist/ink/hooks/use-app.d.ts +3 -34
- package/dist/ink/hooks/use-app.js +1 -1
- package/dist/ink/hooks/use-box-metrics.d.ts +17 -18
- package/dist/ink/hooks/use-clipboard.d.ts +16 -16
- package/dist/ink/hooks/use-color-blindness.d.ts +16 -16
- package/dist/ink/hooks/use-console-capture.d.ts +19 -19
- package/dist/ink/hooks/use-cursor.d.ts +7 -7
- package/dist/ink/hooks/use-focus-manager.d.ts +25 -25
- package/dist/ink/hooks/use-focus.d.ts +14 -18
- package/dist/ink/hooks/use-form.d.ts +32 -32
- package/dist/ink/hooks/use-hotkey.d.ts +17 -17
- package/dist/ink/hooks/use-input.d.ts +92 -92
- package/dist/ink/hooks/use-input.js +2 -2
- package/dist/ink/hooks/use-interval.d.ts +14 -14
- package/dist/ink/hooks/use-is-screen-reader-enabled.d.ts +3 -3
- package/dist/ink/hooks/use-key-bindings.d.ts +32 -32
- package/dist/ink/hooks/use-key-chord.d.ts +15 -15
- package/dist/ink/hooks/use-paste.d.ts +38 -38
- package/dist/ink/hooks/use-paste.js +1 -1
- package/dist/ink/hooks/use-persistent-state.d.ts +46 -46
- package/dist/ink/hooks/use-persistent-state.js +2 -2
- package/dist/ink/hooks/use-scroll-acceleration.d.ts +24 -24
- package/dist/ink/hooks/use-scroll-input.d.ts +15 -15
- package/dist/ink/hooks/use-stderr.d.ts +6 -6
- package/dist/ink/hooks/use-stderr.js +1 -1
- package/dist/ink/hooks/use-stdin.d.ts +10 -10
- package/dist/ink/hooks/use-stdin.js +1 -1
- package/dist/ink/hooks/use-stdout.d.ts +6 -6
- package/dist/ink/hooks/use-stdout.js +1 -1
- package/dist/ink/hooks/use-stopwatch.d.ts +12 -12
- package/dist/ink/hooks/use-terminal-palette.d.ts +11 -11
- package/dist/ink/hooks/use-text-buffer.d.ts +2 -2
- package/dist/ink/hooks/use-text-selection.d.ts +19 -20
- package/dist/ink/hooks/use-timeout.d.ts +11 -11
- package/dist/ink/hooks/use-timer.d.ts +19 -19
- package/dist/ink/hooks/use-window-size.d.ts +8 -8
- package/dist/ink/hooks/use-window-size.js +1 -1
- package/dist/ink/index.d.ts +110 -123
- package/dist/ink/index.js +1 -1
- package/dist/ink/mouse/use-element-position.d.ts +7 -8
- package/dist/ink/mouse/use-mouse-action.d.ts +1 -1
- package/dist/ink/mouse/use-mouse-position.d.ts +1 -1
- package/dist/ink/mouse/use-mouse.d.ts +1 -1
- package/dist/ink/mouse/use-on-mouse-click.d.ts +4 -5
- package/dist/ink/mouse/use-on-mouse-hover.d.ts +3 -4
- package/dist/ink/mouse/use-on-mouse-state.d.ts +3 -4
- package/dist/ink/public/cursor.d.ts +47 -0
- package/dist/ink/public/cursor.js +1 -0
- package/dist/ink/public/dom.d.ts +6 -0
- package/dist/ink/public/dom.js +0 -0
- package/dist/ink/public/highlighter.d.ts +44 -0
- package/dist/ink/public/highlighter.js +1 -0
- package/dist/ink/public/input.d.ts +14 -0
- package/dist/ink/public/input.js +1 -0
- package/dist/ink/public/styles.d.ts +4 -0
- package/dist/ink/public/styles.js +0 -0
- package/dist/ink/public/utils.d.ts +5 -0
- package/dist/ink/public/utils.js +1 -0
- package/dist/packem_chunks/devtools.js +1 -1
- package/dist/packem_shared/{DevTools-k6uiVzqv.js → DevTools-BxD3PYAN.js} +1 -1
- package/dist/packem_shared/InputParser-CiBitCva.js +2 -0
- package/dist/packem_shared/MouseProvider-DOcWCRVq.js +1 -0
- package/dist/packem_shared/{Renderer-DsskdkUd.js → Renderer-BeS49FNq.js} +1 -1
- package/dist/packem_shared/TuiApp-CCVaiKbf.js +1 -0
- package/dist/packem_shared/app-context-DTm1_XBA.js +1 -0
- package/dist/packem_shared/app-context.d-DMLw5Nxy.d.ts +56 -0
- package/dist/packem_shared/boxes-DyY_LXCi.js +1 -0
- package/dist/packem_shared/buffer.d-CttIC480.d.ts +67 -0
- package/dist/packem_shared/buildCursorOnlySequence-CerkmjWt.js +1 -0
- package/dist/packem_shared/clipboard.d-nDPQkZ2H.d.ts +23 -0
- package/dist/packem_shared/color-matrix.d-sTqnJ23h.d.ts +50 -0
- package/dist/packem_shared/{braille-ch3O5D7I.js → createBrailleGrid-BTOQrujS.js} +1 -1
- package/dist/packem_shared/createCanvasBuffer-CL6sAM-A.js +1 -0
- package/dist/packem_shared/{createInlineLoop-BT40Wpmx.js → createInlineLoop-DnEvE2eM.js} +1 -1
- package/dist/packem_shared/disposeHighlighter-D9OkrhwX.js +1 -0
- package/dist/packem_shared/{dom.d-B4kXbaVY.d.ts → dom.d-CLGlidfI.d.ts} +140 -154
- package/dist/packem_shared/formatDuration-Bdx4ZgRh.js +1 -0
- package/dist/packem_shared/index-Dl9I2_QH.js +75 -0
- package/dist/packem_shared/input.d-Bb8pWHvp.d.ts +172 -0
- package/dist/packem_shared/{input-utils-BSWCb4F_.js → isControlCharacter-uDgBe_32.js} +1 -1
- package/dist/packem_shared/load-native-root-binding-CxJnHcac.js +1 -0
- package/dist/packem_shared/{mouse-context.d-BfL9xGk_.d.ts → mouse-context.d-W-nszUps.d.ts} +8 -8
- package/dist/packem_shared/reconciler-DkwOtC5B.js +1 -0
- package/dist/packem_shared/render-CuCo-R-l.js +24 -0
- package/dist/packem_shared/{render-DFZ8NHlG.js → render-DtQd8qQq.js} +1 -1
- package/dist/packem_shared/render.d-DjQhFsiN.d.ts +435 -0
- package/dist/packem_shared/{renderToString-DwXFY8Qh.js → renderToString-B1LgWcJe.js} +1 -1
- package/dist/packem_shared/{renderToString-L_bpw4OQ.js → renderToString-DkTmJPaS.js} +1 -1
- package/dist/packem_shared/renderToken-DjiQ6dfv.js +1 -0
- package/dist/packem_shared/renderTreeToBuffer-BpSD0sBJ.js +2 -0
- package/dist/packem_shared/{renderer-k-xShm1P.js → renderer-Cs0KEr1o.js} +4 -4
- package/dist/packem_shared/{selection.d-CI3_p8wg.d.ts → selection.d-BSAWa4ey.d.ts} +16 -16
- package/dist/packem_shared/stderr-context-CR2LLec6.js +1 -0
- package/dist/packem_shared/stdin-context-BjMA9Sbi.js +1 -0
- package/dist/packem_shared/stdout-context-DAAlQct2.js +1 -0
- package/dist/packem_shared/styles.d-CKGQFfm4.d.ts +485 -0
- package/dist/packem_shared/{terminal-palette.d-D2SQjfn-.d.ts → terminal-palette.d-JbWHISW-.d.ts} +7 -7
- package/dist/packem_shared/utils-CVgM8kTn.js +1 -0
- package/dist/react/index.d.ts +160 -179
- package/dist/react/index.js +1 -1
- package/dist/testing/index.d.ts +152 -152
- package/dist/testing/index.js +1 -1
- package/index.js +52 -52
- package/package.json +49 -384
- package/dist/components/accordion.d.ts +0 -59
- package/dist/components/accordion.js +0 -1
- package/dist/components/alert.d.ts +0 -26
- package/dist/components/alert.js +0 -1
- package/dist/components/animate-presence.d.ts +0 -18
- package/dist/components/animate-presence.js +0 -1
- package/dist/components/approval-prompt.d.ts +0 -65
- package/dist/components/approval-prompt.js +0 -1
- package/dist/components/area-chart.d.ts +0 -66
- package/dist/components/area-chart.js +0 -1
- package/dist/components/badge.d.ts +0 -22
- package/dist/components/badge.js +0 -1
- package/dist/components/bar-chart.d.ts +0 -67
- package/dist/components/bar-chart.js +0 -1
- package/dist/components/big-text.d.ts +0 -81
- package/dist/components/big-text.js +0 -1
- package/dist/components/blink-dot.d.ts +0 -36
- package/dist/components/blink-dot.js +0 -1
- package/dist/components/breadcrumb.d.ts +0 -33
- package/dist/components/breadcrumb.js +0 -1
- package/dist/components/button.d.ts +0 -45
- package/dist/components/button.js +0 -1
- package/dist/components/calendar.d.ts +0 -72
- package/dist/components/calendar.js +0 -1
- package/dist/components/card.d.ts +0 -57
- package/dist/components/card.js +0 -1
- package/dist/components/checkbox.d.ts +0 -48
- package/dist/components/checkbox.js +0 -1
- package/dist/components/code.d.ts +0 -48
- package/dist/components/code.js +0 -2
- package/dist/components/collapsible.d.ts +0 -53
- package/dist/components/collapsible.js +0 -1
- package/dist/components/command-block.d.ts +0 -47
- package/dist/components/command-block.js +0 -4
- package/dist/components/command-palette.d.ts +0 -82
- package/dist/components/command-palette.js +0 -1
- package/dist/components/confirm-dialog.d.ts +0 -75
- package/dist/components/confirm-dialog.js +0 -1
- package/dist/components/confirm-input.d.ts +0 -38
- package/dist/components/confirm-input.js +0 -1
- package/dist/components/console-overlay.d.ts +0 -54
- package/dist/components/console-overlay.js +0 -1
- package/dist/components/content-switcher.d.ts +0 -57
- package/dist/components/content-switcher.js +0 -1
- package/dist/components/controlled-scroll-view.d.ts +0 -61
- package/dist/components/controlled-scroll-view.js +0 -1
- package/dist/components/date-picker.d.ts +0 -65
- package/dist/components/date-picker.js +0 -1
- package/dist/components/definition-list.d.ts +0 -44
- package/dist/components/definition-list.js +0 -1
- package/dist/components/dialog.d.ts +0 -117
- package/dist/components/dialog.js +0 -1
- package/dist/components/diff-view.d.ts +0 -85
- package/dist/components/diff-view.js +0 -1
- package/dist/components/divider.d.ts +0 -49
- package/dist/components/divider.js +0 -1
- package/dist/components/file-picker-entry.d.ts +0 -104
- package/dist/components/file-picker-entry.js +0 -1
- package/dist/components/form.d.ts +0 -81
- package/dist/components/form.js +0 -1
- package/dist/components/gauge.d.ts +0 -87
- package/dist/components/gauge.js +0 -1
- package/dist/components/gradient.d.ts +0 -42
- package/dist/components/gradient.js +0 -1
- package/dist/components/heading.d.ts +0 -33
- package/dist/components/heading.js +0 -1
- package/dist/components/heatmap.d.ts +0 -62
- package/dist/components/heatmap.js +0 -1
- package/dist/components/help.d.ts +0 -52
- package/dist/components/help.js +0 -1
- package/dist/components/histogram.d.ts +0 -62
- package/dist/components/histogram.js +0 -1
- package/dist/components/kbd.d.ts +0 -31
- package/dist/components/kbd.js +0 -1
- package/dist/components/line-chart.d.ts +0 -109
- package/dist/components/line-chart.js +0 -1
- package/dist/components/link.d.ts +0 -38
- package/dist/components/link.js +0 -1
- package/dist/components/loading-indicator.d.ts +0 -29
- package/dist/components/loading-indicator.js +0 -1
- package/dist/components/markdown.d.ts +0 -40
- package/dist/components/markdown.js +0 -1
- package/dist/components/masked-input.d.ts +0 -50
- package/dist/components/masked-input.js +0 -1
- package/dist/components/menu.d.ts +0 -78
- package/dist/components/menu.js +0 -1
- package/dist/components/message-bubble.d.ts +0 -43
- package/dist/components/message-bubble.js +0 -1
- package/dist/components/model-badge.d.ts +0 -39
- package/dist/components/model-badge.js +0 -1
- package/dist/components/multi-select.d.ts +0 -65
- package/dist/components/multi-select.js +0 -1
- package/dist/components/operation-tree.d.ts +0 -49
- package/dist/components/operation-tree.js +0 -1
- package/dist/components/option-list.d.ts +0 -47
- package/dist/components/option-list.js +0 -1
- package/dist/components/ordered-list.d.ts +0 -24
- package/dist/components/ordered-list.js +0 -1
- package/dist/components/paginator.d.ts +0 -69
- package/dist/components/paginator.js +0 -1
- package/dist/components/paragraph.d.ts +0 -38
- package/dist/components/paragraph.js +0 -1
- package/dist/components/placeholder.d.ts +0 -55
- package/dist/components/placeholder.js +0 -1
- package/dist/components/progress-bar.d.ts +0 -56
- package/dist/components/progress-bar.js +0 -1
- package/dist/components/radio-group.d.ts +0 -74
- package/dist/components/radio-group.js +0 -1
- package/dist/components/scatter-plot.d.ts +0 -35
- package/dist/components/scatter-plot.js +0 -1
- package/dist/components/scroll-bar-box.d.ts +0 -37
- package/dist/components/scroll-bar-box.js +0 -1
- package/dist/components/scroll-bar.d.ts +0 -25
- package/dist/components/scroll-bar.js +0 -1
- package/dist/components/scroll-list.d.ts +0 -20
- package/dist/components/scroll-list.js +0 -1
- package/dist/components/scroll-view.d.ts +0 -10
- package/dist/components/scroll-view.js +0 -1
- package/dist/components/search-input.d.ts +0 -55
- package/dist/components/search-input.js +0 -1
- package/dist/components/select-input-indicator.d.ts +0 -32
- package/dist/components/select-input-indicator.js +0 -1
- package/dist/components/select-input-item.d.ts +0 -41
- package/dist/components/select-input-item.js +0 -1
- package/dist/components/select-input.d.ts +0 -110
- package/dist/components/select-input.js +0 -1
- package/dist/components/shimmer-text.d.ts +0 -47
- package/dist/components/shimmer-text.js +0 -1
- package/dist/components/slider.d.ts +0 -103
- package/dist/components/slider.js +0 -1
- package/dist/components/sparkline.d.ts +0 -35
- package/dist/components/sparkline.js +0 -1
- package/dist/components/spinner.d.ts +0 -17
- package/dist/components/spinner.js +0 -1
- package/dist/components/status-line.d.ts +0 -37
- package/dist/components/status-line.js +0 -1
- package/dist/components/status-message.d.ts +0 -21
- package/dist/components/status-message.js +0 -1
- package/dist/components/stepper.d.ts +0 -48
- package/dist/components/stepper.js +0 -1
- package/dist/components/stopwatch.d.ts +0 -49
- package/dist/components/stopwatch.js +0 -1
- package/dist/components/streaming-text.d.ts +0 -46
- package/dist/components/streaming-text.js +0 -1
- package/dist/components/switch.d.ts +0 -55
- package/dist/components/switch.js +0 -1
- package/dist/components/tab.d.ts +0 -19
- package/dist/components/tab.js +0 -1
- package/dist/components/table.d.ts +0 -119
- package/dist/components/table.js +0 -1
- package/dist/components/tabs.d.ts +0 -107
- package/dist/components/tabs.js +0 -1
- package/dist/components/tag.d.ts +0 -35
- package/dist/components/tag.js +0 -1
- package/dist/components/text-input.d.ts +0 -48
- package/dist/components/text-input.js +0 -1
- package/dist/components/textarea.d.ts +0 -68
- package/dist/components/textarea.js +0 -2
- package/dist/components/timer.d.ts +0 -59
- package/dist/components/timer.js +0 -1
- package/dist/components/toast.d.ts +0 -49
- package/dist/components/toast.js +0 -1
- package/dist/components/tooltip.d.ts +0 -43
- package/dist/components/tooltip.js +0 -1
- package/dist/components/transition.d.ts +0 -74
- package/dist/components/transition.js +0 -1
- package/dist/components/tree-view-entry.d.ts +0 -357
- package/dist/components/tree-view-entry.js +0 -1
- package/dist/components/unordered-list.d.ts +0 -30
- package/dist/components/unordered-list.js +0 -1
- package/dist/ink/hooks/use-linked-scroll.d.ts +0 -49
- package/dist/ink/hooks/use-linked-scroll.js +0 -1
- package/dist/packem_shared/ControlledScrollView-Cn4byU2n.js +0 -1
- package/dist/packem_shared/FilePicker-BLS9nOPz.js +0 -1
- package/dist/packem_shared/InputParser-CtwkCbrQ.js +0 -2
- package/dist/packem_shared/MouseProvider-DUqQ3Eaa.js +0 -1
- package/dist/packem_shared/ScrollBar-qa1IzDDv.js +0 -1
- package/dist/packem_shared/ScrollBarBox-DchESZWv.js +0 -1
- package/dist/packem_shared/ScrollList-BBAnRsrC.js +0 -1
- package/dist/packem_shared/ScrollView-CHAo7Epj.js +0 -1
- package/dist/packem_shared/TreeNodeMap-cJlYqckB.js +0 -1
- package/dist/packem_shared/TreeView-BsvLCsf0.js +0 -1
- package/dist/packem_shared/TuiApp-BPL8v1i1.js +0 -1
- package/dist/packem_shared/app-context-BVpKlG1z.js +0 -1
- package/dist/packem_shared/buffer.d-EJkZr8uH.d.ts +0 -39
- package/dist/packem_shared/clipboard.d-D6lZTQ21.d.ts +0 -23
- package/dist/packem_shared/color-matrix.d-DSXLsB64.d.ts +0 -50
- package/dist/packem_shared/controlled-scroll-view-BVg7ywNW.js +0 -1
- package/dist/packem_shared/cursor-helpers.d-BONB9tky.d.ts +0 -12
- package/dist/packem_shared/format-time-fjoQHMxD.js +0 -1
- package/dist/packem_shared/input.d-CgxV2e8U.d.ts +0 -90
- package/dist/packem_shared/line-chart-C7CUrvVs.js +0 -1
- package/dist/packem_shared/load-native-root-binding-DDikxNox.js +0 -1
- package/dist/packem_shared/reconciler-CFyBVf7l.js +0 -1
- package/dist/packem_shared/render-CuQecTAs.js +0 -24
- package/dist/packem_shared/render.d-CBnYBDk2.d.ts +0 -417
- package/dist/packem_shared/renderTreeToBuffer-C8lS0lJ2.js +0 -2
- package/dist/packem_shared/scroll-view.d-DtpsgHLg.d.ts +0 -119
- package/dist/packem_shared/stderr-context-Bvnik0hL.js +0 -1
- package/dist/packem_shared/stdin-context-88AhuztD.js +0 -1
- package/dist/packem_shared/stdout-context-BnblEPez.js +0 -1
- package/dist/packem_shared/styles.d-cMo36xQz.d.ts +0 -396
- package/dist/packem_shared/token-to-elements-D6J6-P2A.js +0 -1
- package/dist/packem_shared/treeViewTheme-Dq3ekRAC.js +0 -1
- package/dist/packem_shared/useTreeView-D5ifGwG3.js +0 -1
- package/dist/packem_shared/useTreeViewState-BiTJakkh.js +0 -1
- package/dist/packem_shared/utils-Bup8lyK8.js +0 -1
- package/dist/packem_shared/variant-config-BJqpNo7H.js +0 -1
- package/dist/packem_shared/variant-config.d-D5NnrrQK.d.ts +0 -2
|
@@ -1,43 +1,17 @@
|
|
|
1
1
|
import React, { ReactNode, DependencyList } from 'react';
|
|
2
|
-
import { D as DOMElement } from "../packem_shared/dom.d-
|
|
3
|
-
import { S as Styles } from "../packem_shared/styles.d-
|
|
2
|
+
import { D as DOMElement } from "../packem_shared/dom.d-CLGlidfI.js";
|
|
3
|
+
import { S as Styles } from "../packem_shared/styles.d-CKGQFfm4.js";
|
|
4
4
|
import 'yoga-layout';
|
|
5
|
-
import "../
|
|
5
|
+
import "../ink/public/cursor.js";
|
|
6
6
|
import '@visulima/colorize';
|
|
7
|
-
import 'cli-boxes';
|
|
8
7
|
import 'type-fest';
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
* Children are passed as a render function `() => ReactNode`. Once the cache
|
|
19
|
-
* is ready, the component stops calling the function so React does not
|
|
20
|
-
* re-reconcile the subtree on subsequent renders.
|
|
21
|
-
*
|
|
22
|
-
* Re-rendering the cached content is controlled via the `deps` prop (similar
|
|
23
|
-
* to React's hook deps). When `deps` changes, the cache is invalidated and
|
|
24
|
-
* `children()` is invoked again. If `deps` is omitted, the cache is
|
|
25
|
-
* invalidated whenever the `children` function reference changes.
|
|
26
|
-
*
|
|
27
|
-
* Use this for content that renders once and doesn't change (e.g., completed
|
|
28
|
-
* task output, logged messages, static headers).
|
|
29
|
-
*
|
|
30
|
-
* Ported from jacob314/ink (Google LLC, Apache-2.0).
|
|
31
|
-
* @license Apache-2.0
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @property children Render function invoked once to produce the cached content.
|
|
36
|
-
* @property deps Dependencies that control when the static content is re-rendered. When any dependency changes (shallow, Object.is comparison), the cache is invalidated and children() is invoked again. If omitted, the cache is invalidated whenever the children function reference changes.
|
|
37
|
-
* @property onRender Callback fired after the static content has been rendered and cached. The node's cachedRender holds the measured width/height — useful for reacting to the cached block's size without setting up a full ResizeObserver.
|
|
38
|
-
* @property style Optional style applied to the static-render container.
|
|
39
|
-
* @property width Optional fixed width for the cached region.
|
|
40
|
-
*/
|
|
9
|
+
* @property children Render function invoked once to produce the cached content.
|
|
10
|
+
* @property deps Dependencies that control when the static content is re-rendered. When any dependency changes (shallow, Object.is comparison), the cache is invalidated and children() is invoked again. If omitted, the cache is invalidated whenever the children function reference changes.
|
|
11
|
+
* @property onRender Callback fired after the static content has been rendered and cached. The node's cachedRender holds the measured width/height — useful for reacting to the cached block's size without setting up a full ResizeObserver.
|
|
12
|
+
* @property style Optional style applied to the static-render container.
|
|
13
|
+
* @property width Optional fixed width for the cached region.
|
|
14
|
+
*/
|
|
41
15
|
type Props = {
|
|
42
16
|
readonly children: () => ReactNode;
|
|
43
17
|
readonly deps?: DependencyList;
|
|
@@ -45,11 +19,5 @@ type Props = {
|
|
|
45
19
|
readonly style?: Styles;
|
|
46
20
|
readonly width?: number;
|
|
47
21
|
};
|
|
48
|
-
declare const StaticRender: ({
|
|
49
|
-
children,
|
|
50
|
-
deps,
|
|
51
|
-
onRender,
|
|
52
|
-
style,
|
|
53
|
-
width
|
|
54
|
-
}: Props) => React.ReactNode;
|
|
22
|
+
declare const StaticRender: ({ children, deps, onRender, style, width }: Props) => React.ReactNode;
|
|
55
23
|
export { Props, StaticRender, type Props as StaticRenderProps, StaticRender as default };
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
|
-
import { S as Styles } from "../packem_shared/styles.d-
|
|
2
|
+
import { S as Styles } from "../packem_shared/styles.d-CKGQFfm4.js";
|
|
3
3
|
import '@visulima/colorize';
|
|
4
|
-
import 'cli-boxes';
|
|
5
4
|
import 'type-fest';
|
|
6
5
|
import 'yoga-layout';
|
|
7
6
|
type Props<T> = {
|
|
8
7
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
* Function that is called to render every item in the `items` array. The first argument is the item itself, and the second argument is the index of that item in the `items` array. Note that a `key` must be assigned to the root component.
|
|
9
|
+
*/
|
|
11
10
|
readonly children: (item: T, index: number) => ReactNode;
|
|
12
11
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* Array of items of any type to render using the function you pass as a component child.
|
|
13
|
+
*/
|
|
15
14
|
readonly items: T[];
|
|
16
15
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
* Styles to apply to a container of child elements. See <Box> for supported properties.
|
|
17
|
+
*/
|
|
19
18
|
readonly style?: Styles;
|
|
20
19
|
};
|
|
21
20
|
/**
|
|
22
|
-
* `<Static>` component permanently renders its output above everything else. It's useful for displaying activity like completed tasks or logs—things that don't change after they're rendered (hence the name "Static").
|
|
23
|
-
*
|
|
24
|
-
* It's preferred to use `<Static>` for use cases like these when you can't know or control the number of items that need to be rendered.
|
|
25
|
-
*
|
|
26
|
-
* For example, [Tap](https://github.com/tapjs/node-tap) uses `<Static>` to display a list of completed tests. [Gatsby](https://github.com/gatsbyjs/gatsby) uses it to display a list of generated pages while still displaying a live progress bar.
|
|
27
|
-
*/
|
|
21
|
+
* `<Static>` component permanently renders its output above everything else. It's useful for displaying activity like completed tasks or logs—things that don't change after they're rendered (hence the name "Static").
|
|
22
|
+
*
|
|
23
|
+
* It's preferred to use `<Static>` for use cases like these when you can't know or control the number of items that need to be rendered.
|
|
24
|
+
*
|
|
25
|
+
* For example, [Tap](https://github.com/tapjs/node-tap) uses `<Static>` to display a list of completed tests. [Gatsby](https://github.com/gatsbyjs/gatsby) uses it to display a list of generated pages while still displaying a live progress bar.
|
|
26
|
+
*/
|
|
28
27
|
declare function Static<T>(props: Props<T>): ReactElement;
|
|
29
28
|
export { Props, Static, type Props as StaticProps, Static as default };
|
|
@@ -1,79 +1,65 @@
|
|
|
1
1
|
import { AnsiColors } from '@visulima/colorize';
|
|
2
2
|
import { ReactNode, ReactElement } from 'react';
|
|
3
3
|
import { LiteralUnion } from 'type-fest';
|
|
4
|
-
import { S as Styles } from "../packem_shared/styles.d-
|
|
5
|
-
import 'cli-boxes';
|
|
4
|
+
import { S as Styles } from "../packem_shared/styles.d-CKGQFfm4.js";
|
|
6
5
|
import 'yoga-layout';
|
|
7
6
|
type Props = {
|
|
8
7
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
* Hide the element from screen readers.
|
|
9
|
+
*/
|
|
11
10
|
readonly "aria-hidden"?: boolean;
|
|
12
11
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* A label for the element for screen readers.
|
|
13
|
+
*/
|
|
15
14
|
readonly "aria-label"?: string;
|
|
16
15
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
* Same as `color`, but for the background.
|
|
17
|
+
*/
|
|
19
18
|
readonly backgroundColor?: LiteralUnion<AnsiColors, string>;
|
|
20
19
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
* Make the text bold.
|
|
21
|
+
*/
|
|
23
22
|
readonly bold?: boolean;
|
|
24
23
|
readonly children?: ReactNode;
|
|
25
24
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
* Change text color. Ink uses @visulima/colorize under the hood, so all its functionality is supported.
|
|
26
|
+
*/
|
|
28
27
|
readonly color?: LiteralUnion<AnsiColors, string>;
|
|
29
28
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
* Dim the color (make it less bright).
|
|
30
|
+
*/
|
|
32
31
|
readonly dimColor?: boolean;
|
|
33
32
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
* Inverse background and foreground colors.
|
|
34
|
+
*/
|
|
36
35
|
readonly inverse?: boolean;
|
|
37
36
|
/**
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
* Make the text italic.
|
|
38
|
+
*/
|
|
40
39
|
readonly italic?: boolean;
|
|
41
40
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
* Make the text crossed out with a line.
|
|
42
|
+
*/
|
|
44
43
|
readonly strikethrough?: boolean;
|
|
45
44
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
* Make the text underlined.
|
|
46
|
+
*/
|
|
48
47
|
readonly underline?: boolean;
|
|
49
48
|
/**
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
49
|
+
* Controls how text wraps when it exceeds the container width.
|
|
50
|
+
*
|
|
51
|
+
* - `wrap` (default) — Wrap at word boundaries; break inside words only when a single word exceeds the width.
|
|
52
|
+
* - `wrap-anywhere` — Break at any character boundary, even when a whitespace break exists earlier.
|
|
53
|
+
* - `wrap-preserve-words` — Wrap at word boundaries; never break inside words (long words may overflow).
|
|
54
|
+
* - `wrap-strict` — Enforce exact width; always break at the column limit.
|
|
55
|
+
* - `truncate` / `truncate-end` — Truncate at the end with an ellipsis.
|
|
56
|
+
* - `truncate-start` — Truncate at the start with an ellipsis.
|
|
57
|
+
* - `truncate-middle` — Truncate in the middle with an ellipsis.
|
|
58
|
+
*/
|
|
60
59
|
readonly wrap?: Styles["textWrap"];
|
|
61
60
|
};
|
|
62
61
|
/**
|
|
63
|
-
* This component can display text and change its style to make it bold, underlined, italic, or strikethrough.
|
|
64
|
-
*/
|
|
65
|
-
declare function Text({
|
|
66
|
-
"aria-hidden": ariaHidden,
|
|
67
|
-
"aria-label": ariaLabel,
|
|
68
|
-
backgroundColor,
|
|
69
|
-
bold,
|
|
70
|
-
children,
|
|
71
|
-
color,
|
|
72
|
-
dimColor,
|
|
73
|
-
inverse,
|
|
74
|
-
italic,
|
|
75
|
-
strikethrough,
|
|
76
|
-
underline,
|
|
77
|
-
wrap
|
|
78
|
-
}: Props): ReactElement | null;
|
|
62
|
+
* This component can display text and change its style to make it bold, underlined, italic, or strikethrough.
|
|
63
|
+
*/
|
|
64
|
+
declare function Text({ "aria-hidden": ariaHidden, "aria-label": ariaLabel, backgroundColor, bold, children, color, dimColor, inverse, italic, strikethrough, underline, wrap }: Props): ReactElement | null;
|
|
79
65
|
export { Props, Text, type Props as TextProps, Text as default };
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
2
|
type Props = {
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
* Screen-reader-specific text to output. If this is set, all children will be ignored.
|
|
5
|
+
*/
|
|
6
6
|
readonly accessibilityLabel?: string;
|
|
7
7
|
readonly children?: ReactNode;
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
* Function that transforms children output. It accepts children and must return transformed children as well. Note that when children use `<Text>` styling props (e.g. `color`, `bold`), the string will contain ANSI escape codes.
|
|
10
|
+
*/
|
|
11
11
|
readonly transform: (children: string, index: number) => string;
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
|
-
* Transform a string representation of React components before they're written to output. For example, you might want to apply a gradient to text, add a clickable link, or create some text effects. These use cases can't accept React nodes as input; they expect a string. That's what the <Transform> component does: it gives you an output string of its child components and lets you transform it in any way.
|
|
15
|
-
*/
|
|
16
|
-
declare function Transform({
|
|
17
|
-
accessibilityLabel,
|
|
18
|
-
children,
|
|
19
|
-
transform
|
|
20
|
-
}: Props): ReactElement | null;
|
|
14
|
+
* Transform a string representation of React components before they're written to output. For example, you might want to apply a gradient to text, add a clickable link, or create some text effects. These use cases can't accept React nodes as input; they expect a string. That's what the <Transform> component does: it gives you an output string of its child components and lets you transform it in any way.
|
|
15
|
+
*/
|
|
16
|
+
declare function Transform({ accessibilityLabel, children, transform }: Props): ReactElement | null;
|
|
21
17
|
export { Props, Transform, type Props as TransformProps, Transform as default };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
export { I as InlineLoop, a as InlineOptions, b as InlinePaintFn, c as InputParser, M as MouseEvent, T as TuiApp, d as createInlineLoop } from "../packem_shared/input.d-
|
|
2
|
-
import 'tseep';
|
|
1
|
+
export { I as InlineLoop, a as InlineOptions, b as InlinePaintFn, c as InputParser, M as MouseEvent, T as TuiApp, d as createInlineLoop } from "../packem_shared/input.d-Bb8pWHvp.js";
|
|
3
2
|
/**
|
|
4
|
-
* 2×u32 per-cell back-buffer layout:
|
|
5
|
-
* buffer[idx * 2] = charCode (Unicode codepoint, u32)
|
|
6
|
-
* buffer[idx * 2 + 1] = attrCode = (styles << 16) | (bg << 8) | fg
|
|
7
|
-
*/
|
|
3
|
+
* 2×u32 per-cell back-buffer layout:
|
|
4
|
+
* buffer[idx * 2] = charCode (Unicode codepoint, u32)
|
|
5
|
+
* buffer[idx * 2 + 1] = attrCode = (styles << 16) | (bg << 8) | fg
|
|
6
|
+
*/
|
|
8
7
|
declare const Cell: {
|
|
9
8
|
/** Read bg color from an attr slot value (buffer[idx*2+1]) — bits 15:8 */
|
|
10
9
|
getBg(attributeSlot: number): number;
|
|
@@ -15,12 +14,12 @@ declare const Cell: {
|
|
|
15
14
|
/** Read styles bitmask from an attr slot value (buffer[idx*2+1]) — bits 23:16 */
|
|
16
15
|
getStyles(attributeSlot: number): number;
|
|
17
16
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
* Pack a cell into a [charCode, attrCode] tuple.
|
|
18
|
+
* charCode = char.codePointAt(0)
|
|
19
|
+
* attrCode = (styles & 0xFF) << 16 | (bg & 0xFF) << 8 | (fg & 0xFF)
|
|
20
|
+
*
|
|
21
|
+
* Write to buffer as: buffer[idx*2] = charCode; buffer[idx*2+1] = attrCode
|
|
22
|
+
*/
|
|
24
23
|
pack(char: string, fg?: number, bg?: number, styles?: number): [number, number];
|
|
25
24
|
};
|
|
26
25
|
declare const StyleMasks: {
|
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TuiApp as o}from"../packem_shared/TuiApp-
|
|
1
|
+
import{TuiApp as o}from"../packem_shared/TuiApp-CCVaiKbf.js";import{Cell as t,StyleMasks as m}from"../packem_shared/Cell-BrXn3jxY.js";import{createInlineLoop as l}from"../packem_shared/createInlineLoop-DnEvE2eM.js";import{InputParser as f}from"../packem_shared/InputParser-CiBitCva.js";import{Renderer as x,TerminalGuard as s,terminalSize as u}from"../packem_shared/Renderer-BeS49FNq.js";export{t as Cell,f as InputParser,x as Renderer,m as StyleMasks,s as TerminalGuard,o as TuiApp,l as createInlineLoop,u as terminalSize};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { C as CanvasContext, b as CellStyle } from "../../packem_shared/buffer.d-CttIC480.js";
|
|
2
|
+
export { type c as CanvasBuffer, type a as CanvasColor, d as createCanvasBuffer, s as serializeRow } from "../../packem_shared/buffer.d-CttIC480.js";
|
|
3
|
+
type BrailleGrid = {
|
|
4
|
+
readonly cellHeight: number;
|
|
5
|
+
readonly cellWidth: number;
|
|
6
|
+
readonly clear: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Flush the accumulated pixels into the canvas, one braille character per
|
|
9
|
+
* dirtied cell. Pass a color via `style` to apply it uniformly (mixing
|
|
10
|
+
* colors across overlapping series requires a separate grid per series).
|
|
11
|
+
*/
|
|
12
|
+
readonly flush: (context: CanvasContext, style?: CellStyle) => void;
|
|
13
|
+
readonly pixelHeight: number;
|
|
14
|
+
readonly pixelWidth: number;
|
|
15
|
+
readonly plotLine: (x0: number, y0: number, x1: number, y1: number) => void;
|
|
16
|
+
readonly plotPoint: (x: number, y: number) => void;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Accumulator for braille-rendered charts. Tracks which sub-pixels are lit
|
|
20
|
+
* and emits a braille character per dirtied cell on `flush`. Designed to be
|
|
21
|
+
* allocated per chart render and thrown away.
|
|
22
|
+
*/
|
|
23
|
+
declare const createBrailleGrid: (cellWidth: number, cellHeight: number) => BrailleGrid;
|
|
24
|
+
export { type BrailleGrid, type CanvasContext, type CellStyle, createBrailleGrid };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createBrailleGrid as a}from"../../packem_shared/createBrailleGrid-BTOQrujS.js";import{createCanvasBuffer as f,serializeRow as i}from"../../packem_shared/createCanvasBuffer-CL6sAM-A.js";export{a as createBrailleGrid,f as createCanvasBuffer,i as serializeRow};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
type Options = {
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
* Time between ticks in milliseconds.
|
|
4
|
+
* @default 100
|
|
5
|
+
*/
|
|
6
6
|
readonly interval?: number;
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
* Whether the animation is running. When set to `false`, the animation stops.
|
|
9
|
+
* When toggled back to `true`, all values reset to `0`.
|
|
10
|
+
* @default true
|
|
11
|
+
*/
|
|
12
12
|
readonly isActive?: boolean;
|
|
13
13
|
};
|
|
14
14
|
type AnimationResult = {
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
* Time in milliseconds since the previous rendered tick. Accounts for throttled renders.
|
|
17
|
+
* Useful for physics-based or velocity-driven motion: `position += speed * delta`.
|
|
18
|
+
*/
|
|
19
19
|
readonly delta: number;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
* Discrete counter that increments by 1 each interval.
|
|
22
|
+
* Useful for indexed sequences like spinner frames.
|
|
23
|
+
*/
|
|
24
24
|
readonly frame: number;
|
|
25
25
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
* Resets `frame`, `time`, and `delta` to `0` and restarts timing from the current moment.
|
|
27
|
+
* Useful for one-shot animations triggered by events.
|
|
28
|
+
*/
|
|
29
29
|
readonly reset: () => void;
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
* Total elapsed time in milliseconds since the animation started or was last reset.
|
|
32
|
+
* Useful for continuous math-based animations like sine waves: `Math.sin(time / 1000 * Math.PI * 2)`.
|
|
33
|
+
*/
|
|
34
34
|
readonly time: number;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* A React hook that drives animations. Returns a frame counter, elapsed time, frame delta, and a reset function.
|
|
38
|
-
* All animations share a single timer internally, so multiple animated components consolidate into one render cycle.
|
|
39
|
-
*/
|
|
37
|
+
* A React hook that drives animations. Returns a frame counter, elapsed time, frame delta, and a reset function.
|
|
38
|
+
* All animations share a single timer internally, so multiple animated components consolidate into one render cycle.
|
|
39
|
+
*/
|
|
40
40
|
declare function useAnimation(options?: Options): AnimationResult;
|
|
41
41
|
export { AnimationResult, useAnimation as default, useAnimation };
|
|
@@ -1,38 +1,7 @@
|
|
|
1
|
+
import { P as Props } from "../../packem_shared/app-context.d-DMLw5Nxy.js";
|
|
1
2
|
import 'react';
|
|
2
|
-
type Props = {
|
|
3
|
-
/**
|
|
4
|
-
* Exit (unmount) the whole Ink app.
|
|
5
|
-
*
|
|
6
|
-
* - `exit()` — resolves `waitUntilExit()` with `undefined`.
|
|
7
|
-
* - `exit(new Error('…'))` — rejects `waitUntilExit()` with the error.
|
|
8
|
-
* - `exit(value)` — resolves `waitUntilExit()` with `value`.
|
|
9
|
-
*/
|
|
10
|
-
readonly exit: (errorOrResult?: Error | unknown) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Returns a promise that settles after pending render output is flushed to stdout.
|
|
13
|
-
* @example
|
|
14
|
-
* ```jsx
|
|
15
|
-
* import {useEffect} from 'react';
|
|
16
|
-
* import {useApp} from '@visulima/tui/hooks/use-app';
|
|
17
|
-
|
|
18
|
-
const Example = () => {
|
|
19
|
-
const {waitUntilRenderFlush} = useApp();
|
|
20
|
-
|
|
21
|
-
useEffect(() => {
|
|
22
|
-
void (async () => {
|
|
23
|
-
await waitUntilRenderFlush();
|
|
24
|
-
runNextCommand();
|
|
25
|
-
})();
|
|
26
|
-
}, [waitUntilRenderFlush]);
|
|
27
|
-
|
|
28
|
-
return …;
|
|
29
|
-
};
|
|
30
|
-
```
|
|
31
|
-
*/
|
|
32
|
-
readonly waitUntilRenderFlush: () => Promise<void>;
|
|
33
|
-
};
|
|
34
3
|
/**
|
|
35
|
-
* A React hook that returns app lifecycle methods like `exit()` and `waitUntilRenderFlush()`.
|
|
36
|
-
*/
|
|
4
|
+
* A React hook that returns app lifecycle methods like `exit()` and `waitUntilRenderFlush()`.
|
|
5
|
+
*/
|
|
37
6
|
declare const useApp: () => Props;
|
|
38
7
|
export { type Props as AppProps, useApp as default, useApp };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext as
|
|
1
|
+
import{useContext as o}from"react";import{e as t}from"../../packem_shared/app-context-DTm1_XBA.js";const r=()=>o(t);export{r as default,r as useApp};
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { D as DOMElement } from "../../packem_shared/dom.d-
|
|
2
|
+
import { D as DOMElement } from "../../packem_shared/dom.d-CLGlidfI.js";
|
|
3
3
|
import 'yoga-layout';
|
|
4
|
-
import "
|
|
4
|
+
import "../public/cursor.js";
|
|
5
5
|
import '@visulima/colorize';
|
|
6
|
-
import
|
|
7
|
-
import "../../packem_shared/styles.d-cMo36xQz.js";
|
|
6
|
+
import "../../packem_shared/styles.d-CKGQFfm4.js";
|
|
8
7
|
import 'type-fest';
|
|
9
8
|
/**
|
|
10
|
-
* Metrics of a box element.
|
|
11
|
-
*
|
|
12
|
-
* All positions are relative to the element's parent.
|
|
13
|
-
*/
|
|
9
|
+
* Metrics of a box element.
|
|
10
|
+
*
|
|
11
|
+
* All positions are relative to the element's parent.
|
|
12
|
+
*/
|
|
14
13
|
type BoxMetrics = {
|
|
15
14
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
* Element height.
|
|
16
|
+
*/
|
|
18
17
|
readonly height: number;
|
|
19
18
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
* Distance from the left edge of the parent.
|
|
20
|
+
*/
|
|
22
21
|
readonly left: number;
|
|
23
22
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
* Distance from the top edge of the parent.
|
|
24
|
+
*/
|
|
26
25
|
readonly top: number;
|
|
27
26
|
/**
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
* Element width.
|
|
28
|
+
*/
|
|
30
29
|
readonly width: number;
|
|
31
30
|
};
|
|
32
31
|
type UseBoxMetricsResult = BoxMetrics & {
|
|
33
32
|
/**
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
* Whether the currently tracked element has been measured in the latest layout pass.
|
|
34
|
+
*/
|
|
36
35
|
readonly hasMeasured: boolean;
|
|
37
36
|
};
|
|
38
37
|
/**
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { C as ClipboardTarget } from "../../packem_shared/clipboard.d-
|
|
1
|
+
import { C as ClipboardTarget } from "../../packem_shared/clipboard.d-nDPQkZ2H.js";
|
|
2
2
|
import 'node:stream';
|
|
3
3
|
type UseClipboardOptions = {
|
|
4
4
|
/**
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
* The clipboard target to write to.
|
|
6
|
+
* @default "c"
|
|
7
|
+
*/
|
|
8
8
|
readonly target?: ClipboardTarget;
|
|
9
9
|
};
|
|
10
10
|
type UseClipboardResult = {
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* Copy text to the system clipboard.
|
|
13
|
+
* No-op if the terminal does not support OSC 52.
|
|
14
|
+
*/
|
|
15
15
|
readonly copy: (text: string) => void;
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
* Whether the current terminal supports OSC 52 clipboard operations.
|
|
18
|
+
*/
|
|
19
19
|
readonly isSupported: boolean;
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
|
-
* Hook that provides clipboard write access via OSC 52.
|
|
23
|
-
*
|
|
24
|
-
* ```tsx
|
|
25
|
-
* const { copy, isSupported } = useClipboard();
|
|
26
|
-
* copy("Hello, clipboard!");
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
22
|
+
* Hook that provides clipboard write access via OSC 52.
|
|
23
|
+
*
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const { copy, isSupported } = useClipboard();
|
|
26
|
+
* copy("Hello, clipboard!");
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
29
|
declare const useClipboard: (options?: UseClipboardOptions) => UseClipboardResult;
|
|
30
30
|
export { UseClipboardOptions, UseClipboardResult, useClipboard as default, useClipboard };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { C as ColorBlindnessType, a as ColorMatrix } from "../../packem_shared/color-matrix.d-
|
|
1
|
+
import { C as ColorBlindnessType, a as ColorMatrix } from "../../packem_shared/color-matrix.d-sTqnJ23h.js";
|
|
2
2
|
type UseColorBlindnessOptions = {
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
* Use compensation mode (shift colors to distinguishable range)
|
|
5
|
+
* instead of simulation mode (show how colors appear to affected users).
|
|
6
|
+
* Not available for achromatopsia.
|
|
7
|
+
* @default false
|
|
8
|
+
*/
|
|
9
9
|
readonly compensate?: boolean;
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
* Type of color vision deficiency to simulate or compensate for.
|
|
12
|
+
* @default "none"
|
|
13
|
+
*/
|
|
14
14
|
readonly mode?: ColorBlindnessType | "none";
|
|
15
15
|
};
|
|
16
16
|
type UseColorBlindnessResult = {
|
|
@@ -22,12 +22,12 @@ type UseColorBlindnessResult = {
|
|
|
22
22
|
readonly transformColor: (hex: string) => string;
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
* Hook for color blindness simulation and compensation.
|
|
26
|
-
*
|
|
27
|
-
* ```tsx
|
|
28
|
-
* const { transformColor } = useColorBlindness({ mode: "deuteranopia" });
|
|
29
|
-
* <Text color={transformColor("#ff0000")}>This text</Text>
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
25
|
+
* Hook for color blindness simulation and compensation.
|
|
26
|
+
*
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const { transformColor } = useColorBlindness({ mode: "deuteranopia" });
|
|
29
|
+
* <Text color={transformColor("#ff0000")}>This text</Text>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
32
|
declare const useColorBlindness: (options?: UseColorBlindnessOptions) => UseColorBlindnessResult;
|
|
33
33
|
export { UseColorBlindnessOptions, UseColorBlindnessResult, useColorBlindness as default, useColorBlindness };
|
|
@@ -7,19 +7,19 @@ type ConsoleEntry = {
|
|
|
7
7
|
};
|
|
8
8
|
type UseConsoleCaptureOptions = {
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
* Which console levels to capture.
|
|
11
|
+
* @default ["log", "info", "warn", "error", "debug"]
|
|
12
|
+
*/
|
|
13
13
|
readonly filter?: ReadonlyArray<ConsoleLevel>;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
* Enable or disable capture.
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
18
|
readonly isActive?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
* Maximum number of entries to keep in the buffer.
|
|
21
|
+
* @default 200
|
|
22
|
+
*/
|
|
23
23
|
readonly maxEntries?: number;
|
|
24
24
|
};
|
|
25
25
|
type UseConsoleCaptureResult = {
|
|
@@ -29,15 +29,15 @@ type UseConsoleCaptureResult = {
|
|
|
29
29
|
readonly entries: ReadonlyArray<ConsoleEntry>;
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
|
-
* Hook that captures console output into a React state buffer.
|
|
33
|
-
*
|
|
34
|
-
* **Note:** Only one active `useConsoleCapture` instance should exist at a time.
|
|
35
|
-
* The `ConsoleOverlay` component uses this hook internally — do not use both
|
|
36
|
-
* simultaneously unless the hook instance has `isActive: false`.
|
|
37
|
-
*
|
|
38
|
-
* ```tsx
|
|
39
|
-
* const { entries, clear } = useConsoleCapture({ maxEntries: 100 });
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
32
|
+
* Hook that captures console output into a React state buffer.
|
|
33
|
+
*
|
|
34
|
+
* **Note:** Only one active `useConsoleCapture` instance should exist at a time.
|
|
35
|
+
* The `ConsoleOverlay` component uses this hook internally — do not use both
|
|
36
|
+
* simultaneously unless the hook instance has `isActive: false`.
|
|
37
|
+
*
|
|
38
|
+
* ```tsx
|
|
39
|
+
* const { entries, clear } = useConsoleCapture({ maxEntries: 100 });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
42
|
declare const useConsoleCapture: (options?: UseConsoleCaptureOptions) => UseConsoleCaptureResult;
|
|
43
43
|
export { ConsoleEntry, ConsoleLevel, UseConsoleCaptureOptions, UseConsoleCaptureResult, useConsoleCapture as default, useConsoleCapture };
|