@xiongtao.xt/tau-plugins 0.13.0 → 0.14.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/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # 更新记录
2
+
3
+ ## 0.14.0
4
+
5
+ - 移除 `PluginServices.tikz` 和 `context.services.tikz.compile`。TikZ 编译、字体与文档块由独立插件 tau.tikz 提供,宿主不再保留编译实现或转发入口。
6
+ - 插件作者如需 TikZ 绘图,应由自己的插件携带实现;其他宿主编译与转换服务保持不变。
7
+ - 保留 0.13.0 的 TTS、资源上传及其生命周期接口。
package/EDITOR.md CHANGED
@@ -93,7 +93,7 @@ export default definePlugin({
93
93
 
94
94
  ## 块会在哪里显示
95
95
 
96
- 块除了显示在桌面编辑器里,还会出现在移动端、浏览器扩展和用户发布的网页中,这些地方都直接使用你在 `elements.render` 中写的同一个组件,不需要另写入口。因此渲染代码要满足:
96
+ 块显示在桌面编辑器和用户发布的博客中,两处直接使用 `elements.render` 中的同一个组件,不需要另写入口。移动端与浏览器扩展不加载插件,遇到插件节点保留原数据并显示通用占位。因此渲染代码要满足:
97
97
 
98
98
  - 模块顶层和渲染组件能在浏览器中运行,不导入 Electron、Node 或 Tau 客户端内部路径。
99
99
  - 不依赖 `activate` 中才赋值的变量,也不调用 `context` 的存储、页面、服务等桌面能力。
package/SERVICES.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # 编译与转换服务
2
2
 
3
- 需要在插件里编译 Tailwind、Typst、TikZ,转换 Markdown,或处理音视频时,可以使用这些服务。通过 `context.services` 调用,类型从 `@tau/plugins` 导入,需要 Tau 0.59.0 或更高版本。
3
+ 需要在插件里编译 Tailwind、Typst,转换 Markdown,或处理音视频时,可以使用这些服务。通过 `context.services` 调用,类型从 `@tau/plugins` 导入,需要 Tau 0.59.0 或更高版本。TikZ 编译属于独立绘图插件,不再提供宿主服务。
4
4
 
5
5
  所有服务都是异步方法,只处理传入数据并返回结果,不读写笔记、不选择或保存文件、不自动注入样式。
6
6
 
@@ -13,7 +13,6 @@
13
13
  | `markdown.deserialize(source, options?)` | Markdown 字符串 | `{ nodes: Descendant[], warnings }` |
14
14
  | `markdown.serialize(nodes, options?)` | `Descendant[]` | `{ markdown, warnings }` |
15
15
  | `markdown.render(source, options?)` | Markdown 字符串 | `{ html, css, warnings }` |
16
- | `tikz.compile(input, options?)` | `{ source }`,包含 `tikzpicture` 环境 | `{ svg }` |
17
16
  | `ffmpeg.probe(file, options?)` | `{ name, data: Blob }` | `{ format, streams }` |
18
17
  | `ffmpeg.run(input, options?)` | `{ files, args, outputs }` | `{ files, log }` |
19
18
 
@@ -99,18 +98,6 @@ const result = await context.services.markdown.serialize(nodes, {
99
98
 
100
99
  HTML 渲染不自动执行 TikZ、Typst、Mermaid 编译器;相关节点可能显示源码并返回 `DISPLAY_FALLBACK`,音视频可能显示链接。原始 HTML 和远程资源按客户端导出规则保留,输出不是经过净化的 HTML。`css` 是本次生成内容附带的样式,不包含完整 Tau 页面主题,也不打包图片附件。
101
100
 
102
- ## TikZ
103
-
104
- ```ts
105
- const { svg } = await context.services.tikz.compile({
106
- source: String.raw`\begin{tikzpicture}
107
- \draw (0,0) -- (1,1);
108
- \end{tikzpicture}`,
109
- });
110
- ```
111
-
112
- 不要添加 `documentclass` 或 `document` 环境。服务负责包装,返回包含字体样式的 SVG 字符串。这不是完整 LaTeX 文档编译器,不提供任意宏包安装。语法或宏包不支持时明确报错;单次最长 120 秒,可通过 signal 提前取消。
113
-
114
101
  ## FFmpeg
115
102
 
116
103
  `ServiceFile` 为 `{ name: string, data: Blob }`;文件名仅在任务内使用,不是客户端路径。输入输出名称不得重复,目录使用 `/`。文件整体经内存传输,适合可以放进内存的素材,不支持大文件流式处理。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiongtao.xt/tau-plugins",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -74,13 +74,6 @@ export interface PluginServices {
74
74
  warnings: ServiceWarning[];
75
75
  }>;
76
76
  };
77
- tikz: {
78
- compile(input: {
79
- source: string;
80
- }, options?: ServiceOptions): Promise<{
81
- svg: string;
82
- }>;
83
- };
84
77
  ffmpeg: {
85
78
  probe(input: ServiceFile, options?: ServiceOptions): Promise<MediaInfo>;
86
79
  /** args 中用任务文件名引用输入和输出;不接受 shell 命令。 */