@effect-tui/react 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jsx-runtime.d.ts +13 -0
- package/dist/jsx-runtime.d.ts.map +1 -1
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/src/codeblock.d.ts.map +1 -1
- package/dist/src/codeblock.js.map +1 -1
- package/dist/src/components/Divider.d.ts +18 -0
- package/dist/src/components/Divider.d.ts.map +1 -0
- package/dist/src/components/Divider.js +17 -0
- package/dist/src/components/Divider.js.map +1 -0
- package/dist/src/components/Markdown.d.ts +66 -0
- package/dist/src/components/Markdown.d.ts.map +1 -0
- package/dist/src/components/Markdown.js +226 -0
- package/dist/src/components/Markdown.js.map +1 -0
- package/dist/src/components/MultilineTextInput.d.ts +65 -0
- package/dist/src/components/MultilineTextInput.d.ts.map +1 -0
- package/dist/src/components/MultilineTextInput.js +607 -0
- package/dist/src/components/MultilineTextInput.js.map +1 -0
- package/dist/src/components/Overlay.d.ts +46 -0
- package/dist/src/components/Overlay.d.ts.map +1 -0
- package/dist/src/components/Overlay.js +11 -0
- package/dist/src/components/Overlay.js.map +1 -0
- package/dist/src/components/Static.d.ts +44 -0
- package/dist/src/components/Static.d.ts.map +1 -0
- package/dist/src/components/Static.js +53 -0
- package/dist/src/components/Static.js.map +1 -0
- package/dist/src/components/TextInput.d.ts +53 -0
- package/dist/src/components/TextInput.d.ts.map +1 -0
- package/dist/src/components/TextInput.js +210 -0
- package/dist/src/components/TextInput.js.map +1 -0
- package/dist/src/components/index.d.ts +7 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +7 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/text-editing.d.ts +62 -0
- package/dist/src/components/text-editing.d.ts.map +1 -0
- package/dist/src/components/text-editing.js +385 -0
- package/dist/src/components/text-editing.js.map +1 -0
- package/dist/src/console/ConsoleCapture.d.ts +36 -0
- package/dist/src/console/ConsoleCapture.d.ts.map +1 -0
- package/dist/src/console/ConsoleCapture.js +210 -0
- package/dist/src/console/ConsoleCapture.js.map +1 -0
- package/dist/src/console/ConsolePopover.d.ts +18 -0
- package/dist/src/console/ConsolePopover.d.ts.map +1 -0
- package/dist/src/console/ConsolePopover.js +324 -0
- package/dist/src/console/ConsolePopover.js.map +1 -0
- package/dist/src/console/clipboard.d.ts +10 -0
- package/dist/src/console/clipboard.d.ts.map +1 -0
- package/dist/src/console/clipboard.js +74 -0
- package/dist/src/console/clipboard.js.map +1 -0
- package/dist/src/console/index.d.ts +5 -0
- package/dist/src/console/index.d.ts.map +1 -0
- package/dist/src/console/index.js +33 -0
- package/dist/src/console/index.js.map +1 -0
- package/dist/src/console/useConsole.d.ts +44 -0
- package/dist/src/console/useConsole.d.ts.map +1 -0
- package/dist/src/console/useConsole.js +91 -0
- package/dist/src/console/useConsole.js.map +1 -0
- package/dist/src/debug/DebugOverlay.d.ts +49 -0
- package/dist/src/debug/DebugOverlay.d.ts.map +1 -0
- package/dist/src/debug/DebugOverlay.js +438 -0
- package/dist/src/debug/DebugOverlay.js.map +1 -0
- package/dist/src/debug/DiagnosticsPanel.d.ts.map +1 -1
- package/dist/src/debug/DiagnosticsPanel.js.map +1 -1
- package/dist/src/dev/Toast.d.ts +19 -0
- package/dist/src/dev/Toast.d.ts.map +1 -0
- package/dist/src/dev/Toast.js +72 -0
- package/dist/src/dev/Toast.js.map +1 -0
- package/dist/src/dev/index.d.ts +2 -0
- package/dist/src/dev/index.d.ts.map +1 -0
- package/dist/src/dev/index.js +3 -0
- package/dist/src/dev/index.js.map +1 -0
- package/dist/src/dev.d.ts +114 -0
- package/dist/src/dev.d.ts.map +1 -0
- package/dist/src/dev.js +373 -0
- package/dist/src/dev.js.map +1 -0
- package/dist/src/highlight.d.ts +3 -3
- package/dist/src/highlight.d.ts.map +1 -1
- package/dist/src/highlight.js.map +1 -1
- package/dist/src/hmr-plugin.d.ts +2 -0
- package/dist/src/hmr-plugin.d.ts.map +1 -0
- package/dist/src/hmr-plugin.js +53 -0
- package/dist/src/hmr-plugin.js.map +1 -0
- package/dist/src/hooks/index.d.ts +4 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +2 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/use-keyboard.d.ts +11 -0
- package/dist/src/hooks/use-keyboard.d.ts.map +1 -1
- package/dist/src/hooks/use-keyboard.js +22 -4
- package/dist/src/hooks/use-keyboard.js.map +1 -1
- package/dist/src/hooks/use-mouse.d.ts +24 -0
- package/dist/src/hooks/use-mouse.d.ts.map +1 -0
- package/dist/src/hooks/use-mouse.js +41 -0
- package/dist/src/hooks/use-mouse.js.map +1 -0
- package/dist/src/hooks/use-paste.d.ts +11 -0
- package/dist/src/hooks/use-paste.d.ts.map +1 -1
- package/dist/src/hooks/use-paste.js +17 -3
- package/dist/src/hooks/use-paste.js.map +1 -1
- package/dist/src/hooks/use-scroll.d.ts +79 -0
- package/dist/src/hooks/use-scroll.d.ts.map +1 -0
- package/dist/src/hooks/use-scroll.js +239 -0
- package/dist/src/hooks/use-scroll.js.map +1 -0
- package/dist/src/hooks/useFrameStats.js.map +1 -1
- package/dist/src/hosts/base.d.ts +62 -1
- package/dist/src/hosts/base.d.ts.map +1 -1
- package/dist/src/hosts/base.js +118 -5
- package/dist/src/hosts/base.js.map +1 -1
- package/dist/src/hosts/box.d.ts +7 -7
- package/dist/src/hosts/box.d.ts.map +1 -1
- package/dist/src/hosts/box.js +30 -23
- package/dist/src/hosts/box.js.map +1 -1
- package/dist/src/hosts/canvas.d.ts +8 -8
- package/dist/src/hosts/canvas.d.ts.map +1 -1
- package/dist/src/hosts/canvas.js +13 -22
- package/dist/src/hosts/canvas.js.map +1 -1
- package/dist/src/hosts/codeblock.d.ts +7 -7
- package/dist/src/hosts/codeblock.d.ts.map +1 -1
- package/dist/src/hosts/codeblock.js +11 -20
- package/dist/src/hosts/codeblock.js.map +1 -1
- package/dist/src/hosts/flex-container.d.ts +45 -0
- package/dist/src/hosts/flex-container.d.ts.map +1 -0
- package/dist/src/hosts/flex-container.js +90 -0
- package/dist/src/hosts/flex-container.js.map +1 -0
- package/dist/src/hosts/hstack.d.ts +6 -11
- package/dist/src/hosts/hstack.d.ts.map +1 -1
- package/dist/src/hosts/hstack.js +6 -41
- package/dist/src/hosts/hstack.js.map +1 -1
- package/dist/src/hosts/index.d.ts +4 -0
- package/dist/src/hosts/index.d.ts.map +1 -1
- package/dist/src/hosts/index.js +10 -0
- package/dist/src/hosts/index.js.map +1 -1
- package/dist/src/hosts/overlay-item.d.ts +32 -0
- package/dist/src/hosts/overlay-item.d.ts.map +1 -0
- package/dist/src/hosts/overlay-item.js +54 -0
- package/dist/src/hosts/overlay-item.js.map +1 -0
- package/dist/src/hosts/overlay.d.ts +30 -0
- package/dist/src/hosts/overlay.d.ts.map +1 -0
- package/dist/src/hosts/overlay.js +105 -0
- package/dist/src/hosts/overlay.js.map +1 -0
- package/dist/src/hosts/scroll.d.ts +56 -0
- package/dist/src/hosts/scroll.d.ts.map +1 -0
- package/dist/src/hosts/scroll.js +204 -0
- package/dist/src/hosts/scroll.js.map +1 -0
- package/dist/src/hosts/single-child.d.ts +16 -0
- package/dist/src/hosts/single-child.d.ts.map +1 -0
- package/dist/src/hosts/single-child.js +45 -0
- package/dist/src/hosts/single-child.js.map +1 -0
- package/dist/src/hosts/spacer.d.ts.map +1 -1
- package/dist/src/hosts/spacer.js +7 -3
- package/dist/src/hosts/spacer.js.map +1 -1
- package/dist/src/hosts/text.d.ts +9 -6
- package/dist/src/hosts/text.d.ts.map +1 -1
- package/dist/src/hosts/text.js +49 -22
- package/dist/src/hosts/text.js.map +1 -1
- package/dist/src/hosts/vstack.d.ts +6 -11
- package/dist/src/hosts/vstack.d.ts.map +1 -1
- package/dist/src/hosts/vstack.js +6 -41
- package/dist/src/hosts/vstack.js.map +1 -1
- package/dist/src/hosts/zstack.d.ts.map +1 -1
- package/dist/src/hosts/zstack.js +16 -5
- package/dist/src/hosts/zstack.js.map +1 -1
- package/dist/src/index.d.ts +9 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/inline/index.d.ts.map +1 -1
- package/dist/src/inline/index.js.map +1 -1
- package/dist/src/motion/color-motion-value.d.ts.map +1 -1
- package/dist/src/motion/color-motion-value.js.map +1 -1
- package/dist/src/motion/color.d.ts +1 -29
- package/dist/src/motion/color.d.ts.map +1 -1
- package/dist/src/motion/color.js +2 -170
- package/dist/src/motion/color.js.map +1 -1
- package/dist/src/motion/color.test.js.map +1 -1
- package/dist/src/motion/event-emitter.d.ts.map +1 -1
- package/dist/src/motion/event-emitter.js.map +1 -1
- package/dist/src/motion/frame.js.map +1 -1
- package/dist/src/motion/hooks.d.ts.map +1 -1
- package/dist/src/motion/hooks.js +8 -3
- package/dist/src/motion/hooks.js.map +1 -1
- package/dist/src/motion/index.d.ts.map +1 -1
- package/dist/src/motion/index.js.map +1 -1
- package/dist/src/motion/motion-value.d.ts.map +1 -1
- package/dist/src/motion/motion-value.js.map +1 -1
- package/dist/src/motion/motion-value.test.js.map +1 -1
- package/dist/src/motion/spring-math.d.ts +6 -1
- package/dist/src/motion/spring-math.d.ts.map +1 -1
- package/dist/src/motion/spring-math.js +6 -1
- package/dist/src/motion/spring-math.js.map +1 -1
- package/dist/src/motion/types.d.ts.map +1 -1
- package/dist/src/motion/types.js.map +1 -1
- package/dist/src/profiler.js.map +1 -1
- package/dist/src/reconciler/host-config.d.ts +5 -5
- package/dist/src/reconciler/host-config.d.ts.map +1 -1
- package/dist/src/reconciler/host-config.js +43 -51
- package/dist/src/reconciler/host-config.js.map +1 -1
- package/dist/src/reconciler/noop-methods.d.ts +29 -0
- package/dist/src/reconciler/noop-methods.d.ts.map +1 -0
- package/dist/src/reconciler/noop-methods.js +43 -0
- package/dist/src/reconciler/noop-methods.js.map +1 -0
- package/dist/src/reconciler/types.d.ts +68 -14
- package/dist/src/reconciler/types.d.ts.map +1 -1
- package/dist/src/remote/Procedures.d.ts +22 -0
- package/dist/src/remote/Procedures.d.ts.map +1 -0
- package/dist/src/remote/Procedures.js +42 -0
- package/dist/src/remote/Procedures.js.map +1 -0
- package/dist/src/remote/Router.d.ts +20 -0
- package/dist/src/remote/Router.d.ts.map +1 -0
- package/dist/src/remote/Router.js +26 -0
- package/dist/src/remote/Router.js.map +1 -0
- package/dist/src/remote/Server.d.ts +6 -0
- package/dist/src/remote/Server.d.ts.map +1 -0
- package/dist/src/remote/Server.js +53 -0
- package/dist/src/remote/Server.js.map +1 -0
- package/dist/src/remote/index.d.ts +18 -0
- package/dist/src/remote/index.d.ts.map +1 -0
- package/dist/src/remote/index.js +74 -0
- package/dist/src/remote/index.js.map +1 -0
- package/dist/src/renderer/core/FrameBuilder.d.ts +18 -0
- package/dist/src/renderer/core/FrameBuilder.d.ts.map +1 -0
- package/dist/src/renderer/core/FrameBuilder.js +38 -0
- package/dist/src/renderer/core/FrameBuilder.js.map +1 -0
- package/dist/src/renderer/core/RendererState.d.ts +41 -0
- package/dist/src/renderer/core/RendererState.d.ts.map +1 -0
- package/dist/src/renderer/core/RendererState.js +70 -0
- package/dist/src/renderer/core/RendererState.js.map +1 -0
- package/dist/src/renderer/core/index.d.ts +3 -0
- package/dist/src/renderer/core/index.d.ts.map +1 -0
- package/dist/src/renderer/core/index.js +3 -0
- package/dist/src/renderer/core/index.js.map +1 -0
- package/dist/src/renderer/input/InputProcessor.d.ts +25 -0
- package/dist/src/renderer/input/InputProcessor.d.ts.map +1 -0
- package/dist/src/renderer/input/InputProcessor.js +81 -0
- package/dist/src/renderer/input/InputProcessor.js.map +1 -0
- package/dist/src/renderer/input/index.d.ts +2 -0
- package/dist/src/renderer/input/index.d.ts.map +1 -0
- package/dist/src/renderer/input/index.js +2 -0
- package/dist/src/renderer/input/index.js.map +1 -0
- package/dist/src/renderer/lifecycle/EventBus.d.ts +41 -0
- package/dist/src/renderer/lifecycle/EventBus.d.ts.map +1 -0
- package/dist/src/renderer/lifecycle/EventBus.js +78 -0
- package/dist/src/renderer/lifecycle/EventBus.js.map +1 -0
- package/dist/src/renderer/lifecycle/ResizeManager.d.ts +34 -0
- package/dist/src/renderer/lifecycle/ResizeManager.d.ts.map +1 -0
- package/dist/src/renderer/lifecycle/ResizeManager.js +47 -0
- package/dist/src/renderer/lifecycle/ResizeManager.js.map +1 -0
- package/dist/src/renderer/lifecycle/TerminalSetup.d.ts +36 -0
- package/dist/src/renderer/lifecycle/TerminalSetup.d.ts.map +1 -0
- package/dist/src/renderer/lifecycle/TerminalSetup.js +82 -0
- package/dist/src/renderer/lifecycle/TerminalSetup.js.map +1 -0
- package/dist/src/renderer/lifecycle/index.d.ts +4 -0
- package/dist/src/renderer/lifecycle/index.d.ts.map +1 -0
- package/dist/src/renderer/lifecycle/index.js +4 -0
- package/dist/src/renderer/lifecycle/index.js.map +1 -0
- package/dist/src/renderer/modes/FullscreenRenderer.d.ts +12 -0
- package/dist/src/renderer/modes/FullscreenRenderer.d.ts.map +1 -0
- package/dist/src/renderer/modes/FullscreenRenderer.js +52 -0
- package/dist/src/renderer/modes/FullscreenRenderer.js.map +1 -0
- package/dist/src/renderer/modes/InlineRenderer.d.ts +22 -0
- package/dist/src/renderer/modes/InlineRenderer.d.ts.map +1 -0
- package/dist/src/renderer/modes/InlineRenderer.js +154 -0
- package/dist/src/renderer/modes/InlineRenderer.js.map +1 -0
- package/dist/src/renderer/modes/RendererMode.d.ts +42 -0
- package/dist/src/renderer/modes/RendererMode.d.ts.map +1 -0
- package/dist/src/renderer/modes/RendererMode.js +2 -0
- package/dist/src/renderer/modes/RendererMode.js.map +1 -0
- package/dist/src/renderer/modes/StaticContentRenderer.d.ts +25 -0
- package/dist/src/renderer/modes/StaticContentRenderer.d.ts.map +1 -0
- package/dist/src/renderer/modes/StaticContentRenderer.js +47 -0
- package/dist/src/renderer/modes/StaticContentRenderer.js.map +1 -0
- package/dist/src/renderer/modes/index.d.ts +5 -0
- package/dist/src/renderer/modes/index.d.ts.map +1 -0
- package/dist/src/renderer/modes/index.js +4 -0
- package/dist/src/renderer/modes/index.js.map +1 -0
- package/dist/src/renderer-context.d.ts +9 -0
- package/dist/src/renderer-context.d.ts.map +1 -0
- package/dist/src/renderer-context.js +22 -0
- package/dist/src/renderer-context.js.map +1 -0
- package/dist/src/renderer-types.d.ts +103 -0
- package/dist/src/renderer-types.d.ts.map +1 -0
- package/dist/src/renderer-types.js +2 -0
- package/dist/src/renderer-types.js.map +1 -0
- package/dist/src/renderer.d.ts +4 -86
- package/dist/src/renderer.d.ts.map +1 -1
- package/dist/src/renderer.js +213 -384
- package/dist/src/renderer.js.map +1 -1
- package/dist/src/test/index.d.ts.map +1 -1
- package/dist/src/test/index.js.map +1 -1
- package/dist/src/test/mock-streams.d.ts.map +1 -1
- package/dist/src/test/mock-streams.js.map +1 -1
- package/dist/src/test/render-tui.d.ts.map +1 -1
- package/dist/src/test/render-tui.js +2 -5
- package/dist/src/test/render-tui.js.map +1 -1
- package/dist/src/trace/SpanTree.d.ts.map +1 -1
- package/dist/src/trace/SpanTree.js +21 -11
- package/dist/src/trace/SpanTree.js.map +1 -1
- package/dist/src/trace/format-value.d.ts +15 -0
- package/dist/src/trace/format-value.d.ts.map +1 -0
- package/dist/src/trace/format-value.js +77 -0
- package/dist/src/trace/format-value.js.map +1 -0
- package/dist/src/trace/index.d.ts.map +1 -1
- package/dist/src/trace/index.js.map +1 -1
- package/dist/src/trace/location.js +1 -1
- package/dist/src/trace/location.js.map +1 -1
- package/dist/src/trace/span-processor.d.ts.map +1 -1
- package/dist/src/trace/span-processor.js.map +1 -1
- package/dist/src/trace/span-state.d.ts +19 -2
- package/dist/src/trace/span-state.d.ts.map +1 -1
- package/dist/src/trace/span-state.js +62 -31
- package/dist/src/trace/span-state.js.map +1 -1
- package/dist/src/trace/tui-logger.js.map +1 -1
- package/dist/src/utils/border.d.ts +1 -1
- package/dist/src/utils/border.d.ts.map +1 -1
- package/dist/src/utils/border.js +6 -0
- package/dist/src/utils/border.js.map +1 -1
- package/dist/src/utils/flex-layout.d.ts +2 -1
- package/dist/src/utils/flex-layout.d.ts.map +1 -1
- package/dist/src/utils/flex-layout.js +22 -33
- package/dist/src/utils/flex-layout.js.map +1 -1
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +1 -1
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/padding.d.ts.map +1 -1
- package/dist/src/utils/padding.js.map +1 -1
- package/dist/src/utils/styles.d.ts +20 -1
- package/dist/src/utils/styles.d.ts.map +1 -1
- package/dist/src/utils/styles.js +36 -1
- package/dist/src/utils/styles.js.map +1 -1
- package/dist/src/visualize/index.d.ts +8 -19
- package/dist/src/visualize/index.d.ts.map +1 -1
- package/dist/src/visualize/index.js +11 -25
- package/dist/src/visualize/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/jsx-dev-runtime.ts +5 -0
- package/jsx-runtime.ts +54 -0
- package/package.json +124 -92
- package/src/codeblock.tsx +34 -34
- package/src/components/Divider.tsx +23 -0
- package/src/components/Markdown.tsx +380 -0
- package/src/components/MultilineTextInput.tsx +749 -0
- package/src/components/Overlay.tsx +56 -0
- package/src/components/Static.tsx +68 -0
- package/src/components/TextInput.tsx +285 -0
- package/src/components/index.ts +6 -0
- package/src/components/text-editing.ts +464 -0
- package/src/console/ConsoleCapture.ts +272 -0
- package/src/console/ConsolePopover.tsx +487 -0
- package/src/console/clipboard.ts +81 -0
- package/src/console/index.ts +42 -0
- package/src/console/useConsole.ts +129 -0
- package/src/debug/DebugOverlay.ts +557 -0
- package/src/debug/DiagnosticsPanel.tsx +27 -27
- package/src/dev/Toast.tsx +117 -0
- package/src/dev/index.ts +2 -0
- package/src/dev.tsx +489 -0
- package/src/highlight.ts +46 -46
- package/src/hmr-plugin.ts +61 -0
- package/src/hooks/index.ts +4 -0
- package/src/hooks/use-keyboard.ts +44 -24
- package/src/hooks/use-mouse.ts +51 -0
- package/src/hooks/use-paste.ts +21 -6
- package/src/hooks/use-scroll.ts +386 -0
- package/src/hooks/useFrameStats.ts +17 -17
- package/src/hosts/base.ts +180 -59
- package/src/hosts/box.ts +117 -94
- package/src/hosts/canvas.ts +137 -141
- package/src/hosts/codeblock.ts +117 -133
- package/src/hosts/flex-container.ts +124 -0
- package/src/hosts/hstack.ts +11 -59
- package/src/hosts/index.ts +24 -14
- package/src/hosts/overlay-item.ts +72 -0
- package/src/hosts/overlay.ts +125 -0
- package/src/hosts/scroll.ts +255 -0
- package/src/hosts/single-child.ts +52 -0
- package/src/hosts/spacer.ts +30 -26
- package/src/hosts/text.ts +198 -164
- package/src/hosts/vstack.ts +11 -59
- package/src/hosts/zstack.ts +79 -67
- package/src/index.ts +44 -19
- package/src/inline/index.tsx +123 -123
- package/src/motion/color-motion-value.ts +67 -67
- package/src/motion/color.test.ts +107 -107
- package/src/motion/color.ts +9 -190
- package/src/motion/event-emitter.ts +20 -20
- package/src/motion/frame.ts +35 -35
- package/src/motion/hooks.ts +144 -139
- package/src/motion/index.ts +10 -10
- package/src/motion/motion-value.test.ts +207 -207
- package/src/motion/motion-value.ts +112 -112
- package/src/motion/spring-math.ts +88 -83
- package/src/motion/types.ts +25 -25
- package/src/profiler.ts +50 -50
- package/src/reconciler/host-config.ts +152 -174
- package/src/reconciler/noop-methods.ts +55 -0
- package/src/reconciler/types.ts +112 -46
- package/src/remote/Procedures.ts +52 -0
- package/src/remote/Router.ts +58 -0
- package/src/remote/Server.ts +76 -0
- package/src/remote/index.ts +90 -0
- package/src/renderer/core/FrameBuilder.ts +49 -0
- package/src/renderer/core/RendererState.ts +80 -0
- package/src/renderer/core/index.ts +2 -0
- package/src/renderer/input/InputProcessor.ts +94 -0
- package/src/renderer/input/index.ts +1 -0
- package/src/renderer/lifecycle/EventBus.ts +90 -0
- package/src/renderer/lifecycle/ResizeManager.ts +65 -0
- package/src/renderer/lifecycle/TerminalSetup.ts +105 -0
- package/src/renderer/lifecycle/index.ts +3 -0
- package/src/renderer/modes/FullscreenRenderer.ts +53 -0
- package/src/renderer/modes/InlineRenderer.ts +178 -0
- package/src/renderer/modes/RendererMode.ts +46 -0
- package/src/renderer/modes/StaticContentRenderer.ts +56 -0
- package/src/renderer/modes/index.ts +4 -0
- package/src/renderer-context.ts +27 -0
- package/src/renderer-types.ts +109 -0
- package/src/renderer.ts +391 -642
- package/src/test/index.ts +5 -5
- package/src/test/mock-streams.ts +115 -115
- package/src/test/render-tui.ts +84 -87
- package/src/utils/border.ts +79 -73
- package/src/utils/flex-layout.ts +80 -93
- package/src/utils/index.ts +1 -1
- package/src/utils/padding.ts +27 -27
- package/src/utils/styles.ts +50 -7
- package/src/visualize/index.tsx +225 -240
- package/dist/src/output.d.ts +0 -47
- package/dist/src/output.d.ts.map +0 -1
- package/dist/src/output.js +0 -125
- package/dist/src/output.js.map +0 -1
- package/dist/src/terminal.d.ts +0 -37
- package/dist/src/terminal.d.ts.map +0 -1
- package/dist/src/terminal.js +0 -65
- package/dist/src/terminal.js.map +0 -1
- package/src/output.ts +0 -156
- package/src/terminal.ts +0 -67
- package/src/trace/SpanTree.tsx +0 -195
- package/src/trace/index.tsx +0 -205
- package/src/trace/location.ts +0 -90
- package/src/trace/span-processor.ts +0 -65
- package/src/trace/span-state.ts +0 -286
- package/src/trace/tui-logger.ts +0 -72
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type Palette } from "@effect-tui/core";
|
|
2
|
+
import type { HostInstance } from "../../reconciler/types.js";
|
|
3
|
+
import type { TuiWriteStream } from "../../renderer-types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Renders static content to scrollback (inline mode only).
|
|
6
|
+
* Static content is rendered once and doesn't update with the dynamic section.
|
|
7
|
+
* Caches all output for replay on resize (Ink-style).
|
|
8
|
+
*/
|
|
9
|
+
export declare class StaticContentRenderer {
|
|
10
|
+
private palette;
|
|
11
|
+
private cachedOutput;
|
|
12
|
+
constructor(_stdout: TuiWriteStream, // Kept for API compatibility, not used (writes are atomic in renderer.ts)
|
|
13
|
+
palette: Palette);
|
|
14
|
+
/** Get all cached static output for replay on resize */
|
|
15
|
+
getCachedOutput(): string;
|
|
16
|
+
/** Clear the cache (call after full terminal clear + replay) */
|
|
17
|
+
clearCache(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Render a static node and return the output string.
|
|
20
|
+
* Static content is append-only - no cursor positioning needed.
|
|
21
|
+
* Caller clears dynamic area first, then appends this output.
|
|
22
|
+
*/
|
|
23
|
+
render(staticNode: HostInstance, frameWidth: number): string;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=StaticContentRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StaticContentRenderer.d.ts","sourceRoot":"","sources":["../../../../src/renderer/modes/StaticContentRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D;;;;GAIG;AACH,qBAAa,qBAAqB;IAKhC,OAAO,CAAC,OAAO;IAJhB,OAAO,CAAC,YAAY,CAAK;gBAGxB,OAAO,EAAE,cAAc,EAAE,0EAA0E;IAC3F,OAAO,EAAE,OAAO;IAGzB,wDAAwD;IACxD,eAAe,IAAI,MAAM;IAIzB,gEAAgE;IAChE,UAAU,IAAI,IAAI;IAIlB;;;;OAIG;IACH,MAAM,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;CAuB5D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CellBuffer, emitRowWithReset, rowContentWidth } from "@effect-tui/core";
|
|
2
|
+
/**
|
|
3
|
+
* Renders static content to scrollback (inline mode only).
|
|
4
|
+
* Static content is rendered once and doesn't update with the dynamic section.
|
|
5
|
+
* Caches all output for replay on resize (Ink-style).
|
|
6
|
+
*/
|
|
7
|
+
export class StaticContentRenderer {
|
|
8
|
+
palette;
|
|
9
|
+
cachedOutput = ""; // Accumulates all static content for replay
|
|
10
|
+
constructor(_stdout, // Kept for API compatibility, not used (writes are atomic in renderer.ts)
|
|
11
|
+
palette) {
|
|
12
|
+
this.palette = palette;
|
|
13
|
+
}
|
|
14
|
+
/** Get all cached static output for replay on resize */
|
|
15
|
+
getCachedOutput() {
|
|
16
|
+
return this.cachedOutput;
|
|
17
|
+
}
|
|
18
|
+
/** Clear the cache (call after full terminal clear + replay) */
|
|
19
|
+
clearCache() {
|
|
20
|
+
this.cachedOutput = "";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Render a static node and return the output string.
|
|
24
|
+
* Static content is append-only - no cursor positioning needed.
|
|
25
|
+
* Caller clears dynamic area first, then appends this output.
|
|
26
|
+
*/
|
|
27
|
+
render(staticNode, frameWidth) {
|
|
28
|
+
// Measure and layout static content
|
|
29
|
+
const staticSize = staticNode.measure(frameWidth, Number.MAX_SAFE_INTEGER);
|
|
30
|
+
staticNode.layout({ x: 0, y: 0, w: frameWidth, h: staticSize.h });
|
|
31
|
+
// Render to a temporary buffer
|
|
32
|
+
const staticBuffer = new CellBuffer(frameWidth, staticSize.h);
|
|
33
|
+
staticBuffer.clear(0);
|
|
34
|
+
staticNode.render(staticBuffer, this.palette);
|
|
35
|
+
// Build content lines - append-only, no cursor movement
|
|
36
|
+
let contentLines = "";
|
|
37
|
+
for (let y = 0; y < staticSize.h; y++) {
|
|
38
|
+
const trimmedWidth = rowContentWidth(staticBuffer, y, frameWidth);
|
|
39
|
+
const line = emitRowWithReset(staticBuffer, this.palette, y, frameWidth, 0, trimmedWidth);
|
|
40
|
+
contentLines += line + "\n";
|
|
41
|
+
}
|
|
42
|
+
// Cache the content for replay on resize
|
|
43
|
+
this.cachedOutput += contentLines;
|
|
44
|
+
return contentLines;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=StaticContentRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StaticContentRenderer.js","sourceRoot":"","sources":["../../../../src/renderer/modes/StaticContentRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAgB,MAAM,kBAAkB,CAAA;AAI9F;;;;GAIG;AACH,MAAM,OAAO,qBAAqB;IAKxB;IAJD,YAAY,GAAG,EAAE,CAAA,CAAC,4CAA4C;IAEtE,YACC,OAAuB,EAAE,0EAA0E;IAC3F,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IACtB,CAAC;IAEJ,wDAAwD;IACxD,eAAe;QACd,OAAO,IAAI,CAAC,YAAY,CAAA;IACzB,CAAC;IAED,gEAAgE;IAChE,UAAU;QACT,IAAI,CAAC,YAAY,GAAG,EAAE,CAAA;IACvB,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAwB,EAAE,UAAkB;QAClD,oCAAoC;QACpC,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAA;QAC1E,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAA;QAEjE,+BAA+B;QAC/B,MAAM,YAAY,GAAG,IAAI,UAAU,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;QAC7D,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACrB,UAAU,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;QAE7C,wDAAwD;QACxD,IAAI,YAAY,GAAG,EAAE,CAAA;QACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YACvC,MAAM,YAAY,GAAG,eAAe,CAAC,YAAY,EAAE,CAAC,EAAE,UAAU,CAAC,CAAA;YACjE,MAAM,IAAI,GAAG,gBAAgB,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,CAAC,CAAA;YACzF,YAAY,IAAI,IAAI,GAAG,IAAI,CAAA;QAC5B,CAAC;QAED,yCAAyC;QACzC,IAAI,CAAC,YAAY,IAAI,YAAY,CAAA;QAEjC,OAAO,YAAY,CAAA;IACpB,CAAC;CACD"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { RendererMode, RenderContext, RenderOutput } from "./RendererMode.js";
|
|
2
|
+
export { FullscreenRenderer } from "./FullscreenRenderer.js";
|
|
3
|
+
export { InlineRenderer } from "./InlineRenderer.js";
|
|
4
|
+
export { StaticContentRenderer } from "./StaticContentRenderer.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/renderer/modes/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/renderer/modes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TuiRenderer } from "./renderer-types.js";
|
|
2
|
+
export declare const RendererContext: import("react").Context<TuiRenderer | null>;
|
|
3
|
+
export declare function useRenderer(): TuiRenderer;
|
|
4
|
+
/** Hook that returns terminal size and re-renders on resize */
|
|
5
|
+
export declare function useTerminalSize(): {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=renderer-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-context.d.ts","sourceRoot":"","sources":["../../src/renderer-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAGtD,eAAO,MAAM,eAAe,6CAA0C,CAAA;AAEtE,wBAAgB,WAAW,IAAI,WAAW,CAMzC;AAED,+DAA+D;AAC/D,wBAAgB,eAAe,IAAI;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAWnE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createContext, useContext, useState, useEffect } from "react";
|
|
2
|
+
// Context for accessing renderer in components
|
|
3
|
+
export const RendererContext = createContext(null);
|
|
4
|
+
export function useRenderer() {
|
|
5
|
+
const renderer = useContext(RendererContext);
|
|
6
|
+
if (!renderer) {
|
|
7
|
+
throw new Error("useRenderer must be used within a TUI renderer");
|
|
8
|
+
}
|
|
9
|
+
return renderer;
|
|
10
|
+
}
|
|
11
|
+
/** Hook that returns terminal size and re-renders on resize */
|
|
12
|
+
export function useTerminalSize() {
|
|
13
|
+
const renderer = useRenderer();
|
|
14
|
+
const [size, setSize] = useState({ width: renderer.width, height: renderer.height });
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
return renderer.onResize((width, height) => {
|
|
17
|
+
setSize({ width, height });
|
|
18
|
+
});
|
|
19
|
+
}, [renderer]);
|
|
20
|
+
return size;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=renderer-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-context.js","sourceRoot":"","sources":["../../src/renderer-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtE,+CAA+C;AAC/C,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAA;AAEtE,MAAM,UAAU,WAAW;IAC1B,MAAM,QAAQ,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC5C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;IAClE,CAAC;IACD,OAAO,QAAQ,CAAA;AAChB,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,eAAe;IAC9B,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAA;IAC9B,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAEpF,SAAS,CAAC,GAAG,EAAE;QACd,OAAO,QAAQ,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;YAC1C,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;QAC3B,CAAC,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IAEd,OAAO,IAAI,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { KeyMsg, MouseMsg } from "@effect-tui/core";
|
|
2
|
+
import type { HostInstance, HostContext } from "./reconciler/types.js";
|
|
3
|
+
/** Minimal write stream interface for renderer output */
|
|
4
|
+
export interface TuiWriteStream {
|
|
5
|
+
write(s: string): void;
|
|
6
|
+
columns: number;
|
|
7
|
+
rows: number;
|
|
8
|
+
on(event: string, cb: () => void): void;
|
|
9
|
+
removeListener(event: string, cb: () => void): void;
|
|
10
|
+
}
|
|
11
|
+
/** Minimal read stream interface for renderer input */
|
|
12
|
+
export interface TuiReadStream {
|
|
13
|
+
isTTY?: boolean;
|
|
14
|
+
setRawMode?(mode: boolean): void;
|
|
15
|
+
resume?(): void;
|
|
16
|
+
on(event: string, cb: (data: Buffer) => void): void;
|
|
17
|
+
removeListener(event: string, cb: (data: Buffer) => void): void;
|
|
18
|
+
}
|
|
19
|
+
export interface TuiRenderer {
|
|
20
|
+
/** Terminal width */
|
|
21
|
+
width: number;
|
|
22
|
+
/** Terminal height */
|
|
23
|
+
height: number;
|
|
24
|
+
/** Request a re-render */
|
|
25
|
+
requestRender(): void;
|
|
26
|
+
/** Subscribe to per-frame stats (if enabled). */
|
|
27
|
+
onFrameStats?(handler: (stats: FrameStats) => void): () => void;
|
|
28
|
+
/** Subscribe to keyboard events */
|
|
29
|
+
onKey(handler: (key: KeyMsg) => void): () => void;
|
|
30
|
+
/** Subscribe to mouse events (clicks, scroll, etc.) */
|
|
31
|
+
onMouse(handler: (mouse: MouseMsg) => void): () => void;
|
|
32
|
+
/** Subscribe to paste events (bracketed paste mode). */
|
|
33
|
+
onPaste?(handler: (text: string) => void): () => void;
|
|
34
|
+
/** Subscribe to resize events */
|
|
35
|
+
onResize(handler: (width: number, height: number) => void): () => void;
|
|
36
|
+
/** Stop the renderer */
|
|
37
|
+
stop(): void;
|
|
38
|
+
/** Manually trigger one render frame (only in manualMode) */
|
|
39
|
+
flush(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get the current screen as ANSI string (for screenshots/debugging).
|
|
42
|
+
* Returns the last rendered frame with all ANSI color codes intact.
|
|
43
|
+
*/
|
|
44
|
+
getScreenshot(): string;
|
|
45
|
+
/** Dispatch a key event (for remote control) */
|
|
46
|
+
dispatchKey?(key: KeyMsg): void;
|
|
47
|
+
/** Dispatch a paste event (for remote control) */
|
|
48
|
+
dispatchPaste?(text: string): void;
|
|
49
|
+
/** Dispatch a resize event (for remote control) */
|
|
50
|
+
dispatchResize?(width: number, height: number): void;
|
|
51
|
+
}
|
|
52
|
+
/** Internal renderer type with container reference */
|
|
53
|
+
export interface TuiRendererInternal extends TuiRenderer {
|
|
54
|
+
_container: Container | null;
|
|
55
|
+
}
|
|
56
|
+
export interface Container {
|
|
57
|
+
root: HostInstance | null;
|
|
58
|
+
ctx: HostContext;
|
|
59
|
+
/** @internal Static content root node (for Static component) */
|
|
60
|
+
staticRoot?: HostInstance | null;
|
|
61
|
+
/** @internal Flag indicating static content needs flushing */
|
|
62
|
+
staticDirty?: boolean;
|
|
63
|
+
}
|
|
64
|
+
export interface RendererOptions {
|
|
65
|
+
fps?: number;
|
|
66
|
+
stdout?: NodeJS.WriteStream | TuiWriteStream;
|
|
67
|
+
stdin?: NodeJS.ReadStream | TuiReadStream;
|
|
68
|
+
/** Render mode: "fullscreen" uses alternate buffer, "inline" renders in-place */
|
|
69
|
+
mode?: "fullscreen" | "inline";
|
|
70
|
+
/** Exit the process on Ctrl+C unless preventDefault was called. Defaults to true. */
|
|
71
|
+
exitOnCtrlC?: boolean;
|
|
72
|
+
/** Enable diffed rendering (per-line). Defaults to true in runtime, false in manualMode (tests). */
|
|
73
|
+
diff?: boolean;
|
|
74
|
+
/** Skip automatic render loop. Call flush() manually to render frames. */
|
|
75
|
+
manualMode?: boolean;
|
|
76
|
+
/** Skip fullscreen/raw mode setup (for testing) */
|
|
77
|
+
skipTerminalSetup?: boolean;
|
|
78
|
+
/** Enable bracketed paste (default true). */
|
|
79
|
+
enablePaste?: boolean;
|
|
80
|
+
/** Enable mouse mode for scroll wheel events (default true in fullscreen). */
|
|
81
|
+
enableMouse?: boolean;
|
|
82
|
+
/** Optional per-frame diagnostics hook. Called after each frame is written. */
|
|
83
|
+
debug?: {
|
|
84
|
+
onFrame?: (stats: FrameStats) => void;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
export interface FrameStats {
|
|
88
|
+
mode: "fullscreen" | "inline";
|
|
89
|
+
width: number;
|
|
90
|
+
height: number;
|
|
91
|
+
contentHeight: number;
|
|
92
|
+
bytes: number;
|
|
93
|
+
frameMs: number;
|
|
94
|
+
phases: {
|
|
95
|
+
clear: number;
|
|
96
|
+
layout: number;
|
|
97
|
+
render: number;
|
|
98
|
+
diffAnsi: number;
|
|
99
|
+
write: number;
|
|
100
|
+
};
|
|
101
|
+
timestamp: number;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=renderer-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-types.d.ts","sourceRoot":"","sources":["../../src/renderer-types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer-types.js","sourceRoot":"","sources":["../../src/renderer-types.ts"],"names":[],"mappings":""}
|
package/dist/src/renderer.d.ts
CHANGED
|
@@ -1,85 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
write(s: string): void;
|
|
6
|
-
columns: number;
|
|
7
|
-
rows: number;
|
|
8
|
-
on(event: string, cb: () => void): void;
|
|
9
|
-
}
|
|
10
|
-
/** Minimal read stream interface for renderer input */
|
|
11
|
-
export interface TuiReadStream {
|
|
12
|
-
isTTY?: boolean;
|
|
13
|
-
setRawMode?(mode: boolean): void;
|
|
14
|
-
resume?(): void;
|
|
15
|
-
on(event: string, cb: (data: Buffer) => void): void;
|
|
16
|
-
}
|
|
17
|
-
export interface TuiRenderer {
|
|
18
|
-
/** Terminal width */
|
|
19
|
-
width: number;
|
|
20
|
-
/** Terminal height */
|
|
21
|
-
height: number;
|
|
22
|
-
/** Request a re-render */
|
|
23
|
-
requestRender(): void;
|
|
24
|
-
/** Subscribe to per-frame stats (if enabled). */
|
|
25
|
-
onFrameStats?(handler: (stats: FrameStats) => void): () => void;
|
|
26
|
-
/** Subscribe to keyboard events */
|
|
27
|
-
onKey(handler: (key: KeyMsg) => void): () => void;
|
|
28
|
-
/** Subscribe to paste events (bracketed paste mode). */
|
|
29
|
-
onPaste?(handler: (text: string) => void): () => void;
|
|
30
|
-
/** Subscribe to resize events */
|
|
31
|
-
onResize(handler: (width: number, height: number) => void): () => void;
|
|
32
|
-
/** Stop the renderer */
|
|
33
|
-
stop(): void;
|
|
34
|
-
/** Manually trigger one render frame (only in manualMode) */
|
|
35
|
-
flush(): void;
|
|
36
|
-
}
|
|
37
|
-
export declare const RendererContext: React.Context<TuiRenderer | null>;
|
|
38
|
-
export declare function useRenderer(): TuiRenderer;
|
|
39
|
-
/** Hook that returns terminal size and re-renders on resize */
|
|
40
|
-
export declare function useTerminalSize(): {
|
|
41
|
-
width: number;
|
|
42
|
-
height: number;
|
|
43
|
-
};
|
|
44
|
-
export interface RendererOptions {
|
|
45
|
-
fps?: number;
|
|
46
|
-
stdout?: NodeJS.WriteStream | TuiWriteStream;
|
|
47
|
-
stdin?: NodeJS.ReadStream | TuiReadStream;
|
|
48
|
-
/** Render mode: "fullscreen" uses alternate buffer, "inline" renders in-place */
|
|
49
|
-
mode?: "fullscreen" | "inline";
|
|
50
|
-
/** Exit the process on Ctrl+C unless preventDefault was called. Defaults to true. */
|
|
51
|
-
exitOnCtrlC?: boolean;
|
|
52
|
-
/** Enable diffed rendering (per-line). Defaults to true in runtime, false in manualMode (tests). */
|
|
53
|
-
diff?: boolean;
|
|
54
|
-
/** Enable diffed rendering for inline mode (off by default; eraseLines baseline). */
|
|
55
|
-
diffInline?: boolean;
|
|
56
|
-
/** Skip automatic render loop. Call flush() manually to render frames. */
|
|
57
|
-
manualMode?: boolean;
|
|
58
|
-
/** Skip fullscreen/raw mode setup (for testing) */
|
|
59
|
-
skipTerminalSetup?: boolean;
|
|
60
|
-
/** Enable bracketed paste (default true). */
|
|
61
|
-
enablePaste?: boolean;
|
|
62
|
-
/** Optional per-frame diagnostics hook. Called after each frame is written. */
|
|
63
|
-
debug?: {
|
|
64
|
-
onFrame?: (stats: FrameStats) => void;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export interface FrameStats {
|
|
68
|
-
mode: "fullscreen" | "inline";
|
|
69
|
-
width: number;
|
|
70
|
-
height: number;
|
|
71
|
-
contentHeight: number;
|
|
72
|
-
bytes: number;
|
|
73
|
-
frameMs: number;
|
|
74
|
-
phases: {
|
|
75
|
-
clear: number;
|
|
76
|
-
layout: number;
|
|
77
|
-
render: number;
|
|
78
|
-
diffAnsi: number;
|
|
79
|
-
write: number;
|
|
80
|
-
};
|
|
81
|
-
timestamp: number;
|
|
82
|
-
}
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { TuiRenderer, RendererOptions } from "./renderer-types.js";
|
|
3
|
+
export type { TuiWriteStream, TuiReadStream, TuiRenderer, RendererOptions, FrameStats } from "./renderer-types.js";
|
|
4
|
+
export { RendererContext, useRenderer, useTerminalSize } from "./renderer-context.js";
|
|
83
5
|
export declare function createRenderer(options?: RendererOptions): TuiRenderer;
|
|
84
6
|
export interface Root {
|
|
85
7
|
render(element: ReactNode, sync?: boolean): void;
|
|
@@ -93,9 +15,5 @@ export interface RenderInstance {
|
|
|
93
15
|
unmount(): void;
|
|
94
16
|
waitUntilExit(): Promise<void>;
|
|
95
17
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Render a React tree to the terminal in one call.
|
|
98
|
-
* Returns helpers similar to Ink: rerender, unmount, waitUntilExit.
|
|
99
|
-
*/
|
|
100
18
|
export declare function render(element: ReactNode, options?: RendererOptions): RenderInstance;
|
|
101
19
|
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/renderer.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../src/renderer.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAO7C,OAAO,KAAK,EAGX,WAAW,EAGX,eAAe,EAEf,MAAM,qBAAqB,CAAA;AAU5B,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAClH,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAErF,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,WAAW,CAmRrE;AAED,MAAM,WAAW,IAAI;IACpB,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IAChD,OAAO,IAAI,IAAI,CAAA;CACf;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI,CA+CtD;AAGD,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,WAAW,CAAA;IACrB,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAA;IAClC,OAAO,IAAI,IAAI,CAAA;IACf,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9B;AAED,wBAAgB,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,cAAc,CA0CpF"}
|