33 lines
785 B
TypeScript
33 lines
785 B
TypeScript
"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>
|
||
|
|
);
|
||
|
|
}
|