@asd14/vblocks 5.4.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +0,0 @@
1
- import { Panel, useReactFlow, useViewport } from "@xyflow/react"
2
-
3
- /**
4
- * The zoom of the diagram, as a percentage, and a button that centers the
5
- * diagram at 100%. Render it inside `<ReactFlow>`, both hooks read the viewport
6
- * from there
7
- */
8
- const ZoomLevel = () => {
9
- const { zoom } = useViewport()
10
- const { fitView } = useReactFlow()
11
-
12
- return (
13
- <Panel
14
- position="top-right"
15
- className="flex items-center gap-2 rounded border border-stone-200 bg-white px-2 py-1 font-mono text-xs leading-none text-stone-600">
16
- <span>{Math.round(zoom * 100)}%</span>
17
- <button
18
- type="button"
19
- onClick={() => {
20
- void fitView({ minZoom: 1, maxZoom: 1, duration: 200 })
21
- }}
22
- className="cursor-pointer text-stone-500 hover:text-stone-900">
23
- Reset
24
- </button>
25
- </Panel>
26
- )
27
- }
28
-
29
- export { ZoomLevel }
File without changes
File without changes
File without changes