@visualli/react 0.1.1 → 0.1.2
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 +102 -262
- package/dist/index.cjs +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/package.json +5 -3
- package/src/VisualliCanvas.tsx +6 -3
package/dist/index.js
CHANGED
|
@@ -2702,7 +2702,10 @@ function VisualliCanvas(props) {
|
|
|
2702
2702
|
setCanvasContextMenu(null);
|
|
2703
2703
|
return;
|
|
2704
2704
|
}
|
|
2705
|
-
|
|
2705
|
+
const rect = containerRef.current?.getBoundingClientRect();
|
|
2706
|
+
const localX = rect ? e.evt.clientX - rect.left : e.evt.clientX;
|
|
2707
|
+
const localY = rect ? e.evt.clientY - rect.top : e.evt.clientY;
|
|
2708
|
+
setCanvasContextMenu({ x: localX, y: localY });
|
|
2706
2709
|
}, [navStack.length]);
|
|
2707
2710
|
const handleStageTouchStart = useCallback4((e) => handleStageMouseDown(e), [handleStageMouseDown]);
|
|
2708
2711
|
const handleStageTouchMove = useCallback4((e) => handleStageMouseMove(e), [handleStageMouseMove]);
|
|
@@ -2858,7 +2861,7 @@ function VisualliCanvas(props) {
|
|
|
2858
2861
|
role: "menu",
|
|
2859
2862
|
"aria-label": "Canvas options",
|
|
2860
2863
|
style: {
|
|
2861
|
-
position: "
|
|
2864
|
+
position: "absolute",
|
|
2862
2865
|
zIndex: 60,
|
|
2863
2866
|
pointerEvents: "auto",
|
|
2864
2867
|
left: `${Math.min(canvasContextMenu.x, Math.max(8, (canvasSizeRef.current.width || 800) - 152))}px`,
|
|
@@ -2907,7 +2910,7 @@ function VisualliCanvas(props) {
|
|
|
2907
2910
|
{
|
|
2908
2911
|
"data-node-tooltip": "true",
|
|
2909
2912
|
style: {
|
|
2910
|
-
position: "
|
|
2913
|
+
position: "absolute",
|
|
2911
2914
|
zIndex: 50,
|
|
2912
2915
|
left: safeLeft,
|
|
2913
2916
|
top: safeTop,
|