@xiongtao.xt/tau-plugins 0.18.0 → 0.20.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/PUBLISH-DATA.md +29 -0
  3. package/README.md +1 -1
  4. package/client/fuse-M2Z6NNAT.js +2000 -0
  5. package/package.json +15 -3
  6. package/publish-artifacts.js +252 -0
  7. package/publish-client.js +258 -0
  8. package/publish-data.js +1 -0
  9. package/types/packages/editor/api.d.ts +1 -1
  10. package/types/packages/editor/contracts.d.ts +2 -2
  11. package/types/packages/editor/source-contracts.d.ts +48 -0
  12. package/types/packages/editor/src/{services → core/services}/overlayBackDismiss.d.ts +1 -1
  13. package/types/packages/editor/src/{services → core/services}/registry.d.ts +2 -2
  14. package/types/packages/editor/src/{services → core/services}/tokens.d.ts +4 -4
  15. package/types/packages/editor/src/{types → core/types}/custom-element.d.ts +1 -1
  16. package/types/packages/editor/src/core/types/text.d.ts +1 -0
  17. package/types/packages/editor/src/{ui → core/ui}/Tooltip.d.ts +1 -1
  18. package/types/packages/editor/src/{utils → core/utils}/blockNavigation.d.ts +1 -1
  19. package/types/packages/markdown/src/codec.d.ts +2 -2
  20. package/types/packages/plugins/src/categories.d.ts +40 -0
  21. package/types/packages/plugins/src/ids.d.ts +1 -0
  22. package/types/packages/plugins/src/inline-source.d.ts +2 -13
  23. package/types/packages/plugins/src/package.d.ts +38 -0
  24. package/types/packages/plugins/src/publish-artifacts.d.ts +14 -0
  25. package/types/packages/plugins/src/publish-client.d.ts +8 -0
  26. package/types/packages/plugins/src/publish-data.d.ts +280 -0
  27. package/types/packages/plugins/src/render-artifact.d.ts +9 -0
  28. package/types/packages/plugins/src/source-editor.d.ts +2 -38
  29. package/types/packages/plugins/src/version.d.ts +4 -0
  30. package/types/packages/editor/src/types/text.d.ts +0 -1
  31. /package/types/packages/editor/src/{api → core/api}/command.d.ts +0 -0
  32. /package/types/packages/editor/src/{api → core/api}/copy.d.ts +0 -0
  33. /package/types/packages/editor/src/{api → core/api}/drag.d.ts +0 -0
  34. /package/types/packages/editor/src/{api → core/api}/extension.d.ts +0 -0
  35. /package/types/packages/editor/src/{api → core/api}/index.d.ts +0 -0
  36. /package/types/packages/editor/src/{api → core/api}/ingest.d.ts +0 -0
  37. /package/types/packages/editor/src/{api → core/api}/legacy.d.ts +0 -0
  38. /package/types/packages/editor/src/{api → core/api}/marks.d.ts +0 -0
  39. /package/types/packages/editor/src/{api → core/api}/menu.d.ts +0 -0
  40. /package/types/packages/editor/src/{api → core/api}/submission.d.ts +0 -0
  41. /package/types/packages/editor/src/{api → core/api}/toolbar.d.ts +0 -0
  42. /package/types/packages/editor/src/{components → core/components}/AddParagraph/index.d.ts +0 -0
  43. /package/types/packages/editor/src/{components → core/components}/BlockDrag/index.d.ts +0 -0
  44. /package/types/packages/editor/src/{components → core/components}/ElementMenu/index.d.ts +0 -0
  45. /package/types/packages/editor/src/{components → core/components}/FloatingToolbar/index.d.ts +0 -0
  46. /package/types/packages/editor/src/{components → core/components}/HoveringToolbar/FloatingSubmenu.d.ts +0 -0
  47. /package/types/packages/editor/src/{components → core/components}/HoveringToolbar/context.d.ts +0 -0
  48. /package/types/packages/editor/src/{components → core/components}/HoveringToolbar/floatingPosition.d.ts +0 -0
  49. /package/types/packages/editor/src/{components → core/components}/InlineChromiumBugFix/index.d.ts +0 -0
  50. /package/types/packages/editor/src/{components → core/components}/OverlayBackDismiss/index.d.ts +0 -0
  51. /package/types/packages/editor/src/{hooks → core/hooks}/useIsLastElement.d.ts +0 -0
  52. /package/types/packages/editor/src/{kit → core/kit}/elementEmpty.d.ts +0 -0
  53. /package/types/packages/editor/src/{menu → core/menu}/conversion.d.ts +0 -0
  54. /package/types/packages/editor/src/{model → core/model}/paragraph.d.ts +0 -0
  55. /package/types/packages/editor/src/{services → core/services}/editorNotifier.d.ts +0 -0
  56. /package/types/packages/editor/src/{services → core/services}/errorReporter.d.ts +0 -0
  57. /package/types/packages/editor/src/{services → core/services}/hooks.d.ts +0 -0
  58. /package/types/packages/editor/src/{services → core/services}/notifier.d.ts +0 -0
  59. /package/types/packages/editor/src/{theme → core/theme}/ThemeService.d.ts +0 -0
  60. /package/types/packages/editor/src/{theme → core/theme}/context.d.ts +0 -0
  61. /package/types/packages/editor/src/{types → core/types}/block-panel.d.ts +0 -0
  62. /package/types/packages/editor/src/{types → core/types}/editor.d.ts +0 -0
  63. /package/types/packages/editor/src/{types → core/types}/element/paragraph.d.ts +0 -0
  64. /package/types/packages/editor/src/{types → core/types}/hotkeys.d.ts +0 -0
  65. /package/types/packages/editor/src/{types → core/types}/hovering-bar.d.ts +0 -0
  66. /package/types/packages/editor/src/{types → core/types}/index.d.ts +0 -0
  67. /package/types/packages/editor/src/{types.d.ts → core/types.d.ts} +0 -0
  68. /package/types/packages/editor/src/{ui → core/ui}/CaretRight.d.ts +0 -0
  69. /package/types/packages/editor/src/{utils → core/utils}/commandTarget.d.ts +0 -0
  70. /package/types/packages/editor/src/{utils → core/utils}/container.d.ts +0 -0
  71. /package/types/packages/editor/src/{utils → core/utils}/editor.d.ts +0 -0
  72. /package/types/packages/editor/src/{utils → core/utils}/element.d.ts +0 -0
  73. /package/types/packages/editor/src/{utils → core/utils}/insertElement.d.ts +0 -0
  74. /package/types/packages/editor/src/{utils → core/utils}/nodeOperations.d.ts +0 -0
  75. /package/types/packages/editor/src/{utils → core/utils}/paragraphShortcut.d.ts +0 -0
  76. /package/types/packages/editor/src/{utils → core/utils}/path.d.ts +0 -0
  77. /package/types/packages/editor/src/{utils → core/utils}/plugin.d.ts +0 -0
  78. /package/types/packages/editor/src/{utils → core/utils}/selectionSnapshot.d.ts +0 -0
  79. /package/types/packages/editor/src/{utils → core/utils}/zoomPan.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # 更新记录
