@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
@@ -1,4 +1,4 @@
1
- import { type TooltipProps } from "../../../ui/src/index";
1
+ import { type TooltipProps } from "../../../../ui/src/index";
2
2
  /**
3
3
  * 编辑器内的提示:外观同 @tau/ui,层级抬到悬浮工具条(z 9999)与编辑器浮层(~10100)之上,
4
4
  * 否则工具条按钮的提示会被工具条自身盖住。
@@ -22,7 +22,7 @@ export declare const registerBlockNavigation: (element: SlateElement, handler: B
22
22
  export declare const unregisterBlockNavigation: (element: SlateElement) => void;
23
23
  export declare const hasBlockNavigation: (element: SlateElement) => boolean;
24
24
  export declare const focusElementByNavigator: (editor: Editor, element: SlateElement, position: BlockFocusPosition, meta: BlockNavigationMeta) => boolean;
25
- export declare const getSiblingBlockEntry: (editor: Editor, fromPath: Path, direction: BlockNavigationDirection) => NodeEntry<import("../../api").ParagraphElement> | undefined;
25
+ export declare const getSiblingBlockEntry: (editor: Editor, fromPath: Path, direction: BlockNavigationDirection) => NodeEntry<import("../../../api").ParagraphElement> | undefined;
26
26
  export declare const focusPreviousBlock: (editor: Editor, fromPath: Path, meta: BlockNavigationMeta) => boolean;
27
27
  export declare const focusNextBlock: (editor: Editor, fromPath: Path, meta: BlockNavigationMeta) => boolean;
28
28
  export declare const hasBlockNavigationBoundary: (editor: Editor, path: Path) => boolean;
@@ -41,7 +41,7 @@ export interface MarkdownCodec {
41
41
  */
42
42
  fence?: {
43
43
  language: string | readonly string[];
44
- /** 源码落进元素的字段名,默认 "content"(mermaid 用 "chart") */
44
+ /** 源码落进元素的字段名,默认 "content",由领域声明覆盖。 */
45
45
  property?: string;
46
46
  };
47
47
  /**
@@ -69,7 +69,7 @@ export interface MarkdownCodec {
69
69
  parent: Descendant | null;
70
70
  previousSibling: Descendant | null;
71
71
  nextSibling: Descendant | null;
72
- /** 把块级子元素降级为行内形态(image→inline-image、html-block→html-inline),无声明则原样返回 */
72
+ /** 按领域声明把块级子元素降级为行内形态,无声明则原样返回。 */
73
73
  demote: (child: Descendant) => Descendant;
74
74
  }) => Descendant[] | null;
75
75
  /** 按目标类型贡献规范化,先于该类型自身 normalize;按 codec 顺序首个非 null 替换生效。 */
@@ -0,0 +1,40 @@
1
+ /** 插件中心分类按扩展点划分,顺序即展示顺序;新增面向用户的扩展点时同步扩充。 */
2
+ export declare const PLUGIN_CATEGORIES: readonly [{
3
+ readonly id: "sync";
4
+ readonly label: "同步";
5
+ }, {
6
+ readonly id: "upload";
7
+ readonly label: "资源上传";
8
+ }, {
9
+ readonly id: "editor";
10
+ readonly label: "编辑器";
11
+ }, {
12
+ readonly id: "whiteboard";
13
+ readonly label: "白板";
14
+ }, {
15
+ readonly id: "blog-template";
16
+ readonly label: "博客模板";
17
+ }, {
18
+ readonly id: "ai";
19
+ readonly label: "AI";
20
+ }, {
21
+ readonly id: "voice";
22
+ readonly label: "语音";
23
+ }, {
24
+ readonly id: "page";
25
+ readonly label: "页面";
26
+ }];
27
+ export type PluginCategory = (typeof PLUGIN_CATEGORIES)[number]["id"];
28
+ export declare const PLUGIN_KEYWORD_LIMIT = 5;
29
+ export declare const PLUGIN_KEYWORD_MAX_LENGTH = 20;
30
+ export declare const isPluginCategory: (value: unknown) => value is PluginCategory;
31
+ export interface PluginCatalogFields {
32
+ categories?: readonly PluginCategory[];
33
+ keywords?: readonly string[];
34
+ }
35
+ /**
36
+ * 读取 manifest 中的分类与关键词。
37
+ * strict 用于门户上传,非法值直接报错;客户端用宽松模式静默丢弃,
38
+ * 使老客户端不会因词表新增或上限调整而拒收插件。
39
+ */
40
+ export declare function readCatalogFields(item: Record<string, unknown>, strict: boolean): PluginCatalogFields;
@@ -0,0 +1 @@
1
+ export declare function assertLocalId(value: string): void;
@@ -1,16 +1,5 @@
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
- }
1
+ import type { InlineSourceRuntime } from "../../editor/source-contracts";
2
+ export type { InlineSourceRuntime } from "../../editor/source-contracts";
14
3
  export declare function configureInlineSource(value: InlineSourceRuntime): void;
