@h-ai/cli 0.1.0-alpha.21 → 0.1.0-alpha.22

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.21",
4
+ "version": "0.1.0-alpha.22",
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.21"
37
+ "@h-ai/core": "0.1.0-alpha.22"
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.21",
3
+ "version": "0.1.0-alpha.22",
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}}"],
@@ -5,7 +5,7 @@ description: 使用 @h-ai/ui 构建多端应用界面,包含三层组件架构
5
5
 
6
6
  # hai-ui
7
7
 
8
- > `@h-ai/ui` 是基于 Svelte 5 Runes 的多端 UI 组件库,采用 DaisyUI v5 + Tailwind CSS v4 + Bits UI v2,内置 15 个精选 DaisyUI 主题、内置中英文 i18n、自动导入。内置 Shiki 代码高亮、Design Token 系统和 7 个移动端组件。
8
+ > `@h-ai/ui` 是基于 Svelte 5 Runes 的多端 UI 组件库,采用 DaisyUI v5 + Tailwind CSS v4 + Bits UI v2,内置 15 个精选 DaisyUI 主题、内置中英文 i18n、自动导入。内置 Shiki 代码高亮、Mermaid 图表渲染、Design Token 系统和 7 个移动端组件。
9
9
 
10
10
  ---
11
11
 
@@ -23,6 +23,7 @@ description: 使用 @h-ai/ui 构建多端应用界面,包含三层组件架构
23
23
  - 使用 IAM 场景组件(登录/注册/密码/权限守卫/用户资料表单)
24
24
  - 使用 Storage 场景组件(文件上传/图片上传/头像上传/文件列表)
25
25
  - 使用 CRUD 场景组件(列表过滤、详情抽屉、编辑抽屉、删除确认)
26
+ - 渲染 AI 输出(Markdown / Mermaid 文档、代码产物预览)
26
27
  - 配置主题切换与 i18n 多语言
27
28
  - 多端平台检测与适配
28
29
 
@@ -316,10 +317,15 @@ const p = usePlatform()
316
317
  | -------------------- | --------------------------------- |
317
318
  | `MarkdownRenderer` | Markdown 渲染(内置 Shiki 高亮) |
318
319
  | `AiDocumentDownloadMenu` | AI 文档下载菜单 |
319
- | `AiDocumentEditor` | AI 文档编辑器(支持受控代码预览) |
320
+ | `AiDocumentEditor` | AI 文档编辑器(支持 Mermaid 与受控代码预览) |
320
321
  | `AiTableEditor` | AI 表格编辑器 |
321
322
 
322
323
  > AI 场景组件使用 Shiki(纯 ESM)进行代码高亮,支持 27 种语言,通过 CSS 变量 `--hai-hl-*` 自定义颜色。无需额外安装 Shiki,已内置。`AiDocumentEditor` 默认只允许 Markdown 内置预览;HTML / JS / CSS 等高风险预览需要显式启用 `allowUnsafeCodePreview`,或通过 `oncoderun` 返回受控的预览结果。
324
+ >
325
+ > Mermaid 开箱即用:
326
+ > - `sourceKind='document'` 时,文档中的 ```` ```mermaid ```` 代码块会在阅读态自动渲染为图表;
327
+ > - `sourceKind='code'` + `showCodePreviewToggle` 时,可在「代码 / 预览」之间切换查看 Mermaid 图表;
328
+ > - Mermaid 以 `securityLevel: 'strict'` 渲染为消毒后的 SVG,无需开启 `allowUnsafeCodePreview`。
323
329
 
324
330
  #### CRUD 场景组件
325
331