refactor(tui): extract standalone package (#31193)
This commit is contained in:
@@ -26,7 +26,7 @@ function wordmark(pad = "") {
|
||||
})
|
||||
}
|
||||
|
||||
export function sessionExitSummary(input: { title: string; sessionID?: string }) {
|
||||
export function sessionEpilogue(input: { title: string; sessionID?: string }) {
|
||||
const weak = (text: string) => `${dim}${text.padEnd(10, " ")}${reset}`
|
||||
return [
|
||||
...wordmark(" "),
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { CliRenderer } from "@opentui/core"
|
||||
|
||||
export function destroyRenderer(renderer: Pick<CliRenderer, "isDestroyed" | "setTerminalTitle" | "destroy">) {
|
||||
renderer.setTerminalTitle("")
|
||||
if (!renderer.isDestroyed) renderer.destroy()
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { TuiPlatform } from "../platform"
|
||||
import type { ClipboardService } from "../context/clipboard"
|
||||
|
||||
type Toast = {
|
||||
show: (input: { message: string; variant: "info" | "success" | "warning" | "error" }) => void
|
||||
@@ -23,7 +23,7 @@ type SelectionKeyEvent = {
|
||||
stopPropagation: () => void
|
||||
}
|
||||
|
||||
export function copy(renderer: Renderer, toast: Toast, clipboard: TuiPlatform["clipboard"]): boolean {
|
||||
export function copy(renderer: Renderer, toast: Toast, clipboard: ClipboardService): boolean {
|
||||
const selection = renderer.getSelection()
|
||||
if (!selection) return false
|
||||
|
||||
@@ -47,7 +47,7 @@ export function handleSelectionKey(
|
||||
renderer: Renderer,
|
||||
toast: Toast,
|
||||
event: SelectionKeyEvent,
|
||||
clipboard: TuiPlatform["clipboard"],
|
||||
clipboard: ClipboardService,
|
||||
) {
|
||||
const selection = renderer.getSelection()
|
||||
if (!selection) return
|
||||
|
||||
Reference in New Issue
Block a user