@h-ai/cli 0.1.0-alpha.29 → 0.1.0-alpha.31
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-ai/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-alpha.
|
|
4
|
+
"version": "0.1.0-alpha.31",
|
|
5
5
|
"description": "Hai Framework CLI for project scaffolding and code generation.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"keywords": [
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"ora": "^9.1.0",
|
|
35
35
|
"prompts": "^2.4.2",
|
|
36
36
|
"yaml": "^2.7.0",
|
|
37
|
-
"@h-ai/core": "0.1.0-alpha.
|
|
37
|
+
"@h-ai/core": "0.1.0-alpha.31"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "{{projectName}}",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.31",
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "{{#if_eq appType 'admin'}}Enterprise management system built with hai Agent Framework{{/if_eq}}{{#if_eq appType 'website'}}Enterprise website built with hai Agent Framework{{/if_eq}}{{#if_eq appType 'h5'}}Mobile H5 app built with hai Agent Framework{{/if_eq}}{{#if_eq appType 'api'}}REST API service built with hai Agent Framework{{/if_eq}}{{#if_eq appType 'mobile-app'}}Mobile app built with hai Agent Framework{{/if_eq}}",
|
|
6
6
|
"keywords": ["hai", {{#unless isSvelteOnlyApp}}"sveltekit", {{/unless}}"svelte5", "{{appType}}"],
|
|
@@ -384,9 +384,9 @@ const p = usePlatform()
|
|
|
384
384
|
|
|
385
385
|
| 组件 | 说明 |
|
|
386
386
|
| -------------------- | --------------------------------- |
|
|
387
|
-
| `MarkdownRenderer` | Markdown 渲染(内置 Shiki
|
|
387
|
+
| `MarkdownRenderer` | Markdown 渲染(内置 Shiki 高亮,支持 `fontSize` / `allowHtmlTags`) |
|
|
388
388
|
| `AiDocumentDownloadMenu` | AI 文档下载菜单 |
|
|
389
|
-
| `AiDocumentEditor` | AI 文档编辑器(支持 Mermaid
|
|
389
|
+
| `AiDocumentEditor` | AI 文档编辑器(支持 Mermaid、受控代码预览,以及 `fontSize` / `allowHtmlTags`) |
|
|
390
390
|
| `AiTableEditor` | AI 表格编辑器 |
|
|
391
391
|
|
|
392
392
|
> AI 场景组件使用 Shiki(纯 ESM)进行代码高亮,支持 27 种语言,通过 CSS 变量 `--hai-hl-*` 自定义颜色。无需额外安装 Shiki,已内置。`AiDocumentEditor` 默认只允许 Markdown 内置预览;HTML / JS / CSS 等高风险预览需要显式启用 `allowUnsafeCodePreview`,或通过 `oncoderun` 返回受控的预览结果。
|
|
@@ -395,6 +395,23 @@ const p = usePlatform()
|
|
|
395
395
|
> - `sourceKind='document'` 时,文档中的 ```` ```mermaid ```` 代码块会在阅读态自动渲染为图表;
|
|
396
396
|
> - `sourceKind='code'` + `showCodePreviewToggle` 时,可在「代码 / 预览」之间切换查看 Mermaid 图表;
|
|
397
397
|
> - Mermaid 以 `securityLevel: 'strict'` 渲染为消毒后的 SVG,无需开启 `allowUnsafeCodePreview`。
|
|
398
|
+
>
|
|
399
|
+
> 展示层还支持:
|
|
400
|
+
> - `fontSize`:支持 `number`(按 px)或 CSS 长度字符串(如 `1.125rem`)
|
|
401
|
+
> - `allowHtmlTags`:默认关闭;开启后按安全白名单解析 `<b>` / `<i>` / `<u>` / `<mark>` 等标签,危险标签与属性仍会被消毒
|
|
402
|
+
|
|
403
|
+
```svelte
|
|
404
|
+
<MarkdownRenderer content={markdown} fontSize='1.125rem' allowHtmlTags />
|
|
405
|
+
|
|
406
|
+
<AiDocumentEditor
|
|
407
|
+
title="方案文档"
|
|
408
|
+
content={documentMarkdown}
|
|
409
|
+
fontSize={18}
|
|
410
|
+
allowHtmlTags
|
|
411
|
+
showToolbar
|
|
412
|
+
showOutline={false}
|
|
413
|
+
/>
|
|
414
|
+
```
|
|
398
415
|
|
|
399
416
|
#### CRUD 场景组件
|
|
400
417
|
|
|
@@ -539,6 +556,7 @@ typescript, javascript, python, java, go, rust, c, cpp, csharp, ruby, php, swift
|
|
|
539
556
|
5. **移动端样式**:务必引入 `design-tokens.css` + `mobile.css`,使用 SafeArea 包裹原生 App 页面
|
|
540
557
|
6. **`@source` 必须配置**:未配置则 TailwindCSS 无法扫描 `@h-ai/ui` 组件中的 class,样式会丢失
|
|
541
558
|
7. **`ssr.noExternal`**:Vite SSR 需要将 `@h-ai/*` 包纳入处理,否则 SSR 时 Svelte 组件无法正确编译
|
|
559
|
+
8. **data-* 属性透传**:公开 Svelte 组件会把调用方传入的 `data-*` 属性透传到根节点或主交互节点;测试和自动化优先直接使用 `data-testid`、`data-analytics-id`,不要为测试 ID 重复封装组件
|
|
542
560
|
|
|
543
561
|
---
|
|
544
562
|
|