feat(lesson-preparation): add anchor canvas design, new blocks, and textbook content node

- Add anchor injector for canvas-based anchor positioning

- Add new block components: blackboard, homework, import, key-point, new-teaching, objective, summary

- Add textbook content node for React Flow canvas

- Update actions (kp, publish, main), data-access (templates, versions, main)

- Update editor, node-editor, block-renderer, and picker components

- Update schema, types, hooks, and lib utilities (document-migration, node-summary, rf-mappers)
This commit is contained in:
SpecialX
2026-06-23 17:37:19 +08:00
parent 1fcef5c3aa
commit 2197e68069
34 changed files with 3190 additions and 402 deletions

View File

@@ -96,10 +96,12 @@ export async function saveAsTemplate(input: {
if (plan.length === 0) throw new LessonPlanDataError("NOT_FOUND");
const doc = normalizeDocument(plan[0].content);
const skeleton: TemplateBlockSkeleton[] = doc.nodes.map((b) => ({
type: b.type,
title: b.title,
}));
const skeleton: TemplateBlockSkeleton[] = doc.nodes
.filter((b): b is import("./types").LessonPlanNode => b.type !== "textbook_content")
.map((b) => ({
type: b.type,
title: b.title,
}));
const templateId = createId();
await db.insert(lessonPlanTemplates).values({