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' && }