@h-ai/cli 0.1.0-alpha.30 → 0.1.0-alpha.32

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.30",
4
+ "version": "0.1.0-alpha.32",
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.30"
37
+ "@h-ai/core": "0.1.0-alpha.32"
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.30",
3
+ "version": "0.1.0-alpha.32",
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