@xiongtao.xt/tau-plugins 0.44.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 (246) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/client/{chunk-UTVEXGFI.js → chunk-CEWYJJKJ.js} +12 -1
  3. package/client/{fuse-KWYBABFA.js → fuse-OHBNZPDB.js} +1 -1
  4. package/docs/README.md +2 -2
  5. package/docs/api-support.md +17 -4
  6. package/docs/editor-collaboration.md +146 -0
  7. package/docs/editor.md +30 -27
  8. package/docs/getting-started.md +3 -3
  9. package/docs/portability.md +7 -3
  10. package/docs/providers/asr.md +3 -1
  11. package/docs/providers/tts.md +15 -0
  12. package/docs/release.md +1 -1
  13. package/docs/whiteboard-collaboration.md +67 -0
  14. package/docs/whiteboard.md +55 -13
  15. package/package.js +1 -1
  16. package/package.json +5 -4
  17. package/portable.js +1 -1
  18. package/publish-artifacts.js +17975 -76
  19. package/publish-client.js +2 -2
  20. package/types/packages/collaboration/src/protocol.d.ts +144 -0
  21. package/types/packages/collaboration/src/whiteboard-contract.d.ts +6 -0
  22. package/types/packages/collaboration/src/whiteboard-types.d.ts +181 -0
  23. package/types/packages/collaboration/whiteboard-types.d.ts +1 -0
  24. package/types/packages/db-schema/content-contracts.d.ts +4 -1
  25. package/types/packages/db-schema/content-identities.d.ts +19 -0
  26. package/types/packages/db-schema/data-versions.d.ts +16 -0
  27. package/types/packages/editor/source-contracts.d.ts +13 -41
  28. package/types/packages/editor/src/Editor.d.ts +7 -0
  29. package/types/packages/editor/src/builtin-types.d.ts +22 -0
  30. package/types/packages/editor/src/core/CoreEditor.d.ts +44 -0
  31. package/types/packages/editor/src/core/api/elementView.d.ts +14 -0
  32. package/types/packages/editor/src/core/api/extension.d.ts +3 -8
  33. package/types/packages/editor/src/core/api/index.d.ts +5 -0
  34. package/types/packages/editor/src/core/api/slateTextFields.d.ts +6 -0
  35. package/types/packages/editor/src/core/api/textFieldInput.d.ts +14 -0
  36. package/types/packages/editor/src/core/document/EditorDocument.d.ts +74 -0
  37. package/types/packages/editor/src/core/extensions/markdown-paste-import/index.d.ts +10 -0
  38. package/types/packages/editor/src/core/hooks/useTouchVoidSelection.d.ts +10 -0
  39. package/types/packages/editor/src/core/index.d.ts +36 -0
  40. package/types/packages/editor/src/core/menu/defaultMenu.d.ts +2 -0
  41. package/types/packages/editor/src/core/plugins/withMarkdownPasteImport.d.ts +17 -0
  42. package/types/packages/editor/src/core/services/elementEditingPolicy.d.ts +0 -1
  43. package/types/packages/editor/src/core/utils/blockNavigation.d.ts +1 -1
  44. package/types/packages/editor/src/core/utils/editor.d.ts +2 -2
  45. package/types/packages/editor/src/core/utils/hotkey.d.ts +17 -0
  46. package/types/packages/editor/src/core/utils/index.d.ts +9 -0
  47. package/types/packages/editor/src/core/utils/normalizeEditorContent.d.ts +2 -0
  48. package/types/packages/editor/src/core/utils/plugin.d.ts +1 -1
  49. package/types/packages/editor/src/extensions/annotation/src/augmentations.d.ts +9 -0
  50. package/types/packages/editor/src/extensions/annotation/src/types.d.ts +6 -0
  51. package/types/packages/editor/src/extensions/blockquote/src/augmentations.d.ts +6 -0
  52. package/types/packages/editor/src/extensions/blockquote/src/types.d.ts +7 -0
  53. package/types/packages/editor/src/extensions/callout/src/augmentations.d.ts +6 -0
  54. package/types/packages/editor/src/extensions/callout/src/types.d.ts +11 -0
  55. package/types/packages/editor/src/extensions/callout/src/variants.d.ts +1 -0
  56. package/types/packages/editor/src/extensions/code-block/src/augmentations.d.ts +7 -0
  57. package/types/packages/editor/src/extensions/code-block/src/types/code-block.d.ts +40 -0
  58. package/types/packages/editor/src/extensions/code-block/src/types/index.d.ts +1 -0
  59. package/types/packages/editor/src/extensions/comment/src/augmentations.d.ts +9 -0
  60. package/types/packages/editor/src/extensions/comment/src/types.d.ts +15 -0
  61. package/types/packages/editor/src/extensions/detail/src/augmentations.d.ts +6 -0
  62. package/types/packages/editor/src/extensions/detail/src/types.d.ts +9 -0
  63. package/types/packages/editor/src/extensions/diagram/src/augmentations.d.ts +7 -0
  64. package/types/packages/editor/src/extensions/diagram/src/types/index.d.ts +4 -0
  65. package/types/packages/editor/src/extensions/diagram/src/types/mermaid.d.ts +12 -0
  66. package/types/packages/editor/src/extensions/diagram/src/types/plantuml.d.ts +6 -0
  67. package/types/packages/editor/src/extensions/diagram/src/types/typst.d.ts +9 -0
  68. package/types/packages/editor/src/extensions/divide-line/src/augmentations.d.ts +6 -0
  69. package/types/packages/editor/src/extensions/divide-line/src/types.d.ts +5 -0
  70. package/types/packages/editor/src/extensions/emoji/src/augmentations.d.ts +9 -0
  71. package/types/packages/editor/src/extensions/emoji/src/types.d.ts +9 -0
  72. package/types/packages/editor/src/extensions/front-matter/src/augmentations.d.ts +6 -0
  73. package/types/packages/editor/src/extensions/front-matter/src/types.d.ts +6 -0
  74. package/types/packages/editor/src/extensions/header/src/augmentations.d.ts +6 -0
  75. package/types/packages/editor/src/extensions/header/src/types.d.ts +8 -0
  76. package/types/packages/editor/src/extensions/highlight-block/src/augmentations.d.ts +6 -0
  77. package/types/packages/editor/src/extensions/highlight-block/src/types.d.ts +10 -0
  78. package/types/packages/editor/src/extensions/highlight-block/src/variants.d.ts +1 -0
  79. package/types/packages/editor/src/extensions/kbd/src/augmentations.d.ts +9 -0
  80. package/types/packages/editor/src/extensions/kbd/src/types.d.ts +5 -0
  81. package/types/packages/editor/src/extensions/link/src/augmentations.d.ts +9 -0
  82. package/types/packages/editor/src/extensions/link/src/types.d.ts +6 -0
  83. package/types/packages/editor/src/extensions/list/src/augmentations.d.ts +10 -0
  84. package/types/packages/editor/src/extensions/list/src/types/check-list.d.ts +25 -0
  85. package/types/packages/editor/src/extensions/list/src/types/list.d.ts +18 -0
  86. package/types/packages/editor/src/extensions/list/src/types.d.ts +3 -0
  87. package/types/packages/editor/src/extensions/math/src/augmentations.d.ts +10 -0
  88. package/types/packages/editor/src/extensions/math/src/types.d.ts +11 -0
  89. package/types/packages/editor/src/extensions/media/src/augmentations.d.ts +15 -0
  90. package/types/packages/editor/src/extensions/media/src/components/ImageCropEditor/geometry.d.ts +119 -0
  91. package/types/packages/editor/src/extensions/media/src/types/element/audio.d.ts +13 -0
  92. package/types/packages/editor/src/extensions/media/src/types/element/image-appearance.d.ts +2 -0
  93. package/types/packages/editor/src/extensions/media/src/types/element/image.d.ts +31 -0
  94. package/types/packages/editor/src/extensions/media/src/types/element/inline-image.d.ts +10 -0
  95. package/types/packages/editor/src/extensions/media/src/types/element/video.d.ts +21 -0
  96. package/types/packages/editor/src/extensions/styled-text/src/augmentations.d.ts +9 -0
  97. package/types/packages/editor/src/extensions/styled-text/src/colors.d.ts +75 -0
  98. package/types/packages/editor/src/extensions/styled-text/src/types.d.ts +7 -0
  99. package/types/packages/editor/src/extensions/table/src/align.d.ts +2 -0
  100. package/types/packages/editor/src/extensions/table/src/augmentations.d.ts +8 -0
  101. package/types/packages/editor/src/extensions/table/src/types.d.ts +19 -0
  102. package/types/packages/editor/src/extensions/tabs/src/augmentations.d.ts +7 -0
  103. package/types/packages/editor/src/extensions/tabs/src/types.d.ts +29 -0
  104. package/types/packages/editor/src/extensions/underline/src/augmentations.d.ts +9 -0
  105. package/types/packages/editor/src/extensions/underline/src/types.d.ts +8 -0
  106. package/types/packages/editor/src/extensions/webview/src/augmentations.d.ts +6 -0
  107. package/types/packages/editor/src/extensions/webview/src/types.d.ts +14 -0
  108. package/types/packages/editor/src/index.d.ts +4 -0
  109. package/types/packages/editor/src/presets/default.d.ts +2 -0
  110. package/types/packages/editor/text-field-contract.d.ts +36 -0
  111. package/types/packages/plugins/src/content-input.d.ts +1 -0
  112. package/types/packages/plugins/src/data.d.ts +1 -0
  113. package/types/packages/plugins/src/flashcards.d.ts +2 -0
  114. package/types/packages/plugins/src/whiteboard.d.ts +3 -2
  115. package/types/packages/shared/color-utils.d.ts +19 -0
  116. package/types/packages/shared/media-services.d.ts +18 -0
  117. package/types/packages/shared/media-types.d.ts +1 -0
  118. package/types/packages/shared/src/task-assistant/contracts.d.ts +119 -0
  119. package/types/packages/shared/src/task-assistant/document-state.d.ts +14 -0
  120. package/types/packages/shared/src/task-assistant/schema.d.ts +42 -0
  121. package/types/packages/shared/task-assistant.d.ts +3 -0
  122. package/types/packages/whiteboard/src/Board.d.ts +180 -0
  123. package/types/packages/whiteboard/src/WhiteBoard.d.ts +53 -0
  124. package/types/packages/whiteboard/src/author.d.ts +5 -3
  125. package/types/packages/whiteboard/src/components/ArrowConnectPointGroup/index.d.ts +13 -0
  126. package/types/packages/whiteboard/src/components/ArrowDropConnectPoint/index.d.ts +7 -0
  127. package/types/packages/whiteboard/src/components/DocumentElement/index.d.ts +13 -0
  128. package/types/packages/whiteboard/src/components/ResizeCircle/index.d.ts +15 -0
  129. package/types/packages/whiteboard/src/components/SketchPaths/SketchRect.d.ts +21 -0
  130. package/types/packages/whiteboard/src/components/Toolbar/ToolMenu.d.ts +15 -0
  131. package/types/packages/whiteboard/src/constants/arrow.d.ts +19 -0
  132. package/types/packages/whiteboard/src/constants/boardIdentity.d.ts +2 -0
  133. package/types/packages/whiteboard/src/constants/geometry.d.ts +7 -0
  134. package/types/packages/whiteboard/src/constants/grid.d.ts +4 -0
  135. package/types/packages/whiteboard/src/constants/image.d.ts +21 -0
  136. package/types/packages/whiteboard/src/constants/index.d.ts +13 -0
  137. package/types/packages/whiteboard/src/constants/map.d.ts +2 -0
  138. package/types/packages/whiteboard/src/constants/mind-themes.d.ts +30 -0
  139. package/types/packages/whiteboard/src/constants/mind.d.ts +14 -0
  140. package/types/packages/whiteboard/src/constants/resize.d.ts +2 -0
  141. package/types/packages/whiteboard/src/constants/select.d.ts +4 -0
  142. package/types/packages/whiteboard/src/constants/shadow.d.ts +12 -0
  143. package/types/packages/whiteboard/src/constants/sketch.d.ts +16 -0
  144. package/types/packages/whiteboard/src/constants/text-style.d.ts +68 -0
  145. package/types/packages/whiteboard/src/constants/tools.d.ts +11 -0
  146. package/types/packages/whiteboard/src/constants/viewport.d.ts +3 -0
  147. package/types/packages/whiteboard/src/document-version.d.ts +9 -0
  148. package/types/packages/whiteboard/src/document.d.ts +47 -0
  149. package/types/packages/whiteboard/src/extensions/api.d.ts +9 -0
  150. package/types/packages/whiteboard/src/extensions/authorApi.d.ts +10 -0
  151. package/types/packages/whiteboard/src/extensions/authorHooks.d.ts +2 -2
  152. package/types/packages/whiteboard/src/extensions/authorTypes.d.ts +150 -0
  153. package/types/packages/whiteboard/src/extensions/media.d.ts +50 -0
  154. package/types/packages/whiteboard/src/extensions/publicHooks.d.ts +2 -0
  155. package/types/packages/whiteboard/src/extensions/runtime.d.ts +95 -0
  156. package/types/packages/whiteboard/src/extensions/text.d.ts +58 -0
  157. package/types/packages/whiteboard/src/extensions/versions.d.ts +2 -0
  158. package/types/packages/whiteboard/src/hooks/useBoardState.d.ts +6 -0
  159. package/types/packages/whiteboard/src/hooks/useDropArrow.d.ts +76 -0
  160. package/types/packages/whiteboard/src/hooks/useElementsMoving.d.ts +10 -0
  161. package/types/packages/whiteboard/src/hooks/useMindTheme.d.ts +8 -0
  162. package/types/packages/whiteboard/src/hooks/useSelectState.d.ts +10 -0
  163. package/types/packages/whiteboard/src/hooks/useSketch.d.ts +15 -0
  164. package/types/packages/whiteboard/src/index.d.ts +54 -0
  165. package/types/packages/whiteboard/src/interactions/InteractionManager.d.ts +68 -0
  166. package/types/packages/whiteboard/src/interactions/InteractionState.d.ts +28 -0
  167. package/types/packages/whiteboard/src/interactions/states/ResizingState.d.ts +40 -0
  168. package/types/packages/whiteboard/src/plugins/ArrowPlugin.d.ts +48 -0
  169. package/types/packages/whiteboard/src/plugins/AudioPlugin.d.ts +15 -0
  170. package/types/packages/whiteboard/src/plugins/ColumnPlugin.d.ts +81 -0
  171. package/types/packages/whiteboard/src/plugins/CommonPlugin.d.ts +104 -0
  172. package/types/packages/whiteboard/src/plugins/CopyPastePlugin.d.ts +38 -0
  173. package/types/packages/whiteboard/src/plugins/DocumentPlugin.d.ts +41 -0
  174. package/types/packages/whiteboard/src/plugins/ExportImagePlugin.d.ts +6 -0
  175. package/types/packages/whiteboard/src/plugins/FileDragDropPlugin.d.ts +15 -0
  176. package/types/packages/whiteboard/src/plugins/FramePlugin.d.ts +14 -0
  177. package/types/packages/whiteboard/src/plugins/GeometryPlugin.d.ts +31 -0
  178. package/types/packages/whiteboard/src/plugins/HandwritePlugin.d.ts +22 -0
  179. package/types/packages/whiteboard/src/plugins/ImagePlugin.d.ts +21 -0
  180. package/types/packages/whiteboard/src/plugins/MindPlugin.d.ts +72 -0
  181. package/types/packages/whiteboard/src/plugins/PresentationPlugin.d.ts +13 -0
  182. package/types/packages/whiteboard/src/plugins/RichTextPlugin.d.ts +44 -0
  183. package/types/packages/whiteboard/src/plugins/VideoPlugin.d.ts +14 -0
  184. package/types/packages/whiteboard/src/plugins/ViewPortPlugin.d.ts +13 -0
  185. package/types/packages/whiteboard/src/plugins/WebviewPlugin.d.ts +11 -0
  186. package/types/packages/whiteboard/src/plugins/WhiteBoardPlugin.d.ts +31 -0
  187. package/types/packages/whiteboard/src/plugins/index.d.ts +19 -0
  188. package/types/packages/whiteboard/src/public.d.ts +54 -0
  189. package/types/packages/whiteboard/src/schematic/PageSchematic.d.ts +13 -0
  190. package/types/packages/whiteboard/src/services/CapabilityService.d.ts +186 -0
  191. package/types/packages/whiteboard/src/transforms/SelectTransforms.d.ts +4 -0
  192. package/types/packages/whiteboard/src/transforms/SketchTransforms.d.ts +5 -0
  193. package/types/packages/whiteboard/src/transforms/ViewPortTransforms.d.ts +26 -0
  194. package/types/packages/whiteboard/src/transforms/index.d.ts +3 -0
  195. package/types/packages/whiteboard/src/types/arrow.d.ts +52 -0
  196. package/types/packages/whiteboard/src/types/audio.d.ts +8 -0
  197. package/types/packages/whiteboard/src/types/board.d.ts +79 -0
  198. package/types/packages/whiteboard/src/types/capabilities.d.ts +267 -0
  199. package/types/packages/whiteboard/src/types/column.d.ts +71 -0
  200. package/types/packages/whiteboard/src/types/element.d.ts +1 -0
  201. package/types/packages/whiteboard/src/types/frame.d.ts +35 -0
  202. package/types/packages/whiteboard/src/types/image.d.ts +19 -0
  203. package/types/packages/whiteboard/src/types/index.d.ts +33 -0
  204. package/types/packages/whiteboard/src/types/mind.d.ts +54 -0
  205. package/types/packages/whiteboard/src/types/resize.d.ts +16 -0
  206. package/types/packages/whiteboard/src/types/video.d.ts +20 -0
  207. package/types/packages/whiteboard/src/types/webview.d.ts +7 -0
  208. package/types/packages/whiteboard/src/utils/ArrowConnectTracker.d.ts +50 -0
  209. package/types/packages/whiteboard/src/utils/ArrowStyleUtil.d.ts +15 -0
  210. package/types/packages/whiteboard/src/utils/ArrowUtil.d.ts +11 -0
  211. package/types/packages/whiteboard/src/utils/AudioUtil.d.ts +20 -0
  212. package/types/packages/whiteboard/src/utils/BoardUtil.d.ts +101 -0
  213. package/types/packages/whiteboard/src/utils/CanvasUtil.d.ts +5 -0
  214. package/types/packages/whiteboard/src/utils/ClipboardUtil.d.ts +8 -0
  215. package/types/packages/whiteboard/src/utils/ColumnUtil.d.ts +125 -0
  216. package/types/packages/whiteboard/src/utils/ConnectPointOwner.d.ts +36 -0
  217. package/types/packages/whiteboard/src/utils/ConnectPointUtil.d.ts +66 -0
  218. package/types/packages/whiteboard/src/utils/Constraints.d.ts +6 -0
  219. package/types/packages/whiteboard/src/utils/ExportImageUtil.d.ts +14 -0
  220. package/types/packages/whiteboard/src/utils/FrameUtil.d.ts +90 -0
  221. package/types/packages/whiteboard/src/utils/GeometryUtil.d.ts +18 -0
  222. package/types/packages/whiteboard/src/utils/HandwriteGroupUtil.d.ts +25 -0
  223. package/types/packages/whiteboard/src/utils/HandwriteUtil.d.ts +39 -0
  224. package/types/packages/whiteboard/src/utils/ImageUtil.d.ts +13 -0
  225. package/types/packages/whiteboard/src/utils/LayerOrderUtil.d.ts +16 -0
  226. package/types/packages/whiteboard/src/utils/MindThemePreviewStore.d.ts +11 -0
  227. package/types/packages/whiteboard/src/utils/MindThemeUtil.d.ts +54 -0
  228. package/types/packages/whiteboard/src/utils/MindUtil.d.ts +65 -0
  229. package/types/packages/whiteboard/src/utils/PathUtil.d.ts +80 -0
  230. package/types/packages/whiteboard/src/utils/PointUtil.d.ts +50 -0
  231. package/types/packages/whiteboard/src/utils/PresentationManager.d.ts +53 -0
  232. package/types/packages/whiteboard/src/utils/RichTextContentUtil.d.ts +17 -0
  233. package/types/packages/whiteboard/src/utils/SelectionActionUtil.d.ts +9 -0
  234. package/types/packages/whiteboard/src/utils/TextStyleStore.d.ts +10 -0
  235. package/types/packages/whiteboard/src/utils/VideoUtil.d.ts +11 -0
  236. package/types/packages/whiteboard/src/utils/ViewportUtil.d.ts +10 -0
  237. package/types/packages/whiteboard/src/utils/common.d.ts +18 -0
  238. package/types/packages/whiteboard/src/utils/events.d.ts +13 -0
  239. package/types/packages/whiteboard/src/utils/index.d.ts +28 -0
  240. package/types/packages/whiteboard/src/utils/sketch/arrow.d.ts +29 -0
  241. package/types/packages/whiteboard/src/utils/sketch/batch.d.ts +10 -0
  242. package/types/packages/whiteboard/src/utils/sketch/index.d.ts +9 -0
  243. package/types/packages/whiteboard/src/utils/sketch/patch.d.ts +5 -0
  244. package/types/packages/whiteboard/src/utils/sketch/resolve.d.ts +14 -0
  245. package/types/packages/whiteboard/src/utils/snap/SnapGeometry.d.ts +52 -0
  246. package/types/packages/whiteboard/src/utils/snap/SnapManager.d.ts +57 -0
