Revert "feat: 第一个可以用的 ink 组件抽象 (#158)" (#175)

This reverts commit c445f43f8d.
This commit is contained in:
claude-code-best
2026-04-07 15:05:03 +08:00
committed by GitHub
parent ca0c3265e6
commit 88d4c3ba24
645 changed files with 1214 additions and 7255 deletions

View File

@@ -1,5 +1,5 @@
import React, { Children, isValidElement } from 'react'
import { Text } from '@anthropic/ink'
import { Text } from '../../ink.js'
type Props = {
/** The items to join with a middot separator */

View File

@@ -3,7 +3,7 @@ import {
type ExitState,
useExitOnCtrlCDWithKeybindings,
} from '../../hooks/useExitOnCtrlCDWithKeybindings.js'
import { Box, Text } from '@anthropic/ink'
import { Box, Text } from '../../ink.js'
import { useKeybinding } from '../../keybindings/useKeybinding.js'
import type { Theme } from '../../utils/theme.js'
import { ConfigurableShortcutHint } from '../ConfigurableShortcutHint.js'

View File

@@ -1,6 +1,7 @@
import React from 'react'
import { useTerminalSize } from '../../hooks/useTerminalSize.js'
import { Ansi, Text, stringWidth } from '@anthropic/ink'
import { stringWidth } from '../../ink/stringWidth.js'
import { Ansi, Text } from '../../ink.js'
import type { Theme } from '../../utils/theme.js'
type DividerProps = {

View File

@@ -2,7 +2,9 @@ import * as React from 'react'
import { useEffect, useState } from 'react'
import { useSearchInput } from '../../hooks/useSearchInput.js'
import { useTerminalSize } from '../../hooks/useTerminalSize.js'
import { type KeyboardEvent, Box, clamp, Text, useTerminalFocus } from '@anthropic/ink'
import type { KeyboardEvent } from '../../ink/events/keyboard-event.js'
import { clamp } from '../../ink/layout/geometry.js'
import { Box, Text, useTerminalFocus } from '../../ink.js'
import { SearchBox } from '../SearchBox.js'
import { Byline } from './Byline.js'
import { KeyboardShortcutHint } from './KeyboardShortcutHint.js'

View File

@@ -1,5 +1,5 @@
import React from 'react'
import { Text } from '@anthropic/ink'
import Text from '../../ink/components/Text.js'
type Props = {
/** The key or chord to display (e.g., "ctrl+o", "Enter", "↑/↓") */

View File

@@ -1,7 +1,8 @@
import figures from 'figures'
import type { ReactNode } from 'react'
import React from 'react'
import { useDeclaredCursor, Box, Text } from '@anthropic/ink'
import { useDeclaredCursor } from '../../ink/hooks/use-declared-cursor.js'
import { Box, Text } from '../../ink.js'
type ListItemProps = {
/**

View File

@@ -1,5 +1,5 @@
import React from 'react'
import { Box, Text } from '@anthropic/ink'
import { Box, Text } from '../../ink.js'
import { Spinner } from '../Spinner.js'
type LoadingStateProps = {

View File

@@ -1,6 +1,6 @@
import React from 'react'
import { useIsInsideModal } from '../../context/modalContext.js'
import { Box } from '@anthropic/ink'
import { Box } from '../../ink.js'
import type { Theme } from '../../utils/theme.js'
import { Divider } from './Divider.js'

View File

@@ -1,5 +1,5 @@
import React from 'react'
import { Text } from '@anthropic/ink'
import { Text } from '../../ink.js'
import type { Theme } from '../../utils/theme.js'
type Props = {

View File

@@ -1,6 +1,7 @@
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react'
import { useTerminalSize } from '../../hooks/useTerminalSize.js'
import { useTerminalViewport, Box, type DOMElement, measureElement } from '@anthropic/ink'
import { useTerminalViewport } from '../../ink/hooks/use-terminal-viewport.js'
import { Box, type DOMElement, measureElement } from '../../ink.js'
type Props = {
children: React.ReactNode

View File

@@ -1,6 +1,6 @@
import figures from 'figures'
import React from 'react'
import { Text } from '@anthropic/ink'
import { Text } from '../../ink.js'
type Status = 'success' | 'error' | 'warning' | 'info' | 'pending' | 'loading'

View File

@@ -10,7 +10,10 @@ import {
useModalScrollRef,
} from '../../context/modalContext.js'
import { useTerminalSize } from '../../hooks/useTerminalSize.js'
import { Box, ScrollBox, Text, stringWidth, type KeyboardEvent } from '@anthropic/ink'
import ScrollBox from '../../ink/components/ScrollBox.js'
import type { KeyboardEvent } from '../../ink/events/keyboard-event.js'
import { stringWidth } from '../../ink/stringWidth.js'
import { Box, Text } from '../../ink.js'
import { useKeybindings } from '../../keybindings/useKeybinding.js'
import type { Theme } from '../../utils/theme.js'

View File

@@ -6,7 +6,7 @@ import React, {
useMemo,
useState,
} from 'react'
import { useStdin } from '@anthropic/ink'
import useStdin from '../../ink/hooks/use-stdin.js'
import { getGlobalConfig, saveGlobalConfig } from '../../utils/config.js'
import {
getSystemThemeName,

View File

@@ -1,5 +1,10 @@
import React, { type PropsWithChildren, type Ref } from 'react'
import { type ClickEvent, DOMElement, type FocusEvent, type KeyboardEvent, Color, type Styles, Box as BaseBox } from '@anthropic/ink'
import Box from '../../ink/components/Box.js'
import type { DOMElement } from '../../ink/dom.js'
import type { ClickEvent } from '../../ink/events/click-event.js'
import type { FocusEvent } from '../../ink/events/focus-event.js'
import type { KeyboardEvent } from '../../ink/events/keyboard-event.js'
import type { Color, Styles } from '../../ink/styles.js'
import { getTheme, type Theme } from '../../utils/theme.js'
import { useTheme } from './ThemeProvider.js'

View File

@@ -1,7 +1,7 @@
import type { ReactNode } from 'react'
import React, { useContext } from 'react'
import { Text } from '@anthropic/ink'
import type { Color, Styles } from '@anthropic/ink'
import Text from '../../ink/components/Text.js'
import type { Color, Styles } from '../../ink/styles.js'
import { getTheme, type Theme } from '../../utils/theme.js'
import { useTheme } from './ThemeProvider.js'

View File

@@ -1,4 +1,5 @@
import { type ColorType, colorize, type Color } from '@anthropic/ink'
import { type ColorType, colorize } from '../../ink/colorize.js'
import type { Color } from '../../ink/styles.js'
import { getTheme, type Theme, type ThemeName } from '../../utils/theme.js'
/**