From 179be1f63b5749e7d6419fddc43cdfe59f31df8a Mon Sep 17 00:00:00 2001 From: NikitaKalitov Date: Mon, 20 Jul 2026 13:17:41 +0300 Subject: [PATCH] =?UTF-8?q?UI=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DiagramEditor.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/DiagramEditor.tsx b/src/DiagramEditor.tsx index 7cd4e99..f81bba6 100644 --- a/src/DiagramEditor.tsx +++ b/src/DiagramEditor.tsx @@ -169,7 +169,7 @@ function DiagramCanvas({ initialValue, onChange }: DiagramEditorProps) { const lastTypingHistoryPushRef = useRef(0); const clipboardRef = useRef(null); const canvasWrapperRef = useRef(null); - const { screenToFlowPosition } = useReactFlow(); + const { screenToFlowPosition, zoomIn, zoomOut, fitView } = useReactFlow(); const emitChange = useMemo( () => debounce((n: Node[], e: Edge[]) => onChange(serializeDocument(n, e)), 400), @@ -586,6 +586,7 @@ function DiagramCanvas({ initialValue, onChange }: DiagramEditorProps) { zIndexMode="manual" className={mode === 'view' ? 'diagram-flow--view-mode' : undefined} fitView + proOptions={{ hideAttribution: true }} > @@ -601,7 +602,16 @@ function DiagramCanvas({ initialValue, onChange }: DiagramEditorProps) { /> ))} - + + zoomIn()} title="Увеличить"> + + + + zoomOut()} title="Уменьшить"> + − + + fitView()} title="Показать всё"> + ⛶ + {mode === 'edit' && ( <> @@ -613,7 +623,7 @@ function DiagramCanvas({ initialValue, onChange }: DiagramEditorProps) { )} - + {mode === 'edit' && }