@visualli/react 0.1.5 → 0.1.7
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 +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/VisualliCanvas.tsx +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visualli/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "React canvas renderer for .visualli files \u2014 built on @visualli/core",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "tsup",
|
|
26
|
-
"
|
|
26
|
+
"check-types": "tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"react": "^18.0.0",
|
package/src/VisualliCanvas.tsx
CHANGED
|
@@ -130,6 +130,7 @@ export interface VisualliCanvasProps {
|
|
|
130
130
|
chromaticImmersion?: boolean;
|
|
131
131
|
onNodeClick?: (node: FlatNode) => void;
|
|
132
132
|
onLayerChange?: (layerId: string, layer: VisualliLayer) => void;
|
|
133
|
+
onNodeHover?: (nodeId: string | null) => void;
|
|
133
134
|
|
|
134
135
|
// Extension points for private features (implement in consuming app)
|
|
135
136
|
renderOverlay?: (params: { isDark: boolean; containerWidth: number; containerHeight: number }) => React.ReactNode;
|
|
@@ -149,7 +150,7 @@ export interface VisualliCanvasProps {
|
|
|
149
150
|
// ── Component ─────────────────────────────────────────────────────────────────
|
|
150
151
|
|
|
151
152
|
export default function VisualliCanvas(props: VisualliCanvasProps) {
|
|
152
|
-
const { isDark = false, chromaticImmersion = false, onNodeClick, onLayerChange, renderOverlay, renderNodeContent, navigationStackTop = '16px', navigationStackLeft = '16px', className = '', style } = props;
|
|
153
|
+
const { isDark = false, chromaticImmersion = false, onNodeClick, onLayerChange, onNodeHover, renderOverlay, renderNodeContent, navigationStackTop = '16px', navigationStackLeft = '16px', className = '', style } = props;
|
|
153
154
|
|
|
154
155
|
// Read file if provided (handles both File objects and string paths)
|
|
155
156
|
const [fileText, setFileText] = useState<string | undefined>(undefined);
|
|
@@ -746,6 +747,7 @@ export default function VisualliCanvas(props: VisualliCanvasProps) {
|
|
|
746
747
|
if (hovered !== pointerNodeIdRef.current) {
|
|
747
748
|
pointerNodeIdRef.current = hovered;
|
|
748
749
|
setPointerNodeId(hovered);
|
|
750
|
+
onNodeHover?.(hovered);
|
|
749
751
|
}
|
|
750
752
|
if (hovered) {
|
|
751
753
|
stage.container().style.cursor = 'pointer';
|