@xiongtao.xt/tau-plugins 0.43.0 → 0.45.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 (266) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/client/chunk-CEWYJJKJ.js +41 -0
  3. package/client/{fuse-M2Z6NNAT.js → fuse-OHBNZPDB.js} +2 -0
  4. package/docs/README.md +4 -2
  5. package/docs/api-support.md +22 -5
  6. package/docs/content-metrics.md +45 -0
  7. package/docs/editor-collaboration.md +146 -0
  8. package/docs/editor.md +34 -27
  9. package/docs/getting-started.md +3 -3
  10. package/docs/plugin-basics.md +1 -0
  11. package/docs/portability.md +8 -4
  12. package/docs/providers/asr.md +3 -1
  13. package/docs/providers/tts.md +15 -0
  14. package/docs/release.md +1 -1
  15. package/docs/whiteboard-collaboration.md +67 -0
  16. package/docs/whiteboard.md +55 -13
  17. package/package.js +1 -0
  18. package/package.json +5 -4
  19. package/portable.js +1 -0
  20. package/publish-artifacts.js +18040 -31
  21. package/publish-client.js +3 -1
  22. package/types/packages/collaboration/src/protocol.d.ts +144 -0
  23. package/types/packages/collaboration/src/whiteboard-contract.d.ts +6 -0
  24. package/types/packages/collaboration/src/whiteboard-types.d.ts +181 -0
  25. package/types/packages/collaboration/whiteboard-types.d.ts +1 -0
  26. package/types/packages/db-schema/content-contracts.d.ts +83 -0
  27. package/types/packages/db-schema/content-identities.d.ts +19 -0
  28. package/types/packages/db-schema/content-metrics.d.ts +30 -0
  29. package/types/packages/db-schema/content-resources.d.ts +4 -0
  30. package/types/packages/db-schema/data-versions.d.ts +16 -0
  31. package/types/packages/editor/contracts.d.ts +2 -2
  32. package/types/packages/editor/source-contracts.d.ts +39 -3
  33. package/types/packages/editor/src/Editor.d.ts +7 -0
  34. package/types/packages/editor/src/builtin-types.d.ts +22 -0
  35. package/types/packages/editor/src/core/CoreEditor.d.ts +44 -0
  36. package/types/packages/editor/src/core/api/elementVersions.d.ts +12 -0
  37. package/types/packages/editor/src/core/api/elementView.d.ts +14 -0
  38. package/types/packages/editor/src/core/api/extension.d.ts +10 -0
  39. package/types/packages/editor/src/core/api/index.d.ts +8 -0
  40. package/types/packages/editor/src/core/api/slateTextFields.d.ts +6 -0
  41. package/types/packages/editor/src/core/api/textFieldInput.d.ts +14 -0
  42. package/types/packages/editor/src/core/api/useTextFieldBinding.d.ts +9 -0
  43. package/types/packages/editor/src/core/document/EditorDocument.d.ts +74 -0
  44. package/types/packages/editor/src/core/extensions/markdown-paste-import/index.d.ts +10 -0
  45. package/types/packages/editor/src/core/hooks/useTouchVoidSelection.d.ts +10 -0
  46. package/types/packages/editor/src/core/index.d.ts +36 -0
  47. package/types/packages/editor/src/core/kit/ExtensionAssembly.d.ts +5 -1
  48. package/types/packages/editor/src/core/menu/defaultMenu.d.ts +2 -0
  49. package/types/packages/editor/src/core/plugins/withMarkdownPasteImport.d.ts +17 -0
  50. package/types/packages/editor/src/core/services/elementEditingPolicy.d.ts +0 -1
  51. package/types/packages/editor/src/core/utils/blockNavigation.d.ts +1 -1
  52. package/types/packages/editor/src/core/utils/editor.d.ts +2 -2
  53. package/types/packages/editor/src/core/utils/hotkey.d.ts +17 -0
  54. package/types/packages/editor/src/core/utils/index.d.ts +9 -0
  55. package/types/packages/editor/src/core/utils/normalizeEditorContent.d.ts +2 -0
  56. package/types/packages/editor/src/core/utils/plugin.d.ts +1 -1
  57. package/types/packages/editor/src/extensions/annotation/src/augmentations.d.ts +9 -0
  58. package/types/packages/editor/src/extensions/annotation/src/types.d.ts +6 -0
  59. package/types/packages/editor/src/extensions/blockquote/src/augmentations.d.ts +6 -0
  60. package/types/packages/editor/src/extensions/blockquote/src/types.d.ts +7 -0
  61. package/types/packages/editor/src/extensions/callout/src/augmentations.d.ts +6 -0
  62. package/types/packages/editor/src/extensions/callout/src/types.d.ts +11 -0
  63. package/types/packages/editor/src/extensions/callout/src/variants.d.ts +1 -0
  64. package/types/packages/editor/src/extensions/code-block/src/augmentations.d.ts +7 -0
  65. package/types/packages/editor/src/extensions/code-block/src/types/code-block.d.ts +40 -0
  66. package/types/packages/editor/src/extensions/code-block/src/types/index.d.ts +1 -0
  67. package/types/packages/editor/src/extensions/comment/src/augmentations.d.ts +9 -0
  68. package/types/packages/editor/src/extensions/comment/src/types.d.ts +15 -0
  69. package/types/packages/editor/src/extensions/detail/src/augmentations.d.ts +6 -0
  70. package/types/packages/editor/src/extensions/detail/src/types.d.ts +9 -0
  71. package/types/packages/editor/src/extensions/diagram/src/augmentations.d.ts +7 -0
  72. package/types/packages/editor/src/extensions/diagram/src/types/index.d.ts +4 -0
  73. package/types/packages/editor/src/extensions/diagram/src/types/mermaid.d.ts +12 -0
  74. package/types/packages/editor/src/extensions/diagram/src/types/plantuml.d.ts +6 -0
  75. package/types/packages/editor/src/extensions/diagram/src/types/typst.d.ts +9 -0
  76. package/types/packages/editor/src/extensions/divide-line/src/augmentations.d.ts +6 -0
  77. package/types/packages/editor/src/extensions/divide-line/src/types.d.ts +5 -0
  78. package/types/packages/editor/src/extensions/emoji/src/augmentations.d.ts +9 -0
  79. package/types/packages/editor/src/extensions/emoji/src/types.d.ts +9 -0
  80. package/types/packages/editor/src/extensions/front-matter/src/augmentations.d.ts +6 -0
  81. package/types/packages/editor/src/extensions/front-matter/src/types.d.ts +6 -0
  82. package/types/packages/editor/src/extensions/header/src/augmentations.d.ts +6 -0
  83. package/types/packages/editor/src/extensions/header/src/types.d.ts +8 -0
  84. package/types/packages/editor/src/extensions/highlight-block/src/augmentations.d.ts +6 -0
  85. package/types/packages/editor/src/extensions/highlight-block/src/types.d.ts +10 -0
  86. package/types/packages/editor/src/extensions/highlight-block/src/variants.d.ts +1 -0
  87. package/types/packages/editor/src/extensions/kbd/src/augmentations.d.ts +9 -0
  88. package/types/packages/editor/src/extensions/kbd/src/types.d.ts +5 -0
  89. package/types/packages/editor/src/extensions/link/src/augmentations.d.ts +9 -0
  90. package/types/packages/editor/src/extensions/link/src/types.d.ts +6 -0
  91. package/types/packages/editor/src/extensions/list/src/augmentations.d.ts +10 -0
  92. package/types/packages/editor/src/extensions/list/src/types/check-list.d.ts +25 -0
  93. package/types/packages/editor/src/extensions/list/src/types/list.d.ts +18 -0
  94. package/types/packages/editor/src/extensions/list/src/types.d.ts +3 -0
  95. package/types/packages/editor/src/extensions/math/src/augmentations.d.ts +10 -0
  96. package/types/packages/editor/src/extensions/math/src/types.d.ts +11 -0
  97. package/types/packages/editor/src/extensions/media/src/augmentations.d.ts +15 -0
  98. package/types/packages/editor/src/extensions/media/src/components/ImageCropEditor/geometry.d.ts +119 -0
  99. package/types/packages/editor/src/extensions/media/src/types/element/audio.d.ts +13 -0
  100. package/types/packages/editor/src/extensions/media/src/types/element/image-appearance.d.ts +2 -0
  101. package/types/packages/editor/src/extensions/media/src/types/element/image.d.ts +31 -0
  102. package/types/packages/editor/src/extensions/media/src/types/element/inline-image.d.ts +10 -0
  103. package/types/packages/editor/src/extensions/media/src/types/element/video.d.ts +21 -0
  104. package/types/packages/editor/src/extensions/styled-text/src/augmentations.d.ts +9 -0
  105. package/types/packages/editor/src/extensions/styled-text/src/colors.d.ts +75 -0
  106. package/types/packages/editor/src/extensions/styled-text/src/types.d.ts +7 -0
  107. package/types/packages/editor/src/extensions/table/src/align.d.ts +2 -0
  108. package/types/packages/editor/src/extensions/table/src/augmentations.d.ts +8 -0
  109. package/types/packages/editor/src/extensions/table/src/types.d.ts +19 -0
  110. package/types/packages/editor/src/extensions/tabs/src/augmentations.d.ts +7 -0
  111. package/types/packages/editor/src/extensions/tabs/src/types.d.ts +29 -0
  112. package/types/packages/editor/src/extensions/underline/src/augmentations.d.ts +9 -0
  113. package/types/packages/editor/src/extensions/underline/src/types.d.ts +8 -0
  114. package/types/packages/editor/src/extensions/webview/src/augmentations.d.ts +6 -0
  115. package/types/packages/editor/src/extensions/webview/src/types.d.ts +14 -0
  116. package/types/packages/editor/src/index.d.ts +4 -0
  117. package/types/packages/editor/src/presets/default.d.ts +2 -0
  118. package/types/packages/editor/text-field-contract.d.ts +36 -0
  119. package/types/packages/markdown/src/codec.d.ts +2 -0
  120. package/types/packages/markdown/src/index.d.ts +1 -0
  121. package/types/packages/markdown/src/markdown-helper.d.ts +3 -0
  122. package/types/packages/markdown/src/markdownSerializerRegistry.d.ts +8 -2
  123. package/types/packages/markdown/src/positionMapper.d.ts +1 -0
  124. package/types/packages/markdown/src/processor.d.ts +3 -0
  125. package/types/packages/markdown/src/unknownNode.d.ts +24 -0
  126. package/types/packages/plugins/src/content-input.d.ts +1 -0
  127. package/types/packages/plugins/src/contract.d.ts +3 -0
  128. package/types/packages/plugins/src/data.d.ts +1 -0
  129. package/types/packages/plugins/src/editor.d.ts +4 -0
  130. package/types/packages/plugins/src/flashcards.d.ts +2 -0
  131. package/types/packages/plugins/src/index.d.ts +2 -2
  132. package/types/packages/plugins/src/rendering.d.ts +1 -1
  133. package/types/packages/plugins/src/source-editor.d.ts +2 -0
  134. package/types/packages/plugins/src/whiteboard.d.ts +3 -2
  135. package/types/packages/shared/color-utils.d.ts +19 -0
  136. package/types/packages/shared/media-services.d.ts +18 -0
  137. package/types/packages/shared/media-types.d.ts +1 -0
  138. package/types/packages/shared/src/task-assistant/contracts.d.ts +119 -0
  139. package/types/packages/shared/src/task-assistant/document-state.d.ts +14 -0
  140. package/types/packages/shared/src/task-assistant/schema.d.ts +42 -0
  141. package/types/packages/shared/task-assistant.d.ts +3 -0
  142. package/types/packages/whiteboard/src/Board.d.ts +180 -0
  143. package/types/packages/whiteboard/src/WhiteBoard.d.ts +53 -0
  144. package/types/packages/whiteboard/src/author.d.ts +5 -3
  145. package/types/packages/whiteboard/src/components/ArrowConnectPointGroup/index.d.ts +13 -0
  146. package/types/packages/whiteboard/src/components/ArrowDropConnectPoint/index.d.ts +7 -0
  147. package/types/packages/whiteboard/src/components/DocumentElement/index.d.ts +13 -0
  148. package/types/packages/whiteboard/src/components/ResizeCircle/index.d.ts +15 -0
  149. package/types/packages/whiteboard/src/components/SketchPaths/SketchRect.d.ts +21 -0
  150. package/types/packages/whiteboard/src/components/Toolbar/ToolMenu.d.ts +15 -0
  151. package/types/packages/whiteboard/src/constants/arrow.d.ts +19 -0
  152. package/types/packages/whiteboard/src/constants/boardIdentity.d.ts +2 -0
  153. package/types/packages/whiteboard/src/constants/geometry.d.ts +7 -0
  154. package/types/packages/whiteboard/src/constants/grid.d.ts +4 -0
  155. package/types/packages/whiteboard/src/constants/image.d.ts +21 -0
  156. package/types/packages/whiteboard/src/constants/index.d.ts +13 -0
  157. package/types/packages/whiteboard/src/constants/map.d.ts +2 -0
  158. package/types/packages/whiteboard/src/constants/mind-themes.d.ts +30 -0
  159. package/types/packages/whiteboard/src/constants/mind.d.ts +14 -0
  160. package/types/packages/whiteboard/src/constants/resize.d.ts +2 -0
  161. package/types/packages/whiteboard/src/constants/select.d.ts +4 -0
  162. package/types/packages/whiteboard/src/constants/shadow.d.ts +12 -0
  163. package/types/packages/whiteboard/src/constants/sketch.d.ts +16 -0
  164. package/types/packages/whiteboard/src/constants/text-style.d.ts +68 -0
  165. package/types/packages/whiteboard/src/constants/tools.d.ts +11 -0
  166. package/types/packages/whiteboard/src/constants/viewport.d.ts +3 -0
  167. package/types/packages/whiteboard/src/document-version.d.ts +9 -0
  168. package/types/packages/whiteboard/src/document.d.ts +47 -0
  169. package/types/packages/whiteboard/src/extensions/api.d.ts +9 -0
  170. package/types/packages/whiteboard/src/extensions/authorApi.d.ts +10 -0
  171. package/types/packages/whiteboard/src/extensions/authorHooks.d.ts +2 -2
  172. package/types/packages/whiteboard/src/extensions/authorTypes.d.ts +150 -0
  173. package/types/packages/whiteboard/src/extensions/media.d.ts +50 -0
  174. package/types/packages/whiteboard/src/extensions/publicHooks.d.ts +2 -0
  175. package/types/packages/whiteboard/src/extensions/runtime.d.ts +95 -0
  176. package/types/packages/whiteboard/src/extensions/text.d.ts +58 -0
  177. package/types/packages/whiteboard/src/extensions/versions.d.ts +2 -0
  178. package/types/packages/whiteboard/src/hooks/useBoardState.d.ts +6 -0
  179. package/types/packages/whiteboard/src/hooks/useDropArrow.d.ts +76 -0
  180. package/types/packages/whiteboard/src/hooks/useElementsMoving.d.ts +10 -0
  181. package/types/packages/whiteboard/src/hooks/useMindTheme.d.ts +8 -0
  182. package/types/packages/whiteboard/src/hooks/useSelectState.d.ts +10 -0
  183. package/types/packages/whiteboard/src/hooks/useSketch.d.ts +15 -0
  184. package/types/packages/whiteboard/src/index.d.ts +54 -0
  185. package/types/packages/whiteboard/src/interactions/InteractionManager.d.ts +68 -0
  186. package/types/packages/whiteboard/src/interactions/InteractionState.d.ts +28 -0
  187. package/types/packages/whiteboard/src/interactions/states/ResizingState.d.ts +40 -0
  188. package/types/packages/whiteboard/src/plugins/ArrowPlugin.d.ts +48 -0
  189. package/types/packages/whiteboard/src/plugins/AudioPlugin.d.ts +15 -0
  190. package/types/packages/whiteboard/src/plugins/ColumnPlugin.d.ts +81 -0
  191. package/types/packages/whiteboard/src/plugins/CommonPlugin.d.ts +104 -0
  192. package/types/packages/whiteboard/src/plugins/CopyPastePlugin.d.ts +38 -0
  193. package/types/packages/whiteboard/src/plugins/DocumentPlugin.d.ts +41 -0
  194. package/types/packages/whiteboard/src/plugins/ExportImagePlugin.d.ts +6 -0
  195. package/types/packages/whiteboard/src/plugins/FileDragDropPlugin.d.ts +15 -0
  196. package/types/packages/whiteboard/src/plugins/FramePlugin.d.ts +14 -0
  197. package/types/packages/whiteboard/src/plugins/GeometryPlugin.d.ts +31 -0
  198. package/types/packages/whiteboard/src/plugins/HandwritePlugin.d.ts +22 -0
  199. package/types/packages/whiteboard/src/plugins/ImagePlugin.d.ts +21 -0
  200. package/types/packages/whiteboard/src/plugins/MindPlugin.d.ts +72 -0
  201. package/types/packages/whiteboard/src/plugins/PresentationPlugin.d.ts +13 -0
  202. package/types/packages/whiteboard/src/plugins/RichTextPlugin.d.ts +44 -0
  203. package/types/packages/whiteboard/src/plugins/VideoPlugin.d.ts +14 -0
  204. package/types/packages/whiteboard/src/plugins/ViewPortPlugin.d.ts +13 -0
  205. package/types/packages/whiteboard/src/plugins/WebviewPlugin.d.ts +11 -0
  206. package/types/packages/whiteboard/src/plugins/WhiteBoardPlugin.d.ts +31 -0
  207. package/types/packages/whiteboard/src/plugins/index.d.ts +19 -0
  208. package/types/packages/whiteboard/src/public.d.ts +54 -0
  209. package/types/packages/whiteboard/src/schematic/PageSchematic.d.ts +13 -0
  210. package/types/packages/whiteboard/src/services/CapabilityService.d.ts +186 -0
  211. package/types/packages/whiteboard/src/transforms/SelectTransforms.d.ts +4 -0
  212. package/types/packages/whiteboard/src/transforms/SketchTransforms.d.ts +5 -0
  213. package/types/packages/whiteboard/src/transforms/ViewPortTransforms.d.ts +26 -0
  214. package/types/packages/whiteboard/src/transforms/index.d.ts +3 -0
  215. package/types/packages/whiteboard/src/types/arrow.d.ts +52 -0
  216. package/types/packages/whiteboard/src/types/audio.d.ts +8 -0
  217. package/types/packages/whiteboard/src/types/board.d.ts +79 -0
  218. package/types/packages/whiteboard/src/types/capabilities.d.ts +267 -0
  219. package/types/packages/whiteboard/src/types/column.d.ts +71 -0
  220. package/types/packages/whiteboard/src/types/element.d.ts +1 -0
  221. package/types/packages/whiteboard/src/types/frame.d.ts +35 -0
  222. package/types/packages/whiteboard/src/types/image.d.ts +19 -0
  223. package/types/packages/whiteboard/src/types/index.d.ts +33 -0
  224. package/types/packages/whiteboard/src/types/mind.d.ts +54 -0
  225. package/types/packages/whiteboard/src/types/resize.d.ts +16 -0
  226. package/types/packages/whiteboard/src/types/video.d.ts +20 -0
  227. package/types/packages/whiteboard/src/types/webview.d.ts +7 -0
  228. package/types/packages/whiteboard/src/utils/ArrowConnectTracker.d.ts +50 -0
  229. package/types/packages/whiteboard/src/utils/ArrowStyleUtil.d.ts +15 -0
  230. package/types/packages/whiteboard/src/utils/ArrowUtil.d.ts +11 -0
  231. package/types/packages/whiteboard/src/utils/AudioUtil.d.ts +20 -0
  232. package/types/packages/whiteboard/src/utils/BoardUtil.d.ts +101 -0
  233. package/types/packages/whiteboard/src/utils/CanvasUtil.d.ts +5 -0
  234. package/types/packages/whiteboard/src/utils/ClipboardUtil.d.ts +8 -0
  235. package/types/packages/whiteboard/src/utils/ColumnUtil.d.ts +125 -0
  236. package/types/packages/whiteboard/src/utils/ConnectPointOwner.d.ts +36 -0
  237. package/types/packages/whiteboard/src/utils/ConnectPointUtil.d.ts +66 -0
  238. package/types/packages/whiteboard/src/utils/Constraints.d.ts +6 -0
  239. package/types/packages/whiteboard/src/utils/ExportImageUtil.d.ts +14 -0
  240. package/types/packages/whiteboard/src/utils/FrameUtil.d.ts +90 -0
  241. package/types/packages/whiteboard/src/utils/GeometryUtil.d.ts +18 -0
  242. package/types/packages/whiteboard/src/utils/HandwriteGroupUtil.d.ts +25 -0
  243. package/types/packages/whiteboard/src/utils/HandwriteUtil.d.ts +39 -0
  244. package/types/packages/whiteboard/src/utils/ImageUtil.d.ts +13 -0
  245. package/types/packages/whiteboard/src/utils/LayerOrderUtil.d.ts +16 -0
  246. package/types/packages/whiteboard/src/utils/MindThemePreviewStore.d.ts +11 -0
  247. package/types/packages/whiteboard/src/utils/MindThemeUtil.d.ts +54 -0
  248. package/types/packages/whiteboard/src/utils/MindUtil.d.ts +65 -0
  249. package/types/packages/whiteboard/src/utils/PathUtil.d.ts +80 -0
  250. package/types/packages/whiteboard/src/utils/PointUtil.d.ts +50 -0
  251. package/types/packages/whiteboard/src/utils/PresentationManager.d.ts +53 -0
  252. package/types/packages/whiteboard/src/utils/RichTextContentUtil.d.ts +17 -0
  253. package/types/packages/whiteboard/src/utils/SelectionActionUtil.d.ts +9 -0
  254. package/types/packages/whiteboard/src/utils/TextStyleStore.d.ts +10 -0
  255. package/types/packages/whiteboard/src/utils/VideoUtil.d.ts +11 -0
  256. package/types/packages/whiteboard/src/utils/ViewportUtil.d.ts +10 -0
  257. package/types/packages/whiteboard/src/utils/common.d.ts +18 -0
  258. package/types/packages/whiteboard/src/utils/events.d.ts +13 -0
  259. package/types/packages/whiteboard/src/utils/index.d.ts +28 -0
  260. package/types/packages/whiteboard/src/utils/sketch/arrow.d.ts +29 -0
  261. package/types/packages/whiteboard/src/utils/sketch/batch.d.ts +10 -0
  262. package/types/packages/whiteboard/src/utils/sketch/index.d.ts +9 -0
  263. package/types/packages/whiteboard/src/utils/sketch/patch.d.ts +5 -0
  264. package/types/packages/whiteboard/src/utils/sketch/resolve.d.ts +14 -0
  265. package/types/packages/whiteboard/src/utils/snap/SnapGeometry.d.ts +52 -0
  266. package/types/packages/whiteboard/src/utils/snap/SnapManager.d.ts +57 -0