@@ -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";
@@ -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
+ }
@@ -0,0 +1,9 @@
1
+ import type { Descendant } from "slate";
2
+ export interface EmojiElement {
3
+ type: "emoji";
4
+ emoji: string;
5
+ nativeEmoji?: string;
6
+ defaultOpen?: boolean;
7
+ shortcodes?: string;
8
+ children: Descendant[];
9
+ }
@@ -0,0 +1,6 @@
1
+ import type { FrontMatterElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ "front-matter": FrontMatterElement;
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ import type { BaseElement, Descendant } from "slate";
2
+ export interface FrontMatterElement extends BaseElement {
3
+ type: "front-matter";
4
+ value: string;
5
+ children: Descendant[];
6
+ }
@@ -0,0 +1,6 @@
1
+ import type { HeaderElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ header: HeaderElement;
5
+ }
6
+ }
@@ -0,0 +1,8 @@
1
+ import type { InlineElement } from "../../../../api";
2
+ import type { FormattedText } from "../../../../../markdown/src/model";
3
+ export interface HeaderElement {
4
+ type: "header";
5
+ level: 1 | 2 | 3 | 4 | 5 | 6;
6
+ children: Array<InlineElement | FormattedText>;
7
+ collapsed?: boolean;
8
+ }
@@ -0,0 +1,6 @@
1
+ import type { HighlightBlockElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ "highlight-block": HighlightBlockElement;
5
+ }
6
+ }
@@ -0,0 +1,10 @@
1
+ import type { BlockElement } from "../../../../api";
2
+ import type { Color } from "./variants";
3
+ export type { Color } from "./variants";
4
+ export interface HighlightBlockElement {
5
+ type: "highlight-block";
6
+ children: BlockElement[];
7
+ color: Color;
8
+ }
9
+ export type { ParagraphElement, IBlockPanelListItem } from "../../../../api";
10
+ export type { FormattedText } from "../../../../../markdown/src/model";
@@ -0,0 +1 @@
1
+ export type Color = "red" | "green" | "yellow" | "blue" | "orange" | "purple";
@@ -0,0 +1,9 @@
1
+ import type { KbdElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ kbd: KbdElement;
5
+ }
6
+ interface ExtensionInlineElementMap {
7
+ kbd: KbdElement;
8
+ }
9
+ }
@@ -0,0 +1,5 @@
1
+ import { type FormattedText } from "../../../../../markdown/src/model";
2
+ export interface KbdElement {
3
+ type: "kbd";
4
+ children: FormattedText[];
5
+ }
@@ -0,0 +1,9 @@
1
+ import type { LinkElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ link: LinkElement;
5
+ }
6
+ interface ExtensionInlineElementMap {
7
+ link: LinkElement;
8
+ }
9
+ }
@@ -0,0 +1,6 @@
1
+ import { type FormattedText } from "../../../../../markdown/src/model";
2
+ export interface LinkElement {
3
+ type: "link";
4
+ url: string;
5
+ children: FormattedText[];
6
+ }
@@ -0,0 +1,10 @@
1
+ import type { BulletedListElement, NumberedListElement, ListItemElement, CheckListElement, CheckListItemElement } from "./types";
2
+ declare module "../../../../api" {
3
+ interface ExtensionElementMap {
4
+ "bulleted-list": BulletedListElement;
5
+ "numbered-list": NumberedListElement;
6
+ "list-item": ListItemElement;
7
+ "check-list": CheckListElement;
8
+ "check-list-item": CheckListItemElement;
9
+ }
10
+ }
@@ -0,0 +1,25 @@
1
+ import type { ParagraphElement } from "../../../../../api";
2
+ import type { DocumentTaskAttributes } from "../../../../../../shared/task-assistant";
3
+ export interface CheckListItemElement extends DocumentTaskAttributes {
4
+ type: "check-list-item";
5
+ checked: boolean;
6
+ /** 勾选项的稳定身份(文档内唯一),供文档待办定位与回写;缺失或重复时由规范化补齐 */
7
+ taskId?: string;
8
+ /** 相对日期首次解析的正文元信息,随正文同步并参与索引重建。 */
9
+ taskDateAnchor?: {
10
+ hint: string;
11
+ at: number;
12
+ date: string;
13
+ } | null;
14
+ /** 项目词的归属提示,解决项目改名后旧名被其它项目复用的歧义。 */
15
+ taskGroup?: {
16
+ id: number;
17
+ token: string;
18
+ createdAt?: number;
19
+ } | null;
20
+ children: [ParagraphElement] | [ParagraphElement, CheckListElement];
21
+ }
22
+ export interface CheckListElement {
23
+ type: "check-list";
24
+ children: CheckListItemElement[];
25
+ }