feat(network): draw.io XML export

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-04-14 01:25:49 +00:00
parent c8f571db39
commit 2a4220b496
3 changed files with 125 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
import { useState, useCallback, useRef, useEffect } from 'react'
import { useNavigate } from 'react-router-dom'
import { ChevronLeft, Save, Download, FileJson, FileCode, Image, FileText, Undo2, Redo2, MousePointer2, Hand } from 'lucide-react'
import { ChevronLeft, Save, Download, FileJson, FileCode, Image, FileText, Undo2, Redo2, MousePointer2, Hand, Share2 } from 'lucide-react'
import { cn } from '@/lib/utils'
export type InteractionMode = 'select' | 'pan'
@@ -18,6 +18,7 @@ interface DiagramHeaderProps {
onExportSvg: () => void
onExportPdf: () => void
onExportJson: () => void
onExportDrawio: () => void
onUndo: () => void
onRedo: () => void
canUndo: boolean
@@ -39,6 +40,7 @@ export function DiagramHeader({
onExportSvg,
onExportPdf,
onExportJson,
onExportDrawio,
onUndo,
onRedo,
canUndo,
@@ -233,6 +235,12 @@ export function DiagramHeader({
<FileJson size={12} /> Export JSON
</button>
)}
<button
onClick={() => { onExportDrawio(); setShowExportMenu(false) }}
className="flex w-full items-center gap-2 px-3 py-1.5 text-xs text-primary hover:bg-elevated"
>
<Share2 size={12} /> Export draw.io
</button>
</div>
)}
</div>