@@ -0,0 +1,12 @@
1
+ import type { Editor, Element } from "slate";
2
+ import type { ElementSpec } from "./extension";
3
+ export interface ElementVersionAccess {
4
+ element: ElementSpec;
5
+ access: "read" | "edit" | "none";
6
+ }
7
+ export type ElementVersionResolver = (element: Element) => ElementVersionAccess | undefined;
8
+ export declare function bindElementDefinitions(editor: Editor, elements: readonly ElementSpec[]): void;
9
+ export declare const currentElementDefinition: (editor: Editor, type: string) => ElementSpec | undefined;
10
+ export declare function setElementVersionResolver(editor: Editor, resolver: ElementVersionResolver | undefined): void;
11
+ export declare const getElementVersionResolver: (editor: Editor) => ElementVersionResolver | undefined;
12
+ export declare function canEditElement(editor: Editor, element: Element): boolean;
@@ -0,0 +1,14 @@
1
+ import type { Editor, Element } from "slate";
2
+ type View = Readonly<Record<string, unknown>>;
3
+ interface Entry {
4
+ getSnapshot(): View;
5
+ subscribe(listener: () => void): () => void;
6
+ update(patch: Record<string, unknown>): void;
7
+ }
8
+ /** 组件读取本机视图;持久化由当前文档服务负责,临时编辑器只保留会话内状态。 */
9
+ export declare function elementView(editor: Editor, element: Element): Entry;
10
+ export declare function useElementView(element: Element): {
11
+ value: Readonly<Record<string, unknown>>;
12
+ update: (patch: Record<string, unknown>) => void;
13
+ };
14
+ export {};
@@ -1,3 +1,4 @@
1
+ import { type DataMigration, type PreviousDataVersion } from "../../../../db-schema/data-versions";
1
2
  import type { ComponentType, ReactNode } from "react";