2
2
 
3
+ ## 0.20.0
4
+
5
+ - manifest 支持 `categories`(插件中心分类)与 `keywords`(目录搜索),门户上传严格校验,客户端忽略未知值。
6
+ - 博客模板包(`template` 分支)同样支持分类与关键词,只含静态站点产物,不能同时声明代码插件入口。
7
+ - publish-data:站点级数据(`settings`、`collections`、`cardTagTree`、`projectTrees`)改为只在清单中出现;内容文件新增 `links`,只含本文用到且已发布的站内链接目标。
8
+ - publish-client:`readData` 随正文带回清单的 `settings`;检索引擎按索引缓存,不再每次查询重建。
9
+
10
+ ## 0.19.0
11
+
12
+ - 补齐 publish-data 类型、publish-client 纯数据客户端及 publish-artifacts 协议校验/定义求值入口;数据与产物声明不连带载入 Editor/React/UI 类型。
13
+ - 普通 SDK/UI 根入口保持类型与 Tau 注入约定;通用源码组件契约与实现由 Editor 公开入口维护,既有源码宿主适配只负责接线。
14
+ - 保留 master 0.18.0 的图片插件及全部已插件化接口。
15
+
3
16
  ## 0.18.0
4
17
 
5
18
  - 新增 `context.images.register`,按账号配置与模型创建图片生成或编辑实例,返回图片字节和实际 MIME。
