@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.
- package/README.md +52 -56
- package/bin/vblocks +71 -0
- package/bin/vblocks.d/build +193 -0
- package/bin/vblocks.d/eject +69 -0
- package/bin/vblocks.d/init +337 -0
- package/bin/vblocks.d/lib.sh +569 -0
- package/bin/vblocks.d/serve +149 -0
- package/bin/vblocks.d/vblocks.sh +95 -0
- package/bin/vblocks.d/webpack.sh +120 -0
- package/defaults/postcss.config.js +14 -0
- package/{src → defaults}/webpack.config.js +40 -21
- package/package.json +18 -14
- package/template/xyflow/app/postcss.config.js +9 -8
- package/template/xyflow/app/src/diagram.tsx +0 -2
- package/template/xyflow/post-init-app.sh +1 -0
- package/template/xyflow-tabs/app/postcss.config.js +9 -8
- package/template/xyflow-tabs/post-init-app.sh +1 -0
- package/{src/types → types}/client.d.ts +20 -1
- package/bin/vblocks.sh +0 -685
- package/src/postcss.config.js +0 -13
- package/template/xyflow/app/src/ui/zoom-level.tsx +0 -29
- /package/{src → defaults}/.swcrc +0 -0
- /package/{src → defaults/src}/public/favicon.svg +0 -0
- /package/{src → defaults/src}/public/robots.txt +0 -0
|
@@ -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 }
|
/package/{src → defaults}/.swcrc
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|