2
3
  import type { Descendant, Editor, Element, NodeEntry, TextUnit } from "slate";
3
4
  import type { RenderElementProps } from "slate-react";
@@ -11,6 +12,9 @@ import type { ElementCopy } from "./copy";
11
12
  import type { DecorationSpec, MarkSpec } from "./marks";
12
13
  import type { InputRule } from "./inputRules";
13
14
  import type { ContentResourceSpec } from "../../../../db-schema/content-resources";
15
+ import { type ContentCollaborationSpec } from "../../../../db-schema/content-contracts";
16
+ export type ElementDataMigration = DataMigration;
17
+ export type PreviousElementVersion = PreviousDataVersion<ElementSpec>;
14
18
  /**
15
19
  * 扩展 API v2(01 §5.1):声明式描述「这个扩展贡献了什么」,内核负责装配、隔离与分发。
16
20
  * 所有扩展都是 defineExtension 的产物(旧 IExtension 适配层已删除,ER-019)。
@@ -50,6 +54,11 @@ export interface ElementFrame {
50
54
  export interface ElementSpec<E extends Element = Element> {
51
55
  /** 元素 type;内置类型沿用现有名字,兼容已有文档 */
52
56
  type: string;
57
+ /** 数据结构与同步语义版本;无版本的旧声明不能进入新契约文档。 */
58
+ dataVersion?: number;
59
+ collaboration?: ContentCollaborationSpec;
60
+ previousVersions?: readonly PreviousElementVersion[];
61
+ migrations?: readonly ElementDataMigration[];
53
62
  kind: "block" | "inline";
