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

This commit is contained in:
claude-code-best
2026-04-06 23:56:45 +08:00
committed by GitHub
parent 3ea64eeb0f
commit c445f43f8d
645 changed files with 7255 additions and 1214 deletions

View File

@@ -9,9 +9,9 @@ import { getIsRemoteMode } from '../bootstrap/state.js'
import type { Command } from '../commands.js'
import { BLACK_CIRCLE } from '../constants/figures.js'
import { useTerminalSize } from '../hooks/useTerminalSize.js'
import type { ScrollBoxHandle } from '../ink/components/ScrollBox.js'
import { useTerminalNotification } from '../ink/useTerminalNotification.js'
import { Box, Text } from '../ink.js'
import type { ScrollBoxHandle } from '@anthropic/ink'
import { useTerminalNotification } from '@anthropic/ink'
import { Box, Text } from '@anthropic/ink'
import { useShortcutDisplay } from '../keybindings/useShortcutDisplay.js'
import type { Screen } from '../screens/REPL.js'
import type { Tools } from '../Tool.js'
@@ -49,7 +49,7 @@ import {
} from '../utils/messages.js'
import { plural } from '../utils/stringUtils.js'
import { renderableSearchText } from '../utils/transcriptSearch.js'
import { Divider } from './design-system/Divider.js'
import { Divider } from '@anthropic/ink'
import type { UnseenDivider } from './FullscreenLayout.js'
import { LogoV2 } from './LogoV2/LogoV2.js'
import { StreamingMarkdown } from './Markdown.js'
@@ -291,13 +291,13 @@ type Props = {
/** Paint an existing DOM subtree to fresh Screen, scan. Element comes
* from the main tree (all real providers). Message-relative positions. */
scanElement?: (
el: import('../ink/dom.js').DOMElement,
) => import('../ink/render-to-screen.js').MatchPosition[]
el: import('@anthropic/ink').DOMElement,
) => import('@anthropic/ink').MatchPosition[]
/** Position-based CURRENT highlight. positions stable (msg-relative),
* rowOffset tracks scroll. null clears. */
setPositions?: (
state: {
positions: import('../ink/render-to-screen.js').MatchPosition[]
positions: import('@anthropic/ink').MatchPosition[]
rowOffset: number
currentIdx: number
} | null,