@openviking/react 0.0.0-stage → 0.1.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/README.md +82 -2
- package/dist/3~0.js +8 -0
- package/dist/a~0.js +21 -0
- package/dist/client/client.d.ts +12 -0
- package/dist/client/errors.d.ts +30 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/options.d.ts +101 -0
- package/dist/client/provider.d.ts +52 -0
- package/dist/client/types.d.ts +160 -0
- package/dist/client.js +239 -0
- package/dist/components/agent-connect/agent-connect.d.ts +4 -0
- package/dist/components/agent-connect/index.d.ts +1 -0
- package/dist/components/agent-connect/style.css +16 -0
- package/dist/components/agent-connect/style.js +0 -0
- package/dist/components/agent-connect/types.d.ts +175 -0
- package/dist/components/agent-connect.js +1 -0
- package/dist/components/file-preview/file-preview-body.d.ts +15 -0
- package/dist/components/file-preview/file-preview-header.d.ts +16 -0
- package/dist/components/file-preview/file-preview-icons.d.ts +2 -0
- package/dist/components/file-preview/file-preview-labels.d.ts +5 -0
- package/dist/components/file-preview/file-preview-operations.d.ts +1 -0
- package/dist/components/file-preview/file-preview.d.ts +17 -0
- package/dist/components/file-preview/index.d.ts +1 -0
- package/dist/components/file-preview/style.css +285 -0
- package/dist/components/file-preview/style.js +0 -0
- package/dist/components/file-preview/types.d.ts +435 -0
- package/dist/components/file-preview/use-file-preview-editing.d.ts +13 -0
- package/dist/components/file-preview.js +442 -0
- package/dist/components/file-tree/file-tree-body.d.ts +14 -0
- package/dist/components/file-tree/file-tree-dom.d.ts +4 -0
- package/dist/components/file-tree/file-tree-entry-row.d.ts +6 -0
- package/dist/components/file-tree/file-tree-icons.d.ts +8 -0
- package/dist/components/file-tree/file-tree-keyboard.d.ts +10 -0
- package/dist/components/file-tree/file-tree-labels.d.ts +5 -0
- package/dist/components/file-tree/file-tree-row-context.d.ts +24 -0
- package/dist/components/file-tree/file-tree-rows.d.ts +12 -0
- package/dist/components/file-tree/file-tree-tooltip.d.ts +11 -0
- package/dist/components/file-tree/file-tree.d.ts +4 -0
- package/dist/components/file-tree/index.d.ts +1 -0
- package/dist/components/file-tree/style.css +244 -0
- package/dist/components/file-tree/style.js +0 -0
- package/dist/components/file-tree/types.d.ts +406 -0
- package/dist/components/file-tree/use-file-tree-actions.d.ts +10 -0
- package/dist/components/file-tree.js +1 -0
- package/dist/components/scope-switcher/index.d.ts +1 -0
- package/dist/components/scope-switcher/scope-keyboard.d.ts +2 -0
- package/dist/components/scope-switcher/scope-panel.d.ts +5 -0
- package/dist/components/scope-switcher/scope-selector.d.ts +2 -0
- package/dist/components/scope-switcher/scope-switcher.d.ts +6 -0
- package/dist/components/scope-switcher/style.css +248 -0
- package/dist/components/scope-switcher/style.js +0 -0
- package/dist/components/scope-switcher/types.d.ts +367 -0
- package/dist/components/scope-switcher.js +3 -0
- package/dist/components/style.css +811 -0
- package/dist/components/style.js +0 -0
- package/dist/components/tui/index.d.ts +1 -0
- package/dist/components/tui/style.css +16 -0
- package/dist/components/tui/style.js +0 -0
- package/dist/components/tui/tui.d.ts +3 -0
- package/dist/components/tui/types.d.ts +485 -0
- package/dist/components/tui.js +1 -0
- package/dist/f~0.js +284 -0
- package/dist/icons/index.d.ts +23 -0
- package/dist/icons.js +25 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +8 -0
- package/dist/i~0.js +21 -0
- package/dist/lk~0.js +220 -0
- package/dist/l~0.js +44 -0
- package/dist/modules/console/console.d.ts +4 -0
- package/dist/modules/console/index.d.ts +1 -0
- package/dist/modules/console/style.css +29 -0
- package/dist/modules/console/style.js +0 -0
- package/dist/modules/console/types.d.ts +101 -0
- package/dist/modules/console.js +1 -0
- package/dist/modules/file-browser/file-browser-toolbar-button.d.ts +10 -0
- package/dist/modules/file-browser/file-browser.d.ts +6 -0
- package/dist/modules/file-browser/index.d.ts +1 -0
- package/dist/modules/file-browser/style.css +75 -0
- package/dist/modules/file-browser/style.js +0 -0
- package/dist/modules/file-browser/types.d.ts +101 -0
- package/dist/modules/file-browser.js +1 -0
- package/dist/modules/scope-cascade/controller.d.ts +6 -0
- package/dist/modules/scope-cascade/index.d.ts +3 -0
- package/dist/modules/scope-cascade/scope-cascade.d.ts +3 -0
- package/dist/modules/scope-cascade/style.css +250 -0
- package/dist/modules/scope-cascade/style.js +0 -0
- package/dist/modules/scope-cascade/types.d.ts +39 -0
- package/dist/modules/scope-cascade/use-scope-cascade.d.ts +5 -0
- package/dist/modules/scope-cascade.js +1 -0
- package/dist/modules/style.css +385 -0
- package/dist/modules/style.js +0 -0
- package/dist/modules/task-center/columns.d.ts +129 -0
- package/dist/modules/task-center/index.d.ts +1 -0
- package/dist/modules/task-center/style.css +29 -0
- package/dist/modules/task-center/style.js +0 -0
- package/dist/modules/task-center/task-center.d.ts +4 -0
- package/dist/modules/task-center/types.d.ts +168 -0
- package/dist/modules/task-center.js +1 -0
- package/dist/n~0.js +499 -0
- package/dist/style.css +1198 -0
- package/dist/style.js +0 -0
- package/dist/u~0.js +8 -0
- package/package.json +103 -4
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tui.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
.ov-tui {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
border-radius: var(--ov-ui-radius, 6px);
|
|
4
|
+
background: var(--ov-ui-placeholder, #f3f4f7);
|
|
5
|
+
width: 360px;
|
|
6
|
+
height: 560px;
|
|
7
|
+
color: var(--ov-ui-text-muted, #8f959e);
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
font-family: inherit;
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { TuiCommandHelpContent, TuiCommandHelpItem, TuiCommandHelpSection, TuiLabels, TuiProps, TuiRecord, TuiRecordContent, TuiRecordStatus, TuiResourcePreviewContent, TuiResourceTreeContent, TuiResourceTreeDetailRow, TuiResourceTreeItem, TuiSearchListContent, TuiSearchResultItem, TuiStatusContent, TuiStatusRow, TuiTextContent, TuiWriteResultContent, } from './types.js';
|
|
2
|
+
/** 占位组件:仅渲染固定尺寸的空壳,真实实现按 props 契约重写。 */
|
|
3
|
+
export declare function Tui(): import("react").JSX.Element;
|
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 一条执行记录的状态。
|
|
4
|
+
* Status of one execution record.
|
|
5
|
+
*/
|
|
6
|
+
export type TuiRecordStatus =
|
|
7
|
+
/**
|
|
8
|
+
* 执行中。
|
|
9
|
+
* Still running.
|
|
10
|
+
*/
|
|
11
|
+
'pending'
|
|
12
|
+
/**
|
|
13
|
+
* 执行成功。
|
|
14
|
+
* Finished successfully.
|
|
15
|
+
*/
|
|
16
|
+
| 'success'
|
|
17
|
+
/**
|
|
18
|
+
* 执行失败。
|
|
19
|
+
* Finished with an error.
|
|
20
|
+
*/
|
|
21
|
+
| 'error';
|
|
22
|
+
/** 检索结果卡片中的一行。One row of a search result card. */
|
|
23
|
+
export interface TuiSearchResultItem {
|
|
24
|
+
/**
|
|
25
|
+
* 行唯一标识。
|
|
26
|
+
* Unique row key.
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
/**
|
|
30
|
+
* 主标题。
|
|
31
|
+
* Primary title.
|
|
32
|
+
*/
|
|
33
|
+
title: string;
|
|
34
|
+
/**
|
|
35
|
+
* 次要标签,例如路径或文件类型。
|
|
36
|
+
* Secondary label, for example a path or file type.
|
|
37
|
+
*/
|
|
38
|
+
metaLabel?: string;
|
|
39
|
+
/**
|
|
40
|
+
* 标题旁的内容层级标签。
|
|
41
|
+
* Content level label next to the title.
|
|
42
|
+
*/
|
|
43
|
+
levelLabel?: string;
|
|
44
|
+
/**
|
|
45
|
+
* 分数旁的结果类型标签。
|
|
46
|
+
* Result type label next to the score.
|
|
47
|
+
*/
|
|
48
|
+
typeLabel?: string;
|
|
49
|
+
/**
|
|
50
|
+
* 宿主计算出的分数,显示在右侧。
|
|
51
|
+
* Score rendered on the right when the host computes one.
|
|
52
|
+
*/
|
|
53
|
+
scoreLabel?: string;
|
|
54
|
+
/**
|
|
55
|
+
* 悬停或键盘聚焦分数时展示的详情;仅在提供 `scoreLabel` 时显示。
|
|
56
|
+
* Details shown on score hover or keyboard focus; requires `scoreLabel`.
|
|
57
|
+
*/
|
|
58
|
+
scoreDetails?: ReactNode;
|
|
59
|
+
/**
|
|
60
|
+
* 标题下方的摘录。
|
|
61
|
+
* Short excerpt shown under the title.
|
|
62
|
+
*/
|
|
63
|
+
preview?: string;
|
|
64
|
+
/**
|
|
65
|
+
* 该结果对应的资源 URI,可用于打开。
|
|
66
|
+
* URI of the result, which can be opened.
|
|
67
|
+
*/
|
|
68
|
+
uri?: string;
|
|
69
|
+
}
|
|
70
|
+
/** 资源树行内的一条键值明细。One key/value detail row inside a resource tree item. */
|
|
71
|
+
export interface TuiResourceTreeDetailRow {
|
|
72
|
+
/**
|
|
73
|
+
* 明细标签。
|
|
74
|
+
* Detail label.
|
|
75
|
+
*/
|
|
76
|
+
label: string;
|
|
77
|
+
/**
|
|
78
|
+
* 明细值。
|
|
79
|
+
* Detail value.
|
|
80
|
+
*/
|
|
81
|
+
value: string;
|
|
82
|
+
}
|
|
83
|
+
/** 资源树结果卡片中的一行。One row of a resource tree card. */
|
|
84
|
+
export interface TuiResourceTreeItem {
|
|
85
|
+
/**
|
|
86
|
+
* 行唯一标识。
|
|
87
|
+
* Unique row key.
|
|
88
|
+
*/
|
|
89
|
+
id: string;
|
|
90
|
+
/**
|
|
91
|
+
* 主标题。
|
|
92
|
+
* Primary title.
|
|
93
|
+
*/
|
|
94
|
+
title: string;
|
|
95
|
+
/**
|
|
96
|
+
* 次要标签。
|
|
97
|
+
* Secondary label.
|
|
98
|
+
*/
|
|
99
|
+
metaLabel?: string;
|
|
100
|
+
/**
|
|
101
|
+
* 行内展示的键值明细。
|
|
102
|
+
* Key/value rows shown inside the item.
|
|
103
|
+
*/
|
|
104
|
+
detailRows?: readonly TuiResourceTreeDetailRow[];
|
|
105
|
+
/**
|
|
106
|
+
* 该资源对应的 URI,可用于打开。
|
|
107
|
+
* URI of the resource, which can be opened.
|
|
108
|
+
*/
|
|
109
|
+
uri?: string;
|
|
110
|
+
}
|
|
111
|
+
/** 状态卡片中的一行键值。One key/value row of a status card. */
|
|
112
|
+
export interface TuiStatusRow {
|
|
113
|
+
/**
|
|
114
|
+
* 行标签。
|
|
115
|
+
* Row label.
|
|
116
|
+
*/
|
|
117
|
+
label: string;
|
|
118
|
+
/**
|
|
119
|
+
* 行内容,由宿主渲染。
|
|
120
|
+
* Row content, rendered by the host.
|
|
121
|
+
*/
|
|
122
|
+
value: ReactNode;
|
|
123
|
+
/**
|
|
124
|
+
* 展示形态:单行、长文本或多行等宽文本。
|
|
125
|
+
* Display form: inline, long text or preformatted text.
|
|
126
|
+
*/
|
|
127
|
+
variant?:
|
|
128
|
+
/**
|
|
129
|
+
* 单行展示。
|
|
130
|
+
* Rendered on a single line.
|
|
131
|
+
*/
|
|
132
|
+
'inline'
|
|
133
|
+
/**
|
|
134
|
+
* 长文本,自动换行。
|
|
135
|
+
* Long text that wraps.
|
|
136
|
+
*/
|
|
137
|
+
| 'long-text'
|
|
138
|
+
/**
|
|
139
|
+
* 多行等宽文本。
|
|
140
|
+
* Multi-line preformatted text.
|
|
141
|
+
*/
|
|
142
|
+
| 'pre';
|
|
143
|
+
}
|
|
144
|
+
/** 通用文本结果。A general text result. */
|
|
145
|
+
export interface TuiTextContent {
|
|
146
|
+
/**
|
|
147
|
+
* 变体标记,固定为 `text`。
|
|
148
|
+
* Variant discriminator, always `text`.
|
|
149
|
+
*/
|
|
150
|
+
variant: 'text';
|
|
151
|
+
/**
|
|
152
|
+
* 文本正文。
|
|
153
|
+
* Text body.
|
|
154
|
+
*/
|
|
155
|
+
text: string;
|
|
156
|
+
/**
|
|
157
|
+
* 文本格式,缺省为 `plain`。
|
|
158
|
+
* Text format; defaults to `plain`.
|
|
159
|
+
*/
|
|
160
|
+
format?: 'plain' | 'markdown';
|
|
161
|
+
}
|
|
162
|
+
/** 检索结果列表。A list of search results. */
|
|
163
|
+
export interface TuiSearchListContent {
|
|
164
|
+
/**
|
|
165
|
+
* 变体标记,固定为 `search-list`。
|
|
166
|
+
* Variant discriminator, always `search-list`.
|
|
167
|
+
*/
|
|
168
|
+
variant: 'search-list';
|
|
169
|
+
/**
|
|
170
|
+
* 结果行。
|
|
171
|
+
* Result rows.
|
|
172
|
+
*/
|
|
173
|
+
items: readonly TuiSearchResultItem[];
|
|
174
|
+
/**
|
|
175
|
+
* 列表上方的汇总信息,由宿主渲染。
|
|
176
|
+
* Summary above the list, rendered by the host.
|
|
177
|
+
*/
|
|
178
|
+
summary?: ReactNode;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* 单个资源的预览结果,例如读取一个文件。
|
|
182
|
+
*
|
|
183
|
+
* A preview of one resource, for example reading a file.
|
|
184
|
+
*/
|
|
185
|
+
export interface TuiResourcePreviewContent {
|
|
186
|
+
/**
|
|
187
|
+
* 变体标记,固定为 `resource-preview`。
|
|
188
|
+
* Variant discriminator, always `resource-preview`.
|
|
189
|
+
*/
|
|
190
|
+
variant: 'resource-preview';
|
|
191
|
+
/**
|
|
192
|
+
* 资源标题。
|
|
193
|
+
* Resource title.
|
|
194
|
+
*/
|
|
195
|
+
title: string;
|
|
196
|
+
/**
|
|
197
|
+
* 正文,通常是文件内容。
|
|
198
|
+
* Body, usually the file content.
|
|
199
|
+
*/
|
|
200
|
+
content: string;
|
|
201
|
+
/**
|
|
202
|
+
* 标题下方的元信息,例如类型与大小,按顺序以分隔符连接展示。
|
|
203
|
+
* Metadata under the title, for example type and size, joined in order.
|
|
204
|
+
*/
|
|
205
|
+
meta?: readonly string[];
|
|
206
|
+
/**
|
|
207
|
+
* 没有 `meta` 时使用的单行说明。
|
|
208
|
+
* Single-line description used when `meta` is absent.
|
|
209
|
+
*/
|
|
210
|
+
description?: string;
|
|
211
|
+
/**
|
|
212
|
+
* 资源自身的 URI,显示为可点击入口。
|
|
213
|
+
* The resource's own URI, rendered as an openable entry.
|
|
214
|
+
*/
|
|
215
|
+
uri?: string;
|
|
216
|
+
/**
|
|
217
|
+
* 点击 URI 时跳转到的位置;省略时使用 `uri`。
|
|
218
|
+
* Where clicking the URI navigates to; `uri` is used when omitted.
|
|
219
|
+
*/
|
|
220
|
+
navigationUri?: string;
|
|
221
|
+
}
|
|
222
|
+
/** 资源树结果。A resource tree result. */
|
|
223
|
+
export interface TuiResourceTreeContent {
|
|
224
|
+
/**
|
|
225
|
+
* 变体标记,固定为 `resource-tree`。
|
|
226
|
+
* Variant discriminator, always `resource-tree`.
|
|
227
|
+
*/
|
|
228
|
+
variant: 'resource-tree';
|
|
229
|
+
/**
|
|
230
|
+
* 资源行。
|
|
231
|
+
* Resource rows.
|
|
232
|
+
*/
|
|
233
|
+
items: readonly TuiResourceTreeItem[];
|
|
234
|
+
/**
|
|
235
|
+
* 卡片标题。
|
|
236
|
+
* Card title.
|
|
237
|
+
*/
|
|
238
|
+
title?: string;
|
|
239
|
+
}
|
|
240
|
+
/** 状态卡片。A status card. */
|
|
241
|
+
export interface TuiStatusContent {
|
|
242
|
+
/**
|
|
243
|
+
* 变体标记,固定为 `status`。
|
|
244
|
+
* Variant discriminator, always `status`.
|
|
245
|
+
*/
|
|
246
|
+
variant: 'status';
|
|
247
|
+
/**
|
|
248
|
+
* 键值行。
|
|
249
|
+
* Key/value rows.
|
|
250
|
+
*/
|
|
251
|
+
rows: readonly TuiStatusRow[];
|
|
252
|
+
/**
|
|
253
|
+
* 卡片标题。
|
|
254
|
+
* Card title.
|
|
255
|
+
*/
|
|
256
|
+
title?: string;
|
|
257
|
+
}
|
|
258
|
+
/** 写入结果。A write result. */
|
|
259
|
+
export interface TuiWriteResultContent {
|
|
260
|
+
/**
|
|
261
|
+
* 变体标记,固定为 `write-result`。
|
|
262
|
+
* Variant discriminator, always `write-result`.
|
|
263
|
+
*/
|
|
264
|
+
variant: 'write-result';
|
|
265
|
+
/**
|
|
266
|
+
* 结果行,由宿主渲染。
|
|
267
|
+
* Result lines, rendered by the host.
|
|
268
|
+
*/
|
|
269
|
+
lines: readonly ReactNode[];
|
|
270
|
+
/**
|
|
271
|
+
* 卡片标题。
|
|
272
|
+
* Card title.
|
|
273
|
+
*/
|
|
274
|
+
title?: string;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* 命令帮助结果:按分组列出可用命令。
|
|
278
|
+
*
|
|
279
|
+
* A command-help result: available commands listed in groups.
|
|
280
|
+
*/
|
|
281
|
+
export interface TuiCommandHelpContent {
|
|
282
|
+
/**
|
|
283
|
+
* 变体标记,固定为 `command-help`。
|
|
284
|
+
* Variant discriminator, always `command-help`.
|
|
285
|
+
*/
|
|
286
|
+
variant: 'command-help';
|
|
287
|
+
/**
|
|
288
|
+
* 命令分组。
|
|
289
|
+
* Command groups.
|
|
290
|
+
*/
|
|
291
|
+
sections: readonly TuiCommandHelpSection[];
|
|
292
|
+
}
|
|
293
|
+
/** 命令帮助中的一组命令。One group of commands in the help result. */
|
|
294
|
+
export interface TuiCommandHelpSection {
|
|
295
|
+
/**
|
|
296
|
+
* 分组唯一标识。
|
|
297
|
+
* Unique section key.
|
|
298
|
+
*/
|
|
299
|
+
key: string;
|
|
300
|
+
/**
|
|
301
|
+
* 分组标题。
|
|
302
|
+
* Section title.
|
|
303
|
+
*/
|
|
304
|
+
label: string;
|
|
305
|
+
/**
|
|
306
|
+
* 该组下的命令。
|
|
307
|
+
* Commands in this group.
|
|
308
|
+
*/
|
|
309
|
+
items: readonly TuiCommandHelpItem[];
|
|
310
|
+
}
|
|
311
|
+
/** 命令帮助中的一条命令。One command in the help result. */
|
|
312
|
+
export interface TuiCommandHelpItem {
|
|
313
|
+
/**
|
|
314
|
+
* 命令唯一标识。
|
|
315
|
+
* Unique command key.
|
|
316
|
+
*/
|
|
317
|
+
key: string;
|
|
318
|
+
/**
|
|
319
|
+
* 命令名,包含开头的斜杠。
|
|
320
|
+
* Command name including the leading slash.
|
|
321
|
+
*/
|
|
322
|
+
name: string;
|
|
323
|
+
/**
|
|
324
|
+
* 命令说明。
|
|
325
|
+
* Command description.
|
|
326
|
+
*/
|
|
327
|
+
description?: string;
|
|
328
|
+
}
|
|
329
|
+
/** 命令结果内容。Command result content. */
|
|
330
|
+
export type TuiRecordContent = TuiTextContent | TuiSearchListContent | TuiResourcePreviewContent | TuiResourceTreeContent | TuiStatusContent | TuiWriteResultContent | TuiCommandHelpContent;
|
|
331
|
+
/** 一条执行记录。One execution record. */
|
|
332
|
+
export interface TuiRecord {
|
|
333
|
+
/**
|
|
334
|
+
* 记录唯一标识。
|
|
335
|
+
* Unique record key.
|
|
336
|
+
*/
|
|
337
|
+
id: string;
|
|
338
|
+
/**
|
|
339
|
+
* 提交的命令文本,显示在结果上方。
|
|
340
|
+
* The submitted command text, echoed above the result.
|
|
341
|
+
*/
|
|
342
|
+
command: string;
|
|
343
|
+
/**
|
|
344
|
+
* 当前记录的执行状态;不控制其他命令的提交。
|
|
345
|
+
* Execution status of this record; does not control other submissions.
|
|
346
|
+
*/
|
|
347
|
+
status: TuiRecordStatus;
|
|
348
|
+
/**
|
|
349
|
+
* 执行结果,进行中时省略。
|
|
350
|
+
* Execution result, omitted while pending.
|
|
351
|
+
*/
|
|
352
|
+
content?: TuiRecordContent;
|
|
353
|
+
/**
|
|
354
|
+
* 记录头部的展示时间。
|
|
355
|
+
* Timestamp rendered in the record header.
|
|
356
|
+
*/
|
|
357
|
+
createdAt?: string;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* 可替换的界面文案,默认英文。
|
|
361
|
+
* Replaceable interface copy, defaulting to English.
|
|
362
|
+
*/
|
|
363
|
+
export interface TuiLabels {
|
|
364
|
+
/**
|
|
365
|
+
* 输入框占位文本。
|
|
366
|
+
* Input placeholder.
|
|
367
|
+
*/
|
|
368
|
+
placeholder?: string;
|
|
369
|
+
/**
|
|
370
|
+
* `disabled` 为 `true` 时展示的不可用提示;文案本身不控制禁用状态。
|
|
371
|
+
* Unavailable message shown when `disabled` is `true`; copy does not control
|
|
372
|
+
* the disabled state.
|
|
373
|
+
*/
|
|
374
|
+
unavailableMessage?: string;
|
|
375
|
+
/**
|
|
376
|
+
* 发送按钮文案。
|
|
377
|
+
* Send button label.
|
|
378
|
+
*/
|
|
379
|
+
send?: string;
|
|
380
|
+
/**
|
|
381
|
+
* 建议列表的无障碍名称。
|
|
382
|
+
* Accessible name of the suggestion list.
|
|
383
|
+
*/
|
|
384
|
+
suggestions?: string;
|
|
385
|
+
/**
|
|
386
|
+
* 无匹配建议时的提示。
|
|
387
|
+
* Message shown when no suggestion matches.
|
|
388
|
+
*/
|
|
389
|
+
noSuggestions?: string;
|
|
390
|
+
/**
|
|
391
|
+
* 等待中的状态文本。
|
|
392
|
+
* Text for the pending state.
|
|
393
|
+
*/
|
|
394
|
+
pending?: string;
|
|
395
|
+
/**
|
|
396
|
+
* 执行成功状态文本。
|
|
397
|
+
* Text for the success status.
|
|
398
|
+
*/
|
|
399
|
+
success?: string;
|
|
400
|
+
/**
|
|
401
|
+
* 执行失败状态文本。
|
|
402
|
+
* Text for the error status.
|
|
403
|
+
*/
|
|
404
|
+
error?: string;
|
|
405
|
+
/**
|
|
406
|
+
* 复制按钮文案。
|
|
407
|
+
* Copy button label.
|
|
408
|
+
*/
|
|
409
|
+
copy?: string;
|
|
410
|
+
/**
|
|
411
|
+
* 复制成功提示。
|
|
412
|
+
* Message shown after a successful copy.
|
|
413
|
+
*/
|
|
414
|
+
copied?: string;
|
|
415
|
+
/**
|
|
416
|
+
* 无记录时的提示。
|
|
417
|
+
* Message shown when there are no records.
|
|
418
|
+
*/
|
|
419
|
+
empty?: string;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* 当前命令记录、结果与输入区的公开接口;会话、历史面板和外层工具栏由宿主组合。
|
|
423
|
+
* 提供命令补全、参数提示与帮助。
|
|
424
|
+
* Public interface for current command records, results and input. The host
|
|
425
|
+
* composes session controls, history panels and surrounding toolbars separately.
|
|
426
|
+
* Provides command completion, parameter hints and help.
|
|
427
|
+
*/
|
|
428
|
+
export interface TuiProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onCopy' | 'onSubmit'> {
|
|
429
|
+
/**
|
|
430
|
+
* 当前展示的执行记录,按提交顺序排列;会话与历史切换后由宿主更新。
|
|
431
|
+
* Currently displayed execution records in submission order, updated by the
|
|
432
|
+
* host when switching sessions or historical results.
|
|
433
|
+
*/
|
|
434
|
+
records: readonly TuiRecord[];
|
|
435
|
+
/**
|
|
436
|
+
* 受控的输入值。
|
|
437
|
+
* Controlled input value.
|
|
438
|
+
*/
|
|
439
|
+
value: string;
|
|
440
|
+
/**
|
|
441
|
+
* 是否禁用命令输入与提交,缺省为 `false`。
|
|
442
|
+
* 禁用时的提示文案由 `labels.unavailableMessage` 提供。
|
|
443
|
+
* Whether command input and submission are disabled; defaults to `false`.
|
|
444
|
+
* Disabled copy comes from `labels.unavailableMessage`.
|
|
445
|
+
*/
|
|
446
|
+
disabled?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* 无记录时展示的完整空态节点,可包含标题、说明与快捷入口。
|
|
449
|
+
* 省略时展示 `labels.empty`,传 `null` 时隐藏空态内容。
|
|
450
|
+
* Complete empty-state node when there are no records; may include a
|
|
451
|
+
* heading, description and shortcuts. Omission shows `labels.empty`;
|
|
452
|
+
* passing `null` hides empty-state content.
|
|
453
|
+
*/
|
|
454
|
+
emptyState?: ReactNode;
|
|
455
|
+
/**
|
|
456
|
+
* 输入值变化时触发,包括接受补全或参数提示;填入不提交命令。省略时输入框
|
|
457
|
+
* 只读,用于展示历史记录。
|
|
458
|
+
* Invoked when the input changes, including accepted completions and parameter
|
|
459
|
+
* hints; filling the input does not submit a command. Omission makes the input
|
|
460
|
+
* read-only, for showing history.
|
|
461
|
+
*/
|
|
462
|
+
onValueChange?: (value: string) => void;
|
|
463
|
+
/**
|
|
464
|
+
* 命令发送成功后触发,失败时不触发。省略时不能提交命令。
|
|
465
|
+
* Called after a command is sent successfully; not called on failure. Omission
|
|
466
|
+
* disables submission.
|
|
467
|
+
*/
|
|
468
|
+
onSubmit?: (command: string) => void;
|
|
469
|
+
/**
|
|
470
|
+
* 资源成功打开后触发,参数为已打开的资源 URI;失败时不触发。
|
|
471
|
+
* Called after a resource opens successfully, with its URI; not called on failure.
|
|
472
|
+
*/
|
|
473
|
+
onOpenUri?: (uri: string) => void;
|
|
474
|
+
/**
|
|
475
|
+
* 复制成功后触发,参数为已复制的文本;复制失败时不触发。
|
|
476
|
+
* Called after copying succeeds, with the copied text; not called on failure.
|
|
477
|
+
*/
|
|
478
|
+
onCopy?: (text: string) => void;
|
|
479
|
+
/**
|
|
480
|
+
* 统一的界面文案与引导提示;仅替换展示内容,不改变可用性。
|
|
481
|
+
* Interface copy and guidance; replaces display content without changing
|
|
482
|
+
* availability.
|
|
483
|
+
*/
|
|
484
|
+
labels?: TuiLabels;
|
|
485
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tui } from "../3~0.js";
|