@h-ai/ui 1.0.0-beta.20 → 1.0.0-beta.21
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.en.md +24 -0
- package/README.ja.md +24 -0
- package/README.md +24 -0
- package/auto-import.d.ts +1 -0
- package/auto-import.js +1 -0
- package/dist/components/scenes/code/CodeWorkspace.svelte +946 -0
- package/dist/components/scenes/code/CodeWorkspace.svelte.d.ts +21 -0
- package/dist/components/scenes/code/CodeWorkspaceEditor.svelte +737 -0
- package/dist/components/scenes/code/CodeWorkspaceEditor.svelte.d.ts +37 -0
- package/dist/components/scenes/code/CodeWorkspaceGutter.svelte +246 -0
- package/dist/components/scenes/code/CodeWorkspaceGutter.svelte.d.ts +23 -0
- package/dist/components/scenes/code/CodeWorkspaceSearch.svelte +234 -0
- package/dist/components/scenes/code/CodeWorkspaceSearch.svelte.d.ts +23 -0
- package/dist/components/scenes/code/CodeWorkspaceTree.svelte +519 -0
- package/dist/components/scenes/code/CodeWorkspaceTree.svelte.d.ts +26 -0
- package/dist/components/scenes/code/code-editor.d.ts +12 -0
- package/dist/components/scenes/code/code-editor.js +93 -0
- package/dist/components/scenes/code/code-types.d.ts +346 -0
- package/dist/components/scenes/code/code-types.js +1 -0
- package/dist/components/scenes/code/index.d.ts +2 -0
- package/dist/components/scenes/code/index.js +1 -0
- package/dist/components/scenes/code/workers/css.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/css.worker.js +1 -0
- package/dist/components/scenes/code/workers/editor.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/editor.worker.js +1 -0
- package/dist/components/scenes/code/workers/html.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/html.worker.js +1 -0
- package/dist/components/scenes/code/workers/json.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/json.worker.js +1 -0
- package/dist/components/scenes/code/workers/ts.worker.d.ts +1 -0
- package/dist/components/scenes/code/workers/ts.worker.js +1 -0
- package/dist/components/scenes/index.d.ts +1 -0
- package/dist/components/scenes/index.js +2 -0
- package/dist/messages/en-US.json +54 -1
- package/dist/messages/ja-JP.json +54 -1
- package/dist/messages/zh-CN.json +54 -1
- package/package.json +8 -2
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
/**
|
|
3
|
+
* 文件和目录旁的宿主标记。label 提供给辅助技术,text 用于显示简短标记。
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import type { CodeWorkspaceMarker } from '@h-ai/ui/components/scenes/code/index'
|
|
8
|
+
* const marker: CodeWorkspaceMarker = { label: 'Uncommitted changes', text: 'M', tone: 'warning' }
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export interface CodeWorkspaceMarker {
|
|
12
|
+
label: string;
|
|
13
|
+
text?: string;
|
|
14
|
+
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'error';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 目录 ID 在同一个数据源中唯一。
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import type { CodeWorkspaceFolder } from '@h-ai/ui/components/scenes/code/index'
|
|
22
|
+
* const folder: CodeWorkspaceFolder = { kind: 'folder', id: 'src', name: 'src' }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export interface CodeWorkspaceFolder {
|
|
26
|
+
kind: 'folder';
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
markers?: readonly CodeWorkspaceMarker[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* 同一文件 ID 可以对应多个版本,标签按 ID 和版本去重。
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* import type { CodeWorkspaceFileNode } from '@h-ai/ui/components/scenes/code/index'
|
|
37
|
+
* const file: CodeWorkspaceFileNode = { kind: 'file', id: 'src/app.ts', name: 'app.ts', version: 'rev-1' }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export interface CodeWorkspaceFileNode {
|
|
41
|
+
kind: 'file';
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
version?: string;
|
|
45
|
+
markers?: readonly CodeWorkspaceMarker[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 文件树可呈现的节点。
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* import type { CodeWorkspaceNode } from '@h-ai/ui/components/scenes/code/index'
|
|
53
|
+
* const node: CodeWorkspaceNode = { kind: 'file', id: 'readme', name: 'README.md' }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export type CodeWorkspaceNode = CodeWorkspaceFolder | CodeWorkspaceFileNode;
|
|
57
|
+
/**
|
|
58
|
+
* 坐标从 1 开始,列按 UTF-16 计数,结束位置不包含在范围内。起止相同表示一个位置。
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* import type { CodeWorkspaceRange } from '@h-ai/ui/components/scenes/code/index'
|
|
63
|
+
* const firstWord: CodeWorkspaceRange = { startLine: 1, startColumn: 1, endLine: 1, endColumn: 6 }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export interface CodeWorkspaceRange {
|
|
67
|
+
startLine: number;
|
|
68
|
+
startColumn: number;
|
|
69
|
+
endLine: number;
|
|
70
|
+
endColumn: number;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* 代码文件随内容加载的行或范围标注。
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* import type { CodeWorkspaceAnnotation } from '@h-ai/ui/components/scenes/code/index'
|
|
78
|
+
* const annotation: CodeWorkspaceAnnotation = {
|
|
79
|
+
* label: 'Local changes',
|
|
80
|
+
* range: { startLine: 4, startColumn: 1, endLine: 5, endColumn: 1 },
|
|
81
|
+
* tone: 'info',
|
|
82
|
+
* hoverText: 'This line has uncommitted changes.',
|
|
83
|
+
* }
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export interface CodeWorkspaceAnnotation {
|
|
87
|
+
range: CodeWorkspaceRange;
|
|
88
|
+
label: string;
|
|
89
|
+
tone?: CodeWorkspaceMarker['tone'];
|
|
90
|
+
display?: 'gutter' | 'range' | 'both';
|
|
91
|
+
/** 在标注起始行显示图标与纯文本浮层,仅适用于含行前标记的标注。 */
|
|
92
|
+
hoverText?: string;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* 行前图标和浮层收到的当前文件及标注。
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* import type { CodeWorkspaceAnnotationContext } from '@h-ai/ui/components/scenes/code/index'
|
|
100
|
+
* function tooltip({ file, annotation }: CodeWorkspaceAnnotationContext) {
|
|
101
|
+
* return file.node.name + ': ' + (annotation.hoverText ?? annotation.label)
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export interface CodeWorkspaceAnnotationContext {
|
|
106
|
+
file: CodeWorkspaceFile;
|
|
107
|
+
annotation: CodeWorkspaceAnnotation;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 读取文件返回的文档,可指定 Monaco 语言 ID,例如 typescript。
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* import type { CodeWorkspaceFileContent } from '@h-ai/ui/components/scenes/code/index'
|
|
115
|
+
* const content: CodeWorkspaceFileContent = { text: 'export const value = 1', language: 'typescript' }
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
export interface CodeWorkspaceFileContent {
|
|
119
|
+
text: string;
|
|
120
|
+
language?: string;
|
|
121
|
+
version?: string;
|
|
122
|
+
annotations?: readonly CodeWorkspaceAnnotation[];
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* 提供给宿主界面的当前文档。
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* ```ts
|
|
129
|
+
* import type { CodeWorkspaceFile } from '@h-ai/ui/components/scenes/code/index'
|
|
130
|
+
* const file: CodeWorkspaceFile = {
|
|
131
|
+
* node: { kind: 'file', id: 'readme', name: 'README.md' },
|
|
132
|
+
* text: '# Getting started',
|
|
133
|
+
* language: 'markdown',
|
|
134
|
+
* }
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
export interface CodeWorkspaceFile extends CodeWorkspaceFileContent {
|
|
138
|
+
node: CodeWorkspaceFileNode;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* 工作区搜索请求。cursor 是数据源上一次返回的分页游标。
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* import type { CodeWorkspaceSearchQuery } from '@h-ai/ui/components/scenes/code/index'
|
|
146
|
+
* const query: CodeWorkspaceSearchQuery = { mode: 'content', query: 'summarize', cursor: 'page-2' }
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export interface CodeWorkspaceSearchQuery {
|
|
150
|
+
mode: 'files' | 'content';
|
|
151
|
+
query: string;
|
|
152
|
+
cursor?: string;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* 工作区命中。目录链从根下第一个目录到父目录,range 对应 node.version。
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* import type { CodeWorkspaceSearchHit } from '@h-ai/ui/components/scenes/code/index'
|
|
160
|
+
* const hit: CodeWorkspaceSearchHit = {
|
|
161
|
+
* node: { kind: 'file', id: 'readme', name: 'README.md', version: 'rev-1' },
|
|
162
|
+
* range: { startLine: 1, startColumn: 3, endLine: 1, endColumn: 8 },
|
|
163
|
+
* preview: '# Hello',
|
|
164
|
+
* }
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
export interface CodeWorkspaceSearchHit {
|
|
168
|
+
node: CodeWorkspaceFileNode;
|
|
169
|
+
ancestors?: readonly CodeWorkspaceFolder[];
|
|
170
|
+
range?: CodeWorkspaceRange;
|
|
171
|
+
preview?: string;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* 工作区搜索结果。省略 nextCursor 表示已到末页。
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```ts
|
|
178
|
+
* import type { CodeWorkspaceSearchPage } from '@h-ai/ui/components/scenes/code/index'
|
|
179
|
+
* const page: CodeWorkspaceSearchPage = { hits: [], nextCursor: 'page-2' }
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
export interface CodeWorkspaceSearchPage {
|
|
183
|
+
hits: readonly CodeWorkspaceSearchHit[];
|
|
184
|
+
nextCursor?: string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* 工作区的读取能力。保持对象引用稳定,切换仓库或分支时替换整个对象。
|
|
188
|
+
* 宿主负责授权和搜索索引,回调可返回数据或 Promise,失败时抛错或拒绝。
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* import type { CodeWorkspaceSource } from '@h-ai/ui/components/scenes/code/index'
|
|
193
|
+
* const source: CodeWorkspaceSource = {
|
|
194
|
+
* listChildren: () => [{ kind: 'file', id: 'readme', name: 'README.md' }],
|
|
195
|
+
* readFile: () => ({ text: '# Hello' }),
|
|
196
|
+
* }
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
export interface CodeWorkspaceSource {
|
|
200
|
+
/** parent 为 null 时读取根节点。 */
|
|
201
|
+
listChildren: (parent: CodeWorkspaceFolder | null, signal: AbortSignal) => readonly CodeWorkspaceNode[] | Promise<readonly CodeWorkspaceNode[]>;
|
|
202
|
+
readFile: (node: CodeWorkspaceFileNode, signal: AbortSignal) => CodeWorkspaceFileContent | Promise<CodeWorkspaceFileContent>;
|
|
203
|
+
search?: (query: CodeWorkspaceSearchQuery, signal: AbortSignal) => CodeWorkspaceSearchPage | Promise<CodeWorkspaceSearchPage>;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* 编辑区的初始显示选项,使用者可在工作区内切换。
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```ts
|
|
210
|
+
* import type { CodeWorkspaceDisplay } from '@h-ai/ui/components/scenes/code/index'
|
|
211
|
+
* const display: CodeWorkspaceDisplay = { lineNumbers: 'relative', minimap: false }
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
export interface CodeWorkspaceDisplay {
|
|
215
|
+
lineNumbers?: boolean | 'relative';
|
|
216
|
+
minimap?: boolean;
|
|
217
|
+
breadcrumbs?: boolean;
|
|
218
|
+
wordWrap?: boolean;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* 可作为自定义主题基础的预设。
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* ```ts
|
|
225
|
+
* import type { CodeWorkspaceThemeBase } from '@h-ai/ui/components/scenes/code/index'
|
|
226
|
+
* const base: CodeWorkspaceThemeBase = 'hc-dark'
|
|
227
|
+
* ```
|
|
228
|
+
*/
|
|
229
|
+
export type CodeWorkspaceThemeBase = 'vs-light' | 'vs-dark' | 'hc-light' | 'hc-dark';
|
|
230
|
+
/**
|
|
231
|
+
* Monaco 编辑区主题。同一页面中的 Monaco 实例共用主题。
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```ts
|
|
235
|
+
* import type { CodeWorkspaceTheme } from '@h-ai/ui/components/scenes/code/index'
|
|
236
|
+
* const theme: CodeWorkspaceTheme = {
|
|
237
|
+
* base: 'vs-dark',
|
|
238
|
+
* colors: { 'editor.background': '#121820' },
|
|
239
|
+
* }
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
export type CodeWorkspaceTheme = 'inherit' | CodeWorkspaceThemeBase | 'github-dark' | {
|
|
243
|
+
base: CodeWorkspaceThemeBase;
|
|
244
|
+
colors?: Readonly<Record<string, string>>;
|
|
245
|
+
tokens?: readonly {
|
|
246
|
+
token: string;
|
|
247
|
+
foreground?: string;
|
|
248
|
+
background?: string;
|
|
249
|
+
fontStyle?: string;
|
|
250
|
+
}[];
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* 当前文件的主要选区。
|
|
254
|
+
*
|
|
255
|
+
* @example
|
|
256
|
+
* ```ts
|
|
257
|
+
* import type { CodeWorkspaceSelection } from '@h-ai/ui/components/scenes/code/index'
|
|
258
|
+
* const selection: CodeWorkspaceSelection = {
|
|
259
|
+
* text: 'const',
|
|
260
|
+
* range: { startLine: 1, startColumn: 1, endLine: 1, endColumn: 6 },
|
|
261
|
+
* }
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
export interface CodeWorkspaceSelection {
|
|
265
|
+
range: CodeWorkspaceRange;
|
|
266
|
+
text: string;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* 编辑器内部传递的文件与选区快照。
|
|
270
|
+
*
|
|
271
|
+
* @example 模块内部上下文
|
|
272
|
+
* ```ts
|
|
273
|
+
* function selectedText(context: CodeWorkspaceSelectionContext) {
|
|
274
|
+
* return context.selection.text
|
|
275
|
+
* }
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
278
|
+
export interface CodeWorkspaceSelectionContext {
|
|
279
|
+
file: CodeWorkspaceFile;
|
|
280
|
+
selection: CodeWorkspaceSelection;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* 右侧检查区的渲染上下文。reveal 仅对生成该上下文的文档生效。
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* import type { CodeWorkspaceInspectorContext } from '@h-ai/ui/components/scenes/code/index'
|
|
288
|
+
* function revealFirstAnnotation(context: CodeWorkspaceInspectorContext) {
|
|
289
|
+
* const first = context.file.annotations?.[0]
|
|
290
|
+
* if (first)
|
|
291
|
+
* context.reveal(first.range)
|
|
292
|
+
* }
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
export interface CodeWorkspaceInspectorContext {
|
|
296
|
+
file: CodeWorkspaceFile;
|
|
297
|
+
selection: CodeWorkspaceSelection | null;
|
|
298
|
+
reveal: (range: CodeWorkspaceRange) => void;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* 浮动操作的渲染上下文。
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* ```ts
|
|
305
|
+
* import type { CodeWorkspaceActionContext } from '@h-ai/ui/components/scenes/code/index'
|
|
306
|
+
* function inspectSelection({ selection, openInspector }: CodeWorkspaceActionContext) {
|
|
307
|
+
* if (selection.text.trim())
|
|
308
|
+
* openInspector()
|
|
309
|
+
* }
|
|
310
|
+
* ```
|
|
311
|
+
*/
|
|
312
|
+
export interface CodeWorkspaceActionContext extends CodeWorkspaceSelectionContext {
|
|
313
|
+
reveal: (range: CodeWorkspaceRange) => void;
|
|
314
|
+
openInspector: () => void;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* CodeWorkspace 的参数。只需传入 source 即可浏览文件,按需接入搜索和自定义内容。
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```ts
|
|
321
|
+
* import type { CodeWorkspaceProps } from '@h-ai/ui/components/scenes/code/index'
|
|
322
|
+
* const props: CodeWorkspaceProps = {
|
|
323
|
+
* source: {
|
|
324
|
+
* listChildren: () => [{ kind: 'file', id: 'hello', name: 'hello.ts' }],
|
|
325
|
+
* readFile: () => ({ text: 'export const hello = 1', language: 'typescript' }),
|
|
326
|
+
* },
|
|
327
|
+
* }
|
|
328
|
+
* ```
|
|
329
|
+
*/
|
|
330
|
+
export interface CodeWorkspaceProps {
|
|
331
|
+
source: CodeWorkspaceSource;
|
|
332
|
+
initialFile?: CodeWorkspaceFileNode;
|
|
333
|
+
initialAncestors?: readonly CodeWorkspaceFolder[];
|
|
334
|
+
options?: CodeWorkspaceDisplay;
|
|
335
|
+
theme?: CodeWorkspaceTheme;
|
|
336
|
+
inspector?: Snippet<[CodeWorkspaceInspectorContext]>;
|
|
337
|
+
/** 自定义行前图标。使用装饰性内容,图标按钮的名称来自标注 label。 */
|
|
338
|
+
annotationIcon?: Snippet<[CodeWorkspaceAnnotationContext]>;
|
|
339
|
+
/** 自定义行前浮层。可以包含按钮、链接或其他可交互组件。 */
|
|
340
|
+
annotationHover?: Snippet<[CodeWorkspaceAnnotationContext]>;
|
|
341
|
+
selectionActions?: Snippet<[CodeWorkspaceActionContext]>;
|
|
342
|
+
/** 工作区容器高度,默认 38rem。 */
|
|
343
|
+
height?: string;
|
|
344
|
+
label?: string;
|
|
345
|
+
class?: string;
|
|
346
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type { CodeWorkspaceActionContext, CodeWorkspaceAnnotation, CodeWorkspaceAnnotationContext, CodeWorkspaceDisplay, CodeWorkspaceFile, CodeWorkspaceFileContent, CodeWorkspaceFileNode, CodeWorkspaceFolder, CodeWorkspaceInspectorContext, CodeWorkspaceMarker, CodeWorkspaceNode, CodeWorkspaceProps, CodeWorkspaceRange, CodeWorkspaceSearchHit, CodeWorkspaceSearchPage, CodeWorkspaceSearchQuery, CodeWorkspaceSelection, CodeWorkspaceSource, CodeWorkspaceTheme, CodeWorkspaceThemeBase, } from './code-types.js';
|
|
2
|
+
export { default as CodeWorkspace } from './CodeWorkspace.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CodeWorkspace } from './CodeWorkspace.svelte';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/language/css/css.worker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/language/css/css.worker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/editor/editor.worker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/editor/editor.worker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/language/html/html.worker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/language/html/html.worker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/language/json/json.worker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/language/json/json.worker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/language/typescript/ts.worker.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'monaco-editor/language/typescript/ts.worker.js';
|
package/dist/messages/en-US.json
CHANGED
|
@@ -525,5 +525,58 @@
|
|
|
525
525
|
"chart_retry": "Refresh page to retry",
|
|
526
526
|
"metric_increase": "Increase",
|
|
527
527
|
"metric_decrease": "Decrease",
|
|
528
|
-
"metric_unchanged": "Unchanged"
|
|
528
|
+
"metric_unchanged": "Unchanged",
|
|
529
|
+
"code_workspace": "Code workspace",
|
|
530
|
+
"code_tree": "Workspace files",
|
|
531
|
+
"code_treeLoading": "Loading file tree…",
|
|
532
|
+
"code_treeFolderLoading": "Loading {name}…",
|
|
533
|
+
"code_treeFolderFailed": "Could not load {name}",
|
|
534
|
+
"code_treeFolderReady": "{name} loaded",
|
|
535
|
+
"code_treeEmpty": "No files",
|
|
536
|
+
"code_treeFailed": "Could not load file tree",
|
|
537
|
+
"code_fileTree": "File tree",
|
|
538
|
+
"code_findFiles": "Find files",
|
|
539
|
+
"code_searchContent": "Search content",
|
|
540
|
+
"code_searchPlaceholderFiles": "Search by name or path",
|
|
541
|
+
"code_searchPlaceholderContent": "Search workspace content",
|
|
542
|
+
"code_searchLoading": "Searching…",
|
|
543
|
+
"code_searchFailed": "Search failed",
|
|
544
|
+
"code_searchEmpty": "No matches",
|
|
545
|
+
"code_searchCount": "{count} matches shown",
|
|
546
|
+
"code_more": "Load more",
|
|
547
|
+
"code_inspector": "Code inspector",
|
|
548
|
+
"code_noFile": "Open a file from the file tree or search results.",
|
|
549
|
+
"code_fileLoading": "Loading file…",
|
|
550
|
+
"code_fileFailed": "Could not load file",
|
|
551
|
+
"code_staleLocation": "The file version changed. Search again to locate the match.",
|
|
552
|
+
"code_tabs": "Open files",
|
|
553
|
+
"code_closeFile": "Close {name}",
|
|
554
|
+
"code_close": "Close",
|
|
555
|
+
"code_retry": "Retry",
|
|
556
|
+
"code_find": "Find in file",
|
|
557
|
+
"code_goto": "Go to line",
|
|
558
|
+
"code_lineNumber": "Line {line}",
|
|
559
|
+
"code_editor": "Code editor",
|
|
560
|
+
"code_editorLoading": "Loading editor…",
|
|
561
|
+
"code_editorFallback": "Showing the plain text view.",
|
|
562
|
+
"code_selectionActions": "Selection actions",
|
|
563
|
+
"code_display": "Display options",
|
|
564
|
+
"code_lineNumbers": "Line numbers",
|
|
565
|
+
"code_minimap": "Minimap",
|
|
566
|
+
"code_breadcrumbs": "Breadcrumbs",
|
|
567
|
+
"code_wordWrap": "Word wrap",
|
|
568
|
+
"code_theme": "Editor theme",
|
|
569
|
+
"code_themeInherit": "Follow application",
|
|
570
|
+
"code_themeLight": "Light",
|
|
571
|
+
"code_themeDark": "Dark",
|
|
572
|
+
"code_themeHighContrastLight": "High contrast light",
|
|
573
|
+
"code_themeHighContrastDark": "High contrast dark",
|
|
574
|
+
"code_themeGithubDark": "GitHub Dark",
|
|
575
|
+
"code_themeCustom": "Custom theme",
|
|
576
|
+
"code_resizeTree": "Resize file explorer",
|
|
577
|
+
"code_resizeInspector": "Resize inspector",
|
|
578
|
+
"code_explorer": "File explorer",
|
|
579
|
+
"code_readOnly": "Read-only",
|
|
580
|
+
"code_root": "Root folder",
|
|
581
|
+
"code_searchMatch": "{name}, line {line}, column {column}"
|
|
529
582
|
}
|
package/dist/messages/ja-JP.json
CHANGED
|
@@ -525,5 +525,58 @@
|
|
|
525
525
|
"chart_retry": "ページを更新して再試行",
|
|
526
526
|
"metric_increase": "増加",
|
|
527
527
|
"metric_decrease": "減少",
|
|
528
|
-
"metric_unchanged": "変化なし"
|
|
528
|
+
"metric_unchanged": "変化なし",
|
|
529
|
+
"code_workspace": "コードワークスペース",
|
|
530
|
+
"code_tree": "ワークスペースのファイル",
|
|
531
|
+
"code_treeLoading": "ファイルツリーを読み込み中…",
|
|
532
|
+
"code_treeFolderLoading": "{name} を読み込み中…",
|
|
533
|
+
"code_treeFolderFailed": "{name} を読み込めませんでした",
|
|
534
|
+
"code_treeFolderReady": "{name} を読み込みました",
|
|
535
|
+
"code_treeEmpty": "ファイルがありません",
|
|
536
|
+
"code_treeFailed": "ファイルツリーを読み込めませんでした",
|
|
537
|
+
"code_fileTree": "ファイルツリー",
|
|
538
|
+
"code_findFiles": "ファイルを探す",
|
|
539
|
+
"code_searchContent": "内容を検索",
|
|
540
|
+
"code_searchPlaceholderFiles": "ファイル名またはパスで検索",
|
|
541
|
+
"code_searchPlaceholderContent": "ワークスペースの内容を検索",
|
|
542
|
+
"code_searchLoading": "検索中…",
|
|
543
|
+
"code_searchFailed": "検索できませんでした",
|
|
544
|
+
"code_searchEmpty": "一致する結果がありません",
|
|
545
|
+
"code_searchCount": "{count} 件の一致を表示",
|
|
546
|
+
"code_more": "さらに表示",
|
|
547
|
+
"code_inspector": "コードインスペクター",
|
|
548
|
+
"code_noFile": "ファイルツリーまたは検索結果からファイルを開いてください。",
|
|
549
|
+
"code_fileLoading": "ファイルを読み込み中…",
|
|
550
|
+
"code_fileFailed": "ファイルを読み込めませんでした",
|
|
551
|
+
"code_staleLocation": "ファイルのバージョンが変わりました。位置を確認するには再検索してください。",
|
|
552
|
+
"code_tabs": "開いているファイル",
|
|
553
|
+
"code_closeFile": "{name} を閉じる",
|
|
554
|
+
"code_close": "閉じる",
|
|
555
|
+
"code_retry": "再試行",
|
|
556
|
+
"code_find": "ファイル内を検索",
|
|
557
|
+
"code_goto": "行へ移動",
|
|
558
|
+
"code_lineNumber": "{line} 行目",
|
|
559
|
+
"code_editor": "コードエディター",
|
|
560
|
+
"code_editorLoading": "エディターを読み込み中…",
|
|
561
|
+
"code_editorFallback": "プレーンテキストビューを表示しています。",
|
|
562
|
+
"code_selectionActions": "選択範囲の操作",
|
|
563
|
+
"code_display": "表示オプション",
|
|
564
|
+
"code_lineNumbers": "行番号",
|
|
565
|
+
"code_minimap": "ミニマップ",
|
|
566
|
+
"code_breadcrumbs": "パンくずリスト",
|
|
567
|
+
"code_wordWrap": "折り返し",
|
|
568
|
+
"code_theme": "エディターテーマ",
|
|
569
|
+
"code_themeInherit": "アプリに合わせる",
|
|
570
|
+
"code_themeLight": "ライト",
|
|
571
|
+
"code_themeDark": "ダーク",
|
|
572
|
+
"code_themeHighContrastLight": "高コントラストライト",
|
|
573
|
+
"code_themeHighContrastDark": "高コントラストダーク",
|
|
574
|
+
"code_themeGithubDark": "GitHub Dark",
|
|
575
|
+
"code_themeCustom": "カスタムテーマ",
|
|
576
|
+
"code_resizeTree": "ファイルエクスプローラーの幅を変更",
|
|
577
|
+
"code_resizeInspector": "インスペクターの幅を変更",
|
|
578
|
+
"code_explorer": "ファイルエクスプローラー",
|
|
579
|
+
"code_readOnly": "読み取り専用",
|
|
580
|
+
"code_root": "ルートフォルダー",
|
|
581
|
+
"code_searchMatch": "{name}、{line} 行 {column} 列"
|
|
529
582
|
}
|
package/dist/messages/zh-CN.json
CHANGED
|
@@ -525,5 +525,58 @@
|
|
|
525
525
|
"chart_retry": "刷新页面重试",
|
|
526
526
|
"metric_increase": "上升",
|
|
527
527
|
"metric_decrease": "下降",
|
|
528
|
-
"metric_unchanged": "持平"
|
|
528
|
+
"metric_unchanged": "持平",
|
|
529
|
+
"code_workspace": "代码工作区",
|
|
530
|
+
"code_tree": "工作区文件",
|
|
531
|
+
"code_treeLoading": "正在加载文件树…",
|
|
532
|
+
"code_treeFolderLoading": "正在加载 {name}…",
|
|
533
|
+
"code_treeFolderFailed": "无法加载 {name}",
|
|
534
|
+
"code_treeFolderReady": "{name} 已加载",
|
|
535
|
+
"code_treeEmpty": "没有文件",
|
|
536
|
+
"code_treeFailed": "无法加载文件树",
|
|
537
|
+
"code_fileTree": "文件树",
|
|
538
|
+
"code_findFiles": "找文件",
|
|
539
|
+
"code_searchContent": "搜内容",
|
|
540
|
+
"code_searchPlaceholderFiles": "搜索文件名或路径",
|
|
541
|
+
"code_searchPlaceholderContent": "搜索工作区内容",
|
|
542
|
+
"code_searchLoading": "正在搜索…",
|
|
543
|
+
"code_searchFailed": "搜索失败",
|
|
544
|
+
"code_searchEmpty": "没有匹配结果",
|
|
545
|
+
"code_searchCount": "已显示 {count} 个匹配",
|
|
546
|
+
"code_more": "加载更多",
|
|
547
|
+
"code_inspector": "代码检查区",
|
|
548
|
+
"code_noFile": "从文件树或搜索结果打开文件。",
|
|
549
|
+
"code_fileLoading": "正在读取文件…",
|
|
550
|
+
"code_fileFailed": "无法读取文件",
|
|
551
|
+
"code_staleLocation": "文件版本已变化,请重新搜索以定位。",
|
|
552
|
+
"code_tabs": "已打开的文件",
|
|
553
|
+
"code_closeFile": "关闭 {name}",
|
|
554
|
+
"code_close": "关闭",
|
|
555
|
+
"code_retry": "重试",
|
|
556
|
+
"code_find": "在当前文件查找",
|
|
557
|
+
"code_goto": "跳转到行",
|
|
558
|
+
"code_lineNumber": "第 {line} 行",
|
|
559
|
+
"code_editor": "代码编辑区",
|
|
560
|
+
"code_editorLoading": "正在加载编辑器…",
|
|
561
|
+
"code_editorFallback": "当前使用纯文本视图。",
|
|
562
|
+
"code_selectionActions": "选区操作",
|
|
563
|
+
"code_display": "显示选项",
|
|
564
|
+
"code_lineNumbers": "行号",
|
|
565
|
+
"code_minimap": "缩略图",
|
|
566
|
+
"code_breadcrumbs": "面包屑",
|
|
567
|
+
"code_wordWrap": "自动换行",
|
|
568
|
+
"code_theme": "编辑区主题",
|
|
569
|
+
"code_themeInherit": "跟随应用",
|
|
570
|
+
"code_themeLight": "亮色",
|
|
571
|
+
"code_themeDark": "暗色",
|
|
572
|
+
"code_themeHighContrastLight": "高对比亮色",
|
|
573
|
+
"code_themeHighContrastDark": "高对比暗色",
|
|
574
|
+
"code_themeGithubDark": "GitHub Dark",
|
|
575
|
+
"code_themeCustom": "自定义主题",
|
|
576
|
+
"code_resizeTree": "调整资源管理器宽度",
|
|
577
|
+
"code_resizeInspector": "调整检查区宽度",
|
|
578
|
+
"code_explorer": "资源管理器",
|
|
579
|
+
"code_readOnly": "只读",
|
|
580
|
+
"code_root": "根目录",
|
|
581
|
+
"code_searchMatch": "{name} 第 {line} 行第 {column} 列"
|
|
529
582
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-ai/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-beta.
|
|
4
|
+
"version": "1.0.0-beta.21",
|
|
5
5
|
"description": "Hai Framework UI component library for Svelte 5 Runes.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"svelte": "./dist/index.js",
|
|
@@ -68,6 +68,11 @@
|
|
|
68
68
|
"svelte": "./dist/components/scenes/charts/index.js",
|
|
69
69
|
"import": "./dist/components/scenes/charts/index.js"
|
|
70
70
|
},
|
|
71
|
+
"./components/scenes/code/index": {
|
|
72
|
+
"types": "./dist/components/scenes/code/index.d.ts",
|
|
73
|
+
"svelte": "./dist/components/scenes/code/index.js",
|
|
74
|
+
"import": "./dist/components/scenes/code/index.js"
|
|
75
|
+
},
|
|
71
76
|
"./components/scenes/crud/index": {
|
|
72
77
|
"types": "./dist/components/scenes/crud/index.d.ts",
|
|
73
78
|
"svelte": "./dist/components/scenes/crud/index.js",
|
|
@@ -124,7 +129,7 @@
|
|
|
124
129
|
"svelte": "^5.57.3"
|
|
125
130
|
},
|
|
126
131
|
"dependencies": {
|
|
127
|
-
"@h-ai/core": "1.0.0-beta.
|
|
132
|
+
"@h-ai/core": "1.0.0-beta.21",
|
|
128
133
|
"@internationalized/date": "^3.12.4",
|
|
129
134
|
"@rrweb/replay": "^2.2.1",
|
|
130
135
|
"@shikijs/langs": "^4.6.0",
|
|
@@ -136,6 +141,7 @@
|
|
|
136
141
|
"layerchart": "2.9.2",
|
|
137
142
|
"marked": "^18.1.3",
|
|
138
143
|
"mermaid": "^12.3.0",
|
|
144
|
+
"monaco-editor": "0.57.0",
|
|
139
145
|
"shiki": "^4.6.0",
|
|
140
146
|
"tailwind-merge": "^3.7.0"
|
|
141
147
|
},
|