54
63
  isVoid?: boolean;
55
64
  /** 后代的方向键/退格导航由领域接管,核心不执行默认相邻块导航。 */
@@ -115,4 +124,5 @@ export type ExtensionDefinition = Omit<EditorExtension, "apiVersion"> & {
115
124
  export declare function defineExtension(definition: ExtensionDefinition): EditorExtension;
116
125
  /** 按元素类型收窄 render / behaviors 的参数类型;运行时原样返回 */
117
126
  export declare function defineElement<E extends Element>(spec: ElementSpec<E>): ElementSpec;
127
+ export declare function assertElementVersions(spec: ElementSpec): void;
118
128
  export declare const isEditorExtension: (value: unknown) => value is EditorExtension;
@@ -6,6 +6,8 @@
6
6
  */
7
7
  export { EXTENSION_API_VERSION, defineExtension, defineElement, type EditorExtension, type ExtensionDefinition, type ElementSpec, type ElementFrame, type ElementEmptyContext, type ElementBehaviors, type ElementRenderProps, type ExtensionLayerProps, } from "./extension";
8
8
  export type { AnyExtension } from "./legacy";
9
+ export { elementView, useElementView } from "./elementView";
10
+ export { canEditElement, getElementVersionResolver, setElementVersionResolver, type ElementVersionAccess, type ElementVersionResolver, } from "./elementVersions";
9
11
  export type { CopyDecision, CopyContext, ElementCopy } from "./copy";
10
12
  export type { MarkSpec, MarkRenderProps, DecorationSpec } from "./marks";
11
13
  export type { InputRule, MarkInputRule, InlineInputRule } from "./inputRules";
@@ -50,6 +52,7 @@ export { default as AddParagraph, type AddParagraphRef } from "../components/Add
50
52
  export { IOverlayBackDismiss, type OverlayBackDismissProps, type OverlayBackDismissAdapter, } from "../services/overlayBackDismiss";
51
53
  export { default as OverlayBackDismiss } from "../components/OverlayBackDismiss/index";
52
54
  export { IEditorInteraction, useTouchInteraction, isTouchInteraction, type EditorInteraction, } from "../services/interaction";
55
+ export { useTouchVoidSelection } from "../hooks/useTouchVoidSelection";
53
56
  export { getElementParent, getClosestCurrentElement } from "../utils/editor";
54
57
  export { getParentNodeByNode, getPreviousSiblingNode } from "../utils/element";
55
58
  export { getPrevPath } from "../utils/path";
@@ -62,3 +65,8 @@ export { panAroundAnchor, pointFromCenter, type Point as ZoomPanPoint } from "..
62
65
  export { FloatingToolbar, ToolbarDivider, ToolbarIconButton } from "../components/FloatingToolbar/index";
63
66
  export { IElementEditingPolicy, type ElementEditingPolicy } from "../services/elementEditingPolicy";
64
67
  export { IUnknownElementNotice, type UnknownElementNotice } from "../services/unknownElementNotice";
68
+ export type { EditorTextField } from "../../../source-contracts";
69
+ export { useTextFieldBinding } from "./useTextFieldBinding";
70
+ export { bindTextFieldTextarea, rebaseTextFieldInput } from "./textFieldInput";
71
+ export { IEditorTextFields } from "../../../source-contracts";
72
+ export { slateTextFields } from "./slateTextFields";
@@ -0,0 +1,6 @@
1
+ import type { EditorTextFields } from "../../../source-contracts";
2
+ /**
3
+ * 供以 Slate 节点属性承载源码的文档绑定(如本地 Yjs 文档)注册 IEditorTextFields:
4
+ * 每个编辑器首次打开字段时建立一份,按该编辑器装配的节点声明校验字段。
5
+ */
6
+ export declare const slateTextFields: EditorTextFields;
@@ -0,0 +1,14 @@
1
+ import type { EditorTextField } from "../../../text-field-contract";
2
+ interface Edit {
3
+ offset: number;
4
+ remove: number;
5
+ text: string;
6
+ }
7
+ /** 输入法期间的替换只删除开始组合时已存在的字符,保留期间到达的远端插入。 */
8
+ export declare function rebaseTextFieldInput(local: Edit, remote: readonly Edit[]): Edit[];
9
+ /** 原生输入控件立即消费字段增量,避免 React 渲染时序把旧整段文本写回共享正文。 */
10
+ export declare function bindTextFieldTextarea(input: HTMLTextAreaElement | HTMLInputElement, field: EditorTextField, onValue: (value: string) => void, onError: (message: string) => void): {
11
+ write: (next: string) => void;
12
+ dispose(): void;
13
+ };
14
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Element } from "slate";
2
+ import { type EditorTextField } from "../../../source-contracts";
3
+ export declare function useTextFieldBinding(element: Element | undefined, field: string): {
4
+ binding: EditorTextField | null;
5
+ value: string;
6
+ revision: string;
7
+ readOnly: boolean;
8
+ error: string | null;
9
+ };
@@ -0,0 +1,74 @@
1
+ import type { ReactElement, ReactNode, RefObject } from "react";
2
+ import type { Descendant, Editor } from "slate";
3
+ import type { RenderElementProps } from "slate-react";
4
+ import type { ServiceRegistration } from "../services/registry";
5
+ /**
6
+ * 文档源:回答「内容从哪来、改动往哪去、谁管撤销」(docs/editor-refactor 01 §7.2、ER-009)。
7
+ *
8
+ * 普通值(`createValueDocument`)与 Yjs 绑定(`@tau/editor-collab` 的 `createNodeTreeDocument`)
9
+ * 是两种实现。同一篇内容在本机与共享之间切换时 `lineage` 不变,内核据此判断是
10
+ * 「换同步方式」(同一个 Slate editor 上 `rebind`)还是「换文档」(重建编辑器)。
11
+ */
12
+ export interface EditorDocument {
13
+ /** 内容谱系:同一篇内容在本机 / 共享之间切换时保持不变 */
14
+ readonly lineage: string;
15
+ /** "external" 表示撤销由文档源自己管(Yjs UndoManager),内核不装 withHistory */
16
+ readonly history: "slate" | "external";
17
+ /** 初始内容:挂载首帧使用;`bind` 接管内容的文档源可以给空数组 */
18
+ readonly initialValue: Descendant[];
19
+ /** 文档源要求的只读(如共享会话被冻结);与 `<Editor readonly>` 取或 */
20
+ readonly readonly?: boolean;
21
+ /** 本文档源需要覆盖的服务(如共享模式的资源上传) */
22
+ readonly services?: ServiceRegistration;
23
+ /** 挂到编辑器上:开始监听;返回卸载函数 */
24
+ attach?(editor: Editor): () => void;
25
+ /** 编辑器内容变化时回调 */
26
+ onChange?(value: Descendant[], editor: Editor): void;
27
+ /** 文档源自身状态变化(只读、在线状态等)时通知 */
28
+ subscribe?(listener: () => void): () => void;
29
+ /**
30
+ * 受信任层(ER-005,只给内部文档源用,不进公开 API):接管内容与撤销的文档源在这里
31
+ * 改写 Slate editor。创建编辑器时调用一次;`rebind` 在同谱系换源时调用。
32
+ * @internal
33
+ */
34
+ readonly binding?: EditorDocumentBinding;
35
+ }
36
+ /** @internal 接管内容来源的文档源(协作)给内核的钩子 */
37
+ export interface EditorDocumentBinding {
38
+ /** 创建编辑器时包装一次(装 withYjs 等),内核随后调用 `connect` */
39
+ install(editor: Editor): Editor;
40
+ /** 开始同步:内容从文档源读入 editor.children */
41
+ connect(editor: Editor): void;
42
+ /** 停止同步(先把未发出的本地改动写回文档源) */
43
+ disconnect(editor: Editor): void;
44
+ /**
45
+ * 同谱系换源:把已装好的 editor 从旧文档源迁到本文档源。调用时 editor 已由旧文档源
46
+ * `disconnect`;实现负责改写同步目标、连接,并尽量复用内容相同的节点对象。
47
+ * 返回 false 表示做不到(如不是同一种实现),内核改为重建编辑器。
48
+ */
49
+ rebind?(editor: Editor): boolean;
50
+ /** 让之后的修改另起一个撤销步(输入规则等自动转换用);history 为 "external" 时应提供 */
51
+ splitUndoStep?(editor: Editor): void;
52
+ /**
53
+ * 元素渲染拦截(如私有块占位);返回 undefined 走正常分发。
54
+ * `renderByType` 按 kit 分发,该类型没有扩展时返回 undefined。
55
+ */
56
+ renderElement?(props: RenderElementProps, renderByType: (props: RenderElementProps) => ReactElement | undefined): ReactElement | undefined;
57
+ /**
58
+ * 编辑区之上的覆盖层(如协作光标),容器是编辑区的定位父级。
59
+ * 用函数而不是组件:换源时组件类型一变,React 会重挂载整棵子树。
60
+ */
61
+ renderOverlay?(containerRef: RefObject<HTMLDivElement | null>): ReactNode;
62
+ /** 给子树提供上下文(如 useCollaboration);返回的外层元素类型必须稳定,理由同上 */
63
+ wrap?(children: ReactNode): ReactNode;
64
+ }
65
+ export interface ValueDocumentOptions {
66
+ /** 缺省按内容对象身份生成:同一份值视为同一篇文档 */
67
+ lineage?: string;
68
+ readonly?: boolean;
69
+ }
70
+ /**
71
+ * 普通值文档源:给 blog、预览、只读场景,以及 `<Editor initValue onChange>` 的等价形态。
72
+ * 撤销由内核的 withHistory 负责。
73
+ */
74
+ export declare function createValueDocument(initialValue: Descendant[], onChange?: (value: Descendant[], editor: Editor) => void, options?: ValueDocumentOptions): EditorDocument;
@@ -0,0 +1,10 @@
1
+ import type { Descendant } from "slate";
2
+ import type { ImportFromMarkdownOptions } from "../../plugins/withMarkdownPasteImport";
3
+ export type MarkdownImportFn = (markdown: string, ignoreTypes?: string[], options?: ImportFromMarkdownOptions) => Descendant[];
4
+ /**
5
+ * markdown 粘贴导入扩展(宿主 opt-in):
6
+ * 粘贴 markdown 文本时经宿主注入的 importFromMarkdown 解析为富文本结构。
7
+ * 内核默认不启用,由宿主放进 kit 的 extensions;
8
+ * 本扩展不对应任何元素类型,只贡献插件。
9
+ */
10
+ export declare const createMarkdownPasteImportExtension: (importFromMarkdown: MarkdownImportFn) => import("../../../../api").EditorExtension;
@@ -0,0 +1,10 @@
1
+ import { type Element } from "slate";
2
+ /**
3
+ * 触屏模式下 void 块(媒体、源码块等)的选中:选中即 Slate 选区折叠在该 void 内,宿主工具栏据选区识别并接管操作;
4
+ * 非触屏模式 selected 恒为 false,组件沿用自身的选中状态。
5
+ */
6
+ export declare function useTouchVoidSelection(element: Element): {
7
+ touch: boolean;
8
+ selected: boolean;
9
+ select: (this: unknown) => void;
10
+ };
@@ -0,0 +1,36 @@
1
+ export { default as Editor } from "./CoreEditor";
2
+ export type { MarkSpec, MarkRenderProps } from "./api/marks";
3
+ export { createEditorKit } from "./kit/EditorKit";
4
+ export { renderElementSpec } from "./kit/ExtensionAssembly";
5
+ export { defaultMenuExtension } from "./menu/defaultMenu";
6
+ export type { EditorKit, EditorKitOptions, EditorKitExtendOptions } from "./kit/EditorKit";
7
+ export { createValueDocument } from "./document/EditorDocument";
8
+ export type { EditorDocument, EditorDocumentBinding, ValueDocumentOptions, } from "./document/EditorDocument";
9
+ export { createServiceId, IExtensionErrorReporter, IEditorNotifier } from "./services/tokens";
10
+ export { defaultEditorNotifier } from "./services/notifier";
11
+ export type { EditorNotifier, EditorFeedback, EditorLoadingHandle, EditorConfirmOptions, EditorPromptOptions, } from "./services/notifier";
12
+ export { consoleErrorReporter } from "./services/errorReporter";
13
+ export type { ExtensionErrorEvent, ExtensionErrorReporter } from "./services/errorReporter";
14
+ export type { ServiceIdentifier } from "./services/tokens";
15
+ export { createServiceRegistry, createChildRegistry } from "./services/registry";
16
+ export type { ServiceRegistry, ServiceRegister, ServiceRegistration } from "./services/registry";
17
+ export { useServiceRegistry, useService, useOptionalService, useNotifier } from "./services/hooks";
18
+ export { notifierOf } from "./services/editorNotifier";
19
+ export { default as useIsLastElement } from "./hooks/useIsLastElement";
20
+ export { createMarkdownPasteImportExtension } from "./extensions/markdown-paste-import/index";
21
+ export type { MarkdownImportFn } from "./extensions/markdown-paste-import/index";
22
+ export { isMarkdownLikeText } from "./plugins/withMarkdownPasteImport";
23
+ export type { ImportFromMarkdownOptions } from "./plugins/withMarkdownPasteImport";
24
+ export { useEditorTheme, EditorThemeOverride } from "./theme/context";
25
+ export type { EditorTheme } from "./theme/context";
26
+ export { createDomThemeService, createStaticThemeService } from "./theme/ThemeService";
27
+ export type { ThemeService, EditorThemeMode } from "./theme/ThemeService";
28
+ export * from "./utils/element";
29
+ export { defineExtension, defineElement, type EditorExtension, type AnyExtension, type ElementSpec, type ElementEmptyContext, type ElementBehaviors, type ElementRenderProps, type ExtensionLayerProps, type EditorCommand, type EditorCommandContext, type EditorHotkey, } from "./api/index";
30
+ export * from "./utils/index";
31
+ export * from "./types";
32
+ export * from "./types/custom-element";
33
+ export { default as AddParagraph } from "./components/AddParagraph/index";
34
+ export type { IngestContext, IngestFilesRule, IngestTextRule, ElementIngestSpec, } from "./api/ingest";
35
+ export { default as InlineChromiumBugfix } from "./components/InlineChromiumBugFix/index";
36
+ export { BLOCK_DRAG_GROUP } from "./components/BlockDrag/index";
@@ -2,7 +2,7 @@ import { type ReactElement } from "react";
2
2
  import type { ContentResourceDeclarations } from "../../../../db-schema/content-resources";
