@effect-tui/react 0.2.0 → 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 +3 -3
- package/dist/src/hooks/index.d.ts.map +1 -1
- 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-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 +2 -2
- package/dist/src/hosts/base.d.ts.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 +1 -1
- 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 +2 -2
- package/dist/src/hosts/scroll.d.ts.map +1 -1
- package/dist/src/hosts/scroll.js +1 -1
- 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 +1 -1
- package/dist/src/hosts/spacer.d.ts.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 +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.js +1 -1
- package/dist/src/renderer/input/InputProcessor.js.map +1 -1
- package/dist/src/renderer/lifecycle/TerminalSetup.d.ts +1 -1
- package/dist/src/renderer/lifecycle/TerminalSetup.d.ts.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 +2 -2
- package/dist/src/renderer.d.ts.map +1 -1
- package/dist/src/renderer.js +6 -6
- 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 +2 -2
- package/dist/src/test/render-tui.d.ts.map +1 -1
- package/dist/src/test/render-tui.js +2 -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 +1 -1
- 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 +2 -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 +3 -3
- package/src/hooks/use-keyboard.ts +1 -1
- package/src/hooks/use-mouse.ts +1 -1
- package/src/hooks/use-scroll.ts +9 -11
- package/src/hooks/useFrameStats.ts +1 -1
- package/src/hosts/base.ts +2 -2
- 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 +3 -3
- 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 +3 -3
- package/src/hosts/single-child.ts +1 -1
- package/src/hosts/spacer.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- package/src/renderer/lifecycle/TerminalSetup.ts +1 -1
- 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 +18 -19
- package/src/test/index.ts +4 -4
- package/src/test/render-tui.ts +3 -3
- package/src/utils/flex-layout.ts +2 -2
- package/src/utils/index.ts +8 -8
- package/src/utils/styles.ts +2 -2
- package/src/visualize/index.tsx +2 -2
package/src/test/render-tui.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ReactElement } from "react"
|
|
2
1
|
import type { KeyMsg } from "@effect-tui/core"
|
|
3
|
-
import {
|
|
2
|
+
import type { ReactElement } from "react"
|
|
4
3
|
import { flushPassiveEffects, flushSync } from "../reconciler/host-config.js"
|
|
5
|
-
import {
|
|
4
|
+
import { createRenderer, createRoot } from "../renderer.js"
|
|
5
|
+
import { getVisibleLines, MockStdin, MockStdout, stripAnsi } from "./mock-streams.js"
|
|
6
6
|
|
|
7
7
|
export interface RenderTUIOptions {
|
|
8
8
|
width?: number
|
package/src/utils/flex-layout.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Generic flex layout algorithm for VStack and HStack.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type
|
|
5
|
+
import { type Axis, crossDim, crossPos, crossSize, mainDim, mainPos, mainSize, makeRect } from "@effect-tui/core"
|
|
6
6
|
import type { BaseHost } from "../hosts/base.js"
|
|
7
|
-
import
|
|
7
|
+
import type { HostInstance, Rect, Size } from "../reconciler/types.js"
|
|
8
8
|
|
|
9
9
|
export type FlexAxis = Axis
|
|
10
10
|
export type FlexAlignment = "start" | "center" | "end"
|
package/src/utils/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { type HAlign, type VAlign
|
|
2
|
-
export { type
|
|
1
|
+
export { alignInRect, type HAlign, type VAlign } from "./alignment.js"
|
|
2
|
+
export { type BorderChars, type BorderKind, borderChars, type ClipRect, drawBorder } from "./border.js"
|
|
3
|
+
export { type FlexAlignment, type FlexAxis, type FlexMeasureResult, layoutFlex, measureFlex } from "./flex-layout.js"
|
|
3
4
|
export { type Padding, type PaddingInput, resolvePadding } from "./padding.js"
|
|
4
5
|
export {
|
|
5
|
-
type StyleOptions,
|
|
6
|
-
type StyleInput,
|
|
7
|
-
toColorValue,
|
|
8
|
-
styleSpecFromProps,
|
|
9
|
-
styleIdFromProps,
|
|
10
6
|
resolveBgStyle,
|
|
11
7
|
resolveInheritedBgStyle,
|
|
8
|
+
type StyleInput,
|
|
9
|
+
type StyleOptions,
|
|
10
|
+
styleIdFromProps,
|
|
11
|
+
styleSpecFromProps,
|
|
12
|
+
toColorValue,
|
|
12
13
|
} from "./styles.js"
|
|
13
|
-
export { type FlexAxis, type FlexAlignment, type FlexMeasureResult, measureFlex, layoutFlex } from "./flex-layout.js"
|
package/src/utils/styles.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Style utilities for building palette-compatible style objects.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Color, type ColorValue, type Palette, parseColor, type StyleSpec } from "@effect-tui/core"
|
|
6
6
|
|
|
7
7
|
export interface StyleOptions {
|
|
8
8
|
fg?: ColorValue
|
|
@@ -56,8 +56,8 @@ export function resolveBgStyle(palette: Palette, bg?: Color): { value?: ColorVal
|
|
|
56
56
|
return { value, styleId }
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
import type { HostInstance } from "../reconciler/types.js"
|
|
60
59
|
import { getInheritedBg } from "../hosts/base.js"
|
|
60
|
+
import type { HostInstance } from "../reconciler/types.js"
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* Resolve background style, inheriting from parent if not explicitly set.
|
package/src/visualize/index.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Effect visualization wrapper using React
|
|
2
2
|
// Uses Effect Layer for proper terminal state management across multiple calls
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { ANSI, Colors } from "@effect-tui/core"
|
|
5
5
|
import { Cause, Context, Duration, Effect, Exit, Fiber, Layer, Option } from "effect"
|
|
6
|
-
import {
|
|
6
|
+
import { useEffect, useState } from "react"
|
|
7
7
|
import { createRenderer, createRoot } from "../renderer.js"
|
|
8
8
|
|
|
9
9
|
const SPINNER_FRAMES = ["⠋", "⠙", "⠸", "⠴", "⠦", "⠇"] as const
|