feat: scaffold mindmap core and layout engine

This commit is contained in:
liaibo
2025-11-29 19:07:18 +08:00
parent 140bce9768
commit 3305944db4
15 changed files with 905 additions and 0 deletions
@@ -0,0 +1,17 @@
import { useState, useCallback } from 'react';
import { mindmapCommandBus } from '@/lib/mindmap/command/MindmapCommandBus';
export function useMindmapTextEdit(nodeId: string) {
const [value, setValue] = useState('');
const handleChange = useCallback(
(next: string) => {
setValue(next);
mindmapCommandBus.emit('SET_NODE_TEXT', { nodeId, text: next });
},
[nodeId],
);
return { value, setValue, handleChange };
}