15
4
  export declare const useInlineSource: InlineSourceRuntime["useInlineSource"];
16
5
  export declare const insertInlineSource: InlineSourceRuntime["insertInlineSource"];
@@ -0,0 +1,38 @@
1
+ export { assertLocalId } from "./ids";
2
+ import { type PluginCategory } from "./categories";
3
+ export { comparePluginVersions } from "./version";
4
+ export { PLUGIN_CATEGORIES, PLUGIN_KEYWORD_LIMIT, PLUGIN_KEYWORD_MAX_LENGTH, isPluginCategory, type PluginCategory, } from "./categories";
5
+ export declare const PLUGIN_SHARED_MODULES: readonly ["@tau/plugins", "@tau/plugins/whiteboard", "@tau/plugins/sync", "@tau/ui", "react", "react-dom", "react-dom/client", "react/jsx-runtime", "react/jsx-dev-runtime"];
6
+ export interface PluginManifest {
7
+ formatVersion: 1;
8
+ id: string;
9
+ name: string;
10
+ version: string;
11
+ minAppVersion?: string;
12
+ apiVersion: 1;
13
+ platform: "desktop";
14
+ format: "cjs";
15
+ main: string;
16
+ /** 无界面的同步存储入口,Node产物与UI入口分别校验。 */
17
+ styles?: string;
18
+ /** 静态编辑器贡献在窗口启动时装配,启停需重启。 */
19
+ editor?: true;
20
+ whiteboard?: true;
21
+ /** 插件中心分类,作者自填,不与实际注册对账。 */
22
+ categories?: readonly PluginCategory[];
23
+ /** 仅参与搜索匹配。 */
24
+ keywords?: readonly string[];
25
+ integrity: Record<string, string>;
26
+ }
27
+ /** 宿主内部传输的已读取产物,不属于作者运行时 API。 */
28
+ export interface DevelopmentPluginPackage {
29
+ manifest: PluginManifest;
30
+ code: string;
31
+ css?: string;
32
+ }
33
+ /** strict 供门户上传使用:分类或关键词不合规时报错,客户端默认静默丢弃。 */
34
+ export declare function validatePluginManifest(value: unknown, options?: {
35
+ strict?: boolean;
36
+ }): PluginManifest;
37
+ /** 静态内容贡献在启动时固定,启停与更新需要重启。 */
38
+ export declare const isContentPlugin: (manifest: Pick<PluginManifest, "editor" | "whiteboard">) => boolean;
@@ -0,0 +1,14 @@
1
+ export { validatePluginManifest, PLUGIN_SHARED_MODULES } from "./package";
2
+ import type { DevelopmentPluginPackage } from "./package";
3
+ export declare const PLUGIN_RENDER_VERSION: 1;
4
+ export type { PublishedPluginRender } from "./render-artifact";
5
+ /** 协议层只检查贡献归属,具体扩展类型由模板选用的渲染器解释。 */
6
+ export interface EvaluatedPluginDefinition {
7
+ id: string;
8
+ name: string;
9
+ version: string;
10
+ apiVersion: 1;
11
+ editorExtensions?: readonly unknown[];
12
+ }
13
+ export declare function evaluatePluginPackage(artifact: DevelopmentPluginPackage, modules: Readonly<Record<string, unknown>>): EvaluatedPluginDefinition;
14
+ export declare function assertRenderTypes(definition: EvaluatedPluginDefinition, types: string[]): void;
@@ -0,0 +1,8 @@
1
+ import type { DataClient } from "./publish-data";
2
+ export declare class DataError extends Error {
3
+ code: string;
4
+ constructor(code: string, message: string);
5
+ }
6
+ export declare function createClient({ manifestUrl }: {
7
+ manifestUrl: string;
8
+ }): DataClient;
@@ -0,0 +1,280 @@
1
+ /** 发布数据协议不包含公开路由、DOM、组件或宿主生命周期。 */
2
+ export type DataKind = "home" | "card" | "article" | "doc" | "quest" | "list";
3
+ export interface ContentRef {
4
+ key: string;
5
+ type: DataKind;
6
+ id?: number;
7
+ }
8
+ export interface ResourceRef {
9
+ href: string;
10
+ integrity: string;
11
+ }
12
+ export interface ManifestItem extends ContentRef {
13
+ collectionType?: "card" | "article" | "doc" | "quest";
14
+ title: string;
15
+ projectId?: number;
16
+ data: string;
17
+ integrity: string;
18
+ }
19
+ export interface SiteData {
20
+ title: string;
21
+ description: string;
22
+ basePath: string;
23
+ publicUrl?: string;
24
+ favicon?: {
25
+ href: string;
26
+ format: "svg" | "png" | "ico";
27
+ mimeType: string;
28
+ };
29
+ }
30
+ export interface PublishSettings {
31
+ appearance?: {
32
+ image?: {
33
+ borderRadius?: string;
34
+ shadow?: string | boolean;
35
+ };
36
+ };
37
+ }
38
+ /** 站点级数据只在清单中出现一次,各内容文件不重复携带。 */
39
+ export interface DataManifest {
40
+ version: 1;
41
+ site: SiteData;
42
+ search: {
43
+ data: string;
44
+ integrity: string;
45
+ };
46
+ items: ManifestItem[];
47
+ settings?: PublishSettings;
48
+ collections?: Collection[];
49
+ cardTagTree?: CardTagTree[];
50
+ /** 键为项目 id。 */
51
+ projectTrees?: Record<string, TreeItem[]>;
52
+ }
53
+ export interface ContentNode {
54
+ [field: string]: unknown;
55
+ text?: string;
56
+ type?: string;
57
+ children?: ContentNode[];
58
+ }
59
+ export interface TreeItem {
60
+ title: string;
61
+ target?: ContentRef;
62
+ children?: TreeItem[];
63
+ }
64
+ export interface Collection {
65
+ type: "project";
66
+ label: string;
67
+ items: {
68
+ id: number;
69
+ title: string;
70
+ target: ContentRef;
71
+ kind: "project";
72
+ }[];
73
+ }
74
+ export interface RelatedCard {
75
+ id: number;
76
+ target: ContentRef;
77
+ summary: string;
78
+ tags: string[];
79
+ }
80
+ export interface CardData {
81
+ id: number;
82
+ content: ContentNode[];
83
+ tags: string[];
84
+ createTime: number;
85
+ updateTime: number;
86
+ linkedCards?: RelatedCard[];
87
+ }
88
+ export interface ArticleData extends Omit<CardData, "linkedCards"> {
89
+ title: string;
90
+ author: string;
91
+ bannerBg?: string;
92
+ }
93
+ export interface DocData {
94
+ id: number;
95
+ projectId: number;
96
+ title: string;
97
+ content: ContentNode[];
98
+ breadcrumb: {
99
+ label: string;
100
+ target?: ContentRef;
101
+ }[];
102
+ prevPage?: {
103
+ title: string;
104
+ target: ContentRef;
105
+ };
106
+ nextPage?: {
107
+ title: string;
108
+ target: ContentRef;
109
+ };
110
+ createTime: number;
111
+ updateTime: number;
112
+ }
113
+ export type QuestStatus = "not_started" | "in_progress" | "resolved";
114
+ export interface QuestAnswer {
115
+ id: number;
116
+ createTime: number;
117
+ updateTime: number;
118
+ content?: ContentNode[];
119
+ source?: {
120
+ type: "card" | "article" | "project-item" | "custom";
121
+ id?: number;
122
+ contentId: number;
123
+ target?: ContentRef;
124
+ title?: string;
125
+ published: boolean;
126
+ };
127
+ }
128
+ export interface QuestMaterial {
129
+ index: number;
130
+ kind: string;
131
+ group: "external" | "note" | "discussion";
132
+ title: string;
133
+ meta: string;
134
+ excerpt: string;
135
+ note?: string;
136
+ target?: ContentRef;
137
+ url?: string;
138
+ citeKey?: string;
139
+ }
140
+ export interface QuestTrail {
141
+ time: number;
142
+ tone: "start" | "milestone" | "plain" | "note" | "done";
143
+ text: string;
144
+ refs: number[];
145
+ }
146
+ export interface QuestData {
147
+ id: number;
148
+ title: string;
149
+ summary: string;
150
+ target: ContentRef;
151
+ groupId: number;
152
+ groupTitle: string;
153
+ groupColor?: string;
154
+ status: QuestStatus;
155
+ answers: QuestAnswer[];
156
+ materials: QuestMaterial[];
157
+ trail: QuestTrail[];
158
+ description?: ContentNode[];
159
+ createTime: number;
160
+ updateTime: number;
161
+ resolvedTime?: number | null;
162
+ }
163
+ export interface TimelineItem {
164
+ type: "card" | "article" | "doc" | "quest";
165
+ id: number;
166
+ title?: string;
167
+ summary: string;
168
+ target: ContentRef;
169
+ tags: string[];
170
+ publishTime: number;
171
+ }
172
+ export interface HomeData {
173
+ hero?: {
174
+ title: string;
175
+ description: string;
176
+ };
177
+ timeline: TimelineItem[];
178
+ stats: {
179
+ articles: number;
180
+ cards: number;
181
+ };
182
+ docStats: {
183
+ projects: number;
184
+ };
185
+ }
186
+ export interface ListItem {
187
+ id: number;
188
+ title?: string;
189
+ summary: string;
190
+ target: ContentRef;
191
+ tags: string[];
192
+ createTime: number;
193
+ updateTime?: number;
194
+ groupId?: number;
195
+ groupTitle?: string;
196
+ status?: QuestStatus;
197
+ answerCount?: number;
198
+ }
199
+ export interface ListData {
200
+ title: string;
201
+ type: "card" | "article" | "doc" | "quest";
202
+ items: ListItem[];
203
+ tags?: {
204
+ name: string;
205
+ count: number;
206
+ }[];
207
+ }
208
+ export interface CardTagTree {
209
+ tag: string;
210
+ count: number;
211
+ cards: {
212
+ id: number;
213
+ summary: string;
214
+ target: ContentRef;
215
+ createTime: number;
216
+ }[];
217
+ children?: CardTagTree[];
218
+ }
219
+ export interface PublishedCommon {
220
+ version: 1;
221
+ key: string;
222
+ /** 本文正文里已发布的站内链接目标,键与 QuestMaterial.citeKey 同一口径;未发布的链接不在其中。 */
223
+ links?: Record<string, ContentRef>;
224
+ pluginRenderers?: import("./render-artifact").PublishedPluginRender[];
225
+ contentStyles?: ResourceRef[];
226
+ }
227
+ export type PublishedData = {
228
+ [K in DataKind]: PublishedCommon & {
229
+ meta: {
230
+ type: K;
231
+ publishTime: number;
232
+ };
233
+ content: {
234
+ home: HomeData;
235
+ card: CardData;
236
+ article: ArticleData;
237
+ doc: DocData;
238
+ quest: QuestData;
239
+ list: ListData;
240
+ }[K];
241
+ };
242
+ }[DataKind];
243
+ export interface DataResult {
244
+ data: PublishedData;
245
+ dataUrl: string;
246
+ /** 清单中的发布设置,由客户端随正文带回。 */
247
+ settings?: PublishSettings;
248
+ }
249
+ export interface SearchDocument extends ContentRef {
250
+ type: "card" | "article" | "doc" | "quest";
251
+ title: string;
252
+ summary: string;
253
+ content: string;
254
+ tags: string[];
255
+ }
256
+ export interface SearchFile {
257
+ version: 1;
258
+ documents: SearchDocument[];
259
+ }
260
+ export interface SearchMatch {
261
+ field: "title" | "summary" | "content" | "tags";
262
+ text: string;
263
+ ranges: [number, number][];
264
+ }
265
+ export interface SearchHit extends Omit<SearchDocument, "content"> {
266
+ matches?: SearchMatch[];
267
+ }
268
+ export interface DataClient {
269
+ readManifest(options?: {
270
+ signal?: AbortSignal;
271
+ }): Promise<DataManifest>;
272
+ readData(options: {
273
+ key: string;
274
+ signal?: AbortSignal;
275
+ }): Promise<DataResult>;
276
+ search(query: string, options?: {
277
+ limit?: number;
278
+ signal?: AbortSignal;
279
+ }): Promise<SearchHit[]>;
280
+ }
@@ -0,0 +1,9 @@
1
+ import type { PluginManifest } from "./package";
2
+ /** 发布内容只携带插件产物元数据,不依赖编辑器或 UI 类型。 */
3
+ export interface PublishedPluginRender {
4
+ runtimeVersion: 1;
5
+ manifest: PluginManifest;
6
+ entry: string;
7
+ styles?: string;
8
+ nodeTypes: string[];
9
+ }
@@ -1,41 +1,5 @@
1
- import type { ReactNode, ReactElement } from "react";
2
- import type { LucideIcon } from "lucide-react";
3
- import type { Editor, Element, Path } from "slate";
4
- import type { ElementBehaviors, ParagraphElement, BlockElement } from "../../editor/api";
5
- export interface SourceBlockEditorProps {
6
- mode: string;
7
- title: string;
8
- icon: LucideIcon;
9
- initValue: string;
10
- onChange(value: string): void;
11
- element: Element;
12
- center?: boolean;
13
- extend?: boolean;
14
- fluid?: boolean;
15
- children?: ReactNode;
16
- }
17
- export interface PluginRuntimeStyleCompiler {
18
- compile(request: {
19
- source: string;
20
- language: "html" | "tsx";
21
- }): Promise<string>;
22
- }
23
- export interface SourceEditorRuntime {
24
- SourceBlockEditor(props: SourceBlockEditorProps): ReactElement;
25
- useSourceBlock(element: Element): {
26
- theme: {
27
- isDark: boolean;
28
- token(word: string): string;
29
- };
30
- compiler: PluginRuntimeStyleCompiler | undefined;
31
- update(properties: Record<string, unknown>): void;
32
- };
33
- useReportPreviewError(error: string | null, options?: {
34
- stale?: boolean;
35
- }): boolean;
36
- insertSourceBlock(editor: Editor, element: BlockElement, line?: number): Path | undefined;
37
- sourceBlockParagraphBehavior(type: string): ElementBehaviors<ParagraphElement>;
38
- }
1
+ import type { SourceEditorRuntime } from "../../editor/source-contracts";
2
+ export type { SourceBlockEditorProps, RuntimeStyleCompiler as PluginRuntimeStyleCompiler, SourceEditorRuntime, } from "../../editor/source-contracts";
39
3
  export declare function configureSourceEditor(value: SourceEditorRuntime): void;
40
4
  export declare const SourceBlockEditor: SourceEditorRuntime["SourceBlockEditor"];
41
5
  export declare const useSourceBlock: SourceEditorRuntime["useSourceBlock"];
@@ -0,0 +1,4 @@
1
+ export declare function comparePluginVersions(left: string, right: string): number;
2
+ export declare function assertPluginCompatibility(manifest: {
3
+ minAppVersion?: string;
4
+ }, clientVersion: string): void;
@@ -1 +0,0 @@
1
- export type { FormattedText } from "../../../markdown/src/model";