@xfe-repo/cli 2.0.7 → 2.0.8

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.
@@ -1,50 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * @xfe-repo/cli - 日志面板组件
4
- *
5
- * 滚动日志面板,展示带颜色的日志条目
6
- */
7
- import { memo } from 'react';
8
- import { Box, Text } from 'ink';
9
- import { StatusMessage } from '@inkjs/ui';
10
- /** 日志级别与颜色映射 */
11
- const LOG_LEVEL_COLORS = {
12
- log: 'white',
13
- success: 'green',
14
- warn: 'yellow',
15
- error: 'red',
16
- debug: 'gray',
17
- };
18
- /** 单条日志渲染 */
19
- const LogLine = memo(function LogLine({ entry }) {
20
- if (entry.level === 'custom' && entry.segments) {
21
- return (_jsx(Box, { children: entry.segments.map((seg, i) => (_jsx(Text, { color: seg.color, children: seg.text }, i))) }));
22
- }
23
- const variant = getVariant(entry.level);
24
- if (variant) {
25
- return _jsx(StatusMessage, { variant: variant, children: entry.message });
26
- }
27
- return _jsx(Text, { color: LOG_LEVEL_COLORS[entry.level], children: entry.message });
28
- });
29
- function getVariant(level) {
30
- switch (level) {
31
- case 'success':
32
- return 'success';
33
- case 'error':
34
- return 'error';
35
- case 'warn':
36
- return 'warning';
37
- default:
38
- return undefined;
39
- }
40
- }
41
- /**
42
- * LogPanel - 滚动日志面板
43
- *
44
- * 显示最近的日志条目,自动滚动到底部
45
- */
46
- export const LogPanel = memo(function LogPanel({ entries, maxLines = 20 }) {
47
- const visible = entries.slice(-maxLines);
48
- return (_jsx(Box, { flexDirection: "column", children: visible.map((entry, i) => (_jsx(LogLine, { entry: entry }, entry.timestamp + i))) }));
49
- });
50
- //# sourceMappingURL=LogPanel.js.map
@@ -1,13 +0,0 @@
1
- /**
2
- * @xfe-repo/cli - 终端可点击链接组件
3
- *
4
- * 利用 OSC 8 转义序列在支持的终端中渲染可点击链接
5
- * 不支持的终端会回退为普通文本
6
- */
7
- interface TerminalLinkProps {
8
- readonly url: string;
9
- readonly children: React.ReactNode;
10
- }
11
- export declare function TerminalLink({ url, children }: TerminalLinkProps): import("react/jsx-runtime").JSX.Element;
12
- export {};
13
- //# sourceMappingURL=TerminalLink.d.ts.map
@@ -1,16 +0,0 @@
1
- import { jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * @xfe-repo/cli - 终端可点击链接组件
4
- *
5
- * 利用 OSC 8 转义序列在支持的终端中渲染可点击链接
6
- * 不支持的终端会回退为普通文本
7
- */
8
- import { Text } from 'ink';
9
- // ─── Constants ──────────────────────────────────────────────
10
- const OSC = '\u001B]';
11
- const BEL = '\u0007';
12
- // ─── Component ──────────────────────────────────────────────
13
- export function TerminalLink({ url, children }) {
14
- return (_jsxs(Text, { children: [`${OSC}8;;${url}${BEL}`, children, `${OSC}8;;${BEL}`] }));
15
- }
16
- //# sourceMappingURL=TerminalLink.js.map