@@ -0,0 +1,29 @@
1
+ # 独立站点的数据接入
2
+
3
+ 普通 Tau 插件仍然使用 SDK 类型开发,构建时将宿主注入模块设为 external。SDK 根入口和 UI 包不携带编辑器、组件或页面的运行实现。
4
+
5
+ 博客模板一般直接使用 `@tau/blog`:它包含数据读取、搜索、正文渲染和内容插件接入,见该包 README。只想读取数据、自己渲染正文的站点,可使用 `@tau/plugins/publish-data` 的纯数据类型和 `@tau/plugins/publish-client` 的数据客户端。客户端只有数据读取、摘要校验、取消和搜索,不包含 React、渲染器、路由或预览界面。
6
+
7
+ ```ts
8
+ import { createClient } from "@tau/plugins/publish-client";
9
+
10
+ const client = createClient({ manifestUrl: "https://example.com/data/site.<摘要>.json" });
11
+ const manifest = await client.readManifest();
12
+ const result = await client.readData({ key: manifest.items[0].key });
13
+ ```
14
+
15
+ ## 数据分布
16
+
17
+ - 清单 `site.<摘要>.json`:站点信息、全部内容的 key 与数据文件、搜索索引引用,以及只出现一次的站点级数据——`settings`(发布外观设置)、`collections`(项目列表)、`cardTagTree`(卡片标签树)、`projectTrees`(按项目 id 的文档目录)。`readData` 会把 `settings` 一并带回。
18
+ - 内容文件:`key`、`meta`、`content`,以及可选的 `links`(本文正文里已发布的站内链接目标)、`pluginRenderers`(内容插件产物)和 `contentStyles`(正文动态样式)。资源以所属数据文件的 URL 为上下文解析。
19
+ - 公开路由完全由模板决定,数据里只有 ContentRef(`{ key, type, id? }`),没有 URL。
20
+
21
+ 正文的站内链接由 `@tau/blog` 按 `links` 渲染,模板只提供 `hrefFor`。自己渲染正文的站点按 `links` 的键(`${contentType}:${refId}`,与求索资料的 `citeKey` 同一口径)查目标,查不到即目标未发布。
22
+
23
+ ## 样式
24
+
25
+ `contentStyles` 是宿主为正文里的 HTML 节点编译的 Tailwind 工具类,属于过渡产物:按原文加载,含 `:root` 主题变量和全局类名,正文挂载期间对整个页面生效。模板若自定义了同名 Tailwind 主题变量,正文挂载时可能被这些默认值覆盖。
26
+
27
+ ## 插件产物
28
+
29
+ `@tau/plugins/publish-artifacts` 提供 C23 清单校验、定义求值与节点归属检查,仅处理协议,不提供 UI、模块映射或资源生命周期。共享模块由模板通过实际公开能力提供;`@tau/blog` 已内置这部分接入。
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tau 插件开发包 @tau/plugins
2
2
 
3
- 开发 Tau 插件所需的类型与接口,通过 npm 别名安装为 `@tau/plugins`。实际实现由 Tau 客户端在运行时提供,构建时需设为 external,不能在普通 Node.js 程序中直接运行。
3
+ 开发 Tau 插件所需的类型与接口,通过 npm 别名安装为 `@tau/plugins`。根入口的实际实现由 Tau 客户端提供,构建时需设为 external。plugins 包另提供独立站点可用的 publish-data 类型和 publish-client 纯数据客户端,见该包 PUBLISH-DATA.md;不包含站点渲染、路由或预览实现。
4
4
 
5
5
  从模板开始开发:https://github.com/LastKnightCoder/tau-plugin-template
6
6