@neo4j-nvl/react 1.1.0-9049c3fd → 1.1.0-af638304
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.
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import NVL, { HierarchicalLayoutType } from '@neo4j-nvl/base';
|
|
3
3
|
import '@testing-library/jest-dom';
|
|
4
4
|
import { render } from '@testing-library/react';
|
|
5
|
-
import
|
|
5
|
+
import { StrictMode } from 'react';
|
|
6
6
|
import { BasicNvlWrapper } from '../basic-wrapper/BasicNvlWrapper';
|
|
7
7
|
jest.mock('@neo4j-nvl/base');
|
|
8
8
|
jest.mock('@neo4j-nvl/layout-workers');
|
|
@@ -43,7 +43,7 @@ describe('BasicNvlWrapper', () => {
|
|
|
43
43
|
test('successfully re-initialises NVL when using React StrictMode', () => {
|
|
44
44
|
const destroy = jest.fn();
|
|
45
45
|
jest.spyOn(NVL.prototype, 'destroy').mockImplementation(destroy);
|
|
46
|
-
render(_jsx(
|
|
46
|
+
render(_jsx(StrictMode, { children: _jsx("div", { children: _jsx(BasicNvlWrapper, { nodes: [], rels: [] }) }) }));
|
|
47
47
|
expect(NVL).toHaveBeenCalledTimes(2);
|
|
48
48
|
expect(destroy).toHaveBeenCalledTimes(1);
|
|
49
49
|
});
|
|
@@ -3,7 +3,7 @@ import NVL, { HierarchicalLayoutType } from '@neo4j-nvl/base';
|
|
|
3
3
|
import { BoxSelectInteraction, ClickInteraction, DragNodeInteraction, DrawInteraction, HoverInteraction, KeyboardInteraction, LassoInteraction, PanInteraction, ZoomInteraction } from '@neo4j-nvl/interaction-handlers';
|
|
4
4
|
import '@testing-library/jest-dom';
|
|
5
5
|
import { render } from '@testing-library/react';
|
|
6
|
-
import
|
|
6
|
+
import { StrictMode, act, createRef } from 'react';
|
|
7
7
|
import { InteractiveNvlWrapper } from '../interactive-nvl-wrapper/InteractiveNvlWrapper';
|
|
8
8
|
jest.mock('@neo4j-nvl/base');
|
|
9
9
|
jest.mock('@neo4j-nvl/layout-workers');
|
|
@@ -328,7 +328,7 @@ describe('InteractiveNvlWrapper', () => {
|
|
|
328
328
|
});
|
|
329
329
|
test('successfully re-initialises NVL and active interaction handlers when using React StrictMode', () => {
|
|
330
330
|
const myNvlRef = createRef();
|
|
331
|
-
render(_jsx(
|
|
331
|
+
render(_jsx(StrictMode, { children: _jsx(InteractiveNvlWrapper, { nodes: [], rels: [], ref: myNvlRef, mouseEventCallbacks: {
|
|
332
332
|
onHover: true
|
|
333
333
|
}, interactionOptions: {
|
|
334
334
|
drawShadowOnHover: true
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type NVL from '@neo4j-nvl/base';
|
|
2
2
|
import type { HTMLProps } from 'react';
|
|
3
|
-
import React from 'react';
|
|
4
3
|
import type { InteractiveNvlWrapperProps } from './types';
|
|
5
4
|
/**
|
|
6
5
|
* The interactive React wrapper component contains a collection of interaction handlers by default
|
|
@@ -13,4 +12,4 @@ import type { InteractiveNvlWrapperProps } from './types';
|
|
|
13
12
|
*
|
|
14
13
|
* For examples, head to the {@link https://neo4j.com/docs/nvl/current/react-wrappers/#_interactive_reactive_wrapperr Interactive React wrapper documentation page}.
|
|
15
14
|
*/
|
|
16
|
-
export declare const InteractiveNvlWrapper:
|
|
15
|
+
export declare const InteractiveNvlWrapper: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<InteractiveNvlWrapperProps & HTMLProps<HTMLDivElement>, "ref"> & import("react").RefAttributes<NVL>>>;
|
package/lib/utils/constants.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const BASIC_WRAPPER_ID
|
|
2
|
-
export const INTERACTIVE_WRAPPER_ID
|
|
1
|
+
export declare const BASIC_WRAPPER_ID = "NVL_basic-wrapper";
|
|
2
|
+
export declare const INTERACTIVE_WRAPPER_ID = "NVL_interactive-wrapper";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j-nvl/react",
|
|
3
|
-
"version": "1.1.0-
|
|
3
|
+
"version": "1.1.0-af638304",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"homepage": "https://neo4j.com/docs/nvl/current/",
|
|
6
6
|
"license": "SEE LICENSE IN 'LICENSE.txt'",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"react-dom": "19.2.1"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@neo4j-nvl/base": "1.1.0-
|
|
40
|
-
"@neo4j-nvl/interaction-handlers": "1.1.0-
|
|
39
|
+
"@neo4j-nvl/base": "1.1.0-af638304",
|
|
40
|
+
"@neo4j-nvl/interaction-handlers": "1.1.0-af638304",
|
|
41
41
|
"lodash": "4.18.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|