// 正文容器节点(特殊节点类型,不可拖动,可缩放)
interface TextbookContentNode extends LessonPlanNode {
type: "textbook_content"; // 新增节点类型
data: {
chapterId: string; // 关联教材章节
content: string; // Markdown 正文(缓存)
zoom: number; // 缩放比例 0.5-2.0
};
position: { x: number; y: number }; // 固定位置(不可拖动)
draggable: false; // React Flow 节点锁定
}
// 锚点连线(节点 → 正文位置)
interface AnchorEdge extends LessonPlanEdge {
type: "anchor"; // 锚点连线(vs "flow" 流程连线)
source: string; // 节点 ID
target: string; // 正文节点 ID
targetHandle: string; // "anchor:123:145"(正文偏移量 start:end)
}
// LessonPlanDocument v3
interface LessonPlanDocument {
version: 3;
nodes: LessonPlanNode[]; // 含 1 个 textbook_content + N 个教学节点
edges: AnchorEdge | FlowEdge[]; // 锚点连线 + 流程连线
}