/* eslint-disable @typescript-eslint/no-explicit-any */ import React, { useEffect, useMemo, useState } from "react"; // 说明:legacy/reference/compat 组件,仅作为 Phase 6 UI shell 迁移素材。 // 3000 文档页默认 mindmap 主链是 leptos-tiptap NodeView + Leptos/Rust shell。 import Image from "next/image"; import { Label } from "@/components/ui/label"; import { Input } from "@/components/ui/input"; import { Toggle } from "@/components/ui/toggle"; import { Bold, Italic, Underline, Type, Strikethrough, Palette, X, Network } from "lucide-react"; import { fontFamilyList, fontSizeList, lineHeightList, borderDasharrayList, borderRadiusList, borderWidthList, lineWidthList, shapeList, lineStyleList, themeList, layoutList, outlineDepthOptions, backgroundRepeatList, backgroundPositionList, backgroundSizeList, } from "./mindmapOptions"; import iconConfig from "./mindmapIconConfig"; import imageConfig from "./mindmapImageConfig"; import { sidebarTitles, type SidebarPanel } from "./mindmapSidebarConfig"; import type { MindMapNode } from "./mindmapTypes"; import { MindmapAiAgentPanel } from "./MindmapAiAgentPanel"; // 避免 SSR 阶段触发浏览器依赖,改为运行时动态引入 const loadIconModules = async () => { const { nodeIconList } = await import("simple-mind-map/src/svg/icons.js"); const { mergerIconList } = await import("simple-mind-map/src/utils/index.js"); return { nodeIconList, mergerIconList }; }; type SidebarProps = { documentId: string; mindmapId: string; mindmap: any; activeNodes: MindMapNode[]; activeTab: SidebarPanel | null; onClose: () => void; }; // 旧 Next route 已退场;补完节点能力保留在 AI Agent 的 mindmap_expand_node 工具中。 const MINDMAP_LEGACY_EXPAND_NODE_ENTRY_ENABLED = false; const ColorInput = ({ value, onChange, label, }: { value: string; onChange: (val: string) => void; label?: string; }) => (
请选择一个节点以编辑样式
仅本地开发可用:用于快速验证“生成导图 + 节点跳页链接”。
出于安全考虑,当前仅允许本机或 supabase 域名。
将使用 AI 生成完整思维导图,返回的 Markdown 会自动解析并替换当前导图。请确保本地 Ollama 已启动且模型已下载。
)} {mode === "partial" && (续写模式:请选择一个或多个节点,AI 返回的 Markdown 子列表会追加为所选节点的子节点。
)}