@xiongtao.xt/tau-plugins 0.16.0 → 0.17.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # 更新记录
2
2
 
3
+ ## 0.17.0
4
+
5
+ - 新增通用行内源码 API:useInlineSource、insertInlineSource 和 InlineSourceBoundary,复用宿主 Slate 实例与浏览器行内边界处理。
6
+ - 行内源码更新和删除遵守只读、卸载/停驻、目标替换及编辑器提交守卫;不修改 useSourceBlock、EditorKit 或已有节点格式。
7
+ - 保留已有 TTS、上传、聊天、独立服务入口与 TikZ 服务移除边界;客户端版本不变。
8
+
3
9
  ## 0.16.0
4
10
 
5
11
  - 新增独立 `usePluginServices()`,由插件渲染运行时提供已有编译与转换服务;博客及无服务的宿主返回 undefined。
package/EDITOR.md CHANGED
@@ -157,6 +157,10 @@ function SourceView({ element, children }: { element: SourceElement; children: R
157
157
 
158
158
  ## 动态样式与静态导出
159
159
 
160
+ SDK 0.17.0 提供 `useInlineSource(element)`:返回 readOnly、可选 compiler、update(properties) 与 remove(),只读、停驻、卸载及旧目标回调不会写入文档。行内源码组件通过 `InlineSourceBoundary` 复用宿主的浏览器边界处理;菜单用 `insertInlineSource(editor, element)` 插入节点。行内输入弹层由插件通过公共 UI 组件承载,只读时只显示预览,不打开编辑器。
161
+
162
+ 静态导出也按 styleSources 编译节点字段并向导出 CSS 收集器提供样式;插件只负责把节点序列化为 HTML,宿主不维护具体节点类型的样式名单。
163
+
160
164
  若节点源码中包含动态 Tailwind 类名,在同一个扩展上声明字段:
161
165
 
162
166
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xiongtao.xt/tau-plugins",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -6,6 +6,7 @@ export type { PluginSettings, PluginSettingsDefinition, PluginSettingsProps, Plu
6
6
  export * from "./editor";
7
7
  export { SourceBlockEditor, useSourceBlock, useReportPreviewError, insertSourceBlock, sourceBlockParagraphBehavior, } from "./source-editor";
8
8
  export type { SourceBlockEditorProps, PluginRuntimeStyleCompiler } from "./source-editor";
9
+ export { useInlineSource, insertInlineSource, InlineSourceBoundary } from "./inline-source";
9
10
  export * from "./sidebar";
10
11
  export type * from "./excerpts";
11
12
  export type * from "./services";
@@ -0,0 +1,17 @@
1
+ import type { ReactElement } from "react";
2
+ import type { Editor, Element } from "slate";
3
+ import type { PluginRuntimeStyleCompiler } from "./source-editor";
4
+ export interface InlineSourceRuntime {
5
+ useInlineSource(element: Element): {
6
+ readOnly: boolean;
7
+ compiler: PluginRuntimeStyleCompiler | undefined;
8
+ update(properties: Record<string, unknown>): void;
9
+ remove(): void;
10
+ };
11
+ insertInlineSource(editor: Editor, element: Element): void;
12
+ InlineSourceBoundary(): ReactElement;
13
+ }
14
+ export declare function configureInlineSource(value: InlineSourceRuntime): void;
15
+ export declare const useInlineSource: InlineSourceRuntime["useInlineSource"];
16
+ export declare const insertInlineSource: InlineSourceRuntime["insertInlineSource"];
17
+ export declare const InlineSourceBoundary: InlineSourceRuntime["InlineSourceBoundary"];