feat(mindmap): 引入官方工具栏/侧栏并修复节点选择
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
export type SidebarTrigger = {
|
||||
value: string; // 官方配置标识
|
||||
target: SidebarPanel; // React 内部面板 key
|
||||
label: string;
|
||||
iconClass: string;
|
||||
visible?: boolean; // 可选,默认 true;官方之外的扩展可设为 false 不显示在触发条
|
||||
};
|
||||
|
||||
export type SidebarPanel =
|
||||
| "style"
|
||||
| "base"
|
||||
| "theme"
|
||||
| "structure"
|
||||
| "outline"
|
||||
| "settings"
|
||||
| "icons"
|
||||
| "formula"
|
||||
| "note"
|
||||
| "ai";
|
||||
|
||||
// 侧栏触发配置,来源于官方 config/zh.js 的 sidebarTriggerList,保持顺序
|
||||
export const sidebarTriggers: SidebarTrigger[] = [
|
||||
{ value: "nodeStyle", target: "style", label: "节点样式", iconClass: "iconzhuti" },
|
||||
{ value: "baseStyle", target: "base", label: "基础样式", iconClass: "iconyangshi" },
|
||||
{ value: "theme", target: "theme", label: "主题", iconClass: "iconjingzi" },
|
||||
{ value: "structure", target: "structure", label: "结构", iconClass: "iconjiegou" },
|
||||
{ value: "outline", target: "outline", label: "大纲", iconClass: "iconfuhao-dagangshu" },
|
||||
{ value: "shortcutKey", target: "settings", label: "快捷键/设置", iconClass: "iconjianpan" },
|
||||
// 扩展:图标/公式/备注/AI,官方通过按钮唤起,这里隐藏不展示但支持被触发
|
||||
{ value: "icons", target: "icons", label: "图标/贴纸", iconClass: "iconxiaolian", visible: false },
|
||||
{ value: "formula", target: "formula", label: "公式", iconClass: "icongongshi", visible: false },
|
||||
{ value: "note", target: "note", label: "备注", iconClass: "iconflow-Mark", visible: false },
|
||||
{ value: "ai", target: "ai", label: "AI", iconClass: "iconstar", visible: false },
|
||||
];
|
||||
|
||||
export const sidebarTitles: Record<SidebarPanel, string> = {
|
||||
style: "节点样式",
|
||||
base: "基础样式",
|
||||
theme: "主题",
|
||||
structure: "结构",
|
||||
outline: "大纲",
|
||||
settings: "设置",
|
||||
icons: "图标/贴纸",
|
||||
formula: "公式",
|
||||
note: "备注",
|
||||
ai: "AI 对话",
|
||||
};
|
||||
Reference in New Issue
Block a user