@neo4j-nvl/react 0.2.13 → 0.2.15

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.
@@ -6,7 +6,7 @@ import type { BasicReactWrapperProps } from '../basic-wrapper/BasicNvlWrapper';
6
6
  * The events that can be passed to the {@link MouseEventCallbacks} object
7
7
  * to turn on/off certain events for the {@link InteractiveNvlWrapper} component.
8
8
  */
9
- export type MouseEvent = 'onHover' | 'onNodeClick' | 'onNodeRightClick' | 'onNodeDoubleClick' | 'onRelationshipClick' | 'onRelationshipDoubleClick' | 'onRelationshipRightClick' | 'onCanvasClick' | 'onCanvasDoubleClick' | 'onCanvasRightClick' | 'onDrag' | 'onDrawEnd' | 'onMultiSelect' | 'onPan' | 'onZoom';
9
+ export type MouseEvent = 'onHover' | 'onNodeClick' | 'onNodeRightClick' | 'onNodeDoubleClick' | 'onRelationshipClick' | 'onRelationshipDoubleClick' | 'onRelationshipRightClick' | 'onCanvasClick' | 'onCanvasDoubleClick' | 'onCanvasRightClick' | 'onDrag' | 'onDragStart' | 'onDragEnd' | 'onDrawEnd' | 'onMultiSelect' | 'onPan' | 'onZoom';
10
10
  export type MouseEventCallbacks = ClickInteractionCallbacks & DragNodeInteractionCallbacks & HoverInteractionCallbacks & PanInteractionCallbacks & ZoomInteractionCallbacks & MultiSelectInteractionCallbacks & DrawInteractionCallbacks;
11
11
  export type InteractionOptions = ClickInteractionOptions & MultiSelectInteractionOptions & HoverInteractionOptions;
12
12
  /**
@@ -69,7 +69,7 @@ const useInteractionEffect = (interaction, interactionRef, callback, eventName,
69
69
  */
70
70
  export const InteractiveNvlWrapper = memo(forwardRef(({ nodes, rels, layout, layoutOptions, mouseEventCallbacks, nvlCallbacks, nvlOptions = {}, interactionOptions = options }, nvlRef) => {
71
71
  const myNvlRef = nvlRef !== null ? nvlRef : useRef(null);
72
- const { onHover, onNodeClick, onNodeDoubleClick, onNodeRightClick, onRelationshipClick, onRelationshipDoubleClick, onRelationshipRightClick, onCanvasClick, onCanvasRightClick, onPan, onZoom, onDrag, onDrawEnd, onMultiSelect } = mouseEventCallbacks;
72
+ const { onHover, onNodeClick, onNodeDoubleClick, onNodeRightClick, onRelationshipClick, onRelationshipDoubleClick, onRelationshipRightClick, onCanvasClick, onCanvasRightClick, onPan, onZoom, onDrag, onDragStart, onDragEnd, onDrawEnd, onMultiSelect } = mouseEventCallbacks;
73
73
  const hoverInteraction = useRef();
74
74
  const clickInteraction = useRef();
75
75
  const panInteraction = useRef();
@@ -89,6 +89,8 @@ export const InteractiveNvlWrapper = memo(forwardRef(({ nodes, rels, layout, lay
89
89
  useInteractionEffect(PanInteraction, panInteraction, onPan, 'onPan', myNvlRef, interactionOptions);
90
90
  useInteractionEffect(ZoomInteraction, zoomInteraction, onZoom, 'onZoom', myNvlRef, interactionOptions);
91
91
  useInteractionEffect(DragNodeInteraction, dragNodeInteraction, onDrag, 'onDrag', myNvlRef, interactionOptions);
92
+ useInteractionEffect(DragNodeInteraction, dragNodeInteraction, onDragStart, 'onDragStart', myNvlRef, interactionOptions);
93
+ useInteractionEffect(DragNodeInteraction, dragNodeInteraction, onDragEnd, 'onDragEnd', myNvlRef, interactionOptions);
92
94
  useInteractionEffect(DrawInteraction, drawInteraction, onDrawEnd, 'onDrawEnd', myNvlRef, interactionOptions);
93
95
  useInteractionEffect(MultiSelectInteraction, multiSelectInteraction, onMultiSelect, 'onMultiSelect', myNvlRef, interactionOptions);
94
96
  useEffect(() => () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neo4j-nvl/react",
3
- "version": "0.2.13",
3
+ "version": "0.2.15",
4
4
  "main": "lib/index.js",
5
5
  "license": "SEE LICENSE IN 'Neo4j Early Access Agreement - Visualization Library.pdf'",
6
6
  "scripts": {