@visualli/react 0.1.2 → 0.1.3
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/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/src/VisualliCanvas.tsx +14 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visualli/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "React canvas renderer for .visualli files \u2014 built on @visualli/core",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,10 +30,12 @@
|
|
|
30
30
|
"react-dom": "^18.0.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@visualli/bindings": "*",
|
|
33
34
|
"@visualli/core": "*",
|
|
34
35
|
"zustand": "^4.5.2",
|
|
35
36
|
"konva": "^9.3.6",
|
|
36
|
-
"react-konva": "^18.2.10"
|
|
37
|
+
"react-konva": "^18.2.10",
|
|
38
|
+
"react-use-measure": "^1.1.2"
|
|
37
39
|
},
|
|
38
40
|
"devDependencies": {
|
|
39
41
|
"@types/react": "^18.3.0",
|
package/src/VisualliCanvas.tsx
CHANGED
|
@@ -212,20 +212,20 @@ export default function VisualliCanvas(props: VisualliCanvasProps) {
|
|
|
212
212
|
containers: getContainersForLayer(doc, currentLayerId) as ContainerGroup[],
|
|
213
213
|
};
|
|
214
214
|
} catch { return { flatNodes: [] as FlatNode[], connections: [] as MindMapConnection[], containers: [] as ContainerGroup[] }; }
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
215
|
+
}, [doc, currentLayerId]);
|
|
216
|
+
const viewport = useViewportStore(s => ({
|
|
217
|
+
centerX: s.centerX, centerY: s.centerY, zoomLevel: s.zoomLevel,
|
|
218
|
+
canvasWidth: s.canvasWidth, canvasHeight: s.canvasHeight,
|
|
219
|
+
}));
|
|
220
|
+
const setCenter = useViewportStore(s => s.setCenter);
|
|
221
|
+
const setZoom = useViewportStore(s => s.setZoom);
|
|
222
|
+
|
|
223
|
+
const nodes = useNodeStore(s => s.nodes);
|
|
224
|
+
const setNodes = useNodeStore(s => s.setNodes);
|
|
225
|
+
const updateNodePosition = useNodeStore(s => s.updateNodePosition);
|
|
226
|
+
|
|
227
|
+
const clearSel = useSelectionStore(s => s.clear);
|
|
228
|
+
const select = useSelectionStore(s => s.select);
|
|
229
229
|
|
|
230
230
|
// Sync nodes → store
|
|
231
231
|
useEffect(() => {
|