feat(mindmap): 引入官方工具栏/侧栏并修复节点选择

This commit is contained in:
liaibo
2025-12-28 22:05:37 +08:00
parent bddef15242
commit af58c12d81
24 changed files with 2548 additions and 211 deletions
@@ -0,0 +1,32 @@
"use client";
import { MindmapBlockView } from "@/components/editor/blocks/MindmapBlock";
import type { BlockNoteEditor, Block } from "@blocknote/core";
import type { CustomBlockSchema } from "@/components/editor/schema";
const stubBlock: Block<CustomBlockSchema, "mindmap"> = {
id: "dev-mindmap",
type: "mindmap",
props: {
data: {
data: { text: "中心主题" },
children: [],
},
},
content: [],
children: [],
};
const editorStub = {
updateBlock: () => {
/* 开发沙盒中跳过持久化 */
},
} as unknown as BlockNoteEditor<CustomBlockSchema>;
export default function MindmapDevPage() {
return (
<div className="fixed inset-0 bg-white">
<MindmapBlockView block={stubBlock} editor={editorStub} fullscreen />
</div>
);
}