@xiongtao.xt/tau-plugins 0.23.1 → 0.24.0

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/API.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  博客发布提供方见 [PUBLISH.md](PUBLISH.md),需要 SDK 0.21.0 和包含该能力的客户端;独立博客站点读取数据见 [PUBLISH-DATA.md](PUBLISH-DATA.md)。
8
8
 
9
- 想在文档里添加自定义块,见 [EDITOR.md](EDITOR.md);需要编译 Tailwind、Typst、Markdown 等内容,见 [SERVICES.md](SERVICES.md)。
9
+ 想在文档里添加自定义块,见 [EDITOR.md](EDITOR.md);需要编译 Tailwind、Markdown 等内容,见 [SERVICES.md](SERVICES.md)。
10
10
 
11
11
  AI 功能声明、用户模型分配、流式对话、取消与统一用量审计见 [AI.md](AI.md)(SDK 0.7.0 及以上)。
12
12
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # 更新记录
2
2
 
3
+ ## 0.24.0
4
+
5
+ - 移除 `PluginServices.typst`:宿主不再内置 Typst 编译服务(原生二进制约 37 MB/平台随之从安装包移除)。Typst 排版由 `tau.typst` 插件 v0.2.0 以 WebAssembly 引擎在渲染进程本地完成,首次使用联网下载编译组件与字体并长期缓存。
6
+ - 旧版 `tau.typst` 插件(0.1.x)在新宿主上不再能实时编译,已保存的排版缓存与源码照常显示。
7
+
3
8
  ## 0.23.1
4
9
 
5
10
  - 修正 FFprobe 升级说明中已删除类型的名称为 `MediaInfo`,接口与 0.23.0 相同。
package/DEVELOPMENT.md CHANGED
@@ -80,7 +80,7 @@ pnpm build
80
80
  | 0.19.0–0.20.0 | 发布数据子入口、站点级数据归清单、分类与关键词,见 PUBLISH-DATA.md 与 API.md |
81
81
  | 0.21.0 | 博客发布提供方、配置与 Git 快照服务,见 PUBLISH.md |
82
82
  | 0.22.0 | 视频提供方与视频页面信息查询,见 VIDEO.md |
83
- | 0.23.0 | 删除 `ffmpeg.probe` 与 `MediaInfo`;`ffmpeg.run` 保留,见 SERVICES.md |
83
+ | 0.23.0 | 删除 `ffmpeg.probe` 与 `MediaInfo`;`ffmpeg.run` 保留,见 SERVICES.md |
84
84
 
85
85
  更早版本的完整变更见已安装包的 `node_modules/@tau/plugins/CHANGELOG.md`。需要本地媒体元数据时自行实现,不能把视频页面解析当作本地文件探测。SDK 根入口、白板/同步契约、UI 和 React 由 Tau 提供,保持模板的 external 配置;普通第三方库由构建打入 ZIP。独立站点数据子入口的用途另见 PUBLISH-DATA.md。
86
86
 
package/SERVICES.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 编译与转换服务
2
2
 
3
- 需要在插件里编译 Tailwind、Typst,转换 Markdown,或处理音视频时,可以使用这些服务。通过 `context.services` 调用,类型从 `@tau/plugins` 导入,需要 Tau 0.59.0 或更高版本及实现相应能力的客户端构建。本文对应 SDK 0.23.0。TikZ 编译属于独立绘图插件,不再提供宿主服务。
3
+ 需要在插件里编译 Tailwind,转换 Markdown,或处理音视频时,可以使用这些服务。通过 `context.services` 调用,类型从 `@tau/plugins` 导入,需要 Tau 0.59.0 或更高版本及实现相应能力的客户端构建。本文对应 SDK 0.24.0。TikZ 编译属于独立绘图插件,Typst 排版属于 `tau.typst` 插件(自带 WebAssembly 引擎),均不再提供宿主服务。
4
4
 
5
5
  所有服务都是异步方法,只处理传入数据并返回结果,不读写笔记、不选择或保存文件、不自动注入样式。
6
6
 
@@ -9,7 +9,6 @@
9
9
  | 方法 | 输入 | 返回 |
10
10
  | ---------------------------------------- | ------------------------------------------------- | --------------------------------------- |
11
11
  | `tailwind.compile(input, options?)` | `{ source, language?: "html" \| "tsx" \| "jsx" }` | `{ css }` |
12
- | `typst.compile(input, options?)` | `{ source, format?: "html", inputs?, files? }` | `{ html }` |
13
12
  | `markdown.deserialize(source, options?)` | Markdown 字符串 | `{ nodes: Descendant[], warnings }` |
14
13
  | `markdown.serialize(nodes, options?)` | `Descendant[]` | `{ markdown, warnings }` |
15
14
  | `markdown.render(source, options?)` | Markdown 字符串 | `{ html, css, warnings }` |
@@ -33,11 +32,11 @@ SDK 0.16.0 的 `usePluginServices()` 返回当前插件可用的同一组服务
33
32
  ```ts
34
33
  const controller = new AbortController();
35
34
  try {
36
- const { html } = await context.services.typst.compile(
37
- { source: "= 阅读报告\n本周阅读记录" },
35
+ const { css } = await context.services.tailwind.compile(
36
+ { source: '<div class="p-4">Hello</div>', language: "html" },
38
37
  { signal: controller.signal }
39
38
  );
40
- // 将 html 用于插件自己的预览。
39
+ // 将 css 用于插件自己的预览。
41
40
  } catch (error) {
42
41
  if (error instanceof Error && error.name === "AbortError") return;
43
42
  throw error;
@@ -60,20 +59,6 @@ const { css } = await context.services.tailwind.compile({
60
59
 
61
60
  固定插件界面通常在打包时编译样式;此服务主要用于运行时生成内容。返回 CSS 由插件自行使用并在停用时清理。
62
61
 
63
- ## Typst
64
-
65
- 目前只输出 HTML 正文片段,不支持 PDF 和 SVG。`inputs` 对应 Typst 的 `sys.inputs`:
66
-
67
- ```ts
68
- const { html } = await context.services.typst.compile({
69
- source: '#include "parts/intro.typ"\n#sys.inputs.at("title")',
70
- inputs: { title: "阅读报告" },
71
- files: [{ name: "parts/intro.typ", data: new Blob(["本周阅读记录"]) }],
72
- });
73
- ```
74
-
75
- 附件名是本次编译中的相对路径,不能使用绝对路径、`..` 或反斜杠。图片和包含文件等需显式通过 `files` 提供。可用字体依赖客户端运行环境;不承诺任意宏包或排版效果均可导出为 HTML。公式需要使用 Typst 相应的 HTML 写法,不能把 PDF 能力等同于 HTML 支持。
76
-
77
62
  ## Markdown 与编辑器节点
78
63
 
79
64
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiongtao.xt/tau-plugins",
3
- "version": "0.23.1",
3
+ "version": "0.24.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -56,16 +56,6 @@ export interface PluginServices {
56
56
  css: string;
57
57
  }>;
58
58
  };
59
- typst: {
60
- compile(input: {
61
- source: string;
62
- format?: "html";
63
- inputs?: Record<string, string>;
64
- files?: ServiceFile[];
65
- }, options?: ServiceOptions): Promise<{
66
- html: string;
67
- }>;
68
- };
69
59
  markdown: {
70
60
  deserialize(source: string, options?: MarkdownServiceOptions): Promise<{
71
61
  nodes: Descendant[];