3
3
  import type { Editor } from "slate";
4
4
  import type { RenderElementProps } from "slate-react";
5
- import type { EditorExtension, ElementBehaviors } from "../api/extension";
5
+ import type { EditorExtension, ElementBehaviors, ElementSpec } from "../api/extension";
6
6
  import { CommandRegistry, type EditorHotkey } from "../api/command";
7
7
  import { type ElementDragSpec } from "../api/drag";
8
8
  import type { ElementIngestSpec } from "../api/ingest";
@@ -24,6 +24,7 @@ export interface ExtensionPluginGroup {
24
24
  export interface ElementBehaviorEntry {
25
25
  readonly extension: string;
26
26
  readonly behaviors: ElementBehaviors;
27
+ readonly own?: boolean;
27
28
  }
28
29
  /** 一个扩展的内容注入声明;owner 用于隔离熔断与日志 */
29
30
  export interface IngestSource {
@@ -31,6 +32,8 @@ export interface IngestSource {
31
32
  readonly files?: ElementIngestSpec["files"];
32
33
  readonly text?: ElementIngestSpec["text"];
33
34
  }
35
+ type ElementRenderer = (props: RenderElementProps) => ReactElement | undefined;
36
+ export declare const renderElementSpec: (spec: ElementSpec) => ElementRenderer;
34
37
  /**
35
38
  * 扩展的预计算结果:插件链、快捷键、悬浮工具条条目与 type → 渲染的分发表。
36
39
  *
@@ -79,3 +82,4 @@ export declare class ExtensionAssembly {
79
82
  /** 块菜单条目:每次打开菜单求值;单个扩展出错只丢它自己的条目 */
80
83
  getBlockPanelItems(editor: Editor): IBlockPanelListItem[];
81
84
  }
85
+ export {};
@@ -0,0 +1,2 @@
1
+ /** 产品显式安装通用块菜单;旧转换命令只转发到已安装领域。 */
2
+ export declare const defaultMenuExtension: import("../../../api").EditorExtension;
@@ -0,0 +1,17 @@
1
+ import { Descendant } from "slate";
2
+ import type { Plugin } from "../utils/plugin";
3
+ /**
4
+ * 宿主注入的导入函数的第三个参数。编辑器内核不依赖 @tau/markdown(它反过来依赖编辑器的元素类型),
5
+ * 这里只声明结构,与 @tau/markdown 的 ImportFromMarkdownOptions 结构兼容。
6
+ */
7
+ export interface ImportFromMarkdownOptions {
8
+ customDirectives?: Record<string, (attributes: Record<string, string | undefined>) => Descendant | null>;
9
+ }
10
+ /** 粗判一段纯文本是否像 Markdown:粘贴时决定要不要交给宿主的导入函数 */
11
+ export declare const isMarkdownLikeText: (text: string) => boolean;
12
+ /**
13
+ * markdown 粘贴导入插件(宿主 opt-in):
14
+ * 经 createMarkdownPasteImportExtension 注入宿主的 importFromMarkdown
15
+ * (可携带业务 customDirectives),内核默认不启用。
16
+ */
17
+ export declare const createMarkdownPasteImportPlugin: (importFromMarkdown: (markdown: string, ignoreTypes?: string[], options?: ImportFromMarkdownOptions) => Descendant[]) => Plugin;
@@ -1,6 +1,5 @@
1
1
  /** 宿主按场景限制节点编辑,未注册时沿用编辑器自身只读状态。 */
2
2
  export interface ElementEditingPolicy {
3
3
  canEdit(type: string): boolean;
4
- sourcePresentation?: "pointer" | "touch";
5
4
  }
6
5
  export declare const IElementEditingPolicy: import("../../../../shared/service-contract").ServiceIdentifier<ElementEditingPolicy>;
@@ -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").CustomElement> | 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;
@@ -1,5 +1,5 @@
1
1
  import { Editor, Node, Element, NodeMatch, NodeEntry, Path } from "slate";
2
- import { ParagraphElement, BlockElement } from "../types";
2
+ import { BlockElement } from "../types";
3
3
  export declare const getCurrentTextNode: (editor: Editor) => NodeEntry<Node>;
4
4
  export declare const getClosestCurrentElement: (editor: Editor) => NodeEntry<BlockElement>;
5
5
  export declare const getLeafParent: (editor: Editor) => NodeEntry<import("slate").Ancestor> | undefined;
@@ -9,7 +9,7 @@ export declare const insertParagraphAndFocus: (editor: Editor, node: Element) =>
9
9
  export declare const replaceNode: (editor: Editor, node: Node, match: NodeMatch<Node>, options?: {}) => Path | undefined;
10
10
  export declare const isParagraphAndEmpty: (editor: Editor) => boolean;
11
11
  export declare const isCollapsed: (editor: Editor) => boolean;
12
- export declare const getCurrentEmptyNode: (editor: Editor) => NodeEntry<ParagraphElement> | undefined;
12
+ export declare const getCurrentEmptyNode: (editor: Editor) => NodeEntry<BlockElement> | undefined;
13
13
  export declare const focusBlockElement: (editor: Editor, node: Node) => void;
14
14
  export declare const removeCurrentEmptyNodeAndFocusPreviousNode: (editor: Editor) => void;
15
15
  export declare const isFirstChild: (editor: Editor, node: Node) => boolean;
@@ -0,0 +1,17 @@
1
+ import { Editor } from "slate";
2
+ import { IHotKeyConfig } from "../types";
3
+ import type { CommandDispatcher } from "../api/command";
4
+ /** 热键的两种来源:v2 绑命令 id;legacy 直函数(迁移期内并存,扩展迁 v2 时切换) */
5
+ export type ResolvedHotkey = {
6
+ kind: "command";
7
+ keys: string | string[];
8
+ command: string;
9
+ } | {
10
+ kind: "legacy";
11
+ config: IHotKeyConfig;
12
+ };
13
+ /**
14
+ * keydown 的统一入口:按声明顺序匹配,命令热键经注册表执行(隔离与 enablement 在
15
+ * dispatcher 里),legacy 热键执行 action。任一处理消费了事件(defaultPrevented)即停。
16
+ */
17
+ export declare const registerHotKey: (editor: Editor, event: React.KeyboardEvent<HTMLDivElement>, resolved: readonly ResolvedHotkey[], dispatcher?: CommandDispatcher) => void;
@@ -0,0 +1,9 @@
1
+ export * from "./editor";
2
+ export * from "./plugin";
3
+ export * from "./element";
4
+ export * from "./hotkey";
5
+ export * from "./path";
6
+ export * from "./insertElement";
7
+ export * from "./blockNavigation";
8
+ export * from "./normalizeEditorContent";
9
+ export * from "./container";
@@ -0,0 +1,2 @@
1
+ import type { Descendant } from "slate";
2
+ export declare const normalizeEditorContent: (content: unknown) => Descendant[];
@@ -1,4 +1,4 @@
1
1
  import { Editor } from "slate";
2
2
  /** 原始 Slate 插件:受信任层(ER-005),只给表达不了声明式行为的编辑器级改写用 */
3
3
  export type Plugin = (editor: Editor) => Editor;
4
- export declare const applyPlugin: (editor: Editor, plugins: Plugin[]) => import("../types").CustomEditor;
4
+ export declare const applyPlugin: (editor: Editor, plugins: Plugin[]) => import("../index").CustomEditor;
@@ -0,0 +1,9 @@
1
+ import type { AnnotationElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ annotation: AnnotationElement;
5
+ }
6
+ interface ExtensionInlineElementMap {
7
+ annotation: AnnotationElement;
8
+ }
9
+ }
@@ -0,0 +1,6 @@
1
+ import { type FormattedText } from "../../../../../markdown/src/model";
2
+ export interface AnnotationElement {
3
+ type: "annotation";
4
+ content: string;
5
+ children: FormattedText[];
6
+ }
@@ -0,0 +1,6 @@
1
+ import type { BlockquoteElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ blockquote: BlockquoteElement;
5
+ }
6
+ }
@@ -0,0 +1,7 @@
1
+ import type { BlockElement } from "../../../../api";
2
+ export interface BlockquoteElement {
3
+ type: "blockquote";
4
+ children: BlockElement[];
5
+ }
6
+ export type { ParagraphElement, IBlockPanelListItem } from "../../../../api";
7
+ export type { FormattedText } from "../../../../../markdown/src/model";
@@ -0,0 +1,6 @@
1
+ import type { CalloutElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ callout: CalloutElement;
5
+ }
6
+ }
@@ -0,0 +1,11 @@
1
+ import type { BlockElement } from "../../../../api";
2
+ import type { CalloutType } from "./variants";
3
+ export type { CalloutType } from "./variants";
4
+ export interface CalloutElement {
5
+ type: "callout";
6
+ calloutType: CalloutType;
7
+ title: string;
8
+ children: BlockElement[];
9
+ }
10
+ export type { ParagraphElement, IBlockPanelListItem } from "../../../../api";
11
+ export type { FormattedText } from "../../../../../markdown/src/model";
@@ -0,0 +1 @@
1
+ export type CalloutType = "tip" | "warning" | "info" | "danger" | "note";
@@ -0,0 +1,7 @@
1
+ import type { CodeBlockElement, CodeStepElement } from "./types/index";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ "code-block": CodeBlockElement;
5
+ "code-step": CodeStepElement;
6
+ }
7
+ }
@@ -0,0 +1,40 @@
1
+ import type { Descendant } from "slate";
2
+ export interface CodeStepElement {
3
+ type: "code-step";
4
+ code: string;
5
+ title?: string;
6
+ highlightLines?: string;
7
+ collabId?: string;
8
+ children: Descendant[];
9
+ }
10
+ export interface CodeBlockV2Element extends Omit<CodeBlockElement, "code" | "magicMove" | "highlightLines" | "isFold" | "foldHeight" | "children"> {
11
+ children: CodeStepElement[];
12
+ }
13
+ export interface CodeBlockMagicMoveStep {
14
+ id: string;
15
+ title?: string;
16
+ code: string;
17
+ highlightLines?: string;
18
+ }
19
+ export interface CodeBlockMagicMove {
20
+ v: 1;
21
+ activeStep: number;
22
+ steps: CodeBlockMagicMoveStep[];
23
+ }
24
+ export interface CodeBlockElement {
25
+ type: "code-block";
26
+ language: string;
27
+ code?: string;
28
+ uuid: string;
29
+ magicMove?: CodeBlockMagicMove;
30
+ highlightLines?: string;
31
+ /** 标题栏显示的文件名 */
32
+ filename?: string;
33
+ /** 自动换行;分步演示中不生效 */
34
+ wrap?: boolean;
35
+ /** 行号,缺省显示 */
36
+ lineNumbers?: boolean;
37
+ isFold?: boolean;
38
+ foldHeight?: number;
39
+ children: Descendant[];
40
+ }
@@ -0,0 +1 @@
1
+ export type { CodeBlockElement, CodeBlockV2Element, CodeStepElement, CodeBlockMagicMove, CodeBlockMagicMoveStep, } from "./code-block";
@@ -0,0 +1,9 @@
1
+ import type { CommentElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ comment: CommentElement;
5
+ }
6
+ interface ExtensionInlineElementMap {
7
+ comment: CommentElement;
8
+ }
9
+ }
@@ -0,0 +1,15 @@
1
+ import type { Descendant } from "slate";
2
+ export interface Comment {
3
+ id: string;
4
+ content: string;
5
+ createTime: number;
6
+ updateTime: number;
7
+ replies: Comment[];
8
+ }
9
+ export interface CommentElement {
10
+ type: "comment";
11
+ comments: Comment[];
12
+ uuid: string;
13
+ openEdit?: boolean;
14
+ children: Descendant[];
15
+ }
@@ -0,0 +1,6 @@
1
+ import type { DetailElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ detail: DetailElement;
5
+ }
6
+ }
@@ -0,0 +1,9 @@
1
+ import type { BlockElement } from "../../../../api";
2
+ export interface DetailElement {
3
+ type: "detail";
4
+ title: string;
5
+ open?: boolean;
6
+ children: BlockElement[];
7
+ }
8
+ export type { ParagraphElement, IBlockPanelListItem } from "../../../../api";
9
+ export type { FormattedText } from "../../../../../markdown/src/model";
@@ -0,0 +1,7 @@
1
+ import type { MermaidElement, PlantUMLElement } from "./types/index";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ mermaid: MermaidElement;
5
+ plantuml: PlantUMLElement;
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ import type { MermaidElement } from "./mermaid";
2
+ import type { PlantUMLElement } from "./plantuml";
3
+ import type { TypstElement } from "./typst";
4
+ export type { MermaidElement, PlantUMLElement, TypstElement };
@@ -0,0 +1,12 @@
1
+ import type { Descendant } from "slate";
2
+ export interface MermaidElement {
3
+ type: "mermaid";
4
+ chart: string;
5
+ /** Cached SVG output from mermaid rendering */
6
+ svg?: string;
7
+ /** The chart code that was used to generate the cached SVG */
8
+ compiledFrom?: string;
9
+ /** Timestamp when the SVG was compiled */
10
+ compiledAt?: number;
11
+ children: Descendant[];
12
+ }
@@ -0,0 +1,6 @@
1
+ import type { Descendant } from "slate";
2
+ export interface PlantUMLElement {
3
+ type: "plantuml";
4
+ content: string;
5
+ children: Descendant[];
6
+ }
@@ -0,0 +1,9 @@
1
+ import type { Descendant } from "slate";
2
+ export interface TypstElement {
3
+ type: "typst";
4
+ content: string;
5
+ html?: string;
6
+ compiledFrom?: string;
7
+ compiledAt?: number;
8
+ children: Descendant[];
9
+ }
@@ -0,0 +1,6 @@
1
+ import type { DivideLineElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ "divide-line": DivideLineElement;
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ import type { Descendant } from "slate";
2
+ export interface DivideLineElement {
3
+ type: "divide-line";
4
+ children: Descendant[];
5
+ }
@@ -0,0 +1,9 @@
1
+ import type { EmojiElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ emoji: EmojiElement;
5
+ }
6
+ interface ExtensionInlineElementMap {
7
+ emoji: EmojiElement;
8
+ }
9
+ }