feat(mindmap): 打开图标/备注/公式侧栏并显示官方触发项
This commit is contained in:
@@ -345,9 +345,7 @@ const MindmapBlockView = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleIcon = () => {
|
const handleIcon = () => {
|
||||||
const value = createSimplePrompt("请输入内置图标键(示例:priority_1 或 progress_2)", "priority_1");
|
setActiveSidebar("icons");
|
||||||
if (!value) return;
|
|
||||||
applyToActiveNodes(mindmap, (node) => mindmap?.execCommand("SET_NODE_ICON", node, [value]));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleLink = () => {
|
const handleLink = () => {
|
||||||
@@ -357,9 +355,7 @@ const MindmapBlockView = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleNote = () => {
|
const handleNote = () => {
|
||||||
const note = createSimplePrompt("请输入备注内容");
|
setActiveSidebar("note");
|
||||||
if (!note) return;
|
|
||||||
applyToActiveNodes(mindmap, (node) => mindmap?.execCommand("SET_NODE_NOTE", node, note));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleTag = () => {
|
const handleTag = () => {
|
||||||
@@ -370,9 +366,7 @@ const MindmapBlockView = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleFormula = () => {
|
const handleFormula = () => {
|
||||||
const formula = createSimplePrompt("输入 LaTeX 公式(示例:a^2+b^2=c^2)", "a^2+b^2=c^2");
|
setActiveSidebar("formula");
|
||||||
if (!formula) return;
|
|
||||||
mindmap?.execCommand("INSERT_FORMULA", formula, mindmap?.renderer?.activeNodeList ?? []);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleAttachment = () => {
|
const handleAttachment = () => {
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ export const sidebarTriggers: SidebarTrigger[] = [
|
|||||||
{ value: "structure", target: "structure", label: "结构", iconClass: "iconjiegou" },
|
{ value: "structure", target: "structure", label: "结构", iconClass: "iconjiegou" },
|
||||||
{ value: "outline", target: "outline", label: "大纲", iconClass: "iconfuhao-dagangshu" },
|
{ value: "outline", target: "outline", label: "大纲", iconClass: "iconfuhao-dagangshu" },
|
||||||
{ value: "shortcutKey", target: "settings", label: "快捷键/设置", iconClass: "iconjianpan" },
|
{ value: "shortcutKey", target: "settings", label: "快捷键/设置", iconClass: "iconjianpan" },
|
||||||
// 扩展:图标/公式/备注/AI,官方通过按钮唤起,这里隐藏不展示但支持被触发
|
// 扩展:图标/公式/备注/AI,默认全部可见,保持和官方一致
|
||||||
{ value: "icons", target: "icons", label: "图标/贴纸", iconClass: "iconxiaolian", visible: false },
|
{ value: "icons", target: "icons", label: "图标/贴纸", iconClass: "iconxiaolian", visible: true },
|
||||||
{ value: "formula", target: "formula", label: "公式", iconClass: "icongongshi", visible: false },
|
{ value: "formula", target: "formula", label: "公式", iconClass: "icongongshi", visible: true },
|
||||||
{ value: "note", target: "note", label: "备注", iconClass: "iconflow-Mark", visible: false },
|
{ value: "note", target: "note", label: "备注", iconClass: "iconflow-Mark", visible: true },
|
||||||
{ value: "ai", target: "ai", label: "AI", iconClass: "iconstar", visible: false },
|
{ value: "ai", target: "ai", label: "AI", iconClass: "iconstar", visible: true },
|
||||||
];
|
];
|
||||||
|
|
||||||
export const sidebarTitles: Record<SidebarPanel, string> = {
|
export const sidebarTitles: Record<SidebarPanel, string> = {
|
||||||
|
|||||||
Reference in New Issue
Block a user