@effect-tui/react 0.1.7 → 0.2.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/dist/jsx-runtime.d.ts +6 -6
- package/dist/jsx-runtime.d.ts.map +1 -1
- package/dist/src/codeblock.js.map +1 -1
- package/dist/src/components/Divider.d.ts.map +1 -1
- package/dist/src/components/Divider.js +1 -1
- package/dist/src/components/Divider.js.map +1 -1
- package/dist/src/components/Markdown.d.ts.map +1 -1
- package/dist/src/components/Markdown.js +1 -1
- package/dist/src/components/Markdown.js.map +1 -1
- package/dist/src/components/MultilineTextInput.d.ts.map +1 -1
- package/dist/src/components/MultilineTextInput.js +2 -2
- package/dist/src/components/MultilineTextInput.js.map +1 -1
- package/dist/src/components/Static.d.ts.map +1 -1
- package/dist/src/components/Static.js +1 -1
- package/dist/src/components/Static.js.map +1 -1
- package/dist/src/components/TextInput.d.ts.map +1 -1
- package/dist/src/components/TextInput.js +2 -2
- package/dist/src/components/TextInput.js.map +1 -1
- package/dist/src/components/index.d.ts +4 -4
- package/dist/src/components/index.d.ts.map +1 -1
- package/dist/src/components/index.js +4 -4
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/console/ConsoleCapture.d.ts.map +1 -1
- package/dist/src/console/ConsoleCapture.js +1 -1
- package/dist/src/console/ConsoleCapture.js.map +1 -1
- package/dist/src/console/ConsolePopover.d.ts.map +1 -1
- package/dist/src/console/ConsolePopover.js +5 -7
- package/dist/src/console/ConsolePopover.js.map +1 -1
- package/dist/src/console/index.d.ts +1 -1
- package/dist/src/console/index.d.ts.map +1 -1
- package/dist/src/console/index.js +1 -1
- package/dist/src/console/index.js.map +1 -1
- package/dist/src/console/useConsole.d.ts.map +1 -1
- package/dist/src/console/useConsole.js +2 -2
- package/dist/src/console/useConsole.js.map +1 -1
- package/dist/src/debug/DebugOverlay.d.ts +1 -1
- package/dist/src/debug/DebugOverlay.d.ts.map +1 -1
- package/dist/src/debug/DebugOverlay.js +1 -1
- package/dist/src/debug/DebugOverlay.js.map +1 -1
- package/dist/src/dev/Toast.d.ts.map +1 -1
- package/dist/src/dev/Toast.js +2 -2
- package/dist/src/dev/Toast.js.map +1 -1
- package/dist/src/dev/index.d.ts +1 -1
- package/dist/src/dev/index.d.ts.map +1 -1
- package/dist/src/dev/index.js +1 -1
- package/dist/src/dev/index.js.map +1 -1
- package/dist/src/dev.d.ts +1 -2
- package/dist/src/dev.d.ts.map +1 -1
- package/dist/src/dev.js +10 -10
- package/dist/src/dev.js.map +1 -1
- package/dist/src/highlight.d.ts +1 -1
- package/dist/src/highlight.d.ts.map +1 -1
- package/dist/src/highlight.js.map +1 -1
- package/dist/src/hooks/index.d.ts +4 -3
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/index.js +1 -0
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/hooks/use-keyboard.d.ts.map +1 -1
- package/dist/src/hooks/use-keyboard.js.map +1 -1
- package/dist/src/hooks/use-mouse.d.ts +1 -1
- package/dist/src/hooks/use-mouse.d.ts.map +1 -1
- package/dist/src/hooks/use-mouse.js.map +1 -1
- package/dist/src/hooks/use-quit.d.ts +21 -0
- package/dist/src/hooks/use-quit.d.ts.map +1 -0
- package/dist/src/hooks/use-quit.js +29 -0
- package/dist/src/hooks/use-quit.js.map +1 -0
- package/dist/src/hooks/use-scroll.d.ts.map +1 -1
- package/dist/src/hooks/use-scroll.js +2 -2
- package/dist/src/hooks/use-scroll.js.map +1 -1
- package/dist/src/hooks/useFrameStats.d.ts.map +1 -1
- package/dist/src/hooks/useFrameStats.js.map +1 -1
- package/dist/src/hosts/base.d.ts +3 -4
- package/dist/src/hosts/base.d.ts.map +1 -1
- package/dist/src/hosts/base.js +42 -6
- package/dist/src/hosts/base.js.map +1 -1
- package/dist/src/hosts/box.d.ts +3 -3
- package/dist/src/hosts/box.d.ts.map +1 -1
- package/dist/src/hosts/box.js +1 -1
- package/dist/src/hosts/box.js.map +1 -1
- package/dist/src/hosts/canvas.d.ts +3 -3
- package/dist/src/hosts/canvas.d.ts.map +1 -1
- package/dist/src/hosts/canvas.js +1 -1
- package/dist/src/hosts/canvas.js.map +1 -1
- package/dist/src/hosts/codeblock.d.ts +2 -2
- package/dist/src/hosts/codeblock.d.ts.map +1 -1
- package/dist/src/hosts/codeblock.js +1 -1
- package/dist/src/hosts/codeblock.js.map +1 -1
- package/dist/src/hosts/flex-container.d.ts +3 -3
- package/dist/src/hosts/flex-container.d.ts.map +1 -1
- package/dist/src/hosts/flex-container.js +5 -2
- package/dist/src/hosts/flex-container.js.map +1 -1
- package/dist/src/hosts/hstack.d.ts +1 -1
- package/dist/src/hosts/index.d.ts +8 -8
- package/dist/src/hosts/index.d.ts.map +1 -1
- package/dist/src/hosts/index.js +13 -13
- package/dist/src/hosts/index.js.map +1 -1
- package/dist/src/hosts/overlay-item.d.ts +1 -1
- package/dist/src/hosts/overlay.d.ts +1 -1
- package/dist/src/hosts/overlay.d.ts.map +1 -1
- package/dist/src/hosts/overlay.js +1 -1
- package/dist/src/hosts/overlay.js.map +1 -1
- package/dist/src/hosts/scroll.d.ts +3 -2
- package/dist/src/hosts/scroll.d.ts.map +1 -1
- package/dist/src/hosts/scroll.js +12 -3
- package/dist/src/hosts/scroll.js.map +1 -1
- package/dist/src/hosts/single-child.d.ts +1 -1
- package/dist/src/hosts/single-child.d.ts.map +1 -1
- package/dist/src/hosts/spacer.d.ts +2 -1
- package/dist/src/hosts/spacer.d.ts.map +1 -1
- package/dist/src/hosts/spacer.js +10 -9
- package/dist/src/hosts/spacer.js.map +1 -1
- package/dist/src/hosts/text.d.ts +2 -2
- package/dist/src/hosts/text.d.ts.map +1 -1
- package/dist/src/hosts/text.js +1 -1
- package/dist/src/hosts/text.js.map +1 -1
- package/dist/src/hosts/vstack.d.ts +1 -1
- package/dist/src/hosts/zstack.d.ts +2 -2
- package/dist/src/hosts/zstack.d.ts.map +1 -1
- package/dist/src/hosts/zstack.js +1 -1
- package/dist/src/hosts/zstack.js.map +1 -1
- package/dist/src/index.d.ts +17 -21
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -15
- package/dist/src/index.js.map +1 -1
- package/dist/src/inline/index.d.ts.map +1 -1
- package/dist/src/inline/index.js +1 -1
- package/dist/src/inline/index.js.map +1 -1
- package/dist/src/motion/color-motion-value.d.ts +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 -1
- package/dist/src/motion/color.d.ts.map +1 -1
- package/dist/src/motion/color.js +1 -1
- package/dist/src/motion/color.js.map +1 -1
- package/dist/src/motion/color.test.js +2 -2
- package/dist/src/motion/color.test.js.map +1 -1
- package/dist/src/motion/hooks.d.ts +3 -3
- package/dist/src/motion/hooks.d.ts.map +1 -1
- package/dist/src/motion/hooks.js +1 -1
- package/dist/src/motion/hooks.js.map +1 -1
- package/dist/src/motion/index.d.ts +2 -2
- package/dist/src/motion/index.d.ts.map +1 -1
- package/dist/src/motion/index.js +3 -3
- package/dist/src/motion/index.js.map +1 -1
- package/dist/src/motion/motion-value.d.ts +5 -5
- package/dist/src/motion/motion-value.d.ts.map +1 -1
- package/dist/src/motion/motion-value.js +4 -4
- package/dist/src/motion/motion-value.js.map +1 -1
- package/dist/src/motion/motion-value.test.js +1 -1
- package/dist/src/motion/motion-value.test.js.map +1 -1
- package/dist/src/reconciler/host-config.d.ts +1 -1
- package/dist/src/reconciler/host-config.d.ts.map +1 -1
- package/dist/src/reconciler/host-config.js +1 -1
- package/dist/src/reconciler/host-config.js.map +1 -1
- package/dist/src/reconciler/types.d.ts +10 -5
- package/dist/src/reconciler/types.d.ts.map +1 -1
- package/dist/src/remote/Procedures.d.ts.map +1 -1
- package/dist/src/remote/Procedures.js.map +1 -1
- package/dist/src/remote/Router.d.ts +1 -1
- package/dist/src/remote/Router.d.ts.map +1 -1
- package/dist/src/remote/Router.js +1 -1
- package/dist/src/remote/Router.js.map +1 -1
- package/dist/src/remote/Server.d.ts +1 -1
- package/dist/src/remote/Server.d.ts.map +1 -1
- package/dist/src/remote/Server.js +3 -3
- package/dist/src/remote/Server.js.map +1 -1
- package/dist/src/remote/index.d.ts +2 -2
- package/dist/src/remote/index.d.ts.map +1 -1
- package/dist/src/remote/index.js +5 -5
- package/dist/src/remote/index.js.map +1 -1
- package/dist/src/renderer/core/FrameBuilder.d.ts.map +1 -1
- package/dist/src/renderer/core/FrameBuilder.js.map +1 -1
- package/dist/src/renderer/input/InputProcessor.d.ts +1 -0
- package/dist/src/renderer/input/InputProcessor.d.ts.map +1 -1
- package/dist/src/renderer/input/InputProcessor.js +7 -2
- package/dist/src/renderer/input/InputProcessor.js.map +1 -1
- package/dist/src/renderer/lifecycle/TerminalSetup.d.ts +2 -1
- package/dist/src/renderer/lifecycle/TerminalSetup.d.ts.map +1 -1
- package/dist/src/renderer/lifecycle/TerminalSetup.js +26 -17
- package/dist/src/renderer/lifecycle/TerminalSetup.js.map +1 -1
- package/dist/src/renderer/lifecycle/index.d.ts +1 -1
- package/dist/src/renderer/lifecycle/index.d.ts.map +1 -1
- package/dist/src/renderer/lifecycle/index.js +1 -1
- package/dist/src/renderer/lifecycle/index.js.map +1 -1
- package/dist/src/renderer/modes/FullscreenRenderer.d.ts +1 -1
- package/dist/src/renderer/modes/FullscreenRenderer.d.ts.map +1 -1
- package/dist/src/renderer/modes/InlineRenderer.d.ts +1 -1
- package/dist/src/renderer/modes/InlineRenderer.d.ts.map +1 -1
- package/dist/src/renderer/modes/InlineRenderer.js +1 -1
- package/dist/src/renderer/modes/InlineRenderer.js.map +1 -1
- package/dist/src/renderer/modes/StaticContentRenderer.d.ts.map +1 -1
- package/dist/src/renderer/modes/StaticContentRenderer.js.map +1 -1
- package/dist/src/renderer/modes/index.d.ts +1 -1
- package/dist/src/renderer/modes/index.d.ts.map +1 -1
- package/dist/src/renderer/modes/index.js.map +1 -1
- package/dist/src/renderer-context.js +1 -1
- package/dist/src/renderer-context.js.map +1 -1
- package/dist/src/renderer-types.d.ts +1 -1
- package/dist/src/renderer-types.d.ts.map +1 -1
- package/dist/src/renderer.d.ts +4 -2
- package/dist/src/renderer.d.ts.map +1 -1
- package/dist/src/renderer.js +45 -13
- package/dist/src/renderer.js.map +1 -1
- package/dist/src/test/index.d.ts +2 -2
- package/dist/src/test/index.d.ts.map +1 -1
- package/dist/src/test/index.js +1 -1
- package/dist/src/test/index.js.map +1 -1
- package/dist/src/test/render-tui.d.ts +7 -2
- package/dist/src/test/render-tui.d.ts.map +1 -1
- package/dist/src/test/render-tui.js +5 -2
- package/dist/src/test/render-tui.js.map +1 -1
- package/dist/src/utils/flex-layout.d.ts +1 -1
- package/dist/src/utils/flex-layout.d.ts.map +1 -1
- package/dist/src/utils/flex-layout.js +21 -7
- package/dist/src/utils/flex-layout.js.map +1 -1
- package/dist/src/utils/index.d.ts +4 -4
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +2 -2
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/styles.d.ts.map +1 -1
- package/dist/src/utils/styles.js.map +1 -1
- package/dist/src/visualize/index.js +2 -2
- package/dist/src/visualize/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/jsx-runtime.ts +6 -6
- package/package.json +3 -2
- package/src/codeblock.tsx +1 -1
- package/src/components/Divider.tsx +1 -1
- package/src/components/Markdown.tsx +2 -2
- package/src/components/MultilineTextInput.tsx +9 -9
- package/src/components/Static.tsx +1 -1
- package/src/components/TextInput.tsx +8 -8
- package/src/components/index.ts +4 -4
- package/src/console/ConsoleCapture.ts +1 -1
- package/src/console/ConsolePopover.tsx +27 -26
- package/src/console/index.ts +1 -3
- package/src/console/useConsole.ts +2 -2
- package/src/debug/DebugOverlay.ts +3 -6
- package/src/dev/Toast.tsx +12 -10
- package/src/dev/index.ts +1 -1
- package/src/dev.tsx +11 -12
- package/src/highlight.ts +1 -1
- package/src/hooks/index.ts +4 -3
- package/src/hooks/use-keyboard.ts +1 -1
- package/src/hooks/use-mouse.ts +1 -1
- package/src/hooks/use-quit.ts +33 -0
- package/src/hooks/use-scroll.ts +9 -11
- package/src/hooks/useFrameStats.ts +1 -1
- package/src/hosts/base.ts +38 -8
- package/src/hosts/box.ts +4 -4
- package/src/hosts/canvas.ts +3 -3
- package/src/hosts/codeblock.ts +3 -3
- package/src/hosts/flex-container.ts +6 -4
- package/src/hosts/hstack.ts +1 -1
- package/src/hosts/index.ts +14 -14
- package/src/hosts/overlay-item.ts +1 -1
- package/src/hosts/overlay.ts +2 -2
- package/src/hosts/scroll.ts +16 -5
- package/src/hosts/single-child.ts +1 -1
- package/src/hosts/spacer.ts +12 -10
- package/src/hosts/text.ts +3 -3
- package/src/hosts/vstack.ts +1 -1
- package/src/hosts/zstack.ts +2 -2
- package/src/index.ts +60 -60
- package/src/inline/index.tsx +1 -1
- package/src/motion/color-motion-value.ts +1 -1
- package/src/motion/color.test.ts +2 -2
- package/src/motion/color.ts +2 -2
- package/src/motion/hooks.ts +3 -3
- package/src/motion/index.ts +8 -8
- package/src/motion/motion-value.test.ts +1 -1
- package/src/motion/motion-value.ts +11 -11
- package/src/reconciler/host-config.ts +3 -3
- package/src/reconciler/types.ts +10 -5
- package/src/remote/Procedures.ts +1 -7
- package/src/remote/Router.ts +3 -7
- package/src/remote/Server.ts +7 -12
- package/src/remote/index.ts +6 -10
- package/src/renderer/core/FrameBuilder.ts +1 -1
- package/src/renderer/input/InputProcessor.ts +7 -2
- package/src/renderer/lifecycle/TerminalSetup.ts +29 -18
- package/src/renderer/lifecycle/index.ts +1 -1
- package/src/renderer/modes/FullscreenRenderer.ts +1 -1
- package/src/renderer/modes/InlineRenderer.ts +2 -2
- package/src/renderer/modes/StaticContentRenderer.ts +1 -1
- package/src/renderer/modes/index.ts +1 -1
- package/src/renderer-context.ts +1 -1
- package/src/renderer-types.ts +1 -1
- package/src/renderer.ts +62 -25
- package/src/test/index.ts +4 -4
- package/src/test/render-tui.ts +10 -3
- package/src/utils/flex-layout.ts +21 -8
- package/src/utils/index.ts +8 -8
- package/src/utils/styles.ts +2 -2
- package/src/visualize/index.tsx +2 -2
package/jsx-runtime.ts
CHANGED
|
@@ -3,17 +3,17 @@ export { Fragment, jsx, jsxs } from "react/jsx-runtime"
|
|
|
3
3
|
|
|
4
4
|
// JSX types (namespace is type-only, but we export a dummy runtime value for bundlers)
|
|
5
5
|
import type * as React from "react"
|
|
6
|
-
import type { TextProps } from "./src/hosts/text.js"
|
|
7
|
-
import type { SpacerProps } from "./src/hosts/spacer.js"
|
|
8
|
-
import type { VStackProps } from "./src/hosts/vstack.js"
|
|
9
|
-
import type { HStackProps } from "./src/hosts/hstack.js"
|
|
10
|
-
import type { ZStackProps } from "./src/hosts/zstack.js"
|
|
11
6
|
import type { BoxProps } from "./src/hosts/box.js"
|
|
12
7
|
import type { CanvasProps } from "./src/hosts/canvas.js"
|
|
13
8
|
import type { CodeBlockProps } from "./src/hosts/codeblock.js"
|
|
14
|
-
import type {
|
|
9
|
+
import type { HStackProps } from "./src/hosts/hstack.js"
|
|
15
10
|
import type { OverlayProps } from "./src/hosts/overlay.js"
|
|
16
11
|
import type { OverlayItemProps } from "./src/hosts/overlay-item.js"
|
|
12
|
+
import type { ScrollProps } from "./src/hosts/scroll.js"
|
|
13
|
+
import type { SpacerProps } from "./src/hosts/spacer.js"
|
|
14
|
+
import type { TextProps } from "./src/hosts/text.js"
|
|
15
|
+
import type { VStackProps } from "./src/hosts/vstack.js"
|
|
16
|
+
import type { ZStackProps } from "./src/hosts/zstack.js"
|
|
17
17
|
|
|
18
18
|
// Runtime placeholder (the actual JSX namespace below is type-only)
|
|
19
19
|
const JSX = {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect-tui/react",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "React bindings for @effect-tui/core",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"prepublishOnly": "bun run typecheck && bun run build"
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@effect-tui/core": "^0.1
|
|
86
|
+
"@effect-tui/core": "^0.2.1",
|
|
87
87
|
"@effect/platform": "^0.94.0",
|
|
88
88
|
"@effect/platform-bun": "^0.87.0",
|
|
89
89
|
"@effect/rpc": "^0.73.0",
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
|
+
"@effect-tui/emulator": "workspace:^",
|
|
113
114
|
"@effect/opentelemetry": "^0.60.0",
|
|
114
115
|
"@effect/vitest": "^0.27.0",
|
|
115
116
|
"@opentelemetry/api": "^1.9.0",
|
package/src/codeblock.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState } from "react"
|
|
2
2
|
import type { BundledLanguage, BundledTheme } from "shiki"
|
|
3
|
-
import { highlightCode, toPlainLines
|
|
3
|
+
import { type HighlightLine, highlightCode, toPlainLines } from "./highlight.js"
|
|
4
4
|
import type { CodeBlockProps as HostCodeBlockProps } from "./hosts/codeblock.js"
|
|
5
5
|
|
|
6
6
|
export interface CodeBlockProps extends Omit<HostCodeBlockProps, "lines"> {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Colors, type ColorValue } from "@effect-tui/core"
|
|
2
|
-
import { CodeBlock } from "../codeblock.js"
|
|
3
2
|
import type { BundledLanguage, BundledTheme } from "shiki"
|
|
3
|
+
import { CodeBlock } from "../codeblock.js"
|
|
4
4
|
|
|
5
5
|
export interface MarkdownTheme {
|
|
6
6
|
/** Header colors by level (h1, h2, h3+) */
|
|
@@ -115,7 +115,7 @@ function parseInline(text: string): MdSpan[] {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
// Plain text until next special character
|
|
118
|
-
match = remaining.match(/^[^*_
|
|
118
|
+
match = remaining.match(/^[^*_`[]+/)
|
|
119
119
|
if (match) {
|
|
120
120
|
spans.push({ type: "text", text: match[0] })
|
|
121
121
|
remaining = remaining.slice(match[0].length)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type Color, Colors, displayWidth, graphemes } from "@effect-tui/core"
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
|
3
3
|
import { useKeyboard } from "../hooks/use-keyboard.js"
|
|
4
4
|
import type { DrawContext } from "../hosts/canvas.js"
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
deleteCharBackwardMultiline,
|
|
7
|
+
deleteCharForwardMultiline,
|
|
8
8
|
deleteWordBackwardMultiline,
|
|
9
|
+
graphemeColToCharIdx,
|
|
10
|
+
insertTextMultiline,
|
|
9
11
|
killToEndMultiline,
|
|
10
12
|
killToStartMultiline,
|
|
11
|
-
|
|
12
|
-
deleteCharForwardMultiline,
|
|
13
|
-
deleteCharBackwardMultiline,
|
|
14
|
-
insertTextMultiline,
|
|
15
|
-
matchPrevWord,
|
|
13
|
+
type MultilineState,
|
|
16
14
|
matchNextWord,
|
|
15
|
+
matchPrevWord,
|
|
16
|
+
transposeCharsMultiline,
|
|
17
17
|
} from "./text-editing.js"
|
|
18
18
|
|
|
19
19
|
export interface MultilineTextInputProps {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type Color, Colors, displayWidth } from "@effect-tui/core"
|
|
2
|
+
import { useCallback, useEffect, useState } from "react"
|
|
3
3
|
import { useKeyboard } from "../hooks/use-keyboard.js"
|
|
4
4
|
import type { DrawContext } from "../hosts/canvas.js"
|
|
5
5
|
import {
|
|
6
|
-
|
|
6
|
+
deleteCharBackward,
|
|
7
|
+
deleteCharForward,
|
|
7
8
|
deleteWordBackward,
|
|
9
|
+
insertText,
|
|
8
10
|
killToEnd,
|
|
9
11
|
killToStart,
|
|
10
|
-
deleteCharForward,
|
|
11
|
-
deleteCharBackward,
|
|
12
|
-
transposeChars,
|
|
13
|
-
insertText,
|
|
14
|
-
matchPrevWord,
|
|
15
12
|
matchNextWord,
|
|
13
|
+
matchPrevWord,
|
|
14
|
+
type TextState,
|
|
15
|
+
transposeChars,
|
|
16
16
|
} from "./text-editing.js"
|
|
17
17
|
|
|
18
18
|
export interface TextInputProps {
|
package/src/components/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { MultilineTextInput, type MultilineTextInputProps } from "./MultilineTextInput.js"
|
|
1
|
+
export { Divider, type DividerProps } from "./Divider.js"
|
|
3
2
|
export { Markdown, type MarkdownProps, type MarkdownTheme } from "./Markdown.js"
|
|
3
|
+
export { MultilineTextInput, type MultilineTextInputProps } from "./MultilineTextInput.js"
|
|
4
|
+
export { Overlay, type OverlayItemProps, type OverlayProps } from "./Overlay.js"
|
|
4
5
|
export { Static, type StaticProps } from "./Static.js"
|
|
5
|
-
export {
|
|
6
|
-
export { Overlay, type OverlayProps, type OverlayItemProps } from "./Overlay.js"
|
|
6
|
+
export { TextInput, type TextInputProps } from "./TextInput.js"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Console capture singleton for TUI debugging
|
|
2
2
|
// Intercepts console.log/info/warn/error/debug and stores entries for display
|
|
3
3
|
|
|
4
|
-
import { EventEmitter } from "events"
|
|
5
4
|
import { Console } from "node:console"
|
|
6
5
|
import { Writable } from "node:stream"
|
|
7
6
|
import * as util from "node:util"
|
|
7
|
+
import { EventEmitter } from "events"
|
|
8
8
|
|
|
9
9
|
// ─────────────────────────────────────────────────────────────
|
|
10
10
|
// Types
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// Console popover component for displaying captured console output
|
|
2
2
|
// Shows logs in a scrollable overlay with text selection and copy functionality
|
|
3
3
|
|
|
4
|
-
import { useState, useCallback, useEffect, useMemo, useRef } from "react"
|
|
5
4
|
import { Colors, type ColorValue } from "@effect-tui/core"
|
|
6
|
-
import {
|
|
5
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react"
|
|
7
6
|
import { useKeyboard } from "../hooks/use-keyboard.js"
|
|
8
7
|
import { useMouse } from "../hooks/use-mouse.js"
|
|
9
8
|
import { useScroll } from "../hooks/use-scroll.js"
|
|
9
|
+
import { useTerminalSize } from "../renderer.js"
|
|
10
10
|
import { getConsoleCapture, type LogEntry, type LogLevel } from "./ConsoleCapture.js"
|
|
11
|
-
import {
|
|
11
|
+
import { copyToClipboard, copyToClipboardSync } from "./clipboard.js"
|
|
12
12
|
|
|
13
13
|
// ─────────────────────────────────────────────────────────────
|
|
14
14
|
// Types
|
|
@@ -97,10 +97,7 @@ function wrapLine(text: string, maxWidth: number): string[] {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/** Normalize selection so start is before end */
|
|
100
|
-
function normalizeSelection(
|
|
101
|
-
anchor: SelectionPoint,
|
|
102
|
-
head: SelectionPoint,
|
|
103
|
-
): [SelectionPoint, SelectionPoint] {
|
|
100
|
+
function normalizeSelection(anchor: SelectionPoint, head: SelectionPoint): [SelectionPoint, SelectionPoint] {
|
|
104
101
|
if (anchor.line < head.line || (anchor.line === head.line && anchor.col <= head.col)) {
|
|
105
102
|
return [anchor, head]
|
|
106
103
|
}
|
|
@@ -156,13 +153,17 @@ export function ConsolePopover({
|
|
|
156
153
|
const [feedback, setFeedback] = useState<string | null>(null)
|
|
157
154
|
|
|
158
155
|
// Calculate dimensions - inline mode uses adjustable fixed height
|
|
159
|
-
const popoverHeight = mode === "inline"
|
|
160
|
-
? inlineHeight
|
|
161
|
-
: Math.max(5, Math.floor(termHeight * (sizePercent / 100)))
|
|
156
|
+
const popoverHeight = mode === "inline" ? inlineHeight : Math.max(5, Math.floor(termHeight * (sizePercent / 100)))
|
|
162
157
|
const contentStartY = termHeight - popoverHeight + 1 // +1 for title bar
|
|
163
158
|
|
|
164
159
|
// Use scroll hook for content scrolling
|
|
165
|
-
const {
|
|
160
|
+
const {
|
|
161
|
+
state: scrollState,
|
|
162
|
+
scrollProps,
|
|
163
|
+
scrollToEnd,
|
|
164
|
+
scrollToStart,
|
|
165
|
+
scrollBy,
|
|
166
|
+
} = useScroll({
|
|
166
167
|
axis: "vertical",
|
|
167
168
|
sticky: true,
|
|
168
169
|
enableKeyboard: false,
|
|
@@ -423,22 +424,22 @@ export function ConsolePopover({
|
|
|
423
424
|
|
|
424
425
|
return (
|
|
425
426
|
<hstack key={index}>
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
</text>
|
|
434
|
-
{after.length > 0 && (
|
|
435
|
-
<text fg={LOG_COLORS[line.level]} bg={CONTENT_BG}>
|
|
436
|
-
{after}
|
|
427
|
+
{before.length > 0 && (
|
|
428
|
+
<text fg={LOG_COLORS[line.level]} bg={CONTENT_BG}>
|
|
429
|
+
{before}
|
|
430
|
+
</text>
|
|
431
|
+
)}
|
|
432
|
+
<text fg={Colors.white} bg={SELECTION_BG}>
|
|
433
|
+
{selected}
|
|
437
434
|
</text>
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
435
|
+
{after.length > 0 && (
|
|
436
|
+
<text fg={LOG_COLORS[line.level]} bg={CONTENT_BG}>
|
|
437
|
+
{after}
|
|
438
|
+
</text>
|
|
439
|
+
)}
|
|
440
|
+
</hstack>
|
|
441
|
+
)
|
|
442
|
+
}
|
|
442
443
|
}
|
|
443
444
|
|
|
444
445
|
// No selection on this line
|
package/src/console/index.ts
CHANGED
|
@@ -36,7 +36,5 @@ export {
|
|
|
36
36
|
} from "./ConsoleCapture.js"
|
|
37
37
|
|
|
38
38
|
export { ConsolePopover, type ConsolePopoverProps } from "./ConsolePopover.js"
|
|
39
|
-
|
|
40
|
-
export { useConsole, type UseConsoleOptions, type UseConsoleReturn } from "./useConsole.js"
|
|
41
|
-
|
|
42
39
|
export { copyToClipboard, copyToClipboardSync } from "./clipboard.js"
|
|
40
|
+
export { type UseConsoleOptions, type UseConsoleReturn, useConsole } from "./useConsole.js"
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Uses ` (backtick) for toggle, ~ (tilde) for screenshot
|
|
3
3
|
// Auto-show on error
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { getConsoleCapture, type LogEntry } from "./ConsoleCapture.js"
|
|
5
|
+
import { useCallback, useEffect, useMemo, useState } from "react"
|
|
7
6
|
import { useKeyboard } from "../hooks/use-keyboard.js"
|
|
7
|
+
import { getConsoleCapture, type LogEntry } from "./ConsoleCapture.js"
|
|
8
8
|
|
|
9
9
|
// ─────────────────────────────────────────────────────────────
|
|
10
10
|
// Types
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Integrated debug overlay for all TUI apps
|
|
2
2
|
// Provides console log viewer with Ctrl+Shift+D toggle and Ctrl+Shift+S screenshot
|
|
3
3
|
|
|
4
|
-
import type { CellBuffer,
|
|
4
|
+
import type { CellBuffer, KeyMsg, MouseMsg, Palette } from "@effect-tui/core"
|
|
5
5
|
import { getConsoleCapture, type LogLevel } from "../console/ConsoleCapture.js"
|
|
6
|
-
import {
|
|
6
|
+
import { copyToClipboard, copyToClipboardSync } from "../console/clipboard.js"
|
|
7
7
|
|
|
8
8
|
// ─────────────────────────────────────────────────────────────
|
|
9
9
|
// Types
|
|
@@ -433,10 +433,7 @@ export class DebugOverlay {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
-
private getLineSelection(
|
|
437
|
-
lineIndex: number,
|
|
438
|
-
lineLength: number,
|
|
439
|
-
): { startCol: number; endCol: number } | null {
|
|
436
|
+
private getLineSelection(lineIndex: number, lineLength: number): { startCol: number; endCol: number } | null {
|
|
440
437
|
if (!this.selectionAnchor || !this.selectionHead) return null
|
|
441
438
|
|
|
442
439
|
const [start, end] = normalizeSelection(this.selectionAnchor, this.selectionHead)
|
package/src/dev/Toast.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Toast notification system for dev mode
|
|
2
2
|
// Beautiful, minimal notifications that appear at the top of the screen
|
|
3
3
|
|
|
4
|
-
import { useState, useCallback, createContext, useContext, type ReactNode } from "react"
|
|
5
4
|
import { Colors } from "@effect-tui/core"
|
|
5
|
+
import { createContext, type ReactNode, useCallback, useContext, useState } from "react"
|
|
6
6
|
import { useTerminalSize } from "../renderer-context.js"
|
|
7
7
|
|
|
8
8
|
// ─────────────────────────────────────────────────────────────
|
|
@@ -41,7 +41,10 @@ export function useToast(): ToastContextValue {
|
|
|
41
41
|
// Styling
|
|
42
42
|
// ─────────────────────────────────────────────────────────────
|
|
43
43
|
|
|
44
|
-
const TOAST_STYLES: Record<
|
|
44
|
+
const TOAST_STYLES: Record<
|
|
45
|
+
ToastType,
|
|
46
|
+
{ bg: ReturnType<typeof Colors.rgb>; fg: ReturnType<typeof Colors.rgb>; icon: string }
|
|
47
|
+
> = {
|
|
45
48
|
success: { bg: Colors.rgb(30, 70, 40), fg: Colors.rgb(140, 230, 140), icon: "✓" },
|
|
46
49
|
info: { bg: Colors.rgb(30, 50, 80), fg: Colors.rgb(140, 180, 230), icon: "ℹ" },
|
|
47
50
|
warning: { bg: Colors.rgb(80, 60, 20), fg: Colors.rgb(230, 200, 100), icon: "⚠" },
|
|
@@ -70,11 +73,7 @@ export function ToastProvider({ children }: { children: ReactNode }) {
|
|
|
70
73
|
setToasts((prev) => prev.filter((t) => t.id !== id))
|
|
71
74
|
}, [])
|
|
72
75
|
|
|
73
|
-
return
|
|
74
|
-
<ToastContext.Provider value={{ toasts, show, dismiss }}>
|
|
75
|
-
{children}
|
|
76
|
-
</ToastContext.Provider>
|
|
77
|
-
)
|
|
76
|
+
return <ToastContext.Provider value={{ toasts, show, dismiss }}>{children}</ToastContext.Provider>
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
// ─────────────────────────────────────────────────────────────
|
|
@@ -111,7 +110,10 @@ export function ToastContainer() {
|
|
|
111
110
|
export function useScreenshotToast() {
|
|
112
111
|
const { show } = useToast()
|
|
113
112
|
|
|
114
|
-
return useCallback(
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
return useCallback(
|
|
114
|
+
(path: string) => {
|
|
115
|
+
show(`Screenshot saved: ${path}`, "success", 2500)
|
|
116
|
+
},
|
|
117
|
+
[show],
|
|
118
|
+
)
|
|
117
119
|
}
|
package/src/dev/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Dev mode utilities
|
|
2
|
-
export {
|
|
2
|
+
export { type Toast, ToastContainer, ToastProvider, type ToastType, useScreenshotToast, useToast } from "./Toast.js"
|
package/src/dev.tsx
CHANGED
|
@@ -9,25 +9,24 @@
|
|
|
9
9
|
* - Remote control when EFFECT_TUI_REMOTE=1
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { Colors } from "@effect-tui/core"
|
|
13
13
|
import * as watcher from "@parcel/watcher"
|
|
14
|
-
import {
|
|
15
|
-
import { stat } from "fs/promises"
|
|
14
|
+
import { globalValue } from "effect/GlobalValue"
|
|
16
15
|
import { readFileSync } from "fs"
|
|
16
|
+
import { stat } from "fs/promises"
|
|
17
|
+
import { dirname } from "path"
|
|
17
18
|
import React from "react"
|
|
18
|
-
import {
|
|
19
|
-
import { createRenderer, createRoot, type Root } from "./renderer.js"
|
|
20
|
-
import type { RendererOptions } from "./renderer-types.js"
|
|
21
|
-
import type { TuiRenderer } from "./renderer-types.js"
|
|
19
|
+
import { Overlay } from "./components/Overlay.js"
|
|
22
20
|
import { ConsolePopover } from "./console/ConsolePopover.js"
|
|
21
|
+
import { copyToClipboard, copyToClipboardSync } from "./console/clipboard.js"
|
|
23
22
|
import { useConsole } from "./console/useConsole.js"
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
23
|
+
import { DiagnosticsPanel } from "./debug/DiagnosticsPanel.js"
|
|
24
|
+
import { ToastContainer, ToastProvider, useToast } from "./dev/Toast.js"
|
|
26
25
|
import { useKeyboard } from "./hooks/use-keyboard.js"
|
|
26
|
+
import { enableRemote } from "./remote/index.js"
|
|
27
|
+
import { createRenderer, createRoot, type Root } from "./renderer.js"
|
|
27
28
|
import { useRenderer, useTerminalSize } from "./renderer-context.js"
|
|
28
|
-
import {
|
|
29
|
-
import { DiagnosticsPanel } from "./debug/DiagnosticsPanel.js"
|
|
30
|
-
import { Overlay } from "./components/Overlay.js"
|
|
29
|
+
import type { RendererOptions, TuiRenderer } from "./renderer-types.js"
|
|
31
30
|
|
|
32
31
|
/**
|
|
33
32
|
* Pipeable combinator that makes an atom persist across hot reloads.
|
package/src/highlight.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createHighlighter, type Highlighter, type BundledLanguage, type BundledTheme } from "shiki"
|
|
2
1
|
import type { Color } from "@effect-tui/core"
|
|
2
|
+
import { type BundledLanguage, type BundledTheme, createHighlighter, type Highlighter } from "shiki"
|
|
3
3
|
|
|
4
4
|
export interface HighlightTokenStyle {
|
|
5
5
|
fg?: Color
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { useKeyboard } from "./use-keyboard.js"
|
|
2
1
|
export type { UseKeyboardOptions } from "./use-keyboard.js"
|
|
3
|
-
export {
|
|
2
|
+
export { useKeyboard } from "./use-keyboard.js"
|
|
4
3
|
export type { UseMouseOptions } from "./use-mouse.js"
|
|
4
|
+
export { useMouse } from "./use-mouse.js"
|
|
5
5
|
export { usePaste } from "./use-paste.js"
|
|
6
|
+
export { useQuit } from "./use-quit.js"
|
|
7
|
+
export type { ScrollState, UseScrollOptions, UseScrollReturn } from "./use-scroll.js"
|
|
6
8
|
export { useScroll } from "./use-scroll.js"
|
|
7
|
-
export type { UseScrollOptions, UseScrollReturn, ScrollState } from "./use-scroll.js"
|
package/src/hooks/use-mouse.ts
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useCallback } from "react"
|
|
2
|
+
import { useRenderer } from "../renderer-context.js"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Hook that returns a quit function for cleanly exiting the TUI application.
|
|
6
|
+
*
|
|
7
|
+
* This ensures terminal state is properly restored (alternate buffer exit,
|
|
8
|
+
* cursor shown, raw mode disabled) before the process exits.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* function App() {
|
|
13
|
+
* const quit = useQuit()
|
|
14
|
+
*
|
|
15
|
+
* useKeyboard((key) => {
|
|
16
|
+
* if (key.text === "q") quit()
|
|
17
|
+
* })
|
|
18
|
+
*
|
|
19
|
+
* return <text>Press q to quit</text>
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function useQuit(): (code?: number) => void {
|
|
24
|
+
const renderer = useRenderer()
|
|
25
|
+
|
|
26
|
+
return useCallback(
|
|
27
|
+
(code = 0) => {
|
|
28
|
+
renderer.stop()
|
|
29
|
+
process.exit(code)
|
|
30
|
+
},
|
|
31
|
+
[renderer],
|
|
32
|
+
)
|
|
33
|
+
}
|
package/src/hooks/use-scroll.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// use-scroll.ts — Hook for managing scroll state with keyboard/mouse input
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import type { KeyMsg } from "@effect-tui/core"
|
|
4
|
-
import {
|
|
4
|
+
import { useCallback, useLayoutEffect, useMemo, useRef, useState } from "react"
|
|
5
5
|
import { useTerminalSize } from "../renderer.js"
|
|
6
|
+
import { useKeyboard } from "./use-keyboard.js"
|
|
6
7
|
|
|
7
8
|
// ============================================================================
|
|
8
9
|
// Scroll Acceleration (macOS-style)
|
|
@@ -356,15 +357,12 @@ export function useScroll(options: UseScrollOptions = {}): UseScrollReturn {
|
|
|
356
357
|
}
|
|
357
358
|
|
|
358
359
|
// Handle effective offset sync from host (when sticky adjusts the offset)
|
|
359
|
-
const handleEffectiveOffset = useCallback(
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
},
|
|
366
|
-
[],
|
|
367
|
-
)
|
|
360
|
+
const handleEffectiveOffset = useCallback((effectiveOffset: number) => {
|
|
361
|
+
// Sync the ref so scrollToVisible uses the actual rendered position
|
|
362
|
+
offsetRef.current = effectiveOffset
|
|
363
|
+
// Also update state to keep in sync (but don't trigger wasAtEnd change)
|
|
364
|
+
setOffsetRaw(effectiveOffset)
|
|
365
|
+
}, [])
|
|
368
366
|
|
|
369
367
|
const scrollProps = {
|
|
370
368
|
offset,
|
package/src/hosts/base.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CellBuffer,
|
|
2
|
-
import type {
|
|
1
|
+
import type { CellBuffer, Color, Palette } from "@effect-tui/core"
|
|
2
|
+
import type { CommonProps, HostContext, HostInstance, Rect, Size } from "../reconciler/types.js"
|
|
3
3
|
|
|
4
4
|
/** Host that may have a background color (e.g., BoxHost) */
|
|
5
5
|
export interface HostWithBg extends HostInstance {
|
|
@@ -32,9 +32,11 @@ export abstract class BaseHost implements HostInstance {
|
|
|
32
32
|
children: HostInstance[] = []
|
|
33
33
|
rect: Rect | null = null
|
|
34
34
|
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
// Greedy layout - expands to fill remaining space
|
|
36
|
+
// undefined = not greedy (hug content)
|
|
37
|
+
// true or 1 = 1 share
|
|
38
|
+
// number > 1 = proportionally more shares
|
|
39
|
+
greedy: boolean | number | undefined = undefined
|
|
38
40
|
|
|
39
41
|
// ─────────────────────────────────────────────────────────────
|
|
40
42
|
// Frame constraints (like SwiftUI's .frame modifier)
|
|
@@ -65,7 +67,20 @@ export abstract class BaseHost implements HostInstance {
|
|
|
65
67
|
abstract render(buffer: CellBuffer, palette: Palette): void
|
|
66
68
|
|
|
67
69
|
layout(rect: Rect): void {
|
|
68
|
-
|
|
70
|
+
// Apply frame constraints to the assigned rect
|
|
71
|
+
let { w, h } = rect
|
|
72
|
+
|
|
73
|
+
// Fixed width/height override
|
|
74
|
+
if (this.frameWidth !== undefined) w = this.frameWidth
|
|
75
|
+
if (this.frameHeight !== undefined) h = this.frameHeight
|
|
76
|
+
|
|
77
|
+
// Apply min/max clamps
|
|
78
|
+
if (this.frameMinWidth !== undefined) w = Math.max(this.frameMinWidth, w)
|
|
79
|
+
if (this.frameMaxWidth !== undefined) w = Math.min(this.frameMaxWidth, w)
|
|
80
|
+
if (this.frameMinHeight !== undefined) h = Math.max(this.frameMinHeight, h)
|
|
81
|
+
if (this.frameMaxHeight !== undefined) h = Math.min(this.frameMaxHeight, h)
|
|
82
|
+
|
|
83
|
+
this.rect = { x: rect.x, y: rect.y, w, h }
|
|
69
84
|
}
|
|
70
85
|
|
|
71
86
|
/**
|
|
@@ -144,8 +159,23 @@ export abstract class BaseHost implements HostInstance {
|
|
|
144
159
|
}
|
|
145
160
|
|
|
146
161
|
updateProps(props: Record<string, unknown>): void {
|
|
147
|
-
|
|
148
|
-
|
|
162
|
+
// Greedy layout - reset to undefined unless explicitly set
|
|
163
|
+
// Subclasses like Spacer/Scroll set their own default before calling super
|
|
164
|
+
if ("greedy" in props) {
|
|
165
|
+
const greedy = props.greedy
|
|
166
|
+
if (greedy === true) {
|
|
167
|
+
this.greedy = 1
|
|
168
|
+
} else if (typeof greedy === "number") {
|
|
169
|
+
this.greedy = greedy
|
|
170
|
+
} else {
|
|
171
|
+
// greedy is false, undefined, or null
|
|
172
|
+
this.greedy = undefined
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
// No greedy prop - reset to default (undefined)
|
|
176
|
+
// Subclasses like Spacer/Scroll handle this before calling super
|
|
177
|
+
this.greedy = undefined
|
|
178
|
+
}
|
|
149
179
|
|
|
150
180
|
// Frame constraints - only accept valid numbers (ignore strings like "100%")
|
|
151
181
|
this.frameWidth = typeof props.width === "number" ? props.width : undefined
|
package/src/hosts/box.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { CellBuffer,
|
|
1
|
+
import type { CellBuffer, Color, Palette } from "@effect-tui/core"
|
|
2
2
|
import { Colors } from "@effect-tui/core"
|
|
3
|
-
import type { HostContext, Rect, Size
|
|
4
|
-
import { SingleChildHost } from "./single-child.js"
|
|
3
|
+
import type { CommonProps, HostContext, Rect, Size } from "../reconciler/types.js"
|
|
5
4
|
import {
|
|
6
5
|
type BorderKind,
|
|
7
6
|
borderChars,
|
|
8
7
|
drawBorder,
|
|
9
8
|
type Padding,
|
|
10
9
|
type PaddingInput,
|
|
11
|
-
resolvePadding,
|
|
12
10
|
resolveInheritedBgStyle,
|
|
11
|
+
resolvePadding,
|
|
13
12
|
toColorValue,
|
|
14
13
|
} from "../utils/index.js"
|
|
14
|
+
import { SingleChildHost } from "./single-child.js"
|
|
15
15
|
|
|
16
16
|
export type { BorderKind }
|
|
17
17
|
|
package/src/hosts/canvas.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { CellBuffer,
|
|
1
|
+
import type { CellBuffer, Color, Palette } from "@effect-tui/core"
|
|
2
2
|
import { Colors } from "@effect-tui/core"
|
|
3
|
-
import type { HostContext, Size
|
|
4
|
-
import { BaseHost } from "./base.js"
|
|
3
|
+
import type { CommonProps, HostContext, Size } from "../reconciler/types.js"
|
|
5
4
|
import {
|
|
6
5
|
type BorderKind,
|
|
7
6
|
borderChars,
|
|
@@ -10,6 +9,7 @@ import {
|
|
|
10
9
|
styleIdFromProps,
|
|
11
10
|
toColorValue,
|
|
12
11
|
} from "../utils/index.js"
|
|
12
|
+
import { BaseHost } from "./base.js"
|
|
13
13
|
|
|
14
14
|
export type { BorderKind }
|
|
15
15
|
|
package/src/hosts/codeblock.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type CellBuffer, type Color, Colors, displayWidth, type Palette } from "@effect-tui/core"
|
|
2
2
|
import type { HighlightLine } from "../highlight.js"
|
|
3
|
-
import type { HostContext, Rect, Size
|
|
3
|
+
import type { CommonProps, HostContext, Rect, Size } from "../reconciler/types.js"
|
|
4
|
+
import { type Padding, type PaddingInput, resolveBgStyle, resolvePadding, styleIdFromProps } from "../utils/index.js"
|
|
4
5
|
import { BaseHost } from "./base.js"
|
|
5
|
-
import { type Padding, type PaddingInput, resolvePadding, resolveBgStyle, styleIdFromProps } from "../utils/index.js"
|
|
6
6
|
|
|
7
7
|
export interface CodeBlockProps extends CommonProps {
|
|
8
8
|
lines: HighlightLine[]
|